@absolutejs/absolute 0.19.0-beta.820 → 0.19.0-beta.821
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-ilhHSf/src/core/streamingSlotRegistrar.ts
|
|
5
5
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
6
6
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
7
7
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-ilhHSf/src/core/streamingSlotRegistrar.ts
|
|
5
5
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
6
6
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
7
7
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
|
48
48
|
getWarningController()?.maybeWarn(primitiveName);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
// .angular-partial-tmp-
|
|
51
|
+
// .angular-partial-tmp-ilhHSf/src/core/streamingSlotRegistry.ts
|
|
52
52
|
var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
53
53
|
var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
|
|
54
54
|
var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* page.svelte.ts generated by Svelte v5.55.0 */
|
|
2
|
+
import * as $ from 'svelte/internal/client';
|
|
3
|
+
|
|
4
|
+
const initialUrl = () => {
|
|
5
|
+
if (typeof window !== "undefined") {
|
|
6
|
+
return new URL(window.location.href);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return new URL("http://localhost/");
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const initialState = () => ({ params: {}, state: undefined, url: initialUrl() });
|
|
13
|
+
const inner = $.proxy(initialState());
|
|
14
|
+
|
|
15
|
+
export const page = inner;
|
|
16
|
+
|
|
17
|
+
export const setPage = (next) => {
|
|
18
|
+
if (next.url !== undefined) inner.url = next.url;
|
|
19
|
+
if (next.params !== undefined) inner.params = next.params;
|
|
20
|
+
if (next.state !== undefined) inner.state = next.state;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const seedPage = (url, params = {}) => {
|
|
24
|
+
inner.url = url;
|
|
25
|
+
inner.params = params;
|
|
26
|
+
inner.state = undefined;
|
|
27
|
+
};
|
package/package.json
CHANGED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { PageState } from '../../types/svelteRouter';
|
|
2
|
-
|
|
3
|
-
const initialUrl = () => {
|
|
4
|
-
if (typeof window !== 'undefined') {
|
|
5
|
-
return new URL(window.location.href);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// On the server we don't know the URL yet — Router.svelte initializes
|
|
9
|
-
// it from its `url` prop. Use a placeholder that Router.svelte will
|
|
10
|
-
// overwrite immediately.
|
|
11
|
-
return new URL('http://localhost/');
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const initialState = (): PageState => ({
|
|
15
|
-
params: {},
|
|
16
|
-
state: undefined,
|
|
17
|
-
url: initialUrl()
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const inner = $state<PageState>(initialState());
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Reactive route state. Mirrors SvelteKit's `page` from `$app/state`:
|
|
24
|
-
*
|
|
25
|
-
* import { page } from '@absolutejs/absolute/svelte/router';
|
|
26
|
-
* page.url.pathname // current path (reactive)
|
|
27
|
-
* page.url.searchParams // parsed URLSearchParams (reactive)
|
|
28
|
-
* page.params.id // active route params (reactive)
|
|
29
|
-
* page.state // history.state for the current entry
|
|
30
|
-
*
|
|
31
|
-
* Backed by `$state`. Direct property access in templates re-renders.
|
|
32
|
-
*/
|
|
33
|
-
export const page = inner;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Internal — only Router.svelte and the navigation primitives call this.
|
|
37
|
-
* Replaces the entire page state in one assignment so subscribers fire
|
|
38
|
-
* once per navigation rather than once per mutated field.
|
|
39
|
-
*/
|
|
40
|
-
export const setPage = (next: Partial<PageState>) => {
|
|
41
|
-
if (next.url !== undefined) inner.url = next.url;
|
|
42
|
-
if (next.params !== undefined) inner.params = next.params;
|
|
43
|
-
if (next.state !== undefined) inner.state = next.state;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Internal — used during SSR to seed the page state before render so
|
|
48
|
-
* `<Route>` blocks see the correct `page.url`.
|
|
49
|
-
*/
|
|
50
|
-
export const seedPage = (
|
|
51
|
-
url: URL,
|
|
52
|
-
params: Record<string, string | undefined> = {}
|
|
53
|
-
) => {
|
|
54
|
-
inner.url = url;
|
|
55
|
-
inner.params = params;
|
|
56
|
-
inner.state = undefined;
|
|
57
|
-
};
|