@absolutejs/absolute 0.20.0-beta.181 → 0.20.0-beta.183
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/CHANGELOG.md +46 -0
- package/changelog.json +75 -0
- package/dist/angular/browser.js +2 -2
- package/dist/angular/browser.js.map +4 -4
- package/dist/angular/components/constants.js +4 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +520 -84
- package/dist/angular/index.js.map +13 -12
- package/dist/angular/server.js +520 -84
- package/dist/angular/server.js.map +13 -12
- package/dist/build.js +452 -85
- package/dist/build.js.map +18 -18
- package/dist/cli/{add-8gw9mk2b.js → add-jft96bp4.js} +9 -9
- package/dist/cli/{analyze-e57zz9x8.js → analyze-5w46d1f0.js} +3 -3
- package/dist/cli/{androidEmulatorController-vqc5m2rp.js → androidEmulatorController-gbf9r660.js} +6 -6
- package/dist/cli/{androidNativeWatcher-s03aczxv.js → androidNativeWatcher-3astrxxz.js} +6 -6
- package/dist/cli/{api-8ppxw487.js → api-zmvnvdsf.js} +8 -8
- package/dist/cli/{build-ptx5a72p.js → build-df81wh71.js} +67 -6
- package/dist/cli/{build-fz7qbdn3.js → build-mskrk9zb.js} +3 -3
- package/dist/cli/{buildDepVendor-qnwfct22.js → buildDepVendor-36d1aa7c.js} +2 -2
- package/dist/cli/{buildReactServerComponents-01s87hnk.js → buildReactServerComponents-k6amghrj.js} +5 -5
- package/dist/cli/{compile-54rb8szn.js → compile-7mjd739p.js} +10 -6
- package/dist/cli/config/server.js +37 -18
- package/dist/cli/{db-qbzjw3en.js → db-mpmj37jq.js} +2 -2
- package/dist/cli/{dev-6s6g5tnk.js → dev-9d6d7757.js} +14 -14
- package/dist/cli/{doctor-m36tmx4d.js → doctor-nng9szw6.js} +3 -3
- package/dist/cli/{emulatorDoctor-s1z5tkp7.js → emulatorDoctor-3eszsqs8.js} +5 -5
- package/dist/cli/{emulatorInstaller-pgkdswvq.js → emulatorInstaller-1r6cawm0.js} +6 -6
- package/dist/cli/{env-5nz1qm8e.js → env-bfa7vs35.js} +3 -3
- package/dist/cli/{expoDevController-018anvbm.js → expoDevController-s0msdwbm.js} +6 -6
- package/dist/cli/{generate-5vyz1s44.js → generate-xk3a7qnc.js} +8 -8
- package/dist/cli/{heapDiff-kncvdtn8.js → heapDiff-3ba8p8wf.js} +3 -3
- package/dist/cli/{htmx-26hs6jdm.js → htmx-an2x3gpx.js} +6 -6
- package/dist/cli/{index-7854xf0m.js → index-1bszxtdj.js} +1 -1
- package/dist/cli/{index-kx2d067c.js → index-3066eqr3.js} +8 -5
- package/dist/cli/{index-8khbn8qr.js → index-3a9h87v5.js} +3 -3
- package/dist/cli/{index-jkg2h10c.js → index-3dz754hk.js} +3 -3
- package/dist/cli/{index-9djrap79.js → index-3pz5sjaz.js} +1 -1
- package/dist/cli/{index-50ag35xg.js → index-3ys9tz53.js} +2 -2
- package/dist/cli/{index-6f448d7m.js → index-4ynx0cq6.js} +26 -12
- package/dist/cli/{index-btp4fyf1.js → index-785hpa2r.js} +2 -2
- package/dist/cli/{index-kes8he5s.js → index-9sqqzeq4.js} +1 -1
- package/dist/cli/{index-pr1skxen.js → index-akseq9ps.js} +1 -1
- package/dist/cli/{index-23hvdyxf.js → index-c6j2727a.js} +1 -1
- package/dist/cli/{index-pkw3jktb.js → index-eh786rj4.js} +2 -2
- package/dist/cli/{index-aemhvvwb.js → index-eydgkr7w.js} +1 -1
- package/dist/cli/{index-rz56x932.js → index-fbmfpqk8.js} +1 -1
- package/dist/cli/{index-c8rcfe5a.js → index-fy4th3n0.js} +1 -1
- package/dist/cli/{index-prza6tkp.js → index-gx6pjzzk.js} +3 -3
- package/dist/cli/{index-125cfzvn.js → index-hker5fs4.js} +2 -2
- package/dist/cli/{index-cgmp9d02.js → index-hqkcxa2p.js} +1 -1
- package/dist/cli/{index-5w8arh3m.js → index-pq4qqz0r.js} +2 -2
- package/dist/cli/{index-enbw9484.js → index-wpgsermq.js} +1 -1
- package/dist/cli/{index-0z5fgb80.js → index-wqpg377f.js} +1 -1
- package/dist/cli/{index-3sfcmb49.js → index-x7h6w6td.js} +1 -1
- package/dist/cli/{index-a6xx0p9e.js → index-ydaxsftq.js} +1 -1
- package/dist/cli/{index-3ewt17wm.js → index-yhkg5by0.js} +1 -1
- package/dist/cli/{index-aqe25w4h.js → index-zeeep92g.js} +1 -1
- package/dist/cli/index.js +32 -32
- package/dist/cli/{info-k124sh7g.js → info-5rwsbhe2.js} +4 -4
- package/dist/cli/{inspect-n6pcfvfw.js → inspect-nmwb0q5k.js} +5 -5
- package/dist/cli/{iosNativeWatcher-wdq2fvj1.js → iosNativeWatcher-7r9gnk87.js} +7 -7
- package/dist/cli/{iosSimulatorController-n97dpa8p.js → iosSimulatorController-w963vv9r.js} +7 -7
- package/dist/cli/{islands-17tfx8jf.js → islands-w9xrehpk.js} +3 -3
- package/dist/cli/{logs-shg23fbt.js → logs-m793x8a7.js} +3 -3
- package/dist/cli/{ls-0wr74w0b.js → ls-k31npd5b.js} +3 -3
- package/dist/cli/{mem-16sy1707.js → mem-jm6kw6gr.js} +5 -5
- package/dist/cli/{migrate-k91k050s.js → migrate-95bjkqkr.js} +2 -2
- package/dist/cli/{mobile-hpqpy61f.js → mobile-cpp8vfn7.js} +13 -13
- package/dist/cli/prerender-26pzynh4.js +13 -0
- package/dist/cli/{prettier-dh5fh786.js → prettier-0ws9pbc1.js} +1 -1
- package/dist/cli/{ps-pk7ncjac.js → ps-fx8mz3e3.js} +6 -6
- package/dist/cli/{psTui-50wf0b72.js → psTui-0e9c7an6.js} +7 -7
- package/dist/cli/{remoteMacProtocol-g10s408w.js → remoteMacProtocol-y7h79gr8.js} +7 -7
- package/dist/cli/{remove-x987pvd3.js → remove-xhvph8bz.js} +8 -8
- package/dist/cli/{routes-mc3ymp8t.js → routes-hq9yje5z.js} +3 -3
- package/dist/cli/{start-mbn2zgs2.js → start-5mjh9hh2.js} +5 -5
- package/dist/cli/{typecheck-ynzw2eep.js → typecheck-bvm0ndq4.js} +188 -75
- package/dist/cli/{workspace-7sbyyc59.js → workspace-xeb6abxj.js} +5 -5
- package/dist/dev/serverBootstrap.js +8 -2
- package/dist/index.js +469 -99
- package/dist/index.js.map +20 -20
- package/dist/islands/index.js +312 -23
- package/dist/islands/index.js.map +5 -5
- package/dist/mobile/index.js +2 -2
- package/dist/mobile/index.js.map +3 -3
- package/dist/react/browser.js +18 -1
- package/dist/react/browser.js.map +6 -4
- package/dist/react/components/index.js +2 -2
- package/dist/react/components/index.js.map +3 -3
- package/dist/react/index.js +370 -62
- package/dist/react/index.js.map +14 -13
- package/dist/react/server.js +51 -36
- package/dist/react/server.js.map +10 -10
- package/dist/src/angular/colocatedRouteMatch.d.ts +23 -0
- package/dist/src/angular/components/constants.d.ts +1 -0
- package/dist/src/angular/components/defer-slot-payload.d.ts +5 -0
- package/dist/src/cli/scripts/manifestKeysEditorHint.d.ts +9 -0
- package/dist/src/cli/scripts/typecheck.d.ts +1 -0
- package/dist/src/cli/scripts/typecheckDiagnostics.d.ts +41 -0
- package/dist/src/constants.d.ts +1 -0
- package/dist/src/core/prerender.d.ts +10 -0
- package/dist/src/dev/hot/analyze.d.ts +1 -1
- package/dist/src/react/browser.d.ts +1 -0
- package/dist/src/react/index.d.ts +1 -0
- package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +23 -0
- package/dist/src/utils/pageCspNonce.d.ts +14 -0
- package/dist/src/utils/spaRouteManifest.d.ts +1 -0
- package/dist/svelte/index.js +372 -69
- package/dist/svelte/index.js.map +11 -11
- package/dist/svelte/server.js +363 -60
- package/dist/svelte/server.js.map +11 -11
- package/dist/types/manifest.d.ts +3 -2
- package/dist/types/svelte.d.ts +3 -0
- package/dist/vue/components/Image.js +2 -2
- package/dist/vue/components/Image.js.map +3 -3
- package/dist/vue/components/index.js +2 -2
- package/dist/vue/components/index.js.map +3 -3
- package/dist/vue/index.js +364 -61
- package/dist/vue/index.js.map +11 -11
- package/dist/vue/server.js +54 -40
- package/dist/vue/server.js.map +9 -9
- package/package.json +1 -1
- package/dist/cli/prerender-w65xp6h8.js +0 -11
- /package/dist/cli/{index-t8jmj8w1.js → index-fm9x6sjs.js} +0 -0
package/dist/react/index.js
CHANGED
|
@@ -72,6 +72,26 @@ var __esm = (fn, res, err) => () => {
|
|
|
72
72
|
};
|
|
73
73
|
var __require = import.meta.require;
|
|
74
74
|
|
|
75
|
+
// src/constants.ts
|
|
76
|
+
var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_RELOAD_BACKOFF_BASE_MS = 1000, CSS_RELOAD_BACKOFF_MAX_MS = 60000, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTML_CONTENT_TYPE = "text/html; charset=utf-8", HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HTTP_STATUS_GONE = 410, HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS = 240, DEFAULT_HTTP_IDLE_TIMEOUT_SECONDS = 240, MAX_HTTP_IDLE_TIMEOUT_SECONDS = 255, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
|
|
77
|
+
var init_constants = __esm(() => {
|
|
78
|
+
TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
|
|
79
|
+
IMAGE_DEFAULT_DEVICE_SIZES = [
|
|
80
|
+
640,
|
|
81
|
+
750,
|
|
82
|
+
828,
|
|
83
|
+
1080,
|
|
84
|
+
1200,
|
|
85
|
+
1920,
|
|
86
|
+
2048,
|
|
87
|
+
3840
|
|
88
|
+
];
|
|
89
|
+
IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
|
|
90
|
+
MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
|
|
91
|
+
MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
|
|
92
|
+
TWO_THIRDS = 2 / 3;
|
|
93
|
+
});
|
|
94
|
+
|
|
75
95
|
// src/utils/cspNonceRef.ts
|
|
76
96
|
var GETTER_KEY, nonceAttr = (nonce = readCspNonce()) => nonce ? ` nonce="${nonce}"` : "", nonceSvelteHeadStyles = (head, nonce = readCspNonce()) => nonce ? head.replace(/<style(?=\s+id="svelte-[^"]*")(?![^>]*\snonce=)/g, `<style nonce="${nonce}"`) : head, readCspNonce = () => {
|
|
77
97
|
const getter = Reflect.get(globalThis, GETTER_KEY);
|
|
@@ -103,26 +123,6 @@ var init_escapeScriptContent = __esm(() => {
|
|
|
103
123
|
ESCAPE_REGEX = /[<\u2028\u2029]/g;
|
|
104
124
|
});
|
|
105
125
|
|
|
106
|
-
// src/constants.ts
|
|
107
|
-
var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_RELOAD_BACKOFF_BASE_MS = 1000, CSS_RELOAD_BACKOFF_MAX_MS = 60000, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HTTP_STATUS_GONE = 410, HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS = 240, DEFAULT_HTTP_IDLE_TIMEOUT_SECONDS = 240, MAX_HTTP_IDLE_TIMEOUT_SECONDS = 255, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
|
|
108
|
-
var init_constants = __esm(() => {
|
|
109
|
-
TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
|
|
110
|
-
IMAGE_DEFAULT_DEVICE_SIZES = [
|
|
111
|
-
640,
|
|
112
|
-
750,
|
|
113
|
-
828,
|
|
114
|
-
1080,
|
|
115
|
-
1200,
|
|
116
|
-
1920,
|
|
117
|
-
2048,
|
|
118
|
-
3840
|
|
119
|
-
];
|
|
120
|
-
IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
|
|
121
|
-
MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
|
|
122
|
-
MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
|
|
123
|
-
TWO_THIRDS = 2 / 3;
|
|
124
|
-
});
|
|
125
|
-
|
|
126
126
|
// src/utils/getDurationString.ts
|
|
127
127
|
var getDurationString = (duration) => {
|
|
128
128
|
let durationString;
|
|
@@ -1224,14 +1224,14 @@ var init_pageProtocol = __esm(() => {
|
|
|
1224
1224
|
|
|
1225
1225
|
// src/core/pageResponseCache.ts
|
|
1226
1226
|
import { createHash } from "crypto";
|
|
1227
|
-
var STREAMING_PAGE_HEADER = "x-absolute-stream",
|
|
1227
|
+
var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_MEDIA_TYPE = "text/html", streamingPageHeaders = (extra) => {
|
|
1228
1228
|
const headers = new Headers(extra);
|
|
1229
1229
|
headers.set("content-type", HTML_CONTENT_TYPE);
|
|
1230
1230
|
headers.set(STREAMING_PAGE_HEADER, "1");
|
|
1231
1231
|
return headers;
|
|
1232
1232
|
}, computeEtag = (html) => `W/"${createHash("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
|
|
1233
1233
|
const contentType = response.headers.get("content-type") ?? "";
|
|
1234
|
-
if (!contentType.includes(
|
|
1234
|
+
if (!contentType.includes(HTML_MEDIA_TYPE))
|
|
1235
1235
|
return response;
|
|
1236
1236
|
const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
|
|
1237
1237
|
if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
|
|
@@ -1257,7 +1257,9 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
|
|
|
1257
1257
|
statusText: response.statusText
|
|
1258
1258
|
});
|
|
1259
1259
|
};
|
|
1260
|
-
var init_pageResponseCache = () => {
|
|
1260
|
+
var init_pageResponseCache = __esm(() => {
|
|
1261
|
+
init_constants();
|
|
1262
|
+
});
|
|
1261
1263
|
|
|
1262
1264
|
// src/client/streamSwap.ts
|
|
1263
1265
|
var streamSwapRuntime = () => {
|
|
@@ -1709,9 +1711,9 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
|
|
|
1709
1711
|
tail: ""
|
|
1710
1712
|
};
|
|
1711
1713
|
};
|
|
1712
|
-
const handleBaseWinner = (controller, winner, baseRead, tail, footer) => {
|
|
1714
|
+
const handleBaseWinner = (controller, winner, baseRead, tail, footer, baseDone) => {
|
|
1713
1715
|
if (winner.kind !== "base") {
|
|
1714
|
-
return { baseDone
|
|
1716
|
+
return { baseDone, baseRead, footer, handled: false, tail };
|
|
1715
1717
|
}
|
|
1716
1718
|
if (winner.done) {
|
|
1717
1719
|
return finalizeCompletedBaseWinner(controller, tail + decoder.decode(), baseRead);
|
|
@@ -1754,7 +1756,7 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
|
|
|
1754
1756
|
return footer;
|
|
1755
1757
|
}
|
|
1756
1758
|
const winner = await Promise.race(racers);
|
|
1757
|
-
const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer), winner, (slotWinner) => {
|
|
1759
|
+
const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer, baseDone), winner, (slotWinner) => {
|
|
1758
1760
|
handleResolvedSlot(controller, slotWinner);
|
|
1759
1761
|
});
|
|
1760
1762
|
({ baseDone, baseRead, footer, tail } = baseWinnerState);
|
|
@@ -2075,7 +2077,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
2075
2077
|
nonce: readCspNonce()
|
|
2076
2078
|
});
|
|
2077
2079
|
return new Response(stream, {
|
|
2078
|
-
headers: { "Content-Type":
|
|
2080
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
2079
2081
|
status: 500
|
|
2080
2082
|
});
|
|
2081
2083
|
}, renderSvelteError = async (conventionPath, errorProps) => {
|
|
@@ -2091,7 +2093,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
2091
2093
|
});
|
|
2092
2094
|
const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
|
|
2093
2095
|
return new Response(html, {
|
|
2094
|
-
headers: { "Content-Type":
|
|
2096
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
2095
2097
|
status: 500
|
|
2096
2098
|
});
|
|
2097
2099
|
}, unescapeVueStyles = (ssrBody) => {
|
|
@@ -2115,7 +2117,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
2115
2117
|
const { styles, body } = unescapeVueStyles(rawBody);
|
|
2116
2118
|
const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
|
|
2117
2119
|
return new Response(html, {
|
|
2118
|
-
headers: { "Content-Type":
|
|
2120
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
2119
2121
|
status: 500
|
|
2120
2122
|
});
|
|
2121
2123
|
}, renderAngularError = async (conventionPath, errorProps) => {
|
|
@@ -2125,14 +2127,14 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
2125
2127
|
return null;
|
|
2126
2128
|
const html = renderFn(errorProps);
|
|
2127
2129
|
return new Response(html, {
|
|
2128
|
-
headers: { "Content-Type":
|
|
2130
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
2129
2131
|
status: 500
|
|
2130
2132
|
});
|
|
2131
2133
|
}, escapeHtml = (value) => value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), replaceErrorTokens = (template, errorProps) => template.replace(/\{\{\s*name\s*\}\}/g, escapeHtml(errorProps.name)).replace(/\{\{\s*message\s*\}\}/g, escapeHtml(errorProps.message)).replace(/\{\{\s*stack\s*\}\}/g, errorProps.stack ? escapeHtml(errorProps.stack) : ""), renderHtmlError = async (conventionPath, errorProps) => {
|
|
2132
2134
|
const template = await nonceStaticHtml(await Bun.file(conventionPath).text());
|
|
2133
2135
|
const html = replaceErrorTokens(template, errorProps);
|
|
2134
2136
|
return new Response(html, {
|
|
2135
|
-
headers: { "Content-Type":
|
|
2137
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
2136
2138
|
status: 500
|
|
2137
2139
|
});
|
|
2138
2140
|
}, logConventionRenderError = (framework, label, renderError) => {
|
|
@@ -2211,7 +2213,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
2211
2213
|
nonce: readCspNonce()
|
|
2212
2214
|
});
|
|
2213
2215
|
return new Response(stream, {
|
|
2214
|
-
headers: { "Content-Type":
|
|
2216
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
2215
2217
|
status: 404
|
|
2216
2218
|
});
|
|
2217
2219
|
}, renderSvelteNotFound = async (conventionPath) => {
|
|
@@ -2224,7 +2226,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
2224
2226
|
const { head, body } = render(NotFoundComponent, nonce ? { csp: { nonce } } : {});
|
|
2225
2227
|
const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
|
|
2226
2228
|
return new Response(html, {
|
|
2227
|
-
headers: { "Content-Type":
|
|
2229
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
2228
2230
|
status: 404
|
|
2229
2231
|
});
|
|
2230
2232
|
}, renderVueNotFound = async (conventionPath) => {
|
|
@@ -2241,7 +2243,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
2241
2243
|
const { styles, body } = unescapeVueStyles(rawBody);
|
|
2242
2244
|
const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
|
|
2243
2245
|
return new Response(html, {
|
|
2244
|
-
headers: { "Content-Type":
|
|
2246
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
2245
2247
|
status: 404
|
|
2246
2248
|
});
|
|
2247
2249
|
}, renderAngularNotFound = async (conventionPath) => {
|
|
@@ -2251,13 +2253,13 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
2251
2253
|
return null;
|
|
2252
2254
|
const html = renderFn();
|
|
2253
2255
|
return new Response(html, {
|
|
2254
|
-
headers: { "Content-Type":
|
|
2256
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
2255
2257
|
status: 404
|
|
2256
2258
|
});
|
|
2257
2259
|
}, renderHtmlNotFound = async (conventionPath) => {
|
|
2258
2260
|
const html = await nonceStaticHtml(await Bun.file(conventionPath).text());
|
|
2259
2261
|
return new Response(html, {
|
|
2260
|
-
headers: { "Content-Type":
|
|
2262
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
2261
2263
|
status: 404
|
|
2262
2264
|
});
|
|
2263
2265
|
}, NOT_FOUND_RENDERERS, renderConventionNotFound = async (framework) => {
|
|
@@ -2291,6 +2293,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
2291
2293
|
return renderNext(options.preferHtmx ? ["htmx", ...NOT_FOUND_PRIORITY.filter((key) => key !== "htmx")] : NOT_FOUND_PRIORITY);
|
|
2292
2294
|
};
|
|
2293
2295
|
var init_resolveConvention = __esm(() => {
|
|
2296
|
+
init_constants();
|
|
2294
2297
|
init_cspNonceRef();
|
|
2295
2298
|
init_staticHtmlNonce();
|
|
2296
2299
|
init_ssrErrorPage();
|
|
@@ -2323,6 +2326,7 @@ var init_resolveConvention = __esm(() => {
|
|
|
2323
2326
|
});
|
|
2324
2327
|
|
|
2325
2328
|
// src/utils/spaRouteManifest.ts
|
|
2329
|
+
import { NotFound } from "elysia";
|
|
2326
2330
|
import { basename as basename2 } from "path";
|
|
2327
2331
|
var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
|
|
2328
2332
|
Reflect.set(globalThis, SPA_ROUTES_KEY, hosts);
|
|
@@ -2387,7 +2391,14 @@ var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
|
|
|
2387
2391
|
}, renderSpaNotFound = async (framework, pageName, request) => {
|
|
2388
2392
|
if (isKnownSpaRoute(framework, pageName, request))
|
|
2389
2393
|
return null;
|
|
2390
|
-
return
|
|
2394
|
+
return renderSpaNotFoundResponse(request);
|
|
2395
|
+
}, renderSpaNotFoundResponse = async (request) => {
|
|
2396
|
+
if (request && !isPageRequest(request)) {
|
|
2397
|
+
return new NotFound().toResponse();
|
|
2398
|
+
}
|
|
2399
|
+
return await renderFirstNotFound({
|
|
2400
|
+
preferHtmx: request?.headers.get("hx-request") === "true"
|
|
2401
|
+
}) ?? new Response("Not found", {
|
|
2391
2402
|
headers: { "Content-Type": "text/plain" },
|
|
2392
2403
|
status: 404
|
|
2393
2404
|
});
|
|
@@ -3766,23 +3777,247 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
|
|
|
3766
3777
|
index = markup.indexOf("{", end);
|
|
3767
3778
|
}
|
|
3768
3779
|
return tags;
|
|
3769
|
-
}, escapeTemplateLiteral = (value) => value.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${"),
|
|
3770
|
-
|
|
3771
|
-
const
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3780
|
+
}, escapeTemplateLiteral = (value) => value.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${"), HTML_HELPERS = "__absoluteAwaitHtml", AWAIT_SCOPE_CLASS_PLACEHOLDER = "__absoluteAwaitScopeClass__", AWAIT_HTML_HELPERS_SOURCE, applyAwaitScopeClass = (code, scopeClass) => code.replaceAll(AWAIT_SCOPE_CLASS_PLACEHOLDER, scopeClass), createAwaitScopeClassCapture = () => {
|
|
3781
|
+
let scopeClass = "";
|
|
3782
|
+
const cssHash = ({ css, filename, hash }) => {
|
|
3783
|
+
scopeClass = `svelte-${hash(filename === "(unknown)" ? css : filename ?? css)}`;
|
|
3784
|
+
return scopeClass;
|
|
3785
|
+
};
|
|
3786
|
+
const apply = (code) => applyAwaitScopeClass(code, scopeClass);
|
|
3787
|
+
return { apply, cssHash };
|
|
3788
|
+
}, BOOLEAN_ATTRIBUTES, DIRECTIVE_ATTRIBUTE_RE, ATTRIBUTE_NAME_END_RE, RAW_TEXT_ELEMENTS, helperCall = (name, ...args) => `\${${HTML_HELPERS}.${name}(${args.join(", ")})}`, SHADOW_VALUE, END_TAG_RE, isShadowAttribute = (name) => !DIRECTIVE_ATTRIBUTE_RE.test(name) && !/^on/i.test(name), pushText = (scan, text) => {
|
|
3789
|
+
scan.literal += escapeTemplateLiteral(text);
|
|
3790
|
+
}, readExpressionTag = (scan) => {
|
|
3791
|
+
const end = findTagEnd(scan.source, scan.index);
|
|
3792
|
+
if (end === -1) {
|
|
3793
|
+
fail(scan.filePath, `unterminated tag in the ${scan.branch} branch`);
|
|
3794
|
+
}
|
|
3795
|
+
const inner = scan.source.slice(scan.index + 1, end - 1).trim();
|
|
3796
|
+
scan.index = end;
|
|
3797
|
+
return inner;
|
|
3798
|
+
}, failAttribute = (scan, detail) => fail(scan.filePath, `the ${scan.branch} branch of a streamed {#await} has ${detail}`), atValueEnd = (scan, quote) => {
|
|
3799
|
+
const char = scan.source[scan.index] ?? "";
|
|
3800
|
+
if (quote)
|
|
3801
|
+
return char === quote;
|
|
3802
|
+
return /[\s>]/.test(char) || scan.source.startsWith("/>", scan.index);
|
|
3803
|
+
}, readValueText = (scan, quote) => {
|
|
3804
|
+
const start = scan.index;
|
|
3805
|
+
while (scan.index < scan.source.length && scan.source[scan.index] !== "{" && !atValueEnd(scan, quote)) {
|
|
3806
|
+
scan.index += 1;
|
|
3807
|
+
}
|
|
3808
|
+
return scan.source.slice(start, scan.index);
|
|
3809
|
+
}, readAttributeValue = (scan) => {
|
|
3810
|
+
const { source } = scan;
|
|
3811
|
+
const quote = source[scan.index];
|
|
3812
|
+
const chunks = [];
|
|
3813
|
+
const isQuoted = quote === '"' || quote === "'";
|
|
3814
|
+
if (isQuoted)
|
|
3815
|
+
scan.index += 1;
|
|
3816
|
+
if (!isQuoted && source[scan.index] === "{") {
|
|
3817
|
+
chunks.push({ code: readExpressionTag(scan) });
|
|
3818
|
+
return chunks;
|
|
3819
|
+
}
|
|
3820
|
+
const valueQuote = isQuoted ? quote : undefined;
|
|
3821
|
+
while (scan.index < source.length && !atValueEnd(scan, valueQuote)) {
|
|
3822
|
+
chunks.push({ text: readValueText(scan, valueQuote) });
|
|
3823
|
+
if (source[scan.index] === "{")
|
|
3824
|
+
chunks.push({ code: readExpressionTag(scan) });
|
|
3825
|
+
}
|
|
3826
|
+
if (isQuoted)
|
|
3827
|
+
scan.index += 1;
|
|
3828
|
+
return chunks.filter((chunk) => !("text" in chunk) || chunk.text !== "");
|
|
3829
|
+
}, pushDynamicAttribute = (scan, name, chunks) => {
|
|
3830
|
+
if (DIRECTIVE_ATTRIBUTE_RE.test(name) || /^on/i.test(name)) {
|
|
3831
|
+
failAttribute(scan, `an expression in ${name}= (directives and event handlers need Svelte to run them)`);
|
|
3832
|
+
}
|
|
3833
|
+
const tag = chunks.find((chunk) => ("code" in chunk) && /^[#:/@]/.test(chunk.code));
|
|
3834
|
+
if (tag && "code" in tag) {
|
|
3835
|
+
failAttribute(scan, `{${tag.code}} in the ${name}= attribute`);
|
|
3836
|
+
}
|
|
3837
|
+
if (isShadowAttribute(name))
|
|
3838
|
+
scan.shadow += ` ${name}=${SHADOW_VALUE}`;
|
|
3839
|
+
const isClass = name === "class";
|
|
3840
|
+
if (isClass)
|
|
3841
|
+
scan.hasClass = true;
|
|
3842
|
+
const [only] = chunks;
|
|
3843
|
+
const codes = chunks.flatMap((chunk) => ("code" in chunk) ? [`(${chunk.code})`] : []);
|
|
3844
|
+
if (isClass && chunks.length > 1 && codes.length === chunks.length) {
|
|
3845
|
+
scan.literal += helperCall("class", `${HTML_HELPERS}.join(${codes.join(", ")})`);
|
|
3846
|
+
return;
|
|
3847
|
+
}
|
|
3848
|
+
if (chunks.length === 1 && only && "code" in only) {
|
|
3849
|
+
const value = `(${only.code})`;
|
|
3850
|
+
if (name === "class")
|
|
3851
|
+
scan.literal += helperCall("class", value);
|
|
3852
|
+
else if (name === "style")
|
|
3853
|
+
scan.literal += helperCall("style", value);
|
|
3854
|
+
else
|
|
3855
|
+
scan.literal += helperCall("attr", JSON.stringify(name), value, String(BOOLEAN_ATTRIBUTES.has(name)));
|
|
3856
|
+
return;
|
|
3857
|
+
}
|
|
3858
|
+
pushText(scan, ` ${name}="`);
|
|
3859
|
+
for (const chunk of chunks) {
|
|
3860
|
+
if ("code" in chunk)
|
|
3861
|
+
scan.literal += helperCall("part", `(${chunk.code})`);
|
|
3862
|
+
else
|
|
3863
|
+
pushText(scan, chunk.text.replaceAll('"', """));
|
|
3864
|
+
}
|
|
3865
|
+
if (isClass)
|
|
3866
|
+
scan.literal += helperCall("scoped");
|
|
3867
|
+
pushText(scan, '"');
|
|
3868
|
+
}, pushStaticAttribute = (scan, whitespace, name, value) => {
|
|
3869
|
+
if (isShadowAttribute(name))
|
|
3870
|
+
scan.shadow += `${whitespace}${name}=${value}`;
|
|
3871
|
+
if (name !== "class") {
|
|
3872
|
+
pushText(scan, `${whitespace}${name}=${value}`);
|
|
3873
|
+
return;
|
|
3874
|
+
}
|
|
3875
|
+
scan.hasClass = true;
|
|
3876
|
+
const [first = ""] = value;
|
|
3877
|
+
const isQuoted = first === '"' || first === "'";
|
|
3878
|
+
const quote = isQuoted ? first : '"';
|
|
3879
|
+
const classes = isQuoted ? value.slice(1, -1) : value;
|
|
3880
|
+
if (classes === "") {
|
|
3881
|
+
scan.literal += helperCall("class", "''");
|
|
3882
|
+
return;
|
|
3883
|
+
}
|
|
3884
|
+
pushText(scan, `${whitespace}${name}=${quote}${classes}`);
|
|
3885
|
+
scan.literal += helperCall("scoped");
|
|
3886
|
+
pushText(scan, quote);
|
|
3887
|
+
}, readAttributeName = (scan) => {
|
|
3888
|
+
const { source } = scan;
|
|
3889
|
+
const start = scan.index;
|
|
3890
|
+
while (scan.index < source.length && !ATTRIBUTE_NAME_END_RE.test(source[scan.index] ?? "")) {
|
|
3891
|
+
scan.index += 1;
|
|
3892
|
+
}
|
|
3893
|
+
return source.slice(start, scan.index);
|
|
3894
|
+
}, skipWhitespace = (scan) => {
|
|
3895
|
+
const start = scan.index;
|
|
3896
|
+
while (/\s/.test(scan.source[scan.index] ?? ""))
|
|
3897
|
+
scan.index += 1;
|
|
3898
|
+
return scan.source.slice(start, scan.index);
|
|
3899
|
+
}, pushTagExpression = (scan) => {
|
|
3900
|
+
const inner = readExpressionTag(scan);
|
|
3901
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(inner)) {
|
|
3902
|
+
failAttribute(scan, `{${inner}} in a start tag`);
|
|
3903
|
+
}
|
|
3904
|
+
pushDynamicAttribute(scan, inner, [{ code: inner }]);
|
|
3905
|
+
}, pushAttribute = (scan) => {
|
|
3906
|
+
const { source } = scan;
|
|
3907
|
+
const whitespace = skipWhitespace(scan);
|
|
3908
|
+
const closing = source.startsWith("/>", scan.index) ? "/>" : ">";
|
|
3909
|
+
const isEnd = scan.index >= source.length;
|
|
3910
|
+
if (isEnd || source.startsWith(closing, scan.index)) {
|
|
3911
|
+
if (!scan.hasClass)
|
|
3912
|
+
scan.literal += helperCall("scope");
|
|
3913
|
+
const tagEnd = isEnd ? "" : closing;
|
|
3914
|
+
pushText(scan, whitespace + tagEnd);
|
|
3915
|
+
scan.shadow += whitespace + (isEnd ? ">" : closing);
|
|
3916
|
+
scan.index += tagEnd.length;
|
|
3917
|
+
return false;
|
|
3918
|
+
}
|
|
3919
|
+
if (source[scan.index] === "{") {
|
|
3920
|
+
pushTagExpression(scan);
|
|
3921
|
+
return true;
|
|
3922
|
+
}
|
|
3923
|
+
const name = readAttributeName(scan);
|
|
3924
|
+
if (!name) {
|
|
3925
|
+
pushText(scan, whitespace + (source[scan.index] ?? ""));
|
|
3926
|
+
scan.index += 1;
|
|
3927
|
+
return true;
|
|
3928
|
+
}
|
|
3929
|
+
const beforeEquals = scan.index;
|
|
3930
|
+
skipWhitespace(scan);
|
|
3931
|
+
if (source[scan.index] !== "=") {
|
|
3932
|
+
scan.index = beforeEquals;
|
|
3933
|
+
pushText(scan, whitespace + name);
|
|
3934
|
+
if (isShadowAttribute(name))
|
|
3935
|
+
scan.shadow += whitespace + name;
|
|
3936
|
+
return true;
|
|
3937
|
+
}
|
|
3938
|
+
scan.index += 1;
|
|
3939
|
+
skipWhitespace(scan);
|
|
3940
|
+
const valueStart = scan.index;
|
|
3941
|
+
const chunks = readAttributeValue(scan);
|
|
3942
|
+
if (chunks.some((chunk) => ("code" in chunk))) {
|
|
3943
|
+
pushDynamicAttribute(scan, name, chunks);
|
|
3944
|
+
return true;
|
|
3945
|
+
}
|
|
3946
|
+
pushStaticAttribute(scan, whitespace, name, source.slice(valueStart, scan.index));
|
|
3947
|
+
return true;
|
|
3948
|
+
}, pushStartTag = (scan) => {
|
|
3949
|
+
const { source } = scan;
|
|
3950
|
+
const nameMatch = source.slice(scan.index + 1).match(/^[^\s/>{]+/);
|
|
3951
|
+
const tagName = nameMatch?.[0] ?? "";
|
|
3952
|
+
pushText(scan, `<${tagName}`);
|
|
3953
|
+
scan.shadow += `<${tagName}`;
|
|
3954
|
+
scan.hasClass = RAW_TEXT_ELEMENTS.has(tagName.toLowerCase());
|
|
3955
|
+
scan.index += 1 + tagName.length;
|
|
3956
|
+
while (pushAttribute(scan))
|
|
3957
|
+
;
|
|
3958
|
+
return tagName.toLowerCase();
|
|
3959
|
+
}, pushRawText = (scan, tagName, shadowStart) => {
|
|
3960
|
+
const { source } = scan;
|
|
3961
|
+
const close = source.toLowerCase().indexOf(`</${tagName}`, scan.index);
|
|
3962
|
+
const closeEnd = close === -1 ? -1 : source.indexOf(">", close);
|
|
3963
|
+
const end = closeEnd === -1 ? source.length : closeEnd + 1;
|
|
3964
|
+
pushText(scan, source.slice(scan.index, end));
|
|
3965
|
+
scan.shadow = scan.shadow.slice(0, shadowStart);
|
|
3966
|
+
scan.index = end;
|
|
3967
|
+
}, pushTextExpression = (scan) => {
|
|
3968
|
+
const inner = readExpressionTag(scan);
|
|
3969
|
+
const rawHtml = inner.match(/^@html\s([\s\S]*)$/);
|
|
3970
|
+
if (rawHtml) {
|
|
3971
|
+
scan.literal += helperCall("html", `(${(rawHtml[1] ?? "").trim()})`);
|
|
3972
|
+
return;
|
|
3973
|
+
}
|
|
3974
|
+
scan.literal += helperCall("text", `(${inner})`);
|
|
3975
|
+
}, pushComment = (scan) => {
|
|
3976
|
+
const close = scan.source.indexOf("-->", scan.index + "<!--".length);
|
|
3977
|
+
const end = close === -1 ? scan.source.length : close + "-->".length;
|
|
3978
|
+
pushText(scan, scan.source.slice(scan.index, end));
|
|
3979
|
+
scan.index = end;
|
|
3980
|
+
}, scanTextPosition = (scan) => {
|
|
3981
|
+
const { index, source } = scan;
|
|
3982
|
+
if (source.startsWith("<!--", index)) {
|
|
3983
|
+
pushComment(scan);
|
|
3984
|
+
return;
|
|
3985
|
+
}
|
|
3986
|
+
if (source[index] === "<" && /[A-Za-z]/.test(source[index + 1] ?? "")) {
|
|
3987
|
+
const shadowStart = scan.shadow.length;
|
|
3988
|
+
const tagName = pushStartTag(scan);
|
|
3989
|
+
if (RAW_TEXT_ELEMENTS.has(tagName))
|
|
3990
|
+
pushRawText(scan, tagName, shadowStart);
|
|
3991
|
+
return;
|
|
3778
3992
|
}
|
|
3779
|
-
|
|
3780
|
-
|
|
3993
|
+
if (source[index] === "{") {
|
|
3994
|
+
pushTextExpression(scan);
|
|
3995
|
+
return;
|
|
3996
|
+
}
|
|
3997
|
+
const next = source.slice(index + 1).search(/[<{]/);
|
|
3998
|
+
const end = next === -1 ? source.length : index + 1 + next;
|
|
3999
|
+
const text = source.slice(index, end);
|
|
4000
|
+
pushText(scan, text);
|
|
4001
|
+
scan.shadow += (text.match(END_TAG_RE) ?? []).join("");
|
|
4002
|
+
scan.index = end;
|
|
4003
|
+
}, lowerBranch = (markup, branch, filePath) => {
|
|
4004
|
+
const scan = {
|
|
4005
|
+
branch,
|
|
4006
|
+
filePath,
|
|
4007
|
+
hasClass: false,
|
|
4008
|
+
index: 0,
|
|
4009
|
+
literal: "",
|
|
4010
|
+
shadow: "",
|
|
4011
|
+
source: markup.trim()
|
|
4012
|
+
};
|
|
4013
|
+
while (scan.index < scan.source.length)
|
|
4014
|
+
scanTextPosition(scan);
|
|
4015
|
+
return { literal: `\`${scan.literal}\``, shadow: scan.shadow };
|
|
3781
4016
|
}, fail = (filePath, message) => {
|
|
3782
4017
|
throw new Error(`${filePath ? `${filePath}: ` : ""}${message} (${AWAIT_STREAM_DIRECTIVE} streams plain HTML; remove the directive to let Svelte render the block and hydrate it)`);
|
|
3783
4018
|
}, assertPlainHtml = (markup, branch, filePath) => {
|
|
3784
4019
|
const withoutExpressions = topLevelTags(markup).reduceRight((text, { end, start }) => text.slice(0, start) + text.slice(end), markup);
|
|
3785
|
-
const nestedTag = topLevelTags(markup).find(({ text }) => /^\{[
|
|
4020
|
+
const nestedTag = topLevelTags(markup).find(({ text }) => /^\{(?:[#:/]|@(?!html\s))/.test(text));
|
|
3786
4021
|
if (nestedTag || SVELTE_ONLY_MARKUP_RE.test(withoutExpressions)) {
|
|
3787
4022
|
fail(filePath, `the ${branch} branch of a streamed {#await} holds Svelte markup (${nestedTag?.text ?? withoutExpressions.match(SVELTE_ONLY_MARKUP_RE)?.[0]}\u2026)`);
|
|
3788
4023
|
}
|
|
@@ -3826,12 +4061,16 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
|
|
|
3826
4061
|
thenIdentifier: thenMatch?.[2],
|
|
3827
4062
|
thenMarkup
|
|
3828
4063
|
};
|
|
3829
|
-
}, renderSlot = (block, slotId, dynamic) => {
|
|
4064
|
+
}, renderSlot = (block, slotId, dynamic, filePath) => {
|
|
3830
4065
|
const thenValueIdentifier = block.thenIdentifier ?? "__awaitValue";
|
|
3831
4066
|
const catchValueIdentifier = block.catchIdentifier ?? "__awaitError";
|
|
3832
|
-
const
|
|
3833
|
-
|
|
3834
|
-
|
|
4067
|
+
const pending = lowerBranch(block.pendingMarkup, "pending", filePath);
|
|
4068
|
+
const then = lowerBranch(block.thenMarkup, "then", filePath);
|
|
4069
|
+
const caught = block.catchMarkup === undefined ? undefined : lowerBranch(block.catchMarkup, "catch", filePath);
|
|
4070
|
+
const catchBranch = caught ? `catch (${catchValueIdentifier}) { return ${caught.literal}; }` : "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }";
|
|
4071
|
+
const shadows = [pending, then, caught].map((branch) => branch ? `<svelte:element this={'div'} data-absolute-slot="true">${branch.shadow}</svelte:element>` : "").join("");
|
|
4072
|
+
return `<AbsoluteAwaitSlot id="${slotId}"${dynamic ? " dynamic" : ""} fallbackHtml={${pending.literal}} resolve={async () => { try { const ${thenValueIdentifier} = await (${block.expression}); return ${then.literal}; } ${catchBranch} }} />{#if ${HTML_HELPERS}.shadow}${shadows}{/if}`;
|
|
4073
|
+
}, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', INJECTED_SCRIPT, lowerSvelteAwaitSlotSyntax = (source, filePath) => {
|
|
3835
4074
|
if (!source.includes("absolute:stream")) {
|
|
3836
4075
|
return { code: source, transformed: false };
|
|
3837
4076
|
}
|
|
@@ -3846,7 +4085,7 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
|
|
|
3846
4085
|
const slotId = `absolute-svelte-await-${awaitIndex.toString(BASE_36_RADIX)}`;
|
|
3847
4086
|
awaitIndex += 1;
|
|
3848
4087
|
lowered += source.slice(cursor, directive.index);
|
|
3849
|
-
lowered += renderSlot(block, slotId, directive[1] !== undefined);
|
|
4088
|
+
lowered += renderSlot(block, slotId, directive[1] !== undefined, filePath);
|
|
3850
4089
|
cursor = block.end;
|
|
3851
4090
|
}
|
|
3852
4091
|
if (awaitIndex === 0) {
|
|
@@ -3856,14 +4095,14 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
|
|
|
3856
4095
|
if (lowered.includes("<script")) {
|
|
3857
4096
|
return {
|
|
3858
4097
|
code: lowered.replace(/<script(\s[^>]*)?>/, (match) => `${match}
|
|
3859
|
-
${
|
|
4098
|
+
${INJECTED_SCRIPT}
|
|
3860
4099
|
`),
|
|
3861
4100
|
transformed: true
|
|
3862
4101
|
};
|
|
3863
4102
|
}
|
|
3864
4103
|
return {
|
|
3865
4104
|
code: `<script lang="ts">
|
|
3866
|
-
${
|
|
4105
|
+
${INJECTED_SCRIPT}
|
|
3867
4106
|
</script>
|
|
3868
4107
|
${lowered}`,
|
|
3869
4108
|
transformed: true
|
|
@@ -3875,6 +4114,64 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
|
|
|
3875
4114
|
BRANCH_TAG_RE = /^\{:(then|catch)(?:\s+([A-Za-z_$][\w$]*))?\s*\}$/;
|
|
3876
4115
|
SVELTE_ONLY_MARKUP_RE = /\{[#:/@]|<[A-Z]|<svelte:/;
|
|
3877
4116
|
QUOTES = new Set(['"', "'", "`"]);
|
|
4117
|
+
AWAIT_HTML_HELPERS_SOURCE = [
|
|
4118
|
+
`const ${HTML_HELPERS} = (() => {`,
|
|
4119
|
+
` const scope = ${JSON.stringify(AWAIT_SCOPE_CLASS_PLACEHOLDER)};`,
|
|
4120
|
+
` const escape = (value, isAttr) => String(value ?? '').replace(isAttr ? /[&"<]/g : /[&<]/g, (char) => char === '&' ? '&' : char === '"' ? '"' : '<');`,
|
|
4121
|
+
"\tconst stringify = (value) => typeof value === 'string' ? value : value == null ? '' : value + '';",
|
|
4122
|
+
"\tconst classNames = (value) => { if (Array.isArray(value)) return value.filter(Boolean).map(classNames).filter(Boolean).join(' '); if (value && typeof value === 'object') return Object.keys(value).filter((key) => value[key]).join(' '); return typeof value === 'string' || typeof value === 'number' ? String(value) : ''; };",
|
|
4123
|
+
"\treturn {",
|
|
4124
|
+
` attr: (name, value, isBoolean) => { const boolean = isBoolean || (name === 'hidden' && value !== 'until-found'); if (value == null || (!value && boolean)) return ''; const normalized = name === 'translate' && typeof value === 'boolean' ? (value ? 'yes' : 'no') : value; return boolean ? ' ' + name + '=""' : ' ' + name + '="' + escape(normalized, true) + '"'; },`,
|
|
4125
|
+
` class: (value) => { const resolved = typeof value === 'object' ? classNames(value) : value ?? ''; let name = '' + resolved; if (scope) name = name ? name + ' ' + scope : scope; return name ? ' class="' + escape(name, true) + '"' : ''; },`,
|
|
4126
|
+
"\t\thtml: (value) => String(value ?? ''),",
|
|
4127
|
+
"\t\tjoin: (...values) => values.map(stringify).join(''),",
|
|
4128
|
+
"\t\tpart: (value) => escape(stringify(value), true),",
|
|
4129
|
+
` scope: () => scope ? ' class="' + scope + '"' : '',`,
|
|
4130
|
+
"\t\tscoped: () => scope ? ' ' + scope : '',",
|
|
4131
|
+
"\t\tshadow: false,",
|
|
4132
|
+
` style: (value) => { const style = value == null ? '' : String(value); return style ? ' style="' + escape(style, true) + '"' : ''; },`,
|
|
4133
|
+
"\t\ttext: (value) => escape(value, false)",
|
|
4134
|
+
"\t};",
|
|
4135
|
+
"})();"
|
|
4136
|
+
].join(`
|
|
4137
|
+
`);
|
|
4138
|
+
BOOLEAN_ATTRIBUTES = new Set([
|
|
4139
|
+
"allowfullscreen",
|
|
4140
|
+
"async",
|
|
4141
|
+
"autofocus",
|
|
4142
|
+
"autoplay",
|
|
4143
|
+
"checked",
|
|
4144
|
+
"controls",
|
|
4145
|
+
"default",
|
|
4146
|
+
"defer",
|
|
4147
|
+
"disabled",
|
|
4148
|
+
"disablepictureinpicture",
|
|
4149
|
+
"disableremoteplayback",
|
|
4150
|
+
"formnovalidate",
|
|
4151
|
+
"indeterminate",
|
|
4152
|
+
"inert",
|
|
4153
|
+
"ismap",
|
|
4154
|
+
"loop",
|
|
4155
|
+
"multiple",
|
|
4156
|
+
"muted",
|
|
4157
|
+
"nomodule",
|
|
4158
|
+
"novalidate",
|
|
4159
|
+
"open",
|
|
4160
|
+
"playsinline",
|
|
4161
|
+
"readonly",
|
|
4162
|
+
"required",
|
|
4163
|
+
"reversed",
|
|
4164
|
+
"seamless",
|
|
4165
|
+
"selected",
|
|
4166
|
+
"webkitdirectory"
|
|
4167
|
+
]);
|
|
4168
|
+
DIRECTIVE_ATTRIBUTE_RE = /^(?:animate|bind|class|in|let|on|out|style|transition|use):/;
|
|
4169
|
+
ATTRIBUTE_NAME_END_RE = /[\s=>/{]/;
|
|
4170
|
+
RAW_TEXT_ELEMENTS = new Set(["script", "style"]);
|
|
4171
|
+
SHADOW_VALUE = `{${HTML_HELPERS}.shadow}`;
|
|
4172
|
+
END_TAG_RE = /<\/[A-Za-z][^\s>]*\s*>/g;
|
|
4173
|
+
INJECTED_SCRIPT = `${IMPORT_LINE}
|
|
4174
|
+
${AWAIT_HTML_HELPERS_SOURCE}`;
|
|
3878
4175
|
});
|
|
3879
4176
|
|
|
3880
4177
|
// src/build/stylePreprocessor.ts
|
|
@@ -4646,15 +4943,18 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandG
|
|
|
4646
4943
|
for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
|
|
4647
4944
|
transpiled = replaceQuotedSpecifier(transpiled, spec, resolvedModuleImport);
|
|
4648
4945
|
}
|
|
4649
|
-
|
|
4946
|
+
const scopeClass = createAwaitScopeClassCapture();
|
|
4947
|
+
const compiledServer = compile(transpiled, {
|
|
4650
4948
|
css: "injected",
|
|
4949
|
+
cssHash: scopeClass.cssHash,
|
|
4651
4950
|
experimental: {
|
|
4652
4951
|
async: loweredAwaitSource.transformed || loweredSource.transformed
|
|
4653
4952
|
},
|
|
4654
4953
|
filename: resolutionSourcePath,
|
|
4655
4954
|
generate: "server",
|
|
4656
4955
|
hmr: isDevelopmentRuntime()
|
|
4657
|
-
})
|
|
4956
|
+
});
|
|
4957
|
+
let compiledCode = scopeClass.apply(compiledServer.js.code);
|
|
4658
4958
|
for (const [spec, compiledChildPath] of childModulePaths) {
|
|
4659
4959
|
compiledCode = replaceQuotedSpecifier(compiledCode, spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), compiledChildPath));
|
|
4660
4960
|
}
|
|
@@ -5000,6 +5300,9 @@ var init_renderIslandMarkup = __esm(() => {
|
|
|
5000
5300
|
});
|
|
5001
5301
|
});
|
|
5002
5302
|
|
|
5303
|
+
// src/react/pageHandler.ts
|
|
5304
|
+
init_constants();
|
|
5305
|
+
|
|
5003
5306
|
// src/utils/requestRenderUrl.ts
|
|
5004
5307
|
var requestRenderUrl = (request) => {
|
|
5005
5308
|
if (!request)
|
|
@@ -5368,7 +5671,7 @@ var handleReactPageRequest = async (input) => {
|
|
|
5368
5671
|
if (resolveErrorConventionPath("react", pageName) || hasErrorConvention("react")) {
|
|
5369
5672
|
const html = await new Response(htmlStream).text();
|
|
5370
5673
|
return new Response(html, {
|
|
5371
|
-
headers: { "Content-Type":
|
|
5674
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE }
|
|
5372
5675
|
});
|
|
5373
5676
|
}
|
|
5374
5677
|
return new Response(htmlStream, {
|
|
@@ -5386,7 +5689,7 @@ var handleReactPageRequest = async (input) => {
|
|
|
5386
5689
|
return withPageCacheHeaders(conventionResponse, request);
|
|
5387
5690
|
}
|
|
5388
5691
|
return withPageCacheHeaders(new Response(ssrErrorPage("react", error), {
|
|
5389
|
-
headers: { "Content-Type":
|
|
5692
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
5390
5693
|
status: 500
|
|
5391
5694
|
}), request);
|
|
5392
5695
|
}
|
|
@@ -5473,6 +5776,7 @@ var reactFileRoute = (route) => defineFileRouteWith("react", route, async ({ man
|
|
|
5473
5776
|
});
|
|
5474
5777
|
});
|
|
5475
5778
|
// src/react/serverComponents/pageHandler.ts
|
|
5779
|
+
init_constants();
|
|
5476
5780
|
init_cspNonceRef();
|
|
5477
5781
|
init_requestContext();
|
|
5478
5782
|
init_pageResponseCache();
|
|
@@ -5671,7 +5975,7 @@ var handleReactServerPageRequest = async (input) => {
|
|
|
5671
5975
|
} catch (error) {
|
|
5672
5976
|
logRenderError(error);
|
|
5673
5977
|
return withPageCacheHeaders(new Response(ssrErrorPage("react", error), {
|
|
5674
|
-
headers: { "Content-Type":
|
|
5978
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
5675
5979
|
status: 500
|
|
5676
5980
|
}), request);
|
|
5677
5981
|
}
|
|
@@ -5903,14 +6207,18 @@ var subscribeIslandStore = (store, selector, listener) => {
|
|
|
5903
6207
|
var useIslandStore = (store, selector) => useSyncExternalStore((listener) => subscribeIslandStore(store, selector, () => {
|
|
5904
6208
|
listener();
|
|
5905
6209
|
}), () => readIslandStore(store, selector), () => getIslandStoreServerSnapshot(store, selector));
|
|
6210
|
+
// src/utils/pageCspNonce.ts
|
|
6211
|
+
init_cspNonceRef();
|
|
6212
|
+
var getCspNonce = () => readCspNonce() ?? readPageNonce();
|
|
5906
6213
|
export {
|
|
5907
6214
|
Island,
|
|
5908
6215
|
createTypedIsland,
|
|
6216
|
+
getCspNonce,
|
|
5909
6217
|
handleReactPageRequest,
|
|
5910
6218
|
handleReactServerPageRequest,
|
|
5911
6219
|
reactFileRoute,
|
|
5912
6220
|
useIslandStore
|
|
5913
6221
|
};
|
|
5914
6222
|
|
|
5915
|
-
//# debugId=
|
|
6223
|
+
//# debugId=D5C7152E8FB51DFE64756E2164756E21
|
|
5916
6224
|
//# sourceMappingURL=index.js.map
|