@tdacorp/hyle-sdk 0.14.1 → 0.21.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 (86) hide show
  1. package/README.md +171 -32
  2. package/dist/check-routes-bin.js +48 -21
  3. package/dist/chunk-56Y24XBV.js +840 -0
  4. package/dist/{chunk-MGSUQBDW.js → chunk-75JFLML4.js} +176 -14
  5. package/dist/chunk-HJX57NLI.js +1105 -0
  6. package/dist/chunk-K5VDLROQ.js +145 -0
  7. package/dist/{chunk-BUJFMR3M.js → chunk-QVYQM5R2.js} +15 -6
  8. package/dist/chunk-U74B7AUG.js +398 -0
  9. package/dist/{chunk-6VOHFFA5.js → chunk-X2TLYM7Y.js} +2 -2
  10. package/dist/client-41fU6OY2.d.cts +201 -0
  11. package/dist/client-LwzHwqpM.d.ts +201 -0
  12. package/dist/code-copy.cjs +72 -0
  13. package/dist/code-copy.d.cts +15 -0
  14. package/dist/code-copy.d.ts +15 -0
  15. package/dist/code-copy.js +48 -0
  16. package/dist/comments.cjs +733 -278
  17. package/dist/comments.d.cts +66 -3
  18. package/dist/comments.d.ts +66 -3
  19. package/dist/comments.js +414 -330
  20. package/dist/{diagram-viewer-DYX6R63Y.js → diagram-viewer-XY3CG75U.js} +107 -46
  21. package/dist/{embed-B76zRRPa.d.cts → embed-BUFRQboD.d.ts} +10 -5
  22. package/dist/{embed-SqOBGI-E.d.ts → embed-CYt-q13P.d.cts} +10 -5
  23. package/dist/fragment-alias.cjs +51 -0
  24. package/dist/fragment-alias.d.cts +7 -0
  25. package/dist/fragment-alias.d.ts +7 -0
  26. package/dist/fragment-alias.js +27 -0
  27. package/dist/html.cjs +881 -0
  28. package/dist/html.d.cts +20 -0
  29. package/dist/html.d.ts +20 -0
  30. package/dist/html.js +45 -0
  31. package/dist/index.cjs +181 -14
  32. package/dist/index.d.cts +14 -62
  33. package/dist/index.d.ts +14 -62
  34. package/dist/index.js +11 -1
  35. package/dist/labels-CrA-iqTN.d.cts +46 -0
  36. package/dist/labels-CrA-iqTN.d.ts +46 -0
  37. package/dist/mermaid-diagram.cjs +453 -148
  38. package/dist/mermaid-diagram.d.cts +25 -42
  39. package/dist/mermaid-diagram.d.ts +25 -42
  40. package/dist/mermaid-diagram.js +205 -50
  41. package/dist/mermaid-image.cjs +1456 -0
  42. package/dist/mermaid-image.d.cts +30 -0
  43. package/dist/mermaid-image.d.ts +30 -0
  44. package/dist/mermaid-image.js +93 -0
  45. package/dist/next.cjs +1709 -1134
  46. package/dist/next.d.cts +67 -14
  47. package/dist/next.d.ts +67 -14
  48. package/dist/next.js +950 -794
  49. package/dist/print-coordinator.cjs +157 -0
  50. package/dist/print-coordinator.d.cts +27 -0
  51. package/dist/print-coordinator.d.ts +27 -0
  52. package/dist/print-coordinator.js +83 -0
  53. package/dist/react.cjs +677 -264
  54. package/dist/react.d.cts +161 -31
  55. package/dist/react.d.ts +161 -31
  56. package/dist/react.js +23 -3
  57. package/dist/reactions.cjs +653 -0
  58. package/dist/reactions.d.cts +27 -0
  59. package/dist/reactions.d.ts +27 -0
  60. package/dist/reactions.js +364 -0
  61. package/dist/{resolve-DC2ccfwA.d.ts → resolve-BjAK0k_Y.d.ts} +2 -2
  62. package/dist/{resolve-DKLVftk_.d.cts → resolve-eI1muCKL.d.cts} +2 -2
  63. package/dist/revalidation-callback-BQl77tQR.d.cts +75 -0
  64. package/dist/revalidation-callback-BQl77tQR.d.ts +75 -0
  65. package/dist/sanitize-ijiWjEm9.d.cts +23 -0
  66. package/dist/sanitize-ijiWjEm9.d.ts +23 -0
  67. package/dist/styles.css +107 -47
  68. package/dist/toc-spy.cjs +59 -0
  69. package/dist/toc-spy.d.cts +15 -0
  70. package/dist/toc-spy.d.ts +15 -0
  71. package/dist/toc-spy.js +35 -0
  72. package/dist/{types-ByodIyEv.d.cts → types-3F0wqD-o.d.cts} +44 -4
  73. package/dist/{types-ByodIyEv.d.ts → types-3F0wqD-o.d.ts} +44 -4
  74. package/dist/use-cache.cjs +37 -11
  75. package/dist/use-cache.d.cts +12 -5
  76. package/dist/use-cache.d.ts +12 -5
  77. package/dist/use-cache.js +7 -7
  78. package/dist/youtube-facade.cjs +50 -0
  79. package/dist/youtube-facade.d.cts +17 -0
  80. package/dist/youtube-facade.d.ts +17 -0
  81. package/dist/youtube-facade.js +26 -0
  82. package/package.json +16 -3
  83. package/dist/chunk-4V4VKB3O.js +0 -1471
  84. package/dist/chunk-R5EMI4HQ.js +0 -61
  85. package/dist/revalidation-callback-D7Ms_Puz.d.cts +0 -42
  86. package/dist/revalidation-callback-D7Ms_Puz.d.ts +0 -42
