changes
This commit is contained in:
parent
bea29624ab
commit
81a9f68a22
58 changed files with 280 additions and 815 deletions
|
@ -1,6 +1,7 @@
|
|||
// We import the CSS which is extracted to its own file by esbuild.
|
||||
// Remove this line if you add a your own CSS build pipeline (e.g postcss).
|
||||
import "../css/app.css"
|
||||
import Alpine from "alpinejs"
|
||||
|
||||
// If you want to use Phoenix channels, run `mix help phx.gen.channel`
|
||||
// to get started and then uncomment the line below.
|
||||
|
@ -25,10 +26,21 @@ import "phoenix_html"
|
|||
import {Socket} from "phoenix"
|
||||
import {LiveSocket} from "phoenix_live_view"
|
||||
import topbar from "../vendor/topbar"
|
||||
|
||||
window.Alpine = Alpine;
|
||||
Alpine.start();
|
||||
let hooks = {};
|
||||
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
|
||||
let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}})
|
||||
|
||||
let liveSocket = new LiveSocket("/live", Socket, {
|
||||
params: { _csrf_token: csrfToken },
|
||||
hooks: hooks,
|
||||
dom: {
|
||||
onBeforeElUpdated(from, to) {
|
||||
if (from._x_dataStack) {
|
||||
window.Alpine.clone(from, to);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
// Show progress bar on live navigation and form submits
|
||||
topbar.config({barColors: {0: "#29d"}, shadowColor: "rgba(0, 0, 0, .3)"})
|
||||
window.addEventListener("phx:page-loading-start", info => topbar.show())
|
||||
|
|
15
assets/package.json
Normal file
15
assets/package.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"name": "assets",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"alpinejs": "^3.10.2"
|
||||
}
|
||||
}
|
25
assets/pnpm-lock.yaml
generated
Normal file
25
assets/pnpm-lock.yaml
generated
Normal file
|
@ -0,0 +1,25 @@
|
|||
lockfileVersion: 5.4
|
||||
|
||||
specifiers:
|
||||
alpinejs: ^3.10.2
|
||||
|
||||
dependencies:
|
||||
alpinejs: 3.10.2
|
||||
|
||||
packages:
|
||||
|
||||
/@vue/reactivity/3.1.5:
|
||||
resolution: {integrity: sha512-1tdfLmNjWG6t/CsPldh+foumYFo3cpyCHgBYQ34ylaMsJ+SNHQ1kApMIa8jN+i593zQuaw3AdWH0nJTARzCFhg==}
|
||||
dependencies:
|
||||
'@vue/shared': 3.1.5
|
||||
dev: false
|
||||
|
||||
/@vue/shared/3.1.5:
|
||||
resolution: {integrity: sha512-oJ4F3TnvpXaQwZJNF3ZK+kLPHKarDmJjJ6jyzVNDKH9md1dptjC7lWR//jrGuLdek/U6iltWxqAnYOu8gCiOvA==}
|
||||
dev: false
|
||||
|
||||
/alpinejs/3.10.2:
|
||||
resolution: {integrity: sha512-P6DTX78J94FgsskS3eS23s26hfb0NWQZUidBnkUK7fId1x64/kLm5E79lL3HNItUmHDCKOHvfP8EAcuCVab89w==}
|
||||
dependencies:
|
||||
'@vue/reactivity': 3.1.5
|
||||
dev: false
|
Loading…
Add table
Add a link
Reference in a new issue