UNPKG

@react-av/editor

Version:

Editor Timeline Components built on React AV.

19 lines 1.37 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useTimelineEditorContext = useTimelineEditorContext; exports.TimelineEditor = TimelineEditor; const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = require("react"); const TimelineEditorContext = (0, react_1.createContext)(undefined); function useTimelineEditorContext() { const context = (0, react_1.useContext)(TimelineEditorContext); if (!context) { throw new Error('useTimelineEditorContext must be used within a TimelineEditor component'); } return context; } function TimelineEditor({ children, styling }) { const [timelineInterval, setTimelineInterval] = (0, react_1.useState)(5); return (0, jsx_runtime_1.jsx)("div", { style: Object.assign({ display: 'flex', flexDirection: 'column' }, (typeof (styling === null || styling === void 0 ? void 0 : styling.timelineEditorContainer) === 'string' ? {} : styling === null || styling === void 0 ? void 0 : styling.timelineEditorContainer)), className: typeof (styling === null || styling === void 0 ? void 0 : styling.timelineEditorContainer) === 'string' ? styling.timelineEditorContainer : undefined, children: (0, jsx_runtime_1.jsx)(TimelineEditorContext.Provider, { value: { timelineInterval, setTimelineInterval }, children: children }) }); } //# sourceMappingURL=TimelineEditor.js.map