@brett_lamy/ui 5.0.0 → 5.2.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 (173) hide show
  1. package/dist/components/adaptive-pane.d.ts +12 -1
  2. package/dist/components/adaptive-pane.d.ts.map +1 -1
  3. package/dist/components/adaptive-pane.js +122 -19
  4. package/dist/components/avatar.d.ts +47 -5
  5. package/dist/components/avatar.d.ts.map +1 -1
  6. package/dist/components/avatar.js +101 -14
  7. package/dist/components/breadcrumb.d.ts +87 -0
  8. package/dist/components/breadcrumb.d.ts.map +1 -0
  9. package/dist/components/breadcrumb.js +312 -0
  10. package/dist/components/calendar.d.ts +26 -0
  11. package/dist/components/calendar.d.ts.map +1 -0
  12. package/dist/components/calendar.js +97 -0
  13. package/dist/components/color-field.d.ts +22 -0
  14. package/dist/components/color-field.d.ts.map +1 -0
  15. package/dist/components/color-field.js +60 -0
  16. package/dist/components/color-picker.d.ts +49 -0
  17. package/dist/components/color-picker.d.ts.map +1 -0
  18. package/dist/components/color-picker.js +121 -0
  19. package/dist/components/command-menu.js +13 -13
  20. package/dist/components/credenza.d.ts +5 -2
  21. package/dist/components/credenza.d.ts.map +1 -1
  22. package/dist/components/credenza.js +62 -60
  23. package/dist/components/date-field.d.ts +19 -0
  24. package/dist/components/date-field.d.ts.map +1 -0
  25. package/dist/components/date-field.js +79 -0
  26. package/dist/components/date-picker.d.ts +38 -0
  27. package/dist/components/date-picker.d.ts.map +1 -0
  28. package/dist/components/date-picker.js +110 -0
  29. package/dist/components/edge-drawer.d.ts +7 -2
  30. package/dist/components/edge-drawer.d.ts.map +1 -1
  31. package/dist/components/edge-drawer.js +7 -4
  32. package/dist/components/filmstrip.d.ts +19 -0
  33. package/dist/components/filmstrip.d.ts.map +1 -0
  34. package/dist/components/filmstrip.js +59 -0
  35. package/dist/components/filter-input.js +4 -4
  36. package/dist/components/filter.js +62 -62
  37. package/dist/components/font-picker.d.ts +67 -0
  38. package/dist/components/font-picker.d.ts.map +1 -0
  39. package/dist/components/font-picker.js +373 -0
  40. package/dist/components/markdown-editor.d.ts +11 -0
  41. package/dist/components/markdown-editor.d.ts.map +1 -1
  42. package/dist/components/markdown-editor.js +72 -65
  43. package/dist/components/navigation-stack.d.ts.map +1 -1
  44. package/dist/components/navigation-stack.js +75 -65
  45. package/dist/components/number-morph.d.ts.map +1 -1
  46. package/dist/components/number-morph.js +5 -5
  47. package/dist/components/replay-preview.d.ts +2 -2
  48. package/dist/components/replay-preview.d.ts.map +1 -1
  49. package/dist/components/replay-preview.js +3 -3
  50. package/dist/components/result-table.js +10 -10
  51. package/dist/components/schema-tree.d.ts.map +1 -1
  52. package/dist/components/schema-tree.js +62 -131
  53. package/dist/components/segmented.d.ts +1 -1
  54. package/dist/components/segmented.d.ts.map +1 -1
  55. package/dist/components/segmented.js +1 -1
  56. package/dist/components/sidebar.d.ts.map +1 -1
  57. package/dist/components/sidebar.js +8 -4
  58. package/dist/components/spinner-shapes.d.ts +36 -0
  59. package/dist/components/spinner-shapes.d.ts.map +1 -1
  60. package/dist/components/spinner-shapes.js +105 -0
  61. package/dist/components/spinner.d.ts +1 -1
  62. package/dist/components/spinner.d.ts.map +1 -1
  63. package/dist/components/split-view.d.ts +3 -1
  64. package/dist/components/split-view.d.ts.map +1 -1
  65. package/dist/components/split-view.js +211 -211
  66. package/dist/components/spreadsheet.d.ts +58 -0
  67. package/dist/components/spreadsheet.d.ts.map +1 -0
  68. package/dist/components/spreadsheet.js +804 -0
  69. package/dist/components/sql-console.d.ts.map +1 -1
  70. package/dist/components/sql-console.js +2 -1
  71. package/dist/components/sql-editor.js +8 -8
  72. package/dist/components/stl-viewer.d.ts +3 -0
  73. package/dist/components/stl-viewer.d.ts.map +1 -0
  74. package/dist/components/stl-viewer.js +2 -0
  75. package/dist/components/strudel-player.d.ts +3 -0
  76. package/dist/components/strudel-player.d.ts.map +1 -0
  77. package/dist/components/strudel-player.js +2 -0
  78. package/dist/components/strudel-rack.d.ts +3 -0
  79. package/dist/components/strudel-rack.d.ts.map +1 -0
  80. package/dist/components/strudel-rack.js +2 -0
  81. package/dist/components/strudel-syntax.d.ts +3 -0
  82. package/dist/components/strudel-syntax.d.ts.map +1 -0
  83. package/dist/components/strudel-syntax.js +2 -0
  84. package/dist/components/tabs.js +3 -3
  85. package/dist/components/tailscale-menu.d.ts +69 -0
  86. package/dist/components/tailscale-menu.d.ts.map +1 -0
  87. package/dist/components/tailscale-menu.js +202 -0
  88. package/dist/components/toggle-group.js +3 -3
  89. package/dist/components/tree.d.ts +82 -0
  90. package/dist/components/tree.d.ts.map +1 -0
  91. package/dist/components/tree.js +494 -0
  92. package/dist/components/video-preview.d.ts +46 -0
  93. package/dist/components/video-preview.d.ts.map +1 -0
  94. package/dist/components/video-preview.js +197 -0
  95. package/dist/components/video-timeline.d.ts +64 -0
  96. package/dist/components/video-timeline.d.ts.map +1 -0
  97. package/dist/components/video-timeline.js +479 -0
  98. package/dist/components/waveform.d.ts +23 -0
  99. package/dist/components/waveform.d.ts.map +1 -0
  100. package/dist/components/waveform.js +56 -0
  101. package/dist/ffmpeg-worker.js +118 -0
  102. package/dist/index.css +1 -1
  103. package/dist/index.d.ts +53 -4
  104. package/dist/index.d.ts.map +1 -1
  105. package/dist/index.js +145 -116
  106. package/dist/lib/csv.d.ts +28 -0
  107. package/dist/lib/csv.d.ts.map +1 -0
  108. package/dist/lib/csv.js +90 -0
  109. package/dist/lib/drawer-swipe.d.ts +31 -0
  110. package/dist/lib/drawer-swipe.d.ts.map +1 -0
  111. package/dist/lib/drawer-swipe.js +68 -0
  112. package/dist/lib/ffmpeg/index.d.ts +117 -0
  113. package/dist/lib/ffmpeg/index.d.ts.map +1 -0
  114. package/dist/lib/ffmpeg/index.js +204 -0
  115. package/dist/lib/ffmpeg/media.d.ts +39 -0
  116. package/dist/lib/ffmpeg/media.d.ts.map +1 -0
  117. package/dist/lib/ffmpeg/media.js +100 -0
  118. package/dist/lib/ffmpeg/react.d.ts +51 -0
  119. package/dist/lib/ffmpeg/react.d.ts.map +1 -0
  120. package/dist/lib/ffmpeg/react.js +113 -0
  121. package/dist/lib/google-fonts.d.ts +47 -0
  122. package/dist/lib/google-fonts.d.ts.map +1 -0
  123. package/dist/lib/google-fonts.generated.d.ts +2 -0
  124. package/dist/lib/google-fonts.generated.d.ts.map +1 -0
  125. package/dist/lib/google-fonts.generated.js +1925 -0
  126. package/dist/lib/google-fonts.js +112 -0
  127. package/dist/lib/icon.d.ts +6 -1
  128. package/dist/lib/icon.d.ts.map +1 -1
  129. package/dist/lib/icon.js +2 -0
  130. package/dist/lib/playback.d.ts +34 -0
  131. package/dist/lib/playback.d.ts.map +1 -0
  132. package/dist/lib/playback.js +79 -0
  133. package/dist/lib/spreadsheet-gpu.d.ts +9 -0
  134. package/dist/lib/spreadsheet-gpu.d.ts.map +1 -0
  135. package/dist/lib/spreadsheet-gpu.js +237 -0
  136. package/dist/lib/spreadsheet.d.ts +82 -0
  137. package/dist/lib/spreadsheet.d.ts.map +1 -0
  138. package/dist/lib/spreadsheet.js +162 -0
  139. package/dist/lib/syntax.d.ts +2 -6
  140. package/dist/lib/syntax.d.ts.map +1 -1
  141. package/dist/lib/syntax.js +53 -75
  142. package/dist/lib/tailscale-connect.d.ts +33 -0
  143. package/dist/lib/tailscale-connect.d.ts.map +1 -1
  144. package/dist/lib/tailscale-connect.js +221 -42
  145. package/dist/lib/tailscale-exit.d.ts +19 -0
  146. package/dist/lib/tailscale-exit.d.ts.map +1 -0
  147. package/dist/lib/tailscale-exit.js +14 -0
  148. package/dist/lib/tailscale-fake.d.ts +8 -0
  149. package/dist/lib/tailscale-fake.d.ts.map +1 -1
  150. package/dist/lib/tailscale-fake.js +51 -26
  151. package/dist/lib/tailscale-roots.d.ts +3 -0
  152. package/dist/lib/tailscale-roots.d.ts.map +1 -0
  153. package/dist/lib/tailscale-roots.js +4 -0
  154. package/dist/lib/tailscale.d.ts +23 -0
  155. package/dist/lib/tailscale.d.ts.map +1 -1
  156. package/dist/lib/tailscale.js +156 -94
  157. package/dist/lib/title-flight.d.ts +4 -0
  158. package/dist/lib/title-flight.d.ts.map +1 -1
  159. package/dist/lib/title-flight.js +15 -12
  160. package/dist/lib/tokens.generated.d.ts +2 -2
  161. package/dist/lib/tokens.generated.d.ts.map +1 -1
  162. package/dist/lib/tokens.generated.js +2 -2
  163. package/dist/lib/video-render.d.ts +38 -0
  164. package/dist/lib/video-render.d.ts.map +1 -0
  165. package/dist/lib/video-render.js +147 -0
  166. package/dist/lib/video-timeline.d.ts +154 -0
  167. package/dist/lib/video-timeline.d.ts.map +1 -0
  168. package/dist/lib/video-timeline.js +265 -0
  169. package/dist/lib/webgpu.d.ts +26 -0
  170. package/dist/lib/webgpu.d.ts.map +1 -0
  171. package/dist/lib/webgpu.js +28 -0
  172. package/dist/theme.css +3 -0
  173. package/package.json +10 -4
