@tdacorp/hyle-sdk 0.17.0 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +261 -42
- package/dist/check-routes-bin.js +190 -53
- package/dist/{chunk-6VOHFFA5.js → chunk-7T5EEJHK.js} +2 -2
- package/dist/chunk-DUPT6XLB.js +57 -0
- package/dist/chunk-IW3TUD4G.js +841 -0
- package/dist/{chunk-MGSUQBDW.js → chunk-KU7LWK4E.js} +249 -24
- package/dist/{chunk-BUJFMR3M.js → chunk-QVYQM5R2.js} +15 -6
- package/dist/chunk-SFFBZFEN.js +178 -0
- package/dist/chunk-U74B7AUG.js +398 -0
- package/dist/chunk-ZIW6FDU2.js +1126 -0
- package/dist/client-BGjmEWhN.d.cts +207 -0
- package/dist/client-D0LTpr3Y.d.ts +207 -0
- package/dist/code-copy.cjs +74 -0
- package/dist/code-copy.d.cts +18 -0
- package/dist/code-copy.d.ts +18 -0
- package/dist/code-copy.js +50 -0
- package/dist/comments.cjs +738 -280
- package/dist/comments.d.cts +66 -3
- package/dist/comments.d.ts +66 -3
- package/dist/comments.js +419 -331
- package/dist/{diagram-viewer-FJPED4SN.js → diagram-viewer-XY3CG75U.js} +62 -21
- package/dist/docs-enhance.cjs +7 -4
- package/dist/docs-enhance.d.cts +5 -3
- package/dist/docs-enhance.d.ts +5 -3
- package/dist/docs-enhance.js +8 -5
- package/dist/{embed-DNTZ2UXv.d.ts → embed-CbtsbZs3.d.cts} +5 -3
- package/dist/{embed-BmdwA2G9.d.cts → embed-Cf_2ZR5x.d.ts} +5 -3
- package/dist/fragment-alias.cjs +51 -0
- package/dist/fragment-alias.d.cts +7 -0
- package/dist/fragment-alias.d.ts +7 -0
- package/dist/fragment-alias.js +27 -0
- package/dist/html.cjs +886 -0
- package/dist/html.d.cts +20 -0
- package/dist/html.d.ts +20 -0
- package/dist/html.js +45 -0
- package/dist/index.cjs +244 -24
- package/dist/index.d.cts +22 -68
- package/dist/index.d.ts +22 -68
- package/dist/index.js +12 -2
- package/dist/{labels-nmukKYgL.d.cts → labels-CrA-iqTN.d.cts} +9 -0
- package/dist/{labels-nmukKYgL.d.ts → labels-CrA-iqTN.d.ts} +9 -0
- package/dist/mermaid-diagram.cjs +441 -125
- package/dist/mermaid-diagram.d.cts +23 -7
- package/dist/mermaid-diagram.d.ts +23 -7
- package/dist/mermaid-diagram.js +213 -51
- package/dist/mermaid-image.cjs +137 -60
- package/dist/mermaid-image.d.cts +4 -3
- package/dist/mermaid-image.d.ts +4 -3
- package/dist/mermaid-image.js +27 -28
- package/dist/next.cjs +836 -304
- package/dist/next.d.cts +45 -20
- package/dist/next.d.ts +45 -20
- package/dist/next.js +151 -40
- package/dist/print-coordinator.cjs +157 -0
- package/dist/print-coordinator.d.cts +27 -0
- package/dist/print-coordinator.d.ts +27 -0
- package/dist/print-coordinator.js +83 -0
- package/dist/react.cjs +603 -240
- package/dist/react.d.cts +148 -30
- package/dist/react.d.ts +148 -30
- package/dist/react.js +26 -4
- package/dist/reactions.cjs +653 -0
- package/dist/reactions.d.cts +27 -0
- package/dist/reactions.d.ts +27 -0
- package/dist/reactions.js +364 -0
- package/dist/{resolve-euZ4-aC9.d.cts → resolve-BnIv7aB7.d.cts} +2 -2
- package/dist/{resolve-Ae7UFjsQ.d.ts → resolve-BysHtZ_i.d.ts} +2 -2
- package/dist/revalidation-callback-BQl77tQR.d.cts +75 -0
- package/dist/revalidation-callback-BQl77tQR.d.ts +75 -0
- package/dist/sanitize-BpY_AdZh.d.cts +23 -0
- package/dist/sanitize-BpY_AdZh.d.ts +23 -0
- package/dist/styles.css +100 -29
- package/dist/toc-spy.cjs +60 -0
- package/dist/toc-spy.d.cts +15 -0
- package/dist/toc-spy.d.ts +15 -0
- package/dist/toc-spy.js +36 -0
- package/dist/{types-Czt887Iv.d.cts → types-D09Z072G.d.cts} +57 -2
- package/dist/{types-Czt887Iv.d.ts → types-D09Z072G.d.ts} +57 -2
- package/dist/use-cache.cjs +89 -13
- package/dist/use-cache.d.cts +12 -5
- package/dist/use-cache.d.ts +12 -5
- package/dist/use-cache.js +8 -8
- package/dist/youtube-facade.cjs +50 -0
- package/dist/youtube-facade.d.cts +17 -0
- package/dist/youtube-facade.d.ts +17 -0
- package/dist/youtube-facade.js +26 -0
- package/package.json +16 -3
- package/dist/chunk-67IOIAVW.js +0 -35
- package/dist/chunk-DMK4XQLU.js +0 -1556
- package/dist/chunk-PJMJMP66.js +0 -63
- package/dist/revalidation-callback-D7Ms_Puz.d.cts +0 -42
- package/dist/revalidation-callback-D7Ms_Puz.d.ts +0 -42
package/dist/chunk-PJMJMP66.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// src/react/mermaid-config.ts
|
|
2
|
-
var MAX_MERMAID_SOURCE = 1024 * 1024;
|
|
3
|
-
var MAX_MERMAID_EDGES = 5e3;
|
|
4
|
-
function luminance(css) {
|
|
5
|
-
const m = /^(rgba?)\(([^)]*)\)$|^color\(srgb ([^)]*)\)$/.exec(css.trim());
|
|
6
|
-
if (!m) return void 0;
|
|
7
|
-
const parts = (m[2] ?? m[3] ?? "").split(/[\s,/]+/).filter(Boolean).map(Number);
|
|
8
|
-
const [r, g, b] = parts.map((v) => m[3] ? v : v / 255);
|
|
9
|
-
const alpha = parts[3] ?? 1;
|
|
10
|
-
if (r === void 0 || g === void 0 || b === void 0 || [r, g, b, alpha].some(Number.isNaN) || alpha < 0.5) return void 0;
|
|
11
|
-
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
12
|
-
}
|
|
13
|
-
function pickMermaidTheme(background, prefersDark) {
|
|
14
|
-
const l = luminance(background);
|
|
15
|
-
return (l === void 0 ? prefersDark : l < 0.5) ? "dark" : "default";
|
|
16
|
-
}
|
|
17
|
-
var RENDER_TIMEOUT_MS = 1e4;
|
|
18
|
-
var NEAR_VIEWPORT_MARGIN = "200px";
|
|
19
|
-
var FRONTMATTER = /^\s*-{3}[^\S\n]*\n[\s\S]*?\n-{3}[^\S\n]*(?:\n|$)/;
|
|
20
|
-
var DIRECTIVE = /%%\{(?:(?!\}%%)[\s\S])*(?:\}%%)?/g;
|
|
21
|
-
function stripMermaidConfig(source) {
|
|
22
|
-
let text = source.replace(/\r\n?/g, "\n");
|
|
23
|
-
for (let previous = ""; previous !== text; ) {
|
|
24
|
-
previous = text;
|
|
25
|
-
text = text.replace(FRONTMATTER, "").replace(DIRECTIVE, "");
|
|
26
|
-
}
|
|
27
|
-
return text;
|
|
28
|
-
}
|
|
29
|
-
var counter = 0;
|
|
30
|
-
var nextMermaidId = () => `hyle-mermaid-${++counter}`;
|
|
31
|
-
function withTimeout(promise, ms) {
|
|
32
|
-
let timer;
|
|
33
|
-
const timeout = new Promise((_, reject) => {
|
|
34
|
-
timer = setTimeout(() => reject(new Error("timeout")), ms);
|
|
35
|
-
});
|
|
36
|
-
return Promise.race([promise, timeout]).finally(() => clearTimeout(timer));
|
|
37
|
-
}
|
|
38
|
-
function whenNearViewport(el, onNear, Observer = globalThis.IntersectionObserver) {
|
|
39
|
-
if (!Observer) {
|
|
40
|
-
onNear();
|
|
41
|
-
return () => {
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
const observer = new Observer((entries) => {
|
|
45
|
-
if (entries.some((e) => e.isIntersecting)) {
|
|
46
|
-
observer.disconnect();
|
|
47
|
-
onNear();
|
|
48
|
-
}
|
|
49
|
-
}, { rootMargin: NEAR_VIEWPORT_MARGIN });
|
|
50
|
-
observer.observe(el);
|
|
51
|
-
return () => observer.disconnect();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export {
|
|
55
|
-
MAX_MERMAID_SOURCE,
|
|
56
|
-
MAX_MERMAID_EDGES,
|
|
57
|
-
pickMermaidTheme,
|
|
58
|
-
RENDER_TIMEOUT_MS,
|
|
59
|
-
stripMermaidConfig,
|
|
60
|
-
nextMermaidId,
|
|
61
|
-
withTimeout,
|
|
62
|
-
whenNearViewport
|
|
63
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
interface RevalidationPayload {
|
|
2
|
-
readonly cp: number;
|
|
3
|
-
readonly id: string;
|
|
4
|
-
readonly type: string;
|
|
5
|
-
readonly created_at: string;
|
|
6
|
-
readonly workspace_id: string;
|
|
7
|
-
readonly event_id: string;
|
|
8
|
-
readonly reason: string;
|
|
9
|
-
readonly epoch: number;
|
|
10
|
-
readonly tags: readonly string[];
|
|
11
|
-
readonly paths?: readonly string[];
|
|
12
|
-
}
|
|
13
|
-
interface RevalidationCallbackOptions {
|
|
14
|
-
/** This deployment's own configured workspace -- a mismatched payload is ignored (step 5), never rejected. */
|
|
15
|
-
readonly workspaceId: string;
|
|
16
|
-
/** Current secret first, previous secret(s) after, for rotation with a grace window (section 5.2). */
|
|
17
|
-
readonly secrets: readonly string[];
|
|
18
|
-
/**
|
|
19
|
-
* Wired by the caller to next/cache's own revalidateTag -- this package
|
|
20
|
-
* never imports next/cache directly, so it stays usable outside a Next.js
|
|
21
|
-
* runtime too (docs/cp1-spec.md section 7.7's own framework-boundary
|
|
22
|
-
* spirit, applied here even though the SDK itself is outside that
|
|
23
|
-
* table).
|
|
24
|
-
*/
|
|
25
|
-
readonly revalidateTag: (tag: string) => void;
|
|
26
|
-
readonly toleranceSeconds?: number;
|
|
27
|
-
readonly dedupeCapacity?: number;
|
|
28
|
-
/** Injectable for tests; defaults to the real wall clock. */
|
|
29
|
-
readonly now?: () => number;
|
|
30
|
-
}
|
|
31
|
-
interface RevalidationCallbackRoute {
|
|
32
|
-
readonly POST: (req: Request) => Promise<Response>;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* docs/cp1-spec.md section 5.6, all nine steps, in order. Never throws for
|
|
36
|
-
* an expected condition (a mismatched workspace, an unknown cp version) --
|
|
37
|
-
* those are 200-and-ignore, specifically so they never trip the sender's
|
|
38
|
-
* circuit breaker (section 5.7) for an endpoint that is otherwise healthy.
|
|
39
|
-
*/
|
|
40
|
-
declare function createRevalidationCallbackRoute(options: RevalidationCallbackOptions): RevalidationCallbackRoute;
|
|
41
|
-
|
|
42
|
-
export { type RevalidationCallbackOptions as R, type RevalidationCallbackRoute as a, type RevalidationPayload as b, createRevalidationCallbackRoute as c };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
interface RevalidationPayload {
|
|
2
|
-
readonly cp: number;
|
|
3
|
-
readonly id: string;
|
|
4
|
-
readonly type: string;
|
|
5
|
-
readonly created_at: string;
|
|
6
|
-
readonly workspace_id: string;
|
|
7
|
-
readonly event_id: string;
|
|
8
|
-
readonly reason: string;
|
|
9
|
-
readonly epoch: number;
|
|
10
|
-
readonly tags: readonly string[];
|
|
11
|
-
readonly paths?: readonly string[];
|
|
12
|
-
}
|
|
13
|
-
interface RevalidationCallbackOptions {
|
|
14
|
-
/** This deployment's own configured workspace -- a mismatched payload is ignored (step 5), never rejected. */
|
|
15
|
-
readonly workspaceId: string;
|
|
16
|
-
/** Current secret first, previous secret(s) after, for rotation with a grace window (section 5.2). */
|
|
17
|
-
readonly secrets: readonly string[];
|
|
18
|
-
/**
|
|
19
|
-
* Wired by the caller to next/cache's own revalidateTag -- this package
|
|
20
|
-
* never imports next/cache directly, so it stays usable outside a Next.js
|
|
21
|
-
* runtime too (docs/cp1-spec.md section 7.7's own framework-boundary
|
|
22
|
-
* spirit, applied here even though the SDK itself is outside that
|
|
23
|
-
* table).
|
|
24
|
-
*/
|
|
25
|
-
readonly revalidateTag: (tag: string) => void;
|
|
26
|
-
readonly toleranceSeconds?: number;
|
|
27
|
-
readonly dedupeCapacity?: number;
|
|
28
|
-
/** Injectable for tests; defaults to the real wall clock. */
|
|
29
|
-
readonly now?: () => number;
|
|
30
|
-
}
|
|
31
|
-
interface RevalidationCallbackRoute {
|
|
32
|
-
readonly POST: (req: Request) => Promise<Response>;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* docs/cp1-spec.md section 5.6, all nine steps, in order. Never throws for
|
|
36
|
-
* an expected condition (a mismatched workspace, an unknown cp version) --
|
|
37
|
-
* those are 200-and-ignore, specifically so they never trip the sender's
|
|
38
|
-
* circuit breaker (section 5.7) for an endpoint that is otherwise healthy.
|
|
39
|
-
*/
|
|
40
|
-
declare function createRevalidationCallbackRoute(options: RevalidationCallbackOptions): RevalidationCallbackRoute;
|
|
41
|
-
|
|
42
|
-
export { type RevalidationCallbackOptions as R, type RevalidationCallbackRoute as a, type RevalidationPayload as b, createRevalidationCallbackRoute as c };
|