@medialane/ui 0.105.0 → 0.106.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.
- package/dist/components/asset-lightbox.cjs +66 -0
- package/dist/components/asset-lightbox.cjs.map +1 -0
- package/dist/components/asset-lightbox.d.cts +11 -0
- package/dist/components/asset-lightbox.d.ts +11 -0
- package/dist/components/asset-lightbox.js +42 -0
- package/dist/components/asset-lightbox.js.map +1 -0
- package/dist/components/club-owner-actions.cjs +56 -0
- package/dist/components/club-owner-actions.cjs.map +1 -0
- package/dist/components/club-owner-actions.d.cts +11 -0
- package/dist/components/club-owner-actions.d.ts +11 -0
- package/dist/components/club-owner-actions.js +22 -0
- package/dist/components/club-owner-actions.js.map +1 -0
- package/dist/components/create-form-primitives.cjs +61 -0
- package/dist/components/create-form-primitives.cjs.map +1 -0
- package/dist/components/create-form-primitives.d.cts +16 -0
- package/dist/components/create-form-primitives.d.ts +16 -0
- package/dist/components/create-form-primitives.js +36 -0
- package/dist/components/create-form-primitives.js.map +1 -0
- package/dist/components/creation-record.cjs +86 -0
- package/dist/components/creation-record.cjs.map +1 -0
- package/dist/components/creation-record.d.cts +14 -0
- package/dist/components/creation-record.d.ts +14 -0
- package/dist/components/creation-record.js +52 -0
- package/dist/components/creation-record.js.map +1 -0
- package/dist/components/dialog.d.cts +9 -9
- package/dist/components/dialog.d.ts +9 -9
- package/dist/components/ip-type-fields.cjs +307 -0
- package/dist/components/ip-type-fields.cjs.map +1 -0
- package/dist/components/ip-type-fields.d.cts +17 -0
- package/dist/components/ip-type-fields.d.ts +17 -0
- package/dist/components/ip-type-fields.js +293 -0
- package/dist/components/ip-type-fields.js.map +1 -0
- package/dist/components/json-ld.cjs +39 -0
- package/dist/components/json-ld.cjs.map +1 -0
- package/dist/components/json-ld.d.cts +8 -0
- package/dist/components/json-ld.d.ts +8 -0
- package/dist/components/json-ld.js +15 -0
- package/dist/components/json-ld.js.map +1 -0
- package/dist/components/nav-theme-toggle.cjs +66 -0
- package/dist/components/nav-theme-toggle.cjs.map +1 -0
- package/dist/components/nav-theme-toggle.d.cts +9 -0
- package/dist/components/nav-theme-toggle.d.ts +9 -0
- package/dist/components/nav-theme-toggle.js +42 -0
- package/dist/components/nav-theme-toggle.js.map +1 -0
- package/dist/components/order-sort-control.cjs +58 -0
- package/dist/components/order-sort-control.cjs.map +1 -0
- package/dist/components/order-sort-control.d.cts +13 -0
- package/dist/components/order-sort-control.d.ts +13 -0
- package/dist/components/order-sort-control.js +39 -0
- package/dist/components/order-sort-control.js.map +1 -0
- package/dist/components/price-history-chart.cjs +130 -0
- package/dist/components/price-history-chart.cjs.map +1 -0
- package/dist/components/price-history-chart.d.cts +9 -0
- package/dist/components/price-history-chart.d.ts +9 -0
- package/dist/components/price-history-chart.js +114 -0
- package/dist/components/price-history-chart.js.map +1 -0
- package/dist/components/sheet.cjs +160 -0
- package/dist/components/sheet.cjs.map +1 -0
- package/dist/components/sheet.d.cts +30 -0
- package/dist/components/sheet.d.ts +30 -0
- package/dist/components/sheet.js +117 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/textarea.cjs +57 -0
- package/dist/components/textarea.cjs.map +1 -0
- package/dist/components/textarea.d.cts +6 -0
- package/dist/components/textarea.d.ts +6 -0
- package/dist/components/textarea.js +23 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/index.cjs +67 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/format-activity.cjs +143 -0
- package/dist/utils/format-activity.cjs.map +1 -0
- package/dist/utils/format-activity.d.cts +14 -0
- package/dist/utils/format-activity.d.ts +14 -0
- package/dist/utils/format-activity.js +116 -0
- package/dist/utils/format-activity.js.map +1 -0
- package/dist/utils/proxy-body.cjs +60 -0
- package/dist/utils/proxy-body.cjs.map +1 -0
- package/dist/utils/proxy-body.d.cts +22 -0
- package/dist/utils/proxy-body.d.ts +22 -0
- package/dist/utils/proxy-body.js +36 -0
- package/dist/utils/proxy-body.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var proxy_body_exports = {};
|
|
20
|
+
__export(proxy_body_exports, {
|
|
21
|
+
readBodyWithCap: () => readBodyWithCap
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(proxy_body_exports);
|
|
24
|
+
async function readBodyWithCap(upstream, maxBytes) {
|
|
25
|
+
const declaredLength = upstream.headers.get("content-length");
|
|
26
|
+
if (declaredLength) {
|
|
27
|
+
const n = Number.parseInt(declaredLength, 10);
|
|
28
|
+
if (Number.isFinite(n) && n > maxBytes) {
|
|
29
|
+
return { ok: false, status: 413, error: `Response exceeds size cap (${maxBytes} bytes)` };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (!upstream.body) {
|
|
33
|
+
return { ok: false, status: 502, error: "Upstream returned no body" };
|
|
34
|
+
}
|
|
35
|
+
const reader = upstream.body.getReader();
|
|
36
|
+
const chunks = [];
|
|
37
|
+
let total = 0;
|
|
38
|
+
while (true) {
|
|
39
|
+
const { done, value } = await reader.read();
|
|
40
|
+
if (done) break;
|
|
41
|
+
total += value.byteLength;
|
|
42
|
+
if (total > maxBytes) {
|
|
43
|
+
await reader.cancel();
|
|
44
|
+
return { ok: false, status: 413, error: `Response exceeds size cap (${maxBytes} bytes)` };
|
|
45
|
+
}
|
|
46
|
+
chunks.push(value);
|
|
47
|
+
}
|
|
48
|
+
const body = new Uint8Array(total);
|
|
49
|
+
let offset = 0;
|
|
50
|
+
for (const chunk of chunks) {
|
|
51
|
+
body.set(chunk, offset);
|
|
52
|
+
offset += chunk.byteLength;
|
|
53
|
+
}
|
|
54
|
+
return { ok: true, body };
|
|
55
|
+
}
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
readBodyWithCap
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=proxy-body.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/proxy-body.ts"],"sourcesContent":["/**\n * Read an upstream `fetch` Response body into memory with a hard byte cap.\n *\n * `arrayBuffer()` buffers the whole body before any limit applies, so a public\n * proxy route (image, IPFS) can be made to pin server memory by pointing it at\n * a large file. This streams the body and aborts once `maxBytes` is crossed.\n * A `Content-Length` larger than the cap short-circuits before a byte is read\n * (advisory — some origins omit or lie, so the streaming guard is the real\n * limit). Shared by both apps' `/api/img` and `/api/ipfs` routes so the cap\n * can't drift between them.\n */\nexport type CappedBody =\n | { ok: true; body: Uint8Array<ArrayBuffer> }\n | { ok: false; status: 413 | 502; error: string };\n\nexport async function readBodyWithCap(upstream: Response, maxBytes: number): Promise<CappedBody> {\n const declaredLength = upstream.headers.get(\"content-length\");\n if (declaredLength) {\n const n = Number.parseInt(declaredLength, 10);\n if (Number.isFinite(n) && n > maxBytes) {\n return { ok: false, status: 413, error: `Response exceeds size cap (${maxBytes} bytes)` };\n }\n }\n\n if (!upstream.body) {\n return { ok: false, status: 502, error: \"Upstream returned no body\" };\n }\n\n const reader = upstream.body.getReader();\n const chunks: Uint8Array[] = [];\n let total = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n total += value.byteLength;\n if (total > maxBytes) {\n await reader.cancel();\n return { ok: false, status: 413, error: `Response exceeds size cap (${maxBytes} bytes)` };\n }\n chunks.push(value);\n }\n\n const body = new Uint8Array(total) as Uint8Array<ArrayBuffer>;\n let offset = 0;\n for (const chunk of chunks) {\n body.set(chunk, offset);\n offset += chunk.byteLength;\n }\n return { ok: true, body };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,eAAsB,gBAAgB,UAAoB,UAAuC;AAC/F,QAAM,iBAAiB,SAAS,QAAQ,IAAI,gBAAgB;AAC5D,MAAI,gBAAgB;AAClB,UAAM,IAAI,OAAO,SAAS,gBAAgB,EAAE;AAC5C,QAAI,OAAO,SAAS,CAAC,KAAK,IAAI,UAAU;AACtC,aAAO,EAAE,IAAI,OAAO,QAAQ,KAAK,OAAO,8BAA8B,QAAQ,UAAU;AAAA,IAC1F;AAAA,EACF;AAEA,MAAI,CAAC,SAAS,MAAM;AAClB,WAAO,EAAE,IAAI,OAAO,QAAQ,KAAK,OAAO,4BAA4B;AAAA,EACtE;AAEA,QAAM,SAAS,SAAS,KAAK,UAAU;AACvC,QAAM,SAAuB,CAAC;AAC9B,MAAI,QAAQ;AACZ,SAAO,MAAM;AACX,UAAM,EAAE,MAAM,MAAM,IAAI,MAAM,OAAO,KAAK;AAC1C,QAAI,KAAM;AACV,aAAS,MAAM;AACf,QAAI,QAAQ,UAAU;AACpB,YAAM,OAAO,OAAO;AACpB,aAAO,EAAE,IAAI,OAAO,QAAQ,KAAK,OAAO,8BAA8B,QAAQ,UAAU;AAAA,IAC1F;AACA,WAAO,KAAK,KAAK;AAAA,EACnB;AAEA,QAAM,OAAO,IAAI,WAAW,KAAK;AACjC,MAAI,SAAS;AACb,aAAW,SAAS,QAAQ;AAC1B,SAAK,IAAI,OAAO,MAAM;AACtB,cAAU,MAAM;AAAA,EAClB;AACA,SAAO,EAAE,IAAI,MAAM,KAAK;AAC1B;","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read an upstream `fetch` Response body into memory with a hard byte cap.
|
|
3
|
+
*
|
|
4
|
+
* `arrayBuffer()` buffers the whole body before any limit applies, so a public
|
|
5
|
+
* proxy route (image, IPFS) can be made to pin server memory by pointing it at
|
|
6
|
+
* a large file. This streams the body and aborts once `maxBytes` is crossed.
|
|
7
|
+
* A `Content-Length` larger than the cap short-circuits before a byte is read
|
|
8
|
+
* (advisory — some origins omit or lie, so the streaming guard is the real
|
|
9
|
+
* limit). Shared by both apps' `/api/img` and `/api/ipfs` routes so the cap
|
|
10
|
+
* can't drift between them.
|
|
11
|
+
*/
|
|
12
|
+
type CappedBody = {
|
|
13
|
+
ok: true;
|
|
14
|
+
body: Uint8Array<ArrayBuffer>;
|
|
15
|
+
} | {
|
|
16
|
+
ok: false;
|
|
17
|
+
status: 413 | 502;
|
|
18
|
+
error: string;
|
|
19
|
+
};
|
|
20
|
+
declare function readBodyWithCap(upstream: Response, maxBytes: number): Promise<CappedBody>;
|
|
21
|
+
|
|
22
|
+
export { type CappedBody, readBodyWithCap };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read an upstream `fetch` Response body into memory with a hard byte cap.
|
|
3
|
+
*
|
|
4
|
+
* `arrayBuffer()` buffers the whole body before any limit applies, so a public
|
|
5
|
+
* proxy route (image, IPFS) can be made to pin server memory by pointing it at
|
|
6
|
+
* a large file. This streams the body and aborts once `maxBytes` is crossed.
|
|
7
|
+
* A `Content-Length` larger than the cap short-circuits before a byte is read
|
|
8
|
+
* (advisory — some origins omit or lie, so the streaming guard is the real
|
|
9
|
+
* limit). Shared by both apps' `/api/img` and `/api/ipfs` routes so the cap
|
|
10
|
+
* can't drift between them.
|
|
11
|
+
*/
|
|
12
|
+
type CappedBody = {
|
|
13
|
+
ok: true;
|
|
14
|
+
body: Uint8Array<ArrayBuffer>;
|
|
15
|
+
} | {
|
|
16
|
+
ok: false;
|
|
17
|
+
status: 413 | 502;
|
|
18
|
+
error: string;
|
|
19
|
+
};
|
|
20
|
+
declare function readBodyWithCap(upstream: Response, maxBytes: number): Promise<CappedBody>;
|
|
21
|
+
|
|
22
|
+
export { type CappedBody, readBodyWithCap };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
async function readBodyWithCap(upstream, maxBytes) {
|
|
2
|
+
const declaredLength = upstream.headers.get("content-length");
|
|
3
|
+
if (declaredLength) {
|
|
4
|
+
const n = Number.parseInt(declaredLength, 10);
|
|
5
|
+
if (Number.isFinite(n) && n > maxBytes) {
|
|
6
|
+
return { ok: false, status: 413, error: `Response exceeds size cap (${maxBytes} bytes)` };
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
if (!upstream.body) {
|
|
10
|
+
return { ok: false, status: 502, error: "Upstream returned no body" };
|
|
11
|
+
}
|
|
12
|
+
const reader = upstream.body.getReader();
|
|
13
|
+
const chunks = [];
|
|
14
|
+
let total = 0;
|
|
15
|
+
while (true) {
|
|
16
|
+
const { done, value } = await reader.read();
|
|
17
|
+
if (done) break;
|
|
18
|
+
total += value.byteLength;
|
|
19
|
+
if (total > maxBytes) {
|
|
20
|
+
await reader.cancel();
|
|
21
|
+
return { ok: false, status: 413, error: `Response exceeds size cap (${maxBytes} bytes)` };
|
|
22
|
+
}
|
|
23
|
+
chunks.push(value);
|
|
24
|
+
}
|
|
25
|
+
const body = new Uint8Array(total);
|
|
26
|
+
let offset = 0;
|
|
27
|
+
for (const chunk of chunks) {
|
|
28
|
+
body.set(chunk, offset);
|
|
29
|
+
offset += chunk.byteLength;
|
|
30
|
+
}
|
|
31
|
+
return { ok: true, body };
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
readBodyWithCap
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=proxy-body.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/proxy-body.ts"],"sourcesContent":["/**\n * Read an upstream `fetch` Response body into memory with a hard byte cap.\n *\n * `arrayBuffer()` buffers the whole body before any limit applies, so a public\n * proxy route (image, IPFS) can be made to pin server memory by pointing it at\n * a large file. This streams the body and aborts once `maxBytes` is crossed.\n * A `Content-Length` larger than the cap short-circuits before a byte is read\n * (advisory — some origins omit or lie, so the streaming guard is the real\n * limit). Shared by both apps' `/api/img` and `/api/ipfs` routes so the cap\n * can't drift between them.\n */\nexport type CappedBody =\n | { ok: true; body: Uint8Array<ArrayBuffer> }\n | { ok: false; status: 413 | 502; error: string };\n\nexport async function readBodyWithCap(upstream: Response, maxBytes: number): Promise<CappedBody> {\n const declaredLength = upstream.headers.get(\"content-length\");\n if (declaredLength) {\n const n = Number.parseInt(declaredLength, 10);\n if (Number.isFinite(n) && n > maxBytes) {\n return { ok: false, status: 413, error: `Response exceeds size cap (${maxBytes} bytes)` };\n }\n }\n\n if (!upstream.body) {\n return { ok: false, status: 502, error: \"Upstream returned no body\" };\n }\n\n const reader = upstream.body.getReader();\n const chunks: Uint8Array[] = [];\n let total = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n total += value.byteLength;\n if (total > maxBytes) {\n await reader.cancel();\n return { ok: false, status: 413, error: `Response exceeds size cap (${maxBytes} bytes)` };\n }\n chunks.push(value);\n }\n\n const body = new Uint8Array(total) as Uint8Array<ArrayBuffer>;\n let offset = 0;\n for (const chunk of chunks) {\n body.set(chunk, offset);\n offset += chunk.byteLength;\n }\n return { ok: true, body };\n}\n"],"mappings":"AAeA,eAAsB,gBAAgB,UAAoB,UAAuC;AAC/F,QAAM,iBAAiB,SAAS,QAAQ,IAAI,gBAAgB;AAC5D,MAAI,gBAAgB;AAClB,UAAM,IAAI,OAAO,SAAS,gBAAgB,EAAE;AAC5C,QAAI,OAAO,SAAS,CAAC,KAAK,IAAI,UAAU;AACtC,aAAO,EAAE,IAAI,OAAO,QAAQ,KAAK,OAAO,8BAA8B,QAAQ,UAAU;AAAA,IAC1F;AAAA,EACF;AAEA,MAAI,CAAC,SAAS,MAAM;AAClB,WAAO,EAAE,IAAI,OAAO,QAAQ,KAAK,OAAO,4BAA4B;AAAA,EACtE;AAEA,QAAM,SAAS,SAAS,KAAK,UAAU;AACvC,QAAM,SAAuB,CAAC;AAC9B,MAAI,QAAQ;AACZ,SAAO,MAAM;AACX,UAAM,EAAE,MAAM,MAAM,IAAI,MAAM,OAAO,KAAK;AAC1C,QAAI,KAAM;AACV,aAAS,MAAM;AACf,QAAI,QAAQ,UAAU;AACpB,YAAM,OAAO,OAAO;AACpB,aAAO,EAAE,IAAI,OAAO,QAAQ,KAAK,OAAO,8BAA8B,QAAQ,UAAU;AAAA,IAC1F;AACA,WAAO,KAAK,KAAK;AAAA,EACnB;AAEA,QAAM,OAAO,IAAI,WAAW,KAAK;AACjC,MAAI,SAAS;AACb,aAAW,SAAS,QAAQ;AAC1B,SAAK,IAAI,OAAO,MAAM;AACtB,cAAU,MAAM;AAAA,EAClB;AACA,SAAO,EAAE,IAAI,MAAM,KAAK;AAC1B;","names":[]}
|