@@ -0,0 +1,113 @@
1
+ "use client";
2
+ import { createFfmpeg as e, ffmpegUnsupportedReason as t } from "./index.js";
3
+ import { extractFrames as n, extractPeaks as r, frameTimes as i } from "./media.js";
4
+ import { createContext as a, useContext as o, useEffect as s, useState as c } from "react";
5
+ import { jsx as l } from "react/jsx-runtime";
6
+ //#region src/lib/ffmpeg/react.tsx
7
+ var u = a(null);
8
+ function d({ baseURL: t, concurrency: n, children: r }) {
9
+ let [i, a] = c(null), o = t == null ? void 0 : String(t);
10
+ return s(() => {
11
+ let t = e({
12
+ baseURL: o,
13
+ concurrency: n
14
+ });
15
+ return a(t), () => t.dispose();
16
+ }, [o, n]), /* @__PURE__ */ l(u.Provider, {
17
+ value: i,
18
+ children: r
19
+ });
20
+ }
21
+ function f() {
22
+ return o(u);
23
+ }
24
+ function p() {
25
+ let [e, n] = c(void 0);
26
+ return s(() => n(t()), []), e;
27
+ }
28
+ var m = /* @__PURE__ */ new WeakMap(), h = (e) => {
29
+ let t = m.get(e);
30
+ return t || m.set(e, t = {
31
+ frames: /* @__PURE__ */ new Map(),
32
+ peaks: /* @__PURE__ */ new Map(),
33
+ urls: []
34
+ }), t;
35
+ };
36
+ function g(e, t, n) {
37
+ let r = e.get(t);
38
+ return r || (r = n(), e.set(t, r), r.catch(() => e.delete(t))), r;
39
+ }
40
+ function _(e) {
41
+ let t = m.get(e);
42
+ t && (t.urls.forEach((e) => URL.revokeObjectURL(e)), m.delete(e));
43
+ }
44
+ function v(e, t) {
45
+ let n = h(t);
46
+ return n.info || (n.info = e.probe(t), n.info.catch(() => {
47
+ m.get(t) === n && (n.info = void 0);
48
+ })), n.info;
49
+ }
50
+ function y(e, t, { count: r = 24, height: a = 72 } = {}) {
51
+ let o = h(t);
52
+ return g(o.frames, `${r}@${a}`, async () => {
53
+ let s = await v(e, t);
54
+ if (!s.video) return [];
55
+ let c = (await n(e, t, {
56
+ times: i(s.duration, r),
57
+ height: a
58
+ })).map((e) => ({
59
+ time: e.time,
60
+ src: URL.createObjectURL(e.blob)
61
+ }));
62
+ return o.urls.push(...c.map((e) => e.src)), c;
63
+ });
64
+ }
65
+ function b(e, t, { rate: n = 50 } = {}) {
66
+ return g(h(t).peaks, n, async () => (await v(e, t)).audio ? r(e, t, { rate: n }) : null);
67
+ }
68
+ function x(e, t, n) {
69
+ let r = f(), [i, a] = c({});
70
+ return s(() => {
71
+ if (!r || !t) return;
72
+ let i = !0;
73
+ return e(r, t).then((e) => {
74
+ i && a({
75
+ blob: t,
76
+ key: n,
77
+ data: e
78
+ });
79
+ }, (e) => {
80
+ i && a({
81
+ blob: t,
82
+ key: n,
83
+ error: e instanceof Error ? e : Error(String(e))
84
+ });
85
+ }), () => {
86
+ i = !1;
87
+ };
88
+ }, [
89
+ r,
90
+ t,
91
+ n
92
+ ]), t ? i.blob !== t || i.key !== n ? { loading: !0 } : {
93
+ data: i.data,
94
+ error: i.error,
95
+ loading: !1
96
+ } : { loading: !1 };
97
+ }
98
+ function S(e) {
99
+ return x(v, e, "info");
100
+ }
101
+ function C(e, t = {}) {
102
+ let { count: n = 24, height: r = 72 } = t;
103
+ return x((e, t) => y(e, t, {
104
+ count: n,
105
+ height: r
106
+ }), e, `frames:${n}@${r}`);
107
+ }
108
+ function w(e, t = {}) {
109
+ let { rate: n = 50 } = t;
110
+ return x((e, t) => b(e, t, { rate: n }), e, `peaks:${n}`);
111
+ }
112
+ //#endregion
113
+ export { d as FfmpegProvider, y as mediaFrames, b as mediaPeaks, v as probeMedia, _ as releaseMedia, f as useFfmpeg, p as useFfmpegSupport, C as useMediaFrames, S as useMediaInfo, w as useMediaPeaks };
@@ -0,0 +1,47 @@
1
+ export type FontCategory = 'sans-serif' | 'serif' | 'display' | 'handwriting' | 'monospace';
2
+ /** The categories, in Google Fonts' order, with the labels a filter shows. */
3
+ export declare const FONT_CATEGORIES: readonly {
4
+ id: FontCategory;
5
+ label: string;
6
+ }[];
7
+ export interface GoogleFont {
8
+ family: string;
9
+ category: FontCategory;
10
+ /** Its weights, lightest first (every hundred in its range, for a variable font). */
11
+ weights: readonly number[];
12
+ /** A variable font: any weight in its range, not only the hundreds. */
13
+ variable: boolean;
14
+ italic: boolean;
15
+ }
16
+ /** The most popular Google Fonts families that cover Latin, most popular first. */
17
+ export declare const GOOGLE_FONTS: readonly GoogleFont[];
18
+ /** A family in the catalog, by name (any case). */
19
+ export declare const findGoogleFont: (family: string) => GoogleFont | undefined;
20
+ /** The CSS `font-family` for a family, or a stack of them (the first that loads wins): quoted, with a fallback of
21
+ the first one's kind. Nothing for no family (inherit). */
22
+ export declare function fontStack(family: string | readonly string[] | null | undefined, category?: FontCategory): string | undefined;
23
+ export interface GoogleFontOptions {
24
+ /** The weights to load (default: every weight the family has, which only costs the stylesheet: the browser
25
+ * downloads a face when text uses it). */
26
+ weights?: readonly number[];
27
+ /** Load the italics too (when the family has them). */
28
+ italic?: boolean;
29
+ /** Only the glyphs of this text: a tiny file, for drawing a sample such as the family's own name. */
30
+ text?: string;
31
+ }
32
+ /** The stylesheet URL for a family on the Google Fonts CSS API. */
33
+ export declare function googleFontsUrl(family: string, { weights, italic, text }?: GoogleFontOptions): string;
34
+ /**
35
+ * Loads a family from the Google Fonts CDN (once per family and options) and resolves true when its faces can be
36
+ * used, false when Google Fonts doesn't have it (or there's no network, or no document). A request for a style the
37
+ * family lacks (italics it doesn't have) falls back to the plain one.
38
+ */
39
+ export declare function loadGoogleFont(family: string, options?: GoogleFontOptions): Promise<boolean>;
40
+ export type GoogleFontStatus = 'idle' | 'loading' | 'ready' | 'missing';
41
+ /** Loads a family, or every family of a stack (see loadGoogleFont), and re-renders as that goes: `idle` with none,
42
+ `missing` when Google Fonts doesn't have one of them. */
43
+ export declare function useGoogleFontStatus(family: string | readonly string[] | null | undefined, options?: GoogleFontOptions): GoogleFontStatus;
44
+ /** Loads a family, or a stack of them (see loadGoogleFont), and re-renders when they're ready: true once their
45
+ faces can be used. */
46
+ export declare const useGoogleFont: (family: string | readonly string[] | null | undefined, options?: GoogleFontOptions) => boolean;
47
+ //# sourceMappingURL=google-fonts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-fonts.d.ts","sourceRoot":"","sources":["../../src/lib/google-fonts.ts"],"names":[],"mappings":"AAiBA,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC;AAE5F,8EAA8E;AAC9E,eAAO,MAAM,eAAe,EAAE,SAAS;IAAE,EAAE,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAMzE,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,YAAY,CAAC;IACvB,qFAAqF;IACrF,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACjB;AAUD,mFAAmF;AACnF,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAAiC,CAAC;AAIhF,mDAAmD;AACnD,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,KAAG,UAAU,GAAG,SAAsD,CAAC;AAapH;6DAC6D;AAC7D,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAI5H;AAED,MAAM,WAAW,iBAAiB;IAChC;+CAC2C;IAC3C,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qGAAqG;IACrG,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAID,mEAAmE;AACnE,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAE,iBAAsB,GAAG,MAAM,CAQxG;AAID;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC,CA6BhG;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAExE;4DAC4D;AAC5D,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,GAAE,iBAAsB,GAAG,gBAAgB,CAe5I;AAED;yBACyB;AACzB,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,UAAU,iBAAiB,KAAG,OACjE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const GOOGLE_FONT_ROWS: readonly (readonly [string, number, string, number])[];
2
+ //# sourceMappingURL=google-fonts.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-fonts.generated.d.ts","sourceRoot":"","sources":["../../src/lib/google-fonts.generated.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAiUlF,CAAC"}