@solidxai/core-ui 0.1.14-beta.9 → 0.1.14
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/components/auth/AuthLayout.js +1 -1
- package/dist/components/auth/AuthLayout.js.map +1 -1
- package/dist/components/auth/AuthLayout.tsx +2 -2
- package/dist/components/common/SettingsComponent.module.css +1 -4
- package/dist/components/common/SolidFormStepper.d.ts.map +1 -1
- package/dist/components/common/SolidFormStepper.js +6 -7
- package/dist/components/common/SolidFormStepper.js.map +1 -1
- package/dist/components/common/SolidFormStepper.tsx +1 -7
- package/dist/components/common/SolidThemeProvider.d.ts.map +1 -1
- package/dist/components/common/SolidThemeProvider.js +11 -127
- package/dist/components/common/SolidThemeProvider.js.map +1 -1
- package/dist/components/common/SolidThemeProvider.tsx +22 -104
- package/dist/components/core/card/CardGrid.d.ts +1 -1
- package/dist/components/core/card/CardGrid.d.ts.map +1 -1
- package/dist/components/core/card/CardGrid.js +2 -2
- package/dist/components/core/card/CardGrid.js.map +1 -1
- package/dist/components/core/card/CardGrid.tsx +0 -4
- package/dist/components/core/card/CardItem.d.ts +0 -2
- package/dist/components/core/card/CardItem.d.ts.map +1 -1
- package/dist/components/core/card/CardItem.js +3 -4
- package/dist/components/core/card/CardItem.js.map +1 -1
- package/dist/components/core/card/CardItem.tsx +0 -15
- package/dist/components/core/card/SolidCardView.d.ts +1 -28
- package/dist/components/core/card/SolidCardView.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardView.js +44 -99
- package/dist/components/core/card/SolidCardView.js.map +1 -1
- package/dist/components/core/card/SolidCardView.tsx +7 -124
- package/dist/components/core/card/SolidCardViewConfigure.d.ts +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.js +6 -15
- package/dist/components/core/card/SolidCardViewConfigure.js.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.tsx +0 -34
- package/dist/components/core/common/PDFViewer.d.ts +5 -9
- package/dist/components/core/common/PDFViewer.d.ts.map +1 -1
- package/dist/components/core/common/PDFViewer.js +102 -10
- package/dist/components/core/common/PDFViewer.js.map +1 -1
- package/dist/components/core/common/PDFViewer.tsx +88 -29
- package/dist/components/core/common/SolidCreateButton.d.ts.map +1 -1
- package/dist/components/core/common/SolidCreateButton.js +2 -2
- package/dist/components/core/common/SolidCreateButton.js.map +1 -1
- package/dist/components/core/common/SolidCreateButton.tsx +2 -22
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +134 -137
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +119 -127
- package/dist/components/core/form/SolidFormActionHeader.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.js +21 -21
- package/dist/components/core/form/SolidFormActionHeader.js.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.tsx +53 -62
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +2 -5
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +2 -7
- package/dist/components/core/kanban/KanbanBoard.d.ts +1 -1
- package/dist/components/core/kanban/KanbanBoard.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanBoard.js +2 -2
- package/dist/components/core/kanban/KanbanBoard.js.map +1 -1
- package/dist/components/core/kanban/KanbanBoard.tsx +1 -3
- package/dist/components/core/kanban/KanbanCard.d.ts +0 -2
- package/dist/components/core/kanban/KanbanCard.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanCard.js +2 -4
- package/dist/components/core/kanban/KanbanCard.js.map +1 -1
- package/dist/components/core/kanban/KanbanCard.tsx +1 -14
- package/dist/components/core/kanban/KanbanColumn.d.ts +1 -3
- package/dist/components/core/kanban/KanbanColumn.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanColumn.js +2 -2
- package/dist/components/core/kanban/KanbanColumn.js.map +1 -1
- package/dist/components/core/kanban/KanbanColumn.tsx +2 -4
- package/dist/components/core/kanban/SolidKanbanView.d.ts +1 -25
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +50 -89
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +9 -82
- package/dist/components/core/list/PLAN.md +1 -1
- package/dist/components/core/list/SolidListView.d.ts +0 -11
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +3 -8
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +43 -82
- package/dist/components/core/list/SolidListViewConfigure.js +1 -1
- package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.tsx +1 -1
- package/dist/components/core/model/CreateModel.d.ts.map +1 -1
- package/dist/components/core/model/CreateModel.js +1 -2
- package/dist/components/core/model/CreateModel.js.map +1 -1
- package/dist/components/core/model/CreateModel.tsx +0 -2
- package/dist/components/core/model/FieldMetaData.d.ts +1 -1
- package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaData.js +8 -8
- package/dist/components/core/model/FieldMetaData.js.map +1 -1
- package/dist/components/core/model/FieldMetaData.tsx +2 -2
- package/dist/components/core/model/FieldMetaDataForm.css +0 -119
- package/dist/components/core/model/FieldMetaDataForm.js +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.tsx +1 -1
- package/dist/components/core/module/ModuleMetadataExplorer.css +0 -64
- package/dist/components/core/module/ModulePackageDialog.css +12 -117
- package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
- package/dist/components/core/tree/SolidTreeView.js +3 -6
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +13 -35
- package/dist/components/layout/AdminHeaderActions.d.ts.map +1 -1
- package/dist/components/layout/AdminHeaderActions.js +10 -15
- package/dist/components/layout/AdminHeaderActions.js.map +1 -1
- package/dist/components/layout/AdminHeaderActions.tsx +8 -15
- package/dist/components/layout/AdminTopHeader.d.ts.map +1 -1
- package/dist/components/layout/AdminTopHeader.js +18 -1
- package/dist/components/layout/AdminTopHeader.js.map +1 -1
- package/dist/components/layout/AdminTopHeader.tsx +21 -3
- package/dist/index.d.ts +0 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/index.ts +0 -5
- package/dist/resources/globals.css +0 -15
- package/dist/resources/solid-custom.css +0 -11
- package/dist/resources/solid-tailwind-generated.css +1 -1
- package/dist/resources/themes/solid-light-modern/theme.css +3 -4
- package/dist/routes/pages/admin/core/CardPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.js +2 -15
- package/dist/routes/pages/admin/core/CardPage.js.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.tsx +2 -17
- package/dist/routes/pages/admin/core/DashboardPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/DashboardPage.js +3 -31
- package/dist/routes/pages/admin/core/DashboardPage.js.map +1 -1
- package/dist/routes/pages/admin/core/DashboardPage.tsx +11 -39
- package/dist/routes/pages/admin/core/KanbanPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.js +2 -15
- package/dist/routes/pages/admin/core/KanbanPage.js.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.tsx +2 -17
- package/dist/routes/pages/admin/core/ListPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.js +13 -5
- package/dist/routes/pages/admin/core/ListPage.js.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.tsx +15 -5
- package/dist/types/solid-core.d.ts +0 -8
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PDFViewer.js","sourceRoot":"","sources":["../../../../src/components/core/common/PDFViewer.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"PDFViewer.js","sourceRoot":"","sources":["../../../../src/components/core/common/PDFViewer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAQvD;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAwC;IAA1E,iBA6FC;QA7FmC,GAAG,SAAA,EAAE,cAAe,EAAf,MAAM,mBAAG,MAAM,KAAA;IAC9C,IAAA,KAAwB,QAAQ,CAAgB,IAAI,CAAC,EAApD,OAAO,QAAA,EAAE,UAAU,QAAiC,CAAC;IACtD,IAAA,KAAoB,QAAQ,CAAgB,IAAI,CAAC,EAAhD,KAAK,QAAA,EAAE,QAAQ,QAAiC,CAAC;IAClD,IAAA,KAAgC,QAAQ,CAAC,CAAC,CAAC,EAA1C,WAAW,QAAA,EAAE,cAAc,QAAe,CAAC;IAClD,IAAM,UAAU,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAC;IAE/C,SAAS,CAAC;QACN,IAAI,CAAC,GAAG;YAAE,OAAO;QAEjB,IAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,UAAU,CAAC,IAAI,CAAC,CAAC;QAEjB,KAAK,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC;aACpC,IAAI,CAAC,UAAO,GAAG;;;;;;wBACZ,IAAI,CAAC,GAAG,CAAC,EAAE;4BAAE,MAAM,IAAI,KAAK,CAAC,8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H,cACI,SAAS,EAAC,oFAAoF,EAC9F,KAAK,EAAE,EAAE,MAAM,QAAA,EAAE,YAEjB,YAAG,SAAS,EAAC,gCAAgC,oCAAwB,GACnE,CACT,CAAC;KACL;IAED,IAAI,KAAK,EAAE;QACP,OAAO,CACH,eACI,SAAS,EAAC,kGAAkG,EAC5G,KAAK,EAAE,EAAE,MAAM,QAAA,EAAE,aAEjB,YAAG,SAAS,EAAC,4BAA4B,YAAE,KAAK,GAAK,EACrD,KAAC,WAAW,IACR,OAAO,EAAE,cAAM,OAAA,cAAc,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,GAAG,CAAC,EAAL,CAAK,CAAC,EAA5B,CAA4B,EAC3C,QAAQ,EAAE,KAAC,SAAS,IAAC,IAAI,EAAC,YAAY,EAAC,IAAI,EAAE,EAAE,wBAAgB,sBAGrD,IACZ,CACT,CAAC;KACL;IAED,IAAI,CAAC,OAAO,EAAE;QACV,OAAO,CACH,cACI,SAAS,EAAC,oFAAoF,EAC9F,KAAK,EAAE,EAAE,MAAM,QAAA,EAAE,YAEjB,YAAG,SAAS,EAAC,oCAAoC,+BAAmB,GAClE,CACT,CAAC;KACL;IAED,OAAO,CACH,iBACI,GAAG,EAAE,OAAO,EACZ,KAAK,EAAC,aAAa,EACnB,SAAS,EAAC,4GAA4G,EACtH,KAAK,EAAE,EAAE,MAAM,QAAA,EAAE,GACnB,CACL,CAAC;AACN,CAAC","sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { SolidButton } from '../../shad-cn-ui/SolidButton';\nimport { SolidIcon } from '../../shad-cn-ui/SolidIcon';\n\nexport interface PDFViewerProps {\n url?: string | null;\n /** Height of the viewport the PDF renders into. */\n height?: string;\n}\n\n/**\n * Renders a PDF using the browser's built-in PDF viewer.\n *\n * The signed URL is fetched into a blob first, which both keeps any auth on the\n * request and guarantees inline rendering regardless of the `Content-Disposition`\n * the storage provider sends back. Everything else — zoom, rotation, page\n * navigation, text search/selection, print, download — is handled natively by\n * the browser, so there is no pdf.js worker to configure or version-match.\n */\nexport default function PDFViewer({ url, height = '70vh' }: PDFViewerProps) {\n const [blobUrl, setBlobUrl] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [reloadToken, setReloadToken] = useState(0);\n const blobUrlRef = useRef<string | null>(null);\n\n useEffect(() => {\n if (!url) return;\n\n const controller = new AbortController();\n setError(null);\n setBlobUrl(null);\n\n fetch(url, { signal: controller.signal })\n .then(async (res) => {\n if (!res.ok) throw new Error(`Request failed with ${res.status}`);\n\n const contentType = res.headers.get('content-type') ?? '';\n if (contentType && !contentType.includes('pdf') && !contentType.includes('octet-stream')) {\n throw new Error(`Unexpected content type: ${contentType}`);\n }\n\n const blob = await res.blob();\n const nextBlobUrl = URL.createObjectURL(blob);\n\n // Revoke the URL this one replaces so repeated previews don't leak.\n if (blobUrlRef.current) URL.revokeObjectURL(blobUrlRef.current);\n blobUrlRef.current = nextBlobUrl;\n\n setBlobUrl(nextBlobUrl);\n })\n .catch((err) => {\n if (controller.signal.aborted) return;\n console.error('PDF load error:', err);\n setError('Failed to load PDF');\n });\n\n return () => controller.abort();\n }, [url, reloadToken]);\n\n useEffect(() => {\n return () => {\n if (blobUrlRef.current) URL.revokeObjectURL(blobUrlRef.current);\n };\n }, []);\n\n if (!url) {\n return (\n <div\n className=\"flex min-h-0 items-center justify-center rounded-lg bg-[var(--solid-surface-pane)]\"\n style={{ height }}\n >\n <p className=\"text-[var(--solid-text-muted)]\">No PDF URL provided</p>\n </div>\n );\n }\n\n if (error) {\n return (\n <div\n className=\"flex min-h-0 flex-col items-center justify-center gap-4 rounded-lg bg-[var(--solid-danger-soft)]\"\n style={{ height }}\n >\n <p className=\"text-[var(--solid-danger)]\">{error}</p>\n <SolidButton\n onClick={() => setReloadToken((t) => t + 1)}\n leftIcon={<SolidIcon name=\"si-refresh\" size={16} aria-hidden />}\n >\n Retry\n </SolidButton>\n </div>\n );\n }\n\n if (!blobUrl) {\n return (\n <div\n className=\"flex min-h-0 items-center justify-center rounded-lg bg-[var(--solid-surface-pane)]\"\n style={{ height }}\n >\n <p className=\"text-[var(--solid-text-secondary)]\">Loading PDF...</p>\n </div>\n );\n }\n\n return (\n <iframe\n src={blobUrl}\n title=\"PDF preview\"\n className=\"block min-h-0 w-full rounded-lg border border-[var(--solid-border-default)] bg-[var(--solid-surface-pane)]\"\n style={{ height }}\n />\n );\n}\n"]}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { SolidButton } from '../../shad-cn-ui/SolidButton';
|
|
3
|
+
import { SolidIcon } from '../../shad-cn-ui/SolidIcon';
|
|
4
|
+
|
|
1
5
|
export interface PDFViewerProps {
|
|
2
6
|
url?: string | null;
|
|
3
7
|
/** Height of the viewport the PDF renders into. */
|
|
@@ -7,17 +11,58 @@ export interface PDFViewerProps {
|
|
|
7
11
|
/**
|
|
8
12
|
* Renders a PDF using the browser's built-in PDF viewer.
|
|
9
13
|
*
|
|
10
|
-
* The signed URL is
|
|
11
|
-
*
|
|
12
|
-
* the storage
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* Zoom, rotation, page navigation, text search/selection, print and download all
|
|
17
|
-
* come from the browser's native viewer, so there is no pdf.js worker to
|
|
18
|
-
* configure or version-match.
|
|
14
|
+
* The signed URL is fetched into a blob first, which both keeps any auth on the
|
|
15
|
+
* request and guarantees inline rendering regardless of the `Content-Disposition`
|
|
16
|
+
* the storage provider sends back. Everything else — zoom, rotation, page
|
|
17
|
+
* navigation, text search/selection, print, download — is handled natively by
|
|
18
|
+
* the browser, so there is no pdf.js worker to configure or version-match.
|
|
19
19
|
*/
|
|
20
20
|
export default function PDFViewer({ url, height = '70vh' }: PDFViewerProps) {
|
|
21
|
+
const [blobUrl, setBlobUrl] = useState<string | null>(null);
|
|
22
|
+
const [error, setError] = useState<string | null>(null);
|
|
23
|
+
const [reloadToken, setReloadToken] = useState(0);
|
|
24
|
+
const blobUrlRef = useRef<string | null>(null);
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (!url) return;
|
|
28
|
+
|
|
29
|
+
const controller = new AbortController();
|
|
30
|
+
setError(null);
|
|
31
|
+
setBlobUrl(null);
|
|
32
|
+
|
|
33
|
+
fetch(url, { signal: controller.signal })
|
|
34
|
+
.then(async (res) => {
|
|
35
|
+
if (!res.ok) throw new Error(`Request failed with ${res.status}`);
|
|
36
|
+
|
|
37
|
+
const contentType = res.headers.get('content-type') ?? '';
|
|
38
|
+
if (contentType && !contentType.includes('pdf') && !contentType.includes('octet-stream')) {
|
|
39
|
+
throw new Error(`Unexpected content type: ${contentType}`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const blob = await res.blob();
|
|
43
|
+
const nextBlobUrl = URL.createObjectURL(blob);
|
|
44
|
+
|
|
45
|
+
// Revoke the URL this one replaces so repeated previews don't leak.
|
|
46
|
+
if (blobUrlRef.current) URL.revokeObjectURL(blobUrlRef.current);
|
|
47
|
+
blobUrlRef.current = nextBlobUrl;
|
|
48
|
+
|
|
49
|
+
setBlobUrl(nextBlobUrl);
|
|
50
|
+
})
|
|
51
|
+
.catch((err) => {
|
|
52
|
+
if (controller.signal.aborted) return;
|
|
53
|
+
console.error('PDF load error:', err);
|
|
54
|
+
setError('Failed to load PDF');
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
return () => controller.abort();
|
|
58
|
+
}, [url, reloadToken]);
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
return () => {
|
|
62
|
+
if (blobUrlRef.current) URL.revokeObjectURL(blobUrlRef.current);
|
|
63
|
+
};
|
|
64
|
+
}, []);
|
|
65
|
+
|
|
21
66
|
if (!url) {
|
|
22
67
|
return (
|
|
23
68
|
<div
|
|
@@ -29,26 +74,40 @@ export default function PDFViewer({ url, height = '70vh' }: PDFViewerProps) {
|
|
|
29
74
|
);
|
|
30
75
|
}
|
|
31
76
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
className="block min-h-0 w-full flex-1 rounded-lg border border-[var(--solid-border-default)] bg-[var(--solid-surface-pane)]"
|
|
38
|
-
/>
|
|
39
|
-
{/*
|
|
40
|
-
Escape hatch: a browser that won't render PDFs inline (iOS Safari, or
|
|
41
|
-
an object stored with a non-PDF content type) shows a blank frame with
|
|
42
|
-
no error event to hook. This keeps the document reachable in that case.
|
|
43
|
-
*/}
|
|
44
|
-
<a
|
|
45
|
-
href={url}
|
|
46
|
-
target="_blank"
|
|
47
|
-
rel="noopener noreferrer"
|
|
48
|
-
className="shrink-0 text-center text-xs text-[var(--solid-text-muted)] underline"
|
|
77
|
+
if (error) {
|
|
78
|
+
return (
|
|
79
|
+
<div
|
|
80
|
+
className="flex min-h-0 flex-col items-center justify-center gap-4 rounded-lg bg-[var(--solid-danger-soft)]"
|
|
81
|
+
style={{ height }}
|
|
49
82
|
>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
83
|
+
<p className="text-[var(--solid-danger)]">{error}</p>
|
|
84
|
+
<SolidButton
|
|
85
|
+
onClick={() => setReloadToken((t) => t + 1)}
|
|
86
|
+
leftIcon={<SolidIcon name="si-refresh" size={16} aria-hidden />}
|
|
87
|
+
>
|
|
88
|
+
Retry
|
|
89
|
+
</SolidButton>
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (!blobUrl) {
|
|
95
|
+
return (
|
|
96
|
+
<div
|
|
97
|
+
className="flex min-h-0 items-center justify-center rounded-lg bg-[var(--solid-surface-pane)]"
|
|
98
|
+
style={{ height }}
|
|
99
|
+
>
|
|
100
|
+
<p className="text-[var(--solid-text-secondary)]">Loading PDF...</p>
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<iframe
|
|
107
|
+
src={blobUrl}
|
|
108
|
+
title="PDF preview"
|
|
109
|
+
className="block min-h-0 w-full rounded-lg border border-[var(--solid-border-default)] bg-[var(--solid-surface-pane)]"
|
|
110
|
+
style={{ height }}
|
|
111
|
+
/>
|
|
53
112
|
);
|
|
54
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidCreateButton.d.ts","sourceRoot":"","sources":["../../../../src/components/core/common/SolidCreateButton.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,iBAAiB,0FAAmG,GAAG,
|
|
1
|
+
{"version":3,"file":"SolidCreateButton.d.ts","sourceRoot":"","sources":["../../../../src/components/core/common/SolidCreateButton.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,iBAAiB,0FAAmG,GAAG,4CA6DnI,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import Link from "../../common/Link";
|
|
3
3
|
import { usePathname } from "../../../hooks/usePathname";
|
|
4
4
|
import { normalizeSolidListTreeKanbanActionPath } from "../../../helpers/routePaths";
|
|
@@ -25,6 +25,6 @@ export var SolidCreateButton = function (_a) {
|
|
|
25
25
|
var label = ((_c = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _c === void 0 ? void 0 : _c.addButtonTitle) || "Add";
|
|
26
26
|
var className = ((_d = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _d === void 0 ? void 0 : _d.addButtonClassName) || "";
|
|
27
27
|
var defaultIcon = _jsx(Plus, { size: 14 });
|
|
28
|
-
return (_jsx("div", { children:
|
|
28
|
+
return (_jsx("div", { children: _jsx(Link, { href: createPath, onClick: storeCurrentViewContext, children: responsiveIconOnly ? (_jsxs(_Fragment, { children: [_jsx(SolidButton, { type: "button", icon: icon, leftIcon: !icon ? defaultIcon : undefined, className: "".concat(className, " lg:hidden solid-icon-button "), size: 'sm' }), _jsx(SolidButton, { type: "button", icon: icon, leftIcon: !icon ? defaultIcon : undefined, className: "".concat(className, " hidden lg:inline-flex"), size: 'sm', children: label })] })) : (_jsx(SolidButton, { type: "button", icon: icon, leftIcon: !icon ? defaultIcon : undefined, className: "".concat(className), size: 'sm', children: label })) }) }));
|
|
29
29
|
};
|
|
30
30
|
//# sourceMappingURL=SolidCreateButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidCreateButton.js","sourceRoot":"","sources":["../../../../src/components/core/common/SolidCreateButton.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,sCAAsC,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAAC,EAAkG;;QAAhG,eAAe,qBAAA,EAAE,uBAAuB,6BAAA,EAAE,mBAAmB,yBAAA,EAAE,0BAA0B,EAA1B,kBAAkB,mBAAG,KAAK,KAAA;IACzH,IAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,IAAM,iBAAiB,GAAG;QACtB,IAAI,eAAe,EAAE;YACjB,IAAM,aAAa,GAAG,sCAAsC,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;YACxF,IAAM,KAAK,GAAG,IAAI,eAAe,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE,CAAC;YACtE,OAAO,KAAK,CAAC,CAAC,CAAC,UAAG,aAAa,cAAI,KAAK,CAAE,CAAC,CAAC,CAAC,aAAa,CAAC;SAC9D;QAED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E,UAAG,SAAS,kCAA+B,EACtD,IAAI,EAAC,IAAI,GACX,EAEF,KAAC,WAAW,IACR,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EACzC,SAAS,EAAE,UAAG,SAAS,2BAAwB,EAC/C,IAAI,EAAC,IAAI,YAER,KAAK,GACI,IACf,CACN,CAAC,CAAC,CAAC,CACA,KAAC,WAAW,IACR,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EACzC,SAAS,EAAE,UAAG,SAAS,CAAE,EACzB,IAAI,EAAC,IAAI,YAER,KAAK,GACI,CACjB,GAEE,GACL,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import Link from \"../../common/Link\";\nimport { usePathname } from \"../../../hooks/usePathname\";\nimport { normalizeSolidListTreeKanbanActionPath } from \"../../../helpers/routePaths\";\nimport { storeCurrentModelViewContext } from \"../../../helpers/modelViewPersistence\";\nimport { SolidButton } from \"../../shad-cn-ui\";\nimport { Plus } from \"lucide-react\";\n\nexport const SolidCreateButton = ({ createButtonUrl, createActionQueryParams, solidListViewLayout, responsiveIconOnly = false }: any) => {\n const pathName = usePathname();\n\n const resolveCreatePath = () => {\n if (createButtonUrl) {\n const normalizedUrl = normalizeSolidListTreeKanbanActionPath(pathName, createButtonUrl);\n const query = new URLSearchParams(createActionQueryParams).toString();\n return query ? `${normalizedUrl}?${query}` : normalizedUrl;\n }\n\n return `${normalizeSolidListTreeKanbanActionPath(pathName, \"form\")}/new?viewMode=edit`;\n };\n\n const createPath = resolveCreatePath();\n const storeCurrentViewContext = () => {\n storeCurrentModelViewContext();\n };\n\n const icon = solidListViewLayout?.attrs?.addButtonIcon;\n const label = solidListViewLayout?.attrs?.addButtonTitle || \"Add\";\n const className = solidListViewLayout?.attrs?.addButtonClassName || \"\";\n const defaultIcon = <Plus size={14} />;\n\n return (\n <div>\n <Link href={createPath} onClick={storeCurrentViewContext}>\n {responsiveIconOnly ? (\n <>\n <SolidButton\n type=\"button\"\n icon={icon}\n leftIcon={!icon ? defaultIcon : undefined}\n className={`${className} lg:hidden solid-icon-button `}\n size='sm'\n />\n\n <SolidButton\n type=\"button\"\n icon={icon}\n leftIcon={!icon ? defaultIcon : undefined}\n className={`${className} hidden lg:inline-flex`}\n size='sm'\n >\n {label}\n </SolidButton>\n </>\n ) : (\n <SolidButton\n type=\"button\"\n icon={icon}\n leftIcon={!icon ? defaultIcon : undefined}\n className={`${className}`}\n size='sm'\n >\n {label}\n </SolidButton>\n )}\n\n </Link>\n </div>\n );\n};\n"]}
|
|
@@ -31,27 +31,7 @@ export const SolidCreateButton = ({ createButtonUrl, createActionQueryParams, so
|
|
|
31
31
|
return (
|
|
32
32
|
<div>
|
|
33
33
|
<Link href={createPath} onClick={storeCurrentViewContext}>
|
|
34
|
-
{
|
|
35
|
-
<SolidButton
|
|
36
|
-
type="button"
|
|
37
|
-
icon={icon}
|
|
38
|
-
leftIcon={!icon ? defaultIcon : undefined}
|
|
39
|
-
className={`${className} max-[576px]:hidden sm:hidden lg:flex`}
|
|
40
|
-
size='sm'
|
|
41
|
-
>
|
|
42
|
-
{label}
|
|
43
|
-
</SolidButton>
|
|
44
|
-
|
|
45
|
-
{/* Mobile Version */}
|
|
46
|
-
<SolidButton
|
|
47
|
-
type="button"
|
|
48
|
-
icon={icon}
|
|
49
|
-
leftIcon={!icon ? defaultIcon : undefined}
|
|
50
|
-
className={`${className} lg:hidden solid-icon-button `}
|
|
51
|
-
size='sm'
|
|
52
|
-
/>
|
|
53
|
-
|
|
54
|
-
{/* {responsiveIconOnly ? (
|
|
34
|
+
{responsiveIconOnly ? (
|
|
55
35
|
<>
|
|
56
36
|
<SolidButton
|
|
57
37
|
type="button"
|
|
@@ -81,7 +61,7 @@ export const SolidCreateButton = ({ createButtonUrl, createActionQueryParams, so
|
|
|
81
61
|
>
|
|
82
62
|
{label}
|
|
83
63
|
</SolidButton>
|
|
84
|
-
)}
|
|
64
|
+
)}
|
|
85
65
|
|
|
86
66
|
</Link>
|
|
87
67
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidGlobalSearchElement.d.ts","sourceRoot":"","sources":["../../../../src/components/core/common/SolidGlobalSearchElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6F,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SolidGlobalSearchElement.d.ts","sourceRoot":"","sources":["../../../../src/components/core/common/SolidGlobalSearchElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6F,MAAM,OAAO,CAAC;AAclH,OAA0B,EAAE,eAAe,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AA0B3G,MAAM,MAAM,eAAe,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,sBAAsB,EAAE,MAAM,CAAC;CAClC,CAAA;AAoUD,eAAO,MAAM,2BAA2B,sBAAuB,GAAG,aAAa,GAAG,yBAAyB,MAAM,iBAAiB,MAAM,QAavI,CAAA;AAGD,eAAO,MAAM,mBAAmB,iBAAkB,GAAG,gBAAgB,GAAG,eAAe,GAAG,qBAAqB,GAAG,kBAAkB,YAAY,EAAE,qBAAqB,eAAe,EAAE,QAwBvL,CAAA;AAoID,eAAO,MAAM,wBAAwB,kFA+0DnC,CAAC"}
|