@absolutejs/absolute 0.20.0-beta.5 → 0.20.0-beta.50
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/README.md +205 -0
- package/dist/angular/browser.js +392 -361
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/core/streamingSlotRegistrar.js +7 -7
- package/dist/angular/components/core/streamingSlotRegistry.js +4 -4
- package/dist/angular/index.js +355 -302
- package/dist/angular/index.js.map +5 -5
- package/dist/angular/server.js +109 -58
- package/dist/angular/server.js.map +5 -5
- package/dist/build.js +2261 -1335
- package/dist/build.js.map +16 -12
- package/dist/cli/config/client.js +12 -12
- package/dist/cli/config/server.js +1136 -1090
- package/dist/cli/index.js +8247 -1898
- package/dist/client/index.js +29 -25
- package/dist/client/index.js.map +2 -2
- package/dist/core/streamingSlotRegistrar.js +15 -13
- package/dist/core/streamingSlotRegistrar.js.map +2 -2
- package/dist/core/streamingSlotRegistry.js +11 -9
- package/dist/core/streamingSlotRegistry.js.map +2 -2
- package/dist/dev/client/hmrClient.ts +35 -3
- package/dist/dev/client/hmrTiming.ts +6 -0
- package/dist/dev/client/syncDevtools.ts +237 -0
- package/dist/dev/serverBootstrap.js +28 -0
- package/dist/image-client/imageClient.js +7 -7
- package/dist/index.js +3400 -2126
- package/dist/index.js.map +30 -23
- package/dist/islands/browser.js +11 -9
- package/dist/islands/browser.js.map +2 -2
- package/dist/islands/index.js +39 -35
- package/dist/islands/index.js.map +2 -2
- package/dist/mobile/browser.js +167 -20
- package/dist/mobile/browser.js.map +7 -5
- package/dist/mobile/index.js +7840 -2983
- package/dist/mobile/index.js.map +37 -18
- package/dist/mobile/remoteMacAgentEntry.js +1184 -14
- package/dist/mobile/shellAuth.js +36 -0
- package/dist/mobile/shellBootstrap.js +836 -0
- package/dist/mobile/shellExpoAuth.js +163 -0
- package/dist/mobile/shellExpoDevices.js +77 -0
- package/dist/mobile/shellExpoSync.js +104 -0
- package/dist/mobile/shellSync.js +173 -0
- package/dist/react/browser.js +17 -15
- package/dist/react/browser.js.map +2 -2
- package/dist/react/components/browser/index.js +107 -107
- package/dist/react/components/index.js +118 -116
- package/dist/react/components/index.js.map +2 -2
- package/dist/react/hooks/index.js +11 -9
- package/dist/react/hooks/index.js.map +2 -2
- package/dist/react/index.js +92 -49
- package/dist/react/index.js.map +4 -4
- package/dist/react/jsxDevRuntimeCompat.js +11 -9
- package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
- package/dist/react/jsxRuntimeCompat.js +11 -9
- package/dist/react/jsxRuntimeCompat.js.map +2 -2
- package/dist/react/router/browser.js +9 -7
- package/dist/react/router/browser.js.map +2 -2
- package/dist/react/router/index.js +9 -7
- package/dist/react/router/index.js.map +2 -2
- package/dist/react/server.js +51 -10
- package/dist/react/server.js.map +4 -4
- package/dist/src/build/pwa.d.ts +16 -0
- package/dist/src/cli/config/server.d.ts +1 -1
- package/dist/src/cli/instanceStatus.d.ts +1 -0
- package/dist/src/cli/scripts/dev.d.ts +2 -0
- package/dist/src/core/devBuild.d.ts +1 -0
- package/dist/src/core/prepare.d.ts +376 -0
- package/dist/src/dev/clientManager.d.ts +1 -0
- package/dist/src/dev/devCert.d.ts +6 -4
- package/dist/src/dev/serverEntryCopies.d.ts +3 -0
- package/dist/src/mobile/androidEmulatorController.d.ts +8 -1
- package/dist/src/mobile/androidRelease.d.ts +9 -2
- package/dist/src/mobile/androidTestReport.d.ts +14 -0
- package/dist/src/mobile/androidUpgradeConformance.d.ts +47 -0
- package/dist/src/mobile/androidWebView.d.ts +1 -0
- package/dist/src/mobile/browser.d.ts +1 -0
- package/dist/src/mobile/capacitorBundle.d.ts +11 -0
- package/dist/src/mobile/ciWorkflow.d.ts +26 -0
- package/dist/src/mobile/config.d.ts +4 -1
- package/dist/src/mobile/devDeviceAdapter.d.ts +3 -0
- package/dist/src/mobile/deviceCapabilities.d.ts +48 -0
- package/dist/src/mobile/expoBridge.d.ts +91 -0
- package/dist/src/mobile/expoDevController.d.ts +56 -0
- package/dist/src/mobile/expoProject.d.ts +16 -0
- package/dist/src/mobile/index.d.ts +14 -0
- package/dist/src/mobile/iosDeviceAcceptance.d.ts +32 -0
- package/dist/src/mobile/iosPhysicalDeviceTransport.d.ts +16 -0
- package/dist/src/mobile/iosRelease.d.ts +16 -3
- package/dist/src/mobile/iosSimulatorController.d.ts +20 -2
- package/dist/src/mobile/iosTestReport.d.ts +24 -0
- package/dist/src/mobile/mobileBundleInspection.d.ts +55 -0
- package/dist/src/mobile/mobileInspect.d.ts +136 -0
- package/dist/src/mobile/mobilePreview.d.ts +174 -0
- package/dist/src/mobile/mobilePreviewClient.d.ts +1 -0
- package/dist/src/mobile/nativeAuth.d.ts +6 -0
- package/dist/src/mobile/nativeBackgroundSync.d.ts +4 -0
- package/dist/src/mobile/nativeDeviceCapabilities.d.ts +6 -0
- package/dist/src/mobile/nativeRoute.d.ts +13 -0
- package/dist/src/mobile/nativeTestReport.d.ts +91 -0
- package/dist/src/mobile/pageProtocol.d.ts +2 -0
- package/dist/src/mobile/releaseDoctor.d.ts +23 -1
- package/dist/src/mobile/remoteMacProtocol.d.ts +38 -0
- package/dist/src/mobile/remoteMacWire.d.ts +1 -1
- package/dist/src/mobile/shellAuth.d.ts +8 -1
- package/dist/src/mobile/shellBootstrap.d.ts +14 -2
- package/dist/src/mobile/shellExpoAuth.d.ts +12 -0
- package/dist/src/mobile/shellExpoDevices.d.ts +3 -0
- package/dist/src/mobile/shellExpoSync.d.ts +18 -0
- package/dist/src/mobile/shellHttp.d.ts +2 -0
- package/dist/src/mobile/shellPush.d.ts +11 -0
- package/dist/src/mobile/shellSync.d.ts +46 -1
- package/dist/src/mobile/syncRemediation.d.ts +10 -0
- package/dist/src/mobile/syncSchema.d.ts +9 -0
- package/dist/src/mobile/transport.d.ts +7 -0
- package/dist/src/plugins/hmr.d.ts +3 -0
- package/dist/src/plugins/imageOptimizer.d.ts +1 -1
- package/dist/src/react/hooks/useMediaQuery.d.ts +1 -1
- package/dist/src/utils/imageProcessing.d.ts +3 -0
- package/dist/src/utils/loadConfig.d.ts +1 -0
- package/dist/src/utils/logger.d.ts +1 -0
- package/dist/src/utils/startupBanner.d.ts +1 -0
- package/dist/src/utils/userAgentFunctions.d.ts +1 -1
- package/dist/svelte/browser.js +12 -10
- package/dist/svelte/browser.js.map +2 -2
- package/dist/svelte/index.js +86 -43
- package/dist/svelte/index.js.map +4 -4
- package/dist/svelte/server.js +68 -27
- package/dist/svelte/server.js.map +4 -4
- package/dist/types/build.d.ts +53 -3
- package/dist/types/cli.d.ts +1 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/vue/browser.js +14 -12
- package/dist/vue/browser.js.map +2 -2
- package/dist/vue/components/Image.js +9 -7
- package/dist/vue/components/Image.js.map +2 -2
- package/dist/vue/components/index.js +11 -9
- package/dist/vue/components/index.js.map +2 -2
- package/dist/vue/index.js +91 -48
- package/dist/vue/index.js.map +4 -4
- package/dist/vue/server.js +53 -12
- package/dist/vue/server.js.map +4 -4
- package/package.json +35 -15
|
@@ -19,12 +19,14 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
19
19
|
}
|
|
20
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
21
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(mod))
|
|
24
|
+
if (!__hasOwnProp.call(to, key))
|
|
25
|
+
__defProp(to, key, {
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
27
|
+
enumerable: true
|
|
28
|
+
});
|
|
29
|
+
}
|
|
28
30
|
if (canCache)
|
|
29
31
|
cache.set(mod, to);
|
|
30
32
|
return to;
|
|
@@ -84,9 +86,9 @@ var jsxs = (type, props, key) => reactJsxs(type, nativeRootProps(type, props), k
|
|
|
84
86
|
// src/react/jsxDevRuntimeCompat.ts
|
|
85
87
|
var jsxDEV = (type, props, key, _isStaticChildren, _source, _self) => Array.isArray(props?.children) ? jsxs(type, props, key) : jsx(type, props, key);
|
|
86
88
|
export {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
Fragment,
|
|
90
|
+
jsxDEV
|
|
89
91
|
};
|
|
90
92
|
|
|
91
|
-
//# debugId=
|
|
93
|
+
//# debugId=682E163D9238E04A64756E2164756E21
|
|
92
94
|
//# sourceMappingURL=jsxDevRuntimeCompat.js.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"import {\n\tFragment,\n\tjsx as reactJsx,\n\tjsxs as reactJsxs\n} from 'react/jsx-runtime';\n\ntype JSXType = Parameters<typeof reactJsx>[0];\ntype JSXProps = Parameters<typeof reactJsx>[1];\ntype JSXKey = Parameters<typeof reactJsx>[2];\n\nconst nativeRootProps = (type: JSXType, props: JSXProps) => {\n\tif (type !== 'html') return props;\n\tconst capacitor: unknown = Reflect.get(globalThis, 'Capacitor');\n\tif (typeof capacitor !== 'object' || capacitor === null) return props;\n\tconst isNativePlatform: unknown = Reflect.get(\n\t\tcapacitor,\n\t\t'isNativePlatform'\n\t);\n\tif (\n\t\ttypeof isNativePlatform !== 'function' ||\n\t\tisNativePlatform.call(capacitor) !== true\n\t) {\n\t\treturn props;\n\t}\n\n\t// Capacitor's SystemBars plugin owns safe-area CSS variables on <html>.\n\t// React must preserve those native runtime attributes during hydration.\n\treturn Object.assign(\n\t\t{},\n\t\ttypeof props === 'object' && props !== null ? props : {},\n\t\t{ suppressHydrationWarning: true }\n\t);\n};\n\nexport { Fragment };\n\nexport const jsx = (type: JSXType, props: JSXProps, key?: JSXKey) =>\n\treactJsx(type, nativeRootProps(type, props), key);\n\nexport const jsxs = (type: JSXType, props: JSXProps, key?: JSXKey) =>\n\treactJsxs(type, nativeRootProps(type, props), key);\n",
|
|
6
6
|
"import { Fragment, jsx, jsxs } from './jsxRuntimeCompat';\n\ntype JSXType = Parameters<typeof jsx>[0];\ntype JSXKey = Parameters<typeof jsx>[2];\ntype JSXProps = Parameters<typeof jsx>[1] & {\n\tchildren?: unknown;\n};\n\nexport { Fragment };\n\nexport const jsxDEV = (\n\ttype: JSXType,\n\tprops: JSXProps,\n\tkey?: JSXKey,\n\t_isStaticChildren?: boolean,\n\t_source?: unknown,\n\t_self?: unknown\n) =>\n\tArray.isArray(props?.children)\n\t\t? jsxs(type, props, key)\n\t\t: jsx(type, props, key);\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": "
|
|
9
|
-
"debugId": "
|
|
8
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,SAEC;AAAA,UACA;AAAA;AAOD,IAAM,kBAAkB,CAAC,MAAe,UAAoB;AAAA,EAC3D,IAAI,SAAS;AAAA,IAAQ,OAAO;AAAA,EAC5B,MAAM,YAAqB,QAAQ,IAAI,YAAY,WAAW;AAAA,EAC9D,IAAI,OAAO,cAAc,YAAY,cAAc;AAAA,IAAM,OAAO;AAAA,EAChE,MAAM,mBAA4B,QAAQ,IACzC,WACA,kBACD;AAAA,EACA,IACC,OAAO,qBAAqB,cAC5B,iBAAiB,KAAK,SAAS,MAAM,MACpC;AAAA,IACD,OAAO;AAAA,EACR;AAAA,EAIA,OAAO,OAAO,OACb,CAAC,GACD,OAAO,UAAU,YAAY,UAAU,OAAO,QAAQ,CAAC,GACvD,EAAE,0BAA0B,KAAK,CAClC;AAAA;AAKM,IAAM,MAAM,CAAC,MAAe,OAAiB,QACnD,SAAS,MAAM,gBAAgB,MAAM,KAAK,GAAG,GAAG;AAE1C,IAAM,OAAO,CAAC,MAAe,OAAiB,QACpD,UAAU,MAAM,gBAAgB,MAAM,KAAK,GAAG,GAAG;;;AC9B3C,IAAM,SAAS,CACrB,MACA,OACA,KACA,mBACA,SACA,UAEA,MAAM,QAAQ,OAAO,QAAQ,IAC1B,KAAK,MAAM,OAAO,GAAG,IACrB,IAAI,MAAM,OAAO,GAAG;",
|
|
9
|
+
"debugId": "682E163D9238E04A64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -19,12 +19,14 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
19
19
|
}
|
|
20
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
21
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(mod))
|
|
24
|
+
if (!__hasOwnProp.call(to, key))
|
|
25
|
+
__defProp(to, key, {
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
27
|
+
enumerable: true
|
|
28
|
+
});
|
|
29
|
+
}
|
|
28
30
|
if (canCache)
|
|
29
31
|
cache.set(mod, to);
|
|
30
32
|
return to;
|
|
@@ -81,10 +83,10 @@ var nativeRootProps = (type, props) => {
|
|
|
81
83
|
var jsx = (type, props, key) => reactJsx(type, nativeRootProps(type, props), key);
|
|
82
84
|
var jsxs = (type, props, key) => reactJsxs(type, nativeRootProps(type, props), key);
|
|
83
85
|
export {
|
|
84
|
-
|
|
86
|
+
Fragment,
|
|
85
87
|
jsx,
|
|
86
|
-
|
|
88
|
+
jsxs
|
|
87
89
|
};
|
|
88
90
|
|
|
89
|
-
//# debugId=
|
|
91
|
+
//# debugId=A6BB10B64D476FAD64756E2164756E21
|
|
90
92
|
//# sourceMappingURL=jsxRuntimeCompat.js.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import {\n\tFragment,\n\tjsx as reactJsx,\n\tjsxs as reactJsxs\n} from 'react/jsx-runtime';\n\ntype JSXType = Parameters<typeof reactJsx>[0];\ntype JSXProps = Parameters<typeof reactJsx>[1];\ntype JSXKey = Parameters<typeof reactJsx>[2];\n\nconst nativeRootProps = (type: JSXType, props: JSXProps) => {\n\tif (type !== 'html') return props;\n\tconst capacitor: unknown = Reflect.get(globalThis, 'Capacitor');\n\tif (typeof capacitor !== 'object' || capacitor === null) return props;\n\tconst isNativePlatform: unknown = Reflect.get(\n\t\tcapacitor,\n\t\t'isNativePlatform'\n\t);\n\tif (\n\t\ttypeof isNativePlatform !== 'function' ||\n\t\tisNativePlatform.call(capacitor) !== true\n\t) {\n\t\treturn props;\n\t}\n\n\t// Capacitor's SystemBars plugin owns safe-area CSS variables on <html>.\n\t// React must preserve those native runtime attributes during hydration.\n\treturn Object.assign(\n\t\t{},\n\t\ttypeof props === 'object' && props !== null ? props : {},\n\t\t{ suppressHydrationWarning: true }\n\t);\n};\n\nexport { Fragment };\n\nexport const jsx = (type: JSXType, props: JSXProps, key?: JSXKey) =>\n\treactJsx(type, nativeRootProps(type, props), key);\n\nexport const jsxs = (type: JSXType, props: JSXProps, key?: JSXKey) =>\n\treactJsxs(type, nativeRootProps(type, props), key);\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,SAEC;AAAA,UACA;AAAA;AAOD,IAAM,kBAAkB,CAAC,MAAe,UAAoB;AAAA,EAC3D,IAAI,SAAS;AAAA,IAAQ,OAAO;AAAA,EAC5B,MAAM,YAAqB,QAAQ,IAAI,YAAY,WAAW;AAAA,EAC9D,IAAI,OAAO,cAAc,YAAY,cAAc;AAAA,IAAM,OAAO;AAAA,EAChE,MAAM,mBAA4B,QAAQ,IACzC,WACA,kBACD;AAAA,EACA,IACC,OAAO,qBAAqB,cAC5B,iBAAiB,KAAK,SAAS,MAAM,MACpC;AAAA,IACD,OAAO;AAAA,EACR;AAAA,EAIA,OAAO,OAAO,OACb,CAAC,GACD,OAAO,UAAU,YAAY,UAAU,OAAO,QAAQ,CAAC,GACvD,EAAE,0BAA0B,KAAK,CAClC;AAAA;AAKM,IAAM,MAAM,CAAC,MAAe,OAAiB,QACnD,SAAS,MAAM,gBAAgB,MAAM,KAAK,GAAG,GAAG;AAE1C,IAAM,OAAO,CAAC,MAAe,OAAiB,QACpD,UAAU,MAAM,gBAAgB,MAAM,KAAK,GAAG,GAAG;",
|
|
8
|
+
"debugId": "A6BB10B64D476FAD64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -19,12 +19,14 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
19
19
|
}
|
|
20
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
21
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(mod))
|
|
24
|
+
if (!__hasOwnProp.call(to, key))
|
|
25
|
+
__defProp(to, key, {
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
27
|
+
enumerable: true
|
|
28
|
+
});
|
|
29
|
+
}
|
|
28
30
|
if (canCache)
|
|
29
31
|
cache.set(mod, to);
|
|
30
32
|
return to;
|
|
@@ -73,5 +75,5 @@ export {
|
|
|
73
75
|
UniversalRouter
|
|
74
76
|
};
|
|
75
77
|
|
|
76
|
-
//# debugId=
|
|
78
|
+
//# debugId=4DFB01207B8E6AD964756E2164756E21
|
|
77
79
|
//# sourceMappingURL=browser.js.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import { createElement, type ReactNode } from 'react';\nimport { BrowserRouter, StaticRouter } from 'react-router';\n\nexport type UniversalRouterProps = {\n\t/** The request URL to seed `<StaticRouter>` with on the server. Pages\n\t * typically forward `props.url` (auto-injected by handleReactPageRequest\n\t * from `request.url`). Ignored in the browser, where `<BrowserRouter>`\n\t * reads `window.location` directly. Defaults to '/'. */\n\turl?: string;\n\tchildren?: ReactNode;\n};\n\n/** SSR-safe wrapper around react-router that picks `<StaticRouter>` on the\n * server and `<BrowserRouter>` in the browser. Without it, every SPA page\n * has to write its own `typeof window === 'undefined'` branch and import\n * both routers — boilerplate that's the same in every page.\n *\n * Usage:\n *\n * import { UniversalRouter } from '@absolutejs/absolute/react/router';\n *\n * export const MySpa = ({ url }: { url?: string }) => (\n * <html>\n * <Head />\n * <body>\n * <UniversalRouter url={url}>\n * <Routes>\n * <Route path=\"/foo\" element={<Foo />} />\n * </Routes>\n * </UniversalRouter>\n * </body>\n * </html>\n * );\n *\n * This component lives on its own `@absolutejs/absolute/react/router`\n * subpath rather than the main `@absolutejs/absolute/react` barrel so the\n * static `import 'react-router'` below only loads for consumers who\n * actually use the router — importing `Head`/`Image`/`Island` from\n * `@absolutejs/absolute/react` does not pull react-router into the bundle,\n * so projects that don't route aren't forced to install it.\n *\n * `<BrowserRouter>` reads `window.history` at construction, so it throws\n * if instantiated on the server. The `typeof window` check has to live at\n * render time (not import time) because the module is loaded in both\n * environments. */\nexport const UniversalRouter = ({ url, children }: UniversalRouterProps) => {\n\tif (typeof window === 'undefined') {\n\t\treturn createElement(StaticRouter, { location: url ?? '/' }, children);\n\t}\n\n\treturn createElement(BrowserRouter, null, children);\n};\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AA4CO,IAAM,kBAAkB,GAAG,KAAK,eAAqC;AAAA,EAC3E,IAAI,OAAO,WAAW,aAAa;AAAA,IAClC,OAAO,cAAc,cAAc,EAAE,UAAU,OAAO,IAAI,GAAG,QAAQ;AAAA,EACtE;AAAA,EAEA,OAAO,cAAc,eAAe,MAAM,QAAQ;AAAA;",
|
|
8
|
+
"debugId": "4DFB01207B8E6AD964756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -19,12 +19,14 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
19
19
|
}
|
|
20
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
21
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(mod))
|
|
24
|
+
if (!__hasOwnProp.call(to, key))
|
|
25
|
+
__defProp(to, key, {
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
27
|
+
enumerable: true
|
|
28
|
+
});
|
|
29
|
+
}
|
|
28
30
|
if (canCache)
|
|
29
31
|
cache.set(mod, to);
|
|
30
32
|
return to;
|
|
@@ -73,5 +75,5 @@ export {
|
|
|
73
75
|
UniversalRouter
|
|
74
76
|
};
|
|
75
77
|
|
|
76
|
-
//# debugId=
|
|
78
|
+
//# debugId=54F5F161F396C44764756E2164756E21
|
|
77
79
|
//# sourceMappingURL=index.js.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import { createElement, type ReactNode } from 'react';\nimport { BrowserRouter, StaticRouter } from 'react-router';\n\nexport type UniversalRouterProps = {\n\t/** The request URL to seed `<StaticRouter>` with on the server. Pages\n\t * typically forward `props.url` (auto-injected by handleReactPageRequest\n\t * from `request.url`). Ignored in the browser, where `<BrowserRouter>`\n\t * reads `window.location` directly. Defaults to '/'. */\n\turl?: string;\n\tchildren?: ReactNode;\n};\n\n/** SSR-safe wrapper around react-router that picks `<StaticRouter>` on the\n * server and `<BrowserRouter>` in the browser. Without it, every SPA page\n * has to write its own `typeof window === 'undefined'` branch and import\n * both routers — boilerplate that's the same in every page.\n *\n * Usage:\n *\n * import { UniversalRouter } from '@absolutejs/absolute/react/router';\n *\n * export const MySpa = ({ url }: { url?: string }) => (\n * <html>\n * <Head />\n * <body>\n * <UniversalRouter url={url}>\n * <Routes>\n * <Route path=\"/foo\" element={<Foo />} />\n * </Routes>\n * </UniversalRouter>\n * </body>\n * </html>\n * );\n *\n * This component lives on its own `@absolutejs/absolute/react/router`\n * subpath rather than the main `@absolutejs/absolute/react` barrel so the\n * static `import 'react-router'` below only loads for consumers who\n * actually use the router — importing `Head`/`Image`/`Island` from\n * `@absolutejs/absolute/react` does not pull react-router into the bundle,\n * so projects that don't route aren't forced to install it.\n *\n * `<BrowserRouter>` reads `window.history` at construction, so it throws\n * if instantiated on the server. The `typeof window` check has to live at\n * render time (not import time) because the module is loaded in both\n * environments. */\nexport const UniversalRouter = ({ url, children }: UniversalRouterProps) => {\n\tif (typeof window === 'undefined') {\n\t\treturn createElement(StaticRouter, { location: url ?? '/' }, children);\n\t}\n\n\treturn createElement(BrowserRouter, null, children);\n};\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AA4CO,IAAM,kBAAkB,GAAG,KAAK,eAAqC;AAAA,EAC3E,IAAI,OAAO,WAAW,aAAa;AAAA,IAClC,OAAO,cAAc,cAAc,EAAE,UAAU,OAAO,IAAI,GAAG,QAAQ;AAAA,EACtE;AAAA,EAEA,OAAO,cAAc,eAAe,MAAM,QAAQ;AAAA;",
|
|
8
|
+
"debugId": "54F5F161F396C44764756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
package/dist/react/server.js
CHANGED
|
@@ -19,12 +19,14 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
19
19
|
}
|
|
20
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
21
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(mod))
|
|
24
|
+
if (!__hasOwnProp.call(to, key))
|
|
25
|
+
__defProp(to, key, {
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
27
|
+
enumerable: true
|
|
28
|
+
});
|
|
29
|
+
}
|
|
28
30
|
if (canCache)
|
|
29
31
|
cache.set(mod, to);
|
|
30
32
|
return to;
|
|
@@ -63,10 +65,10 @@ var __require = import.meta.require;
|
|
|
63
65
|
// src/core/devRouteRegistrationCallsite.ts
|
|
64
66
|
var exports_devRouteRegistrationCallsite = {};
|
|
65
67
|
__export(exports_devRouteRegistrationCallsite, {
|
|
66
|
-
|
|
67
|
-
isPageHandler: () => isPageHandler,
|
|
68
|
+
getCurrentRouteRegistrationCallsite: () => getCurrentRouteRegistrationCallsite,
|
|
68
69
|
getOriginalPageHandlerSource: () => getOriginalPageHandlerSource,
|
|
69
|
-
|
|
70
|
+
isPageHandler: () => isPageHandler,
|
|
71
|
+
patchElysiaRouteRegistrationCallsites: () => patchElysiaRouteRegistrationCallsites
|
|
70
72
|
});
|
|
71
73
|
import { AsyncLocalStorage } from "async_hooks";
|
|
72
74
|
import { Elysia } from "elysia";
|
|
@@ -941,6 +943,7 @@ var colors, MONTHS, formatTimestamp = () => {
|
|
|
941
943
|
port,
|
|
942
944
|
host,
|
|
943
945
|
networkUrl,
|
|
946
|
+
mobilePreviewUrl,
|
|
944
947
|
protocol = "http"
|
|
945
948
|
} = options;
|
|
946
949
|
const name = `${colors.cyan}${colors.bold}ABSOLUTEJS${colors.reset}`;
|
|
@@ -954,6 +957,9 @@ var colors, MONTHS, formatTimestamp = () => {
|
|
|
954
957
|
if (networkUrl) {
|
|
955
958
|
console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Network:${colors.reset} ${networkUrl}`);
|
|
956
959
|
}
|
|
960
|
+
if (mobilePreviewUrl) {
|
|
961
|
+
console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Mobile:${colors.reset} ${mobilePreviewUrl}`);
|
|
962
|
+
}
|
|
957
963
|
console.log("");
|
|
958
964
|
};
|
|
959
965
|
var init_startupBanner = __esm(() => {
|
|
@@ -1846,6 +1852,7 @@ var getCurrentAbsoluteMobileProducerContext = () => {
|
|
|
1846
1852
|
// src/mobile/pageProtocol.ts
|
|
1847
1853
|
var ABSOLUTE_MOBILE_PAGE_MEDIA_TYPE = "application/vnd.absolute.page+json";
|
|
1848
1854
|
var ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION = 1;
|
|
1855
|
+
var ABSOLUTE_NATIVE_ROUTE_DATA_MEDIA_TYPE = "application/vnd.absolute.native-route+json";
|
|
1849
1856
|
var BAD_REQUEST_STATUS = 400;
|
|
1850
1857
|
var OK_STATUS = 200;
|
|
1851
1858
|
var SERVER_ERROR_STATUS = 500;
|
|
@@ -1864,6 +1871,11 @@ var acceptsAbsoluteMobilePage = (request) => {
|
|
|
1864
1871
|
return false;
|
|
1865
1872
|
return (request.headers.get("accept") ?? "").split(",").some((value) => parseMediaType(value) === ABSOLUTE_MOBILE_PAGE_MEDIA_TYPE);
|
|
1866
1873
|
};
|
|
1874
|
+
var acceptsAbsoluteNativeRouteData = (request) => {
|
|
1875
|
+
if (!request)
|
|
1876
|
+
return false;
|
|
1877
|
+
return (request.headers.get("accept") ?? "").split(",").some((value) => parseMediaType(value) === ABSOLUTE_NATIVE_ROUTE_DATA_MEDIA_TYPE);
|
|
1878
|
+
};
|
|
1867
1879
|
var readRequiredHeader = (request, name) => {
|
|
1868
1880
|
const value = request.headers.get(name)?.trim();
|
|
1869
1881
|
return value ? value : undefined;
|
|
@@ -1994,6 +2006,32 @@ var finalizeArchivedMobilePage = (context, input) => {
|
|
|
1994
2006
|
return createAbsoluteMobilePageErrorResponse(page.pageId);
|
|
1995
2007
|
}
|
|
1996
2008
|
};
|
|
2009
|
+
var finalizeAbsoluteNativeRouteDevelopmentPage = (input) => {
|
|
2010
|
+
if (false) {}
|
|
2011
|
+
if (input.request?.method !== "GET") {
|
|
2012
|
+
return createAbsoluteMobileInvalidRequestResponse("Native-route data requests must use GET.");
|
|
2013
|
+
}
|
|
2014
|
+
if (input.request.headers.get(MOBILE_PAGE_REQUEST_HEADERS.protocol) !== String(ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION)) {
|
|
2015
|
+
return createAbsoluteMobileInvalidRequestResponse(`Native-route data requires protocol ${ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION}.`);
|
|
2016
|
+
}
|
|
2017
|
+
const [representation] = input.compatibility.representations;
|
|
2018
|
+
if (!representation) {
|
|
2019
|
+
return createAbsoluteMobilePageErrorResponse(input.compatibility.pageId);
|
|
2020
|
+
}
|
|
2021
|
+
try {
|
|
2022
|
+
return envelopeResponse({
|
|
2023
|
+
contract: representation.contract,
|
|
2024
|
+
framework: input.compatibility.framework,
|
|
2025
|
+
kind: "page",
|
|
2026
|
+
pageId: input.compatibility.pageId,
|
|
2027
|
+
props: normalizeJsonValue(representation.mapProps(input.props)),
|
|
2028
|
+
status: input.status ?? OK_STATUS
|
|
2029
|
+
}, input.status ?? OK_STATUS);
|
|
2030
|
+
} catch (error) {
|
|
2031
|
+
console.error(`[Mobile] Failed to produce development native route ${input.compatibility.pageId}:`, error);
|
|
2032
|
+
return createAbsoluteMobilePageErrorResponse(input.compatibility.pageId);
|
|
2033
|
+
}
|
|
2034
|
+
};
|
|
1997
2035
|
var createAbsoluteMobileInvalidRequestResponse = (message) => envelopeResponse({ kind: "invalid-request", message }, BAD_REQUEST_STATUS);
|
|
1998
2036
|
var createAbsoluteMobilePageErrorResponse = (pageId) => envelopeResponse({
|
|
1999
2037
|
code: "representation-failed",
|
|
@@ -2003,6 +2041,9 @@ var createAbsoluteMobilePageErrorResponse = (pageId) => envelopeResponse({
|
|
|
2003
2041
|
}, SERVER_ERROR_STATUS);
|
|
2004
2042
|
var createAbsoluteMobileUpgradeResponse = (result) => envelopeResponse(result, UPGRADE_REQUIRED_STATUS);
|
|
2005
2043
|
var finalizeAbsoluteMobilePage = (input) => {
|
|
2044
|
+
if (acceptsAbsoluteNativeRouteData(input.request)) {
|
|
2045
|
+
return finalizeAbsoluteNativeRouteDevelopmentPage(input);
|
|
2046
|
+
}
|
|
2006
2047
|
const parsed = parseAbsoluteMobilePageRequest(input.request);
|
|
2007
2048
|
if (parsed.kind === "not-mobile")
|
|
2008
2049
|
return;
|
|
@@ -2269,5 +2310,5 @@ export {
|
|
|
2269
2310
|
handleReactPageRequest
|
|
2270
2311
|
};
|
|
2271
2312
|
|
|
2272
|
-
//# debugId=
|
|
2313
|
+
//# debugId=5AA87E5CBF867D4164756E2164756E21
|
|
2273
2314
|
//# sourceMappingURL=server.js.map
|