@burdenoff/microfe-eventfullymanaged 2026.1110.1 → 2026.1110.3
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/eventfullymanaged/api/eventApi.d.ts +9 -0
- package/dist/eventfullymanaged/api/eventApi.js +216 -199
- package/dist/eventfullymanaged/api/eventApi.js.map +1 -1
- package/dist/eventfullymanaged/components/ImageUploadField.d.ts +8 -1
- package/dist/eventfullymanaged/components/ImageUploadField.js +19 -17
- package/dist/eventfullymanaged/components/ImageUploadField.js.map +1 -1
- package/dist/eventfullymanaged/pages/events/EventDetailPage.js +275 -278
- package/dist/eventfullymanaged/pages/events/EventDetailPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/events/EventFormPage.js +129 -129
- package/dist/eventfullymanaged/pages/events/EventFormPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/events/SessionFormPage.js +103 -103
- package/dist/eventfullymanaged/pages/events/SessionFormPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/speakers/SpeakerFormPage.js +121 -130
- package/dist/eventfullymanaged/pages/speakers/SpeakerFormPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/sponsors/SponsorFormPage.js +5 -4
- package/dist/eventfullymanaged/pages/sponsors/SponsorFormPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/venues/FloorPlansPage.js +81 -80
- package/dist/eventfullymanaged/pages/venues/FloorPlansPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/venues/VenueFormPage.js +21 -15
- package/dist/eventfullymanaged/pages/venues/VenueFormPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -16,21 +16,23 @@ var h = e`
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
`;
|
|
19
|
-
function g({ folderPath: e, value: g, onUploaded: _,
|
|
20
|
-
let
|
|
19
|
+
function g({ folderPath: e, value: g, onUploaded: _, onUploadingChange: v, label: y, hint: b, className: x, disabled: S = !1 }) {
|
|
20
|
+
let C = t(), w = o(null), T = a(), [E, D] = s(!1), O = (e) => {
|
|
21
|
+
D(e), v?.(e);
|
|
22
|
+
}, k = async (t) => {
|
|
21
23
|
let i = t.target.files?.[0];
|
|
22
24
|
if (t.target.value = "", i) {
|
|
23
25
|
if (!i.type.startsWith("image/")) r.error("Unsupported file", "Please choose an image file.");
|
|
24
26
|
else {
|
|
25
|
-
|
|
27
|
+
O(!0);
|
|
26
28
|
try {
|
|
27
|
-
let t = await
|
|
29
|
+
let t = await C.mutate({
|
|
28
30
|
mutation: h,
|
|
29
31
|
variables: { path: e }
|
|
30
32
|
}), a = t.data?.ensureFolderByPath?.id;
|
|
31
33
|
if (!a) throw Error(t.error?.message ?? "Could not resolve the upload folder.");
|
|
32
34
|
let o = await m({
|
|
33
|
-
client:
|
|
35
|
+
client: C,
|
|
34
36
|
blob: i,
|
|
35
37
|
filename: i.name,
|
|
36
38
|
mimeType: i.type || "application/octet-stream",
|
|
@@ -40,18 +42,18 @@ function g({ folderPath: e, value: g, onUploaded: _, label: v, hint: y, classNam
|
|
|
40
42
|
} catch (e) {
|
|
41
43
|
r.error("Upload failed", e instanceof Error ? e.message : "Please try again.");
|
|
42
44
|
} finally {
|
|
43
|
-
|
|
45
|
+
O(!1);
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
};
|
|
48
50
|
return /* @__PURE__ */ l("div", {
|
|
49
|
-
className:
|
|
51
|
+
className: x,
|
|
50
52
|
children: [/* @__PURE__ */ l("div", {
|
|
51
53
|
className: "flex items-center gap-4",
|
|
52
54
|
children: [/* @__PURE__ */ c(i, {
|
|
53
55
|
value: g,
|
|
54
|
-
alt:
|
|
56
|
+
alt: y,
|
|
55
57
|
className: "h-16 w-16 shrink-0 rounded-card border border-border-seam object-cover",
|
|
56
58
|
fallback: /* @__PURE__ */ c("div", {
|
|
57
59
|
className: "flex h-16 w-16 shrink-0 items-center justify-center rounded-card border border-dashed border-border-default bg-bg-surface text-text-secondary",
|
|
@@ -63,22 +65,22 @@ function g({ folderPath: e, value: g, onUploaded: _, label: v, hint: y, classNam
|
|
|
63
65
|
type: "button",
|
|
64
66
|
variant: "secondary",
|
|
65
67
|
size: "sm",
|
|
66
|
-
disabled:
|
|
67
|
-
onClick: () =>
|
|
68
|
-
children: [
|
|
69
|
-
}),
|
|
68
|
+
disabled: S || E,
|
|
69
|
+
onClick: () => w.current?.click(),
|
|
70
|
+
children: [E ? /* @__PURE__ */ c(d, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ c(f, { className: "h-4 w-4" }), E ? "Uploading..." : g ? "Replace image" : y]
|
|
71
|
+
}), b ? /* @__PURE__ */ c("p", {
|
|
70
72
|
className: "text-xs text-text-secondary",
|
|
71
|
-
children:
|
|
73
|
+
children: b
|
|
72
74
|
}) : null]
|
|
73
75
|
})]
|
|
74
76
|
}), /* @__PURE__ */ c("input", {
|
|
75
|
-
ref:
|
|
76
|
-
id:
|
|
77
|
+
ref: w,
|
|
78
|
+
id: T,
|
|
77
79
|
type: "file",
|
|
78
80
|
accept: "image/*",
|
|
79
81
|
className: "sr-only",
|
|
80
|
-
"aria-label":
|
|
81
|
-
onChange: (e) => void
|
|
82
|
+
"aria-label": y,
|
|
83
|
+
onChange: (e) => void k(e)
|
|
82
84
|
})]
|
|
83
85
|
});
|
|
84
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageUploadField.js","names":["ENSURE_FOLDER","ImageUploadField","client","useApolloClient","inputRef","useRef","inputId","useId","uploading","setUploading","useState","handleSelect","file","event","folderResult","folderPath","folderId","uploaded","uploadBlobToFiles","onUploaded","toFileRef","notify","error","ResolvedImage","label","ImagePlus","Button","disabled","Loader2","Upload","value","hint"],"sources":["../../../src/eventfullymanaged/components/ImageUploadField.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useApolloClient } from '@apollo/client/react';\nimport { uploadBlobToFiles } from '@burdenoff/fe-libs/storage';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { ImagePlus, Loader2, Upload } from 'lucide-react';\nimport { useId, useRef, useState } from 'react';\n\nimport { toFileRef } from '../lib/fileRef';\nimport { notify } from '../lib/toast';\nimport { ResolvedImage } from './ResolvedImage';\n\n// wspace-files requires a real folder id (File.folderId FK) — resolve/create the\n// destination folder by path before uploading.\nconst ENSURE_FOLDER = gql`\n mutation EventfullymanagedEnsureFolder($path: String!) {\n ensureFolderByPath(path: $path) {\n id\n }\n }\n`;\n\ninterface EnsureFolderResponse {\n ensureFolderByPath?: { id: string } | null;\n}\n\ninterface ImageUploadFieldProps {\n /** Files-svc folder path the upload is stored under, e.g. \"/EventfullyManaged/FloorPlans\". */\n folderPath: string;\n /** Current persisted image value (a `files:<id>` reference or a URL), rendered as a preview. */\n value?: string | null;\n /** Called with the stored `files:<id>` reference once the upload completes. */\n onUploaded: (ref: string) => void | Promise<void>;\n /** Accessible label for the control. */\n label: string;\n /** Optional helper text shown under the control. */\n hint?: string;\n className?: string;\n disabled?: boolean;\n}\n\n/**\n * Reusable image upload control backed by wspace-files-svc via the shared\n * `uploadBlobToFiles` storage helper (presigned 3-step upload). It never keeps a\n * local blob store — on select it ensures the destination folder, uploads the\n * blob, and hands a stable `files:<fileId>` reference back to the caller to\n * persist through the entity's own mutation. Presigned URLs are never stored:\n * S3 caps them at 7 days, so the UI resolves the reference at render time\n * (see `lib/fileRef` and `ResolvedImage`).\n */\nexport function ImageUploadField({\n folderPath,\n value,\n onUploaded,\n label,\n hint,\n className,\n disabled = false,\n}: ImageUploadFieldProps) {\n const client = useApolloClient();\n const inputRef = useRef<HTMLInputElement | null>(null);\n const inputId = useId();\n const [uploading, setUploading] = useState(false);\n\n const handleSelect = async (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n // Reset the input so selecting the same file again re-triggers change.\n event.target.value = '';\n if (!file) {\n return;\n }\n if (!file.type.startsWith('image/')) {\n notify.error('Unsupported file', 'Please choose an image file.');\n return;\n }\n\n
|
|
1
|
+
{"version":3,"file":"ImageUploadField.js","names":["ENSURE_FOLDER","ImageUploadField","client","useApolloClient","inputRef","useRef","inputId","useId","uploading","setUploading","useState","setUploadingState","next","onUploadingChange","handleSelect","file","event","folderResult","folderPath","folderId","uploaded","uploadBlobToFiles","onUploaded","toFileRef","notify","error","ResolvedImage","label","ImagePlus","Button","disabled","Loader2","Upload","value","hint"],"sources":["../../../src/eventfullymanaged/components/ImageUploadField.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useApolloClient } from '@apollo/client/react';\nimport { uploadBlobToFiles } from '@burdenoff/fe-libs/storage';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { ImagePlus, Loader2, Upload } from 'lucide-react';\nimport { useId, useRef, useState } from 'react';\n\nimport { toFileRef } from '../lib/fileRef';\nimport { notify } from '../lib/toast';\nimport { ResolvedImage } from './ResolvedImage';\n\n// wspace-files requires a real folder id (File.folderId FK) — resolve/create the\n// destination folder by path before uploading.\nconst ENSURE_FOLDER = gql`\n mutation EventfullymanagedEnsureFolder($path: String!) {\n ensureFolderByPath(path: $path) {\n id\n }\n }\n`;\n\ninterface EnsureFolderResponse {\n ensureFolderByPath?: { id: string } | null;\n}\n\ninterface ImageUploadFieldProps {\n /** Files-svc folder path the upload is stored under, e.g. \"/EventfullyManaged/FloorPlans\". */\n folderPath: string;\n /** Current persisted image value (a `files:<id>` reference or a URL), rendered as a preview. */\n value?: string | null;\n /** Called with the stored `files:<id>` reference once the upload completes. */\n onUploaded: (ref: string) => void | Promise<void>;\n /**\n * Reports upload-in-progress state so the parent form can disable its own\n * Save/Create button — otherwise saving while an upload is still running\n * persists the entity without the new image, and the upload's own\n * completion update lands on a form the user has already left (BOFF-11231).\n */\n onUploadingChange?: (uploading: boolean) => void;\n /** Accessible label for the control. */\n label: string;\n /** Optional helper text shown under the control. */\n hint?: string;\n className?: string;\n disabled?: boolean;\n}\n\n/**\n * Reusable image upload control backed by wspace-files-svc via the shared\n * `uploadBlobToFiles` storage helper (presigned 3-step upload). It never keeps a\n * local blob store — on select it ensures the destination folder, uploads the\n * blob, and hands a stable `files:<fileId>` reference back to the caller to\n * persist through the entity's own mutation. Presigned URLs are never stored:\n * S3 caps them at 7 days, so the UI resolves the reference at render time\n * (see `lib/fileRef` and `ResolvedImage`).\n */\nexport function ImageUploadField({\n folderPath,\n value,\n onUploaded,\n onUploadingChange,\n label,\n hint,\n className,\n disabled = false,\n}: ImageUploadFieldProps) {\n const client = useApolloClient();\n const inputRef = useRef<HTMLInputElement | null>(null);\n const inputId = useId();\n const [uploading, setUploading] = useState(false);\n\n const setUploadingState = (next: boolean) => {\n setUploading(next);\n onUploadingChange?.(next);\n };\n\n const handleSelect = async (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n // Reset the input so selecting the same file again re-triggers change.\n event.target.value = '';\n if (!file) {\n return;\n }\n if (!file.type.startsWith('image/')) {\n notify.error('Unsupported file', 'Please choose an image file.');\n return;\n }\n\n setUploadingState(true);\n try {\n const folderResult = await client.mutate<EnsureFolderResponse>({\n mutation: ENSURE_FOLDER,\n variables: { path: folderPath },\n });\n const folderId = folderResult.data?.ensureFolderByPath?.id;\n if (!folderId) {\n throw new Error(folderResult.error?.message ?? 'Could not resolve the upload folder.');\n }\n\n const uploaded = await uploadBlobToFiles({\n client,\n blob: file,\n filename: file.name,\n mimeType: file.type || 'application/octet-stream',\n folderId,\n });\n\n await onUploaded(toFileRef(uploaded.id));\n notify.success('Image uploaded');\n } catch (error) {\n notify.error('Upload failed', error instanceof Error ? error.message : 'Please try again.');\n } finally {\n setUploadingState(false);\n }\n };\n\n return (\n <div className={className}>\n <div className=\"flex items-center gap-4\">\n <ResolvedImage\n value={value}\n alt={label}\n className=\"h-16 w-16 shrink-0 rounded-card border border-border-seam object-cover\"\n fallback={\n <div className=\"flex h-16 w-16 shrink-0 items-center justify-center rounded-card border border-dashed border-border-default bg-bg-surface text-text-secondary\">\n <ImagePlus className=\"h-5 w-5\" />\n </div>\n }\n />\n <div className=\"space-y-1\">\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n disabled={disabled || uploading}\n onClick={() => inputRef.current?.click()}\n >\n {uploading ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <Upload className=\"h-4 w-4\" />}\n {uploading ? 'Uploading...' : value ? 'Replace image' : label}\n </Button>\n {hint ? <p className=\"text-xs text-text-secondary\">{hint}</p> : null}\n </div>\n </div>\n <input\n ref={inputRef}\n id={inputId}\n type=\"file\"\n accept=\"image/*\"\n className=\"sr-only\"\n aria-label={label}\n onChange={(event) => void handleSelect(event)}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAaA,IAAMA,IAAgB,CAAG;;;;;;;AA2CzB,SAAgBC,EAAiB,EAC/B,eACA,UACA,eACA,sBACA,UACA,SACA,cACA,cAAW,MACa;CACxB,IAAMC,IAASC,EAAgB,GACzBC,IAAWC,EAAgC,IAAI,GAC/CC,IAAUC,EAAM,GAChB,CAACC,GAAWC,KAAgBC,EAAS,EAAK,GAE1CC,KAAqB,MAAkB;EAE3C,AADAF,EAAaG,CAAI,GACjBC,IAAoBD,CAAI;CAC1B,GAEME,IAAe,OAAO,MAA+C;EACzE,IAAMC,IAAOC,EAAM,OAAO,QAAQ;EAGlC,IADA,EAAM,OAAO,QAAQ,IAChBD,GAGL;OAAI,CAACA,EAAK,KAAK,WAAW,QAAQ,GAChC,EAAO,MAAM,oBAAoB,8BAA8B;QAIjE;MAAkB,EAAI;IACtB,IAAI;KACF,IAAME,IAAe,MAAMf,EAAO,OAA6B;MAC7D,UAAUF;MACV,WAAW,EAAE,MAAMkB,EAAW;KAChC,CAAC,GACKC,IAAWF,EAAa,MAAM,oBAAoB;KACxD,IAAI,CAACE,GACH,MAAU,MAAMF,EAAa,OAAO,WAAW,sCAAsC;KAGvF,IAAMG,IAAW,MAAMC,EAAkB;MACvC;MACA,MAAMN;MACN,UAAUA,EAAK;MACf,UAAUA,EAAK,QAAQ;MACvB;KACF,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