@editframe/react 0.43.0 → 0.45.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 +11 -0
- package/dist/gui/Scrubber.d.ts +1 -0
- package/dist/gui/Scrubber.js.map +1 -1
- package/package.json +2 -2
package/README.md
ADDED
package/dist/gui/Scrubber.d.ts
CHANGED
package/dist/gui/Scrubber.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scrubber.js","names":[],"sources":["../../src/gui/Scrubber.tsx"],"sourcesContent":["import { EFScrubber } from \"@editframe/elements\";\nimport React from \"react\";\nimport { createComponent } from \"../hooks/create-element\";\n\nexport interface ScrubberProps {\n orientation?: \"horizontal\" | \"vertical\";\n currentTimeMs?: number;\n durationMs?: number;\n zoomScale?: number;\n containerWidth?: number;\n fps?: number;\n rawScrubTimeMs?: number | null;\n scrollContainerRef?: React.RefObject<HTMLElement>;\n isScrubbingRef?: React.MutableRefObject<boolean>;\n onSeek?: (time: number) => void;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst BaseScrubber = createComponent<EFScrubber, { onSeek: \"seek\" }>({\n tagName: \"ef-scrubber\",\n elementClass: EFScrubber,\n react: React,\n displayName: \"Scrubber\",\n events: {\n onSeek: \"seek\",\n },\n}) as React.ForwardRefExoticComponent<\n ScrubberProps & React.RefAttributes<EFScrubber>\n>;\n\nexport const Scrubber = React.forwardRef<EFScrubber, ScrubberProps>(\n (props, ref) => {\n const { scrollContainerRef, isScrubbingRef, ...restProps } = props;\n const elementRef = React.useRef<EFScrubber | null>(null);\n\n React.useLayoutEffect(() => {\n if (elementRef.current) {\n if (scrollContainerRef?.current) {\n elementRef.current.scrollContainerRef = scrollContainerRef;\n } else {\n elementRef.current.scrollContainerRef = undefined;\n }\n if (isScrubbingRef) {\n elementRef.current.isScrubbingRef = isScrubbingRef;\n } else {\n elementRef.current.isScrubbingRef = undefined;\n }\n }\n }, [scrollContainerRef?.current, isScrubbingRef]);\n\n return (\n <BaseScrubber\n {...restProps}\n ref={(node) => {\n elementRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n />\n );\n },\n);\n\nScrubber.displayName = \"Scrubber\";\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"Scrubber.js","names":[],"sources":["../../src/gui/Scrubber.tsx"],"sourcesContent":["import { EFScrubber } from \"@editframe/elements\";\nimport React from \"react\";\nimport { createComponent } from \"../hooks/create-element\";\n\nexport interface ScrubberProps {\n target?: string;\n orientation?: \"horizontal\" | \"vertical\";\n currentTimeMs?: number;\n durationMs?: number;\n zoomScale?: number;\n containerWidth?: number;\n fps?: number;\n rawScrubTimeMs?: number | null;\n scrollContainerRef?: React.RefObject<HTMLElement>;\n isScrubbingRef?: React.MutableRefObject<boolean>;\n onSeek?: (time: number) => void;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst BaseScrubber = createComponent<EFScrubber, { onSeek: \"seek\" }>({\n tagName: \"ef-scrubber\",\n elementClass: EFScrubber,\n react: React,\n displayName: \"Scrubber\",\n events: {\n onSeek: \"seek\",\n },\n}) as React.ForwardRefExoticComponent<\n ScrubberProps & React.RefAttributes<EFScrubber>\n>;\n\nexport const Scrubber = React.forwardRef<EFScrubber, ScrubberProps>(\n (props, ref) => {\n const { scrollContainerRef, isScrubbingRef, ...restProps } = props;\n const elementRef = React.useRef<EFScrubber | null>(null);\n\n React.useLayoutEffect(() => {\n if (elementRef.current) {\n if (scrollContainerRef?.current) {\n elementRef.current.scrollContainerRef = scrollContainerRef;\n } else {\n elementRef.current.scrollContainerRef = undefined;\n }\n if (isScrubbingRef) {\n elementRef.current.isScrubbingRef = isScrubbingRef;\n } else {\n elementRef.current.isScrubbingRef = undefined;\n }\n }\n }, [scrollContainerRef?.current, isScrubbingRef]);\n\n return (\n <BaseScrubber\n {...restProps}\n ref={(node) => {\n elementRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n />\n );\n },\n);\n\nScrubber.displayName = \"Scrubber\";\n"],"mappings":";;;;;;AAoBA,MAAM,eAAe,gBAAgD;CACnE,SAAS;CACT,cAAc;CACd,OAAO;CACP,aAAa;CACb,QAAQ,EACN,QAAQ,QACT;CACF,CAAC;AAIF,MAAa,WAAW,MAAM,YAC3B,OAAO,QAAQ;CACd,MAAM,EAAE,oBAAoB,eAAgB,GAAG,cAAc;CAC7D,MAAM,aAAa,MAAM,OAA0B,KAAK;AAExD,OAAM,sBAAsB;AAC1B,MAAI,WAAW,SAAS;AACtB,OAAI,oBAAoB,QACtB,YAAW,QAAQ,qBAAqB;OAExC,YAAW,QAAQ,qBAAqB;AAE1C,OAAI,eACF,YAAW,QAAQ,iBAAiB;OAEpC,YAAW,QAAQ,iBAAiB;;IAGvC,CAAC,oBAAoB,SAAS,eAAe,CAAC;AAEjD,QACE,oBAAC;EACC,GAAI;EACJ,MAAM,SAAS;AACb,cAAW,UAAU;AACrB,OAAI,OAAO,QAAQ,WAAY,KAAI,KAAK;YAC/B,IAAK,KAAI,UAAU;;GAE9B;EAGP;AAED,SAAS,cAAc"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editframe/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"typedoc": "(typedoc --json ./types.json --plugin typedoc-plugin-zod --excludeExternals ./src || true) && ([ -f ./types.json ] && jq -c . ./types.json > ./types.tmp.json && mv ./types.tmp.json ./types.json || true)"
|
|
38
38
|
},
|
|
39
39
|
"author": "",
|
|
40
|
-
"license": "
|
|
40
|
+
"license": "SEE LICENSE IN LICENSE-FULL.md",
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@editframe/elements": "0.43.0",
|
|
43
43
|
"@lit/task": "^1.0.1",
|