mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
fix(ci): fix netlify deployment by building to dist
- Move from root publishing to clean `dist/` directory - Create `scripts/build-dist.mjs` to orchestrate build and copy assets - Update `package.json` build script - Update `netlify.toml` to publish `dist/` - Ignore `dist/` in `.gitignore` Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
ccb60c3a7e
commit
0bfa3b08e8
638 files changed
+193490
-2
No files matched your search
Vendored
+76
@@ -0,0 +1,76 @@
|
||||
import { UploadModal } from "./components/UploadModal.js";
|
||||
|
||||
export function initUploadModal({
|
||||
app = null,
|
||||
uploadModalOverride = null,
|
||||
container = null,
|
||||
services = {},
|
||||
utilities = {},
|
||||
callbacks = {},
|
||||
eventTarget = null,
|
||||
} = {}) {
|
||||
const events = eventTarget instanceof EventTarget ? eventTarget : new EventTarget();
|
||||
|
||||
const {
|
||||
authService = null,
|
||||
r2Service = null,
|
||||
s3Service = null,
|
||||
storageService = null,
|
||||
} = services;
|
||||
|
||||
const {
|
||||
removeTrackingScripts: removeTrackingScriptsFn = null,
|
||||
setGlobalModalState: setGlobalModalStateFn = null,
|
||||
} = utilities;
|
||||
|
||||
const {
|
||||
publishVideoNote = null,
|
||||
showError = null,
|
||||
showSuccess = null,
|
||||
getCurrentPubkey = null,
|
||||
safeEncodeNpub = null,
|
||||
onSubmit = null,
|
||||
} = callbacks;
|
||||
|
||||
const modal =
|
||||
(typeof uploadModalOverride === "function"
|
||||
? uploadModalOverride({ app, eventTarget: events })
|
||||
: uploadModalOverride) ||
|
||||
new UploadModal({
|
||||
authService,
|
||||
r2Service,
|
||||
s3Service,
|
||||
storageService,
|
||||
publishVideoNote,
|
||||
removeTrackingScripts: removeTrackingScriptsFn,
|
||||
setGlobalModalState: setGlobalModalStateFn,
|
||||
showError,
|
||||
showSuccess,
|
||||
getCurrentPubkey,
|
||||
safeEncodeNpub,
|
||||
eventTarget: events,
|
||||
container,
|
||||
onRequestStorageSettings: () => {
|
||||
if (app && app.profileController && typeof app.profileController.show === "function") {
|
||||
app.profileController.show("storage");
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const boundSubmitHandler =
|
||||
typeof onSubmit === "function" ? (event) => onSubmit(event) : null;
|
||||
|
||||
if (boundSubmitHandler && typeof modal?.addEventListener === "function") {
|
||||
modal.addEventListener("upload:submit", boundSubmitHandler);
|
||||
}
|
||||
|
||||
return {
|
||||
modal,
|
||||
events,
|
||||
handlers: {
|
||||
submit: boundSubmitHandler,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default initUploadModal;
|
||||
Reference in new issue
Block a user