@useupup/core 3.3.0

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.
Files changed (118) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +8 -0
  3. package/README.md +75 -0
  4. package/dist/browser-SXR426OQ.cjs +10 -0
  5. package/dist/browser-WD6T5ABJ.js +1 -0
  6. package/dist/chunk-2H5ICKFT.cjs +122 -0
  7. package/dist/chunk-6HF3I2JS.cjs +39 -0
  8. package/dist/chunk-6S5DQDQH.js +212 -0
  9. package/dist/chunk-BMQC27OE.cjs +92 -0
  10. package/dist/chunk-BSGQGINR.cjs +219 -0
  11. package/dist/chunk-CPKZ2CXD.cjs +179 -0
  12. package/dist/chunk-DTKDIMKT.cjs +573 -0
  13. package/dist/chunk-DYE5XJ6Z.cjs +2134 -0
  14. package/dist/chunk-E3ZCNOXG.cjs +74 -0
  15. package/dist/chunk-FEQY2WYY.cjs +2377 -0
  16. package/dist/chunk-FMURBCZ7.js +120 -0
  17. package/dist/chunk-FYQQRULL.js +37 -0
  18. package/dist/chunk-GE4LIVXP.js +133 -0
  19. package/dist/chunk-HFR5HZJZ.js +56 -0
  20. package/dist/chunk-I7ULPCA2.js +72 -0
  21. package/dist/chunk-MHYXDLZR.js +569 -0
  22. package/dist/chunk-N2SLHVAW.cjs +61 -0
  23. package/dist/chunk-OOPDEOTM.js +169 -0
  24. package/dist/chunk-PMBR3OUW.js +2359 -0
  25. package/dist/chunk-QK7HZIVY.cjs +144 -0
  26. package/dist/chunk-T2AQHY7V.cjs +59 -0
  27. package/dist/chunk-TRCP5FUR.js +90 -0
  28. package/dist/chunk-U7KL5M2H.cjs +374 -0
  29. package/dist/chunk-UXNPM54W.js +2108 -0
  30. package/dist/chunk-VV6QCQLL.js +365 -0
  31. package/dist/chunk-ZMS2HXLB.js +56 -0
  32. package/dist/context-shapes-123dd3b6.d.cts +207 -0
  33. package/dist/context-shapes-27b24c8f.d.ts +207 -0
  34. package/dist/contracts-pipeline-cf177270.d.cts +78 -0
  35. package/dist/contracts-pipeline-cf177270.d.ts +78 -0
  36. package/dist/contracts-strategies-378a16b7.d.cts +168 -0
  37. package/dist/contracts-strategies-378a16b7.d.ts +168 -0
  38. package/dist/contracts.cjs +181 -0
  39. package/dist/contracts.d.cts +11 -0
  40. package/dist/contracts.d.ts +11 -0
  41. package/dist/contracts.js +4 -0
  42. package/dist/core-141335ac.d.ts +651 -0
  43. package/dist/core-bea2ceca.d.cts +651 -0
  44. package/dist/create-worker-provider-AA5SRII6.js +58 -0
  45. package/dist/create-worker-provider-KJNUSSTW.cjs +60 -0
  46. package/dist/eligibility-ONLNJ6FB.cjs +10 -0
  47. package/dist/eligibility-ULFC3E4G.js +8 -0
  48. package/dist/error-code-map-9c44a425.d.ts +62 -0
  49. package/dist/error-code-map-dd5becfa.d.cts +62 -0
  50. package/dist/i18n/index.cjs +90 -0
  51. package/dist/i18n/index.d.cts +3 -0
  52. package/dist/i18n/index.d.ts +3 -0
  53. package/dist/i18n/index.js +1 -0
  54. package/dist/index.cjs +1770 -0
  55. package/dist/index.d.cts +280 -0
  56. package/dist/index.d.ts +280 -0
  57. package/dist/index.js +1589 -0
  58. package/dist/internal.cjs +2407 -0
  59. package/dist/internal.d.cts +595 -0
  60. package/dist/internal.d.ts +595 -0
  61. package/dist/internal.js +2275 -0
  62. package/dist/pipeline/index.cjs +10 -0
  63. package/dist/pipeline/index.d.cts +11 -0
  64. package/dist/pipeline/index.d.ts +11 -0
  65. package/dist/pipeline/index.js +1 -0
  66. package/dist/pipeline-worker.cjs +199 -0
  67. package/dist/pipeline-worker.d.cts +2 -0
  68. package/dist/pipeline-worker.d.ts +2 -0
  69. package/dist/pipeline-worker.js +197 -0
  70. package/dist/resolve-locale-81feef21.d.ts +20 -0
  71. package/dist/resolve-locale-9cb63600.d.cts +20 -0
  72. package/dist/resolve-theme-01758105.d.ts +53 -0
  73. package/dist/resolve-theme-66cf8d98.d.cts +53 -0
  74. package/dist/server-mode-drive-controller-b5f8ee12.d.cts +180 -0
  75. package/dist/server-mode-drive-controller-b5f8ee12.d.ts +180 -0
  76. package/dist/steps/compress.cjs +66 -0
  77. package/dist/steps/compress.d.cts +10 -0
  78. package/dist/steps/compress.d.ts +10 -0
  79. package/dist/steps/compress.js +64 -0
  80. package/dist/steps/exif.cjs +44 -0
  81. package/dist/steps/exif.d.cts +5 -0
  82. package/dist/steps/exif.d.ts +5 -0
  83. package/dist/steps/exif.js +42 -0
  84. package/dist/steps/hash.cjs +44 -0
  85. package/dist/steps/hash.d.cts +5 -0
  86. package/dist/steps/hash.d.ts +5 -0
  87. package/dist/steps/hash.js +42 -0
  88. package/dist/steps/heic.cjs +59 -0
  89. package/dist/steps/heic.d.cts +5 -0
  90. package/dist/steps/heic.d.ts +5 -0
  91. package/dist/steps/heic.js +57 -0
  92. package/dist/steps/thumbnail.cjs +54 -0
  93. package/dist/steps/thumbnail.d.cts +10 -0
  94. package/dist/steps/thumbnail.d.ts +10 -0
  95. package/dist/steps/thumbnail.js +52 -0
  96. package/dist/strategies/index.cjs +82 -0
  97. package/dist/strategies/index.d.cts +187 -0
  98. package/dist/strategies/index.d.ts +187 -0
  99. package/dist/strategies/index.js +60 -0
  100. package/dist/strategies/tus-upload.cjs +14 -0
  101. package/dist/strategies/tus-upload.d.cts +15 -0
  102. package/dist/strategies/tus-upload.d.ts +15 -0
  103. package/dist/strategies/tus-upload.js +5 -0
  104. package/dist/theme/index.cjs +38 -0
  105. package/dist/theme/index.d.cts +3 -0
  106. package/dist/theme/index.d.ts +3 -0
  107. package/dist/theme/index.js +1 -0
  108. package/dist/theme-store-2e56a674.d.cts +39 -0
  109. package/dist/theme-store-f13e0315.d.ts +39 -0
  110. package/dist/token-endpoint-5fdb4a35.d.ts +20 -0
  111. package/dist/token-endpoint-a7d15ab6.d.cts +20 -0
  112. package/dist/ui-translations-c5d00392.d.cts +455 -0
  113. package/dist/ui-translations-c5d00392.d.ts +455 -0
  114. package/dist/uploader-props-72242002.d.ts +340 -0
  115. package/dist/uploader-props-7f956e60.d.cts +340 -0
  116. package/dist/vars-d3421f6c.d.cts +240 -0
  117. package/dist/vars-d3421f6c.d.ts +240 -0
  118. package/package.json +182 -0
