@crewlethq/ui 0.35.1 → 0.36.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 (164) hide show
  1. package/README.md +73 -0
  2. package/dist/AgentHandoffPanel/AgentHandoffPanel.d.ts +99 -0
  3. package/dist/AgentHandoffPanel/index.d.ts +3 -0
  4. package/dist/AgentHandoffPanel/index.js +16 -0
  5. package/dist/AgentHandoffPanel-JWSW62GU.css +151 -0
  6. package/dist/ArrangeFrame/index.js +1 -1
  7. package/dist/{ArrangeFrame-3PLZAG22.css → ArrangeFrame-QXOQTFAH.css} +22 -5
  8. package/dist/ArrangeList/index.js +4 -3
  9. package/dist/ArtifactBar/ArtifactBar.d.ts +2 -1
  10. package/dist/ArtifactBar/index.js +2 -2
  11. package/dist/{ArtifactBar-HV5AT4RG.css → ArtifactBar-FWPBBKQ5.css} +8 -0
  12. package/dist/ArtifactCard/index.js +3 -3
  13. package/dist/ArtifactCover/index.js +3 -2
  14. package/dist/ArtifactKindIllustration/ArtifactKindIllustration.d.ts +16 -7
  15. package/dist/ArtifactKindIllustration/index.js +1 -1
  16. package/dist/{ArtifactKindIllustration-5FPRJQ3P.css → ArtifactKindIllustration-5KTP43QS.css} +36 -0
  17. package/dist/ArtifactMakeRow/ArtifactMakeRow.d.ts +39 -0
  18. package/dist/ArtifactMakeRow/index.d.ts +4 -0
  19. package/dist/ArtifactMakeRow/index.js +4 -0
  20. package/dist/ArtifactMakeRow-RWUTS5MC.css +167 -0
  21. package/dist/ArtifactPanel/ArtifactPanel.d.ts +8 -1
  22. package/dist/ArtifactPanel/index.js +1 -1
  23. package/dist/{ArtifactPanel-HW3SU7CP.css → ArtifactPanel-KKUUIPEU.css} +9 -0
  24. package/dist/AuthLayout/index.js +2 -2
  25. package/dist/AvatarPicker/index.js +2 -2
  26. package/dist/Canvas/index.js +2 -2
  27. package/dist/CanvasBoard/CanvasBoard.d.ts +27 -13
  28. package/dist/CanvasBoard/index.d.ts +1 -1
  29. package/dist/CanvasBoard/index.js +4 -4
  30. package/dist/{CanvasBoard-5NNSKY6A.css → CanvasBoard-TS4P356F.css} +13 -6
  31. package/dist/CanvasToolbar/index.js +3 -3
  32. package/dist/Card/index.js +1 -1
  33. package/dist/{Card-KJOYHDTJ.css → Card-QOVASQNU.css} +17 -12
  34. package/dist/Checkbox/index.js +3 -2
  35. package/dist/ChoiceButtons/index.js +1 -1
  36. package/dist/{ChoiceButtons-DJ5EOGUA.css → ChoiceButtons-FLIFXFFS.css} +10 -0
  37. package/dist/ChoiceList/index.js +1 -1
  38. package/dist/{ChoiceList-RBL7FNQL.css → ChoiceList-EA2W6MOS.css} +36 -5
  39. package/dist/Combobox/index.js +3 -2
  40. package/dist/CommandPalette/index.js +3 -2
  41. package/dist/CommentThread/index.js +6 -5
  42. package/dist/Composer/Composer.d.ts +4 -0
  43. package/dist/Composer/index.js +3 -2
  44. package/dist/{Composer-ABGJIAIR.css → Composer-PXITWNEK.css} +26 -15
  45. package/dist/ConfirmField/index.js +3 -2
  46. package/dist/DataTable/index.js +5 -4
  47. package/dist/DataView/index.js +9 -8
  48. package/dist/DatasetSource/DatasetSource.d.ts +4 -0
  49. package/dist/DatasetSource/index.js +1 -1
  50. package/dist/{DatasetSource-XFPZBRXL.css → DatasetSource-SMGX4PS5.css} +38 -4
  51. package/dist/DateTimePicker/index.js +2 -1
  52. package/dist/{DateTimePicker-HG2KQXQ6.css → DateTimePicker-2IVTKFV2.css} +15 -2
  53. package/dist/DocTabsEditor/index.js +4 -3
  54. package/dist/Document/Document.d.ts +15 -3
  55. package/dist/Document/index.js +2 -1
  56. package/dist/{Document-JUGCSQ4L.css → Document-YFWTWXJP.css} +34 -2
  57. package/dist/{Editor-BVQHBF7L.js → Editor-HORWMUM3.js} +2 -1
  58. package/dist/FilterChip/index.js +1 -1
  59. package/dist/{FilterChip-EZ4QMW4E.css → FilterChip-VL33P3JL.css} +5 -1
  60. package/dist/Input/index.js +2 -1
  61. package/dist/{Input-GBZSFXLU.css → Input-ABGOFENS.css} +46 -10
  62. package/dist/LayersList/index.js +1 -1
  63. package/dist/{LayersList-NQZEIPZB.css → LayersList-TBNF4XGL.css} +16 -3
  64. package/dist/LinkInterstitial/index.js +2 -2
  65. package/dist/ListInput/index.js +4 -3
  66. package/dist/LivePreview/LivePreview.d.ts +105 -25
  67. package/dist/LivePreview/budget.d.ts +64 -20
  68. package/dist/LivePreview/index.d.ts +5 -3
  69. package/dist/LivePreview/index.js +1 -1
  70. package/dist/LivePreview/stills.d.ts +57 -0
  71. package/dist/LivePreview-BROGKR4N.css +113 -0
  72. package/dist/PresenterView/index.js +2 -2
  73. package/dist/PrincipalPicker/index.js +4 -3
  74. package/dist/RichEditor/index.js +1 -1
  75. package/dist/Select/index.js +2 -1
  76. package/dist/{Select-A54YS5EP.css → Select-W3CHTZXP.css} +18 -2
  77. package/dist/ShareDialog/index.js +5 -4
  78. package/dist/SheetColumnEditor/index.js +6 -5
  79. package/dist/SheetGrid/index.js +4 -4
  80. package/dist/SlideCompare/index.js +2 -2
  81. package/dist/SlideFilmstrip/index.js +3 -3
  82. package/dist/{SlideFilmstrip-4ITZLMO4.css → SlideFilmstrip-PAT7P4OG.css} +26 -7
  83. package/dist/SlideGrid/index.js +2 -2
  84. package/dist/{SlideGrid-S4LTJ4UU.css → SlideGrid-FJA33DV4.css} +11 -1
  85. package/dist/SlideStage/index.js +1 -1
  86. package/dist/{SlideStage-S2FISF4C.css → SlideStage-ZTTEQSS2.css} +4 -2
  87. package/dist/SourceEditor/index.js +2 -1
  88. package/dist/{SourceEditor-G2C3STPX.css → SourceEditor-QAYE2JS6.css} +19 -12
  89. package/dist/Switcher/index.js +5 -4
  90. package/dist/TagsInput/index.js +3 -2
  91. package/dist/{TagsInput-XMXTI5Q4.css → TagsInput-7EGBBXHS.css} +7 -1
  92. package/dist/ThemeGallery/index.js +1 -1
  93. package/dist/{ThemeGallery-HSUKBDWY.css → ThemeGallery-X35Y25EX.css} +26 -5
  94. package/dist/TimeWindowPicker/index.js +4 -3
  95. package/dist/{TimeWindowPicker-T763GLXH.css → TimeWindowPicker-DEFDV77Z.css} +15 -2
  96. package/dist/TreeCanvas/index.js +3 -3
  97. package/dist/VersionTimeline/index.js +2 -2
  98. package/dist/{chunk-V43UVX4H.js → chunk-27GD7LVR.js} +1 -1
  99. package/dist/{chunk-CCLNGVCM.js → chunk-2DV4THNQ.js} +2 -2
  100. package/dist/{chunk-2CQLNML5.js → chunk-3PTUDKSR.js} +4 -2
  101. package/dist/{chunk-ONL54WMH.js → chunk-46RL3E54.js} +1 -1
  102. package/dist/{chunk-UHJQDFKQ.js → chunk-4ZJLOKSS.js} +1 -1
  103. package/dist/{chunk-ACA27MZH.js → chunk-5QXRI35B.js} +1 -1
  104. package/dist/{chunk-LL5AFXU7.js → chunk-5RT5O4JR.js} +1 -1
  105. package/dist/chunk-66ADEPFB.js +51 -0
  106. package/dist/{chunk-3Y56GQPM.js → chunk-7VAUGG6B.js} +1 -1
  107. package/dist/{chunk-NKZCJRKO.js → chunk-APDKUGSH.js} +2 -2
  108. package/dist/{chunk-YSJC7AZC.js → chunk-BWOIUOO3.js} +1 -1
  109. package/dist/{chunk-PI7HKLIT.js → chunk-D7GNNID2.js} +3 -1
  110. package/dist/{chunk-THROPJZC.js → chunk-DEMALFHY.js} +1 -1
  111. package/dist/chunk-EOQFPZEE.js +138 -0
  112. package/dist/{chunk-QFNWMWWY.js → chunk-ES4RKQ7B.js} +4 -4
  113. package/dist/{chunk-J6YZ4IYV.js → chunk-FG4O64DV.js} +3 -3
  114. package/dist/{chunk-E35CMI5D.js → chunk-FHHYXZSP.js} +31 -13
  115. package/dist/{chunk-AYB6AYNH.js → chunk-GMLAKNFY.js} +1 -1
  116. package/dist/{chunk-ZB5O3ELS.js → chunk-GRYZ5EP3.js} +4 -2
  117. package/dist/{chunk-ILAEBSLJ.js → chunk-H5NOLRGH.js} +2 -2
  118. package/dist/{chunk-W3UVOZKL.js → chunk-IPAU6FLH.js} +6 -2
  119. package/dist/{chunk-Z6VW6CXX.js → chunk-IQH3DDZ2.js} +2 -2
  120. package/dist/{chunk-6QFAK2WV.js → chunk-IUYUS2SO.js} +4 -1
  121. package/dist/{chunk-AXBRWRGV.js → chunk-JQLS3MZB.js} +1 -1
  122. package/dist/{chunk-FGYET26P.js → chunk-KJW2AS57.js} +1 -1
  123. package/dist/{chunk-QIXMNOBD.js → chunk-KYZMN6I6.js} +2 -2
  124. package/dist/{chunk-73A7D5CE.js → chunk-L4WZSVMT.js} +3 -1
  125. package/dist/{chunk-W7QBBKUE.js → chunk-MJW6SQYB.js} +7 -3
  126. package/dist/{chunk-GMU6SQ6B.js → chunk-MRMHZ437.js} +3 -3
  127. package/dist/{chunk-ULPL26BU.js → chunk-N5SKHIAP.js} +1 -1
  128. package/dist/{chunk-LV4APO72.js → chunk-NQGPD6NX.js} +1 -1
  129. package/dist/{chunk-7UYONN6K.js → chunk-OSZDHN5Z.js} +2 -2
  130. package/dist/chunk-P6WFZDKS.js +111 -0
  131. package/dist/{chunk-CPEPST4S.js → chunk-PJIPUEJ3.js} +1 -1
  132. package/dist/{chunk-QS4ZGTEU.js → chunk-PPFX6GRK.js} +1 -1
  133. package/dist/{chunk-7DZDSSJS.js → chunk-RH2NCQBZ.js} +5 -4
  134. package/dist/{chunk-3VD3G3IL.js → chunk-T5RQGI6O.js} +1 -1
  135. package/dist/{chunk-F2KY4RLI.js → chunk-TVRBQMIX.js} +5 -3
  136. package/dist/{chunk-QEFHYUCY.js → chunk-UWGUKMBK.js} +1 -1
  137. package/dist/{chunk-5YLON2PW.js → chunk-UYZZV4DZ.js} +1 -1
  138. package/dist/{chunk-BQ7AKL2N.js → chunk-VKKUGZ3G.js} +3 -1
  139. package/dist/{chunk-DEJHAOC5.js → chunk-WMXAX6VA.js} +1 -1
  140. package/dist/{chunk-6JVRY5DQ.js → chunk-WNAYQQ6Y.js} +2 -2
  141. package/dist/{chunk-VDPJGP4Q.js → chunk-WX2NIG4G.js} +1 -1
  142. package/dist/{chunk-ZU3DUXD2.js → chunk-WZGYIVYH.js} +1 -1
  143. package/dist/chunk-XGBLRDSU.js +446 -0
  144. package/dist/{chunk-22CQQDFW.js → chunk-XMRTFPWX.js} +2 -2
  145. package/dist/{chunk-HUVG2FFT.js → chunk-Y5BD4MTE.js} +4 -2
  146. package/dist/chunk-YSGLEHND.js +56 -0
  147. package/dist/generated/index.d.ts +2 -0
  148. package/dist/generated/index.js +95 -92
  149. package/dist/index.js +95 -92
  150. package/dist/styles.css +862 -130
  151. package/dist/utils/focusModality.d.ts +41 -0
  152. package/dist/utils/index.d.ts +2 -0
  153. package/dist/utils/index.js +2 -1
  154. package/package.json +3 -3
  155. package/dist/LivePreview-SRO7KHO4.css +0 -65
  156. package/dist/chunk-KF6YGL4B.js +0 -160
  157. package/dist/chunk-TYKQ33CL.js +0 -35
  158. package/dist/{chunk-3P4Y5RX6.js → chunk-4BYHAOHH.js} +1 -1
  159. package/dist/{chunk-3WCNHYXE.js → chunk-5BP6IS3N.js} +0 -0
  160. package/dist/{chunk-KD2IRYCT.js → chunk-5WDXPHEW.js} +1 -1
  161. package/dist/{chunk-OSFA5ROT.js → chunk-FEJANUZK.js} +0 -0
  162. package/dist/{chunk-FJJHD73S.js → chunk-GYBDPCRC.js} +1 -1
  163. package/dist/{chunk-VHZ3AXJD.js → chunk-NQCY44B3.js} +1 -1
  164. package/dist/{chunk-FF5OZV77.js → chunk-W3HYWD63.js} +2 -2