@@ -1,61 +0,0 @@
1
- // src/react/mermaid-config.ts
2
- var MAX_MERMAID_SOURCE = 2e4;
3
- function luminance(css) {
4
- const m = /^(rgba?)\(([^)]*)\)$|^color\(srgb ([^)]*)\)$/.exec(css.trim());
5
- if (!m) return void 0;
6
- const parts = (m[2] ?? m[3] ?? "").split(/[\s,/]+/).filter(Boolean).map(Number);
7
- const [r, g, b] = parts.map((v) => m[3] ? v : v / 255);
8
- const alpha = parts[3] ?? 1;
9
- if (r === void 0 || g === void 0 || b === void 0 || [r, g, b, alpha].some(Number.isNaN) || alpha < 0.5) return void 0;
10
- return 0.2126 * r + 0.7152 * g + 0.0722 * b;
11
- }
12
- function pickMermaidTheme(background, prefersDark) {
13
- const l = luminance(background);
14
- return (l === void 0 ? prefersDark : l < 0.5) ? "dark" : "default";
15
- }
16
- var RENDER_TIMEOUT_MS = 1e4;
17
- var NEAR_VIEWPORT_MARGIN = "200px";
18
- var FRONTMATTER = /^\s*-{3}[^\S\n]*\n[\s\S]*?\n-{3}[^\S\n]*(?:\n|$)/;
19
- var DIRECTIVE = /%%\{(?:(?!\}%%)[\s\S])*(?:\}%%)?/g;
20
- function stripMermaidConfig(source) {
21
- let text = source.replace(/\r\n?/g, "\n");
22
- for (let previous = ""; previous !== text; ) {
23
- previous = text;
24
- text = text.replace(FRONTMATTER, "").replace(DIRECTIVE, "");
25
- }
26
- return text;
27
- }
28
- var counter = 0;
29
- var nextMermaidId = () => `hyle-mermaid-${++counter}`;
30
- function withTimeout(promise, ms) {
31
- let timer;
32
- const timeout = new Promise((_, reject) => {
33
- timer = setTimeout(() => reject(new Error("timeout")), ms);
34
- });
35
- return Promise.race([promise, timeout]).finally(() => clearTimeout(timer));
36
- }
37
- function whenNearViewport(el, onNear, Observer = globalThis.IntersectionObserver) {
38
- if (!Observer) {
39
- onNear();
40
- return () => {
41
- };
42
- }
43
- const observer = new Observer((entries) => {
44
- if (entries.some((e) => e.isIntersecting)) {
45
- observer.disconnect();
46
- onNear();
47
- }
48
- }, { rootMargin: NEAR_VIEWPORT_MARGIN });
49
- observer.observe(el);
50
- return () => observer.disconnect();
51
- }
52
-
53
- export {
54
- MAX_MERMAID_SOURCE,
55
- pickMermaidTheme,
56
- RENDER_TIMEOUT_MS,
57
- stripMermaidConfig,
58
- nextMermaidId,
59
- withTimeout,
60
- whenNearViewport
61
- };
@@ -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 };