@@ -0,0 +1,187 @@
1
+ import { k as CredentialStrategy, F as FileMetadata, P as PresignedUrlResponse, a as MultipartInitResponse, b as MultipartSignPartResponse, f as MultipartCompleteResponse, e as MultipartResumeResponse, l as UploadStrategy, U as UploadCredentials, h as UploadResult, j as CloudProvider } from '../contracts-strategies-378a16b7.js';
2
+ export { i as ProgressInfo, m as RuntimeAdapter } from '../contracts-strategies-378a16b7.js';
3
+ export { D as DirectUpload, T as TokenEndpointCredentials } from '../token-endpoint-5fdb4a35.js';
4
+ export { TusUpload } from './tus-upload.js';
5
+
6
+ interface ServerCredentialsOptions {
7
+ serverUrl: string;
8
+ headers?: Record<string, string>;
9
+ }
10
+ declare class ServerCredentials implements CredentialStrategy {
11
+ private serverUrl;
12
+ private headers;
13
+ constructor(options: ServerCredentialsOptions);
14
+ private post;
15
+ getPresignedUrl(file: FileMetadata): Promise<PresignedUrlResponse>;
16
+ initMultipartUpload(file: FileMetadata): Promise<MultipartInitResponse>;
17
+ signPart(params: {
18
+ token: string;
19
+ partNumber: number;
20
+ }): Promise<MultipartSignPartResponse>;
21
+ completeMultipartUpload(params: {
22
+ token: string;
23
+ parts: {
24
+ partNumber: number;
25
+ eTag: string;
26
+ }[];
27
+ }): Promise<MultipartCompleteResponse>;
28
+ abortMultipartUpload(params: {
29
+ token: string;
30
+ }): Promise<void>;
31
+ /** Re-attach to an upload the client left in flight (page reload, pause,
32
+ * retry) or whose token aged past its 1h TTL. The presented token is the
33
+ * ONLY input — key/uploadId are never sent by the client — and the
34
+ * response carries a freshly-signed replacement plus the parts storage
35
+ * already holds, each with its byte size. */
36
+ resumeMultipartUpload(params: {
37
+ token: string;
38
+ }): Promise<MultipartResumeResponse>;
39
+ }
40
+
41
+ interface MultipartUploadOptions {
42
+ credentials: CredentialStrategy;
43
+ chunkSizeBytes?: number | undefined;
44
+ /**
45
+ * Parts of this one file in flight at once. Throughput on a fast link
46
+ * against memory and socket pressure — every in-flight part holds its own
47
+ * chunk. Clamped to a whole number ≥ 1 — the cap is a count of live
48
+ * requests, and a run with none in flight can never finish.
49
+ */
50
+ maxConcurrentParts?: number | undefined;
51
+ /**
52
+ * Persist a resumable session (localStorage) for `File` inputs, so a page
53
+ * reload, a pause, or a retry re-attaches to the server-side upload rather
54
+ * than restarting it from part 1.
55
+ *
56
+ * Defaults to FALSE here on purpose: `resolveUploadConfig` is the single
57
+ * place that opts the product default in (`resumable.persist ?? true`), so
58
+ * a hand-constructed strategy keeps the historical abort-on-failure
59
+ * semantics until it explicitly asks for persistence.
60
+ */
61
+ persist?: boolean | undefined;
62
+ /**
63
+ * The serverUrl sessions belong to. A session saved against server A must
64
+ * never be resumed against server B — its token means nothing there.
65
+ */
66
+ sessionScope?: string | undefined;
67
+ /**
68
+ * Delays (ms) before each successive retry of a part whose attempt failed
69
+ * transiently — a network-level fetch rejection, a 429, a 5xx, or a stall
70
+ * caught by `partTimeoutMs`. Same vocabulary as the tus strategy's
71
+ * `retryDelays`: the array length is the retry budget, `[]` disables part
72
+ * retries. Definitive 4xx rejections are never retried.
73
+ */
74
+ retryDelays?: number[] | undefined;
75
+ /**
76
+ * Watchdog budget applied to each PHASE of a part attempt separately: the
77
+ * sign call, the source read (parts small enough to be materialized —
78
+ * see MATERIALIZE_PART_MAX_BYTES), and the PUT, where it is an INACTIVITY
79
+ * window reset by upload progress. A phase that neither succeeds nor
80
+ * fails within its window is aborted and counted as a transient failure,
81
+ * so a hung connection or a hung blob read costs one `retryDelays` slot
82
+ * instead of hanging the whole upload forever (worst case per attempt is
83
+ * therefore up to 3 × this value, not 1 ×). A slow-but-progressing PUT is
84
+ * never aborted — only one with no forward motion at all.
85
+ */
86
+ partTimeoutMs?: number | undefined;
87
+ }
88
+ declare class MultipartUpload implements UploadStrategy {
89
+ private credentials;
90
+ private initMultipartUpload;
91
+ private signPart;
92
+ private completeMultipartUpload;
93
+ private resumeMultipartUpload;
94
+ private chunkSizeBytes;
95
+ private maxConcurrentParts;
96
+ private persist;
97
+ private sessionScope;
98
+ private retryDelays;
99
+ private partTimeoutMs;
100
+ constructor(options: MultipartUploadOptions);
101
+ /**
102
+ * Each stored part must be byte-for-byte where this file's own chunking
103
+ * would put it: exactly `partSize`, except the file's TRUE final part
104
+ * (`partNumber === totalParts`), which must be exactly the remaining tail.
105
+ *
106
+ * The "highest part number we happen to hold" is NOT the exemption — the
107
+ * server may hold a sparse prefix (say parts 1, 2, 5 of 10), and letting
108
+ * part 5 be short would splice a short block into the MIDDLE of the object.
109
+ * S3 only enforces the ≥5 MiB floor on non-final parts, so it would accept
110
+ * the complete call and hand back a silently corrupt object. A part with no
111
+ * reported `size` is unverifiable and therefore equally unusable.
112
+ */
113
+ private partsMatchSession;
114
+ /**
115
+ * Try to re-attach to the upload a previous session left in flight.
116
+ * Returns `null` for every "just start fresh" outcome — a resume failure
117
+ * must never fail an upload that a fresh init could still serve.
118
+ */
119
+ private tryResume;
120
+ /**
121
+ * Failure teardown. THE behavior change of cross-reload resume: with
122
+ * `persist` on, an error or abort deliberately leaves the server-side
123
+ * upload alive so the next attempt can resume into it — pause(), a dropped
124
+ * connection, and UploadManager's own retries all re-enter `upload()` and
125
+ * pick the session back up. Without persist this is exactly the historical
126
+ * best-effort abort. Either way, a 4xx from init/complete kills the
127
+ * session: the server has already torn the upload down.
128
+ */
129
+ private handleUploadFailure;
130
+ /**
131
+ * PUT one signed part over XMLHttpRequest, under an INACTIVITY watchdog.
132
+ *
133
+ * The watchdog resets on every `upload` progress event and fires only after
134
+ * `partTimeoutMs` with no forward motion at all. That distinction is the
135
+ * point: `fetch()` for a PUT resolves only once the whole body is sent, so a
136
+ * flat ceiling on total time aborts a large part on a slow-but-healthy link
137
+ * (a 5 MiB part under ~233 kbit/s crosses the 180s default) even though it
138
+ * is uploading fine. An inactivity timer kills the connection the watchdog
139
+ * was built for — one that has genuinely stopped moving bytes — without
140
+ * penalizing the slow one. Mirrors the XHR PUT in direct-upload.ts.
141
+ *
142
+ * Resolves with the part's ETag. Rejects with: the retryable stall on
143
+ * inactivity (`partStallError`) — covering both the slice READ and the PUT;
144
+ * a retryable `UPLOAD_FAILED` when the slice read itself rejects;
145
+ * `UpupNetworkError('Upload aborted')` when
146
+ * the caller's signal aborts; a retryable `TypeError` on a network-level
147
+ * failure (the shape `fetch` produced, which `isRetryablePartFailure`
148
+ * already classifies); or an `uploadErrorFromResponse` on a non-2xx — its
149
+ * body read synchronously from `xhr.responseText`, so the whole request
150
+ * including the error body stays inside the one abort/inactivity window (the
151
+ * old `await response.text()` ran AFTER the watchdog was cleared and could
152
+ * hang a half-dead connection forever on the body read).
153
+ */
154
+ private putPart;
155
+ upload(file: File | Blob, _credentials: UploadCredentials, options: {
156
+ onProgress: (loaded: number, total: number) => void;
157
+ signal: AbortSignal;
158
+ }): Promise<UploadResult>;
159
+ }
160
+
161
+ interface ServerTransferOptions {
162
+ serverUrl: string;
163
+ headers?: Record<string, string>;
164
+ }
165
+ interface TransferResult {
166
+ provider: string;
167
+ fileId: string;
168
+ status: string;
169
+ key?: string;
170
+ url?: string;
171
+ }
172
+ /**
173
+ * Strategy that POSTs to the server's /files/:provider/transfer endpoint
174
+ * to transfer a file from a cloud drive directly to S3 on the server side.
175
+ */
176
+ declare class ServerTransfer {
177
+ private serverUrl;
178
+ private headers;
179
+ constructor(options: ServerTransferOptions);
180
+ private providerSlug;
181
+ transfer(provider: CloudProvider, fileId: string, options?: {
182
+ token?: string;
183
+ fileName?: string;
184
+ }): Promise<TransferResult>;
185
+ }
186
+
187
+ export { CloudProvider, CredentialStrategy, FileMetadata, MultipartUpload, ServerCredentials, ServerTransfer, UploadCredentials, UploadResult, UploadStrategy };
@@ -0,0 +1,60 @@
1
+ export { MultipartUpload, ServerCredentials } from '../chunk-MHYXDLZR.js';
2
+ export { DirectUpload, TokenEndpointCredentials } from '../chunk-OOPDEOTM.js';
3
+ export { TusUpload } from '../chunk-TRCP5FUR.js';
4
+ import '../chunk-ZMS2HXLB.js';
5
+ import { uploadErrorFromResponse } from '../chunk-GE4LIVXP.js';
6
+ import '../chunk-UXNPM54W.js';
7
+ import '../chunk-VV6QCQLL.js';
8
+
9
+ // src/strategies/server-transfer.ts
10
+ var ServerTransfer = class {
11
+ constructor(options) {
12
+ this.serverUrl = options.serverUrl.replace(/\/$/, "");
13
+ this.headers = {
14
+ "Content-Type": "application/json",
15
+ ...options.headers
16
+ };
17
+ }
18
+ providerSlug(provider) {
19
+ switch (provider) {
20
+ case "googleDrive":
21
+ return "google-drive";
22
+ case "oneDrive":
23
+ return "one-drive";
24
+ case "dropbox":
25
+ return "dropbox";
26
+ case "box":
27
+ return "box";
28
+ default:
29
+ return provider;
30
+ }
31
+ }
32
+ async transfer(provider, fileId, options) {
33
+ const slug = this.providerSlug(provider);
34
+ const response = await fetch(
35
+ `${this.serverUrl}/files/${slug}/transfer`,
36
+ {
37
+ method: "POST",
38
+ headers: this.headers,
39
+ body: JSON.stringify({
40
+ fileId,
41
+ fileName: options?.fileName,
42
+ token: options?.token
43
+ })
44
+ }
45
+ );
46
+ if (!response.ok) {
47
+ const body = await response.text().catch(() => "");
48
+ const err = uploadErrorFromResponse({
49
+ status: response.status,
50
+ statusText: response.statusText,
51
+ body,
52
+ kind: "network"
53
+ });
54
+ throw err;
55
+ }
56
+ return response.json();
57
+ }
58
+ };
59
+
60
+ export { ServerTransfer };
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var chunkBMQC27OE_cjs = require('../chunk-BMQC27OE.cjs');
4
+ require('../chunk-N2SLHVAW.cjs');
5
+ require('../chunk-QK7HZIVY.cjs');
6
+ require('../chunk-DYE5XJ6Z.cjs');
7
+ require('../chunk-U7KL5M2H.cjs');
8
+
9
+
10
+
11
+ Object.defineProperty(exports, 'TusUpload', {
12
+ enumerable: true,
13
+ get: function () { return chunkBMQC27OE_cjs.TusUpload; }
14
+ });
@@ -0,0 +1,15 @@
1
+ import { l as UploadStrategy, U as UploadCredentials, h as UploadResult, R as ResumableUploadOptions } from '../contracts-strategies-378a16b7.cjs';
2
+
3
+ type TusOptions = Extract<ResumableUploadOptions, {
4
+ protocol: 'tus';
5
+ }>;
6
+ declare class TusUpload implements UploadStrategy {
7
+ private options;
8
+ constructor(options: TusOptions);
9
+ upload(file: File | Blob, _credentials: UploadCredentials, options: {
10
+ onProgress: (loaded: number, total: number) => void;
11
+ signal: AbortSignal;
12
+ }): Promise<UploadResult>;
13
+ }
14
+
15
+ export { TusUpload };
@@ -0,0 +1,15 @@
1
+ import { l as UploadStrategy, U as UploadCredentials, h as UploadResult, R as ResumableUploadOptions } from '../contracts-strategies-378a16b7.js';
2
+
3
+ type TusOptions = Extract<ResumableUploadOptions, {
4
+ protocol: 'tus';
5
+ }>;
6
+ declare class TusUpload implements UploadStrategy {
7
+ private options;
8
+ constructor(options: TusOptions);
9
+ upload(file: File | Blob, _credentials: UploadCredentials, options: {
10
+ onProgress: (loaded: number, total: number) => void;
11
+ signal: AbortSignal;
12
+ }): Promise<UploadResult>;
13
+ }
14
+
15
+ export { TusUpload };
@@ -0,0 +1,5 @@
1
+ export { TusUpload } from '../chunk-TRCP5FUR.js';
2
+ import '../chunk-ZMS2HXLB.js';
3
+ import '../chunk-GE4LIVXP.js';
4
+ import '../chunk-UXNPM54W.js';
5
+ import '../chunk-VV6QCQLL.js';
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ var chunkU7KL5M2H_cjs = require('../chunk-U7KL5M2H.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, 'ThemeStore', {
8
+ enumerable: true,
9
+ get: function () { return chunkU7KL5M2H_cjs.ThemeStore; }
10
+ });
11
+ Object.defineProperty(exports, 'UPUP_VAR_PREFIX', {
12
+ enumerable: true,
13
+ get: function () { return chunkU7KL5M2H_cjs.UPUP_VAR_PREFIX; }
14
+ });
15
+ Object.defineProperty(exports, 'darkPreset', {
16
+ enumerable: true,
17
+ get: function () { return chunkU7KL5M2H_cjs.darkPreset; }
18
+ });
19
+ Object.defineProperty(exports, 'flattenSlotsToClassNames', {
20
+ enumerable: true,
21
+ get: function () { return chunkU7KL5M2H_cjs.flattenSlotsToClassNames; }
22
+ });
23
+ Object.defineProperty(exports, 'lightPreset', {
24
+ enumerable: true,
25
+ get: function () { return chunkU7KL5M2H_cjs.lightPreset; }
26
+ });
27
+ Object.defineProperty(exports, 'resolveTheme', {
28
+ enumerable: true,
29
+ get: function () { return chunkU7KL5M2H_cjs.resolveTheme; }
30
+ });
31
+ Object.defineProperty(exports, 'tokensToVarRefs', {
32
+ enumerable: true,
33
+ get: function () { return chunkU7KL5M2H_cjs.tokensToVarRefs; }
34
+ });
35
+ Object.defineProperty(exports, 'tokensToVars', {
36
+ enumerable: true,
37
+ get: function () { return chunkU7KL5M2H_cjs.tokensToVars; }
38
+ });
@@ -0,0 +1,3 @@
1
+ export { D as DeepPartial, l as DeepPartialSlots, I as InternalFlatClassNames, h as UPUP_VAR_PREFIX, U as UpupColorTokens, a as UpupRadiusTokens, g as UpupResolvedTheme, b as UpupShadowTokens, k as UpupSlotPath, c as UpupSpacingTokens, f as UpupThemeConfig, e as UpupThemeMode, j as UpupThemeSlots, d as UpupThemeTokens, m as flattenSlotsToClassNames, i as tokensToVarRefs, t as tokensToVars } from '../vars-d3421f6c.cjs';
2
+ export { d as darkPreset, l as lightPreset, r as resolveTheme } from '../resolve-theme-66cf8d98.cjs';
3
+ export { a as ThemeStore, T as ThemeStoreState } from '../theme-store-2e56a674.cjs';
@@ -0,0 +1,3 @@
1
+ export { D as DeepPartial, l as DeepPartialSlots, I as InternalFlatClassNames, h as UPUP_VAR_PREFIX, U as UpupColorTokens, a as UpupRadiusTokens, g as UpupResolvedTheme, b as UpupShadowTokens, k as UpupSlotPath, c as UpupSpacingTokens, f as UpupThemeConfig, e as UpupThemeMode, j as UpupThemeSlots, d as UpupThemeTokens, m as flattenSlotsToClassNames, i as tokensToVarRefs, t as tokensToVars } from '../vars-d3421f6c.js';
2
+ export { d as darkPreset, l as lightPreset, r as resolveTheme } from '../resolve-theme-01758105.js';
3
+ export { a as ThemeStore, T as ThemeStoreState } from '../theme-store-f13e0315.js';
@@ -0,0 +1 @@
1
+ export { ThemeStore, UPUP_VAR_PREFIX, darkPreset, flattenSlotsToClassNames, lightPreset, resolveTheme, tokensToVarRefs, tokensToVars } from '../chunk-VV6QCQLL.js';
@@ -0,0 +1,39 @@
1
+ import { d as UpupThemeTokens, I as InternalFlatClassNames, l as DeepPartialSlots, f as UpupThemeConfig, g as UpupResolvedTheme } from './vars-d3421f6c.cjs';
2
+
3
+ type ResolvedLightDark = Omit<UpupResolvedTheme, 'mode'> & {
4
+ mode: 'light' | 'dark';
5
+ };
6
+ interface ThemeStoreState {
7
+ themeMode: 'light' | 'dark';
8
+ isDark: boolean;
9
+ tokens: UpupThemeTokens;
10
+ resolved: ResolvedLightDark;
11
+ slotOverrides: InternalFlatClassNames;
12
+ slots: DeepPartialSlots;
13
+ }
14
+ /**
15
+ * Framework-agnostic theme store. Owns the `system` matchMedia subscription and
16
+ * the resolution of a tri-state theme mode ('light' | 'dark' | 'system') into a
17
+ * concrete 'light' | 'dark' + tokens/slots. Mirrors UploaderOrchestrator's
18
+ * subscribe/getSnapshot pattern. SSR-safe: init() no-ops without window.
19
+ */
20
+ declare class ThemeStore {
21
+ private state;
22
+ private listeners;
23
+ private config?;
24
+ private systemMode;
25
+ private mediaCleanup;
26
+ constructor(config?: UpupThemeConfig);
27
+ subscribe: (listener: () => void) => (() => void);
28
+ getSnapshot: () => ThemeStoreState;
29
+ /** Start the `system` matchMedia subscription (no-op for explicit modes / SSR). */
30
+ init(): void;
31
+ /** Re-resolve when the host's theme config prop changes. */
32
+ setThemeConfig(config?: UpupThemeConfig): void;
33
+ private compute;
34
+ private recompute;
35
+ private notify;
36
+ destroy(): void;
37
+ }
38
+
39
+ export { type ThemeStoreState as T, ThemeStore as a };
@@ -0,0 +1,39 @@
1
+ import { d as UpupThemeTokens, I as InternalFlatClassNames, l as DeepPartialSlots, f as UpupThemeConfig, g as UpupResolvedTheme } from './vars-d3421f6c.js';
2
+
3
+ type ResolvedLightDark = Omit<UpupResolvedTheme, 'mode'> & {
4
+ mode: 'light' | 'dark';
5
+ };
6
+ interface ThemeStoreState {
7
+ themeMode: 'light' | 'dark';
8
+ isDark: boolean;
9
+ tokens: UpupThemeTokens;
10
+ resolved: ResolvedLightDark;
11
+ slotOverrides: InternalFlatClassNames;
12
+ slots: DeepPartialSlots;
13
+ }
14
+ /**
15
+ * Framework-agnostic theme store. Owns the `system` matchMedia subscription and
16
+ * the resolution of a tri-state theme mode ('light' | 'dark' | 'system') into a
17
+ * concrete 'light' | 'dark' + tokens/slots. Mirrors UploaderOrchestrator's
18
+ * subscribe/getSnapshot pattern. SSR-safe: init() no-ops without window.
19
+ */
20
+ declare class ThemeStore {
21
+ private state;
22
+ private listeners;
23
+ private config?;
24
+ private systemMode;
25
+ private mediaCleanup;
26
+ constructor(config?: UpupThemeConfig);
27
+ subscribe: (listener: () => void) => (() => void);
28
+ getSnapshot: () => ThemeStoreState;
29
+ /** Start the `system` matchMedia subscription (no-op for explicit modes / SSR). */
30
+ init(): void;
31
+ /** Re-resolve when the host's theme config prop changes. */
32
+ setThemeConfig(config?: UpupThemeConfig): void;
33
+ private compute;
34
+ private recompute;
35
+ private notify;
36
+ destroy(): void;
37
+ }
38
+
39
+ export { type ThemeStoreState as T, ThemeStore as a };
@@ -0,0 +1,20 @@
1
+ import { l as UploadStrategy, U as UploadCredentials, h as UploadResult, k as CredentialStrategy, F as FileMetadata, P as PresignedUrlResponse } from './contracts-strategies-378a16b7.js';
2
+
3
+ declare class DirectUpload implements UploadStrategy {
4
+ upload(file: File | Blob, credentials: UploadCredentials, options: {
5
+ onProgress: (loaded: number, total: number) => void;
6
+ signal: AbortSignal;
7
+ }): Promise<UploadResult>;
8
+ }
9
+
10
+ declare class TokenEndpointCredentials implements CredentialStrategy {
11
+ private url;
12
+ private headers;
13
+ constructor(options: {
14
+ url: string;
15
+ headers?: Record<string, string>;
16
+ });
17
+ getPresignedUrl(file: FileMetadata): Promise<PresignedUrlResponse>;
18
+ }
19
+
20
+ export { DirectUpload as D, TokenEndpointCredentials as T };
@@ -0,0 +1,20 @@
1
+ import { l as UploadStrategy, U as UploadCredentials, h as UploadResult, k as CredentialStrategy, F as FileMetadata, P as PresignedUrlResponse } from './contracts-strategies-378a16b7.cjs';
2
+
3
+ declare class DirectUpload implements UploadStrategy {
4
+ upload(file: File | Blob, credentials: UploadCredentials, options: {
5
+ onProgress: (loaded: number, total: number) => void;
6
+ signal: AbortSignal;
7
+ }): Promise<UploadResult>;
8
+ }
9
+
10
+ declare class TokenEndpointCredentials implements CredentialStrategy {
11
+ private url;
12
+ private headers;
13
+ constructor(options: {
14
+ url: string;
15
+ headers?: Record<string, string>;
16
+ });
17
+ getPresignedUrl(file: FileMetadata): Promise<PresignedUrlResponse>;
18
+ }
19
+
20
+ export { DirectUpload as D, TokenEndpointCredentials as T };