@@ -0,0 +1,41 @@
1
+ /**
2
+ * HOW THE READER LAST MOVED: by keyboard or by pointer, written on the root
3
+ * element as `data-crewlet-focus="keyboard" | "pointer"` so a stylesheet can
4
+ * tell the two apart where the platform cannot.
5
+ *
6
+ * WHY IT EXISTS. A text field matches `:focus-visible` on a pointer press as
7
+ * well as on a tab: the platform treats every caret as an indicator worth
8
+ * showing. That leaves a field two choices and both are wrong. Ringed for the
9
+ * keyboard (2px in the focus colour, the area WCAG 2.2's focus appearance asks
10
+ * for), a click into a title or a search box drew a heavy band round the one
11
+ * thing a reader was already looking at, and on a page of fields that band was
12
+ * the loudest thing on it. Ringed for the pointer (one quiet pixel), a reader
13
+ * tabbing through a form was given half the indicator they need. So a field
14
+ * draws the keyboard's ring by default and narrows it only where this
15
+ * attribute says the caret was put there by a pointer.
16
+ *
17
+ * THE DEFAULT IS THE KEYBOARD'S. A document that never tracks the modality
18
+ * keeps the full ring everywhere, which is the accessible failure mode: a
19
+ * missing call costs some calm, never a reader's indicator.
20
+ *
21
+ * WHAT COUNTS AS THE KEYBOARD: Tab from anywhere, and any key pressed while
22
+ * focus is NOT in a text-entry control (Enter on a link, the arrows in a
23
+ * radio group, Escape out of a menu), because those keys move focus. Typing
24
+ * inside a field does not, or the ring would widen under every character a
25
+ * reader typed into a field they clicked. A modifier on its own is neither.
26
+ *
27
+ * One listener set per document however many fields mount, counted, and taken
28
+ * down when the last one unmounts.
29
+ */
30
+ export type FocusModality = 'keyboard' | 'pointer';
31
+ export declare const FOCUS_MODALITY_ATTRIBUTE = "data-crewlet-focus";
32
+ /**
33
+ * Start tracking the modality on `doc`, and return the release. Safe to call
34
+ * any number of times: the listeners are installed once per document. An
35
+ * application may call it at boot, so the very first key a reader presses
36
+ * (Enter on the link that opened a page with a field already focused) is seen
37
+ * before any field has mounted.
38
+ */
39
+ export declare function trackFocusModality(doc?: Document): () => void;
40
+ /** Track the modality for as long as the calling component is mounted. */
41
+ export declare function useFocusModality(): void;
@@ -14,3 +14,5 @@ export { NODE_HUES, NODE_HUE_NAMES, isNodeHue } from './nodeHue.js';
14
14
  export type { NodeHue } from './nodeHue.js';
