@ossclip/scenes 0.1.18 → 0.1.20
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/package.json +2 -2
- package/src/CaptionTrack.tsx +18 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossclip/scenes",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "ossclip's scene library and stage geometry — React components shared by preview and render",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"zod": "^3.25.0",
|
|
22
|
-
"@ossclip/core": "0.1.
|
|
22
|
+
"@ossclip/core": "0.1.20"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": ">=18",
|
package/src/CaptionTrack.tsx
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AbsoluteFill, Sequence, useCurrentFrame, useVideoConfig } from "remotion";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
captionAnchorOf,
|
|
5
|
+
lineDirection,
|
|
6
|
+
type CaptionLine,
|
|
7
|
+
type SceneCue,
|
|
8
|
+
} from "@ossclip/core/browser";
|
|
4
9
|
import { safeAreaFor, activeCueAt } from "./stage";
|
|
5
10
|
import { frameWindow } from "./frames";
|
|
6
11
|
import { captionAnchorAvoiding, regionsDuring, type OccupiedRegion } from "./source-fit";
|
|
@@ -134,6 +139,18 @@ const LineView: React.FC<{
|
|
|
134
139
|
// and the retype's stale-guard must compare against the truth.
|
|
135
140
|
data-caption-word={wordOffset + i}
|
|
136
141
|
data-caption-text={w.text}
|
|
142
|
+
// The word's SOURCE start, which is what the edit is keyed on
|
|
143
|
+
// (§137). These attributes are the whole contract between this
|
|
144
|
+
// file and the editor's Overlay — it hit-tests the Player's DOM
|
|
145
|
+
// and holds no caption lines of its own — so the anchor has to
|
|
146
|
+
// travel the same channel as the text. OMITTED when the word has
|
|
147
|
+
// no usable anchor (`captionAnchorOf` is core's single definition
|
|
148
|
+
// of that, so this cannot drift from the apply side): a pre-§137
|
|
149
|
+
// render-props.json has no `srcStart` at all, and the editor
|
|
150
|
+
// treats the missing attribute as "this word cannot be retyped".
|
|
151
|
+
// Never `NaN` — a shared garbage anchor is the failure §137
|
|
152
|
+
// exists to remove.
|
|
153
|
+
data-caption-src={captionAnchorOf(w) === null ? undefined : w.srcStart}
|
|
137
154
|
style={{
|
|
138
155
|
display: "inline-block",
|
|
139
156
|
// Words are individually hit-testable for the editor (the
|