@absolutejs/absolute 0.19.0-beta.1030 → 0.19.0-beta.1032
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/angular/browser.js +18 -16
- package/dist/angular/browser.js.map +5 -5
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/hmrPreserveCore.ts +83 -118
- package/dist/angular/index.js +49 -49
- package/dist/angular/index.js.map +12 -12
- package/dist/angular/server.js +34 -34
- package/dist/angular/server.js.map +10 -10
- package/dist/build.js +135 -135
- package/dist/build.js.map +26 -26
- package/dist/cli/config/client.js +1 -1
- package/dist/cli/config/server.js +43 -43
- package/dist/cli/index.js +247 -168
- package/dist/client/index.js +9 -9
- package/dist/client/index.js.map +8 -8
- package/dist/dev/client/errorOverlay.ts +4 -4
- package/dist/dev/client/handlers/angularHmrShim.ts +17 -17
- package/dist/dev/client/handlers/angularRemount.ts +6 -4
- package/dist/dev/client/handlers/angularRemountWiring.ts +1 -1
- package/dist/dev/client/hmrToast.ts +18 -18
- package/dist/index.js +149 -150
- package/dist/index.js.map +31 -31
- package/dist/islands/browser.js.map +1 -1
- package/dist/islands/index.js +5 -5
- package/dist/islands/index.js.map +6 -6
- package/dist/react/browser.js.map +1 -1
- package/dist/react/components/index.js +2 -2
- package/dist/react/components/index.js.map +3 -3
- package/dist/react/hooks/index.js.map +1 -1
- package/dist/react/index.js +21 -21
- package/dist/react/index.js.map +9 -9
- package/dist/react/server.js +17 -17
- package/dist/react/server.js.map +5 -5
- package/dist/src/angular/hmrPreserveCore.d.ts +5 -18
- package/dist/src/angular/islands.d.ts +1 -1
- package/dist/src/cli/config/packageJson/editPackageJson.d.ts +2 -2
- package/dist/src/cli/config/schema/fromJsonSchema.d.ts +1 -1
- package/dist/src/client/hydrators/react.d.ts +1 -1
- package/dist/src/client/hydrators/svelte.d.ts +1 -1
- package/dist/src/client/hydrators/vue.d.ts +1 -1
- package/dist/src/client/islandStore.d.ts +3 -3
- package/dist/src/core/devRouteRegistrationCallsite.d.ts +1 -5
- package/dist/src/dev/angular/fastHmrCompiler.d.ts +2 -2
- package/dist/src/dev/angular/hmrCompiler.d.ts +1 -1
- package/dist/src/dev/angular/resolveOwningComponents.d.ts +1 -1
- package/dist/src/svelte/router/hashMode.d.ts +1 -6
- package/dist/src/svelte/router/matchPath.d.ts +2 -22
- package/dist/src/svelte/router/page.svelte.d.ts +1 -10
- package/dist/src/svelte/router/prefetchCache.d.ts +2 -6
- package/dist/src/utils/generatedDir.d.ts +1 -1
- package/dist/src/utils/inlinePageCss.d.ts +1 -3
- package/dist/src/utils/jsonLd.d.ts +1 -1
- package/dist/src/utils/loadConfig.d.ts +2 -3
- package/dist/src/utils/resolveConvention.d.ts +1 -1
- package/dist/src/utils/runtimeMode.d.ts +1 -1
- package/dist/src/vue/defineVuePage.d.ts +1 -11
- package/dist/svelte/browser.js.map +1 -1
- package/dist/svelte/index.js +26 -26
- package/dist/svelte/index.js.map +9 -9
- package/dist/svelte/router/hashMode.ts +6 -12
- package/dist/svelte/router/matchPath.ts +23 -45
- package/dist/svelte/router/page.d.ts +1 -10
- package/dist/svelte/router/page.js +6 -6
- package/dist/svelte/router/prefetchCache.ts +12 -20
- package/dist/svelte/server.js +22 -22
- package/dist/svelte/server.js.map +5 -5
- package/dist/vue/browser.js +2 -2
- package/dist/vue/browser.js.map +4 -4
- package/dist/vue/index.js +29 -29
- package/dist/vue/index.js.map +11 -11
- package/dist/vue/server.js +24 -24
- package/dist/vue/server.js.map +6 -6
- package/package.json +38 -38
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ComponentType } from 'react';
|
|
2
|
-
export declare const isReactComponent: (value: unknown) => value is ComponentType<Record<string, unknown>>;
|
|
3
2
|
export declare const hydrateReactIsland: (component: ComponentType<Record<string, unknown>>, element: HTMLElement, props: unknown) => void;
|
|
3
|
+
export declare const isReactComponent: (value: unknown) => value is ComponentType<Record<string, unknown>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const isSvelteComponent: (value: unknown) => value is import("svelte").Component<Record<string, unknown>>;
|
|
2
1
|
export declare const hydrateSvelteIsland: (component: import("svelte").Component<Record<string, unknown>>, element: HTMLElement, props: unknown) => void;
|
|
2
|
+
export declare const isSvelteComponent: (value: unknown) => value is import("svelte").Component<Record<string, unknown>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const isVueComponent: (value: unknown) => value is import("vue").Component<Record<string, unknown>>;
|
|
2
1
|
export declare const hydrateVueIsland: (component: import("vue").Component<Record<string, unknown>>, element: HTMLElement, props: unknown) => void;
|
|
2
|
+
export declare const isVueComponent: (value: unknown) => value is import("vue").Component<Record<string, unknown>>;
|
|
@@ -7,8 +7,8 @@ type IslandStoreInstance = {
|
|
|
7
7
|
applyExternalSnapshot: (snapshot: IslandStoreSnapshot) => void;
|
|
8
8
|
store: AnyIslandStore;
|
|
9
9
|
};
|
|
10
|
-
declare const ABSOLUTE_ISLAND_STATE = "__ABS_ISLAND_STATE__";
|
|
11
|
-
declare const ABSOLUTE_ISLAND_STORES = "__ABS_ISLAND_STORES__";
|
|
10
|
+
export declare const ABSOLUTE_ISLAND_STATE = "__ABS_ISLAND_STATE__";
|
|
11
|
+
export declare const ABSOLUTE_ISLAND_STORES = "__ABS_ISLAND_STORES__";
|
|
12
12
|
declare global {
|
|
13
13
|
var __ABS_ISLAND_STATE__: IslandStateSnapshot | undefined;
|
|
14
14
|
var __ABS_ISLAND_STORES__: Map<string, Set<IslandStoreInstance>> | undefined;
|
|
@@ -19,4 +19,4 @@ export declare const initializeIslandStores: (state: IslandStateSnapshot) => voi
|
|
|
19
19
|
export declare const readIslandStore: <TState extends IslandStoreState, TSelected>(store: StoreApi<TState>, selector: (state: TState) => TSelected) => TSelected;
|
|
20
20
|
export declare const resetIslandStoreForTesting: () => void;
|
|
21
21
|
export declare const subscribeIslandStore: <TState extends IslandStoreState, TSelected>(store: StoreApi<TState>, selector: (state: TState) => TSelected, listener: (value: TSelected) => void) => () => void;
|
|
22
|
-
export {
|
|
22
|
+
export {};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
export declare const isPageHandler: (handler: unknown) => boolean;
|
|
2
|
-
/** Returns the unwrapped handler source. In dev the dev wrapper's
|
|
3
|
-
* `.toString()` is opaque, so we use the registration-time-captured
|
|
4
|
-
* original handler. In prod nothing wraps, so `route.handler` IS the
|
|
5
|
-
* original. Returns `undefined` for non-functions. */
|
|
6
1
|
export declare const getOriginalPageHandlerSource: (handler: unknown) => string | undefined;
|
|
2
|
+
export declare const isPageHandler: (handler: unknown) => boolean;
|
|
7
3
|
export declare const getCurrentRouteRegistrationCallsite: () => string | undefined;
|
|
8
4
|
export declare const patchElysiaRouteRegistrationCallsites: () => void;
|
|
@@ -46,9 +46,9 @@ export type FastHmrFailure = {
|
|
|
46
46
|
};
|
|
47
47
|
export type FastHmrResult = FastHmrSuccess | FastHmrFailure;
|
|
48
48
|
export declare const takePendingModule: (id: string) => string | undefined;
|
|
49
|
-
export declare const recordFingerprint: (id: string, fp: ComponentFingerprint) => void;
|
|
50
|
-
export declare const primeComponentFingerprint: (componentFilePath: string) => Promise<void>;
|
|
51
49
|
export declare const invalidateFingerprintCache: () => void;
|
|
50
|
+
export declare const primeComponentFingerprint: (componentFilePath: string) => Promise<void>;
|
|
51
|
+
export declare const recordFingerprint: (id: string, fp: ComponentFingerprint) => void;
|
|
52
52
|
export type TryFastHmrParams = {
|
|
53
53
|
componentFilePath: string;
|
|
54
54
|
className: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getApplyMetadataModule: (encodedId: string) => Promise<string | null>;
|
|
2
1
|
export declare const encodeHmrComponentId: (absoluteFilePath: string, className: string) => string;
|
|
2
|
+
export declare const getApplyMetadataModule: (encodedId: string) => Promise<string | null>;
|
|
@@ -9,8 +9,8 @@ export declare const resolveOwningComponents: (params: {
|
|
|
9
9
|
changedFilePath: string;
|
|
10
10
|
userAngularRoot: string;
|
|
11
11
|
}) => AffectedEntity[];
|
|
12
|
+
export declare const invalidateResourceIndex: () => void;
|
|
12
13
|
export declare const resolveDescendantsOfParent: (params: {
|
|
13
14
|
changedFilePath: string;
|
|
14
15
|
userAngularRoot: string;
|
|
15
16
|
}) => AffectedEntity[];
|
|
16
|
-
export declare const invalidateResourceIndex: () => void;
|
|
@@ -12,10 +12,5 @@
|
|
|
12
12
|
* Returns the part after `#/`, prefixed with `/` so it parses as a
|
|
13
13
|
* normal pathname.
|
|
14
14
|
*/
|
|
15
|
-
export declare const hashPathnameOf: (url: URL) => string;
|
|
16
|
-
/**
|
|
17
|
-
* Build a hash URL from a routable pathname. Used by goto() / pushState()
|
|
18
|
-
* when in hash mode — converts `/dashboard/settings` to `#/dashboard/settings`
|
|
19
|
-
* and writes the result back to the URL.
|
|
20
|
-
*/
|
|
21
15
|
export declare const buildHashHref: (pathname: string) => string;
|
|
16
|
+
export declare const hashPathnameOf: (url: URL) => string;
|
|
@@ -17,17 +17,6 @@ type CompiledPattern = {
|
|
|
17
17
|
* Compile a `<Route path>` pattern into segments + a specificity score.
|
|
18
18
|
* Higher score = more specific (longer static prefix beats parameterised).
|
|
19
19
|
*/
|
|
20
|
-
export declare const compilePattern: (pattern: string) => CompiledPattern;
|
|
21
|
-
/**
|
|
22
|
-
* Match a URL pathname against a compiled pattern. Returns the extracted
|
|
23
|
-
* params on a successful match, or a miss otherwise.
|
|
24
|
-
*/
|
|
25
|
-
export declare const matchPattern: <Path extends string>(pattern: CompiledPattern, pathname: string) => RouteMatchResult<ExtractRouteParams<Path>>;
|
|
26
|
-
/**
|
|
27
|
-
* Stable comparator for compiled patterns. Higher specificity sorts first.
|
|
28
|
-
* When two patterns have equal score, declaration order (the original index)
|
|
29
|
-
* decides — passed in via the `index` field on each entry.
|
|
30
|
-
*/
|
|
31
20
|
export declare const comparePatterns: (a: {
|
|
32
21
|
score: number;
|
|
33
22
|
index: number;
|
|
@@ -35,16 +24,7 @@ export declare const comparePatterns: (a: {
|
|
|
35
24
|
score: number;
|
|
36
25
|
index: number;
|
|
37
26
|
}) => number;
|
|
38
|
-
|
|
39
|
-
* Join a basepath stack with a child pattern, producing an absolute pattern
|
|
40
|
-
* that the route matcher can compile against an incoming pathname.
|
|
41
|
-
*
|
|
42
|
-
* Handles slash edge cases:
|
|
43
|
-
* joinBasepath('', '/users') → '/users'
|
|
44
|
-
* joinBasepath('/portal', '/users') → '/portal/users'
|
|
45
|
-
* joinBasepath('/portal/', '/users') → '/portal/users'
|
|
46
|
-
* joinBasepath('/portal', 'users') → '/portal/users'
|
|
47
|
-
* joinBasepath('/portal', '/') → '/portal'
|
|
48
|
-
*/
|
|
27
|
+
export declare const compilePattern: (pattern: string) => CompiledPattern;
|
|
49
28
|
export declare const joinBasepath: (basepath: string, pattern: string) => string;
|
|
29
|
+
export declare const matchPattern: <Path extends string>(pattern: CompiledPattern, pathname: string) => RouteMatchResult<ExtractRouteParams<Path>>;
|
|
50
30
|
export {};
|
|
@@ -11,14 +11,5 @@ import type { PageState } from '../../../types/svelteRouter';
|
|
|
11
11
|
* Backed by `$state`. Direct property access in templates re-renders.
|
|
12
12
|
*/
|
|
13
13
|
export declare const page: PageState;
|
|
14
|
-
/**
|
|
15
|
-
* Internal — only Router.svelte and the navigation primitives call this.
|
|
16
|
-
* Replaces the entire page state in one assignment so subscribers fire
|
|
17
|
-
* once per navigation rather than once per mutated field.
|
|
18
|
-
*/
|
|
19
|
-
export declare const setPage: (next: Partial<PageState>) => void;
|
|
20
|
-
/**
|
|
21
|
-
* Internal — used during SSR to seed the page state before render so
|
|
22
|
-
* `<Route>` blocks see the correct `page.url`.
|
|
23
|
-
*/
|
|
24
14
|
export declare const seedPage: (url: URL, params?: Record<string, string | undefined>) => void;
|
|
15
|
+
export declare const setPage: (next: Partial<PageState>) => void;
|
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
* Prefetch a URL into the in-memory cache. No-op if the user has signalled
|
|
3
3
|
* data-saver / reduced-data, or if the URL is already cached.
|
|
4
4
|
*/
|
|
5
|
-
export declare const prefetch: (url: string) => void;
|
|
6
|
-
/**
|
|
7
|
-
* Consume a cached prefetch entry on actual navigation, removing it from
|
|
8
|
-
* the cache. Returns the cached Promise<Response> or undefined.
|
|
9
|
-
*/
|
|
10
|
-
export declare const consumePrefetch: (url: string) => Promise<Response> | undefined;
|
|
11
5
|
export declare const clearPrefetchCache: () => void;
|
|
6
|
+
export declare const consumePrefetch: (url: string) => Promise<Response> | undefined;
|
|
7
|
+
export declare const prefetch: (url: string) => void;
|
|
12
8
|
type HoverHandle = {
|
|
13
9
|
cancel: () => void;
|
|
14
10
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type GeneratedFramework = 'angular' | 'vue' | 'svelte' | 'react' | 'ember';
|
|
2
|
-
export declare const getGeneratedRoot: (projectRoot?: string) => string;
|
|
3
2
|
export declare const getFrameworkGeneratedDir: (framework: GeneratedFramework, projectRoot?: string) => string;
|
|
3
|
+
export declare const getGeneratedRoot: (projectRoot?: string) => string;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export declare const readSiblingCss: (siblingJsPath: string | undefined) => Promise<string>;
|
|
2
|
-
/** Splice an inline <style> block before `</head>` in the user's
|
|
3
|
-
* headTag. No-op when the css string is empty. */
|
|
4
1
|
export declare const injectInlineCss: <T extends string>(headTag: T, css: string) => T;
|
|
2
|
+
export declare const readSiblingCss: (siblingJsPath: string | undefined) => Promise<string>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { JsonLdSchema } from '../../types/jsonLd';
|
|
2
|
-
export declare const serializeJsonLd: (schema: JsonLdSchema | JsonLdSchema[]) => string;
|
|
3
2
|
export declare const jsonLd: (schema: JsonLdSchema | JsonLdSchema[]) => string;
|
|
3
|
+
export declare const serializeJsonLd: (schema: JsonLdSchema | JsonLdSchema[]) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConfigInput, WorkspaceConfig } from '../../types/build';
|
|
2
|
-
declare const isWorkspaceConfig: (config: ConfigInput) => config is WorkspaceConfig;
|
|
3
|
-
declare const getWorkspaceServices: (config: ConfigInput) => WorkspaceConfig;
|
|
2
|
+
export declare const isWorkspaceConfig: (config: ConfigInput) => config is WorkspaceConfig;
|
|
3
|
+
export declare const getWorkspaceServices: (config: ConfigInput) => WorkspaceConfig;
|
|
4
4
|
export declare const loadConfig: (configPath?: string) => Promise<{
|
|
5
5
|
buildDirectory?: string;
|
|
6
6
|
assetsDirectory?: string;
|
|
@@ -53,4 +53,3 @@ export declare const loadConfig: (configPath?: string) => Promise<{
|
|
|
53
53
|
shutdown?: import("..").ServiceShutdownConfig;
|
|
54
54
|
}>;
|
|
55
55
|
export declare const loadRawConfig: (configPath?: string) => Promise<ConfigInput>;
|
|
56
|
-
export { getWorkspaceServices, isWorkspaceConfig };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ConventionsMap } from '../../types/conventions';
|
|
2
2
|
export declare const derivePageName: (pagePath: string) => string;
|
|
3
3
|
export declare const getConventions: () => ConventionsMap;
|
|
4
|
+
export declare const hasErrorConvention: (framework: keyof ConventionsMap) => boolean;
|
|
4
5
|
export declare const resolveErrorConventionPath: (framework: keyof ConventionsMap, pageName: string) => string | undefined;
|
|
5
6
|
export declare const resolveNotFoundConventionPath: (framework: keyof ConventionsMap) => string | undefined;
|
|
6
|
-
export declare const hasErrorConvention: (framework: keyof ConventionsMap) => boolean;
|
|
7
7
|
export declare const setConventions: (map: ConventionsMap) => void;
|
|
8
8
|
export declare const renderConventionError: (framework: keyof ConventionsMap, pageName: string, error: unknown) => Promise<Response | null>;
|
|
9
9
|
export declare const renderConventionNotFound: (framework: keyof ConventionsMap) => Promise<Response | null>;
|
|
@@ -2,15 +2,5 @@ import type { VueRoutes, VueSetupApp } from '../../types/vue';
|
|
|
2
2
|
/** Identity helper that types a Vue page's `setupApp` export without
|
|
3
3
|
* forcing the user to `import type { VueSetupApp }` every time. Use as
|
|
4
4
|
* `export const setupApp = defineVueSetupApp(async (app, ctx) => { ... });` */
|
|
5
|
-
export declare const defineVueSetupApp: (hook: VueSetupApp) => VueSetupApp;
|
|
6
|
-
/** Identity helper that signals — to humans and to TypeScript — that a
|
|
7
|
-
* Vue page's `routes` export is the input to AbsoluteJS's auto-generated
|
|
8
|
-
* vue-router. Without this, `export const routes = [...]` reads as an
|
|
9
|
-
* ordinary const that nobody references locally; the import + call make
|
|
10
|
-
* the contract explicit (mirroring Vue's `defineProps` convention).
|
|
11
|
-
*
|
|
12
|
-
* At runtime this is identity (`(routes) => routes`); the actual
|
|
13
|
-
* router-creation code lives in the compile-time transform applied to
|
|
14
|
-
* the page's `<script>` block. Use as
|
|
15
|
-
* `export const routes = defineRoutes([{ path: '/foo', component: Foo }]);` */
|
|
16
5
|
export declare const defineRoutes: <T extends VueRoutes>(routes: T) => T;
|
|
6
|
+
export declare const defineVueSetupApp: (hook: VueSetupApp) => VueSetupApp;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"import type { RuntimeIslandRenderProps } from '../../types/island';\nimport {\n\tgetIslandMarkerAttributes,\n\tserializeIslandAttributes\n} from '../core/islandMarkupAttributes';\n\nconst getIslandSnapshot = (slotId: string) => {\n\tif (typeof window === 'undefined') {\n\t\treturn null;\n\t}\n\n\tconst snapshot = window.__ABS_SVELTE_ISLAND_HTML__;\n\tif (!snapshot || typeof snapshot !== 'object') {\n\t\treturn null;\n\t}\n\n\tconst value = snapshot[slotId];\n\n\treturn typeof value === 'string' ? value : null;\n};\n\nconst buildFallbackMarkup = (props: RuntimeIslandRenderProps) =>\n\t`<div ${serializeIslandAttributes(getIslandMarkerAttributes(props))}></div>`;\n\nexport const resolveIslandHtml = (\n\tslotId: string,\n\tprops: RuntimeIslandRenderProps\n) => {\n\tconst snapshot = getIslandSnapshot(slotId);\n\tif (snapshot !== null) {\n\t\treturn snapshot;\n\t}\n\n\tif (typeof document === 'undefined') {\n\t\treturn buildFallbackMarkup(props);\n\t}\n\n\tconst slot = document.querySelector<HTMLElement>(\n\t\t`[data-absolute-island-slot=\"${slotId}\"]`\n\t);\n\n\treturn slot?.innerHTML ?? buildFallbackMarkup(props);\n};\n",
|
|
10
10
|
"const createStoreImpl = (createState) => {\n let state;\n const listeners = /* @__PURE__ */ new Set();\n const setState = (partial, replace) => {\n const nextState = typeof partial === \"function\" ? partial(state) : partial;\n if (!Object.is(nextState, state)) {\n const previousState = state;\n state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n listeners.forEach((listener) => listener(state, previousState));\n }\n };\n const getState = () => state;\n const getInitialState = () => initialState;\n const subscribe = (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n };\n const api = { setState, getState, getInitialState, subscribe };\n const initialState = state = createState(setState, getState, api);\n return api;\n};\nconst createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);\n\nexport { createStore };\n",
|
|
11
11
|
"const reduxImpl = (reducer, initial) => (set, _get, api) => {\n api.dispatch = (action) => {\n set((state) => reducer(state, action), false, action);\n return action;\n };\n api.dispatchFromDevtools = true;\n return { dispatch: (...args) => api.dispatch(...args), ...initial };\n};\nconst redux = reduxImpl;\n\nconst shouldDispatchFromDevtools = (api) => !!api.dispatchFromDevtools && typeof api.dispatch === \"function\";\nconst trackedConnections = /* @__PURE__ */ new Map();\nconst getTrackedConnectionState = (name) => {\n const api = trackedConnections.get(name);\n if (!api) return {};\n return Object.fromEntries(\n Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])\n );\n};\nconst extractConnectionInformation = (store, extensionConnector, options) => {\n if (store === void 0) {\n return {\n type: \"untracked\",\n connection: extensionConnector.connect(options)\n };\n }\n const existingConnection = trackedConnections.get(options.name);\n if (existingConnection) {\n return { type: \"tracked\", store, ...existingConnection };\n }\n const newConnection = {\n connection: extensionConnector.connect(options),\n stores: {}\n };\n trackedConnections.set(options.name, newConnection);\n return { type: \"tracked\", store, ...newConnection };\n};\nconst removeStoreFromTrackedConnections = (name, store) => {\n if (store === void 0) return;\n const connectionInfo = trackedConnections.get(name);\n if (!connectionInfo) return;\n delete connectionInfo.stores[store];\n if (Object.keys(connectionInfo.stores).length === 0) {\n trackedConnections.delete(name);\n }\n};\nconst findCallerName = (stack) => {\n var _a, _b;\n if (!stack) return void 0;\n const traceLines = stack.split(\"\\n\");\n const apiSetStateLineIndex = traceLines.findIndex(\n (traceLine) => traceLine.includes(\"api.setState\")\n );\n if (apiSetStateLineIndex < 0) return void 0;\n const callerLine = ((_a = traceLines[apiSetStateLineIndex + 1]) == null ? void 0 : _a.trim()) || \"\";\n return (_b = /.+ (.+) .+/.exec(callerLine)) == null ? void 0 : _b[1];\n};\nconst devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => {\n const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;\n let extensionConnector;\n try {\n extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") && window.__REDUX_DEVTOOLS_EXTENSION__;\n } catch (e) {\n }\n if (!extensionConnector) {\n return fn(set, get, api);\n }\n const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);\n let isRecording = true;\n api.setState = ((state, replace, nameOrAction) => {\n const r = set(state, replace);\n if (!isRecording) return r;\n const action = nameOrAction === void 0 ? {\n type: anonymousActionType || findCallerName(new Error().stack) || \"anonymous\"\n } : typeof nameOrAction === \"string\" ? { type: nameOrAction } : nameOrAction;\n if (store === void 0) {\n connection == null ? void 0 : connection.send(action, get());\n return r;\n }\n connection == null ? void 0 : connection.send(\n {\n ...action,\n type: `${store}/${action.type}`\n },\n {\n ...getTrackedConnectionState(options.name),\n [store]: api.getState()\n }\n );\n return r;\n });\n api.devtools = {\n cleanup: () => {\n if (connection && typeof connection.unsubscribe === \"function\") {\n connection.unsubscribe();\n }\n removeStoreFromTrackedConnections(options.name, store);\n }\n };\n const setStateFromDevtools = (...a) => {\n const originalIsRecording = isRecording;\n isRecording = false;\n set(...a);\n isRecording = originalIsRecording;\n };\n const initialState = fn(api.setState, get, api);\n if (connectionInformation.type === \"untracked\") {\n connection == null ? void 0 : connection.init(initialState);\n } else {\n connectionInformation.stores[connectionInformation.store] = api;\n connection == null ? void 0 : connection.init(\n Object.fromEntries(\n Object.entries(connectionInformation.stores).map(([key, store2]) => [\n key,\n key === connectionInformation.store ? initialState : store2.getState()\n ])\n )\n );\n }\n if (shouldDispatchFromDevtools(api)) {\n let didWarnAboutReservedActionType = false;\n const originalDispatch = api.dispatch;\n api.dispatch = (...args) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && args[0].type === \"__setState\" && !didWarnAboutReservedActionType) {\n console.warn(\n '[zustand devtools middleware] \"__setState\" action type is reserved to set state from the devtools. Avoid using it.'\n );\n didWarnAboutReservedActionType = true;\n }\n originalDispatch(...args);\n };\n }\n connection.subscribe((message) => {\n var _a;\n switch (message.type) {\n case \"ACTION\":\n if (typeof message.payload !== \"string\") {\n console.error(\n \"[zustand devtools middleware] Unsupported action format\"\n );\n return;\n }\n return parseJsonThen(\n message.payload,\n (action) => {\n if (action.type === \"__setState\") {\n if (store === void 0) {\n setStateFromDevtools(action.state);\n return;\n }\n if (Object.keys(action.state).length !== 1) {\n console.error(\n `\n [zustand devtools middleware] Unsupported __setState action format.\n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n `\n );\n }\n const stateFromDevtools = action.state[store];\n if (stateFromDevtools === void 0 || stateFromDevtools === null) {\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {\n setStateFromDevtools(stateFromDevtools);\n }\n return;\n }\n if (shouldDispatchFromDevtools(api)) {\n api.dispatch(action);\n }\n }\n );\n case \"DISPATCH\":\n switch (message.payload.type) {\n case \"RESET\":\n setStateFromDevtools(initialState);\n if (store === void 0) {\n return connection == null ? void 0 : connection.init(api.getState());\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"COMMIT\":\n if (store === void 0) {\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"ROLLBACK\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n setStateFromDevtools(state[store]);\n connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n });\n case \"JUMP_TO_STATE\":\n case \"JUMP_TO_ACTION\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {\n setStateFromDevtools(state[store]);\n }\n });\n case \"IMPORT_STATE\": {\n const { nextLiftedState } = message.payload;\n const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state;\n if (!lastComputedState) return;\n if (store === void 0) {\n setStateFromDevtools(lastComputedState);\n } else {\n setStateFromDevtools(lastComputedState[store]);\n }\n connection == null ? void 0 : connection.send(\n null,\n // FIXME no-any\n nextLiftedState\n );\n return;\n }\n case \"PAUSE_RECORDING\":\n return isRecording = !isRecording;\n }\n return;\n }\n });\n return initialState;\n};\nconst devtools = devtoolsImpl;\nconst parseJsonThen = (stringified, fn) => {\n let parsed;\n try {\n parsed = JSON.parse(stringified);\n } catch (e) {\n console.error(\n \"[zustand devtools middleware] Could not parse the received json\",\n e\n );\n }\n if (parsed !== void 0) fn(parsed);\n};\n\nconst subscribeWithSelectorImpl = (fn) => (set, get, api) => {\n const origSubscribe = api.subscribe;\n api.subscribe = ((selector, optListener, options) => {\n let listener = selector;\n if (optListener) {\n const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;\n let currentSlice = selector(api.getState());\n listener = (state) => {\n const nextSlice = selector(state);\n if (!equalityFn(currentSlice, nextSlice)) {\n const previousSlice = currentSlice;\n optListener(currentSlice = nextSlice, previousSlice);\n }\n };\n if (options == null ? void 0 : options.fireImmediately) {\n optListener(currentSlice, currentSlice);\n }\n }\n return origSubscribe(listener);\n });\n const initialState = fn(set, get, api);\n return initialState;\n};\nconst subscribeWithSelector = subscribeWithSelectorImpl;\n\nfunction combine(initialState, create) {\n return (...args) => Object.assign({}, initialState, create(...args));\n}\n\nfunction createJSONStorage(getStorage, options) {\n let storage;\n try {\n storage = getStorage();\n } catch (e) {\n return;\n }\n const persistStorage = {\n getItem: (name) => {\n var _a;\n const parse = (str2) => {\n if (str2 === null) {\n return null;\n }\n return JSON.parse(str2, options == null ? void 0 : options.reviver);\n };\n const str = (_a = storage.getItem(name)) != null ? _a : null;\n if (str instanceof Promise) {\n return str.then(parse);\n }\n return parse(str);\n },\n setItem: (name, newValue) => storage.setItem(name, JSON.stringify(newValue, options == null ? void 0 : options.replacer)),\n removeItem: (name) => storage.removeItem(name)\n };\n return persistStorage;\n}\nconst toThenable = (fn) => (input) => {\n try {\n const result = fn(input);\n if (result instanceof Promise) {\n return result;\n }\n return {\n then(onFulfilled) {\n return toThenable(onFulfilled)(result);\n },\n catch(_onRejected) {\n return this;\n }\n };\n } catch (e) {\n return {\n then(_onFulfilled) {\n return this;\n },\n catch(onRejected) {\n return toThenable(onRejected)(e);\n }\n };\n }\n};\nconst persistImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n storage: createJSONStorage(() => window.localStorage),\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n let hydrationVersion = 0;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage = options.storage;\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const setItem = () => {\n const state = options.partialize({ ...get() });\n return storage.setItem(options.name, {\n state,\n version: options.version\n });\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n return setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n return setItem();\n },\n get,\n api\n );\n api.getInitialState = () => configResult;\n let stateFromStorage;\n const hydrate = () => {\n var _a, _b;\n if (!storage) return;\n const currentVersion = ++hydrationVersion;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => {\n var _a2;\n return cb((_a2 = get()) != null ? _a2 : configResult);\n });\n const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;\n return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n const migration = options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n );\n if (migration instanceof Promise) {\n return migration.then((result) => [true, result]);\n }\n return [true, migration];\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return [false, deserializedStorageValue.state];\n }\n }\n return [false, void 0];\n }).then((migrationResult) => {\n var _a2;\n if (currentVersion !== hydrationVersion) {\n return;\n }\n const [migrated, migratedState] = migrationResult;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n if (migrated) {\n return setItem();\n }\n }).then(() => {\n if (currentVersion !== hydrationVersion) {\n return;\n }\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(get(), void 0);\n stateFromStorage = get();\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n if (currentVersion !== hydrationVersion) {\n return;\n }\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.storage) {\n storage = newOptions.storage;\n }\n },\n clearStorage: () => {\n storage == null ? void 0 : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n if (!options.skipHydration) {\n hydrate();\n }\n return stateFromStorage || configResult;\n};\nconst persist = persistImpl;\n\nfunction ssrSafe(config, isSSR = typeof window === \"undefined\") {\n return (set, get, api) => {\n if (!isSSR) {\n return config(set, get, api);\n }\n const ssrSet = () => {\n throw new Error(\"Cannot set state of Zustand store in SSR\");\n };\n api.setState = ssrSet;\n return config(ssrSet, get, api);\n };\n}\n\nexport { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector, ssrSafe as unstable_ssrSafe };\n",
|
|
12
|
-
"import { createStore, type StateCreator, type StoreApi } from 'zustand/vanilla';\nimport { combine } from 'zustand/middleware';\n\nexport type IslandStoreState = object;\ntype IslandStoreSnapshot = Record<string, unknown>;\ntype IslandStoreShape<\n\tTState extends IslandStoreState,\n\tTActions extends object\n> = Omit<TState, keyof TActions> & TActions;\nexport type IslandStateSnapshot = Record<string, IslandStoreSnapshot>;\ntype AnyIslandStore = StoreApi<object>;\ntype IslandStoreInstance = {\n\tapplyExternalSnapshot: (snapshot: IslandStoreSnapshot) => void;\n\tstore: AnyIslandStore;\n};\n\
|
|
12
|
+
"import { createStore, type StateCreator, type StoreApi } from 'zustand/vanilla';\nimport { combine } from 'zustand/middleware';\n\nexport type IslandStoreState = object;\ntype IslandStoreSnapshot = Record<string, unknown>;\ntype IslandStoreShape<\n\tTState extends IslandStoreState,\n\tTActions extends object\n> = Omit<TState, keyof TActions> & TActions;\nexport type IslandStateSnapshot = Record<string, IslandStoreSnapshot>;\ntype AnyIslandStore = StoreApi<object>;\ntype IslandStoreInstance = {\n\tapplyExternalSnapshot: (snapshot: IslandStoreSnapshot) => void;\n\tstore: AnyIslandStore;\n};\n\nexport const ABSOLUTE_ISLAND_STATE = '__ABS_ISLAND_STATE__';\nexport const ABSOLUTE_ISLAND_STORES = '__ABS_ISLAND_STORES__';\n\ndeclare global {\n\tvar __ABS_ISLAND_STATE__: IslandStateSnapshot | undefined;\n\tvar __ABS_ISLAND_STORES__:\n\t\t| Map<string, Set<IslandStoreInstance>>\n\t\t| undefined;\n}\n\nconst getIslandStoreSnapshot = () => {\n\tglobalThis.__ABS_ISLAND_STATE__ ??= {};\n\n\treturn globalThis.__ABS_ISLAND_STATE__;\n};\n\nconst getIslandStores = () => {\n\tglobalThis.__ABS_ISLAND_STORES__ ??= new Map();\n\n\treturn globalThis.__ABS_ISLAND_STORES__;\n};\n\nconst isSerializableValue = (value: unknown) =>\n\ttypeof value !== 'function' && value !== undefined;\n\nconst toSerializableState = <T extends object>(state: T) =>\n\tObject.fromEntries(\n\t\tObject.entries(state).filter(([, value]) => isSerializableValue(value))\n\t);\n\nconst applySnapshot = <T extends object>(\n\tstore: StoreApi<T>,\n\tsnapshot: IslandStoreSnapshot | undefined\n) => {\n\tif (!snapshot) {\n\t\treturn;\n\t}\n\n\tstore.setState({\n\t\t...store.getState(),\n\t\t...snapshot\n\t});\n};\n\nconst getPeerStores = (\n\tstoreInstances: Set<IslandStoreInstance>,\n\townerStore: AnyIslandStore\n) => [...storeInstances].filter((peer) => peer.store !== ownerStore);\n\nconst syncIslandSnapshot = <\n\tTState extends IslandStoreState,\n\tTActions extends object\n>(\n\tstoreId: string,\n\tstate: IslandStoreShape<TState, TActions>,\n\tstoreInstances: Set<IslandStoreInstance>,\n\townerStore: AnyIslandStore\n) => {\n\tconst nextSnapshot = toSerializableState(state);\n\tgetIslandStoreSnapshot()[storeId] = nextSnapshot;\n\n\tfor (const peerStore of getPeerStores(storeInstances, ownerStore)) {\n\t\tpeerStore.applyExternalSnapshot(nextSnapshot);\n\t}\n};\n\nexport const createIslandStore = <\n\tTState extends IslandStoreState,\n\tTActions extends object\n>(\n\tstoreId: string,\n\tinitialState: TState,\n\tcreateState: StateCreator<TState, [], [], TActions>\n) => {\n\tconst store = createStore(combine(initialState, createState));\n\tconst stores = getIslandStores();\n\tconst storeInstances =\n\t\tstores.get(storeId) ?? new Set<IslandStoreInstance>();\n\tconst initialSnapshot = getIslandStoreSnapshot()[storeId];\n\tapplySnapshot(store, initialSnapshot);\n\tlet isApplyingExternalSnapshot = false;\n\n\tconst applyExternalSnapshot = (snapshot: IslandStoreSnapshot) => {\n\t\tisApplyingExternalSnapshot = true;\n\t\tapplySnapshot(store, snapshot);\n\t};\n\n\tstoreInstances.add({\n\t\tapplyExternalSnapshot,\n\t\tstore\n\t});\n\tstores.set(storeId, storeInstances);\n\n\tsyncIslandSnapshot(storeId, store.getState(), storeInstances, store);\n\tstore.subscribe((state) => {\n\t\tif (isApplyingExternalSnapshot) {\n\t\t\tisApplyingExternalSnapshot = false;\n\n\t\t\treturn;\n\t\t}\n\n\t\tsyncIslandSnapshot(storeId, state, storeInstances, store);\n\t});\n\n\treturn store;\n};\nexport const getIslandStoreServerSnapshot = <\n\tTState extends IslandStoreState,\n\tTSelected\n>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => selector(store.getInitialState());\nconst applySnapshotToStoreInstances = (\n\tstoreId: string,\n\tinstances: Set<IslandStoreInstance>,\n\tsnapshot: IslandStateSnapshot\n) => {\n\tfor (const instance of instances) {\n\t\tinstance.applyExternalSnapshot(snapshot[storeId] ?? {});\n\t}\n};\n\nexport const initializeIslandStores = (state: IslandStateSnapshot) => {\n\tconst currentSnapshot = getIslandStoreSnapshot();\n\tconst nextSnapshot: IslandStateSnapshot = {\n\t\t...state,\n\t\t...currentSnapshot\n\t};\n\n\tglobalThis.__ABS_ISLAND_STATE__ = nextSnapshot;\n\n\tfor (const [storeId, store] of getIslandStores()) {\n\t\tapplySnapshotToStoreInstances(storeId, store, nextSnapshot);\n\t}\n};\nexport const readIslandStore = <TState extends IslandStoreState, TSelected>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => selector(store.getState());\nexport const resetIslandStoreForTesting = () => {\n\tdelete globalThis.__ABS_ISLAND_STATE__;\n\tdelete globalThis.__ABS_ISLAND_STORES__;\n};\nexport const subscribeIslandStore = <\n\tTState extends IslandStoreState,\n\tTSelected\n>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected,\n\tlistener: (value: TSelected) => void\n) => {\n\tlet currentSelection = selector(store.getState());\n\n\treturn store.subscribe((state) => {\n\t\tconst nextSelection = selector(state);\n\t\tif (Object.is(nextSelection, currentSelection)) {\n\t\t\treturn;\n\t\t}\n\n\t\tcurrentSelection = nextSelection;\n\t\tlistener(nextSelection);\n\t});\n};\n\n\n",
|
|
13
13
|
"import type { StoreApi } from 'zustand/vanilla';\nimport {\n\treadIslandStore,\n\tsubscribeIslandStore,\n\ttype IslandStoreState\n} from '../client/islandStore';\n\nexport const useIslandStore = <TState extends IslandStoreState, TSelected>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => ({\n\tsubscribe(listener: (value: TSelected) => void) {\n\t\tlistener(readIslandStore(store, selector));\n\n\t\treturn subscribeIslandStore(store, selector, listener);\n\t}\n});\n",
|
|
14
14
|
"export { createTypedIsland } from './createIsland.browser';\nexport { resolveIslandHtml } from './resolveIslandHtml.browser';\nexport { useIslandStore } from './islandStore';\n\nexport const renderIsland = async () => {\n\tthrow new Error(\n\t\t'renderIsland is server-only. Use it during SSR, not in the browser.'\n\t);\n};\n"
|
|
15
15
|
],
|
package/dist/svelte/index.js
CHANGED
|
@@ -1075,6 +1075,12 @@ import { Elysia } from "elysia";
|
|
|
1075
1075
|
var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES, PAGE_HANDLER_NAMES, pageHandlerWrappers, handlerSourceMentionsPageHelper = (handler) => {
|
|
1076
1076
|
const source = handler.toString();
|
|
1077
1077
|
return PAGE_HANDLER_NAMES.some((name) => source.includes(name));
|
|
1078
|
+
}, getOriginalPageHandlerSource = (handler) => {
|
|
1079
|
+
if (typeof handler !== "function")
|
|
1080
|
+
return;
|
|
1081
|
+
const fn = handler;
|
|
1082
|
+
const info = pageHandlerWrappers.get(fn);
|
|
1083
|
+
return (info?.originalHandler ?? fn).toString();
|
|
1078
1084
|
}, isPageHandler = (handler) => {
|
|
1079
1085
|
if (typeof handler !== "function")
|
|
1080
1086
|
return false;
|
|
@@ -1082,12 +1088,6 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
|
|
|
1082
1088
|
if (pageHandlerWrappers.has(fn))
|
|
1083
1089
|
return true;
|
|
1084
1090
|
return handlerSourceMentionsPageHelper(fn);
|
|
1085
|
-
}, getOriginalPageHandlerSource = (handler) => {
|
|
1086
|
-
if (typeof handler !== "function")
|
|
1087
|
-
return;
|
|
1088
|
-
const fn = handler;
|
|
1089
|
-
const info = pageHandlerWrappers.get(fn);
|
|
1090
|
-
return (info?.originalHandler ?? fn).toString();
|
|
1091
1091
|
}, isObjectRecord3 = (value) => Boolean(value) && typeof value === "object", isAsyncLocalStorage2 = (value) => isObjectRecord3(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function", isRouteMethod = (value) => typeof value === "function", getRouteCallsiteStorage = () => {
|
|
1092
1092
|
const value = Reflect.get(globalThis, ROUTE_CALLSITE_STORAGE_KEY);
|
|
1093
1093
|
if (value === null || typeof value === "undefined") {
|
|
@@ -2154,7 +2154,7 @@ var resolveAngularPackageDir = (specifier) => {
|
|
|
2154
2154
|
var init_resolveAngularPackage = () => {};
|
|
2155
2155
|
|
|
2156
2156
|
// src/utils/runtimeMode.ts
|
|
2157
|
-
var ENV_VAR = "NODE_ENV",
|
|
2157
|
+
var ENV_VAR = "NODE_ENV", isDevelopmentRuntime = () => process.env[ENV_VAR] === "development", isProductionRuntime = () => process.env[ENV_VAR] === "production";
|
|
2158
2158
|
|
|
2159
2159
|
// src/angular/angularPatch.ts
|
|
2160
2160
|
var exports_angularPatch = {};
|
|
@@ -2532,7 +2532,7 @@ __export(exports_islands, {
|
|
|
2532
2532
|
isAngularComponent: () => isAngularComponent,
|
|
2533
2533
|
getAngularIslandSelector: () => getAngularIslandSelector
|
|
2534
2534
|
});
|
|
2535
|
-
var angularIslandSelector = "abs-angular-island", isAngularComponent = (value) => typeof value === "function",
|
|
2535
|
+
var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_islandId) => angularIslandSelector, isAngularComponent = (value) => typeof value === "function", getSelectorFromRenderedIsland = (rootElement) => {
|
|
2536
2536
|
const firstChild = rootElement.firstElementChild;
|
|
2537
2537
|
if (!(firstChild instanceof HTMLElement)) {
|
|
2538
2538
|
return null;
|
|
@@ -3064,8 +3064,8 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, tran
|
|
|
3064
3064
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
3065
3065
|
fs: {
|
|
3066
3066
|
fileExists: existsSync4,
|
|
3067
|
-
|
|
3068
|
-
|
|
3067
|
+
realpath: realpathSync,
|
|
3068
|
+
readFile: (file) => existsSync4(file) ? readFileSync4(file, "utf-8") : undefined
|
|
3069
3069
|
},
|
|
3070
3070
|
id: componentId,
|
|
3071
3071
|
inlineTemplate: false
|
|
@@ -3785,6 +3785,12 @@ var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage(
|
|
|
3785
3785
|
|
|
3786
3786
|
// src/utils/inlinePageCss.ts
|
|
3787
3787
|
var siblingCssCache = new Map;
|
|
3788
|
+
var injectInlineCss = (headTag, css) => {
|
|
3789
|
+
if (!css)
|
|
3790
|
+
return headTag;
|
|
3791
|
+
const styleBlock = `<style data-absolute-page-css>${css}</style>`;
|
|
3792
|
+
return headTag.replace("</head>", `${styleBlock}</head>`);
|
|
3793
|
+
};
|
|
3788
3794
|
var readSiblingCss = async (siblingJsPath) => {
|
|
3789
3795
|
if (!siblingJsPath)
|
|
3790
3796
|
return "";
|
|
@@ -3804,12 +3810,6 @@ var readSiblingCss = async (siblingJsPath) => {
|
|
|
3804
3810
|
return "";
|
|
3805
3811
|
}
|
|
3806
3812
|
};
|
|
3807
|
-
var injectInlineCss = (headTag, css) => {
|
|
3808
|
-
if (!css)
|
|
3809
|
-
return headTag;
|
|
3810
|
-
const styleBlock = `<style data-absolute-page-css>${css}</style>`;
|
|
3811
|
-
return headTag.replace("</head>", `${styleBlock}</head>`);
|
|
3812
|
-
};
|
|
3813
3813
|
// src/utils/resolveConvention.ts
|
|
3814
3814
|
import { basename as basename2 } from "path";
|
|
3815
3815
|
var CONVENTIONS_KEY = "__absoluteConventions";
|
|
@@ -3828,6 +3828,14 @@ var derivePageName = (pagePath) => {
|
|
|
3828
3828
|
return toPascal(name);
|
|
3829
3829
|
};
|
|
3830
3830
|
var normalizeConventionPageName = (name) => toPascal(name).replace(/\d+$/, "");
|
|
3831
|
+
var hasErrorConvention = (framework) => {
|
|
3832
|
+
const conventions = getMap()[framework];
|
|
3833
|
+
if (!conventions)
|
|
3834
|
+
return false;
|
|
3835
|
+
if (conventions.defaults?.error)
|
|
3836
|
+
return true;
|
|
3837
|
+
return Object.values(conventions.pages ?? {}).some((page) => Boolean(page.error));
|
|
3838
|
+
};
|
|
3831
3839
|
var resolveErrorConventionPath = (framework, pageName) => {
|
|
3832
3840
|
const conventions = getMap()[framework];
|
|
3833
3841
|
if (!conventions)
|
|
@@ -3844,14 +3852,6 @@ var resolveErrorConventionPath = (framework, pageName) => {
|
|
|
3844
3852
|
return conventions.defaults?.error;
|
|
3845
3853
|
};
|
|
3846
3854
|
var resolveNotFoundConventionPath = (framework) => getMap()[framework]?.defaults?.notFound;
|
|
3847
|
-
var hasErrorConvention = (framework) => {
|
|
3848
|
-
const conventions = getMap()[framework];
|
|
3849
|
-
if (!conventions)
|
|
3850
|
-
return false;
|
|
3851
|
-
if (conventions.defaults?.error)
|
|
3852
|
-
return true;
|
|
3853
|
-
return Object.values(conventions.pages ?? {}).some((page) => Boolean(page.error));
|
|
3854
|
-
};
|
|
3855
3855
|
var setConventions = (map) => {
|
|
3856
3856
|
Reflect.set(globalThis, CONVENTIONS_KEY, map);
|
|
3857
3857
|
};
|
|
@@ -3864,7 +3864,7 @@ var buildErrorProps = (error) => {
|
|
|
3864
3864
|
...isDev() && error.stack ? { stack: error.stack } : {}
|
|
3865
3865
|
};
|
|
3866
3866
|
}
|
|
3867
|
-
return {
|
|
3867
|
+
return { message: String(error), name: "Error" };
|
|
3868
3868
|
};
|
|
3869
3869
|
var renderReactError = async (conventionPath, errorProps) => {
|
|
3870
3870
|
const { createElement } = await import("react");
|
|
@@ -4360,5 +4360,5 @@ export {
|
|
|
4360
4360
|
createTypedIsland
|
|
4361
4361
|
};
|
|
4362
4362
|
|
|
4363
|
-
//# debugId=
|
|
4363
|
+
//# debugId=ED4007E4CF30067764756E2164756E21
|
|
4364
4364
|
//# sourceMappingURL=index.js.map
|