@interlacejs/editor 1.0.3 → 1.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.
- package/README.md +37 -7
- package/dist/index.cjs +1687 -1333
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +107 -21
- package/dist/index.d.ts +107 -21
- package/dist/index.js +1585 -1228
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { Strings, ContentTypeRegistry, SerializedInteractiveMediaDocument, Placement, ContentInstance, Hook } from '@interlacejs/core';
|
|
3
|
+
import { Strings, InterlaceTheme, ContentTypeRegistry, SerializedInteractiveMediaDocument, Placement, ContentInstance, Hook } from '@interlacejs/core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Localized strings consumed by `PreviewModal`. Extends the core
|
|
@@ -114,7 +114,12 @@ declare function VideoSourceInput({ value, onChange, onUpload, onError, strings:
|
|
|
114
114
|
interface EditorStrings extends Strings {
|
|
115
115
|
/** Heading for the video source step when no document is loaded. */
|
|
116
116
|
videoSourceInputTitle: string;
|
|
117
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* Title for the preview surface.
|
|
119
|
+
*
|
|
120
|
+
* @deprecated Unused since the editor header shows the save status
|
|
121
|
+
* instead of a heading. Retained for backward compatibility.
|
|
122
|
+
*/
|
|
118
123
|
previewTitle: string;
|
|
119
124
|
/** Label for the button that opens the preview modal. */
|
|
120
125
|
previewLabel: string;
|
|
@@ -162,6 +167,26 @@ interface EditorStrings extends Strings {
|
|
|
162
167
|
loadErrorTitle: string;
|
|
163
168
|
/** Shown when the video element has not yet reported a duration. */
|
|
164
169
|
durationUnknownLabel: string;
|
|
170
|
+
/** Prefix for the video duration under the video. */
|
|
171
|
+
durationLabel: string;
|
|
172
|
+
/** Header status while there are unsaved changes. */
|
|
173
|
+
unsavedChangesLabel: string;
|
|
174
|
+
/** Header status after a save with no further changes. */
|
|
175
|
+
savedLabel: string;
|
|
176
|
+
/** Header badge when hooks need attention; `{count}` is replaced. */
|
|
177
|
+
hooksNeedAttentionLabel: string;
|
|
178
|
+
/** Heading of the list shown when Save is blocked by problems. */
|
|
179
|
+
saveBlockedTitle: string;
|
|
180
|
+
/** Button next to each problem that selects the hook. */
|
|
181
|
+
goToHookLabel: string;
|
|
182
|
+
/** Problem: a hook has no title. */
|
|
183
|
+
needsTitleIssue: string;
|
|
184
|
+
/** Problem: a hook has no content type yet. */
|
|
185
|
+
needsContentTypeIssue: string;
|
|
186
|
+
/** Name shown for hooks without a title. */
|
|
187
|
+
untitledHookLabel: string;
|
|
188
|
+
/** Heading of the details column when no hook is selected. */
|
|
189
|
+
noHookSelectedTitle: string;
|
|
165
190
|
/**
|
|
166
191
|
* String overrides forwarded to the embedded `VideoSourceInput`. The
|
|
167
192
|
* first screen of the drop-in component is otherwise unreachable to a
|
|
@@ -182,19 +207,12 @@ interface EditorStrings extends Strings {
|
|
|
182
207
|
*/
|
|
183
208
|
declare const DEFAULT_EDITOR_STRINGS: EditorStrings;
|
|
184
209
|
/**
|
|
185
|
-
* Optional theme overrides.
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
210
|
+
* Optional theme overrides. Every field becomes a `--interlace-*` CSS
|
|
211
|
+
* variable on the editor's root, so it reaches every surface inside it
|
|
212
|
+
* (timeline, Hook details, content editors, preview). Hosts can set the
|
|
213
|
+
* same variables from CSS instead; see `InterlaceTheme` in core.
|
|
189
214
|
*/
|
|
190
|
-
|
|
191
|
-
accentColor?: string;
|
|
192
|
-
backgroundColor?: string;
|
|
193
|
-
surfaceColor?: string;
|
|
194
|
-
borderColor?: string;
|
|
195
|
-
textColor?: string;
|
|
196
|
-
mutedTextColor?: string;
|
|
197
|
-
}
|
|
215
|
+
type EditorTheme = InterlaceTheme;
|
|
198
216
|
interface InterlaceEditorProps {
|
|
199
217
|
/** Registry of content types available for authoring. */
|
|
200
218
|
contentTypeRegistry: ContentTypeRegistry;
|
|
@@ -216,10 +234,20 @@ interface InterlaceEditorProps {
|
|
|
216
234
|
* owns persistence — the editor never persists on its own.
|
|
217
235
|
*/
|
|
218
236
|
onSave: (doc: SerializedInteractiveMediaDocument) => void;
|
|
237
|
+
/**
|
|
238
|
+
* Called when the editor gains or loses unsaved changes, relative to the
|
|
239
|
+
* loaded `document` (or an empty document) and the last `onSave`. Covers
|
|
240
|
+
* the video source, items, hooks, placements, content data, and an
|
|
241
|
+
* unmaterialized pending hook. The video duration is excluded: the
|
|
242
|
+
* editor corrects it from the video's metadata without user input.
|
|
243
|
+
*/
|
|
244
|
+
onDirtyChange?: (dirty: boolean) => void;
|
|
219
245
|
/** Optional string overrides. */
|
|
220
246
|
strings?: Partial<EditorStrings>;
|
|
221
|
-
/** Optional theme overrides. */
|
|
247
|
+
/** Optional theme overrides (see `EditorTheme`). */
|
|
222
248
|
theme?: EditorTheme;
|
|
249
|
+
/** Extra class name for the editor's root element. */
|
|
250
|
+
className?: string;
|
|
223
251
|
/** Optional error callback for upload, load, and runtime failures. */
|
|
224
252
|
onError?: (error: Error) => void;
|
|
225
253
|
/**
|
|
@@ -259,7 +287,7 @@ interface InterlaceEditorProps {
|
|
|
259
287
|
* - `adapterType` is a host-level prop (default `"native"`); it is not
|
|
260
288
|
* written into the serialized document.
|
|
261
289
|
*/
|
|
262
|
-
declare function InterlaceEditor({ contentTypeRegistry, document, onUpload, onSave, strings: stringsOverride, theme, onError, }: InterlaceEditorProps): React.JSX.Element;
|
|
290
|
+
declare function InterlaceEditor({ contentTypeRegistry, document, onUpload, onSave, onDirtyChange, strings: stringsOverride, theme, className, onError, }: InterlaceEditorProps): React.JSX.Element;
|
|
263
291
|
|
|
264
292
|
interface ContentTypeEditorProps<TData = unknown> {
|
|
265
293
|
/** The content type to mount, or `null` while the hook has no content type yet. */
|
|
@@ -300,13 +328,27 @@ interface ContentTypeEditorSlotProps<TData = unknown> {
|
|
|
300
328
|
*/
|
|
301
329
|
declare function ContentTypeEditorSlot<TData = unknown>({ contentTypeId, isOpen, onClose, onSave, registry, data, onChange, }: ContentTypeEditorSlotProps<TData>): React__default.JSX.Element | null;
|
|
302
330
|
|
|
331
|
+
/** A content type as shown to authors. */
|
|
332
|
+
interface ContentTypeOption {
|
|
333
|
+
id: string;
|
|
334
|
+
/** Readable name; falls back to the id. */
|
|
335
|
+
label?: string;
|
|
336
|
+
/** One-line description shown under the name. */
|
|
337
|
+
description?: string;
|
|
338
|
+
}
|
|
303
339
|
interface ContentTypePickerProps {
|
|
340
|
+
/** Registered content type ids (used when `options` is omitted). */
|
|
304
341
|
registeredTypes: string[];
|
|
342
|
+
/** Named options; takes precedence over `registeredTypes`. */
|
|
343
|
+
options?: ContentTypeOption[];
|
|
305
344
|
selectedType: string | null;
|
|
306
345
|
onSelect: (typeId: string) => void;
|
|
346
|
+
/** Accessible name for the group. */
|
|
347
|
+
label?: string;
|
|
307
348
|
}
|
|
308
349
|
/**
|
|
309
|
-
* ContentTypePicker -
|
|
350
|
+
* ContentTypePicker - a radio group of content types, each shown with
|
|
351
|
+
* its readable name and description. Arrow keys move between choices.
|
|
310
352
|
*/
|
|
311
353
|
declare const ContentTypePicker: React__default.FC<ContentTypePickerProps>;
|
|
312
354
|
|
|
@@ -404,6 +446,24 @@ interface InspectorPanelStrings extends Strings {
|
|
|
404
446
|
placementLabel: string;
|
|
405
447
|
/** Label above the content type row. */
|
|
406
448
|
contentTypeLabel: string;
|
|
449
|
+
/** Placeholder for the title input. */
|
|
450
|
+
titlePlaceholder: string;
|
|
451
|
+
/** Help text under the title input. */
|
|
452
|
+
titleHint: string;
|
|
453
|
+
/** Description of the blocking type, shown in the type switch. */
|
|
454
|
+
blockingTypeDescription: string;
|
|
455
|
+
/** Description of the non-blocking type, shown in the type switch. */
|
|
456
|
+
nonBlockingTypeDescription: string;
|
|
457
|
+
/** Help text under the position & size inputs. */
|
|
458
|
+
placementHint: string;
|
|
459
|
+
/** Button that reveals the content type choices for a typed hook. */
|
|
460
|
+
changeContentTypeLabel: string;
|
|
461
|
+
/** Warning shown while changing an existing hook's content type. */
|
|
462
|
+
changeContentTypeWarning: string;
|
|
463
|
+
/** Button that cancels changing the content type. */
|
|
464
|
+
cancelChangeContentTypeLabel: string;
|
|
465
|
+
/** Heading for the list of problems with this hook. */
|
|
466
|
+
issuesHeading: string;
|
|
407
467
|
}
|
|
408
468
|
declare const DEFAULT_INSPECTOR_PANEL_STRINGS: InspectorPanelStrings;
|
|
409
469
|
interface InspectorPanelEntry {
|
|
@@ -425,6 +485,10 @@ interface InspectorPanelEntry {
|
|
|
425
485
|
contentTypeId: string | null;
|
|
426
486
|
/** Registered content type ids (drives the picker for pending hooks). */
|
|
427
487
|
registeredTypes: string[];
|
|
488
|
+
/** Readable names/descriptions for the picker; ids are used when omitted. */
|
|
489
|
+
contentTypeOptions?: ContentTypeOption[];
|
|
490
|
+
/** Problems to fix before this hook can be saved. */
|
|
491
|
+
issues?: string[];
|
|
428
492
|
}
|
|
429
493
|
interface InspectorPanelProps {
|
|
430
494
|
entry: InspectorPanelEntry;
|
|
@@ -439,6 +503,11 @@ interface InspectorPanelProps {
|
|
|
439
503
|
placement?: Placement;
|
|
440
504
|
onPlacementChange?: (placement: Placement) => void;
|
|
441
505
|
onDelete: () => void;
|
|
506
|
+
/**
|
|
507
|
+
* Switches between blocking and non-blocking. When omitted the type is
|
|
508
|
+
* shown read-only.
|
|
509
|
+
*/
|
|
510
|
+
onHookTypeChange?: (hookType: "blocking" | "non-blocking") => void;
|
|
442
511
|
strings?: Partial<InspectorPanelStrings>;
|
|
443
512
|
}
|
|
444
513
|
/**
|
|
@@ -485,6 +554,14 @@ interface KeyframeTimelineStrings extends Strings {
|
|
|
485
554
|
blockingKeyframeLabel: string;
|
|
486
555
|
/** Accessible label prefix for a non-blocking range bar. */
|
|
487
556
|
nonBlockingRangeLabel: string;
|
|
557
|
+
/** Tooltip for the "add blocking hook" button (where/how it is added). */
|
|
558
|
+
addBlockingHint?: string;
|
|
559
|
+
/** Tooltip for the "add non-blocking hook" button (where/how it is added). */
|
|
560
|
+
addNonBlockingHint?: string;
|
|
561
|
+
/** Shown (and announced) in place of an empty hook title. */
|
|
562
|
+
untitledLabel?: string;
|
|
563
|
+
/** Appended to a hook's accessible label when it needs attention. */
|
|
564
|
+
needsAttentionLabel?: string;
|
|
488
565
|
}
|
|
489
566
|
declare const DEFAULT_KEYFRAME_TIMELINE_STRINGS: KeyframeTimelineStrings;
|
|
490
567
|
interface KeyframeTimelineEntry {
|
|
@@ -494,6 +571,10 @@ interface KeyframeTimelineEntry {
|
|
|
494
571
|
timestamp?: number;
|
|
495
572
|
start?: number;
|
|
496
573
|
end?: number;
|
|
574
|
+
/** Marks the hook with a warning indicator (e.g. missing or invalid content). */
|
|
575
|
+
needsAttention?: boolean;
|
|
576
|
+
/** Announced with the hook when `needsAttention` is set; defaults to `strings.needsAttentionLabel`. */
|
|
577
|
+
attentionLabel?: string;
|
|
497
578
|
}
|
|
498
579
|
interface KeyframeTimelineProps {
|
|
499
580
|
entries: KeyframeTimelineEntry[];
|
|
@@ -503,9 +584,13 @@ interface KeyframeTimelineProps {
|
|
|
503
584
|
/** Current playhead position in seconds. */
|
|
504
585
|
currentTime: number;
|
|
505
586
|
/** Whether the authoring video is currently playing (drives the play/pause button). */
|
|
506
|
-
isPlaying
|
|
587
|
+
isPlaying?: boolean;
|
|
507
588
|
onSeek: (time: number) => void;
|
|
508
|
-
|
|
589
|
+
/**
|
|
590
|
+
* Toggles playback. Omit when the host video already has its own
|
|
591
|
+
* controls; the timeline then renders no play button.
|
|
592
|
+
*/
|
|
593
|
+
onTogglePlay?: () => void;
|
|
509
594
|
onSelectEntry: (id: string) => void;
|
|
510
595
|
onUpdateEntry: (id: string, updates: {
|
|
511
596
|
timestamp?: number;
|
|
@@ -532,8 +617,9 @@ interface KeyframeTimelineProps {
|
|
|
532
617
|
* - Drag survives the pointer leaving the strip (pointer capture +
|
|
533
618
|
* window-level fallbacks — the PlacementEditor pattern).
|
|
534
619
|
* - Drag snapping is to integer seconds; hold Shift to bypass.
|
|
535
|
-
* - Zoom via the +/- buttons or
|
|
536
|
-
*
|
|
620
|
+
* - Zoom via the +/- buttons or the vertical mouse wheel (anchored at the
|
|
621
|
+
* pointer); horizontal wheel / Shift+wheel pans. Native non-passive
|
|
622
|
+
* listener, since React's synthetic onWheel cannot preventDefault.
|
|
537
623
|
* - Keyboard: the playhead is a slider (arrow keys ±1s, ±5s with Shift);
|
|
538
624
|
* a selected keyframe nudges with the same keys through `onUpdateEntry`.
|
|
539
625
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { Strings, ContentTypeRegistry, SerializedInteractiveMediaDocument, Placement, ContentInstance, Hook } from '@interlacejs/core';
|
|
3
|
+
import { Strings, InterlaceTheme, ContentTypeRegistry, SerializedInteractiveMediaDocument, Placement, ContentInstance, Hook } from '@interlacejs/core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Localized strings consumed by `PreviewModal`. Extends the core
|
|
@@ -114,7 +114,12 @@ declare function VideoSourceInput({ value, onChange, onUpload, onError, strings:
|
|
|
114
114
|
interface EditorStrings extends Strings {
|
|
115
115
|
/** Heading for the video source step when no document is loaded. */
|
|
116
116
|
videoSourceInputTitle: string;
|
|
117
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* Title for the preview surface.
|
|
119
|
+
*
|
|
120
|
+
* @deprecated Unused since the editor header shows the save status
|
|
121
|
+
* instead of a heading. Retained for backward compatibility.
|
|
122
|
+
*/
|
|
118
123
|
previewTitle: string;
|
|
119
124
|
/** Label for the button that opens the preview modal. */
|
|
120
125
|
previewLabel: string;
|
|
@@ -162,6 +167,26 @@ interface EditorStrings extends Strings {
|
|
|
162
167
|
loadErrorTitle: string;
|
|
163
168
|
/** Shown when the video element has not yet reported a duration. */
|
|
164
169
|
durationUnknownLabel: string;
|
|
170
|
+
/** Prefix for the video duration under the video. */
|
|
171
|
+
durationLabel: string;
|
|
172
|
+
/** Header status while there are unsaved changes. */
|
|
173
|
+
unsavedChangesLabel: string;
|
|
174
|
+
/** Header status after a save with no further changes. */
|
|
175
|
+
savedLabel: string;
|
|
176
|
+
/** Header badge when hooks need attention; `{count}` is replaced. */
|
|
177
|
+
hooksNeedAttentionLabel: string;
|
|
178
|
+
/** Heading of the list shown when Save is blocked by problems. */
|
|
179
|
+
saveBlockedTitle: string;
|
|
180
|
+
/** Button next to each problem that selects the hook. */
|
|
181
|
+
goToHookLabel: string;
|
|
182
|
+
/** Problem: a hook has no title. */
|
|
183
|
+
needsTitleIssue: string;
|
|
184
|
+
/** Problem: a hook has no content type yet. */
|
|
185
|
+
needsContentTypeIssue: string;
|
|
186
|
+
/** Name shown for hooks without a title. */
|
|
187
|
+
untitledHookLabel: string;
|
|
188
|
+
/** Heading of the details column when no hook is selected. */
|
|
189
|
+
noHookSelectedTitle: string;
|
|
165
190
|
/**
|
|
166
191
|
* String overrides forwarded to the embedded `VideoSourceInput`. The
|
|
167
192
|
* first screen of the drop-in component is otherwise unreachable to a
|
|
@@ -182,19 +207,12 @@ interface EditorStrings extends Strings {
|
|
|
182
207
|
*/
|
|
183
208
|
declare const DEFAULT_EDITOR_STRINGS: EditorStrings;
|
|
184
209
|
/**
|
|
185
|
-
* Optional theme overrides.
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
210
|
+
* Optional theme overrides. Every field becomes a `--interlace-*` CSS
|
|
211
|
+
* variable on the editor's root, so it reaches every surface inside it
|
|
212
|
+
* (timeline, Hook details, content editors, preview). Hosts can set the
|
|
213
|
+
* same variables from CSS instead; see `InterlaceTheme` in core.
|
|
189
214
|
*/
|
|
190
|
-
|
|
191
|
-
accentColor?: string;
|
|
192
|
-
backgroundColor?: string;
|
|
193
|
-
surfaceColor?: string;
|
|
194
|
-
borderColor?: string;
|
|
195
|
-
textColor?: string;
|
|
196
|
-
mutedTextColor?: string;
|
|
197
|
-
}
|
|
215
|
+
type EditorTheme = InterlaceTheme;
|
|
198
216
|
interface InterlaceEditorProps {
|
|
199
217
|
/** Registry of content types available for authoring. */
|
|
200
218
|
contentTypeRegistry: ContentTypeRegistry;
|
|
@@ -216,10 +234,20 @@ interface InterlaceEditorProps {
|
|
|
216
234
|
* owns persistence — the editor never persists on its own.
|
|
217
235
|
*/
|
|
218
236
|
onSave: (doc: SerializedInteractiveMediaDocument) => void;
|
|
237
|
+
/**
|
|
238
|
+
* Called when the editor gains or loses unsaved changes, relative to the
|
|
239
|
+
* loaded `document` (or an empty document) and the last `onSave`. Covers
|
|
240
|
+
* the video source, items, hooks, placements, content data, and an
|
|
241
|
+
* unmaterialized pending hook. The video duration is excluded: the
|
|
242
|
+
* editor corrects it from the video's metadata without user input.
|
|
243
|
+
*/
|
|
244
|
+
onDirtyChange?: (dirty: boolean) => void;
|
|
219
245
|
/** Optional string overrides. */
|
|
220
246
|
strings?: Partial<EditorStrings>;
|
|
221
|
-
/** Optional theme overrides. */
|
|
247
|
+
/** Optional theme overrides (see `EditorTheme`). */
|
|
222
248
|
theme?: EditorTheme;
|
|
249
|
+
/** Extra class name for the editor's root element. */
|
|
250
|
+
className?: string;
|
|
223
251
|
/** Optional error callback for upload, load, and runtime failures. */
|
|
224
252
|
onError?: (error: Error) => void;
|
|
225
253
|
/**
|
|
@@ -259,7 +287,7 @@ interface InterlaceEditorProps {
|
|
|
259
287
|
* - `adapterType` is a host-level prop (default `"native"`); it is not
|
|
260
288
|
* written into the serialized document.
|
|
261
289
|
*/
|
|
262
|
-
declare function InterlaceEditor({ contentTypeRegistry, document, onUpload, onSave, strings: stringsOverride, theme, onError, }: InterlaceEditorProps): React.JSX.Element;
|
|
290
|
+
declare function InterlaceEditor({ contentTypeRegistry, document, onUpload, onSave, onDirtyChange, strings: stringsOverride, theme, className, onError, }: InterlaceEditorProps): React.JSX.Element;
|
|
263
291
|
|
|
264
292
|
interface ContentTypeEditorProps<TData = unknown> {
|
|
265
293
|
/** The content type to mount, or `null` while the hook has no content type yet. */
|
|
@@ -300,13 +328,27 @@ interface ContentTypeEditorSlotProps<TData = unknown> {
|
|
|
300
328
|
*/
|
|
301
329
|
declare function ContentTypeEditorSlot<TData = unknown>({ contentTypeId, isOpen, onClose, onSave, registry, data, onChange, }: ContentTypeEditorSlotProps<TData>): React__default.JSX.Element | null;
|
|
302
330
|
|
|
331
|
+
/** A content type as shown to authors. */
|
|
332
|
+
interface ContentTypeOption {
|
|
333
|
+
id: string;
|
|
334
|
+
/** Readable name; falls back to the id. */
|
|
335
|
+
label?: string;
|
|
336
|
+
/** One-line description shown under the name. */
|
|
337
|
+
description?: string;
|
|
338
|
+
}
|
|
303
339
|
interface ContentTypePickerProps {
|
|
340
|
+
/** Registered content type ids (used when `options` is omitted). */
|
|
304
341
|
registeredTypes: string[];
|
|
342
|
+
/** Named options; takes precedence over `registeredTypes`. */
|
|
343
|
+
options?: ContentTypeOption[];
|
|
305
344
|
selectedType: string | null;
|
|
306
345
|
onSelect: (typeId: string) => void;
|
|
346
|
+
/** Accessible name for the group. */
|
|
347
|
+
label?: string;
|
|
307
348
|
}
|
|
308
349
|
/**
|
|
309
|
-
* ContentTypePicker -
|
|
350
|
+
* ContentTypePicker - a radio group of content types, each shown with
|
|
351
|
+
* its readable name and description. Arrow keys move between choices.
|
|
310
352
|
*/
|
|
311
353
|
declare const ContentTypePicker: React__default.FC<ContentTypePickerProps>;
|
|
312
354
|
|
|
@@ -404,6 +446,24 @@ interface InspectorPanelStrings extends Strings {
|
|
|
404
446
|
placementLabel: string;
|
|
405
447
|
/** Label above the content type row. */
|
|
406
448
|
contentTypeLabel: string;
|
|
449
|
+
/** Placeholder for the title input. */
|
|
450
|
+
titlePlaceholder: string;
|
|
451
|
+
/** Help text under the title input. */
|
|
452
|
+
titleHint: string;
|
|
453
|
+
/** Description of the blocking type, shown in the type switch. */
|
|
454
|
+
blockingTypeDescription: string;
|
|
455
|
+
/** Description of the non-blocking type, shown in the type switch. */
|
|
456
|
+
nonBlockingTypeDescription: string;
|
|
457
|
+
/** Help text under the position & size inputs. */
|
|
458
|
+
placementHint: string;
|
|
459
|
+
/** Button that reveals the content type choices for a typed hook. */
|
|
460
|
+
changeContentTypeLabel: string;
|
|
461
|
+
/** Warning shown while changing an existing hook's content type. */
|
|
462
|
+
changeContentTypeWarning: string;
|
|
463
|
+
/** Button that cancels changing the content type. */
|
|
464
|
+
cancelChangeContentTypeLabel: string;
|
|
465
|
+
/** Heading for the list of problems with this hook. */
|
|
466
|
+
issuesHeading: string;
|
|
407
467
|
}
|
|
408
468
|
declare const DEFAULT_INSPECTOR_PANEL_STRINGS: InspectorPanelStrings;
|
|
409
469
|
interface InspectorPanelEntry {
|
|
@@ -425,6 +485,10 @@ interface InspectorPanelEntry {
|
|
|
425
485
|
contentTypeId: string | null;
|
|
426
486
|
/** Registered content type ids (drives the picker for pending hooks). */
|
|
427
487
|
registeredTypes: string[];
|
|
488
|
+
/** Readable names/descriptions for the picker; ids are used when omitted. */
|
|
489
|
+
contentTypeOptions?: ContentTypeOption[];
|
|
490
|
+
/** Problems to fix before this hook can be saved. */
|
|
491
|
+
issues?: string[];
|
|
428
492
|
}
|
|
429
493
|
interface InspectorPanelProps {
|
|
430
494
|
entry: InspectorPanelEntry;
|
|
@@ -439,6 +503,11 @@ interface InspectorPanelProps {
|
|
|
439
503
|
placement?: Placement;
|
|
440
504
|
onPlacementChange?: (placement: Placement) => void;
|
|
441
505
|
onDelete: () => void;
|
|
506
|
+
/**
|
|
507
|
+
* Switches between blocking and non-blocking. When omitted the type is
|
|
508
|
+
* shown read-only.
|
|
509
|
+
*/
|
|
510
|
+
onHookTypeChange?: (hookType: "blocking" | "non-blocking") => void;
|
|
442
511
|
strings?: Partial<InspectorPanelStrings>;
|
|
443
512
|
}
|
|
444
513
|
/**
|
|
@@ -485,6 +554,14 @@ interface KeyframeTimelineStrings extends Strings {
|
|
|
485
554
|
blockingKeyframeLabel: string;
|
|
486
555
|
/** Accessible label prefix for a non-blocking range bar. */
|
|
487
556
|
nonBlockingRangeLabel: string;
|
|
557
|
+
/** Tooltip for the "add blocking hook" button (where/how it is added). */
|
|
558
|
+
addBlockingHint?: string;
|
|
559
|
+
/** Tooltip for the "add non-blocking hook" button (where/how it is added). */
|
|
560
|
+
addNonBlockingHint?: string;
|
|
561
|
+
/** Shown (and announced) in place of an empty hook title. */
|
|
562
|
+
untitledLabel?: string;
|
|
563
|
+
/** Appended to a hook's accessible label when it needs attention. */
|
|
564
|
+
needsAttentionLabel?: string;
|
|
488
565
|
}
|
|
489
566
|
declare const DEFAULT_KEYFRAME_TIMELINE_STRINGS: KeyframeTimelineStrings;
|
|
490
567
|
interface KeyframeTimelineEntry {
|
|
@@ -494,6 +571,10 @@ interface KeyframeTimelineEntry {
|
|
|
494
571
|
timestamp?: number;
|
|
495
572
|
start?: number;
|
|
496
573
|
end?: number;
|
|
574
|
+
/** Marks the hook with a warning indicator (e.g. missing or invalid content). */
|
|
575
|
+
needsAttention?: boolean;
|
|
576
|
+
/** Announced with the hook when `needsAttention` is set; defaults to `strings.needsAttentionLabel`. */
|
|
577
|
+
attentionLabel?: string;
|
|
497
578
|
}
|
|
498
579
|
interface KeyframeTimelineProps {
|
|
499
580
|
entries: KeyframeTimelineEntry[];
|
|
@@ -503,9 +584,13 @@ interface KeyframeTimelineProps {
|
|
|
503
584
|
/** Current playhead position in seconds. */
|
|
504
585
|
currentTime: number;
|
|
505
586
|
/** Whether the authoring video is currently playing (drives the play/pause button). */
|
|
506
|
-
isPlaying
|
|
587
|
+
isPlaying?: boolean;
|
|
507
588
|
onSeek: (time: number) => void;
|
|
508
|
-
|
|
589
|
+
/**
|
|
590
|
+
* Toggles playback. Omit when the host video already has its own
|
|
591
|
+
* controls; the timeline then renders no play button.
|
|
592
|
+
*/
|
|
593
|
+
onTogglePlay?: () => void;
|
|
509
594
|
onSelectEntry: (id: string) => void;
|
|
510
595
|
onUpdateEntry: (id: string, updates: {
|
|
511
596
|
timestamp?: number;
|
|
@@ -532,8 +617,9 @@ interface KeyframeTimelineProps {
|
|
|
532
617
|
* - Drag survives the pointer leaving the strip (pointer capture +
|
|
533
618
|
* window-level fallbacks — the PlacementEditor pattern).
|
|
534
619
|
* - Drag snapping is to integer seconds; hold Shift to bypass.
|
|
535
|
-
* - Zoom via the +/- buttons or
|
|
536
|
-
*
|
|
620
|
+
* - Zoom via the +/- buttons or the vertical mouse wheel (anchored at the
|
|
621
|
+
* pointer); horizontal wheel / Shift+wheel pans. Native non-passive
|
|
622
|
+
* listener, since React's synthetic onWheel cannot preventDefault.
|
|
537
623
|
* - Keyboard: the playhead is a slider (arrow keys ±1s, ±5s with Shift);
|
|
538
624
|
* a selected keyframe nudges with the same keys through `onUpdateEntry`.
|
|
539
625
|
*
|