cursedbelt 5.96.0 → 5.97.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/react/components/AppShell.js +6 -1
- package/dist/react/components/AppShell.js.map +1 -1
- package/dist/react/components/ConfirmDialog.d.ts.map +1 -1
- package/dist/react/components/ConfirmDialog.js +1 -1
- package/dist/react/components/ConfirmDialog.js.map +1 -1
- package/dist/react/components/PaneSplit.d.ts +11 -2
- package/dist/react/components/PaneSplit.d.ts.map +1 -1
- package/dist/react/components/PaneSplit.js +12 -11
- package/dist/react/components/PaneSplit.js.map +1 -1
- package/dist/react/components/PanelGrid.d.ts +14 -8
- package/dist/react/components/PanelGrid.d.ts.map +1 -1
- package/dist/react/components/PanelGrid.js +10 -3
- package/dist/react/components/PanelGrid.js.map +1 -1
- package/dist/react/components/SplitPane.d.ts +3 -9
- package/dist/react/components/SplitPane.d.ts.map +1 -1
- package/dist/react/components/SplitPane.js +0 -3
- package/dist/react/components/SplitPane.js.map +1 -1
- package/dist/react/components/TagsEditor.d.ts +15 -0
- package/dist/react/components/TagsEditor.d.ts.map +1 -0
- package/dist/react/components/TagsEditor.js +93 -0
- package/dist/react/components/TagsEditor.js.map +1 -0
- package/dist/react/components/TagsPromptDialog.d.ts +25 -0
- package/dist/react/components/TagsPromptDialog.d.ts.map +1 -0
- package/dist/react/components/TagsPromptDialog.js +38 -0
- package/dist/react/components/TagsPromptDialog.js.map +1 -0
- package/dist/react/components/paneSplit.css +8 -0
- package/dist/react/file-tree/FolderViewMenus.d.ts.map +1 -1
- package/dist/react/file-tree/FolderViewMenus.js +2 -0
- package/dist/react/file-tree/FolderViewMenus.js.map +1 -1
- package/dist/react/file-tree/useFolderView.d.ts +11 -1
- package/dist/react/file-tree/useFolderView.d.ts.map +1 -1
- package/dist/react/file-tree/useFolderView.js +3 -2
- package/dist/react/file-tree/useFolderView.js.map +1 -1
- package/dist/react/filter-rail/railResize.d.ts +16 -5
- package/dist/react/filter-rail/railResize.d.ts.map +1 -1
- package/dist/react/filter-rail/railResize.js +27 -9
- package/dist/react/filter-rail/railResize.js.map +1 -1
- package/dist/react/filter-rail/railWidth.d.ts +10 -5
- package/dist/react/filter-rail/railWidth.d.ts.map +1 -1
- package/dist/react/filter-rail/railWidth.js +13 -8
- package/dist/react/filter-rail/railWidth.js.map +1 -1
- package/dist/react/hooks/longPressContextMenu.d.ts +10 -1
- package/dist/react/hooks/longPressContextMenu.d.ts.map +1 -1
- package/dist/react/hooks/longPressContextMenu.js +37 -3
- package/dist/react/hooks/longPressContextMenu.js.map +1 -1
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +4 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/lib/paneReach.d.ts +36 -0
- package/dist/react/lib/paneReach.d.ts.map +1 -0
- package/dist/react/lib/paneReach.js +72 -0
- package/dist/react/lib/paneReach.js.map +1 -0
- package/dist/react/lib/tagList.d.ts +16 -0
- package/dist/react/lib/tagList.d.ts.map +1 -0
- package/dist/react/lib/tagList.js +30 -0
- package/dist/react/lib/tagList.js.map +1 -0
- package/dist/react/master-detail/MasterDetail.d.ts +6 -3
- package/dist/react/master-detail/MasterDetail.d.ts.map +1 -1
- package/dist/react/master-detail/MasterDetail.js +3 -2
- package/dist/react/master-detail/MasterDetail.js.map +1 -1
- package/dist/react/media/FocusViewer.d.ts +8 -1
- package/dist/react/media/FocusViewer.d.ts.map +1 -1
- package/dist/react/media/FocusViewer.js +10 -1
- package/dist/react/media/FocusViewer.js.map +1 -1
- package/dist/react/media/FrameGrabber.d.ts +3 -1
- package/dist/react/media/FrameGrabber.d.ts.map +1 -1
- package/dist/react/media/FrameGrabber.js +10 -5
- package/dist/react/media/FrameGrabber.js.map +1 -1
- package/dist/react/media/VideoChapterEditor.d.ts +3 -1
- package/dist/react/media/VideoChapterEditor.d.ts.map +1 -1
- package/dist/react/media/VideoChapterEditor.js +14 -6
- package/dist/react/media/VideoChapterEditor.js.map +1 -1
- package/dist/react/media/VideoCutEditor.d.ts +3 -1
- package/dist/react/media/VideoCutEditor.d.ts.map +1 -1
- package/dist/react/media/VideoCutEditor.js +14 -6
- package/dist/react/media/VideoCutEditor.js.map +1 -1
- package/dist/react/media/VideoTurner.d.ts +3 -1
- package/dist/react/media/VideoTurner.d.ts.map +1 -1
- package/dist/react/media/VideoTurner.js +13 -5
- package/dist/react/media/VideoTurner.js.map +1 -1
- package/dist/react/media/hlsSource.d.ts +27 -0
- package/dist/react/media/hlsSource.d.ts.map +1 -1
- package/dist/react/media/hlsSource.js +39 -0
- package/dist/react/media/hlsSource.js.map +1 -1
- package/dist/react/media/videoEnhance.d.ts +1 -1
- package/dist/react/media/videoEnhance.js +1 -1
- package/dist/react/media-gallery/MediaGallery.d.ts.map +1 -1
- package/dist/react/media-gallery/MediaGallery.js +4 -4
- package/dist/react/media-gallery/MediaGallery.js.map +1 -1
- package/dist/react/tagsPrompt.d.ts +15 -0
- package/dist/react/tagsPrompt.d.ts.map +1 -0
- package/dist/react/tagsPrompt.js +30 -0
- package/dist/react/tagsPrompt.js.map +1 -0
- package/dist/scripts/guardrailsEnforce.d.ts.map +1 -1
- package/dist/styles-areas/fields.css +4 -4
- package/dist/styles-areas/overlays.css +3 -2
- package/dist/styles-utilities.css +7 -0
- package/dist/testing/phoneRules.js +3 -3
- package/dist/testing/phoneRules.js.map +1 -1
- package/dist/theme.css +13 -0
- package/package.json +8 -1
- package/scripts/guardrailsEnforce.spec.ts +25 -0
- package/scripts/guardrailsEnforce.ts +61 -0
- package/scripts/styleAreas.ts +5 -0
- package/src/looks.spec.ts +34 -0
- package/src/react/components/AppShell.spec.tsx +23 -0
- package/src/react/components/AppShell.tsx +6 -1
- package/src/react/components/ConfirmDialog.spec.tsx +41 -0
- package/src/react/components/ConfirmDialog.tsx +12 -2
- package/src/react/components/PaneSplit.spec.tsx +26 -3
- package/src/react/components/PaneSplit.tsx +26 -13
- package/src/react/components/PanelGrid.tsx +16 -11
- package/src/react/components/SplitPane.spec.tsx +10 -5
- package/src/react/components/SplitPane.tsx +3 -12
- package/src/react/components/TagsEditor.tsx +140 -0
- package/src/react/components/TagsPromptDialog.spec.tsx +74 -0
- package/src/react/components/TagsPromptDialog.tsx +108 -0
- package/src/react/components/paneSplit.css +8 -0
- package/src/react/file-tree/FolderViewMenus.tsx +1 -0
- package/src/react/file-tree/folderViewTree.spec.tsx +15 -0
- package/src/react/file-tree/useFolderView.ts +13 -2
- package/src/react/filter-rail/FilterRail.spec.tsx +7 -3
- package/src/react/filter-rail/railResize.spec.tsx +27 -5
- package/src/react/filter-rail/railResize.tsx +46 -15
- package/src/react/filter-rail/railWidth.ts +13 -8
- package/src/react/hooks/longPressContextMenu.spec.ts +50 -0
- package/src/react/hooks/longPressContextMenu.ts +39 -3
- package/src/react/index.ts +4 -0
- package/src/react/lib/paneReach.spec.ts +58 -0
- package/src/react/lib/paneReach.ts +65 -0
- package/src/react/lib/tagList.spec.ts +19 -0
- package/src/react/lib/tagList.ts +29 -0
- package/src/react/master-detail/MasterDetail.tsx +10 -5
- package/src/react/media/FocusViewer.spec.tsx +19 -0
- package/src/react/media/FocusViewer.tsx +17 -0
- package/src/react/media/FrameGrabber.tsx +12 -5
- package/src/react/media/VideoChapterEditor.tsx +16 -6
- package/src/react/media/VideoCutEditor.tsx +17 -6
- package/src/react/media/VideoTurner.tsx +14 -5
- package/src/react/media/editorVideoSource.spec.tsx +71 -0
- package/src/react/media/hlsSource.ts +43 -0
- package/src/react/media/videoEnhance.ts +1 -1
- package/src/react/media-gallery/MediaGallery.tsx +4 -0
- package/src/react/tagsPrompt.tsx +33 -0
- package/src/styles-areas/fields.css +4 -4
- package/src/styles-areas/overlays.css +3 -2
- package/src/styles-utilities.css +7 -0
- package/src/testing/phoneRules.ts +2 -2
- package/src/theme.css +13 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './videoCutEditor.css';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { useEditorVideoSource } from './hlsSource.js';
|
|
3
4
|
import { Scissors, X } from 'lucide-react';
|
|
4
5
|
import { ActionBar } from '../components/ActionBar.js';
|
|
5
6
|
import { Button } from '../components/Button.js';
|
|
@@ -86,6 +87,8 @@ export interface VideoCutEditorProps {
|
|
|
86
87
|
* black screen"* report, in a different dialog. An empty string here is now a stated reason.
|
|
87
88
|
*/
|
|
88
89
|
src: string;
|
|
90
|
+
/** The adaptive ladder's master playlist — a source on its own (`useEditorVideoSource`). */
|
|
91
|
+
hlsUrl?: string | undefined;
|
|
89
92
|
/** Shown until the first frame decodes — a black box reads as a broken player. */
|
|
90
93
|
posterUrl?: string;
|
|
91
94
|
/**
|
|
@@ -117,6 +120,7 @@ export interface VideoCutEditorProps {
|
|
|
117
120
|
|
|
118
121
|
export function VideoCutEditor({
|
|
119
122
|
src,
|
|
123
|
+
hlsUrl,
|
|
120
124
|
posterUrl,
|
|
121
125
|
resolving = false,
|
|
122
126
|
name,
|
|
@@ -150,11 +154,12 @@ export function VideoCutEditor({
|
|
|
150
154
|
*/
|
|
151
155
|
const cannotShow: string | null = resolving
|
|
152
156
|
? 'Finding this film…'
|
|
153
|
-
: !src
|
|
157
|
+
: !src && !hlsUrl
|
|
154
158
|
? 'This file has no video source to play here, so there is nothing to mark up. Nothing has been sent.'
|
|
155
|
-
: failedSrc === src
|
|
159
|
+
: failedSrc === (hlsUrl || src)
|
|
156
160
|
? 'The film could not be loaded, so there is nothing to mark up. Nothing has been sent.'
|
|
157
161
|
: null;
|
|
162
|
+
const source = useEditorVideoSource(videoRef, { src, hlsUrl }, cannotShow === null);
|
|
158
163
|
|
|
159
164
|
const segments = React.useMemo(() => planSegments(plan, duration), [plan, duration]);
|
|
160
165
|
const cuts = React.useMemo(() => planCuts(plan, duration), [plan, duration]);
|
|
@@ -292,8 +297,8 @@ export function VideoCutEditor({
|
|
|
292
297
|
ref={videoRef}
|
|
293
298
|
className='cbvc-video'
|
|
294
299
|
// A new source is a new attempt — see `failedSrc`.
|
|
295
|
-
key={
|
|
296
|
-
src={src}
|
|
300
|
+
key={source.key}
|
|
301
|
+
src={source.src}
|
|
297
302
|
poster={posterUrl}
|
|
298
303
|
controls
|
|
299
304
|
playsInline
|
|
@@ -305,7 +310,9 @@ export function VideoCutEditor({
|
|
|
305
310
|
}}
|
|
306
311
|
onTimeUpdate={(event) => setPlayhead(event.currentTarget.currentTime)}
|
|
307
312
|
onSeeked={(event) => setPlayhead(event.currentTarget.currentTime)}
|
|
308
|
-
onError={() =>
|
|
313
|
+
onError={(event) => {
|
|
314
|
+
if (source.exhausted(event.currentTarget)) setFailedSrc(source.key);
|
|
315
|
+
}}
|
|
309
316
|
/>
|
|
310
317
|
) : (
|
|
311
318
|
/* In the film's own place and at its own size — a sentence under a black rectangle
|
|
@@ -412,8 +419,12 @@ export function VideoCutEditor({
|
|
|
412
419
|
? ' — nothing marked for removal yet'
|
|
413
420
|
: ''}
|
|
414
421
|
</>
|
|
415
|
-
) : (
|
|
422
|
+
) : cannotShow === null ? (
|
|
416
423
|
'Reading the clip…'
|
|
424
|
+
) : (
|
|
425
|
+
// 🔴 Only a mounted film is being read. With none, this said "Reading the clip…"
|
|
426
|
+
// forever beside the reason there was nothing to read (owner, 2026-10-27).
|
|
427
|
+
'Its length is not known.'
|
|
417
428
|
)}
|
|
418
429
|
</p>
|
|
419
430
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './pictureEditor.css';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { useEditorVideoSource } from './hlsSource.js';
|
|
3
4
|
import { ActionBar } from '../components/ActionBar.js';
|
|
4
5
|
import { Button } from '../components/Button.js';
|
|
5
6
|
import { Modal } from '../components/Modal.js';
|
|
@@ -24,6 +25,8 @@ export interface VideoTurnerProps {
|
|
|
24
25
|
* than a black rectangle, but it is still nothing to preview.
|
|
25
26
|
*/
|
|
26
27
|
src: string;
|
|
28
|
+
/** The adaptive ladder's master playlist — a source on its own (`useEditorVideoSource`). */
|
|
29
|
+
hlsUrl?: string | undefined;
|
|
27
30
|
/** Shown until the first frame decodes — a black box reads as a broken player. */
|
|
28
31
|
posterUrl?: string;
|
|
29
32
|
/**
|
|
@@ -62,6 +65,7 @@ export interface VideoTurnerProps {
|
|
|
62
65
|
*/
|
|
63
66
|
export function VideoTurner({
|
|
64
67
|
src,
|
|
68
|
+
hlsUrl,
|
|
65
69
|
posterUrl,
|
|
66
70
|
resolving = false,
|
|
67
71
|
name,
|
|
@@ -99,11 +103,13 @@ export function VideoTurner({
|
|
|
99
103
|
*/
|
|
100
104
|
const cannotShow: string | null = resolving
|
|
101
105
|
? 'Finding this film…'
|
|
102
|
-
: !src
|
|
106
|
+
: !src && !hlsUrl
|
|
103
107
|
? 'This file has no video source to play here, so there is nothing to preview. The turn is stored beside the film rather than encoded into it, so you can still set it and save.'
|
|
104
|
-
: failedSrc === src
|
|
108
|
+
: failedSrc === (hlsUrl || src)
|
|
105
109
|
? 'The film could not be loaded, so there is nothing to preview. The turn is stored beside the film rather than encoded into it, so you can still set it and save.'
|
|
106
110
|
: null;
|
|
111
|
+
const videoRef = React.useRef<HTMLVideoElement>(null);
|
|
112
|
+
const source = useEditorVideoSource(videoRef, { src, hlsUrl }, cannotShow === null);
|
|
107
113
|
// A poster is the next best picture of the film, and it turns with the same transform — so a
|
|
108
114
|
// clip that will not play is still something to aim a turn at rather than a blank panel.
|
|
109
115
|
const posterStandsIn = cannotShow !== null && !resolving && Boolean(posterUrl);
|
|
@@ -173,8 +179,9 @@ export function VideoTurner({
|
|
|
173
179
|
{cannotShow === null ? (
|
|
174
180
|
<video
|
|
175
181
|
// A new source is a new attempt — see `failedSrc`.
|
|
176
|
-
|
|
177
|
-
|
|
182
|
+
ref={videoRef}
|
|
183
|
+
key={source.key}
|
|
184
|
+
src={source.src}
|
|
178
185
|
poster={posterUrl}
|
|
179
186
|
muted
|
|
180
187
|
loop
|
|
@@ -185,7 +192,9 @@ export function VideoTurner({
|
|
|
185
192
|
// decoded and nothing drawn until something pressed play, which is a black frame
|
|
186
193
|
// wearing the same face as a broken source.
|
|
187
194
|
preload='metadata'
|
|
188
|
-
onError={() =>
|
|
195
|
+
onError={(event) => {
|
|
196
|
+
if (source.exhausted(event.currentTarget)) setFailedSrc(source.key);
|
|
197
|
+
}}
|
|
189
198
|
style={{ transform: previewTransform(edit) }}
|
|
190
199
|
/>
|
|
191
200
|
) : posterStandsIn ? (
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🔴 A ladder ALONE is a source, in every editing dialog (owner, 2026-10-27).
|
|
3
|
+
*
|
|
4
|
+
* Collections offers a healthy film ONLY as `hlsUrl` — its progressive copy is released against
|
|
5
|
+
* the ladder — and the cut editor, the chapter editor, the turner and the frame grabber read
|
|
6
|
+
* nothing but `src`. So trimming a film the stage was playing said *"This file has no video
|
|
7
|
+
* source to play here, so there is nothing to mark up"*. Each dialog is mounted here exactly as
|
|
8
|
+
* the gallery mounts it for such a film: an empty `src` beside a master playlist.
|
|
9
|
+
*/
|
|
10
|
+
import { afterEach, describe, expect, test } from 'bun:test';
|
|
11
|
+
import { cleanup, fireEvent, render } from '@testing-library/react';
|
|
12
|
+
import type React from 'react';
|
|
13
|
+
import { FrameGrabber } from './FrameGrabber.js';
|
|
14
|
+
import { VideoChapterEditor } from './VideoChapterEditor.js';
|
|
15
|
+
import { VideoCutEditor } from './VideoCutEditor.js';
|
|
16
|
+
import { VideoTurner } from './VideoTurner.js';
|
|
17
|
+
|
|
18
|
+
afterEach(cleanup);
|
|
19
|
+
|
|
20
|
+
const LADDER = '/films/wedding/master.m3u8';
|
|
21
|
+
const none = () => undefined;
|
|
22
|
+
|
|
23
|
+
const dialogs: [string, (urls: { src: string; hlsUrl?: string }) => React.ReactElement][] = [
|
|
24
|
+
['the cut editor', (urls) => <VideoCutEditor {...urls} name='wedding.mp4' onClose={none} onSubmit={none} />],
|
|
25
|
+
['the chapter editor', (urls) => <VideoChapterEditor {...urls} name='wedding.mp4' onClose={none} onSubmit={none} />],
|
|
26
|
+
['the turner', (urls) => <VideoTurner {...urls} name='wedding.mp4' onClose={none} onSave={none} />],
|
|
27
|
+
['the frame grabber', (urls) => <FrameGrabber {...urls} name='wedding.mp4' onClose={none} />],
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const stated = (): string => document.body.querySelector('[role="status"]')?.textContent ?? '';
|
|
31
|
+
|
|
32
|
+
describe('🔴 an editing dialog plays a film that has only its ladder', () => {
|
|
33
|
+
for (const [name, mount] of dialogs) {
|
|
34
|
+
test(`${name} shows the film, not "no video source"`, () => {
|
|
35
|
+
render(mount({ src: '', hlsUrl: LADDER }));
|
|
36
|
+
expect(document.body.querySelector('video')).not.toBeNull();
|
|
37
|
+
expect(stated()).not.toContain('no video source');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test(`${name} still says so when the ladder is all there was and it failed`, () => {
|
|
41
|
+
render(mount({ src: '', hlsUrl: LADDER }));
|
|
42
|
+
fireEvent.error(document.body.querySelector('video') as HTMLVideoElement);
|
|
43
|
+
expect(stated()).toContain('could not be loaded');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test(`${name} with neither still states the reason`, () => {
|
|
47
|
+
render(mount({ src: '' }));
|
|
48
|
+
expect(document.body.querySelector('video')).toBeNull();
|
|
49
|
+
expect(stated()).toContain('no video source');
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 🔴 …and with no film mounted, nothing is being read. The owner's same report: *"There is also
|
|
56
|
+
* a part that says "Reading the clip…" but doesn't change."*
|
|
57
|
+
*/
|
|
58
|
+
describe('🔴 "Reading the clip…" is said only while a film is being read', () => {
|
|
59
|
+
for (const [name, mount] of dialogs.slice(0, 2)) {
|
|
60
|
+
test(`${name}, with no source, does not claim to be reading one`, () => {
|
|
61
|
+
render(mount({ src: '' }));
|
|
62
|
+
expect(document.body.textContent).not.toContain('Reading the clip');
|
|
63
|
+
expect(document.body.textContent).toContain('Its length is not known.');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test(`${name}, with a film mounted and no length yet, says it is reading it`, () => {
|
|
67
|
+
render(mount({ src: '', hlsUrl: LADDER }));
|
|
68
|
+
expect(document.body.textContent).toContain('Reading the clip');
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
});
|
|
@@ -437,3 +437,46 @@ export function useHlsSource(
|
|
|
437
437
|
// `ref` and `faultRef` are stable objects; the URLs are what a re-attach depends on.
|
|
438
438
|
}, [ref, hlsUrl, streamUrl, listening]);
|
|
439
439
|
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* The source of an EDITING dialog's `<video>` — the cut editor, the chapter editor, the turner
|
|
443
|
+
* and the frame grabber — ladder included.
|
|
444
|
+
*
|
|
445
|
+
* 🔴 A ladder ALONE is a source, here as on the stage (collections, task 3319). Collections
|
|
446
|
+
* offers a healthy film ONLY as `hlsUrl` — its progressive copy is released against the ladder
|
|
447
|
+
* — so these dialogs, which read nothing but `streamUrl ?? url`, said *"This file has no video
|
|
448
|
+
* source to play here"* over a film the stage was playing (owner, 2026-10-27).
|
|
449
|
+
*
|
|
450
|
+
* The dialog's `<video>` mounts only once there is something to show, and remounts per source
|
|
451
|
+
* (`key`), so the attach is keyed on `shown` as well as on the URLs — {@link useHlsSource} reads
|
|
452
|
+
* its element once and would miss one that arrives later.
|
|
453
|
+
*
|
|
454
|
+
* Returns the props the element takes: `key` (a new source is a new attempt), `src` (absent on
|
|
455
|
+
* the ladder — the attach owns it), and `exhausted`, which says whether an element `error` left
|
|
456
|
+
* nothing to try: on the ladder, {@link attachHlsSource} falls back to the stream by itself.
|
|
457
|
+
*/
|
|
458
|
+
export function useEditorVideoSource(
|
|
459
|
+
ref: { current: HTMLVideoElement | null },
|
|
460
|
+
urls: { src: string; hlsUrl?: string | undefined },
|
|
461
|
+
shown: boolean,
|
|
462
|
+
): { key: string; src: string | undefined; exhausted: (el: HTMLVideoElement) => boolean } {
|
|
463
|
+
const { src, hlsUrl } = urls;
|
|
464
|
+
useEffect(() => {
|
|
465
|
+
const el = ref.current;
|
|
466
|
+
if (!el || !shown || !hlsUrl) return;
|
|
467
|
+
return attachHlsSource(el, { hlsUrl, streamUrl: src });
|
|
468
|
+
}, [ref, hlsUrl, src, shown]);
|
|
469
|
+
return {
|
|
470
|
+
key: hlsUrl || src,
|
|
471
|
+
src: hlsUrl ? undefined : src,
|
|
472
|
+
exhausted: (el) => !hlsUrl || !src || el.src === absoluteUrl(src),
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
function absoluteUrl(url: string): string {
|
|
477
|
+
try {
|
|
478
|
+
return new URL(url, globalThis.document?.baseURI).href;
|
|
479
|
+
} catch {
|
|
480
|
+
return url;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* ── 🔴 Upscaling is HONEST here, and deliberately modest ───────────────────────────────
|
|
20
20
|
* There is no detail in a video frame that was not decoded, so nothing here can invent any.
|
|
21
21
|
* What upscaling buys is real but narrow: a 300×200 crop of a 4K frame saved at 1× is a tiny
|
|
22
|
-
* picture that every later viewer scales up with nearest-
|
|
22
|
+
* picture that every later viewer scales up with nearest-neighbor-ish defaults, whereas
|
|
23
23
|
* resampling it once, at capture, with `imageSmoothingQuality: 'high'`, produces a smoother
|
|
24
24
|
* enlargement than each viewer would make for itself. So the ceiling is low on purpose — 4×
|
|
25
25
|
* is already past the point of adding anything, and beyond that it is only file size.
|
|
@@ -220,6 +220,7 @@ function TurnVideoDialog({
|
|
|
220
220
|
return (
|
|
221
221
|
<LazyVideoTurner
|
|
222
222
|
src={src}
|
|
223
|
+
{...(media.hlsUrl ? { hlsUrl: media.hlsUrl } : {})}
|
|
223
224
|
{...(poster ? { posterUrl: poster } : {})}
|
|
224
225
|
// So an unresolved source reads as "still finding it" for the moment it takes, rather
|
|
225
226
|
// than flashing the "cannot show it" reason at somebody whose film is on its way.
|
|
@@ -306,6 +307,7 @@ function TrimVideoDialog({
|
|
|
306
307
|
return (
|
|
307
308
|
<LazyVideoCutEditor
|
|
308
309
|
src={src}
|
|
310
|
+
{...(media.hlsUrl ? { hlsUrl: media.hlsUrl } : {})}
|
|
309
311
|
{...(poster ? { posterUrl: poster } : {})}
|
|
310
312
|
resolving={resolving}
|
|
311
313
|
name={item.name}
|
|
@@ -346,6 +348,7 @@ function ChapterVideoDialog({
|
|
|
346
348
|
return (
|
|
347
349
|
<LazyVideoChapterEditor
|
|
348
350
|
src={src}
|
|
351
|
+
{...(media.hlsUrl ? { hlsUrl: media.hlsUrl } : {})}
|
|
349
352
|
{...(poster ? { posterUrl: poster } : {})}
|
|
350
353
|
resolving={resolving}
|
|
351
354
|
name={item.name}
|
|
@@ -387,6 +390,7 @@ function GrabFrameDialog({
|
|
|
387
390
|
return (
|
|
388
391
|
<LazyFrameGrabber
|
|
389
392
|
src={src}
|
|
393
|
+
{...(media.hlsUrl ? { hlsUrl: media.hlsUrl } : {})}
|
|
390
394
|
resolving={resolving}
|
|
391
395
|
name={item.name}
|
|
392
396
|
startAt={at}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createRoot } from 'react-dom/client';
|
|
2
|
+
import { TagsPromptDialog, type TagsPromptDialogProps } from './components/TagsPromptDialog.js';
|
|
3
|
+
|
|
4
|
+
export type TagsPromptOptions = Omit<TagsPromptDialogProps, 'open' | 'onSubmit' | 'onCancel'>;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Imperative tag editor — {@link prompt}'s twin for a list of tags (forge task 3812). Mounts a
|
|
8
|
+
* one-shot {@link TagsPromptDialog} opened on `defaultValue` (the item's tags, as chips) and
|
|
9
|
+
* resolves to the list it closed on, or `null` when canceled:
|
|
10
|
+
*
|
|
11
|
+
* const next = await promptTags({ title: 'Tag this track', defaultValue: names, suggestions });
|
|
12
|
+
* if (next) save(next.filter((t) => !names.includes(t)), names.filter((t) => !next.includes(t)));
|
|
13
|
+
*
|
|
14
|
+
* Its own subpath so an app lazy-loads it beside `cursedbelt/react/prompt` without the barrel.
|
|
15
|
+
* Must run in a browser (it uses `createRoot`); during SSR it resolves `null`.
|
|
16
|
+
*/
|
|
17
|
+
export function promptTags(options: TagsPromptOptions): Promise<string[] | null> {
|
|
18
|
+
if (typeof document === 'undefined') return Promise.resolve(null);
|
|
19
|
+
|
|
20
|
+
return new Promise<string[] | null>((resolve) => {
|
|
21
|
+
const container = document.createElement('div');
|
|
22
|
+
document.body.appendChild(container);
|
|
23
|
+
const root = createRoot(container);
|
|
24
|
+
|
|
25
|
+
const close = (result: string[] | null) => {
|
|
26
|
+
root.unmount();
|
|
27
|
+
container.remove();
|
|
28
|
+
resolve(result);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
root.render(<TagsPromptDialog {...options} open onSubmit={(tags) => close(tags)} onCancel={() => close(null)} />);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* after an app's responsive variant (task 2124). An app that imports every area gets exactly
|
|
19
19
|
* what `cursedbelt/styles-utilities.css` emits — proved rule by rule in
|
|
20
20
|
* src/stylesAreas.spec.ts, which is also what fails when this file is stale.
|
|
21
|
-
*
|
|
21
|
+
* 97 candidate(s).
|
|
22
22
|
*
|
|
23
23
|
* Written by scripts/generateAreaStyles.ts (`bun run styles:areas`), which
|
|
24
24
|
* `bun run build` runs. The map of what is in which area, and why the areas are
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
@source inline("pointer-coarse:before:bottom-[calc(var(--hit-slop-y)*-1)]");
|
|
41
41
|
@source inline("pointer-coarse:before:top-[calc(var(--hit-slop-y)*-1)] pointer-coarse:items-center");
|
|
42
42
|
@source inline("pointer-coarse:pr-12 pr-11 pr-16 pr-2 pr-3 pr-9 pt-1 resize-none resize-y right-1.5 right-3");
|
|
43
|
-
@source inline("ring-accent/30 ring-field-error/30
|
|
44
|
-
@source inline("text-field-placeholder text-success text-xl top-1.5 w-20
|
|
45
|
-
@source inline("whitespace-pre");
|
|
43
|
+
@source inline("ring-accent ring-accent/30 ring-field-error/30 ring-offset-2 ring-offset-background self-stretch");
|
|
44
|
+
@source inline("size-7 size-9 size-full sm:w-11 sm:w-56 text-field-placeholder text-success text-xl top-1.5 w-20");
|
|
45
|
+
@source inline("w-3.5 w-32 w-36 w-40 w-88 w-fit w-max whitespace-pre");
|
|
46
46
|
@source inline('pointer-coarse:before:content-[""]');
|
|
@@ -18,11 +18,12 @@
|
|
|
18
18
|
* after an app's responsive variant (task 2124). An app that imports every area gets exactly
|
|
19
19
|
* what `cursedbelt/styles-utilities.css` emits — proved rule by rule in
|
|
20
20
|
* src/stylesAreas.spec.ts, which is also what fails when this file is stale.
|
|
21
|
-
*
|
|
21
|
+
* 11 candidate(s).
|
|
22
22
|
*
|
|
23
23
|
* Written by scripts/generateAreaStyles.ts (`bun run styles:areas`), which
|
|
24
24
|
* `bun run build` runs. The map of what is in which area, and why the areas are
|
|
25
25
|
* import closures rather than a hand-written list, is scripts/styleAreas.ts.
|
|
26
26
|
*/
|
|
27
27
|
@source inline("accent-[var(--accent-solid)] bg-accent/15 bg-warning/10 border-dashed hover:border-border");
|
|
28
|
-
@source inline("max-h-[var(--radix-popover-content-available-height)] max-w-[var(--overlay-max-w)]
|
|
28
|
+
@source inline("max-h-[var(--radix-popover-content-available-height)] max-w-[var(--overlay-max-w)] ring-accent");
|
|
29
|
+
@source inline("ring-offset-2 ring-offset-background w-64");
|
package/src/styles-utilities.css
CHANGED
|
@@ -3384,6 +3384,13 @@
|
|
|
3384
3384
|
.ring-ring {
|
|
3385
3385
|
--tw-ring-color: var(--ring);
|
|
3386
3386
|
}
|
|
3387
|
+
.ring-offset-2 {
|
|
3388
|
+
--tw-ring-offset-width: 2px;
|
|
3389
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
3390
|
+
}
|
|
3391
|
+
.ring-offset-background {
|
|
3392
|
+
--tw-ring-offset-color: var(--background);
|
|
3393
|
+
}
|
|
3387
3394
|
.outline {
|
|
3388
3395
|
outline-style: var(--tw-outline-style);
|
|
3389
3396
|
outline-width: 1px;
|
|
@@ -107,8 +107,8 @@ export function judgePhone(s: PhoneSnapshot, { touch }: JudgePhoneOptions): Desi
|
|
|
107
107
|
if (!touch) return found;
|
|
108
108
|
for (const f of s.fields.filter((f) => f.size < ZOOM_FLOOR)) push('FRM-11', f.what, `${f.size}px text: iOS zooms the page into a field under ${ZOOM_FLOOR}px`);
|
|
109
109
|
for (const t of s.targets.filter((t) => !t.inline && !t.cut && Math.min(t.w, t.h) < TARGET_FLOOR)) {
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
110
|
+
const neighbor = crowded(t, s.targets);
|
|
111
|
+
if (neighbor) push('LAY-13', t.what, `${Math.round(t.w)}×${Math.round(t.h)}: under ${TARGET_FLOOR}px and too close to ${neighbor}`);
|
|
112
112
|
}
|
|
113
113
|
// The probe steps a pixel at a time from a center that may sit on a half pixel, so a 44px halo can read 43.
|
|
114
114
|
const cramped = s.targets.filter((t) => !t.inline && !t.cut && Math.min(t.w, t.h) < THUMB - 1.5 && Math.min(t.w, t.h) >= TARGET_FLOOR - 0.5);
|
package/src/theme.css
CHANGED
|
@@ -902,6 +902,19 @@ body {
|
|
|
902
902
|
color: var(--foreground);
|
|
903
903
|
}
|
|
904
904
|
|
|
905
|
+
/*
|
|
906
|
+
* Highlighted text. With no rule the browser paints its OWN highlight, a light system blue that
|
|
907
|
+
* sits under a dark scheme's light text — unreadable (the owner, on desk under obsidian dark,
|
|
908
|
+
* 2026-10-27). A tint of the accent under the text, as Obsidian and Linear draw it: opaque (mixed
|
|
909
|
+
* into the card, so it can be measured) and the text repainted in the scheme's foreground, so an
|
|
910
|
+
* accent-colored link inside a selection still reads. `src/looks.spec.ts` measures every look.
|
|
911
|
+
* A component that draws its own (the rich-text and code editors) is more specific and keeps it.
|
|
912
|
+
*/
|
|
913
|
+
::selection {
|
|
914
|
+
background-color: color-mix(in srgb, var(--accent) 30%, var(--card));
|
|
915
|
+
color: var(--foreground);
|
|
916
|
+
}
|
|
917
|
+
|
|
905
918
|
/*
|
|
906
919
|
* ───────────── Scrollbars: a thin capsule tinted to the pane (forge task 2912) ─────
|
|
907
920
|
*
|