@mohasinac/appkit 3.5.8 → 3.6.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.
- package/dist/_internal/server/features/auth/permissions.js +1 -0
- package/dist/features/media/upload/ImageUpload.js +6 -2
- package/dist/features/media/upload/MediaUploadField.js +4 -1
- package/dist/styles.css +1 -1
- package/dist/tokens/themes/default-light.js +1 -1
- package/dist/tokens/tokens.css +1 -1
- package/package.json +1 -1
- package/tsconfig.base.json +5 -0
|
@@ -21,6 +21,7 @@ export async function getServerPermissions(uid) {
|
|
|
21
21
|
return { isAdmin: false, permissions: [] };
|
|
22
22
|
// userRepository.findById is cached per request in BaseRepository
|
|
23
23
|
const user = await userRepository.findById(uid);
|
|
24
|
+
console.error("[PERM-DIAG] uid:", uid, "user:", user ? JSON.stringify(user) : "null");
|
|
24
25
|
if (!user)
|
|
25
26
|
return { isAdmin: false, permissions: [] };
|
|
26
27
|
if (user.role === "admin")
|
|
@@ -9,13 +9,17 @@ import { normalizeError } from "../../../errors/normalize";
|
|
|
9
9
|
* Optional camera capture (captureSource="both").
|
|
10
10
|
*/
|
|
11
11
|
import { useState, useRef } from "react";
|
|
12
|
+
import dynamic from "next/dynamic";
|
|
12
13
|
import { useTranslations } from "next-intl";
|
|
13
14
|
import { useCamera } from "../../../react";
|
|
14
15
|
import { Alert, Button, Div, Label, Progress, Row, Spinner, Stack, Text, useToast } from "../../../ui";
|
|
15
16
|
import { MediaImage } from "../MediaImage";
|
|
16
|
-
import { ImageCropModal } from "../modals/ImageCropModal";
|
|
17
|
-
import { ImageEditor } from "../modals/ImageEditor";
|
|
18
17
|
import CameraCapture from "./CameraCapture";
|
|
18
|
+
// Crop/editor modals pull in image-manipulation libraries (react-advanced-cropper
|
|
19
|
+
// and friends) that most upload sessions never open — lazy-load so that weight
|
|
20
|
+
// isn't in the initial bundle for every page that renders an ImageUpload field.
|
|
21
|
+
const ImageCropModal = dynamic(() => import("../modals/ImageCropModal").then((m) => m.ImageCropModal), { ssr: false });
|
|
22
|
+
const ImageEditor = dynamic(() => import("../modals/ImageEditor").then((m) => m.ImageEditor), { ssr: false });
|
|
19
23
|
const __O = {
|
|
20
24
|
hidden: "overflow-hidden",
|
|
21
25
|
};
|
|
@@ -12,12 +12,15 @@ import { useCamera } from "../../../react";
|
|
|
12
12
|
import { Alert, Anchor, Button, Div, Label, Row, Span, Spinner, Stack, Text } from "../../../ui";
|
|
13
13
|
import { MediaImage } from "../MediaImage";
|
|
14
14
|
import { MediaVideo } from "../MediaVideo";
|
|
15
|
-
import
|
|
15
|
+
import dynamic from "next/dynamic";
|
|
16
16
|
import { VideoThumbnailSelector } from "../modals/VideoThumbnailSelector";
|
|
17
17
|
import CameraCapture from "./CameraCapture";
|
|
18
18
|
import { extractVideoPosterFrame, posterBlobAsFile } from "./video-poster";
|
|
19
19
|
import { inferMediaTypeFromMime } from "../types/index";
|
|
20
20
|
import { normalizeError } from "../../../errors/normalize";
|
|
21
|
+
// Pulls in video-processing libraries most upload sessions never touch —
|
|
22
|
+
// lazy-load rather than bundle into every page rendering a MediaUploadField.
|
|
23
|
+
const VideoTrimModal = dynamic(() => import("../modals/VideoTrimModal").then((m) => m.VideoTrimModal), { ssr: false });
|
|
21
24
|
const CLS_PDF_BADGE = "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-error-surface text-error dark:bg-error-surface dark:text-error";
|
|
22
25
|
const CLS_PDF_NAME = "text-[length:var(--appkit-text-sm)] font-medium text-info underline break-all dark:text-info";
|
|
23
26
|
const CLS_PDF_LINK = "text-[length:var(--appkit-text-sm)] underline break-all text-info dark:text-info";
|
package/dist/styles.css
CHANGED
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
|
|
282
282
|
--appkit-color-text: #18181b; /* zinc-900 */
|
|
283
283
|
--appkit-color-text-muted: #71717a; /* zinc-500 */
|
|
284
|
-
--appkit-color-text-faint: #
|
|
284
|
+
--appkit-color-text-faint: #87878f; /* zinc-400 darkened for WCAG AA large-text 3:1 on --appkit-color-bg (audit-a11y) */
|
|
285
285
|
--appkit-color-text-on-primary: #ffffff;
|
|
286
286
|
--appkit-color-text-on-dark: #ffffff;
|
|
287
287
|
|
|
@@ -46,7 +46,7 @@ export const DEFAULT_LIGHT_THEME = {
|
|
|
46
46
|
"appkit-color-border-subtle": "#f4f4f5",
|
|
47
47
|
"appkit-color-text": "#18181b",
|
|
48
48
|
"appkit-color-text-muted": "#71717a",
|
|
49
|
-
"appkit-color-text-faint": "#
|
|
49
|
+
"appkit-color-text-faint": "#87878f",
|
|
50
50
|
"appkit-color-text-on-primary": "#ffffff",
|
|
51
51
|
"appkit-color-success": "#059669",
|
|
52
52
|
"appkit-color-success-surface": "#ecfdf5",
|
package/dist/tokens/tokens.css
CHANGED
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
|
|
264
264
|
--appkit-color-text: #18181b; /* zinc-900 */
|
|
265
265
|
--appkit-color-text-muted: #71717a; /* zinc-500 */
|
|
266
|
-
--appkit-color-text-faint: #
|
|
266
|
+
--appkit-color-text-faint: #87878f; /* zinc-400 darkened for WCAG AA large-text 3:1 on --appkit-color-bg (audit-a11y) */
|
|
267
267
|
--appkit-color-text-on-primary: #ffffff;
|
|
268
268
|
--appkit-color-text-on-dark: #ffffff;
|
|
269
269
|
|
package/package.json
CHANGED
package/tsconfig.base.json
CHANGED
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
"lib": ["dom", "dom.iterable", "esnext"],
|
|
6
6
|
"skipLibCheck": true,
|
|
7
7
|
"strict": true,
|
|
8
|
+
"noUncheckedIndexedAccess": true,
|
|
9
|
+
"exactOptionalPropertyTypes": true,
|
|
10
|
+
"noImplicitOverride": true,
|
|
11
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
12
|
+
"noFallthroughCasesInSwitch": true,
|
|
8
13
|
"esModuleInterop": true,
|
|
9
14
|
"module": "esnext",
|
|
10
15
|
"moduleResolution": "bundler",
|