@absolutejs/absolute 0.19.0-beta.807 → 0.19.0-beta.809
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 +9801 -57
- package/dist/angular/browser.js.map +246 -4
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +14877 -60
- package/dist/angular/index.js.map +281 -4
- package/dist/angular/server.js +5610 -45
- package/dist/angular/server.js.map +51 -3
- package/dist/build.js +18092 -45
- package/dist/build.js.map +99 -3
- package/dist/cli/index.js +317 -86
- package/dist/client/index.js +1091 -70
- package/dist/client/index.js.map +24 -4
- package/dist/core/streamingSlotRegistrar.js +108 -11
- package/dist/core/streamingSlotRegistrar.js.map +4 -3
- package/dist/core/streamingSlotRegistry.js +169 -7
- package/dist/core/streamingSlotRegistry.js.map +5 -3
- package/dist/index.js +19957 -547
- package/dist/index.js.map +116 -3
- package/dist/islands/browser.js +228 -9
- package/dist/islands/browser.js.map +9 -4
- package/dist/islands/index.js +1908 -17
- package/dist/islands/index.js.map +27 -3
- package/dist/react/browser.js +328 -12
- package/dist/react/browser.js.map +12 -4
- package/dist/react/components/index.js +167 -16
- package/dist/react/components/index.js.map +6 -3
- package/dist/react/hooks/index.js +183 -8
- package/dist/react/hooks/index.js.map +7 -3
- package/dist/react/index.js +3627 -36
- package/dist/react/index.js.map +45 -4
- package/dist/react/jsxDevRuntimeCompat.js +61 -2
- package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
- package/dist/react/server.js +1789 -18
- package/dist/react/server.js.map +21 -3
- package/dist/src/angular/injectorPatch.d.ts +1 -0
- package/dist/src/angular/islands.d.ts +1 -0
- package/dist/src/client/hydrators/react.d.ts +3 -0
- package/dist/src/client/hydrators/svelte.d.ts +2 -0
- package/dist/src/client/hydrators/vue.d.ts +2 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/svelte/browser.js +247 -12
- package/dist/svelte/browser.js.map +10 -3
- package/dist/svelte/index.js +3732 -37
- package/dist/svelte/index.js.map +47 -4
- package/dist/svelte/server.js +2794 -21
- package/dist/svelte/server.js.map +27 -3
- package/dist/vue/browser.js +348 -12
- package/dist/vue/browser.js.map +12 -4
- package/dist/vue/components/Image.js +240 -7
- package/dist/vue/components/Image.js.map +6 -3
- package/dist/vue/components/index.js +544 -11
- package/dist/vue/components/index.js.map +9 -3
- package/dist/vue/index.js +4212 -52
- package/dist/vue/index.js.map +50 -4
- package/dist/vue/server.js +1849 -18
- package/dist/vue/server.js.map +21 -3
- package/package.json +1 -1
- package/dist/chunk-0867j0r0.js +0 -136
- package/dist/chunk-0867j0r0.js.map +0 -10
- package/dist/chunk-102fp7xe.js +0 -63
- package/dist/chunk-102fp7xe.js.map +0 -10
- package/dist/chunk-11zpfqz6.js +0 -19
- package/dist/chunk-11zpfqz6.js.map +0 -10
- package/dist/chunk-1rfh7hw9.js +0 -319
- package/dist/chunk-1rfh7hw9.js.map +0 -11
- package/dist/chunk-1x4fxm57.js +0 -51
- package/dist/chunk-1x4fxm57.js.map +0 -9
- package/dist/chunk-25v9t56f.js +0 -29
- package/dist/chunk-25v9t56f.js.map +0 -11
- package/dist/chunk-2f21eenc.js +0 -21
- package/dist/chunk-2f21eenc.js.map +0 -10
- package/dist/chunk-2ga2znex.js +0 -13
- package/dist/chunk-2ga2znex.js.map +0 -9
- package/dist/chunk-30yrw0f6.js +0 -33
- package/dist/chunk-30yrw0f6.js.map +0 -10
- package/dist/chunk-3g91wb4f.js +0 -358
- package/dist/chunk-3g91wb4f.js.map +0 -10
- package/dist/chunk-3rea1gam.js +0 -4403
- package/dist/chunk-3rea1gam.js.map +0 -28
- package/dist/chunk-3yjzpcne.js +0 -34
- package/dist/chunk-3yjzpcne.js.map +0 -10
- package/dist/chunk-41bf6aqt.js +0 -17
- package/dist/chunk-41bf6aqt.js.map +0 -9
- package/dist/chunk-4d39r92n.js +0 -81
- package/dist/chunk-4d39r92n.js.map +0 -10
- package/dist/chunk-5003emhv.js +0 -17
- package/dist/chunk-5003emhv.js.map +0 -10
- package/dist/chunk-5f67rsed.js +0 -466
- package/dist/chunk-5f67rsed.js.map +0 -10
- package/dist/chunk-5fhp1jap.js +0 -9169
- package/dist/chunk-5fhp1jap.js.map +0 -236
- package/dist/chunk-629x0yh4.js +0 -20
- package/dist/chunk-629x0yh4.js.map +0 -9
- package/dist/chunk-6pdj08z3.js +0 -73
- package/dist/chunk-6pdj08z3.js.map +0 -12
- package/dist/chunk-6qjbrt0k.js +0 -13
- package/dist/chunk-6qjbrt0k.js.map +0 -9
- package/dist/chunk-6sccb4jr.js +0 -14
- package/dist/chunk-6sccb4jr.js.map +0 -9
- package/dist/chunk-798spvzv.js +0 -50
- package/dist/chunk-798spvzv.js.map +0 -10
- package/dist/chunk-7fw6x3js.js +0 -131
- package/dist/chunk-7fw6x3js.js.map +0 -11
- package/dist/chunk-7kjj42xm.js +0 -11
- package/dist/chunk-7kjj42xm.js.map +0 -10
- package/dist/chunk-7mtstdqn.js +0 -90
- package/dist/chunk-7mtstdqn.js.map +0 -10
- package/dist/chunk-851whwc7.js +0 -17
- package/dist/chunk-851whwc7.js.map +0 -10
- package/dist/chunk-85n68sy6.js +0 -103
- package/dist/chunk-85n68sy6.js.map +0 -10
- package/dist/chunk-8kcfffry.js +0 -35
- package/dist/chunk-8kcfffry.js.map +0 -10
- package/dist/chunk-92fsjfpp.js +0 -1731
- package/dist/chunk-92fsjfpp.js.map +0 -11
- package/dist/chunk-93sqk7be.js +0 -139
- package/dist/chunk-93sqk7be.js.map +0 -12
- package/dist/chunk-9c5tj4k3.js +0 -130
- package/dist/chunk-9c5tj4k3.js.map +0 -10
- package/dist/chunk-9j59emg3.js +0 -184
- package/dist/chunk-9j59emg3.js.map +0 -11
- package/dist/chunk-9ve9jq72.js +0 -203
- package/dist/chunk-9ve9jq72.js.map +0 -10
- package/dist/chunk-9xrsjeem.js +0 -12
- package/dist/chunk-9xrsjeem.js.map +0 -9
- package/dist/chunk-a9mvyp04.js +0 -87
- package/dist/chunk-a9mvyp04.js.map +0 -10
- package/dist/chunk-b3gbnrwe.js +0 -21
- package/dist/chunk-b3gbnrwe.js.map +0 -10
- package/dist/chunk-bgb8k1qs.js +0 -672
- package/dist/chunk-bgb8k1qs.js.map +0 -15
- package/dist/chunk-bmgqm774.js +0 -65
- package/dist/chunk-bmgqm774.js.map +0 -9
- package/dist/chunk-bxfghpma.js +0 -69
- package/dist/chunk-bxfghpma.js.map +0 -10
- package/dist/chunk-c1jfjnka.js +0 -74
- package/dist/chunk-c1jfjnka.js.map +0 -10
- package/dist/chunk-cbkrwmvh.js +0 -80
- package/dist/chunk-cbkrwmvh.js.map +0 -10
- package/dist/chunk-cdxd7sy2.js +0 -71
- package/dist/chunk-cdxd7sy2.js.map +0 -10
- package/dist/chunk-cg95827x.js +0 -21
- package/dist/chunk-cg95827x.js.map +0 -10
- package/dist/chunk-cm0g4q6w.js +0 -149
- package/dist/chunk-cm0g4q6w.js.map +0 -10
- package/dist/chunk-d7mwkzry.js +0 -261
- package/dist/chunk-d7mwkzry.js.map +0 -10
- package/dist/chunk-d9c0am65.js +0 -12
- package/dist/chunk-d9c0am65.js.map +0 -10
- package/dist/chunk-daqghmg8.js +0 -12
- package/dist/chunk-daqghmg8.js.map +0 -9
- package/dist/chunk-e3r9fxaa.js +0 -149
- package/dist/chunk-e3r9fxaa.js.map +0 -10
- package/dist/chunk-e8eecyrq.js +0 -244
- package/dist/chunk-e8eecyrq.js.map +0 -10
- package/dist/chunk-ex2hxe0v.js +0 -160
- package/dist/chunk-ex2hxe0v.js.map +0 -11
- package/dist/chunk-fak944et.js +0 -91
- package/dist/chunk-fak944et.js.map +0 -10
- package/dist/chunk-fygx2ymm.js +0 -118
- package/dist/chunk-fygx2ymm.js.map +0 -12
- package/dist/chunk-g15qj669.js +0 -271
- package/dist/chunk-g15qj669.js.map +0 -11
- package/dist/chunk-gd6wmknh.js +0 -121
- package/dist/chunk-gd6wmknh.js.map +0 -11
- package/dist/chunk-gf0ygptk.js +0 -85
- package/dist/chunk-gf0ygptk.js.map +0 -11
- package/dist/chunk-gytkmthr.js +0 -220
- package/dist/chunk-gytkmthr.js.map +0 -10
- package/dist/chunk-h5bbfn3n.js +0 -28
- package/dist/chunk-h5bbfn3n.js.map +0 -11
- package/dist/chunk-h6mye9r3.js +0 -93
- package/dist/chunk-h6mye9r3.js.map +0 -10
- package/dist/chunk-hcsmxw1v.js +0 -85
- package/dist/chunk-hcsmxw1v.js.map +0 -10
- package/dist/chunk-hyjs4bqs.js +0 -8
- package/dist/chunk-hyjs4bqs.js.map +0 -10
- package/dist/chunk-jn91vzkh.js +0 -66
- package/dist/chunk-jn91vzkh.js.map +0 -10
- package/dist/chunk-jpkjdgsk.js +0 -167
- package/dist/chunk-jpkjdgsk.js.map +0 -11
- package/dist/chunk-jwxt8gnp.js +0 -13
- package/dist/chunk-jwxt8gnp.js.map +0 -9
- package/dist/chunk-kk8w9rh5.js +0 -195
- package/dist/chunk-kk8w9rh5.js.map +0 -10
- package/dist/chunk-kwgh8rmg.js +0 -426
- package/dist/chunk-kwgh8rmg.js.map +0 -14
- package/dist/chunk-m97ze5hz.js +0 -46
- package/dist/chunk-m97ze5hz.js.map +0 -10
- package/dist/chunk-mbazhahf.js +0 -60
- package/dist/chunk-mbazhahf.js.map +0 -10
- package/dist/chunk-mgfwq18r.js +0 -15
- package/dist/chunk-mgfwq18r.js.map +0 -9
- package/dist/chunk-mtgf69xn.js +0 -88
- package/dist/chunk-mtgf69xn.js.map +0 -10
- package/dist/chunk-mtxzyxpg.js +0 -102
- package/dist/chunk-mtxzyxpg.js.map +0 -10
- package/dist/chunk-nehhtthw.js +0 -225
- package/dist/chunk-nehhtthw.js.map +0 -10
- package/dist/chunk-p5504p14.js +0 -16
- package/dist/chunk-p5504p14.js.map +0 -10
- package/dist/chunk-p5zgj77m.js +0 -184
- package/dist/chunk-p5zgj77m.js.map +0 -10
- package/dist/chunk-pnscgw95.js +0 -90
- package/dist/chunk-pnscgw95.js.map +0 -10
- package/dist/chunk-pvpp4pvs.js +0 -17
- package/dist/chunk-pvpp4pvs.js.map +0 -10
- package/dist/chunk-qh75agse.js +0 -95
- package/dist/chunk-qh75agse.js.map +0 -10
- package/dist/chunk-qxq2zcty.js +0 -52
- package/dist/chunk-qxq2zcty.js.map +0 -10
- package/dist/chunk-r6e8pytx.js +0 -22
- package/dist/chunk-r6e8pytx.js.map +0 -9
- package/dist/chunk-r7jmgqnw.js +0 -114
- package/dist/chunk-r7jmgqnw.js.map +0 -10
- package/dist/chunk-s6defjk2.js +0 -116
- package/dist/chunk-s6defjk2.js.map +0 -10
- package/dist/chunk-sd39p726.js +0 -619
- package/dist/chunk-sd39p726.js.map +0 -10
- package/dist/chunk-swrnzs4c.js +0 -63
- package/dist/chunk-swrnzs4c.js.map +0 -10
- package/dist/chunk-tfe3sb44.js +0 -33
- package/dist/chunk-tfe3sb44.js.map +0 -10
- package/dist/chunk-tjr0kcev.js +0 -41
- package/dist/chunk-tjr0kcev.js.map +0 -9
- package/dist/chunk-tx9edm1x.js +0 -34
- package/dist/chunk-tx9edm1x.js.map +0 -10
- package/dist/chunk-txhm2vb5.js +0 -18
- package/dist/chunk-txhm2vb5.js.map +0 -9
- package/dist/chunk-v5vmsxmy.js +0 -526
- package/dist/chunk-v5vmsxmy.js.map +0 -12
- package/dist/chunk-vjhxm8n2.js +0 -29
- package/dist/chunk-vjhxm8n2.js.map +0 -9
- package/dist/chunk-vkrpm7kc.js +0 -247
- package/dist/chunk-vkrpm7kc.js.map +0 -12
- package/dist/chunk-w3m4m5we.js +0 -4925
- package/dist/chunk-w3m4m5we.js.map +0 -12
- package/dist/chunk-wrxtn9ve.js +0 -18
- package/dist/chunk-wrxtn9ve.js.map +0 -10
- package/dist/chunk-x09cskqd.js +0 -377
- package/dist/chunk-x09cskqd.js.map +0 -10
- package/dist/chunk-xnt8c6h2.js +0 -576
- package/dist/chunk-xnt8c6h2.js.map +0 -10
- package/dist/chunk-xw0tx842.js +0 -13
- package/dist/chunk-xw0tx842.js.map +0 -9
- package/dist/chunk-xx5b6b9m.js +0 -69
- package/dist/chunk-xx5b6b9m.js.map +0 -10
- package/dist/chunk-xz1kdswj.js +0 -21
- package/dist/chunk-xz1kdswj.js.map +0 -9
- package/dist/chunk-y84qnsd3.js +0 -32
- package/dist/chunk-y84qnsd3.js.map +0 -10
- package/dist/chunk-ywjn0rad.js +0 -14
- package/dist/chunk-ywjn0rad.js.map +0 -9
- package/dist/chunk-z9nvhm6r.js +0 -13
- package/dist/chunk-z9nvhm6r.js.map +0 -9
- package/dist/chunk-zhmvdpk6.js +0 -15
- package/dist/chunk-zhmvdpk6.js.map +0 -9
- package/dist/chunk-zrg9d4zw.js +0 -784
- package/dist/chunk-zrg9d4zw.js.map +0 -10
|
@@ -1,13 +1,246 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
function __accessProp(key) {
|
|
8
|
+
return this[key];
|
|
9
|
+
}
|
|
10
|
+
var __toESMCache_node;
|
|
11
|
+
var __toESMCache_esm;
|
|
12
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
+
var canCache = mod != null && typeof mod === "object";
|
|
14
|
+
if (canCache) {
|
|
15
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
+
var cached = cache.get(mod);
|
|
17
|
+
if (cached)
|
|
18
|
+
return cached;
|
|
19
|
+
}
|
|
20
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
+
for (let key of __getOwnPropNames(mod))
|
|
23
|
+
if (!__hasOwnProp.call(to, key))
|
|
24
|
+
__defProp(to, key, {
|
|
25
|
+
get: __accessProp.bind(mod, key),
|
|
26
|
+
enumerable: true
|
|
27
|
+
});
|
|
28
|
+
if (canCache)
|
|
29
|
+
cache.set(mod, to);
|
|
30
|
+
return to;
|
|
31
|
+
};
|
|
32
|
+
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
33
|
+
var __returnValue = (v) => v;
|
|
34
|
+
function __exportSetter(name, newValue) {
|
|
35
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
36
|
+
}
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, {
|
|
40
|
+
get: all[name],
|
|
41
|
+
enumerable: true,
|
|
42
|
+
configurable: true,
|
|
43
|
+
set: __exportSetter.bind(all, name)
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
var __legacyDecorateClassTS = function(decorators, target, key, desc) {
|
|
47
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
48
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
49
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
50
|
+
else
|
|
51
|
+
for (var i = decorators.length - 1;i >= 0; i--)
|
|
52
|
+
if (d = decorators[i])
|
|
53
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
54
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
55
|
+
};
|
|
56
|
+
var __legacyMetadataTS = (k, v) => {
|
|
57
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
58
|
+
return Reflect.metadata(k, v);
|
|
59
|
+
};
|
|
60
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
61
|
+
var __require = import.meta.require;
|
|
62
|
+
|
|
63
|
+
// src/constants.ts
|
|
64
|
+
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", 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_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, 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, 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, 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, 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, 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;
|
|
65
|
+
var init_constants = __esm(() => {
|
|
66
|
+
IMAGE_DEFAULT_DEVICE_SIZES = [
|
|
67
|
+
640,
|
|
68
|
+
750,
|
|
69
|
+
828,
|
|
70
|
+
1080,
|
|
71
|
+
1200,
|
|
72
|
+
1920,
|
|
73
|
+
2048,
|
|
74
|
+
3840
|
|
75
|
+
];
|
|
76
|
+
IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
|
|
77
|
+
MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
|
|
78
|
+
MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
|
|
79
|
+
TWO_THIRDS = 2 / 3;
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// src/vue/components/Image.ts
|
|
83
|
+
import { computed, defineComponent, h, ref } from "vue";
|
|
84
|
+
|
|
85
|
+
// src/utils/imageClient.ts
|
|
86
|
+
init_constants();
|
|
87
|
+
var DEFAULT_DEVICE_SIZES = IMAGE_DEFAULT_DEVICE_SIZES;
|
|
88
|
+
var DEFAULT_IMAGE_SIZES = IMAGE_DEFAULT_IMAGE_SIZES;
|
|
89
|
+
var DEFAULT_QUALITY = IMAGE_DEFAULT_QUALITY;
|
|
90
|
+
var OPTIMIZATION_ENDPOINT = "/_absolute/image";
|
|
91
|
+
var buildOptimizedUrl = (src, width, quality, basePath = OPTIMIZATION_ENDPOINT) => `${basePath}?url=${encodeURIComponent(src)}&w=${width}&q=${quality}`;
|
|
92
|
+
var getAllSizes = (deviceSizes, imageSizes) => {
|
|
93
|
+
const device = deviceSizes ?? DEFAULT_DEVICE_SIZES;
|
|
94
|
+
const image = imageSizes ?? DEFAULT_IMAGE_SIZES;
|
|
95
|
+
return [...device, ...image].sort((left, right) => left - right);
|
|
96
|
+
};
|
|
97
|
+
var snapToSize = (target, sizes) => {
|
|
98
|
+
for (const size of sizes) {
|
|
99
|
+
if (size >= target)
|
|
100
|
+
return size;
|
|
101
|
+
}
|
|
102
|
+
return sizes[sizes.length - 1] ?? target;
|
|
103
|
+
};
|
|
104
|
+
var generateBlurSvg = (base64Thumbnail) => {
|
|
105
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 320"><filter id="b" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="20"/><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1"/></filter><image filter="url(#b)" x="0" y="0" width="100%" height="100%" href="${base64Thumbnail}"/></svg>`;
|
|
106
|
+
const encoded = encodeURIComponent(svg);
|
|
107
|
+
return `url("data:image/svg+xml,${encoded}")`;
|
|
108
|
+
};
|
|
109
|
+
var generateSrcSet = (src, width, sizes, deviceSizes, imageSizes) => {
|
|
110
|
+
const quality = DEFAULT_QUALITY;
|
|
111
|
+
if (sizes) {
|
|
112
|
+
const allSizes = getAllSizes(deviceSizes, imageSizes);
|
|
113
|
+
return allSizes.map((sizeWidth) => `${buildOptimizedUrl(src, sizeWidth, quality)} ${sizeWidth}w`).join(", ");
|
|
114
|
+
}
|
|
115
|
+
if (width) {
|
|
116
|
+
const allSizes = getAllSizes(deviceSizes, imageSizes);
|
|
117
|
+
const w1x = snapToSize(width, allSizes);
|
|
118
|
+
const w2x = snapToSize(width * 2, allSizes);
|
|
119
|
+
return `${buildOptimizedUrl(src, w1x, quality)} 1x, ${buildOptimizedUrl(src, w2x, quality)} 2x`;
|
|
120
|
+
}
|
|
121
|
+
const devSizes = deviceSizes ?? DEFAULT_DEVICE_SIZES;
|
|
122
|
+
return devSizes.map((sizeWidth) => `${buildOptimizedUrl(src, sizeWidth, quality)} ${sizeWidth}w`).join(", ");
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// src/vue/components/Image.ts
|
|
126
|
+
var fillWrapperStyle = {
|
|
127
|
+
display: "block",
|
|
128
|
+
height: "100%",
|
|
129
|
+
overflow: "hidden",
|
|
130
|
+
position: "relative",
|
|
131
|
+
width: "100%"
|
|
132
|
+
};
|
|
133
|
+
var Image = defineComponent({
|
|
134
|
+
name: "AbsoluteImage",
|
|
135
|
+
props: {
|
|
136
|
+
alt: { required: true, type: String },
|
|
137
|
+
blurDataURL: { default: undefined, type: String },
|
|
138
|
+
className: { default: undefined, type: String },
|
|
139
|
+
crossOrigin: { default: undefined, type: String },
|
|
140
|
+
fetchPriority: { default: undefined, type: String },
|
|
141
|
+
fill: { default: false, type: Boolean },
|
|
142
|
+
height: { default: undefined, type: Number },
|
|
143
|
+
loader: { default: undefined, type: Function },
|
|
144
|
+
loading: { default: "lazy", type: String },
|
|
145
|
+
onError: { default: undefined, type: Function },
|
|
146
|
+
onLoad: { default: undefined, type: Function },
|
|
147
|
+
overrideSrc: { default: undefined, type: String },
|
|
148
|
+
placeholder: { default: undefined, type: String },
|
|
149
|
+
priority: { default: false, type: Boolean },
|
|
150
|
+
quality: { default: DEFAULT_QUALITY, type: Number },
|
|
151
|
+
referrerPolicy: { default: undefined, type: String },
|
|
152
|
+
sizes: { default: undefined, type: String },
|
|
153
|
+
src: { required: true, type: String },
|
|
154
|
+
style: { default: undefined, type: Object },
|
|
155
|
+
unoptimized: { default: false, type: Boolean },
|
|
156
|
+
width: { default: undefined, type: Number }
|
|
157
|
+
},
|
|
158
|
+
setup(props) {
|
|
159
|
+
const blurRemoved = ref(false);
|
|
160
|
+
const resolvedSrc = computed(() => {
|
|
161
|
+
if (props.overrideSrc)
|
|
162
|
+
return props.overrideSrc;
|
|
163
|
+
if (props.unoptimized)
|
|
164
|
+
return props.src;
|
|
165
|
+
if (props.loader) {
|
|
166
|
+
return props.loader({
|
|
167
|
+
quality: props.quality ?? DEFAULT_QUALITY,
|
|
168
|
+
src: props.src,
|
|
169
|
+
width: props.width ?? 0
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
if (!props.width) {
|
|
173
|
+
return buildOptimizedUrl(props.src, 0, props.quality ?? DEFAULT_QUALITY);
|
|
174
|
+
}
|
|
175
|
+
return buildOptimizedUrl(props.src, props.width, props.quality ?? DEFAULT_QUALITY);
|
|
176
|
+
});
|
|
177
|
+
const srcSet = computed(() => props.unoptimized ? undefined : generateSrcSet(props.src, props.width, props.sizes));
|
|
178
|
+
const resolvedSizes = computed(() => props.sizes ?? (props.fill ? "100vw" : undefined));
|
|
179
|
+
const resolvedLoading = computed(() => props.priority ? "eager" : props.loading ?? "lazy");
|
|
180
|
+
const resolvedFetchPriority = computed(() => props.priority ? "high" : props.fetchPriority);
|
|
181
|
+
const hasBlur = computed(() => props.placeholder === "blur" || typeof props.placeholder === "string" && props.placeholder !== "empty" && props.placeholder.startsWith("data:"));
|
|
182
|
+
const blurBackground = computed(() => {
|
|
183
|
+
if (!hasBlur.value || blurRemoved.value)
|
|
184
|
+
return;
|
|
185
|
+
if (typeof props.placeholder === "string" && props.placeholder !== "blur" && props.placeholder.startsWith("data:")) {
|
|
186
|
+
return generateBlurSvg(props.placeholder);
|
|
187
|
+
}
|
|
188
|
+
if (props.blurDataURL)
|
|
189
|
+
return generateBlurSvg(props.blurDataURL);
|
|
190
|
+
return;
|
|
191
|
+
});
|
|
192
|
+
const imgStyle = computed(() => {
|
|
193
|
+
const base = {
|
|
194
|
+
...props.style ?? {},
|
|
195
|
+
color: "transparent"
|
|
196
|
+
};
|
|
197
|
+
if (blurBackground.value) {
|
|
198
|
+
base.backgroundImage = blurBackground.value;
|
|
199
|
+
base.backgroundPosition = "center";
|
|
200
|
+
base.backgroundRepeat = "no-repeat";
|
|
201
|
+
base.backgroundSize = "cover";
|
|
202
|
+
}
|
|
203
|
+
if (props.fill) {
|
|
204
|
+
base.height = "100%";
|
|
205
|
+
base.inset = "0";
|
|
206
|
+
base.objectFit = "cover";
|
|
207
|
+
base.position = "absolute";
|
|
208
|
+
base.width = "100%";
|
|
209
|
+
}
|
|
210
|
+
return base;
|
|
211
|
+
});
|
|
212
|
+
const handleLoad = (event) => {
|
|
213
|
+
blurRemoved.value = true;
|
|
214
|
+
props.onLoad?.(event);
|
|
215
|
+
};
|
|
216
|
+
const handleError = (event) => {
|
|
217
|
+
props.onError?.(event);
|
|
218
|
+
};
|
|
219
|
+
return () => {
|
|
220
|
+
const imgNode = h("img", {
|
|
221
|
+
alt: props.alt,
|
|
222
|
+
class: props.className,
|
|
223
|
+
crossorigin: props.crossOrigin,
|
|
224
|
+
decoding: "async",
|
|
225
|
+
fetchpriority: resolvedFetchPriority.value,
|
|
226
|
+
height: props.fill ? undefined : props.height,
|
|
227
|
+
loading: resolvedLoading.value,
|
|
228
|
+
onError: handleError,
|
|
229
|
+
onLoad: handleLoad,
|
|
230
|
+
referrerpolicy: props.referrerPolicy,
|
|
231
|
+
sizes: resolvedSizes.value,
|
|
232
|
+
src: resolvedSrc.value,
|
|
233
|
+
srcset: srcSet.value,
|
|
234
|
+
style: imgStyle.value,
|
|
235
|
+
width: props.fill ? undefined : props.width
|
|
236
|
+
});
|
|
237
|
+
return props.fill ? h("span", { style: fillWrapperStyle }, [imgNode]) : imgNode;
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
});
|
|
8
241
|
export {
|
|
9
242
|
Image
|
|
10
243
|
};
|
|
11
244
|
|
|
12
|
-
//# debugId=
|
|
245
|
+
//# debugId=60B5D2D95817FC3B64756E2164756E21
|
|
13
246
|
//# sourceMappingURL=Image.js.map
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
3
|
+
"sources": ["../src/constants.ts", "../src/vue/components/Image.ts", "../src/utils/imageClient.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"export const ANGULAR_INIT_TIMEOUT_MS = 500;\nexport const ANSI_ESCAPE_CODE = 27;\nexport const ANSI_ESCAPE_LENGTH = 3;\nexport const ASCII_SPACE = 32;\nexport const BASE_36_RADIX = 36;\nexport const BUN_BUILD_WARNING_SUPPRESSION =\n\t'wildcard sideEffects are not supported yet';\nexport const BODY_SLICE_LENGTH = 2000;\nexport const BYTES_PER_KILOBYTE = 1024;\nexport const CLI_ARGS_OFFSET = 3;\nexport const CSS_ERROR_RESOLVE_DELAY_MS = 50;\nexport const CSS_MAX_CHECK_ATTEMPTS = 10;\nexport const CSS_MAX_PARSE_TIMEOUT_MS = 500;\nexport const CSS_SHEET_READY_TIMEOUT_MS = 100;\nexport const DEFAULT_CHUNK_SIZE = 16_384;\nexport const DEFAULT_DEBOUNCE_MS = 15;\nexport const DEFAULT_PORT = 3000;\nexport const DEV_SERVER_RESTART_DEBOUNCE_MS = 100;\nexport const DOM_UPDATE_DELAY_MS = 50;\nexport const FILE_PROTOCOL_PREFIX_LENGTH = 7;\nexport const FOCUS_ID_PREFIX_LENGTH = 3;\nexport const FOCUS_IDX_PREFIX_LENGTH = 4;\nexport const FOCUS_NAME_PREFIX_LENGTH = 5;\nexport const HMR_UPDATE_TIMEOUT_MS = 2000;\nexport const HOOK_SIGNATURE_LENGTH = 12;\nexport const EXCLUDE_LAST_OFFSET = -1;\nexport const HTTP_STATUS_OK = 200;\nexport const HTTP_STATUS_BAD_REQUEST = 400;\nexport const HTTP_STATUS_NOT_FOUND = 404;\nexport const HOURS_IN_DAY = 24;\nexport const HOURS_IN_HALF_DAY = 12;\nexport const IMAGE_DEFAULT_DEVICE_SIZES = [\n\t640, 750, 828, 1080, 1200, 1920, 2048, 3840\n];\nexport const IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];\nexport const IMAGE_DEFAULT_QUALITY = 75;\nexport const IMAGE_GLOB_SUFFIX_LENGTH = 2;\nexport const MAX_ERROR_LENGTH = 200;\nexport const MAX_RECONNECT_ATTEMPTS = 60;\nexport const MILLISECONDS_IN_A_SECOND = 1000;\nexport const MINUTES_IN_AN_HOUR = 60;\nexport const SECONDS_IN_A_MINUTE = 60;\nexport const MILLISECONDS_IN_A_MINUTE =\n\tMILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;\nexport const MILLISECONDS_IN_A_DAY =\n\tMILLISECONDS_IN_A_SECOND *\n\tSECONDS_IN_A_MINUTE *\n\tMINUTES_IN_AN_HOUR *\n\tHOURS_IN_DAY;\nexport const OVERLAY_FADE_DURATION_MS = 150;\nexport const PING_INTERVAL_MS = 30_000;\nexport const RAF_BATCH_COUNT = 3;\nexport const RANDOM_ID_END_INDEX = 11;\nexport const REBUILD_BATCH_DELAY_MS = 10;\nexport const REBUILD_RELOAD_DELAY_MS = 200;\nexport const RECONNECT_INITIAL_DELAY_MS = 500;\nexport const RECONNECT_POLL_INTERVAL_MS = 300;\nexport const REACT_STREAM_SLOT_FAST_DELAY_MS = 5;\nexport const REACT_STREAM_SLOT_SLOW_DELAY_MS = 20;\nexport const SIGINT_EXIT_CODE = 130;\nexport const SIGTERM_EXIT_CODE = 143;\nexport const SVELTE_CSS_LOAD_TIMEOUT_MS = 500;\nexport const TIME_PRECISION = 2;\nexport const TWO_THIRDS = 2 / 3;\nexport const UNFOUND_INDEX = -1;\nexport const WEBSOCKET_NORMAL_CLOSURE = 1000;\nexport const WORKSPACE_COMMAND_ARGS_OFFSET = 3;\nexport const WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30;\nexport const WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60;\nexport const WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5_000;\nexport const WORKSPACE_READY_PROBE_INTERVAL_MS = 250;\nexport const WORKSPACE_READY_TIMEOUT_MS = 30_000;\nexport const WORKSPACE_SHUTDOWN_TIMEOUT_MS = 10_000;\nexport const WORKSPACE_TUI_DEFAULT_HEIGHT = 28;\nexport const WORKSPACE_TUI_DEFAULT_WIDTH = 100;\nexport const WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30;\nexport const WORKSPACE_TUI_FOOTER_LINE_COUNT = 3;\nexport const WORKSPACE_TUI_MIN_LOG_HEIGHT = 3;\nexport const WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7;\nexport const WORKSPACE_TUI_MIN_TARGET_WIDTH = 8;\nexport const WORKSPACE_TUI_MIN_WRAP_WIDTH = 12;\nexport const WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3;\nexport const WORKSPACE_TUI_RECENT_LOG_LIMIT = 40;\nexport const WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16;\nexport const WORKSPACE_TUI_STATUS_WIDTH = 10;\nexport const WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6;\nexport const WORKSPACE_TUI_VISIBILITY_WIDTH = 8;\n",
|
|
6
|
+
"import { computed, defineComponent, h, ref } from 'vue';\nimport {\n\tDEFAULT_QUALITY,\n\tbuildOptimizedUrl,\n\tgenerateBlurSvg,\n\tgenerateSrcSet\n} from '../../utils/imageClient';\n\ntype ImageLoader = (params: {\n\tsrc: string;\n\twidth: number;\n\tquality: number;\n}) => string;\n\ntype ImageStyle = Record<string, string | number>;\n\ntype ImageProps = {\n\tsrc: string;\n\talt: string;\n\twidth?: number;\n\theight?: number;\n\tfill?: boolean;\n\tquality?: number;\n\tsizes?: string;\n\tloader?: ImageLoader;\n\tunoptimized?: boolean;\n\tloading?: 'lazy' | 'eager';\n\tpriority?: boolean;\n\tplaceholder?: string;\n\tblurDataURL?: string;\n\tclassName?: string;\n\tstyle?: ImageStyle;\n\tonLoad?: (() => void) | ((event: Event) => void);\n\tonError?: (() => void) | ((event: Event) => void);\n\tcrossOrigin?: 'anonymous' | 'use-credentials' | '';\n\treferrerPolicy?:\n\t\t| ''\n\t\t| 'no-referrer'\n\t\t| 'no-referrer-when-downgrade'\n\t\t| 'origin'\n\t\t| 'origin-when-cross-origin'\n\t\t| 'same-origin'\n\t\t| 'strict-origin'\n\t\t| 'strict-origin-when-cross-origin'\n\t\t| 'unsafe-url';\n\tfetchPriority?: 'high' | 'low' | 'auto';\n\toverrideSrc?: string;\n};\n\nconst fillWrapperStyle: ImageStyle = {\n\tdisplay: 'block',\n\theight: '100%',\n\toverflow: 'hidden',\n\tposition: 'relative',\n\twidth: '100%'\n};\n\nexport const Image = defineComponent({\n\tname: 'AbsoluteImage',\n\tprops: {\n\t\talt: { required: true, type: String },\n\t\tblurDataURL: { default: undefined, type: String },\n\t\tclassName: { default: undefined, type: String },\n\t\tcrossOrigin: { default: undefined, type: String },\n\t\tfetchPriority: { default: undefined, type: String },\n\t\tfill: { default: false, type: Boolean },\n\t\theight: { default: undefined, type: Number },\n\t\tloader: { default: undefined, type: Function },\n\t\tloading: { default: 'lazy', type: String },\n\t\tonError: { default: undefined, type: Function },\n\t\tonLoad: { default: undefined, type: Function },\n\t\toverrideSrc: { default: undefined, type: String },\n\t\tplaceholder: { default: undefined, type: String },\n\t\tpriority: { default: false, type: Boolean },\n\t\tquality: { default: DEFAULT_QUALITY, type: Number },\n\t\treferrerPolicy: { default: undefined, type: String },\n\t\tsizes: { default: undefined, type: String },\n\t\tsrc: { required: true, type: String },\n\t\tstyle: { default: undefined, type: Object },\n\t\tunoptimized: { default: false, type: Boolean },\n\t\twidth: { default: undefined, type: Number }\n\t},\n\tsetup(props: ImageProps) {\n\t\tconst blurRemoved = ref(false);\n\n\t\tconst resolvedSrc = computed(() => {\n\t\t\tif (props.overrideSrc) return props.overrideSrc;\n\t\t\tif (props.unoptimized) return props.src;\n\t\t\tif (props.loader) {\n\t\t\t\treturn props.loader({\n\t\t\t\t\tquality: props.quality ?? DEFAULT_QUALITY,\n\t\t\t\t\tsrc: props.src,\n\t\t\t\t\twidth: props.width ?? 0\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (!props.width) {\n\t\t\t\treturn buildOptimizedUrl(\n\t\t\t\t\tprops.src,\n\t\t\t\t\t0,\n\t\t\t\t\tprops.quality ?? DEFAULT_QUALITY\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn buildOptimizedUrl(\n\t\t\t\tprops.src,\n\t\t\t\tprops.width,\n\t\t\t\tprops.quality ?? DEFAULT_QUALITY\n\t\t\t);\n\t\t});\n\n\t\tconst srcSet = computed(() =>\n\t\t\tprops.unoptimized\n\t\t\t\t? undefined\n\t\t\t\t: generateSrcSet(props.src, props.width, props.sizes)\n\t\t);\n\n\t\tconst resolvedSizes = computed(\n\t\t\t() => props.sizes ?? (props.fill ? '100vw' : undefined)\n\t\t);\n\n\t\tconst resolvedLoading = computed(() =>\n\t\t\tprops.priority ? 'eager' : (props.loading ?? 'lazy')\n\t\t);\n\n\t\tconst resolvedFetchPriority = computed(() =>\n\t\t\tprops.priority ? 'high' : props.fetchPriority\n\t\t);\n\n\t\tconst hasBlur = computed(\n\t\t\t() =>\n\t\t\t\tprops.placeholder === 'blur' ||\n\t\t\t\t(typeof props.placeholder === 'string' &&\n\t\t\t\t\tprops.placeholder !== 'empty' &&\n\t\t\t\t\tprops.placeholder.startsWith('data:'))\n\t\t);\n\n\t\tconst blurBackground = computed(() => {\n\t\t\tif (!hasBlur.value || blurRemoved.value) return undefined;\n\t\t\tif (\n\t\t\t\ttypeof props.placeholder === 'string' &&\n\t\t\t\tprops.placeholder !== 'blur' &&\n\t\t\t\tprops.placeholder.startsWith('data:')\n\t\t\t) {\n\t\t\t\treturn generateBlurSvg(props.placeholder);\n\t\t\t}\n\t\t\tif (props.blurDataURL) return generateBlurSvg(props.blurDataURL);\n\n\t\t\treturn undefined;\n\t\t});\n\n\t\tconst imgStyle = computed(() => {\n\t\t\tconst base: ImageStyle = {\n\t\t\t\t...(props.style ?? {}),\n\t\t\t\tcolor: 'transparent'\n\t\t\t};\n\t\t\tif (blurBackground.value) {\n\t\t\t\tbase.backgroundImage = blurBackground.value;\n\t\t\t\tbase.backgroundPosition = 'center';\n\t\t\t\tbase.backgroundRepeat = 'no-repeat';\n\t\t\t\tbase.backgroundSize = 'cover';\n\t\t\t}\n\t\t\tif (props.fill) {\n\t\t\t\tbase.height = '100%';\n\t\t\t\tbase.inset = '0';\n\t\t\t\tbase.objectFit = 'cover';\n\t\t\t\tbase.position = 'absolute';\n\t\t\t\tbase.width = '100%';\n\t\t\t}\n\n\t\t\treturn base;\n\t\t});\n\n\t\tconst handleLoad = (event: Event) => {\n\t\t\tblurRemoved.value = true;\n\t\t\tprops.onLoad?.(event);\n\t\t};\n\n\t\tconst handleError = (event: Event) => {\n\t\t\tprops.onError?.(event);\n\t\t};\n\n\t\treturn () => {\n\t\t\tconst imgNode = h('img', {\n\t\t\t\talt: props.alt,\n\t\t\t\tclass: props.className,\n\t\t\t\tcrossorigin: props.crossOrigin,\n\t\t\t\tdecoding: 'async',\n\t\t\t\tfetchpriority: resolvedFetchPriority.value,\n\t\t\t\theight: props.fill ? undefined : props.height,\n\t\t\t\tloading: resolvedLoading.value,\n\t\t\t\tonError: handleError,\n\t\t\t\tonLoad: handleLoad,\n\t\t\t\treferrerpolicy: props.referrerPolicy,\n\t\t\t\tsizes: resolvedSizes.value,\n\t\t\t\tsrc: resolvedSrc.value,\n\t\t\t\tsrcset: srcSet.value,\n\t\t\t\tstyle: imgStyle.value,\n\t\t\t\twidth: props.fill ? undefined : props.width\n\t\t\t});\n\n\t\t\treturn props.fill\n\t\t\t\t? h('span', { style: fillWrapperStyle }, [imgNode])\n\t\t\t\t: imgNode;\n\t\t};\n\t}\n});\n",
|
|
7
|
+
"/**\n * Client-safe image utilities — no node:fs, no Sharp, no Bun APIs.\n * These can be imported in both server and client (browser) contexts.\n */\n\nimport {\n\tIMAGE_DEFAULT_DEVICE_SIZES,\n\tIMAGE_DEFAULT_IMAGE_SIZES,\n\tIMAGE_DEFAULT_QUALITY\n} from '../constants';\n\nexport type { ImageProps } from '../../types/image';\n\nexport const DEFAULT_DEVICE_SIZES = IMAGE_DEFAULT_DEVICE_SIZES;\nexport const DEFAULT_IMAGE_SIZES = IMAGE_DEFAULT_IMAGE_SIZES;\nexport const DEFAULT_QUALITY = IMAGE_DEFAULT_QUALITY;\n\nexport const OPTIMIZATION_ENDPOINT = '/_absolute/image';\n\nexport const buildOptimizedUrl = (\n\tsrc: string,\n\twidth: number,\n\tquality: number,\n\tbasePath = OPTIMIZATION_ENDPOINT\n) => `${basePath}?url=${encodeURIComponent(src)}&w=${width}&q=${quality}`;\n\nexport const getAllSizes = (deviceSizes?: number[], imageSizes?: number[]) => {\n\tconst device = deviceSizes ?? DEFAULT_DEVICE_SIZES;\n\n\tconst image = imageSizes ?? DEFAULT_IMAGE_SIZES;\n\n\treturn [...device, ...image].sort((left, right) => left - right);\n};\n\n/** Snap a target width UP to the nearest configured size */\nconst snapToSize = (target: number, sizes: number[]) => {\n\tfor (const size of sizes) {\n\t\tif (size >= target) return size;\n\t}\n\n\treturn sizes[sizes.length - 1] ?? target;\n};\n\nexport const generateBlurSvg = (base64Thumbnail: string) => {\n\tconst svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 320\"><filter id=\"b\" color-interpolation-filters=\"sRGB\"><feGaussianBlur stdDeviation=\"20\"/><feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1\"/></filter><image filter=\"url(#b)\" x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" href=\"${base64Thumbnail}\"/></svg>`;\n\n\tconst encoded = encodeURIComponent(svg);\n\n\treturn `url(\"data:image/svg+xml,${encoded}\")`;\n};\nexport const generateSrcSet = (\n\tsrc: string,\n\twidth: number | undefined,\n\tsizes: string | undefined,\n\tdeviceSizes?: number[],\n\timageSizes?: number[]\n) => {\n\tconst quality = DEFAULT_QUALITY;\n\n\tif (sizes) {\n\t\tconst allSizes = getAllSizes(deviceSizes, imageSizes);\n\n\t\treturn allSizes\n\t\t\t.map(\n\t\t\t\t(sizeWidth) =>\n\t\t\t\t\t`${buildOptimizedUrl(src, sizeWidth, quality)} ${sizeWidth}w`\n\t\t\t)\n\t\t\t.join(', ');\n\t}\n\n\tif (width) {\n\t\tconst allSizes = getAllSizes(deviceSizes, imageSizes);\n\n\t\tconst w1x = snapToSize(width, allSizes);\n\n\t\tconst w2x = snapToSize(width * 2, allSizes);\n\n\t\treturn `${buildOptimizedUrl(src, w1x, quality)} 1x, ${buildOptimizedUrl(src, w2x, quality)} 2x`;\n\t}\n\n\tconst devSizes = deviceSizes ?? DEFAULT_DEVICE_SIZES;\n\n\treturn devSizes\n\t\t.map(\n\t\t\t(sizeWidth) =>\n\t\t\t\t`${buildOptimizedUrl(src, sizeWidth, quality)} ${sizeWidth}w`\n\t\t)\n\t\t.join(', ');\n};\n"
|
|
5
8
|
],
|
|
6
|
-
"mappings": "",
|
|
7
|
-
"debugId": "
|
|
9
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAa,0BAA0B,KAC1B,mBAAmB,IACnB,qBAAqB,GACrB,cAAc,IACd,gBAAgB,IAChB,gCACZ,8CACY,oBAAoB,MACpB,qBAAqB,MACrB,kBAAkB,GAClB,6BAA6B,IAC7B,yBAAyB,IACzB,2BAA2B,KAC3B,6BAA6B,KAC7B,qBAAqB,OACrB,sBAAsB,IACtB,eAAe,MACf,iCAAiC,KACjC,sBAAsB,IACtB,8BAA8B,GAC9B,yBAAyB,GACzB,0BAA0B,GAC1B,2BAA2B,GAC3B,wBAAwB,MACxB,wBAAwB,IACxB,sBAAsB,IACtB,iBAAiB,KACjB,0BAA0B,KAC1B,wBAAwB,KACxB,eAAe,IACf,oBAAoB,IACpB,4BAGA,2BACA,wBAAwB,IACxB,2BAA2B,GAC3B,mBAAmB,KACnB,yBAAyB,IACzB,2BAA2B,MAC3B,qBAAqB,IACrB,sBAAsB,IACtB,0BAEA,uBAKA,2BAA2B,KAC3B,mBAAmB,OACnB,kBAAkB,GAClB,sBAAsB,IACtB,yBAAyB,IACzB,0BAA0B,KAC1B,6BAA6B,KAC7B,6BAA6B,KAC7B,kCAAkC,GAClC,kCAAkC,IAClC,mBAAmB,KACnB,oBAAoB,KACpB,6BAA6B,KAC7B,iBAAiB,GACjB,YACA,gBAAgB,IAChB,2BAA2B,MAC3B,gCAAgC,GAChC,oCAAoC,IACpC,qCAAqC,IACrC,qCAAqC,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