sitero 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useTranslator } from 'intor/react';
3
- import { Lock, Trash2 } from 'lucide-react';
3
+ import { Lock, Network } from 'lucide-react';
4
4
  import 'mime-types';
5
5
  import 'sitero-domain';
6
6
  import 'react';
@@ -9,10 +9,12 @@ import '../../../../../../shared/client/react-query/client.js';
9
9
  import '@tanstack/react-query';
10
10
  import { cn } from '../../../../../../shared/utils/cn.js';
11
11
 
12
- function FileStateIcons({ file }) {
12
+ function FileStateIcons({
13
+ file
14
+ }) {
13
15
  const { t } = useTranslator();
14
16
  const isLocked = !!file?.isLocked;
15
- const isTrash = !!file?.deletedAt;
17
+ const isInUse = file && "isInUse" in file ? file.isInUse : void 0;
16
18
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
17
19
  /* @__PURE__ */ jsx(
18
20
  Lock,
@@ -25,7 +27,17 @@ function FileStateIcons({ file }) {
25
27
  "aria-hidden": false
26
28
  }
27
29
  ),
28
- /* @__PURE__ */ jsx(Trash2, { className: cn(isTrash ? "text-destructive" : "opacity-10") })
30
+ typeof isInUse === "boolean" && /* @__PURE__ */ jsx(
31
+ Network,
32
+ {
33
+ className: cn(isInUse ? "text-warning" : "opacity-10"),
34
+ role: "img",
35
+ "aria-label": t(
36
+ isInUse ? "resources.file.in-use.text" : "resources.file.not-in-use.text"
37
+ ),
38
+ "aria-hidden": false
39
+ }
40
+ )
29
41
  ] });
30
42
  }
31
43
 
@@ -12,7 +12,8 @@ function FilePreviewMeta({
12
12
  height,
13
13
  duration
14
14
  }) {
15
- if (!(width || height) && !duration) return;
15
+ const hasDimensions = !!width && !!height;
16
+ if (!hasDimensions && !duration) return null;
16
17
  return /* @__PURE__ */ jsxs(
17
18
  "span",
18
19
  {
@@ -25,11 +26,13 @@ function FilePreviewMeta({
25
26
  "truncate"
26
27
  ),
27
28
  children: [
28
- width ?? "",
29
- " x ",
30
- height ?? "",
29
+ hasDimensions && /* @__PURE__ */ jsxs("span", { children: [
30
+ width,
31
+ " x ",
32
+ height
33
+ ] }),
31
34
  duration ? /* @__PURE__ */ jsxs(Fragment, { children: [
32
- /* @__PURE__ */ jsx("span", { className: "my-auto h-4 w-px bg-gray-300" }),
35
+ hasDimensions && /* @__PURE__ */ jsx("span", { className: "my-auto h-4 w-px bg-gray-300" }),
33
36
  /* @__PURE__ */ jsxs("span", { children: [
34
37
  duration.toFixed(2),
35
38
  " s"
@@ -71,12 +71,6 @@ function createPostTrashPage({
71
71
  const [selectedId, setSelectedId] = useState(null);
72
72
  const filterId = useSearchParams().get("id");
73
73
  const groups = [
74
- {
75
- type: "POST",
76
- title: t("resources.post.text"),
77
- states: postStates,
78
- setStates: setPostStates
79
- },
80
74
  {
81
75
  type: "CATEGORY",
82
76
  title: t("resources.category.text"),
@@ -93,6 +87,12 @@ function createPostTrashPage({
93
87
  Card: SubcategoryCard,
94
88
  Table: SubcategoryTable
95
89
  },
90
+ {
91
+ type: "POST",
92
+ title: t("resources.post.text"),
93
+ states: postStates,
94
+ setStates: setPostStates
95
+ },
96
96
  {
97
97
  type: "TAG",
98
98
  title: t("resources.tag.text"),
@@ -1,7 +1,7 @@
1
- import type { FileCard } from "sitero-server";
1
+ import type { FileCard, FileListCard } from "sitero-server";
2
2
  import { type createSmartImage } from "../../ui/features";
3
3
  interface FileCardProps {
4
- file: FileCard | null;
4
+ file: FileCard | FileListCard | null;
5
5
  openNewTab?: boolean | undefined;
6
6
  isPicked?: boolean;
7
7
  onSelect?: (() => void) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"file-card.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/cms/client/interfaces/components/resources/file/file-card.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAQ9C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAM1D,UAAU,aAAa;IACrB,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,UAAU,EACV,gBAAgB,GACjB,EAAE;IACD,UAAU,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,IAC0B,sDAStB,aAAa,6CAqDjB"}
1
+ {"version":3,"file":"file-card.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/cms/client/interfaces/components/resources/file/file-card.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAQ5D,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAM1D,UAAU,aAAa;IACrB,IAAI,EAAE,QAAQ,GAAG,YAAY,GAAG,IAAI,CAAC;IACrC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,UAAU,EACV,gBAAgB,GACjB,EAAE;IACD,UAAU,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,IAC0B,sDAStB,aAAa,6CAqDjB"}
@@ -1,5 +1,5 @@
1
- import type { FileCard } from "sitero-server";
2
- export declare function FileStateIcons({ file }: {
3
- file: FileCard | null;
1
+ import type { FileCard, FileListCard } from "sitero-server";
2
+ export declare function FileStateIcons({ file, }: {
3
+ file: FileCard | FileListCard | null;
4
4
  }): import("react/jsx-runtime").JSX.Element;
5
5
  //# sourceMappingURL=file-state-icons.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-state-icons.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/cms/client/interfaces/components/resources/file/file-state-icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK9C,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAA;CAAE,2CAoBjE"}
1
+ {"version":3,"file":"file-state-icons.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/cms/client/interfaces/components/resources/file/file-state-icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAK5D,wBAAgB,cAAc,CAAC,EAC7B,IAAI,GACL,EAAE;IACD,IAAI,EAAE,QAAQ,GAAG,YAAY,GAAG,IAAI,CAAC;CACtC,2CA+BA"}
@@ -2,5 +2,5 @@ export declare function FilePreviewMeta({ width, height, duration, }: {
2
2
  width: number | null;
3
3
  height: number | null;
4
4
  duration: number | null;
5
- }): import("react/jsx-runtime").JSX.Element | undefined;
5
+ }): import("react/jsx-runtime").JSX.Element | null;
6
6
  //# sourceMappingURL=file-preview-meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-preview-meta.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../src/cms/client/interfaces/components/ui/features/file/file-preview/file-preview-meta.tsx"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,MAAM,EACN,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,uDAuBA"}
1
+ {"version":3,"file":"file-preview-meta.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../src/cms/client/interfaces/components/ui/features/file/file-preview/file-preview-meta.tsx"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,MAAM,EACN,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,kDA6BA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sitero",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "author": "Yiming Liao",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -111,8 +111,8 @@
111
111
  "ua-parser-js": "2.0.9",
112
112
  "ulid": "3.0.2",
113
113
  "zod": "4.3.6",
114
- "sitero-domain": "0.9.0",
115
- "sitero-server": "0.9.0"
114
+ "sitero-domain": "0.9.1",
115
+ "sitero-server": "0.9.1"
116
116
  },
117
117
  "peerDependencies": {
118
118
  "@aws-sdk/client-s3": "3.913.0",