webspresso 0.0.109 → 0.0.110
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/core/client/adapter/datastar.js +175 -28
- package/core/client/api.js +312 -8
- package/core/client/controller.js +655 -30
- package/core/client/devtool.js +1134 -0
- package/core/client/forms.js +145 -2
- package/core/client/fragments.js +166 -10
- package/core/client/index.d.ts +19 -0
- package/core/client/index.js +47 -3
- package/core/client/lite.js +11 -0
- package/core/client/server-fragments.js +12 -3
- package/core/client/storage.js +339 -0
- package/core/client/utils.js +137 -0
- package/core/index.js +4 -0
- package/index.d.ts +204 -14
- package/index.js +4 -0
- package/package.json +7 -8
- package/src/client-runtime/bootstrap-swup.js +9 -0
- package/src/client-runtime/mount.js +6 -18
- package/src/client-runtime/resolve.js +3 -2
- package/src/file-router.js +12 -8
- package/src/routing/mount-discovered-routes.js +9 -2
- package/src/server.js +14 -24
- package/views/partials/webspresso-client-runtime.njk +1 -9
- package/src/client-runtime/bootstrap-alpine-swup.js +0 -34
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/* global Swup, SwupHeadPlugin, SwupScriptsPlugin, Alpine */
|
|
2
|
-
(function () {
|
|
3
|
-
if (typeof Swup === 'undefined' || typeof SwupHeadPlugin === 'undefined' || typeof SwupScriptsPlugin === 'undefined' || typeof Alpine === 'undefined') {
|
|
4
|
-
return;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
function ignoreVisit(url, ctx) {
|
|
8
|
-
var el = ctx && ctx.el;
|
|
9
|
-
if (el && el.closest && el.closest('[data-no-swup]')) return true;
|
|
10
|
-
try {
|
|
11
|
-
var u = new URL(url, window.location.origin);
|
|
12
|
-
var p = u.pathname;
|
|
13
|
-
if (p.indexOf('/_admin') === 0 || p.indexOf('/_webspresso') === 0) return true;
|
|
14
|
-
} catch (e) {
|
|
15
|
-
/* ignore */
|
|
16
|
-
}
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var swup = new Swup({
|
|
21
|
-
containers: ['#swup'],
|
|
22
|
-
plugins: [new SwupHeadPlugin(), new SwupScriptsPlugin()],
|
|
23
|
-
ignoreVisit: ignoreVisit,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
swup.hooks.on('content:replace', function () {
|
|
27
|
-
var root = document.querySelector('#swup');
|
|
28
|
-
if (root && typeof Alpine.initTree === 'function') {
|
|
29
|
-
Alpine.initTree(root);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
window.__webspressoSwup = swup;
|
|
34
|
-
})();
|