15
15
  export { HeadingLevelProvider, headingTag, nextHeadingLevel, useHeadingLevel } from './headingLevel.js';
16
16
  export type { HeadingLevel, HeadingLevelProviderProps } from './headingLevel.js';
17
+ export { FOCUS_MODALITY_ATTRIBUTE, trackFocusModality, useFocusModality } from './focusModality.js';
18
+ export type { FocusModality } from './focusModality.js';
@@ -1,7 +1,8 @@
1
- export { ElementToPngError, elementToPng, parseCsv, serializeElement, toCsv } from '../chunk-OSFA5ROT.js';
1
+ export { ElementToPngError, elementToPng, parseCsv, serializeElement, toCsv } from '../chunk-FEJANUZK.js';
2
2
  export { downloadBlob, downloadText, safeFilename, useDownload } from '../chunk-IW55G7XG.js';
3
3
  export { useClipboard, writeClipboard } from '../chunk-STJ7QBC3.js';
4
4
  export { useOutcome } from '../chunk-DTIW4CHZ.js';
5
5
  export { NODE_HUES, NODE_HUE_NAMES, isNodeHue } from '../chunk-AYKXMIOR.js';
6
+ export { FOCUS_MODALITY_ATTRIBUTE, trackFocusModality, useFocusModality } from '../chunk-YSGLEHND.js';
6
7
  export { HeadingLevelProvider, headingTag, nextHeadingLevel, useHeadingLevel } from '../chunk-PQADV6P6.js';
