@yimingliao/cms 0.0.144 → 0.0.146
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/index.js +1 -73
- package/dist/export/client/pages/index.js +8 -0
- package/dist/src/client/interfaces/components/shadcn/sidebar.js +1 -1
- package/dist/src/client/interfaces/styles/constants.js +1 -3
- package/dist/types/export/client/components/index.d.ts +2 -0
- package/dist/types/export/client/components/index.d.ts.map +1 -0
- package/dist/types/export/client/index.d.ts +1 -1
- package/dist/types/export/client/index.d.ts.map +1 -1
- package/dist/types/export/client/pages/index.d.ts +2 -0
- package/dist/types/export/client/pages/index.d.ts.map +1 -0
- package/dist/types/src/client/index.d.ts +1 -1
- package/dist/types/src/client/index.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/index.d.ts +0 -2
- package/dist/types/src/client/interfaces/index.d.ts.map +1 -1
- package/package.json +11 -1
- package/dist/src/client/applications/ui/use-parent-pathname.js +0 -10
- package/dist/src/client/interfaces/components/admin-initializer.js +0 -29
- package/dist/src/client/interfaces/components/resources/file/file-card.js +0 -87
- package/dist/src/client/interfaces/components/resources/file/file-list.js +0 -159
- package/dist/src/client/interfaces/components/resources/file/is-locked-buttons.js +0 -71
- package/dist/src/client/interfaces/components/resources/file/type-buttons.js +0 -62
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/list-cards-container.js +0 -96
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/page-size-selector.js +0 -63
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/pagination.js +0 -94
- package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header-title.js +0 -26
- package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header.js +0 -74
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch-create.js +0 -33
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch.js +0 -39
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/create.js +0 -33
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/edit.js +0 -33
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/index.js +0 -48
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/show.js +0 -61
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/trash.js +0 -39
- package/dist/src/client/interfaces/components/ui/buttons/return-button.js +0 -61
- package/dist/src/client/interfaces/components/ui/cards/action-buttons-card.js +0 -82
- package/dist/src/client/interfaces/components/ui/cards/resource-card/card-status-bar.js +0 -51
- package/dist/src/client/interfaces/components/ui/cards/resource-card/card-text-content.js +0 -38
- package/dist/src/client/interfaces/components/ui/cards/resource-card/resource-card.js +0 -77
- package/dist/src/client/interfaces/components/ui/display/array-list.js +0 -69
- package/dist/src/client/interfaces/components/ui/display/badge.js +0 -41
- package/dist/src/client/interfaces/components/ui/display/html-display.js +0 -32
- package/dist/src/client/interfaces/components/ui/display/object-array-list.js +0 -75
- package/dist/src/client/interfaces/components/ui/features/accordion/accordion-container.js +0 -31
- package/dist/src/client/interfaces/components/ui/features/accordion/accordion-header.js +0 -34
- package/dist/src/client/interfaces/components/ui/features/accordion/accordion.js +0 -81
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expand-bar.js +0 -39
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list-content.js +0 -49
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list.js +0 -53
- package/dist/src/client/interfaces/components/ui/features/external-link.js +0 -15
- package/dist/src/client/interfaces/components/ui/features/file/file-info/file-info.js +0 -118
- package/dist/src/client/interfaces/components/ui/features/file/file-info/file-name.js +0 -48
- package/dist/src/client/interfaces/components/ui/features/file/file-picker/file-picker-container.js +0 -74
- package/dist/src/client/interfaces/components/ui/features/file/file-picker/file-picker-placeholder.js +0 -48
- package/dist/src/client/interfaces/components/ui/features/file/file-picker/file-picker.js +0 -109
- package/dist/src/client/interfaces/components/ui/features/file/file-preview/file-preview-list.js +0 -85
- package/dist/src/client/interfaces/components/ui/features/file/file-preview/file-preview-meta.js +0 -40
- package/dist/src/client/interfaces/components/ui/features/file/file-preview/file-preview.js +0 -113
- package/dist/src/client/interfaces/components/ui/features/file/uploader.js +0 -101
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal-body.js +0 -112
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal-trigger.js +0 -97
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal.js +0 -77
- package/dist/src/client/interfaces/components/ui/features/smart-image.js +0 -57
- package/dist/src/client/interfaces/components/ui/features/tick.js +0 -27
- package/dist/src/client/interfaces/components/ui/form/containers/fields-container.js +0 -24
- package/dist/src/client/interfaces/components/ui/form/containers/main-fields.js +0 -25
- package/dist/src/client/interfaces/components/ui/form/containers/side-fields.js +0 -24
- package/dist/src/client/interfaces/components/ui/form/control-fields/built-in-fields.js +0 -9
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields-display.js +0 -112
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields-input.js +0 -158
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields.js +0 -59
- package/dist/src/client/interfaces/components/ui/form/field-body.js +0 -79
- package/dist/src/client/interfaces/components/ui/form/index-field.js +0 -87
- package/dist/src/client/interfaces/components/ui/form/slug-field.js +0 -82
- package/dist/src/client/interfaces/components/ui/inputs/array-input.js +0 -110
- package/dist/src/client/interfaces/components/ui/inputs/checkbox.js +0 -93
- package/dist/src/client/interfaces/components/ui/inputs/editor/base/base-editor.js +0 -143
- package/dist/src/client/interfaces/components/ui/inputs/editor/base/built-in-plugins.js +0 -71
- package/dist/src/client/interfaces/components/ui/inputs/editor/base/configs/heading.config.js +0 -41
- package/dist/src/client/interfaces/components/ui/inputs/editor/base/configs/image.config.js +0 -32
- package/dist/src/client/interfaces/components/ui/inputs/editor/base/configs/table.config.js +0 -15
- package/dist/src/client/interfaces/components/ui/inputs/editor/editor.js +0 -112
- package/dist/src/client/interfaces/components/ui/inputs/editor/plugins/asset-manager/asset-manager.js +0 -24
- package/dist/src/client/interfaces/components/ui/inputs/editor/plugins/asset-manager/use-control-asset-mamager.js +0 -26
- package/dist/src/client/interfaces/components/ui/inputs/editor/plugins/file-repository/upload-adapter.js +0 -84
- package/dist/src/client/interfaces/components/ui/inputs/editor/plugins/word-count-display/icons.js +0 -17
- package/dist/src/client/interfaces/components/ui/inputs/editor/plugins/word-count-display/word-count-display.js +0 -81
- package/dist/src/client/interfaces/components/ui/inputs/editor/use-init-editor/use-init-editor.js +0 -50
- package/dist/src/client/interfaces/components/ui/inputs/search-input.js +0 -61
- package/dist/src/client/interfaces/components/ui/inputs/select.js +0 -69
- package/dist/src/client/interfaces/components/ui/inputs/textarea.js +0 -62
- package/dist/src/client/interfaces/components/ui/layouts/content-container.js +0 -38
- package/dist/src/client/interfaces/components/ui/layouts/navbar/i18n-selector.js +0 -42
- package/dist/src/client/interfaces/components/ui/layouts/navbar/nav-user.js +0 -106
- package/dist/src/client/interfaces/components/ui/layouts/navbar/navbar.js +0 -84
- package/dist/src/client/interfaces/components/ui/layouts/navbar/sign-out-button.js +0 -58
- package/dist/src/client/interfaces/components/ui/layouts/navbar/theme-selector.js +0 -51
- package/dist/src/client/interfaces/components/ui/layouts/sidebar/nav-main.js +0 -99
- package/dist/src/constants/file.js +0 -27
- package/dist/src/shared/list-items.js +0 -3
- package/dist/src/shared/utils/debounce.js +0 -14
|
@@ -8,53 +8,7 @@ export { createMultiFilesUploadApi } from '../../src/client/infrastructure/inter
|
|
|
8
8
|
export { createUseCommand } from '../../src/client/infrastructure/react-query/create-use-command.js';
|
|
9
9
|
export { createUseQuery } from '../../src/client/infrastructure/react-query/create-use-query.js';
|
|
10
10
|
export { handleToast } from '../../src/client/infrastructure/toast/handle-toast.js';
|
|
11
|
-
export {
|
|
12
|
-
export { PageHeader } from '../../src/client/interfaces/components/ui/blocks/page-header/page-header.js';
|
|
13
|
-
export { ListCardsContainer } from '../../src/client/interfaces/components/ui/blocks/list-cards-container/list-cards-container.js';
|
|
14
|
-
export { Button } from '../../src/client/interfaces/components/ui/buttons/button.js';
|
|
15
|
-
export { ReturnButton } from '../../src/client/interfaces/components/ui/buttons/return-button.js';
|
|
16
|
-
export { ResourceCard } from '../../src/client/interfaces/components/ui/cards/resource-card/resource-card.js';
|
|
17
|
-
export { ActionButtonsCard } from '../../src/client/interfaces/components/ui/cards/action-buttons-card.js';
|
|
18
|
-
export { ArrayList } from '../../src/client/interfaces/components/ui/display/array-list.js';
|
|
19
|
-
export { Badge } from '../../src/client/interfaces/components/ui/display/badge.js';
|
|
20
|
-
export { HtmlDisplay } from '../../src/client/interfaces/components/ui/display/html-display.js';
|
|
21
|
-
export { ObjectArrayList } from '../../src/client/interfaces/components/ui/display/object-array-list.js';
|
|
22
|
-
export { Accordion } from '../../src/client/interfaces/components/ui/features/accordion/accordion.js';
|
|
23
|
-
export { AccordionContainer } from '../../src/client/interfaces/components/ui/features/accordion/accordion-container.js';
|
|
24
|
-
export { ExpandableList } from '../../src/client/interfaces/components/ui/features/expandable-list/expandable-list.js';
|
|
25
|
-
export { createFileInfo } from '../../src/client/interfaces/components/ui/features/file/file-info/file-info.js';
|
|
26
|
-
export { createFilePreview } from '../../src/client/interfaces/components/ui/features/file/file-preview/file-preview.js';
|
|
27
|
-
export { createFilePreviewList } from '../../src/client/interfaces/components/ui/features/file/file-preview/file-preview-list.js';
|
|
28
|
-
export { createFilePicker } from '../../src/client/interfaces/components/ui/features/file/file-picker/file-picker.js';
|
|
29
|
-
export { createUploader } from '../../src/client/interfaces/components/ui/features/file/uploader.js';
|
|
30
|
-
export { PickModal } from '../../src/client/interfaces/components/ui/features/pick-modal/pick-modal.js';
|
|
31
|
-
export { ExternalLink } from '../../src/client/interfaces/components/ui/features/external-link.js';
|
|
32
|
-
export { createSmartImage } from '../../src/client/interfaces/components/ui/features/smart-image.js';
|
|
33
|
-
export { Tick } from '../../src/client/interfaces/components/ui/features/tick.js';
|
|
34
|
-
export { Form } from '../../src/client/interfaces/components/ui/form/form.js';
|
|
35
|
-
export { Field } from '../../src/client/interfaces/components/ui/form/field.js';
|
|
36
|
-
export { FieldBody } from '../../src/client/interfaces/components/ui/form/field-body.js';
|
|
37
|
-
export { FieldsContainer } from '../../src/client/interfaces/components/ui/form/containers/fields-container.js';
|
|
38
|
-
export { MainFields } from '../../src/client/interfaces/components/ui/form/containers/main-fields.js';
|
|
39
|
-
export { SideFields } from '../../src/client/interfaces/components/ui/form/containers/side-fields.js';
|
|
40
|
-
export { IndexField } from '../../src/client/interfaces/components/ui/form/index-field.js';
|
|
41
|
-
export { SlugField } from '../../src/client/interfaces/components/ui/form/slug-field.js';
|
|
42
|
-
export { ControlFields } from '../../src/client/interfaces/components/ui/form/control-fields/control-fields.js';
|
|
43
|
-
export { createEditor } from '../../src/client/interfaces/components/ui/inputs/editor/editor.js';
|
|
44
|
-
export { createUploadAdapter } from '../../src/client/interfaces/components/ui/inputs/editor/plugins/file-repository/upload-adapter.js';
|
|
45
|
-
export { ArrayInput } from '../../src/client/interfaces/components/ui/inputs/array-input.js';
|
|
46
|
-
export { Checkbox } from '../../src/client/interfaces/components/ui/inputs/checkbox.js';
|
|
47
|
-
export { Input } from '../../src/client/interfaces/components/ui/inputs/input.js';
|
|
48
|
-
export { PasswordInput } from '../../src/client/interfaces/components/ui/inputs/password-input.js';
|
|
49
|
-
export { SearchInput } from '../../src/client/interfaces/components/ui/inputs/search-input.js';
|
|
50
|
-
export { Option, Select } from '../../src/client/interfaces/components/ui/inputs/select.js';
|
|
51
|
-
export { Textarea } from '../../src/client/interfaces/components/ui/inputs/textarea.js';
|
|
52
|
-
export { ContentContainer } from '../../src/client/interfaces/components/ui/layouts/content-container.js';
|
|
53
|
-
export { DashboardSkeleton } from '../../src/client/interfaces/components/ui/layouts/dashboard-skeleton.js';
|
|
54
|
-
export { AuthSkeleton } from '../../src/client/interfaces/components/ui/layouts/auth-skeleton.js';
|
|
55
|
-
export { NavMain } from '../../src/client/interfaces/components/ui/layouts/sidebar/nav-main.js';
|
|
56
|
-
import 'react/jsx-runtime';
|
|
57
|
-
import '@radix-ui/react-avatar';
|
|
11
|
+
export { NAVBAR_HEIGHT, PAGE_HEADER_HEIGHT, SIDEBAR_WIDTH } from '../../src/client/interfaces/styles/constants.js';
|
|
58
12
|
export { useDeviceInfo } from '../../src/client/applications/auth/sign-in/use-device-info.js';
|
|
59
13
|
export { usePickItems } from '../../src/client/applications/form/use-pick-items.js';
|
|
60
14
|
export { getControlMeta } from '../../src/client/applications/form/get-control-meta.js';
|
|
@@ -62,29 +16,3 @@ export { cn } from '../../src/client/applications/shadcn/utils.js';
|
|
|
62
16
|
import 'react';
|
|
63
17
|
import 'next/navigation';
|
|
64
18
|
export { isConfirm } from '../../src/client/applications/ui/is-confirm.js';
|
|
65
|
-
import '../../src/client/interfaces/components/shadcn/badge.js';
|
|
66
|
-
import '../../src/client/interfaces/components/shadcn/button.js';
|
|
67
|
-
import '@radix-ui/react-collapsible';
|
|
68
|
-
import '@radix-ui/react-dialog';
|
|
69
|
-
import 'lucide-react';
|
|
70
|
-
import '@radix-ui/react-dropdown-menu';
|
|
71
|
-
import '../../src/client/interfaces/components/shadcn/input-group.js';
|
|
72
|
-
import '@radix-ui/react-label';
|
|
73
|
-
import '@radix-ui/react-select';
|
|
74
|
-
import '@radix-ui/react-separator';
|
|
75
|
-
export { Sidebar, SidebarContent, SidebarInset, SidebarProvider, useSidebar } from '../../src/client/interfaces/components/shadcn/sidebar.js';
|
|
76
|
-
import '@radix-ui/react-tooltip';
|
|
77
|
-
export { createNavbar } from '../../src/client/interfaces/components/ui/layouts/navbar/navbar.js';
|
|
78
|
-
export { createI18nSelector } from '../../src/client/interfaces/components/ui/layouts/navbar/i18n-selector.js';
|
|
79
|
-
export { createSignOutButton } from '../../src/client/interfaces/components/ui/layouts/navbar/sign-out-button.js';
|
|
80
|
-
export { createFileCard } from '../../src/client/interfaces/components/resources/file/file-card.js';
|
|
81
|
-
export { createFileList } from '../../src/client/interfaces/components/resources/file/file-list.js';
|
|
82
|
-
export { createSignInPage } from '../../src/client/interfaces/pages/auth/sign-in/page.js';
|
|
83
|
-
export { createVerifyEmailPage } from '../../src/client/interfaces/pages/auth/verify-email/page.js';
|
|
84
|
-
export { createEmailUnverifiedPage } from '../../src/client/interfaces/pages/auth/email-unverified/page.js';
|
|
85
|
-
export { createForgotPasswordPage } from '../../src/client/interfaces/pages/auth/forgot-password/page.js';
|
|
86
|
-
export { createResetPasswordPage } from '../../src/client/interfaces/pages/auth/reset-password/page.js';
|
|
87
|
-
export { createChangePasswordPage } from '../../src/client/interfaces/pages/auth/change-password/page.js';
|
|
88
|
-
export { createAuthLayout } from '../../src/client/interfaces/pages/auth/layout.js';
|
|
89
|
-
export { createDashboardLayout } from '../../src/client/interfaces/pages/dashboard/layout.js';
|
|
90
|
-
export { NAVBAR_HEIGHT, PAGE_HEADER_HEIGHT, SIDEBAR_WIDTH } from '../../src/client/interfaces/styles/constants.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createSignInPage } from '../../../src/client/interfaces/pages/auth/sign-in/page.js';
|
|
2
|
+
export { createVerifyEmailPage } from '../../../src/client/interfaces/pages/auth/verify-email/page.js';
|
|
3
|
+
export { createEmailUnverifiedPage } from '../../../src/client/interfaces/pages/auth/email-unverified/page.js';
|
|
4
|
+
export { createForgotPasswordPage } from '../../../src/client/interfaces/pages/auth/forgot-password/page.js';
|
|
5
|
+
export { createResetPasswordPage } from '../../../src/client/interfaces/pages/auth/reset-password/page.js';
|
|
6
|
+
export { createChangePasswordPage } from '../../../src/client/interfaces/pages/auth/change-password/page.js';
|
|
7
|
+
export { createAuthLayout } from '../../../src/client/interfaces/pages/auth/layout.js';
|
|
8
|
+
export { createDashboardLayout } from '../../../src/client/interfaces/pages/dashboard/layout.js';
|
|
@@ -14,7 +14,7 @@ import { Input } from './input.js';
|
|
|
14
14
|
import { Separator } from './separator.js';
|
|
15
15
|
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetDescription } from './sheet.js';
|
|
16
16
|
import { Skeleton } from './skeleton.js';
|
|
17
|
-
import {
|
|
17
|
+
import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './tooltip.js';
|
|
18
18
|
|
|
19
19
|
const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
20
20
|
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
const NAVBAR_HEIGHT = 60;
|
|
2
2
|
const SIDEBAR_WIDTH = 288;
|
|
3
3
|
const PAGE_HEADER_HEIGHT = 56;
|
|
4
|
-
const FORM_SIDE_FIELDS_WIDTH = 320;
|
|
5
|
-
const FORM_MIDDLE_GAP_WIDTH = 24;
|
|
6
4
|
|
|
7
|
-
export {
|
|
5
|
+
export { NAVBAR_HEIGHT, PAGE_HEADER_HEIGHT, SIDEBAR_WIDTH };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { createAdminInitializer, PageHeader, ListCardsContainer, Button, type ButtonProps, ReturnButton, ActionButtonsCard, ResourceCard, ArrayList, Badge, HtmlDisplay, ObjectArrayList, Accordion, AccordionContainer, ExpandableList, createFileInfo, createFilePicker, createFilePreview, createFilePreviewList, createUploader, ExternalLink, PickModal, createSmartImage, Tick, Form, Field, FieldBody, FieldsContainer, MainFields, SideFields, IndexField, SlugField, ControlFields, type ControlMeta, createEditor, createUploadAdapter, ArrayInput, Checkbox, Input, type InputProps, PasswordInput, SearchInput, Select, Option, Textarea, ContentContainer, DashboardSkeleton, AuthSkeleton, type NavItem, NavMain, SidebarProvider, Sidebar, SidebarInset, SidebarContent, useSidebar, createNavbar, createI18nSelector, createSignOutButton, createFileCard, createFileList, } from "../../../src/client/interfaces/components";
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../export/client/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAGtB,UAAU,EACV,kBAAkB,EAGlB,MAAM,EACN,KAAK,WAAW,EAChB,YAAY,EAGZ,iBAAiB,EACjB,YAAY,EAGZ,SAAS,EACT,KAAK,EACL,WAAW,EACX,eAAe,EAGf,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,IAAI,EAGJ,IAAI,EACJ,KAAK,EACL,SAAS,EACT,eAAe,EACf,UAAU,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,aAAa,EACb,KAAK,WAAW,EAGhB,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,KAAK,EACL,KAAK,UAAU,EACf,aAAa,EACb,WAAW,EACX,MAAM,EACN,MAAM,EACN,QAAQ,EAGR,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,KAAK,OAAO,EACZ,OAAO,EACP,eAAe,EACf,OAAO,EACP,YAAY,EACZ,cAAc,EACd,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EAGnB,cAAc,EACd,cAAc,GACf,MAAM,2CAA2C,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AdminProvider, useAdmin, ThemeProvider, createSmartFetch, createRequestInterceptor, createResponseInterceptor, createFileUploadApi, createMultiFilesUploadApi, createUseCommand, createUseQuery, handleToast, type ShowToastOption,
|
|
1
|
+
export { AdminProvider, useAdmin, ThemeProvider, createSmartFetch, createRequestInterceptor, createResponseInterceptor, createFileUploadApi, createMultiFilesUploadApi, createUseCommand, createUseQuery, handleToast, type ShowToastOption, NAVBAR_HEIGHT, SIDEBAR_WIDTH, PAGE_HEADER_HEIGHT, cn, useDeviceInfo, getControlMeta, usePickItems, isConfirm, } from "../../src/client";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../export/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,aAAa,EACb,QAAQ,EACR,aAAa,EAEb,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EAEzB,mBAAmB,EACnB,yBAAyB,EAEzB,gBAAgB,EAChB,cAAc,EAEd,WAAW,EACX,KAAK,eAAe,EAMpB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../export/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,aAAa,EACb,QAAQ,EACR,aAAa,EAEb,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EAEzB,mBAAmB,EACnB,yBAAyB,EAEzB,gBAAgB,EAChB,cAAc,EAEd,WAAW,EACX,KAAK,eAAe,EAMpB,aAAa,EACb,aAAa,EACb,kBAAkB,EAKlB,EAAE,EACF,aAAa,EACb,cAAc,EACd,YAAY,EACZ,SAAS,GACV,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { createSignInPage, createVerifyEmailPage, createEmailUnverifiedPage, createForgotPasswordPage, createResetPasswordPage, createChangePasswordPage, createAuthLayout, createDashboardLayout, } from "../../../src/client/interfaces/pages";
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../export/client/pages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,sCAAsC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { AdminProvider, useAdmin, ThemeProvider, createSmartFetch, createRequestInterceptor, createResponseInterceptor, createFileUploadApi, createMultiFilesUploadApi, createUseCommand, createUseQuery, handleToast, type ShowToastOption, } from "./infrastructure";
|
|
2
|
-
export {
|
|
2
|
+
export { NAVBAR_HEIGHT, SIDEBAR_WIDTH, PAGE_HEADER_HEIGHT, } from "./interfaces";
|
|
3
3
|
export { cn, useDeviceInfo, getControlMeta, usePickItems, isConfirm, } from "./applications";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,aAAa,EACb,QAAQ,EACR,aAAa,EAEb,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EAEzB,mBAAmB,EACnB,yBAAyB,EAEzB,gBAAgB,EAChB,cAAc,EAEd,WAAW,EACX,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EAEL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,aAAa,EACb,QAAQ,EACR,aAAa,EAEb,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EAEzB,mBAAmB,EACnB,yBAAyB,EAEzB,gBAAgB,EAChB,cAAc,EAEd,WAAW,EACX,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EAEL,aAAa,EACb,aAAa,EACb,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAKtB,OAAO,EACL,EAAE,EACF,aAAa,EACb,cAAc,EACd,YAAY,EACZ,SAAS,GACV,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export { createAdminInitializer, PageHeader, ListCardsContainer, Button, type ButtonProps, ReturnButton, ActionButtonsCard, ResourceCard, ArrayList, Badge, HtmlDisplay, ObjectArrayList, Accordion, AccordionContainer, ExpandableList, createFileInfo, createFilePicker, createFilePreview, createFilePreviewList, createUploader, ExternalLink, PickModal, createSmartImage, Tick, Form, Field, FieldBody, FieldsContainer, MainFields, SideFields, IndexField, SlugField, ControlFields, type ControlMeta, createEditor, createUploadAdapter, ArrayInput, Checkbox, Input, type InputProps, PasswordInput, SearchInput, Select, Option, Textarea, ContentContainer, DashboardSkeleton, AuthSkeleton, type NavItem, NavMain, SidebarProvider, Sidebar, SidebarInset, SidebarContent, useSidebar, createNavbar, createI18nSelector, createSignOutButton, createFileCard, createFileList, } from "./components";
|
|
2
|
-
export { createSignInPage, createVerifyEmailPage, createEmailUnverifiedPage, createForgotPasswordPage, createResetPasswordPage, createChangePasswordPage, createAuthLayout, createDashboardLayout, } from "./pages";
|
|
3
1
|
export { NAVBAR_HEIGHT, SIDEBAR_WIDTH, PAGE_HEADER_HEIGHT } from "./styles";
|
|
4
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/interfaces/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/interfaces/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yimingliao/cms",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.146",
|
|
4
4
|
"author": "Yiming Liao",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -18,6 +18,16 @@
|
|
|
18
18
|
"import": "./dist/export/client/index.js",
|
|
19
19
|
"require": "./dist/export/client/index.js"
|
|
20
20
|
},
|
|
21
|
+
"./client/components": {
|
|
22
|
+
"types": "./dist/types/export/client/components/index.d.ts",
|
|
23
|
+
"import": "./dist/export/client/components/index.js",
|
|
24
|
+
"require": "./dist/export/client/components/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./client/pages": {
|
|
27
|
+
"types": "./dist/types/export/client/pages/index.d.ts",
|
|
28
|
+
"import": "./dist/export/client/pages/index.js",
|
|
29
|
+
"require": "./dist/export/client/pages/index.js"
|
|
30
|
+
},
|
|
21
31
|
"./client/shadcn": {
|
|
22
32
|
"types": "./dist/types/export/client/shadcn/index.d.ts",
|
|
23
33
|
"import": "./dist/export/client/shadcn/index.js",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { usePathname } from 'next/navigation';
|
|
2
|
-
|
|
3
|
-
const useParentPathname = () => {
|
|
4
|
-
const pathname = usePathname();
|
|
5
|
-
if (pathname === "/") return "/";
|
|
6
|
-
const index = pathname.lastIndexOf("/");
|
|
7
|
-
return index <= 0 ? "/" : pathname.slice(0, index);
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export { useParentPathname };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import { VERIFY_CACHE_KEY } from '../../constants.js';
|
|
4
|
-
|
|
5
|
-
function createAdminInitializer({
|
|
6
|
-
useAdmin,
|
|
7
|
-
useQuery,
|
|
8
|
-
verifyAction
|
|
9
|
-
}) {
|
|
10
|
-
return function AdminInitializer() {
|
|
11
|
-
const { admin: globalAdmin, setAdmin, setIsLoading } = useAdmin();
|
|
12
|
-
const { data: admin, isFetching } = useQuery(
|
|
13
|
-
verifyAction,
|
|
14
|
-
[VERIFY_CACHE_KEY],
|
|
15
|
-
{
|
|
16
|
-
select: (data) => data?.admin,
|
|
17
|
-
enabled: !globalAdmin
|
|
18
|
-
}
|
|
19
|
-
);
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (isFetching) return;
|
|
22
|
-
if (admin) setAdmin(admin);
|
|
23
|
-
setIsLoading(false);
|
|
24
|
-
}, [isFetching, admin, setAdmin, setIsLoading]);
|
|
25
|
-
return null;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { createAdminInitializer };
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { useTranslator } from 'intor/react';
|
|
4
|
-
import { Lock, Trash2 } from 'lucide-react';
|
|
5
|
-
import { PATHS } from '../../../../../constants/paths/index.js';
|
|
6
|
-
import '../../../../../constants/redirect-paths.js';
|
|
7
|
-
import '../../../../../domain/resources/admin/constants.js';
|
|
8
|
-
import { isFileLocked } from '../../../../../domain/resources/file/utils/is-file-locked.js';
|
|
9
|
-
import 'mime-types';
|
|
10
|
-
import { findTranslation } from '../../../../../shared/translation/find-translation.js';
|
|
11
|
-
import { joinUrl } from '../../../../../shared/utils/join-url.js';
|
|
12
|
-
import 'react';
|
|
13
|
-
import 'ua-parser-js';
|
|
14
|
-
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
15
|
-
import 'next/navigation';
|
|
16
|
-
import '@radix-ui/react-avatar';
|
|
17
|
-
import '../../shadcn/badge.js';
|
|
18
|
-
import '../../shadcn/button.js';
|
|
19
|
-
import '@radix-ui/react-collapsible';
|
|
20
|
-
import '@radix-ui/react-dialog';
|
|
21
|
-
import '@radix-ui/react-dropdown-menu';
|
|
22
|
-
import '../../shadcn/input-group.js';
|
|
23
|
-
import '@radix-ui/react-label';
|
|
24
|
-
import '@radix-ui/react-select';
|
|
25
|
-
import '@radix-ui/react-separator';
|
|
26
|
-
import '../../shadcn/sidebar.js';
|
|
27
|
-
import '@radix-ui/react-tooltip';
|
|
28
|
-
import 'next/link';
|
|
29
|
-
import { ResourceCard } from '../../ui/cards/resource-card/resource-card.js';
|
|
30
|
-
import 'next/image';
|
|
31
|
-
import 'ckeditor5';
|
|
32
|
-
import 'ckeditor5/translations/en.js';
|
|
33
|
-
import 'ckeditor5/translations/zh.js';
|
|
34
|
-
import 'sonner';
|
|
35
|
-
import '../../../../infrastructure/contexts/admin.js';
|
|
36
|
-
import 'next-themes';
|
|
37
|
-
import '@tanstack/react-query';
|
|
38
|
-
import 'intor/next';
|
|
39
|
-
|
|
40
|
-
const WIDTH = 160;
|
|
41
|
-
const HEIGHT = 160;
|
|
42
|
-
function createFileCard({
|
|
43
|
-
SmartImage,
|
|
44
|
-
storageUrl
|
|
45
|
-
}) {
|
|
46
|
-
return function FileCard({
|
|
47
|
-
file,
|
|
48
|
-
// link
|
|
49
|
-
openNewTab = false,
|
|
50
|
-
anchorProps,
|
|
51
|
-
// base
|
|
52
|
-
className = ""
|
|
53
|
-
}) {
|
|
54
|
-
const { locale } = useTranslator();
|
|
55
|
-
const isImage = file?.type === "IMAGE";
|
|
56
|
-
const isVideo = file?.type === "VIDEO";
|
|
57
|
-
const isLocked = isFileLocked(file);
|
|
58
|
-
const isTrash = file?.deletedAt;
|
|
59
|
-
const translation = findTranslation(file?.translations, locale);
|
|
60
|
-
return /* @__PURE__ */ jsx(
|
|
61
|
-
ResourceCard,
|
|
62
|
-
{
|
|
63
|
-
className,
|
|
64
|
-
style: { width: `${WIDTH}px`, height: `${HEIGHT}px` },
|
|
65
|
-
href: `${PATHS.resources.file.path}/${file?.id}`,
|
|
66
|
-
openNewTab,
|
|
67
|
-
anchorProps,
|
|
68
|
-
cardStatusBarProps: {
|
|
69
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex w-full justify-between", children: [
|
|
70
|
-
isLocked && /* @__PURE__ */ jsx(Lock, { className: "size-5" }),
|
|
71
|
-
isTrash && /* @__PURE__ */ jsx(Trash2, { className: "text-error size-5" })
|
|
72
|
-
] })
|
|
73
|
-
},
|
|
74
|
-
cardTextContentProps: { title: translation?.name },
|
|
75
|
-
children: /* @__PURE__ */ jsx(
|
|
76
|
-
"div",
|
|
77
|
-
{
|
|
78
|
-
className: cn("flex-center flex-1", "overflow-hidden", "transition"),
|
|
79
|
-
children: isImage ? /* @__PURE__ */ jsx(SmartImage, { fileKey: file.key, width: WIDTH, height: HEIGHT }) : isVideo ? /* @__PURE__ */ jsx("video", { src: joinUrl(storageUrl, file.key), autoPlay: true, loop: true, muted: true }) : /* @__PURE__ */ jsx("span", { className: cn("scale-[3]", "transition"), children: "\u{1F4C4}" })
|
|
80
|
-
}
|
|
81
|
-
)
|
|
82
|
-
}
|
|
83
|
-
);
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export { createFileCard };
|
|
@@ -1,159 +0,0 @@
|
|
|
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 '@radix-ui/react-avatar';
|
|
17
|
-
import '../../shadcn/badge.js';
|
|
18
|
-
import '../../shadcn/button.js';
|
|
19
|
-
import '@radix-ui/react-collapsible';
|
|
20
|
-
import '@radix-ui/react-dialog';
|
|
21
|
-
import 'lucide-react';
|
|
22
|
-
import '@radix-ui/react-dropdown-menu';
|
|
23
|
-
import '../../shadcn/input-group.js';
|
|
24
|
-
import '@radix-ui/react-label';
|
|
25
|
-
import '@radix-ui/react-select';
|
|
26
|
-
import { Separator } from '../../shadcn/separator.js';
|
|
27
|
-
import '../../shadcn/sidebar.js';
|
|
28
|
-
import '@radix-ui/react-tooltip';
|
|
29
|
-
import 'intor/react';
|
|
30
|
-
import { ListCardsContainer } from '../../ui/blocks/list-cards-container/list-cards-container.js';
|
|
31
|
-
import 'next/link';
|
|
32
|
-
import '../../../../../domain/resources/admin/constants.js';
|
|
33
|
-
import 'next/image';
|
|
34
|
-
import { Tick } from '../../ui/features/tick.js';
|
|
35
|
-
import 'ckeditor5';
|
|
36
|
-
import 'ckeditor5/translations/en.js';
|
|
37
|
-
import 'ckeditor5/translations/zh.js';
|
|
38
|
-
import 'sonner';
|
|
39
|
-
import '../../../../infrastructure/contexts/admin.js';
|
|
40
|
-
import 'next-themes';
|
|
41
|
-
import '@tanstack/react-query';
|
|
42
|
-
import 'intor/next';
|
|
43
|
-
import { IsLockedButtons } from './is-locked-buttons.js';
|
|
44
|
-
import { TypeButtons } from './type-buttons.js';
|
|
45
|
-
|
|
46
|
-
function createFileList({
|
|
47
|
-
useQuery,
|
|
48
|
-
fileFindListCardsAction,
|
|
49
|
-
FileCard
|
|
50
|
-
}) {
|
|
51
|
-
return function FileList({
|
|
52
|
-
setItemStates,
|
|
53
|
-
// search
|
|
54
|
-
folderId,
|
|
55
|
-
// Use in File Manager, Folder page
|
|
56
|
-
isDeleted,
|
|
57
|
-
// Use in Trash Page
|
|
58
|
-
fileIds,
|
|
59
|
-
// link
|
|
60
|
-
openNewTab = false,
|
|
61
|
-
// pick
|
|
62
|
-
pickedItems,
|
|
63
|
-
handleClick
|
|
64
|
-
}) {
|
|
65
|
-
const [page, setPage] = useState(1);
|
|
66
|
-
const [pageSize, setPageSize] = useState(20);
|
|
67
|
-
const [searchString, setSearchString] = useState("");
|
|
68
|
-
const debouncedSetSearchString = useMemo(
|
|
69
|
-
() => debounce((v) => setSearchString(v), 300),
|
|
70
|
-
[]
|
|
71
|
-
);
|
|
72
|
-
const [type, setType] = useState(null);
|
|
73
|
-
const [isLocked, setIsLocked] = useState(null);
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
setPage(1);
|
|
76
|
-
}, [setPage, type, isLocked]);
|
|
77
|
-
const { data, isFetching, refetch } = useQuery(
|
|
78
|
-
() => fileFindListCardsAction({
|
|
79
|
-
page,
|
|
80
|
-
pageSize,
|
|
81
|
-
searchString,
|
|
82
|
-
type,
|
|
83
|
-
isLocked,
|
|
84
|
-
...folderId && { folderId },
|
|
85
|
-
...isDeleted && { isDeleted },
|
|
86
|
-
// Use in Trash
|
|
87
|
-
...fileIds && { fileIds }
|
|
88
|
-
}),
|
|
89
|
-
[
|
|
90
|
-
CACHE_KEYS.findListCards("file"),
|
|
91
|
-
page,
|
|
92
|
-
pageSize,
|
|
93
|
-
searchString,
|
|
94
|
-
type,
|
|
95
|
-
isLocked,
|
|
96
|
-
folderId,
|
|
97
|
-
isDeleted,
|
|
98
|
-
JSON.stringify(fileIds)
|
|
99
|
-
],
|
|
100
|
-
{ enabled: folderId !== DO_NOT_FETCH_KEY }
|
|
101
|
-
// Use in File Manager
|
|
102
|
-
);
|
|
103
|
-
const files = useMemo(() => ensureArray(data?.items), [data?.items]);
|
|
104
|
-
useEffect(() => {
|
|
105
|
-
setItemStates?.({
|
|
106
|
-
items: files,
|
|
107
|
-
count: data?.total ?? 0,
|
|
108
|
-
isFetching,
|
|
109
|
-
refetch
|
|
110
|
-
});
|
|
111
|
-
}, [files, data?.total, isFetching, 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__ */ jsxs("div", { className: "flex gap-4", children: [
|
|
124
|
-
/* @__PURE__ */ jsx(TypeButtons, { type: type || null, setType }),
|
|
125
|
-
/* @__PURE__ */ jsx("div", { className: "py-1", children: /* @__PURE__ */ jsx(Separator, { orientation: "vertical" }) }),
|
|
126
|
-
/* @__PURE__ */ jsx(IsLockedButtons, { isLocked, setIsLocked })
|
|
127
|
-
] }),
|
|
128
|
-
children: files.map((file) => {
|
|
129
|
-
const isPicked = pickedItems?.some((item) => item.id === file.id);
|
|
130
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative w-fit", children: [
|
|
131
|
-
/* @__PURE__ */ jsx(
|
|
132
|
-
FileCard,
|
|
133
|
-
{
|
|
134
|
-
file,
|
|
135
|
-
openNewTab,
|
|
136
|
-
className: cn(pickedItems && !isPicked && "opacity-50"),
|
|
137
|
-
anchorProps: handleClick && {
|
|
138
|
-
onClick: (e) => {
|
|
139
|
-
e.preventDefault();
|
|
140
|
-
handleClick(file);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
),
|
|
145
|
-
pickedItems && /* @__PURE__ */ jsx(
|
|
146
|
-
Tick,
|
|
147
|
-
{
|
|
148
|
-
isPicked: isPicked ?? false,
|
|
149
|
-
className: "absolute top-2 right-2"
|
|
150
|
-
}
|
|
151
|
-
)
|
|
152
|
-
] }, file.id);
|
|
153
|
-
})
|
|
154
|
-
}
|
|
155
|
-
);
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export { createFileList };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useTranslator } from 'intor/react';
|
|
3
|
-
import 'react';
|
|
4
|
-
import 'ua-parser-js';
|
|
5
|
-
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
6
|
-
import 'next/navigation';
|
|
7
|
-
import 'lucide-react';
|
|
8
|
-
import '@radix-ui/react-avatar';
|
|
9
|
-
import '../../shadcn/badge.js';
|
|
10
|
-
import '../../shadcn/button.js';
|
|
11
|
-
import '@radix-ui/react-collapsible';
|
|
12
|
-
import '@radix-ui/react-dialog';
|
|
13
|
-
import '@radix-ui/react-dropdown-menu';
|
|
14
|
-
import '../../shadcn/input-group.js';
|
|
15
|
-
import '@radix-ui/react-label';
|
|
16
|
-
import '@radix-ui/react-select';
|
|
17
|
-
import '@radix-ui/react-separator';
|
|
18
|
-
import '../../shadcn/sidebar.js';
|
|
19
|
-
import '@radix-ui/react-tooltip';
|
|
20
|
-
import { Button } from '../../ui/buttons/button.js';
|
|
21
|
-
import 'next/link';
|
|
22
|
-
import '../../../../../constants/paths/auth.js';
|
|
23
|
-
import '../../../../../constants/paths/main.js';
|
|
24
|
-
import '../../../../../constants/paths/resources.js';
|
|
25
|
-
import '../../../../../constants/redirect-paths.js';
|
|
26
|
-
import 'mime-types';
|
|
27
|
-
import '../../../../../domain/resources/admin/constants.js';
|
|
28
|
-
import 'next/image';
|
|
29
|
-
import 'ckeditor5';
|
|
30
|
-
import 'ckeditor5/translations/en.js';
|
|
31
|
-
import 'ckeditor5/translations/zh.js';
|
|
32
|
-
import 'sonner';
|
|
33
|
-
import '../../../../infrastructure/contexts/admin.js';
|
|
34
|
-
import 'next-themes';
|
|
35
|
-
import '@tanstack/react-query';
|
|
36
|
-
import 'intor/next';
|
|
37
|
-
|
|
38
|
-
function IsLockedButtons({
|
|
39
|
-
isLocked,
|
|
40
|
-
setIsLocked
|
|
41
|
-
}) {
|
|
42
|
-
const { t } = useTranslator();
|
|
43
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex h-fit gap-3", children: [
|
|
44
|
-
/* @__PURE__ */ jsx(
|
|
45
|
-
Button,
|
|
46
|
-
{
|
|
47
|
-
type: "button",
|
|
48
|
-
size: "sm",
|
|
49
|
-
variant: "secondary",
|
|
50
|
-
onClick: () => {
|
|
51
|
-
setIsLocked(isLocked === true ? null : true);
|
|
52
|
-
},
|
|
53
|
-
className: cn(isLocked !== true ? "opacity-35" : "shadow"),
|
|
54
|
-
children: t("resources.file.locked.text")
|
|
55
|
-
}
|
|
56
|
-
),
|
|
57
|
-
/* @__PURE__ */ jsx(
|
|
58
|
-
Button,
|
|
59
|
-
{
|
|
60
|
-
type: "button",
|
|
61
|
-
size: "sm",
|
|
62
|
-
variant: "secondary",
|
|
63
|
-
onClick: () => setIsLocked(isLocked === false ? null : false),
|
|
64
|
-
className: cn(isLocked !== false ? "opacity-35" : "shadow"),
|
|
65
|
-
children: t("resources.file.not-locked.text")
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
] });
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export { IsLockedButtons };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useTranslator } from 'intor/react';
|
|
3
|
-
import '../../../../../domain/resources/admin/constants.js';
|
|
4
|
-
import { FILE_TYPES } from '../../../../../domain/resources/file/props.js';
|
|
5
|
-
import 'react';
|
|
6
|
-
import 'ua-parser-js';
|
|
7
|
-
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
8
|
-
import 'next/navigation';
|
|
9
|
-
import 'lucide-react';
|
|
10
|
-
import '@radix-ui/react-avatar';
|
|
11
|
-
import '../../shadcn/badge.js';
|
|
12
|
-
import '../../shadcn/button.js';
|
|
13
|
-
import '@radix-ui/react-collapsible';
|
|
14
|
-
import '@radix-ui/react-dialog';
|
|
15
|
-
import '@radix-ui/react-dropdown-menu';
|
|
16
|
-
import '../../shadcn/input-group.js';
|
|
17
|
-
import '@radix-ui/react-label';
|
|
18
|
-
import '@radix-ui/react-select';
|
|
19
|
-
import '@radix-ui/react-separator';
|
|
20
|
-
import '../../shadcn/sidebar.js';
|
|
21
|
-
import '@radix-ui/react-tooltip';
|
|
22
|
-
import { Button } from '../../ui/buttons/button.js';
|
|
23
|
-
import 'next/link';
|
|
24
|
-
import '../../../../../constants/paths/auth.js';
|
|
25
|
-
import '../../../../../constants/paths/main.js';
|
|
26
|
-
import '../../../../../constants/paths/resources.js';
|
|
27
|
-
import '../../../../../constants/redirect-paths.js';
|
|
28
|
-
import 'mime-types';
|
|
29
|
-
import 'next/image';
|
|
30
|
-
import 'ckeditor5';
|
|
31
|
-
import 'ckeditor5/translations/en.js';
|
|
32
|
-
import 'ckeditor5/translations/zh.js';
|
|
33
|
-
import 'sonner';
|
|
34
|
-
import '../../../../infrastructure/contexts/admin.js';
|
|
35
|
-
import 'next-themes';
|
|
36
|
-
import '@tanstack/react-query';
|
|
37
|
-
import 'intor/next';
|
|
38
|
-
|
|
39
|
-
function TypeButtons({ type, setType }) {
|
|
40
|
-
const { t } = useTranslator();
|
|
41
|
-
const handleClick = (fileType) => {
|
|
42
|
-
if (fileType === type) {
|
|
43
|
-
setType(null);
|
|
44
|
-
} else {
|
|
45
|
-
setType(fileType);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
return /* @__PURE__ */ jsx("div", { className: "flex h-fit gap-3", children: Object.values(FILE_TYPES).map((fileType) => /* @__PURE__ */ jsx(
|
|
49
|
-
Button,
|
|
50
|
-
{
|
|
51
|
-
type: "button",
|
|
52
|
-
size: "sm",
|
|
53
|
-
variant: "secondary",
|
|
54
|
-
onClick: () => handleClick(fileType),
|
|
55
|
-
className: cn(fileType !== type ? "opacity-35" : "shadow"),
|
|
56
|
-
children: t(`resources.file.file-type.${fileType.toLowerCase()}.text`)
|
|
57
|
-
},
|
|
58
|
-
fileType
|
|
59
|
-
)) });
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export { TypeButtons };
|