7
8
  export { cx } from '../chunk-ODEQTPFM.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewlethq/ui",
3
- "version": "0.35.1",
3
+ "version": "0.36.0",
4
4
  "description": "Crewlet shared React components built on @crewlethq/tokens and @crewlethq/icons.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -42,8 +42,8 @@
42
42
  "clean": "rm -rf dist src/generated"
43
43
  },
44
44
  "dependencies": {
45
- "@crewlethq/icons": "0.35.1",
46
- "@crewlethq/tokens": "0.35.1",
45
+ "@crewlethq/icons": "0.36.0",
46
+ "@crewlethq/tokens": "0.36.0",
47
47
  "prosemirror-commands": "1.7.2",
48
48
  "prosemirror-gapcursor": "1.4.1",
49
49
  "prosemirror-history": "1.5.1",
@@ -1,65 +0,0 @@
1
- /*
2
- * A live preview: the stand-in and the live layer stacked in one box. The box
3
- * takes its size from its parent (a card's preview area), so it fills it and
4
- * clips whatever the content lays out past its edge.
5
- */
6
-
7
- .crewlet-live-preview {
8
- position: relative;
9
- display: block;
10
- width: 100%;
11
- height: 100%;
12
- overflow: hidden;
13
- contain: layout paint;
14
- }
15
-
16
- .crewlet-live-preview__fallback {
17
- position: absolute;
18
- inset: 0;
19
- display: flex;
20
- transition: opacity var(--motion-duration-base) var(--motion-easing-out);
21
- }
22
-
23
- .crewlet-live-preview__live {
24
- position: absolute;
25
- inset: 0;
26
- display: block;
27
- overflow: hidden;
28
- opacity: 0;
29
- pointer-events: none;
30
- user-select: none;
31
- transition: opacity var(--motion-duration-base) var(--motion-easing-out);
32
- }
33
-
34
- /* LAID OUT AT ITS OWN SIZE from the top left corner, and scaled from there:
35
- to the box's width, its top left the box's, or whole and centred. */
36
- .crewlet-preview-scale {
37
- position: absolute;
38
- inset: 0;
39
- display: block;
40
- overflow: hidden;
41
- }
42
-
43
- .crewlet-preview-scale__layer {
44
- position: absolute;
45
- top: 0;
46
- left: 0;
47
- display: block;
48
- overflow: hidden;
49
- transform-origin: 0 0;
50
- }
51
-
52
- .crewlet-live-preview[data-state='ready'] > .crewlet-live-preview__live {
53
- opacity: 1;
54
- }
55
-
56
- .crewlet-live-preview[data-state='ready'] > .crewlet-live-preview__fallback {
57
- opacity: 0;
58
- }
59
-
60
- @media (prefers-reduced-motion: reduce) {
61
- .crewlet-live-preview__fallback,
62
- .crewlet-live-preview__live {
63
- transition: none;
64
- }
65
- }
@@ -1,160 +0,0 @@
1
- import { cx } from './chunk-ODEQTPFM.js';
2
- import './LivePreview-SRO7KHO4.css';
3
- import { createContext, useMemo, useContext, useRef, useState, useEffect, useLayoutEffect } from 'react';
4
- import { jsx, jsxs } from 'react/jsx-runtime';
5
-
6
- // src/LivePreview/budget.ts
7
- var LIVE_PREVIEW_MAX = 12;
8
- var immediately = (run) => {
9
- run();
10
- return () => {
11
- };
12
- };
13
- var perFrame = (run) => {
14
- if (typeof requestAnimationFrame === "undefined") return immediately(run);
15
- let timer;
16
- const frame = requestAnimationFrame(() => {
17
- timer = setTimeout(run, 0);
18
- });
19
- return () => {
20
- cancelAnimationFrame(frame);
21
- if (timer !== void 0) clearTimeout(timer);
22
- };
23
- };
24
- function createLivePreviewBudget(max = LIVE_PREVIEW_MAX, schedule = immediately) {
25
- const held = /* @__PURE__ */ new Set();
26
- const queue = [];
27
- let pending = null;
28
- const next = () => {
29
- if (pending || held.size >= max || queue.length === 0) return;
30
- let ran = false;
31
- const cancel = schedule(() => {
32
- ran = true;
33
- pending = null;
34
- const ask = queue.shift();
35
- if (ask && held.size < max) {
36
- held.add(ask.ticket);
37
- ask.grant();
38
- } else if (ask) {
39
- queue.unshift(ask);
40
- }
41
- next();
42
- });
43
- if (!ran) pending = cancel;
44
- };
45
- return {
46
- max,
47
- request(grant) {
48
- const ticket = {};
49
- queue.push({ ticket, grant });
50
- next();
51
- let done = false;
52
- return () => {
53
- if (done) return;
54
- done = true;
55
- if (held.delete(ticket)) {
56
- next();
57
- return;
58
- }
59
- const at = queue.findIndex((a) => a.ticket === ticket);
60
- if (at >= 0) queue.splice(at, 1);
61
- if (queue.length === 0 && pending) {
62
- pending();
63
- pending = null;
64
- }
65
- };
66
- },
67
- live: () => held.size,
68
- waiting: () => queue.length
69
- };
70
- }
71
- var LIVE_PREVIEW_DWELL_MS = 120;
72
- var DefaultBudget = createLivePreviewBudget(LIVE_PREVIEW_MAX, perFrame);
73
- var BudgetContext = createContext(DefaultBudget);
74
- function LivePreviewBudgetProvider({ max = LIVE_PREVIEW_MAX, children }) {
75
- const budget = useMemo(() => createLivePreviewBudget(max, perFrame), [max]);
76
- return /* @__PURE__ */ jsx(BudgetContext.Provider, { value: budget, children });
77
- }
78
- var NOOP = { ready: () => {
79
- }, fail: () => {
80
- } };
81
- var SignalContext = createContext(NOOP);
82
- function useLivePreview() {
83
- return useContext(SignalContext);
84
- }
85
- function LivePreview({ children, fallback, width, rootMargin = "200px 0px", disabled = false, dwellMs = LIVE_PREVIEW_DWELL_MS, onStateChange, className }) {
86
- const budget = useContext(BudgetContext);
87
- const box = useRef(null);
88
- const [near, setNear] = useState(false);
89
- const [state, setState] = useState("idle");
90
- const [failed, setFailed] = useState(false);
91
- useEffect(() => {
92
- const el = box.current;
93
- if (!el || disabled || typeof IntersectionObserver === "undefined") return void 0;
94
- const seen = new IntersectionObserver((entries) => setNear(entries.some((e) => e.isIntersecting)), { rootMargin });
95
- seen.observe(el);
96
- return () => seen.disconnect();
97
- }, [disabled, rootMargin]);
98
- useEffect(() => {
99
- if (!near || disabled || failed) {
100
- setState(failed ? "failed" : "idle");
101
- return void 0;
102
- }
103
- setState("waiting");
104
- let granted = false;
105
- let giveBack = () => {
106
- };
107
- const dwell = setTimeout(() => {
108
- giveBack = budget.request(() => {
109
- granted = true;
110
- setState("live");
111
- });
112
- }, dwellMs);
113
- return () => {
114
- clearTimeout(dwell);
115
- giveBack();
116
- if (granted) setState("idle");
117
- };
118
- }, [near, disabled, failed, budget, dwellMs]);
119
- useEffect(() => onStateChange?.(state), [state, onStateChange]);
120
- const mounted = state === "live" || state === "ready";
121
- const signals = useMemo(
122
- () => ({
123
- ready: () => setState((s) => s === "live" ? "ready" : s),
124
- fail: () => setFailed(true)
125
- }),
126
- []
127
- );
128
- return /* @__PURE__ */ jsxs("span", { ref: box, className: cx("crewlet-live-preview", className), "data-state": state, "aria-hidden": "true", children: [
129
- /* @__PURE__ */ jsx("span", { className: "crewlet-live-preview__fallback", children: fallback }),
130
- mounted ? /* @__PURE__ */ jsx("span", { className: "crewlet-live-preview__live", inert: true, children: /* @__PURE__ */ jsx(SignalContext.Provider, { value: signals, children: width === void 0 ? children : /* @__PURE__ */ jsx(PreviewScale, { width, children }) }) }) : null
131
- ] });
132
- }
133
- function PreviewScale({ children, width, height, fit = "width" }) {
134
- const box = useRef(null);
135
- const [size, setSize] = useState(null);
136
- useLayoutEffect(() => {
137
- const el = box.current;
138
- if (!el) return void 0;
139
- const measure = () => {
140
- const rect = el.getBoundingClientRect();
141
- if (rect.width > 0) setSize((was) => was && was.w === rect.width && was.h === rect.height ? was : { w: rect.width, h: rect.height });
142
- };
143
- measure();
144
- if (typeof ResizeObserver === "undefined") return void 0;
145
- const watch = new ResizeObserver(measure);
146
- watch.observe(el);
147
- return () => watch.disconnect();
148
- }, []);
149
- let layer = { width, visibility: "hidden" };
150
- if (size) {
151
- const k = fit === "contain" && height ? Math.min(size.w / width, size.h / height) : size.w / width;
152
- const h = height ?? size.h / k;
153
- const left = fit === "contain" ? (size.w - width * k) / 2 : 0;
154
- const top = fit === "contain" ? (size.h - h * k) / 2 : 0;
155
- layer = { width, height: h, transform: `translate(${left}px, ${top}px) scale(${k})` };
156
- }
157
- return /* @__PURE__ */ jsx("span", { ref: box, className: "crewlet-preview-scale", children: /* @__PURE__ */ jsx("span", { className: "crewlet-preview-scale__layer", style: layer, children }) });
158
- }
159
-
160
- export { LIVE_PREVIEW_DWELL_MS, LIVE_PREVIEW_MAX, LivePreview, LivePreviewBudgetProvider, PreviewScale, createLivePreviewBudget, immediately, perFrame, useLivePreview };
@@ -1,35 +0,0 @@
1
- import { cx } from './chunk-ODEQTPFM.js';
2
- import './Document-JUGCSQ4L.css';
3
- import { jsx } from 'react/jsx-runtime';
4
-
5
- function Document({ as: Tag = "div", size = "md", measure = "normal", className, children, ...rest }) {
6
- return /* @__PURE__ */ jsx(
7
- Tag,
8
- {
9
- ...rest,
10
- className: cx(
11
- "crewlet-document",
12
- `crewlet-document--${size}`,
13
- measure === "normal" && "crewlet-document--measure",
14
- className
15
- ),
16
- children
17
- }
18
- );
19
- }
20
- function DocumentTitle({ as: Tag = "h1", className, children, ...rest }) {
21
- return /* @__PURE__ */ jsx(Tag, { ...rest, className: cx("crewlet-document-title", className), children });
22
- }
23
- function DocumentTitleField({ error = false, className, ...rest }) {
24
- return /* @__PURE__ */ jsx(
25
- "input",
26
- {
27
- ...rest,
28
- type: "text",
29
- "aria-invalid": error || void 0,
30
- className: cx("crewlet-document-title", "crewlet-document-title-field", className)
31
- }
32
- );
33
- }
34
-
35
- export { Document, DocumentTitle, DocumentTitleField };
@@ -1,6 +1,6 @@
1
1
  import { LayerNodeBridge } from './chunk-LM3ISVJA.js';
2
- import { Kbd } from './chunk-SMBKXWML.js';
3
2
  import { Tooltip } from './chunk-6ZJ3N7QI.js';
3
+ import { Kbd } from './chunk-SMBKXWML.js';
4
4
  import { LAYER_REPOSITION_EVENT, LayerHost } from './chunk-OMV5W53A.js';
5
5
  import { Button } from './chunk-OG6CL3EB.js';
6
6
  import { IconButton } from './chunk-4FQT6ZAY.js';
File without changes
@@ -1,5 +1,5 @@
1
- import { InlineCode } from './chunk-5CLW2CXT.js';
2
1
  import { ConfirmModal } from './chunk-XEGZHHRH.js';
2
+ import { InlineCode } from './chunk-5CLW2CXT.js';
3
3
  import { Callout } from './chunk-SZZRIHGT.js';
4
4
  import './LinkInterstitial-ET4MSVSV.css';
5
5
  import { jsx, jsxs } from 'react/jsx-runtime';
File without changes
@@ -1,7 +1,7 @@
1
1
  import { HuePicker } from './chunk-SUXP4OBT.js';
2
2
  import { Popover } from './chunk-K3IJQNB7.js';
3
- import { CharacterPicker } from './chunk-YEVG2X5R.js';
4
3
  import { NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
4
+ import { CharacterPicker } from './chunk-YEVG2X5R.js';
5
5
  import { Avatar } from './chunk-PZKHBB7D.js';
6
6
  import { cx } from './chunk-ODEQTPFM.js';
7
7
  import './AvatarPicker-PREY36MG.css';
@@ -1,6 +1,6 @@
1
- import { Timeline } from './chunk-AUQPBL4O.js';
2
1
  import { PrincipalAvatar } from './chunk-CI3VPIJN.js';
3
2
  import { RelativeTime } from './chunk-3CZ7XAVY.js';
3
+ import { Timeline } from './chunk-AUQPBL4O.js';
4
4
  import { Button } from './chunk-OG6CL3EB.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
6
6
  import './VersionTimeline-6KRXEEOO.css';
@@ -1,8 +1,8 @@
1
1
  import { TagGroup } from './chunk-O2EGEONV.js';
2
- import { Tag } from './chunk-GFV4LJHH.js';
3
- import { StatusDot } from './chunk-WIATRXEJ.js';
4
2
  import { CursorFlag } from './chunk-3BYIWOTV.js';
5
3
  import { presenceHueClass } from './chunk-I6POAB4V.js';
4
+ import { Tag } from './chunk-GFV4LJHH.js';
5
+ import { StatusDot } from './chunk-WIATRXEJ.js';
6
6
  import { ChangeMark } from './chunk-47JQAGRV.js';
7
7
  import { isEmptyValue, displayText, ratingMax, findPerson, findOption, statusTone, editText, textMax, sheetLabels, normalizeValue, sameValue, spokenText, drawnColumns, fitSamples, fittedWidth, columnWidth, SHEET_COLUMN_BOUNDS, sortRows, SHEET_ROW_HEIGHT, cellKey, columnOffsets, SHEET_ROW_NUMBER_WIDTH, rangeOf, presenceByCell, presenceByRow, presenceByColumn, scrollToRow, planClear, visibleRows, cellDescription, nextSort, rowName, inRange, hasPrevious, flagText, toTSV, planPaste, parseTSV, isMod, moveFrom, isTypingKey, editorSide, optionHue, parseText, liveOptions, checkValue } from './chunk-LFSIKGRQ.js';
8
8
  import { presenceLabels } from './chunk-Z7JYG5TF.js';