payload-richtext-tiptap 0.0.143 → 0.0.144
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/LICENSE.md +22 -22
- package/README.md +33 -33
- package/dist/src/body/StandardArticle.js.map +1 -1
- package/dist/src/fields/TiptapEditor/Components.js.map +1 -1
- package/dist/src/fields/TiptapEditor/context/EditorContext.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/AICommand/AICommand.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/AICommand/AICommand.js +48 -38
- package/dist/src/fields/TiptapEditor/extensions/AICommand/AICommand.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/AICommand/AIMenuList.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/AICommand/CommandButton.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/AICommand/groups.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/AICommand/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/AICommand/types.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Audio/Audio.js +5 -5
- package/dist/src/fields/TiptapEditor/extensions/Audio/Audio.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Audio/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/AudioBlock/AudioBlock.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/AudioBlock/components/AudioBlockMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/AudioBlock/components/AudioBlockView.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/AudioBlock/components/AudioBlockWidth.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/AudioBlock/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/BlockquoteFigure.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Quote/Quote.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Quote/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/QuoteCaption/QuoteCaption.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/QuoteCaption/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Document/Document.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Document/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Figcaption/Figcaption.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Figcaption/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Figure/Figure.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Figure/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/FontSize/FontSize.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/FontSize/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Heading/Heading.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Heading/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/HorizontalRule/HorizontalRule.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/HorizontalRule/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Iframe/IframeEmbed.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Iframe/iframe.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Iframe/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Iframe/menus/IframeMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Iframe/menus/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Image/Image.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Image/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageBlock/ImageBlock.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockView.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockViewClientside.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageBlock/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageUpload/ImageUpload.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageUpload/getImageActualSize.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageUpload/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUpload.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUploader.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/hooks.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLinksComponent.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/InsideLinks/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/InsideLinks/insideLinks.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/InsideLinks/menus/InsideLinksMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/InsideLinks/menus/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Link/Link.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Link/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/LinkPreview/EditLinkPreviewPopover.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/LinkPreview/LinkPreview.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/LinkPreview/LinkPreviewEditorPanel.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/LinkPreview/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/LinkPreview/menus/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/LinkPreview/menus/linkPreviewMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/MultiColumn/Column.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/MultiColumn/Columns.js +3 -3
- package/dist/src/fields/TiptapEditor/extensions/MultiColumn/Columns.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/MultiColumn/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/MultiColumn/menus/ColumnsMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/MultiColumn/menus/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Paragraph/Paragraph.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Paragraph/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Selection/Selection.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Selection/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SlashCommand/CommandButton.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SlashCommand/MenuList.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SlashCommand/SlashCommand.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SlashCommand/groups.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SlashCommand/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SlashCommand/types.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Facebook/FacebookEmbed.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Facebook/facebook.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Facebook/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Instagram/InstagramEmbed.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Instagram/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Instagram/instagram.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Linkedin/LinkedinEmbed.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Linkedin/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Linkedin/linkedin.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbed.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbedServerside.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Tiktok/TiktokEmbed.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Tiktok/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Tiktok/tiktok.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Twitter/TwitterEmbed.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Twitter/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Twitter/twitter.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Youtube/YoutubeEmbed.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Youtube/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Youtube/youtube.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/menus/SocialMediaMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/menus/constants.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/menus/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Table/Cell.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Table/Header.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Table/Row.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Table/Table.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Table/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Table/menus/TableColumn/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Table/menus/TableColumn/utils.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Table/menus/TableRow/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Table/menus/TableRow/utils.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Table/menus/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Table/utils.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/TrailingNode/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/TrailingNode/trailing-node.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Video/Video.js +5 -5
- package/dist/src/fields/TiptapEditor/extensions/Video/Video.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/Video/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/VideoBlock.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockView.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockViewClientside.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockWidth.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/VideoPlayer.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/components/QualityOption.js +9 -9
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/components/QualityOption.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/components/QualitySelector.js +15 -15
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/components/QualitySelector.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/events.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/events.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/middleware/SourceInterceptor.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/util/SafeSeek.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/extension-kit.d.ts +1 -1
- package/dist/src/fields/TiptapEditor/extensions/extension-kit.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/extension-kit.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/EmbedContentInlineRenderer.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/EmbedContentSideRenderer.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/EmbedContentSidebarRenderer.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/FacebookServerside.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/IFrameServerside.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/ImageBlockServerside.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/InsideLinkServerside.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/InstagramServerside.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/LinkedinServerside.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/RenderEmbedClientSide.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/ServersideTiptapBody.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/TiktokServerside.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/TwitterBlockServerside.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/VideoBlockServerside.js +5 -5
- package/dist/src/fields/TiptapEditor/extensions/serverside/VideoBlockServerside.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/YouTubeServerside.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/getAssetsAspectRatio.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/useAppendRequiredBlocksMarkerClient.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/BlockEditor/BlockEditor.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/BlockEditor/OneLineEditor.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/BlockEditor/components/EditorHeader.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/BlockEditor/components/EditorInfo.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/BlockEditor/components/OneLiner.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/BlockEditor/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/BlockEditor/types.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/ContentItemMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/hooks/useContentItemActions.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/hooks/useData.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/LinkMenu/LinkMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/LinkMenu/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/AITextMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ContentTypePicker.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/EditIframeLinkPopover.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/EditLinkPopover.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontFamilyPicker.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontSizePicker.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/SocialMediaPopover.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-completion-command.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-draft-selector-commands.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-selector-commands.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuCommands.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuContentTypes.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuStates.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/types.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/AICommandPanel/AICommandPanel.js +4 -4
- package/dist/src/fields/TiptapEditor/features/panels/AICommandPanel/AICommandPanel.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/AICommandPanel/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.js +4 -6
- package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/EditorPreview.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/markdown.hook.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/utils.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/ColorButton.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/InsideLinksEditorPanel.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/LinkPreviewPanel/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/SocialMediaEditorPanel.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Button/Button.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Button/SpanButton.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Button/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Dropdown/Dropdown.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Dropdown/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Icon.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Loader/Loader.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Loader/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Loader/types.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Panel/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/PopoverMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Spinner/Spinner.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Spinner/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Surface.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Textarea/Textarea.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Textarea/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Toggle/Toggle.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Toggle/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Toolbar.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Tooltip/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Tooltip/types.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/crazy-spinner.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/scroll-area.js.map +1 -1
- package/dist/src/fields/TiptapEditor/hooks/useBlockEditor.js.map +1 -1
- package/dist/src/fields/TiptapEditor/hooks/useSidebar.js.map +1 -1
- package/dist/src/fields/TiptapEditor/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/lib/api.js.map +1 -1
- package/dist/src/fields/TiptapEditor/lib/constants.js.map +1 -1
- package/dist/src/fields/TiptapEditor/lib/data/initialContent.js.map +1 -1
- package/dist/src/fields/TiptapEditor/lib/extract.js.map +1 -1
- package/dist/src/fields/TiptapEditor/lib/tiptapSchema.d.ts +62 -62
- package/dist/src/fields/TiptapEditor/lib/tiptapSchema.js.map +1 -1
- package/dist/src/fields/TiptapEditor/lib/utils/cssVar.js.map +1 -1
- package/dist/src/fields/TiptapEditor/lib/utils/deepMerge.js +8 -8
- package/dist/src/fields/TiptapEditor/lib/utils/deepMerge.js.map +1 -1
- package/dist/src/fields/TiptapEditor/lib/utils/getRenderContainer.js.map +1 -1
- package/dist/src/fields/TiptapEditor/lib/utils/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/lib/utils/isCustomNodeSelected.js.map +1 -1
- package/dist/src/fields/TiptapEditor/lib/utils/isRtl.js.map +1 -1
- package/dist/src/fields/TiptapEditor/lib/utils/isTextSelected.js.map +1 -1
- package/dist/src/fields/TiptapEditor/lib/utils/partialRequired.js.map +1 -1
- package/dist/src/fields/TiptapEditor/types.d.js.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/mobile.css +1 -1
- package/dist/src/styles.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +204 -200
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockMenu.tsx"],"sourcesContent":["import { BubbleMenu as BaseBubbleMenu } from \"@tiptap/react\";\nimport { ReactNode, useCallback, useRef } from \"react\";\nimport { Instance, sticky } from \"tippy.js\";\nimport { v4 as uuid } from \"uuid\";\n\nimport {\n AlignHorizontalDistributeCenter,\n AlignHorizontalDistributeEnd,\n AlignHorizontalDistributeStart,\n Pencil,\n PencilOff,\n} from \"lucide-react\";\nimport { MenuProps } from \"../../../features/menus/types.js\";\nimport { Icon } from \"../../../features/ui/Icon.js\";\nimport { Toolbar } from \"../../../features/ui/Toolbar.js\";\nimport { getRenderContainer } from \"../../../lib/utils/index.js\";\nimport { VideoBlockWidth } from \"./VideoBlockWidth.js\";\nimport i18next from \"i18next\";\n\nexport const VideoBlockMenu = ({ editor, appendTo }: MenuProps): ReactNode => {\n const menuRef = useRef<HTMLDivElement>(null);\n const tippyInstance = useRef<Instance | null>(null);\n\n const getReferenceClientRect = useCallback(() => {\n const renderContainer = getRenderContainer(editor, \"node-videoBlock\");\n const rect =\n renderContainer?.getBoundingClientRect() ||\n new DOMRect(-1000, -1000, 0, 0);\n\n return rect;\n }, [editor]);\n\n const shouldShow = useCallback(() => {\n const isActive = editor.isActive(\"videoBlock\");\n\n return isActive;\n }, [editor]);\n\n const onAlignVideoLeft = useCallback(() => {\n editor\n .chain()\n .focus(undefined, { scrollIntoView: false })\n .setVideoBlockAlign(\"left\")\n .run();\n }, [editor]);\n\n const onAlignVideoCenter = useCallback(() => {\n editor\n .chain()\n .focus(undefined, { scrollIntoView: false })\n .setVideoBlockAlign(\"center\")\n .run();\n }, [editor]);\n\n const onAlignVideoRight = useCallback(() => {\n editor\n .chain()\n .focus(undefined, { scrollIntoView: false })\n .setVideoBlockAlign(\"right\")\n .run();\n }, [editor]);\n\n const onHideCaption = useCallback(() => {\n editor\n .chain()\n .focus(undefined, { scrollIntoView: false })\n .setVideoBlockCaption(\n editor.isActive(\"videoBlock\", { caption: false }) ? true : false\n )\n .run();\n }, [editor]);\n\n const onWidthChange = useCallback(\n (value: number) => {\n editor\n .chain()\n .focus(undefined, { scrollIntoView: false })\n .setVideoBlockWidth(value)\n .run();\n },\n [editor]\n );\n\n return (\n <BaseBubbleMenu\n editor={editor}\n pluginKey={`videoBlockMenu-${uuid()}`}\n shouldShow={shouldShow}\n updateDelay={0}\n tippyOptions={{\n offset: [0, 8],\n popperOptions: {\n modifiers: [{ name: \"flip\", enabled: false }],\n },\n getReferenceClientRect,\n onCreate: (instance: Instance) => {\n tippyInstance.current = instance;\n },\n appendTo: () => {\n return appendTo?.current;\n },\n plugins: [sticky],\n sticky: \"popper\",\n }}\n >\n <Toolbar.Wrapper shouldShowContent={shouldShow()} ref={menuRef}>\n <Toolbar.Button\n type=\"button\"\n tooltip={i18next.t(\"toggleCaption\") || \"Hide/Show caption\"}\n active={editor.isActive(\"videoBlock\", { caption: false })}\n onClick={onHideCaption}\n >\n <Icon\n icon={\n editor.isActive(\"videoBlock\", { caption: false })\n ? PencilOff\n : Pencil\n }\n />\n </Toolbar.Button>\n <Toolbar.Button\n type=\"button\"\n tooltip={i18next.t(\"alignVideoLeft\") || \"Align video left\"}\n active={editor.isActive(\"videoBlock\", { align: \"left\" })}\n onClick={onAlignVideoLeft}\n >\n <Icon icon={AlignHorizontalDistributeStart} />\n </Toolbar.Button>\n <Toolbar.Button\n type=\"button\"\n tooltip={i18next.t(\"alignVideoCenter\") || \"Align video center\"}\n active={editor.isActive(\"videoBlock\", { align: \"center\" })}\n onClick={onAlignVideoCenter}\n >\n <Icon icon={AlignHorizontalDistributeCenter} />\n </Toolbar.Button>\n <Toolbar.Button\n type=\"button\"\n tooltip={i18next.t(\"alignVideoRight\") || \"Align video right\"}\n active={editor.isActive(\"videoBlock\", { align: \"right\" })}\n onClick={onAlignVideoRight}\n >\n <Icon icon={AlignHorizontalDistributeEnd} />\n </Toolbar.Button>\n <Toolbar.Divider />\n <VideoBlockWidth\n onChange={onWidthChange}\n value={parseInt(editor.getAttributes(\"videoBlock\").width)}\n />\n </Toolbar.Wrapper>\n </BaseBubbleMenu>\n );\n};\n\nexport default VideoBlockMenu;\n"],"names":["BubbleMenu","BaseBubbleMenu","useCallback","useRef","sticky","v4","uuid","AlignHorizontalDistributeCenter","AlignHorizontalDistributeEnd","AlignHorizontalDistributeStart","Pencil","PencilOff","Icon","Toolbar","getRenderContainer","VideoBlockWidth","i18next","VideoBlockMenu","editor","appendTo","menuRef","tippyInstance","getReferenceClientRect","renderContainer","rect","getBoundingClientRect","DOMRect","shouldShow","isActive","onAlignVideoLeft","chain","focus","undefined","scrollIntoView","setVideoBlockAlign","run","onAlignVideoCenter","onAlignVideoRight","onHideCaption","setVideoBlockCaption","caption","onWidthChange","value","setVideoBlockWidth","pluginKey","updateDelay","tippyOptions","offset","popperOptions","modifiers","name","enabled","onCreate","instance","current","plugins","Wrapper","shouldShowContent","ref","Button","type","tooltip","t","active","onClick","icon","align","Divider","onChange","parseInt","getAttributes","width"],"mappings":";AAAA,SAASA,cAAcC,cAAc,QAAQ,gBAAgB;AAC7D,SAAoBC,WAAW,EAAEC,MAAM,QAAQ,QAAQ;AACvD,SAAmBC,MAAM,QAAQ,WAAW;AAC5C,SAASC,MAAMC,IAAI,QAAQ,OAAO;AAElC,SACEC,+BAA+B,EAC/BC,4BAA4B,EAC5BC,8BAA8B,EAC9BC,MAAM,EACNC,SAAS,QACJ,eAAe;AAEtB,SAASC,IAAI,QAAQ,+BAA+B;AACpD,SAASC,OAAO,QAAQ,kCAAkC;AAC1D,SAASC,kBAAkB,QAAQ,8BAA8B;AACjE,SAASC,eAAe,QAAQ,uBAAuB;AACvD,OAAOC,aAAa,UAAU;AAE9B,OAAO,MAAMC,iBAAiB,CAAC,EAAEC,MAAM,EAAEC,QAAQ,EAAa;IAC5D,MAAMC,UAAUjB,OAAuB;IACvC,MAAMkB,gBAAgBlB,OAAwB;IAE9C,MAAMmB,yBAAyBpB,YAAY;QACzC,MAAMqB,kBAAkBT,mBAAmBI,QAAQ;QACnD,MAAMM,OACJD,iBAAiBE,2BACjB,IAAIC,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG;QAE/B,OAAOF;IACT,GAAG;QAACN;KAAO;IAEX,MAAMS,aAAazB,YAAY;QAC7B,MAAM0B,WAAWV,OAAOU,QAAQ,CAAC;QAEjC,OAAOA;IACT,GAAG;QAACV;KAAO;IAEX,MAAMW,mBAAmB3B,YAAY;QACnCgB,OACGY,KAAK,GACLC,KAAK,CAACC,WAAW;YAAEC,gBAAgB;QAAM,GACzCC,kBAAkB,CAAC,QACnBC,GAAG;IACR,GAAG;QAACjB;KAAO;IAEX,MAAMkB,qBAAqBlC,YAAY;QACrCgB,OACGY,KAAK,GACLC,KAAK,CAACC,WAAW;YAAEC,gBAAgB;QAAM,GACzCC,kBAAkB,CAAC,UACnBC,GAAG;IACR,GAAG;QAACjB;KAAO;IAEX,MAAMmB,oBAAoBnC,YAAY;QACpCgB,OACGY,KAAK,GACLC,KAAK,CAACC,WAAW;YAAEC,gBAAgB;QAAM,GACzCC,kBAAkB,CAAC,SACnBC,GAAG;IACR,GAAG;QAACjB;KAAO;IAEX,MAAMoB,gBAAgBpC,YAAY;QAChCgB,OACGY,KAAK,GACLC,KAAK,CAACC,WAAW;YAAEC,gBAAgB;QAAM,GACzCM,oBAAoB,CACnBrB,OAAOU,QAAQ,CAAC,cAAc;YAAEY,SAAS;QAAM,KAAK,OAAO,OAE5DL,GAAG;IACR,GAAG;QAACjB;KAAO;IAEX,MAAMuB,gBAAgBvC,YACpB,CAACwC;QACCxB,OACGY,KAAK,GACLC,KAAK,CAACC,WAAW;YAAEC,gBAAgB;QAAM,GACzCU,kBAAkB,CAACD,OACnBP,GAAG;IACR,GACA;QAACjB;KAAO;IAGV,qBACE,KAACjB;QACCiB,QAAQA;QACR0B,WAAW,CAAC,eAAe,EAAEtC,
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockMenu.tsx"],"sourcesContent":["import { BubbleMenu as BaseBubbleMenu } from \"@tiptap/react\";\r\nimport { ReactNode, useCallback, useRef } from \"react\";\r\nimport { Instance, sticky } from \"tippy.js\";\r\nimport { v4 as uuid } from \"uuid\";\r\n\r\nimport {\r\n AlignHorizontalDistributeCenter,\r\n AlignHorizontalDistributeEnd,\r\n AlignHorizontalDistributeStart,\r\n Pencil,\r\n PencilOff,\r\n} from \"lucide-react\";\r\nimport { MenuProps } from \"../../../features/menus/types.js\";\r\nimport { Icon } from \"../../../features/ui/Icon.js\";\r\nimport { Toolbar } from \"../../../features/ui/Toolbar.js\";\r\nimport { getRenderContainer } from \"../../../lib/utils/index.js\";\r\nimport { VideoBlockWidth } from \"./VideoBlockWidth.js\";\r\nimport i18next from \"i18next\";\r\n\r\nexport const VideoBlockMenu = ({ editor, appendTo }: MenuProps): ReactNode => {\r\n const menuRef = useRef<HTMLDivElement>(null);\r\n const tippyInstance = useRef<Instance | null>(null);\r\n\r\n const getReferenceClientRect = useCallback(() => {\r\n const renderContainer = getRenderContainer(editor, \"node-videoBlock\");\r\n const rect =\r\n renderContainer?.getBoundingClientRect() ||\r\n new DOMRect(-1000, -1000, 0, 0);\r\n\r\n return rect;\r\n }, [editor]);\r\n\r\n const shouldShow = useCallback(() => {\r\n const isActive = editor.isActive(\"videoBlock\");\r\n\r\n return isActive;\r\n }, [editor]);\r\n\r\n const onAlignVideoLeft = useCallback(() => {\r\n editor\r\n .chain()\r\n .focus(undefined, { scrollIntoView: false })\r\n .setVideoBlockAlign(\"left\")\r\n .run();\r\n }, [editor]);\r\n\r\n const onAlignVideoCenter = useCallback(() => {\r\n editor\r\n .chain()\r\n .focus(undefined, { scrollIntoView: false })\r\n .setVideoBlockAlign(\"center\")\r\n .run();\r\n }, [editor]);\r\n\r\n const onAlignVideoRight = useCallback(() => {\r\n editor\r\n .chain()\r\n .focus(undefined, { scrollIntoView: false })\r\n .setVideoBlockAlign(\"right\")\r\n .run();\r\n }, [editor]);\r\n\r\n const onHideCaption = useCallback(() => {\r\n editor\r\n .chain()\r\n .focus(undefined, { scrollIntoView: false })\r\n .setVideoBlockCaption(\r\n editor.isActive(\"videoBlock\", { caption: false }) ? true : false\r\n )\r\n .run();\r\n }, [editor]);\r\n\r\n const onWidthChange = useCallback(\r\n (value: number) => {\r\n editor\r\n .chain()\r\n .focus(undefined, { scrollIntoView: false })\r\n .setVideoBlockWidth(value)\r\n .run();\r\n },\r\n [editor]\r\n );\r\n\r\n return (\r\n <BaseBubbleMenu\r\n editor={editor}\r\n pluginKey={`videoBlockMenu-${uuid()}`}\r\n shouldShow={shouldShow}\r\n updateDelay={0}\r\n tippyOptions={{\r\n offset: [0, 8],\r\n popperOptions: {\r\n modifiers: [{ name: \"flip\", enabled: false }],\r\n },\r\n getReferenceClientRect,\r\n onCreate: (instance: Instance) => {\r\n tippyInstance.current = instance;\r\n },\r\n appendTo: () => {\r\n return appendTo?.current;\r\n },\r\n plugins: [sticky],\r\n sticky: \"popper\",\r\n }}\r\n >\r\n <Toolbar.Wrapper shouldShowContent={shouldShow()} ref={menuRef}>\r\n <Toolbar.Button\r\n type=\"button\"\r\n tooltip={i18next.t(\"toggleCaption\") || \"Hide/Show caption\"}\r\n active={editor.isActive(\"videoBlock\", { caption: false })}\r\n onClick={onHideCaption}\r\n >\r\n <Icon\r\n icon={\r\n editor.isActive(\"videoBlock\", { caption: false })\r\n ? PencilOff\r\n : Pencil\r\n }\r\n />\r\n </Toolbar.Button>\r\n <Toolbar.Button\r\n type=\"button\"\r\n tooltip={i18next.t(\"alignVideoLeft\") || \"Align video left\"}\r\n active={editor.isActive(\"videoBlock\", { align: \"left\" })}\r\n onClick={onAlignVideoLeft}\r\n >\r\n <Icon icon={AlignHorizontalDistributeStart} />\r\n </Toolbar.Button>\r\n <Toolbar.Button\r\n type=\"button\"\r\n tooltip={i18next.t(\"alignVideoCenter\") || \"Align video center\"}\r\n active={editor.isActive(\"videoBlock\", { align: \"center\" })}\r\n onClick={onAlignVideoCenter}\r\n >\r\n <Icon icon={AlignHorizontalDistributeCenter} />\r\n </Toolbar.Button>\r\n <Toolbar.Button\r\n type=\"button\"\r\n tooltip={i18next.t(\"alignVideoRight\") || \"Align video right\"}\r\n active={editor.isActive(\"videoBlock\", { align: \"right\" })}\r\n onClick={onAlignVideoRight}\r\n >\r\n <Icon icon={AlignHorizontalDistributeEnd} />\r\n </Toolbar.Button>\r\n <Toolbar.Divider />\r\n <VideoBlockWidth\r\n onChange={onWidthChange}\r\n value={parseInt(editor.getAttributes(\"videoBlock\").width)}\r\n />\r\n </Toolbar.Wrapper>\r\n </BaseBubbleMenu>\r\n );\r\n};\r\n\r\nexport default VideoBlockMenu;\r\n"],"names":["BubbleMenu","BaseBubbleMenu","useCallback","useRef","sticky","v4","uuid","AlignHorizontalDistributeCenter","AlignHorizontalDistributeEnd","AlignHorizontalDistributeStart","Pencil","PencilOff","Icon","Toolbar","getRenderContainer","VideoBlockWidth","i18next","VideoBlockMenu","editor","appendTo","menuRef","tippyInstance","getReferenceClientRect","renderContainer","rect","getBoundingClientRect","DOMRect","shouldShow","isActive","onAlignVideoLeft","chain","focus","undefined","scrollIntoView","setVideoBlockAlign","run","onAlignVideoCenter","onAlignVideoRight","onHideCaption","setVideoBlockCaption","caption","onWidthChange","value","setVideoBlockWidth","pluginKey","updateDelay","tippyOptions","offset","popperOptions","modifiers","name","enabled","onCreate","instance","current","plugins","Wrapper","shouldShowContent","ref","Button","type","tooltip","t","active","onClick","icon","align","Divider","onChange","parseInt","getAttributes","width"],"mappings":";AAAA,SAASA,cAAcC,cAAc,QAAQ,gBAAgB;AAC7D,SAAoBC,WAAW,EAAEC,MAAM,QAAQ,QAAQ;AACvD,SAAmBC,MAAM,QAAQ,WAAW;AAC5C,SAASC,MAAMC,IAAI,QAAQ,OAAO;AAElC,SACEC,+BAA+B,EAC/BC,4BAA4B,EAC5BC,8BAA8B,EAC9BC,MAAM,EACNC,SAAS,QACJ,eAAe;AAEtB,SAASC,IAAI,QAAQ,+BAA+B;AACpD,SAASC,OAAO,QAAQ,kCAAkC;AAC1D,SAASC,kBAAkB,QAAQ,8BAA8B;AACjE,SAASC,eAAe,QAAQ,uBAAuB;AACvD,OAAOC,aAAa,UAAU;AAE9B,OAAO,MAAMC,iBAAiB,CAAC,EAAEC,MAAM,EAAEC,QAAQ,EAAa;IAC5D,MAAMC,UAAUjB,OAAuB;IACvC,MAAMkB,gBAAgBlB,OAAwB;IAE9C,MAAMmB,y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A,KAACzB;wBAAKqD,MAAMzD;;;8BAEd,KAACK,QAAQsD,OAAO;8BAChB,KAACpD;oBACCqD,UAAU3B;oBACVC,OAAO2B,SAASnD,OAAOoD,aAAa,CAAC,cAAcC,KAAK;;;;;AAKlE,EAAE;AAEF,eAAetD,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockView.tsx"],"sourcesContent":["import { Node } from \"@tiptap/pm/model\";\nimport { Editor, NodeViewWrapper } from \"@tiptap/react\";\nimport React, { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { cn } from \"../../../lib/utils/index.js\";\nimport VideoPlayer from \"./videojs/VideoPlayer.js\";\n\ninterface VideoBlockViewProps {\n editor: Editor;\n getPos: () => number;\n node: Node & {\n attrs: {\n src: string;\n poster: string;\n assetId: string;\n playlistUrl?: string;\n };\n };\n updateAttributes: (attrs: Record<string, string>) => void;\n}\n\nexport type Playlist = {\n id: string;\n title: string;\n description: string;\n poster: string;\n items: Item[];\n};\n\nexport type Item = {\n src: string;\n type: string;\n label: string;\n width: number;\n height: number;\n};\n\nexport const VideoBlockView = (props: VideoBlockViewProps) => {\n const { editor, getPos, node } = props;\n const videoWrapperRef = useRef<HTMLDivElement>(null);\n const { src, poster, playlistUrl, caption, title } = node.attrs;\n const [playlistContent, setPlaylistContent] = React.useState<\n Playlist | undefined\n >();\n const [error, setError] = React.useState(\"\");\n\n useEffect(() => {\n async function getPlaylistContent() {\n try {\n const res = await fetch(playlistUrl, {\n cache: \"no-cache\",\n });\n return await res.json();\n } catch {\n setError(\"Issue with getting asset info\");\n return undefined;\n }\n }\n\n if (playlistUrl) {\n try {\n getPlaylistContent()\n .then((data) => {\n setPlaylistContent(data);\n })\n .catch((err) => {\n setError(err);\n });\n } catch (error) {\n setError(error);\n }\n }\n }, [playlistUrl]);\n\n const wrapperClassName = cn(\n node.attrs.align === \"left\" ? \"ml-0\" : \"ml-auto\",\n node.attrs.align === \"right\" ? \"mr-0\" : \"mr-auto\",\n node.attrs.align === \"center\" && \"mx-auto\"\n );\n\n const onClick = useCallback(() => {\n editor.commands.setNodeSelection(getPos());\n }, [getPos, editor.commands]);\n\n const videoJsOptions = useMemo(() => {\n if (playlistContent == undefined) return {};\n\n if (\n playlistContent.items.some(\n (item) =>\n item.type === \"application/x-mpegURL\" ||\n item.type === \"application/vnd.apple.mpegurl\"\n )\n ) {\n return {\n sources: playlistContent.items\n .filter(\n (item) =>\n item.type === \"application/x-mpegURL\" ||\n item.type === \"application/vnd.apple.mpegurl\"\n )\n .map((item) => ({\n src: item.src,\n type: item.type,\n label: item.label,\n })),\n poster: playlistContent.poster,\n };\n }\n return {\n sources: playlistContent.items.map((item) => ({\n src: item.src,\n type: item.type,\n label: item.label,\n })),\n poster: playlistContent.poster,\n };\n }, [playlistContent]);\n return (\n <NodeViewWrapper>\n <div className={wrapperClassName} style={{ width: node.attrs.width }}>\n <div ref={videoWrapperRef}>\n {error && <div>{error}</div>}\n {/* <video\n controls\n className=\"block\"\n src={src}\n poster={poster}\n title=\"\"\n onClick={onClick}\n /> */}\n {playlistContent && <VideoPlayer options={videoJsOptions} />}\n {caption && playlistContent?.title && (\n <caption className=\"text-center block text-sm text-gray-500\">\n {title || playlistContent?.title}\n </caption>\n )}\n </div>\n </div>\n </NodeViewWrapper>\n );\n};\n\nexport default VideoBlockView;\n"],"names":["NodeViewWrapper","React","useCallback","useEffect","useMemo","useRef","cn","VideoPlayer","VideoBlockView","props","editor","getPos","node","videoWrapperRef","src","poster","playlistUrl","caption","title","attrs","playlistContent","setPlaylistContent","useState","error","setError","getPlaylistContent","res","fetch","cache","json","undefined","then","data","catch","err","wrapperClassName","align","onClick","commands","setNodeSelection","videoJsOptions","items","some","item","type","sources","filter","map","label","div","className","style","width","ref","options"],"mappings":";AACA,SAAiBA,eAAe,QAAQ,gBAAgB;AACxD,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO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AgBqB,KAAK,CAACC,IAAI,CACxB,CAACC,OACCA,KAAKC,IAAI,KAAK,2BACdD,KAAKC,IAAI,KAAK,kCAElB;YACA,OAAO;gBACLC,SAASzB,gBAAgBqB,KAAK,CAC3BK,MAAM,CACL,CAACH,OACCA,KAAKC,IAAI,KAAK,2BACdD,KAAKC,IAAI,KAAK,iCAEjBG,GAAG,CAAC,CAACJ,OAAU,CAAA;wBACd7B,KAAK6B,KAAK7B,GAAG;wBACb8B,MAAMD,KAAKC,IAAI;wBACfI,OAAOL,KAAKK,KAAK;oBACnB,CAAA;gBACFjC,QAAQK,gBAAgBL,MAAM;YAChC;QACF;QACA,OAAO;YACL8B,SAASzB,gBAAgBqB,KAAK,CAACM,GAAG,CAAC,CAACJ,OAAU,CAAA;oBAC5C7B,KAAK6B,KAAK7B,GAAG;oBACb8B,MAAMD,KAAKC,IAAI;oBACfI,OAAOL,KAAKK,KAAK;gBACnB,CAAA;YACAjC,QAAQK,gBAAgBL,MAAM;QAChC;IACF,GAAG;QAACK;KAAgB;IACpB,qBACE,KAACpB;kBACC,cAAA,KAACiD;YAAIC,WAAWf;YAAkBgB,OAAO;gBAAEC,OAAOxC,KAAKO,KAAK,CAACiC,KAAK;YAAC;sBACjE,cAAA,MAACH;gBAAII,KAAKxC;;oBACPU,uBAAS,KAAC0B;kCAAK1B;;oBASfH,iCAAmB,KAACb;wBAAY+C,SAASd;;oBACzCvB,WAAWG,iBAAiBF,uBAC3B,KAACD;wBAAQiC,WAAU;kCAChBhC,SAASE,iBAAiBF;;;;;;AAOzC,EAAE;AAEF,eAAeV,eAAe"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockView.tsx"],"sourcesContent":["import { Node } from \"@tiptap/pm/model\";\r\nimport { Editor, NodeViewWrapper } from \"@tiptap/react\";\r\nimport React, { useCallback, useEffect, useMemo, useRef } from \"react\";\r\nimport { cn } from \"../../../lib/utils/index.js\";\r\nimport VideoPlayer from \"./videojs/VideoPlayer.js\";\r\n\r\ninterface VideoBlockViewProps {\r\n editor: Editor;\r\n getPos: () => number;\r\n node: Node & {\r\n attrs: {\r\n src: string;\r\n poster: string;\r\n assetId: string;\r\n playlistUrl?: string;\r\n };\r\n };\r\n updateAttributes: (attrs: Record<string, string>) => void;\r\n}\r\n\r\nexport type Playlist = {\r\n id: string;\r\n title: string;\r\n description: string;\r\n poster: string;\r\n items: Item[];\r\n};\r\n\r\nexport type Item = {\r\n src: string;\r\n type: string;\r\n label: string;\r\n width: number;\r\n height: number;\r\n};\r\n\r\nexport const VideoBlockView = (props: VideoBlockViewProps) => {\r\n const { editor, getPos, node } = props;\r\n const videoWrapperRef = useRef<HTMLDivElement>(null);\r\n const { src, poster, playlistUrl, caption, title } = node.attrs;\r\n const [playlistContent, setPlaylistContent] = React.useState<\r\n Playlist | undefined\r\n >();\r\n const [error, setError] = React.useState(\"\");\r\n\r\n useEffect(() => {\r\n async function getPlaylistContent() {\r\n try {\r\n const res = await fetch(playlistUrl, {\r\n cache: \"no-cache\",\r\n });\r\n return await res.json();\r\n } catch {\r\n setError(\"Issue with getting asset info\");\r\n return undefined;\r\n }\r\n }\r\n\r\n if (playlistUrl) {\r\n try {\r\n getPlaylistContent()\r\n .then((data) => {\r\n setPlaylistContent(data);\r\n })\r\n .catch((err) => {\r\n setError(err);\r\n });\r\n } catch (error) {\r\n setError(error);\r\n }\r\n }\r\n }, [playlistUrl]);\r\n\r\n const wrapperClassName = cn(\r\n node.attrs.align === \"left\" ? \"ml-0\" : \"ml-auto\",\r\n node.attrs.align === \"right\" ? \"mr-0\" : \"mr-auto\",\r\n node.attrs.align === \"center\" && \"mx-auto\"\r\n );\r\n\r\n const onClick = useCallback(() => {\r\n editor.commands.setNodeSelection(getPos());\r\n }, [getPos, editor.commands]);\r\n\r\n const videoJsOptions = useMemo(() => {\r\n if (playlistContent == undefined) return {};\r\n\r\n if (\r\n playlistContent.items.some(\r\n (item) =>\r\n item.type === \"application/x-mpegURL\" ||\r\n item.type === \"application/vnd.apple.mpegurl\"\r\n )\r\n ) {\r\n return {\r\n sources: playlistContent.items\r\n .filter(\r\n (item) =>\r\n item.type === \"application/x-mpegURL\" ||\r\n item.type === \"application/vnd.apple.mpegurl\"\r\n )\r\n .map((item) => ({\r\n src: item.src,\r\n type: item.type,\r\n label: item.label,\r\n })),\r\n poster: playlistContent.poster,\r\n };\r\n }\r\n return {\r\n sources: playlistContent.items.map((item) => ({\r\n src: item.src,\r\n type: item.type,\r\n label: item.label,\r\n })),\r\n poster: playlistContent.poster,\r\n };\r\n }, [playlistContent]);\r\n return (\r\n <NodeViewWrapper>\r\n <div className={wrapperClassName} style={{ width: node.attrs.width }}>\r\n <div ref={videoWrapperRef}>\r\n {error && <div>{error}</div>}\r\n {/* <video\r\n controls\r\n className=\"block\"\r\n src={src}\r\n poster={poster}\r\n title=\"\"\r\n onClick={onClick}\r\n /> */}\r\n {playlistContent && <VideoPlayer options={videoJsOptions} />}\r\n {caption && playlistContent?.title && (\r\n <caption className=\"text-center block text-sm text-gray-500\">\r\n {title || playlistContent?.title}\r\n </caption>\r\n )}\r\n </div>\r\n </div>\r\n </NodeViewWrapper>\r\n );\r\n};\r\n\r\nexport default VideoBlockView;\r\n"],"names":["NodeViewWrapper","React","useCallback","useEffect","useMemo","useRef","cn","VideoPlayer","VideoBlockView","props","editor","getPos","node","videoWrapperRef","src","poster","playlistUrl","caption","title","attrs","playlistContent","setPlaylistContent","useState","error","setError","getPlaylistContent","res","fetch","cache","json","undefined","then","data","catch","err","wrapperClassName","align","onClick","commands","setNodeSelection","videoJsOptions","items","some","item","type","sources","filter","map","label","div","className","style","width","ref","options"],"mappings":";AACA,SAAiBA,eAAe,QAAQ,gBAAgB;AACxD,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,QAAQ;AACvE,SAASC,EAAE,QAAQ,8BAA8B;AACjD,OAAOC,iBAAiB,2BAA2B;AAgCnD,OA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AO;gBACLC,SAASzB,gBAAgBqB,KAAK,CAC3BK,MAAM,CACL,CAACH,OACCA,KAAKC,IAAI,KAAK,2BACdD,KAAKC,IAAI,KAAK,iCAEjBG,GAAG,CAAC,CAACJ,OAAU,CAAA;wBACd7B,KAAK6B,KAAK7B,GAAG;wBACb8B,MAAMD,KAAKC,IAAI;wBACfI,OAAOL,KAAKK,KAAK;oBACnB,CAAA;gBACFjC,QAAQK,gBAAgBL,MAAM;YAChC;QACF;QACA,OAAO;YACL8B,SAASzB,gBAAgBqB,KAAK,CAACM,GAAG,CAAC,CAACJ,OAAU,CAAA;oBAC5C7B,KAAK6B,KAAK7B,GAAG;oBACb8B,MAAMD,KAAKC,IAAI;oBACfI,OAAOL,KAAKK,KAAK;gBACnB,CAAA;YACAjC,QAAQK,gBAAgBL,MAAM;QAChC;IACF,GAAG;QAACK;KAAgB;IACpB,qBACE,KAACpB;kBACC,cAAA,KAACiD;YAAIC,WAAWf;YAAkBgB,OAAO;gBAAEC,OAAOxC,KAAKO,KAAK,CAACiC,KAAK;YAAC;sBACjE,cAAA,MAACH;gBAAII,KAAKxC;;oBACPU,uBAAS,KAAC0B;kCAAK1B;;oBASfH,iCAAmB,KAACb;wBAAY+C,SAASd;;oBACzCvB,WAAWG,iBAAiBF,uBAC3B,KAACD;wBAAQiC,WAAU;kCAChBhC,SAASE,iBAAiBF;;;;;;AAOzC,EAAE;AAEF,eAAeV,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockViewClientside.tsx"],"sourcesContent":["import { Node } from \"@tiptap/pm/model\";\nimport { NodeViewWrapper } from \"@tiptap/react\";\nimport React, { useEffect, useMemo, useRef } from \"react\";\nimport { cn } from \"../../../lib/utils/index.js\";\nimport VideoPlayer from \"./videojs/VideoPlayer.js\";\nimport { useGetAssetsAspectRatio } from \"../../serverside/getAssetsAspectRatio.js\";\n\ninterface VideoBlockViewProps {\n node: Node & {\n attrs: {\n src: string;\n poster: string;\n assetId: string;\n playlistUrl?: string;\n };\n };\n className?: string;\n getVideoAspect?: () => void;\n}\n\nexport type Playlist = {\n id: string;\n title: string;\n description: string;\n poster: string;\n items: Item[];\n};\n\nexport type Item = {\n src: string;\n type: string;\n label: string;\n width: number;\n height: number;\n};\n\nexport const VideoBlockViewClientside = ({\n className,\n getVideoAspect,\n ...props\n}: VideoBlockViewProps) => {\n const { node } = props;\n const videoWrapperRef = useRef<HTMLDivElement>(null);\n const { src, poster, playlistUrl, caption, actualWidth, actualHeight } =\n node.attrs;\n const { aspectRatio, calculateAspectRatio } = useGetAssetsAspectRatio();\n const [playlistContent, setPlaylistContent] = React.useState<\n Playlist | undefined\n >();\n const [error, setError] = React.useState();\n\n useEffect(() => {\n async function getPlaylistContent() {\n const res = await fetch(playlistUrl, {\n cache: \"no-cache\",\n });\n return await res.json();\n }\n\n if (playlistUrl) {\n try {\n getPlaylistContent()\n .then((data) => {\n setPlaylistContent(data);\n })\n .catch((err) => {\n setError(err);\n });\n } catch (error) {\n setError(error);\n }\n }\n }, [playlistUrl]);\n\n const wrapperClassName = cn(\n node.attrs.align === \"left\" ? \"ml-0\" : \"ml-auto\",\n node.attrs.align === \"right\" ? \"mr-0\" : \"mr-auto\",\n node.attrs.align === \"center\" && \"mx-auto\"\n );\n\n const videoJsOptions = useMemo(() => {\n if (playlistContent == undefined) return {};\n\n if (\n playlistContent.items.some(\n (item) =>\n item.type === \"application/x-mpegURL\" ||\n item.type === \"application/vnd.apple.mpegurl\"\n )\n ) {\n return {\n sources: playlistContent.items\n .filter(\n (item) =>\n item.type === \"application/x-mpegURL\" ||\n item.type === \"application/vnd.apple.mpegurl\"\n )\n .map((item) => ({\n src: item.src,\n type: item.type,\n label: item.label,\n })),\n poster: playlistContent.poster,\n preload: \"auto\",\n };\n }\n return {\n sources: playlistContent.items.map((item) => ({\n src: item.src,\n type: item.type,\n label: item.label,\n })),\n poster: playlistContent.poster,\n preload: \"auto\",\n };\n }, [playlistContent]);\n\n useEffect(() => {\n if (!playlistContent?.items?.length) {\n return;\n }\n const source = playlistContent.items.find((item) => item.src);\n if (!aspectRatio && source?.src) {\n calculateAspectRatio(\n {\n src: source.src,\n actualWidth: actualWidth || source?.width,\n actualHeight: actualHeight || source?.height,\n },\n \"VIDEO\",\n getVideoAspect\n );\n }\n }, [playlistContent]);\n const style = useMemo(() => {\n if (aspectRatio) {\n return {\n aspectRatio,\n maxHeight: \"80vh\",\n width: node.attrs.width,\n };\n }\n return {\n width: node.attrs.width,\n };\n }, [aspectRatio]);\n return (\n <NodeViewWrapper className={className}>\n <div\n className={cn(wrapperClassName, \"main-videojs-wrapper aspect-square\")}\n ref={videoWrapperRef}\n style={style}\n >\n {error && <div>{error}</div>}\n {/* <video\n controls\n className=\"block\"\n src={src}\n poster={poster}\n title=\"\"\n onClick={onClick}\n /> */}\n {playlistContent && <VideoPlayer options={videoJsOptions} />}\n </div>\n {caption && playlistContent?.title && (\n <div\n className=\"block mx-auto text-sm text-gray-500\"\n style={{ width: node.attrs.width }}\n >\n {playlistContent?.title}\n </div>\n )}\n </NodeViewWrapper>\n );\n};\n\nexport default VideoBlockViewClientside;\n"],"names":["NodeViewWrapper","React","useEffect","useMemo","useRef","cn","VideoPlayer","useGetAssetsAspectRatio","VideoBlockViewClientside","className","getVideoAspect","props","node","videoWrapperRef","src","poster","playlistUrl","caption","actualWidth","actualHeight","attrs","aspectRatio","calculateAspectRatio","playlistContent","setPlaylistContent","useState","error","setError","getPlaylistContent","res","fetch","cache","json","then","data","catch","err","wrapperClassName","align","videoJsOptions","undefined","items","some","item","type","sources","filter","map","label","preload","length","source","find","width","height","style","maxHeight","div","ref","options","title"],"mappings":";AACA,SAASA,eAAe,QAAQ,gBAAgB;AAChD,OAAOC,SAASC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,QAAQ;AAC1D,SAASC,EAAE,QAAQ,8BAA8B;AACjD,OAAOC,iBAAiB,2BAA2B;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AAC+B;kCAAK/B;;oBASfH,iCAAmB,KAACjB;wBAAYqD,SAASpB;;;;YAE3CtB,WAAWM,iBAAiBqC,uBAC3B,KAACH;gBACChD,WAAU;gBACV8C,OAAO;oBAAEF,OAAOzC,KAAKQ,KAAK,CAACiC,KAAK;gBAAC;0BAEhC9B,iBAAiBqC;;;;AAK5B,EAAE;AAEF,eAAepD,yBAAyB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockViewClientside.tsx"],"sourcesContent":["import { Node } from \"@tiptap/pm/model\";\r\nimport { NodeViewWrapper } from \"@tiptap/react\";\r\nimport React, { useEffect, useMemo, useRef } from \"react\";\r\nimport { cn } from \"../../../lib/utils/index.js\";\r\nimport VideoPlayer from \"./videojs/VideoPlayer.js\";\r\nimport { useGetAssetsAspectRatio } from \"../../serverside/getAssetsAspectRatio.js\";\r\n\r\ninterface VideoBlockViewProps {\r\n node: Node & {\r\n attrs: {\r\n src: string;\r\n poster: string;\r\n assetId: string;\r\n playlistUrl?: string;\r\n };\r\n };\r\n className?: string;\r\n getVideoAspect?: () => void;\r\n}\r\n\r\nexport type Playlist = {\r\n id: string;\r\n title: string;\r\n description: string;\r\n poster: string;\r\n items: Item[];\r\n};\r\n\r\nexport type Item = {\r\n src: string;\r\n type: string;\r\n label: string;\r\n width: number;\r\n height: number;\r\n};\r\n\r\nexport const VideoBlockViewClientside = ({\r\n className,\r\n getVideoAspect,\r\n ...props\r\n}: VideoBlockViewProps) => {\r\n const { node } = props;\r\n const videoWrapperRef = useRef<HTMLDivElement>(null);\r\n const { src, poster, playlistUrl, caption, actualWidth, actualHeight } =\r\n node.attrs;\r\n const { aspectRatio, calculateAspectRatio } = useGetAssetsAspectRatio();\r\n const [playlistContent, setPlaylistContent] = React.useState<\r\n Playlist | undefined\r\n >();\r\n const [error, setError] = React.useState();\r\n\r\n useEffect(() => {\r\n async function getPlaylistContent() {\r\n const res = await fetch(playlistUrl, {\r\n cache: \"no-cache\",\r\n });\r\n return await res.json();\r\n }\r\n\r\n if (playlistUrl) {\r\n try {\r\n getPlaylistContent()\r\n .then((data) => {\r\n setPlaylistContent(data);\r\n })\r\n .catch((err) => {\r\n setError(err);\r\n });\r\n } catch (error) {\r\n setError(error);\r\n }\r\n }\r\n }, [playlistUrl]);\r\n\r\n const wrapperClassName = cn(\r\n node.attrs.align === \"left\" ? \"ml-0\" : \"ml-auto\",\r\n node.attrs.align === \"right\" ? \"mr-0\" : \"mr-auto\",\r\n node.attrs.align === \"center\" && \"mx-auto\"\r\n );\r\n\r\n const videoJsOptions = useMemo(() => {\r\n if (playlistContent == undefined) return {};\r\n\r\n if (\r\n playlistContent.items.some(\r\n (item) =>\r\n item.type === \"application/x-mpegURL\" ||\r\n item.type === \"application/vnd.apple.mpegurl\"\r\n )\r\n ) {\r\n return {\r\n sources: playlistContent.items\r\n .filter(\r\n (item) =>\r\n item.type === \"application/x-mpegURL\" ||\r\n item.type === \"application/vnd.apple.mpegurl\"\r\n )\r\n .map((item) => ({\r\n src: item.src,\r\n type: item.type,\r\n label: item.label,\r\n })),\r\n poster: playlistContent.poster,\r\n preload: \"auto\",\r\n };\r\n }\r\n return {\r\n sources: playlistContent.items.map((item) => ({\r\n src: item.src,\r\n type: item.type,\r\n label: item.label,\r\n })),\r\n poster: playlistContent.poster,\r\n preload: \"auto\",\r\n };\r\n }, [playlistContent]);\r\n\r\n useEffect(() => {\r\n if (!playlistContent?.items?.length) {\r\n return;\r\n }\r\n const source = playlistContent.items.find((item) => item.src);\r\n if (!aspectRatio && source?.src) {\r\n calculateAspectRatio(\r\n {\r\n src: source.src,\r\n actualWidth: actualWidth || source?.width,\r\n actualHeight: actualHeight || source?.height,\r\n },\r\n \"VIDEO\",\r\n getVideoAspect\r\n );\r\n }\r\n }, [playlistContent]);\r\n const style = useMemo(() => {\r\n if (aspectRatio) {\r\n return {\r\n aspectRatio,\r\n maxHeight: \"80vh\",\r\n width: node.attrs.width,\r\n };\r\n }\r\n return {\r\n width: node.attrs.width,\r\n };\r\n }, [aspectRatio]);\r\n return (\r\n <NodeViewWrapper className={className}>\r\n <div\r\n className={cn(wrapperClassName, \"main-videojs-wrapper aspect-square\")}\r\n ref={videoWrapperRef}\r\n style={style}\r\n >\r\n {error && <div>{error}</div>}\r\n {/* <video\r\n controls\r\n className=\"block\"\r\n src={src}\r\n poster={poster}\r\n title=\"\"\r\n onClick={onClick}\r\n /> */}\r\n {playlistContent && <VideoPlayer options={videoJsOptions} />}\r\n </div>\r\n {caption && playlistContent?.title && (\r\n <div\r\n className=\"block mx-auto text-sm text-gray-500\"\r\n style={{ width: node.attrs.width }}\r\n >\r\n {playlistContent?.title}\r\n </div>\r\n )}\r\n </NodeViewWrapper>\r\n );\r\n};\r\n\r\nexport default VideoBlockViewClientside;\r\n"],"names":["NodeViewWrapper","React","useEffect","useMemo","useRef","cn","VideoPlayer","useGetAssetsAspectRatio","VideoBlockViewClientside","className","getVideoAspect","props","node","videoWrapperRef","src","poster","playlistUrl","caption","actualWidth","actualHeight","attrs","aspectRatio","calculateAspectRatio","playlistContent","setPlaylistContent","useState","error","setError","getPlaylistContent","res","fetch","cache","json","then","data","catch","err","wrapperClassName","align","videoJsOptions","undefined","items","some","item","type","sources","filter","map","label","preload","length","source","find","width","height","style","maxHeight","div","ref","options","title"],"mappings":";AACA,SAASA,eAAe,QAAQ,gBAAgB;AAChD,OAAOC,SAASC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,QAAQ;AAC1D,SAASC,EAAE,QAAQ,8BAA8B;AACjD,OAAOC,iBAAiB,2BAA2B;AACnD,SAASC,uBAAuB,QAAQ,2CAA2C;AA+BnF,OAAO,MAAMC,2BAA2B,CAAC,EACvCC,SAAS,EACTC,cAAc,EACd,GAAGC,OACiB;IACpB,MAAM,EAAEC,IAAI,EAAE,GAAGD;IACjB,MAAME,kBAAkBT,OAAuB;IAC/C,MAAM,EAAEU,GAAG,EAAEC,MAAM,EAAEC,WAAW,EA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AyB"}
|
package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockWidth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockWidth.tsx"],"sourcesContent":["import React, { memo, useCallback, useEffect, useState } from \"react\";\n\nexport type VideoBlockWidthProps = {\n onChange: (value: number) => void;\n value: number;\n};\n\nexport const VideoBlockWidth = memo(\n ({ onChange, value }: VideoBlockWidthProps) => {\n const [currentValue, setCurrentValue] = useState(value);\n\n useEffect(() => {\n setCurrentValue(value);\n }, [value]);\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(parseInt(e.target.value));\n },\n [onChange]\n );\n\n return (\n <div className=\"flex items-center gap-2\">\n <input\n className=\"h-2 bg-neutral-200 border-0 rounded appearance-none fill-neutral-300\"\n type=\"range\"\n min=\"25\"\n max=\"100\"\n step=\"25\"\n onChange={handleChange}\n value={currentValue}\n />\n <span className=\"text-xs font-semibold text-neutral-500 select-none\">\n {value}%\n </span>\n </div>\n );\n }\n);\n\nVideoBlockWidth.displayName = \"VideoBlockWidth\";\n"],"names":["React","memo","useCallback","useEffect","useState","VideoBlockWidth","onChange","value","currentValue","setCurrentValue","handleChange","e","parseInt","target","div","className","input","type","min","max","step","span","displayName"],"mappings":";AAAA,OAAOA,SAASC,IAAI,EAAEC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAOtE,OAAO,MAAMC,gCAAkBJ,KAC7B,CAAC,EAAEK,QAAQ,EAAEC,KAAK,EAAwB;IACxC,MAAM,CAACC,cAAcC,gBAAgB,GAAGL,SAASG;IAEjDJ,UAAU;QACRM,gBAAgBF;IAClB,GAAG;QAACA;KAAM;IAEV,MAAMG,eAAeR,YACnB,CAACS;QACCL,SAASM,SAASD,EAAEE,MAAM,CAACN,KAAK;IAClC,GACA;QAACD;KAAS;IAGZ,qBACE,MAACQ;QAAIC,WAAU;;0BACb,KAACC;gBACCD,WAAU;gBACVE,MAAK;gBACLC,KAAI;gBACJC,KAAI;gBACJC,MAAK;gBACLd,UAAUI;gBACVH,OAAOC;;0BAET,MAACa;gBAAKN,WAAU;;oBACbR;oBAAM;;;;;AAIf,GACA;AAEFF,gBAAgBiB,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockWidth.tsx"],"sourcesContent":["import React, { memo, useCallback, useEffect, useState } from \"react\";\r\n\r\nexport type VideoBlockWidthProps = {\r\n onChange: (value: number) => void;\r\n value: number;\r\n};\r\n\r\nexport const VideoBlockWidth = memo(\r\n ({ onChange, value }: VideoBlockWidthProps) => {\r\n const [currentValue, setCurrentValue] = useState(value);\r\n\r\n useEffect(() => {\r\n setCurrentValue(value);\r\n }, [value]);\r\n\r\n const handleChange = useCallback(\r\n (e: React.ChangeEvent<HTMLInputElement>) => {\r\n onChange(parseInt(e.target.value));\r\n },\r\n [onChange]\r\n );\r\n\r\n return (\r\n <div className=\"flex items-center gap-2\">\r\n <input\r\n className=\"h-2 bg-neutral-200 border-0 rounded appearance-none fill-neutral-300\"\r\n type=\"range\"\r\n min=\"25\"\r\n max=\"100\"\r\n step=\"25\"\r\n onChange={handleChange}\r\n value={currentValue}\r\n />\r\n <span className=\"text-xs font-semibold text-neutral-500 select-none\">\r\n {value}%\r\n </span>\r\n </div>\r\n );\r\n }\r\n);\r\n\r\nVideoBlockWidth.displayName = \"VideoBlockWidth\";\r\n"],"names":["React","memo","useCallback","useEffect","useState","VideoBlockWidth","onChange","value","currentValue","setCurrentValue","handleChange","e","parseInt","target","div","className","input","type","min","max","step","span","displayName"],"mappings":";AAAA,OAAOA,SAASC,IAAI,EAAEC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAOtE,OAAO,MAAMC,gCAAkBJ,KAC7B,CAAC,EAAEK,QAAQ,EAAEC,KAAK,EAAwB;IACxC,MAAM,CAACC,cAAcC,gBAAgB,GAAGL,SAASG;IAEjDJ,UAAU;QACRM,gBAAgBF;IAClB,GAAG;QAACA;KAAM;IAEV,MAAMG,eAAeR,YACnB,CAACS;QACCL,SAASM,SAASD,EAAEE,MAAM,CAACN,KAAK;IAClC,GACA;QAACD;KAAS;IAGZ,qBACE,MAACQ;QAAIC,WAAU;;0BACb,KAACC;gBACCD,WAAU;gBACVE,MAAK;gBACLC,KAAI;gBACJC,KAAI;gBACJC,MAAK;gBACLd,UAAUI;gBACVH,OAAOC;;0BAET,MAACa;gBAAKN,WAAU;;oBACbR;oBAAM;;;;;AAIf,GACA;AAEFF,gBAAgBiB,WAAW,GAAG"}
|
package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/VideoPlayer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/VideoPlayer.tsx"],"sourcesContent":["import React, { CSSProperties } from \"react\";\nimport videojs, {\n VideoJsPlayer,\n VideoJsPlayerOptions,\n} from \"video.js/dist/video.js\";\nimport \"video.js/dist/video-js.css\";\n\n// Styles\nimport \"video.js/dist/video-js.css\";\n\nimport { QualitySelector } from \"./quality-selector/index.js\";\n\ninterface IVideoPlayerProps {\n options: VideoJsPlayerOptions;\n}\n\nconst initialOptions: VideoJsPlayerOptions = {\n controls: true,\n fluid: true,\n controlBar: {\n volumePanel: {\n inline: false,\n },\n },\n};\n\nconst VideoPlayer: React.FC<IVideoPlayerProps & { style?: CSSProperties }> = ({\n options,\n style,\n}) => {\n const videoNode = React.useRef<HTMLVideoElement>(null);\n const player = React.useRef<videojs.Player>(null);\n\n React.useEffect(() => {\n QualitySelector(videojs);\n\n player.current = videojs(videoNode.current, {\n ...initialOptions,\n ...options,\n }).ready(function () {\n if (\n !this.controlBar\n .children()\n .some((c: { name_: string }) => c.name_ === \"QualitySelector\")\n ) {\n this.controlBar.addChild(\"QualitySelector\");\n }\n });\n return () => {\n if (player.current) {\n player.current.dispose();\n }\n };\n }, [options]);\n\n return <video ref={videoNode} className=\"video-js\" style={style} />;\n};\n\nexport default VideoPlayer;\n"],"names":["React","videojs","QualitySelector","initialOptions","controls","fluid","controlBar","volumePanel","inline","VideoPlayer","options","style","videoNode","useRef","player","useEffect","current","ready","children","some","c","name_","addChild","dispose","video","ref","className"],"mappings":";AAAA,OAAOA,WAA8B,QAAQ;AAC7C,OAAOC,aAGA,yBAAyB;AAChC,OAAO,6BAA6B;AAEpC,SAAS;AACT,OAAO,6BAA6B;AAEpC,SAASC,eAAe,QAAQ,8BAA8B;AAM9D,MAAMC,iBAAuC;IAC3CC,UAAU;IACVC,OAAO;IACPC,YAAY;QACVC,aAAa;YACXC,QAAQ;QACV;IACF;AACF;AAEA,MAAMC,cAAuE,CAAC,EAC5EC,OAAO,EACPC,KAAK,EACN;IACC,MAAMC,YAAYZ,MAAMa,MAAM,CAAmB;IACjD,MAAMC,SAASd,MAAMa,MAAM,CAAiB;IAE5Cb,MAAMe,SAAS,CAAC;QACdb,gBAAgBD;QAEhBa,OAAOE,OAAO,GAAGf,QAAQW,UAAUI,OAAO,EAAE;YAC1C,GAAGb,cAAc;YACjB,GAAGO,OAAO;QACZ,GAAGO,KAAK,CAAC;YACP,IACE,CAAC,IAAI,CAACX,UAAU,CACbY,QAAQ,GACRC,IAAI,CAAC,CAACC,IAAyBA,EAAEC,KAAK,KAAK,oBAC9C;gBACA,IAAI,CAACf,UAAU,CAACgB,QAAQ,CAAC;YAC3B;QACF;QACA,OAAO;YACL,IAAIR,OAAOE,OAAO,EAAE;gBAClBF,OAAOE,OAAO,CAACO,OAAO;YACxB;QACF;IACF,GAAG;QAACb;KAAQ;IAEZ,qBAAO,KAACc;QAAMC,KAAKb;QAAWc,WAAU;QAAWf,OAAOA;;AAC5D;AAEA,eAAeF,YAAY"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/VideoPlayer.tsx"],"sourcesContent":["import React, { CSSProperties } from \"react\";\r\nimport videojs, {\r\n VideoJsPlayer,\r\n VideoJsPlayerOptions,\r\n} from \"video.js/dist/video.js\";\r\nimport \"video.js/dist/video-js.css\";\r\n\r\n// Styles\r\nimport \"video.js/dist/video-js.css\";\r\n\r\nimport { QualitySelector } from \"./quality-selector/index.js\";\r\n\r\ninterface IVideoPlayerProps {\r\n options: VideoJsPlayerOptions;\r\n}\r\n\r\nconst initialOptions: VideoJsPlayerOptions = {\r\n controls: true,\r\n fluid: true,\r\n controlBar: {\r\n volumePanel: {\r\n inline: false,\r\n },\r\n },\r\n};\r\n\r\nconst VideoPlayer: React.FC<IVideoPlayerProps & { style?: CSSProperties }> = ({\r\n options,\r\n style,\r\n}) => {\r\n const videoNode = React.useRef<HTMLVideoElement>(null);\r\n const player = React.useRef<videojs.Player>(null);\r\n\r\n React.useEffect(() => {\r\n QualitySelector(videojs);\r\n\r\n player.current = videojs(videoNode.current, {\r\n ...initialOptions,\r\n ...options,\r\n }).ready(function () {\r\n if (\r\n !this.controlBar\r\n .children()\r\n .some((c: { name_: string }) => c.name_ === \"QualitySelector\")\r\n ) {\r\n this.controlBar.addChild(\"QualitySelector\");\r\n }\r\n });\r\n return () => {\r\n if (player.current) {\r\n player.current.dispose();\r\n }\r\n };\r\n }, [options]);\r\n\r\n return <video ref={videoNode} className=\"video-js\" style={style} />;\r\n};\r\n\r\nexport default VideoPlayer;\r\n"],"names":["React","videojs","QualitySelector","initialOptions","controls","fluid","controlBar","volumePanel","inline","VideoPlayer","options","style","videoNode","useRef","player","useEffect","current","ready","children","some","c","name_","addChild","dispose","video","ref","className"],"mappings":";AAAA,OAAOA,WAA8B,QAAQ;AAC7C,OAAOC,aAGA,yBAAyB;AAChC,OAAO,6BAA6B;AAEpC,SAAS;AACT,OAAO,6BAA6B;AAEpC,SAASC,eAAe,QAAQ,8BAA8B;AAM9D,MAAMC,iBAAuC;IAC3CC,UAAU;IACVC,OAAO;IACPC,YAAY;QACVC,aAAa;YACXC,QAAQ;QACV;IACF;AACF;AAEA,MAAMC,cAAuE,CAAC,EAC5EC,OAAO,EACPC,KAAK,EACN;IACC,MAAMC,YAAYZ,MAAMa,MAAM,CAAmB;IACjD,MAAMC,SAASd,MAAMa,MAAM,CAAiB;IAE5Cb,MAAMe,SAAS,CAAC;QACdb,gBAAgBD;QAEhBa,OAAOE,OAAO,GAAGf,QAAQW,UAAUI,OAAO,EAAE;YAC1C,GAAGb,cAAc;YACjB,GAAGO,OAAO;QACZ,GAAGO,KAAK,CAAC;YACP,IACE,CAAC,IAAI,CAACX,UAAU,CACbY,QAAQ,GACRC,IAAI,CAAC,CAACC,IAAyBA,EAAEC,KAAK,KAAK,oBAC9C;gBACA,IAAI,CAACf,UAAU,CAACgB,QAAQ,CAAC;YAC3B;QACF;QACA,OAAO;YACL,IAAIR,OAAOE,OAAO,EAAE;gBAClBF,OAAOE,OAAO,CAACO,OAAO;YACxB;QACF;IACF,GAAG;QAACb;KAAQ;IAEZ,qBAAO,KAACc;QAAMC,KAAKb;QAAWc,WAAU;QAAWf,OAAOA;;AAC5D;AAEA,eAAeF,YAAY"}
|
|
@@ -2,14 +2,14 @@ import * as events from "../events.js";
|
|
|
2
2
|
import _ from "underscore";
|
|
3
3
|
export default function QualityOption(videojs) {
|
|
4
4
|
var MenuItem = videojs.getComponent("MenuItem");
|
|
5
|
-
/**
|
|
6
|
-
* A MenuItem to represent a video resolution
|
|
7
|
-
*
|
|
8
|
-
* @class QualityOption
|
|
9
|
-
* @extends videojs.MenuItem
|
|
5
|
+
/**
|
|
6
|
+
* A MenuItem to represent a video resolution
|
|
7
|
+
*
|
|
8
|
+
* @class QualityOption
|
|
9
|
+
* @extends videojs.MenuItem
|
|
10
10
|
*/ return class QualityOption extends MenuItem {
|
|
11
|
-
/**
|
|
12
|
-
* @inheritdoc
|
|
11
|
+
/**
|
|
12
|
+
* @inheritdoc
|
|
13
13
|
*/ constructor(player, options){
|
|
14
14
|
var source = options.source;
|
|
15
15
|
if (!_.isObject(source)) {
|
|
@@ -22,8 +22,8 @@ export default function QualityOption(videojs) {
|
|
|
22
22
|
super(player, options);
|
|
23
23
|
this.source = source;
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
26
|
-
* @inheritdoc
|
|
25
|
+
/**
|
|
26
|
+
* @inheritdoc
|
|
27
27
|
*/ handleClick(event) {
|
|
28
28
|
super.handleClick(event);
|
|
29
29
|
this.player().trigger(events.QUALITY_REQUESTED, this.source);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/components/QualityOption.js"],"sourcesContent":["import * as events from \"../events.js\";\nimport _ from \"underscore\";\n\nexport default function QualityOption(videojs) {\n var MenuItem = videojs.getComponent(\"MenuItem\");\n\n /**\n * A MenuItem to represent a video resolution\n *\n * @class QualityOption\n * @extends videojs.MenuItem\n */\n return class QualityOption extends MenuItem {\n /**\n * @inheritdoc\n */\n constructor(player, options) {\n var source = options.source;\n\n if (!_.isObject(source)) {\n throw new Error(\n 'was not provided a \"source\" object, but rather: ' + typeof source\n );\n }\n\n options = _.extend(\n {\n selectable: true,\n label: source.label,\n },\n options\n );\n\n super(player, options);\n\n this.source = source;\n }\n\n /**\n * @inheritdoc\n */\n handleClick(event) {\n super.handleClick(event);\n this.player().trigger(events.QUALITY_REQUESTED, this.source);\n }\n };\n}\n"],"names":["events","_","QualityOption","videojs","MenuItem","getComponent","constructor","player","options","source","isObject","Error","extend","selectable","label","handleClick","event","trigger","QUALITY_REQUESTED"],"mappings":"AAAA,YAAYA,YAAY,eAAe;AACvC,OAAOC,OAAO,aAAa;AAE3B,eAAe,SAASC,cAAcC,OAAO;IAC3C,IAAIC,WAAWD,QAAQE,YAAY,CAAC;IAEpC;;;;;GAKC,GACD,OAAO,MAAMH,sBAAsBE;QACjC;;KAEC,GACDE,YAAYC,MAAM,EAAEC,OAAO,CAAE;YAC3B,IAAIC,SAASD,QAAQC,MAAM;YAE3B,IAAI,CAACR,EAAES,QAAQ,CAACD,SAAS;gBACvB,MAAM,IAAIE,MACR,qDAAqD,OAAOF;YAEhE;YAEAD,UAAUP,EAAEW,MAAM,CAChB;gBACEC,YAAY;gBACZC,OAAOL,OAAOK,KAAK;YACrB,GACAN;YAGF,KAAK,CAACD,QAAQC;YAEd,IAAI,CAACC,MAAM,GAAGA;QAChB;QAEA;;KAEC,GACDM,YAAYC,KAAK,EAAE;YACjB,KAAK,CAACD,YAAYC;YAClB,IAAI,CAACT,MAAM,GAAGU,OAAO,CAACjB,OAAOkB,iBAAiB,EAAE,IAAI,CAACT,MAAM;QAC7D;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/components/QualityOption.js"],"sourcesContent":["import * as events from \"../events.js\";\r\nimport _ from \"underscore\";\r\n\r\nexport default function QualityOption(videojs) {\r\n var MenuItem = videojs.getComponent(\"MenuItem\");\r\n\r\n /**\r\n * A MenuItem to represent a video resolution\r\n *\r\n * @class QualityOption\r\n * @extends videojs.MenuItem\r\n */\r\n return class QualityOption extends MenuItem {\r\n /**\r\n * @inheritdoc\r\n */\r\n constructor(player, options) {\r\n var source = options.source;\r\n\r\n if (!_.isObject(source)) {\r\n throw new Error(\r\n 'was not provided a \"source\" object, but rather: ' + typeof source\r\n );\r\n }\r\n\r\n options = _.extend(\r\n {\r\n selectable: true,\r\n label: source.label,\r\n },\r\n options\r\n );\r\n\r\n super(player, options);\r\n\r\n this.source = source;\r\n }\r\n\r\n /**\r\n * @inheritdoc\r\n */\r\n handleClick(event) {\r\n super.handleClick(event);\r\n this.player().trigger(events.QUALITY_REQUESTED, this.source);\r\n }\r\n };\r\n}\r\n"],"names":["events","_","QualityOption","videojs","MenuItem","getComponent","constructor","player","options","source","isObject","Error","extend","selectable","label","handleClick","event","trigger","QUALITY_REQUESTED"],"mappings":"AAAA,YAAYA,YAAY,eAAe;AACvC,OAAOC,OAAO,aAAa;AAE3B,eAAe,SAASC,cAAcC,OAAO;IAC3C,IAAIC,WAAWD,QAAQE,YAAY,CAAC;IAEpC;;;;;GAKC,GACD,OAAO,MAAMH,sBAAsBE;QACjC;;KAEC,GACDE,YAAYC,MAAM,EAAEC,OAAO,CAAE;YAC3B,IAAIC,SAASD,QAAQC,MAAM;YAE3B,IAAI,CAACR,EAAES,QAAQ,CAACD,SAAS;gBACvB,MAAM,IAAIE,MACR,qDAAqD,OAAOF;YAEhE;YAEAD,UAAUP,EAAEW,MAAM,CAChB;gBACEC,YAAY;gBACZC,OAAOL,OAAOK,KAAK;YACrB,GACAN;YAGF,KAAK,CAACD,QAAQC;YAEd,IAAI,CAACC,MAAM,GAAGA;QAChB;QAEA;;KAEC,GACDM,YAAYC,KAAK,EAAE;YACjB,KAAK,CAACD,YAAYC;YAClB,IAAI,CAACT,MAAM,GAAGU,OAAO,CAACjB,OAAOkB,iBAAiB,EAAE,IAAI,CAACT,MAAM;QAC7D;IACF;AACF"}
|
|
@@ -4,14 +4,14 @@ import { default as qualityOptionFactory } from "./QualityOption.js";
|
|
|
4
4
|
const QUALITY_CHANGE_CLASS = "vjs-quality-changing";
|
|
5
5
|
export default function QualitySelector(videojs) {
|
|
6
6
|
var MenuButton = videojs.getComponent("MenuButton"), QualityOption = qualityOptionFactory(videojs);
|
|
7
|
-
/**
|
|
8
|
-
* A component for changing video resolutions
|
|
9
|
-
*
|
|
10
|
-
* @class QualitySelector
|
|
11
|
-
* @extends videojs.Button
|
|
7
|
+
/**
|
|
8
|
+
* A component for changing video resolutions
|
|
9
|
+
*
|
|
10
|
+
* @class QualitySelector
|
|
11
|
+
* @extends videojs.Button
|
|
12
12
|
*/ class QualitySelector extends MenuButton {
|
|
13
|
-
/**
|
|
14
|
-
* @inheritdoc
|
|
13
|
+
/**
|
|
14
|
+
* @inheritdoc
|
|
15
15
|
*/ constructor(player, options){
|
|
16
16
|
super(player, options);
|
|
17
17
|
// Update interface instantly so the user's change is acknowledged
|
|
@@ -38,10 +38,10 @@ export default function QualitySelector(videojs) {
|
|
|
38
38
|
}).bind(this));
|
|
39
39
|
this.controlText("Open quality selector menu");
|
|
40
40
|
}
|
|
41
|
-
/**
|
|
42
|
-
* Updates the source that is selected in the menu
|
|
43
|
-
*
|
|
44
|
-
* @param source {object} player source to display as selected
|
|
41
|
+
/**
|
|
42
|
+
* Updates the source that is selected in the menu
|
|
43
|
+
*
|
|
44
|
+
* @param source {object} player source to display as selected
|
|
45
45
|
*/ setSelectedSource(source) {
|
|
46
46
|
var src = source ? source.src : undefined;
|
|
47
47
|
if (this.selectedSrc !== src) {
|
|
@@ -51,8 +51,8 @@ export default function QualitySelector(videojs) {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
/**
|
|
55
|
-
* @inheritdoc
|
|
54
|
+
/**
|
|
55
|
+
* @inheritdoc
|
|
56
56
|
*/ createItems() {
|
|
57
57
|
var player = this.player(), sources = player.currentSources();
|
|
58
58
|
if (!sources || sources.length < 2) {
|
|
@@ -65,8 +65,8 @@ export default function QualitySelector(videojs) {
|
|
|
65
65
|
});
|
|
66
66
|
}).bind(this));
|
|
67
67
|
}
|
|
68
|
-
/**
|
|
69
|
-
* @inheritdoc
|
|
68
|
+
/**
|
|
69
|
+
* @inheritdoc
|
|
70
70
|
*/ buildWrapperCSSClass() {
|
|
71
71
|
return "vjs-quality-selector " + super.buildWrapperCSSClass();
|
|
72
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/components/QualitySelector.js"],"sourcesContent":["import * as events from \"../events.js\";\nimport _ from \"underscore\";\n\nimport { default as qualityOptionFactory } from \"./QualityOption.js\";\n\nconst QUALITY_CHANGE_CLASS = \"vjs-quality-changing\";\n\nexport default function QualitySelector(videojs) {\n var MenuButton = videojs.getComponent(\"MenuButton\"),\n QualityOption = qualityOptionFactory(videojs);\n\n /**\n * A component for changing video resolutions\n *\n * @class QualitySelector\n * @extends videojs.Button\n */\n class QualitySelector extends MenuButton {\n /**\n * @inheritdoc\n */\n constructor(player, options) {\n super(player, options);\n\n // Update interface instantly so the user's change is acknowledged\n player.on(\n events.QUALITY_REQUESTED,\n function (event, newSource) {\n this.setSelectedSource(newSource);\n player.addClass(QUALITY_CHANGE_CLASS);\n\n player.one(\"loadeddata\", function () {\n player.removeClass(QUALITY_CHANGE_CLASS);\n });\n }.bind(this)\n );\n\n // Update the list of menu items only when the list of sources change\n player.on(\n events.PLAYER_SOURCES_CHANGED,\n function () {\n this.update();\n }.bind(this)\n );\n\n player.on(\n events.QUALITY_SELECTED,\n function (event, newSource) {\n // Update the selected source with the source that was actually selected\n this.setSelectedSource(newSource);\n }.bind(this)\n );\n\n // Since it's possible for the player to get a source before the selector is\n // created, make sure to update once we get a \"ready\" signal.\n player.one(\n \"ready\",\n function () {\n this.selectedSrc = player.src();\n this.update();\n }.bind(this)\n );\n\n this.controlText(\"Open quality selector menu\");\n }\n\n /**\n * Updates the source that is selected in the menu\n *\n * @param source {object} player source to display as selected\n */\n setSelectedSource(source) {\n var src = source ? source.src : undefined;\n\n if (this.selectedSrc !== src) {\n this.selectedSrc = src;\n _.each(this.items, function (item) {\n item.selected(item.source.src === src);\n });\n }\n }\n\n /**\n * @inheritdoc\n */\n createItems() {\n var player = this.player(),\n sources = player.currentSources();\n\n if (!sources || sources.length < 2) {\n return [];\n }\n\n return _.map(\n sources,\n function (source) {\n return new QualityOption(player, {\n source: source,\n selected: source.src === this.selectedSrc,\n });\n }.bind(this)\n );\n }\n\n /**\n * @inheritdoc\n */\n buildWrapperCSSClass() {\n return \"vjs-quality-selector \" + super.buildWrapperCSSClass();\n }\n }\n\n videojs.registerComponent(\"QualitySelector\", QualitySelector);\n\n return QualitySelector;\n}\n"],"names":["events","_","default","qualityOptionFactory","QUALITY_CHANGE_CLASS","QualitySelector","videojs","MenuButton","getComponent","QualityOption","constructor","player","options","on","QUALITY_REQUESTED","event","newSource","setSelectedSource","addClass","one","removeClass","bind","PLAYER_SOURCES_CHANGED","update","QUALITY_SELECTED","selectedSrc","src","controlText","source","undefined","each","items","item","selected","createItems","sources","currentSources","length","map","buildWrapperCSSClass","registerComponent"],"mappings":"AAAA,YAAYA,YAAY,eAAe;AACvC,OAAOC,OAAO,aAAa;AAE3B,SAASC,WAAWC,oBAAoB,QAAQ,qBAAqB;AAErE,MAAMC,uBAAuB;AAE7B,eAAe,SAASC,gBAAgBC,OAAO;IAC7C,IAAIC,aAAaD,QAAQE,YAAY,CAAC,eACpCC,gBAAgBN,qBAAqBG;IAEvC;;;;;GAKC,GACD,MAAMD,wBAAwBE;QAC5B;;KAEC,GACDG,YAAYC,MAAM,EAAEC,OAAO,CAAE;YAC3B,KAAK,CAACD,QAAQC;YAEd,kEAAkE;YAClED,OAAOE,EAAE,CACPb,OAAOc,iBAAiB,EACxB,CAAA,SAAUC,KAAK,EAAEC,SAAS;gBACxB,IAAI,CAACC,iBAAiB,CAACD;gBACvBL,OAAOO,QAAQ,CAACd;gBAEhBO,OAAOQ,GAAG,CAAC,cAAc;oBACvBR,OAAOS,WAAW,CAAChB;gBACrB;YACF,CAAA,EAAEiB,IAAI,CAAC,IAAI;YAGb,qEAAqE;YACrEV,OAAOE,EAAE,CACPb,OAAOsB,sBAAsB,EAC7B,CAAA;gBACE,IAAI,CAACC,MAAM;YACb,CAAA,EAAEF,IAAI,CAAC,IAAI;YAGbV,OAAOE,EAAE,CACPb,OAAOwB,gBAAgB,EACvB,CAAA,SAAUT,KAAK,EAAEC,SAAS;gBACxB,wEAAwE;gBACxE,IAAI,CAACC,iBAAiB,CAACD;YACzB,CAAA,EAAEK,IAAI,CAAC,IAAI;YAGb,4EAA4E;YAC5E,6DAA6D;YAC7DV,OAAOQ,GAAG,CACR,SACA,CAAA;gBACE,IAAI,CAACM,WAAW,GAAGd,OAAOe,GAAG;gBAC7B,IAAI,CAACH,MAAM;YACb,CAAA,EAAEF,IAAI,CAAC,IAAI;YAGb,IAAI,CAACM,WAAW,CAAC;QACnB;QAEA;;;;KAIC,GACDV,kBAAkBW,MAAM,EAAE;YACxB,IAAIF,MAAME,SAASA,OAAOF,GAAG,GAAGG;YAEhC,IAAI,IAAI,CAACJ,WAAW,KAAKC,KAAK;gBAC5B,IAAI,CAACD,WAAW,GAAGC;gBACnBzB,EAAE6B,IAAI,CAAC,IAAI,CAACC,KAAK,EAAE,SAAUC,IAAI;oBAC/BA,KAAKC,QAAQ,CAACD,KAAKJ,MAAM,CAACF,GAAG,KAAKA;gBACpC;YACF;QACF;QAEA;;KAEC,GACDQ,cAAc;YACZ,IAAIvB,SAAS,IAAI,CAACA,MAAM,IACtBwB,UAAUxB,OAAOyB,cAAc;YAEjC,IAAI,CAACD,WAAWA,QAAQE,MAAM,GAAG,GAAG;gBAClC,OAAO,EAAE;YACX;YAEA,OAAOpC,EAAEqC,GAAG,CACVH,SACA,CAAA,SAAUP,MAAM;gBACd,OAAO,IAAInB,cAAcE,QAAQ;oBAC/BiB,QAAQA;oBACRK,UAAUL,OAAOF,GAAG,KAAK,IAAI,CAACD,WAAW;gBAC3C;YACF,CAAA,EAAEJ,IAAI,CAAC,IAAI;QAEf;QAEA;;KAEC,GACDkB,uBAAuB;YACrB,OAAO,0BAA0B,KAAK,CAACA;QACzC;IACF;IAEAjC,QAAQkC,iBAAiB,CAAC,mBAAmBnC;IAE7C,OAAOA;AACT"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/components/QualitySelector.js"],"sourcesContent":["import * as events from \"../events.js\";\r\nimport _ from \"underscore\";\r\n\r\nimport { default as qualityOptionFactory } from \"./QualityOption.js\";\r\n\r\nconst QUALITY_CHANGE_CLASS = \"vjs-quality-changing\";\r\n\r\nexport default function QualitySelector(videojs) {\r\n var MenuButton = videojs.getComponent(\"MenuButton\"),\r\n QualityOption = qualityOptionFactory(videojs);\r\n\r\n /**\r\n * A component for changing video resolutions\r\n *\r\n * @class QualitySelector\r\n * @extends videojs.Button\r\n */\r\n class QualitySelector extends MenuButton {\r\n /**\r\n * @inheritdoc\r\n */\r\n constructor(player, options) {\r\n super(player, options);\r\n\r\n // Update interface instantly so the user's change is acknowledged\r\n player.on(\r\n events.QUALITY_REQUESTED,\r\n function (event, newSource) {\r\n this.setSelectedSource(newSource);\r\n player.addClass(QUALITY_CHANGE_CLASS);\r\n\r\n player.one(\"loadeddata\", function () {\r\n player.removeClass(QUALITY_CHANGE_CLASS);\r\n });\r\n }.bind(this)\r\n );\r\n\r\n // Update the list of menu items only when the list of sources change\r\n player.on(\r\n events.PLAYER_SOURCES_CHANGED,\r\n function () {\r\n this.update();\r\n }.bind(this)\r\n );\r\n\r\n player.on(\r\n events.QUALITY_SELECTED,\r\n function (event, newSource) {\r\n // Update the selected source with the source that was actually selected\r\n this.setSelectedSource(newSource);\r\n }.bind(this)\r\n );\r\n\r\n // Since it's possible for the player to get a source before the selector is\r\n // created, make sure to update once we get a \"ready\" signal.\r\n player.one(\r\n \"ready\",\r\n function () {\r\n this.selectedSrc = player.src();\r\n this.update();\r\n }.bind(this)\r\n );\r\n\r\n this.controlText(\"Open quality selector menu\");\r\n }\r\n\r\n /**\r\n * Updates the source that is selected in the menu\r\n *\r\n * @param source {object} player source to display as selected\r\n */\r\n setSelectedSource(source) {\r\n var src = source ? source.src : undefined;\r\n\r\n if (this.selectedSrc !== src) {\r\n this.selectedSrc = src;\r\n _.each(this.items, function (item) {\r\n item.selected(item.source.src === src);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * @inheritdoc\r\n */\r\n createItems() {\r\n var player = this.player(),\r\n sources = player.currentSources();\r\n\r\n if (!sources || sources.length < 2) {\r\n return [];\r\n }\r\n\r\n return _.map(\r\n sources,\r\n function (source) {\r\n return new QualityOption(player, {\r\n source: source,\r\n selected: source.src === this.selectedSrc,\r\n });\r\n }.bind(this)\r\n );\r\n }\r\n\r\n /**\r\n * @inheritdoc\r\n */\r\n buildWrapperCSSClass() {\r\n return \"vjs-quality-selector \" + super.buildWrapperCSSClass();\r\n }\r\n }\r\n\r\n videojs.registerComponent(\"QualitySelector\", QualitySelector);\r\n\r\n return QualitySelector;\r\n}\r\n"],"names":["events","_","default","qualityOptionFactory","QUALITY_CHANGE_CLASS","QualitySelector","videojs","MenuButton","getComponent","QualityOption","constructor","player","options","on","QUALITY_REQUESTED","event","newSource","setSelectedSource","addClass","one","removeClass","bind","PLAYER_SOURCES_CHANGED","update","QUALITY_SELECTED","selectedSrc","src","controlText","source","undefined","each","items","item","selected","createItems","sources","currentSources","length","map","buildWrapperCSSClass","registerComponent"],"mappings":"AAAA,YAAYA,YAAY,eAAe;AACvC,OAAOC,OAAO,aAAa;AAE3B,SAASC,WAAWC,oBAAoB,QAAQ,qBAAqB;AAErE,MAAMC,uBAAuB;AAE7B,eAAe,SAASC,gBAAgBC,OAAO;IAC7C,IAAIC,aAAaD,QAAQE,YAAY,CAAC,eACpCC,gBAAgBN,qBAAqBG;IAEvC;;;;;GAKC,GACD,MAAMD,wBAAwBE;QAC5B;;KAEC,GACDG,YAAYC,MAAM,EAAEC,OAAO,CAAE;YAC3B,KAAK,CAACD,QAAQC;YAEd,kEAAkE;YAClED,OAAOE,EAAE,CACPb,OAAOc,iBAAiB,EACxB,CAAA,SAAUC,KAAK,EAAEC,SAAS;gBACxB,IAAI,CAACC,iBAAiB,CAACD;gBACvBL,OAAOO,QAAQ,CAACd;gBAEhBO,OAAOQ,GAAG,CAAC,cAAc;oBACvBR,OAAOS,WAAW,CAAChB;gBACrB;YACF,CAAA,EAAEiB,IAAI,CAAC,IAAI;YAGb,qEAAqE;YACrEV,OAAOE,EAAE,CACPb,OAAOsB,sBAAsB,EAC7B,CAAA;gBACE,IAAI,CAACC,MAAM;YACb,CAAA,EAAEF,IAAI,CAAC,IAAI;YAGbV,OAAOE,EAAE,CACPb,OAAOwB,gBA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ts","sourceRoot":"","sources":["../../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/events.js"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/events.js"],"names":[],"mappings":"AAAA,mDAAoD;AACpD,iDAAkD;AAClD,4DAA6D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/events.js"],"sourcesContent":["export const QUALITY_REQUESTED = \"qualityRequested\";\nexport const QUALITY_SELECTED = \"qualitySelected\";\nexport const PLAYER_SOURCES_CHANGED = \"playerSourcesChanged\";\n\nexport default {\n QUALITY_REQUESTED,\n QUALITY_SELECTED,\n PLAYER_SOURCES_CHANGED,\n};\n"],"names":["QUALITY_REQUESTED","QUALITY_SELECTED","PLAYER_SOURCES_CHANGED"],"mappings":"AAAA,OAAO,MAAMA,oBAAoB,mBAAmB;AACpD,OAAO,MAAMC,mBAAmB,kBAAkB;AAClD,OAAO,MAAMC,yBAAyB,uBAAuB;AAE7D,eAAe;IACbF;IACAC;IACAC;AACF,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/events.js"],"sourcesContent":["export const QUALITY_REQUESTED = \"qualityRequested\";\r\nexport const QUALITY_SELECTED = \"qualitySelected\";\r\nexport const PLAYER_SOURCES_CHANGED = \"playerSourcesChanged\";\r\n\r\nexport default {\r\n QUALITY_REQUESTED,\r\n QUALITY_SELECTED,\r\n PLAYER_SOURCES_CHANGED,\r\n};\r\n"],"names":["QUALITY_REQUESTED","QUALITY_SELECTED","PLAYER_SOURCES_CHANGED"],"mappings":"AAAA,OAAO,MAAMA,oBAAoB,mBAAmB;AACpD,OAAO,MAAMC,mBAAmB,kBAAkB;AAClD,OAAO,MAAMC,yBAAyB,uBAAuB;AAE7D,eAAe;IACbF;IACAC;IACAC;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/index.ts"],"sourcesContent":["import _ from \"underscore\";\nimport * as events from \"./events.js\";\nimport { default as qualitySelectorFactory } from \"./components/QualitySelector.js\";\nimport { default as sourceInterceptorFactory } from \"./middleware/SourceInterceptor.js\";\nimport SafeSeek from \"./util/SafeSeek.js\";\nimport type videojs from \"video.js\";\nexport function QualitySelector(videojs: videojs) {\n qualitySelectorFactory(videojs);\n sourceInterceptorFactory(videojs);\n\n videojs.hook(\"setup\", function (player: videojs.Player) {\n function changeQuality(event: any, newSource: { src: any }) {\n var sources = player.currentSources(),\n currentTime = player.currentTime(),\n currentPlaybackRate = player.playbackRate(),\n isPaused = player.paused(),\n selectedSource;\n\n // Clear out any previously selected sources (see: #11)\n _.each(sources, function (source) {\n source.selected = false;\n });\n\n selectedSource = _.findWhere(sources, { src: newSource.src });\n // Note: `_.findWhere` returns a reference to an object. Thus the\n // following updates the original object in `sources`.\n selectedSource.selected = true;\n\n if (player._qualitySelectorSafeSeek) {\n player._qualitySelectorSafeSeek.onQualitySelectionChange();\n }\n\n player.src(sources);\n\n player.ready(function () {\n if (\n !player._qualitySelectorSafeSeek ||\n player._qualitySelectorSafeSeek.hasFinished()\n ) {\n // Either we don't have a pending seek action or the one that we have is no\n // longer applicable. This block must be within a `player.ready` callback\n // because the call to `player.src` above is asynchronous, and so not\n // having it within this `ready` callback would cause the SourceInterceptor\n // to execute after this block instead of before.\n //\n // We save the `currentTime` within the SafeSeek instance because if\n // multiple QUALITY_REQUESTED events are received before the SafeSeek\n // operation finishes, the player's `currentTime` will be `0` if the\n // player's `src` is updated but the player's `currentTime` has not yet\n // been set by the SafeSeek operation.\n player._qualitySelectorSafeSeek = new SafeSeek(player, currentTime);\n player.playbackRate(currentPlaybackRate);\n }\n\n if (!isPaused) {\n player.play();\n }\n });\n }\n\n // Add handler to switch sources when the user requests a change\n player.on(events.QUALITY_REQUESTED, changeQuality);\n });\n}\n\n//export const EVENTS = events;\n"],"names":["_","events","default","qualitySelectorFactory","sourceInterceptorFactory","SafeSeek","QualitySelector","videojs","hook","player","changeQuality","event","newSource","sources","currentSources","currentTime","currentPlaybackRate","playbackRate","isPaused","paused","selectedSource","each","source","selected","findWhere","src","_qualitySelectorSafeSeek","onQualitySelectionChange","ready","hasFinished","play","on","QUALITY_REQUESTED"],"mappings":"AAAA,OAAOA,OAAO,aAAa;AAC3B,YAAYC,YAAY,cAAc;AACtC,SAASC,WAAWC,sBAAsB,QAAQ,kCAAkC;AACpF,SAASD,WAAWE,wBAAwB,QAAQ,oCAAoC;AACxF,OAAOC,cAAc,qBAAqB;AAE1C,OAAO,SAASC,gBAAgBC,OAAgB;IAC9CJ,uBAAuBI;IACvBH,yBAAyBG;IAEzBA,QAAQC,IAAI,CAAC,SAAS,SAAUC,MAAsB;QACpD,SAASC,cAAcC,KAAU,EAAEC,SAAuB;YACxD,IAAIC,UAAUJ,OAAOK,cAAc,IACjCC,cAAcN,OAAOM,WAAW,IAChCC,sBAAsBP,OAAOQ,YAAY,IACzCC,WAAWT,OAAOU,MAAM,IACxBC;YAEF,uDAAuD;YACvDpB,EAAEqB,IAAI,CAACR,SAAS,SAAUS,MAAM;gBAC9BA,OAAOC,QAAQ,GAAG;YACpB;YAEAH,iBAAiBpB,EAAEwB,SAAS,CAACX,SAAS;gBAAEY,KAAKb,UAAUa,GAAG;YAAC;YAC3D,iEAAiE;YACjE,sDAAsD;YACtDL,eAAeG,QAAQ,GAAG;YAE1B,IAAId,OAAOiB,wBAAwB,EAAE;gBACnCjB,OAAOiB,wBAAwB,CAACC,wBAAwB;YAC1D;YAEAlB,OAAOgB,GAAG,CAACZ;YAEXJ,OAAOmB,KAAK,CAAC;gBACX,IACE,CAACnB,OAAOiB,wBAAwB,IAChCjB,OAAOiB,wBAAwB,CAACG,WAAW,IAC3C;oBACA,2EAA2E;oBAC3E,yEAAyE;oBACzE,qEAAqE;oBACrE,2EAA2E;oBAC3E,iDAAiD;oBACjD,EAAE;oBACF,oEAAoE;oBACpE,qEAAqE;oBACrE,oEAAoE;oBACpE,uEAAuE;oBACvE,sCAAsC;oBACtCpB,OAAOiB,wBAAwB,GAAG,IAAIrB,SAASI,QAAQM;oBACvDN,OAAOQ,YAAY,CAACD;gBACtB;gBAEA,IAAI,CAACE,UAAU;oBACbT,OAAOqB,IAAI;gBACb;YACF;QACF;QAEA,gEAAgE;QAChErB,OAAOsB,EAAE,CAAC9B,OAAO+B,iBAAiB,EAAEtB;IACtC;AACF,EAEA,+BAA+B"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/index.ts"],"sourcesContent":["import _ from \"underscore\";\r\nimport * as events from \"./events.js\";\r\nimport { default as qualitySelectorFactory } from \"./components/QualitySelector.js\";\r\nimport { default as sourceInterceptorFactory } from \"./middleware/SourceInterceptor.js\";\r\nimport SafeSeek from \"./util/SafeSeek.js\";\r\nimport type videojs from \"video.js\";\r\nexport function QualitySelector(videojs: videojs) {\r\n qualitySelectorFactory(videojs);\r\n sourceInterceptorFactory(videojs);\r\n\r\n videojs.hook(\"setup\", function (player: videojs.Player) {\r\n function changeQuality(event: any, newSource: { src: any }) {\r\n var sources = player.currentSources(),\r\n currentTime = player.currentTime(),\r\n currentPlaybackRate = player.playbackRate(),\r\n isPaused = player.paused(),\r\n selectedSource;\r\n\r\n // Clear out any previously selected sources (see: #11)\r\n _.each(sources, function (source) {\r\n source.selected = false;\r\n });\r\n\r\n selectedSource = _.findWhere(sources, { src: newSource.src });\r\n // Note: `_.findWhere` returns a reference to an object. Thus the\r\n // following updates the original object in `sources`.\r\n selectedSource.selected = true;\r\n\r\n if (player._qualitySelectorSafeSeek) {\r\n player._qualitySelectorSafeSeek.onQualitySelectionChange();\r\n }\r\n\r\n player.src(sources);\r\n\r\n player.ready(function () {\r\n if (\r\n !player._qualitySelectorSafeSeek ||\r\n player._qualitySelectorSafeSeek.hasFinished()\r\n ) {\r\n // Either we don't have a pending seek action or the one that we have is no\r\n // longer applicable. This block must be within a `player.ready` callback\r\n // because the call to `player.src` above is asynchronous, and so not\r\n // having it within this `ready` callback would cause the SourceInterceptor\r\n // to execute after this block instead of before.\r\n //\r\n // We save the `currentTime` within the SafeSeek instance because if\r\n // multiple QUALITY_REQUESTED events are received before the SafeSeek\r\n // operation finishes, the player's `currentTime` will be `0` if the\r\n // player's `src` is updated but the player's `currentTime` has not yet\r\n // been set by the SafeSeek operation.\r\n player._qualitySelectorSafeSeek = new SafeSeek(player, currentTime);\r\n player.playbackRate(currentPlaybackRate);\r\n }\r\n\r\n if (!isPaused) {\r\n player.play();\r\n }\r\n });\r\n }\r\n\r\n // Add handler to switch sources when the user requests a change\r\n player.on(events.QUALITY_REQUESTED, changeQuality);\r\n });\r\n}\r\n\r\n//export const EVENTS = events;\r\n"],"names":["_","events","default","qualitySelectorFactory","sourceInterceptorFactory","SafeSeek","QualitySelector","videojs","hook","player","changeQuality","event","newSource","sources","currentSources","currentTime","currentPlaybackRate","playbackRate","isPaused","paused","selectedSource","each","source","selected","findWhere","src","_qualitySelectorSafeSeek","onQualitySelectionChange","ready","hasFinished","play","on","QUALITY_REQUESTED"],"mappings":"AAAA,OAAOA,OAAO,aAAa;AAC3B,YAAYC,YAAY,cAAc;AACtC,SAASC,WAAWC,sBAAsB,QAAQ,kCAAkC;AACpF,SAASD,WAAWE,wBAAwB,QAAQ,oCAAoC;AACxF,OAAOC,cAAc,qBAAqB;AAE1C,OAAO,SAASC,gBAAgBC,OAAgB;IAC9CJ,uBAAuBI;IACvBH,yBAAyBG;IAEzBA,QAAQC,IAAI,CAAC,SAAS,SAAUC,MAAsB;QACpD,SAASC,cAAcC,KAAU,EAAEC,SAAuB;YACxD,IAAIC,UAAUJ,OAAOK,cAAc,IACjCC,cAAcN,OAAOM,WAAW,IAChCC,sBAAsBP,OAAOQ,YAAY,IACzCC,WAAWT,OAAOU,MAAM,IACxBC;YAEF,uDAAuD;YACvDpB,EAAEqB,IAAI,CAACR,SAAS,SAAUS,MAAM;gBAC9BA,OAAOC,QAAQ,GAAG;YACpB;YAEAH,iBAAiBpB,EAAEwB,SAAS,CAACX,SAAS;gBAAEY,KAAKb,UAAUa,GAAG;YAAC;YAC3D,iEAAiE;YACjE,sDAAsD;YACtDL,eAAeG,QAAQ,GAAG;YAE1B,IAAId,OAAOiB,wBAAwB,EAAE;gBACnCjB,OAAOiB,wBAAwB,CAACC,wBAAwB;YAC1D;YAEAlB,OAAOgB,GAAG,CAACZ;YAEXJ,OAAOmB,KAAK,CAAC;gBACX,IACE,CAACnB,OAAOiB,wBAAwB,IAChCjB,OAAOiB,wBAAwB,CAACG,WAAW,IAC3C;oBACA,2EAA2E;oBAC3E,yEAAyE;oBACzE,qEAAqE;oBACrE,2EAA2E;oBAC3E,iDAAiD;oBACjD,EAAE;oBACF,oEAAoE;oBACpE,qEAAqE;oBACrE,oEAAoE;oBACpE,uEAAuE;oBACvE,sCAAsC;oBACtCpB,OAAOiB,wBAAwB,GAAG,IAAIrB,SAASI,QAAQM;oBACvDN,OAAOQ,YAAY,CAACD;gBACtB;gBAEA,IAAI,CAACE,UAAU;oBACbT,OAAOqB,IAAI;gBACb;YACF;QACF;QAEA,gEAAgE;QAChErB,OAAOsB,EAAE,CAAC9B,OAAO+B,iBAAiB,EAAEtB;IACtC;AACF,EAEA,+BAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/middleware/SourceInterceptor.js"],"sourcesContent":["import _ from \"underscore\";\nimport * as events from \"../events.js\";\n\nexport default function SourceInterceptor(videojs) {\n videojs.use(\"*\", function (player) {\n return {\n setSource: function (playerSelectedSource, next) {\n var sources = player.currentSources(),\n userSelectedSource,\n chosenSource;\n\n if (player._qualitySelectorSafeSeek) {\n player._qualitySelectorSafeSeek.onPlayerSourcesChange();\n }\n\n if (!_.isEqual(sources, player._qualitySelectorPreviousSources)) {\n player.trigger(events.PLAYER_SOURCES_CHANGED, sources);\n player._qualitySelectorPreviousSources = sources;\n }\n\n // There are generally two source options, the one that videojs\n // auto-selects and the one that a \"user\" of this plugin has\n // supplied via the `selected` property. `selected` can come from\n // either the `<source>` tag or the list of sources passed to\n // videojs using `src()`.\n\n userSelectedSource = _.find(sources, function (source) {\n // Must check for boolean values as well as either the string 'true' or\n // 'selected'. When sources are set programmatically, the value will be a\n // boolean, but those coming from a `<source>` tag will be a string.\n return (\n source.selected === true ||\n source.selected === \"true\" ||\n source.selected === \"selected\"\n );\n });\n\n chosenSource = userSelectedSource || playerSelectedSource;\n\n player.trigger(events.QUALITY_SELECTED, chosenSource);\n\n // Pass along the chosen source\n next(null, chosenSource);\n },\n };\n });\n}\n"],"names":["_","events","SourceInterceptor","videojs","use","player","setSource","playerSelectedSource","next","sources","currentSources","userSelectedSource","chosenSource","_qualitySelectorSafeSeek","onPlayerSourcesChange","isEqual","_qualitySelectorPreviousSources","trigger","PLAYER_SOURCES_CHANGED","find","source","selected","QUALITY_SELECTED"],"mappings":"AAAA,OAAOA,OAAO,aAAa;AAC3B,YAAYC,YAAY,eAAe;AAEvC,eAAe,SAASC,kBAAkBC,OAAO;IAC/CA,QAAQC,GAAG,CAAC,KAAK,SAAUC,MAAM;QAC/B,OAAO;YACLC,WAAW,SAAUC,oBAAoB,EAAEC,IAAI;gBAC7C,IAAIC,UAAUJ,OAAOK,cAAc,IACjCC,oBACAC;gBAEF,IAAIP,OAAOQ,wBAAwB,EAAE;oBACnCR,OAAOQ,wBAAwB,CAACC,qBAAqB;gBACvD;gBAEA,IAAI,CAACd,EAAEe,OAAO,CAACN,SAASJ,OAAOW,+BAA+B,GAAG;oBAC/DX,OAAOY,OAAO,CAAChB,OAAOiB,sBAAsB,EAAET;oBAC9CJ,OAAOW,+BAA+B,GAAGP;gBAC3C;gBAEA,+DAA+D;gBAC/D,4DAA4D;gBAC5D,iEAAiE;gBACjE,6DAA6D;gBAC7D,yBAAyB;gBAEzBE,qBAAqBX,EAAEmB,IAAI,CAACV,SAAS,SAAUW,MAAM;oBACnD,uEAAuE;oBACvE,yEAAyE;oBACzE,oEAAoE;oBACpE,OACEA,OAAOC,QAAQ,KAAK,QACpBD,OAAOC,QAAQ,KAAK,UACpBD,OAAOC,QAAQ,KAAK;gBAExB;gBAEAT,eAAeD,sBAAsBJ;gBAErCF,OAAOY,OAAO,CAAChB,OAAOqB,gBAAgB,EAAEV;gBAExC,+BAA+B;gBAC/BJ,KAAK,MAAMI;YACb;QACF;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/middleware/SourceInterceptor.js"],"sourcesContent":["import _ from \"underscore\";\r\nimport * as events from \"../events.js\";\r\n\r\nexport default function SourceInterceptor(videojs) {\r\n videojs.use(\"*\", function (player) {\r\n return {\r\n setSource: function (playerSelectedSource, next) {\r\n var sources = player.currentSources(),\r\n userSelectedSource,\r\n chosenSource;\r\n\r\n if (player._qualitySelectorSafeSeek) {\r\n player._qualitySelectorSafeSeek.onPlayerSourcesChange();\r\n }\r\n\r\n if (!_.isEqual(sources, player._qualitySelectorPreviousSources)) {\r\n player.trigger(events.PLAYER_SOURCES_CHANGED, sources);\r\n player._qualitySelectorPreviousSources = sources;\r\n }\r\n\r\n // There are generally two source options, the one that videojs\r\n // auto-selects and the one that a \"user\" of this plugin has\r\n // supplied via the `selected` property. `selected` can come from\r\n // either the `<source>` tag or the list of sources passed to\r\n // videojs using `src()`.\r\n\r\n userSelectedSource = _.find(sources, function (source) {\r\n // Must check for boolean values as well as either the string 'true' or\r\n // 'selected'. When sources are set programmatically, the value will be a\r\n // boolean, but those coming from a `<source>` tag will be a string.\r\n return (\r\n source.selected === true ||\r\n source.selected === \"true\" ||\r\n source.selected === \"selected\"\r\n );\r\n });\r\n\r\n chosenSource = userSelectedSource || playerSelectedSource;\r\n\r\n player.trigger(events.QUALITY_SELECTED, chosenSource);\r\n\r\n // Pass along the chosen source\r\n next(null, chosenSource);\r\n },\r\n };\r\n });\r\n}\r\n"],"names":["_","events","SourceInterceptor","videojs","use","player","setSource","playerSelectedSource","next","sources","currentSources","userSelectedSource","chosenSource","_qualitySelectorSafeSeek","onPlayerSourcesChange","isEqual","_qualitySelectorPreviousSources","trigger","PLAYER_SOURCES_CHANGED","find","source","selected","QUALITY_SELECTED"],"mappings":"AAAA,OAAOA,OAAO,aAAa;AAC3B,YAAYC,YAAY,eAAe;AAEvC,eAAe,SAASC,kBAAkBC,OAAO;IAC/CA,QAAQC,GAAG,CAAC,KAAK,SAAUC,MAAM;QAC/B,OAAO;YACLC,WAAW,SAAUC,oBAAoB,EAAEC,IAAI;gBAC7C,IAAIC,UAAUJ,OAAOK,cAAc,IACjCC,oBACAC;gBAEF,IAAIP,OAAOQ,wBAAwB,EAAE;oBACnCR,OAAOQ,wBAAwB,CAACC,qBAAqB;gBACvD;gBAEA,IAAI,CAACd,EAAEe,OAAO,CAACN,SAASJ,OAAOW,+BAA+B,GAAG;oBAC/DX,OAAOY,OAAO,CAAChB,OAAOiB,sBAAsB,EAAET;oBAC9CJ,OAAOW,+BAA+B,GAAGP;gBAC3C;gBAEA,+DAA+D;gBAC/D,4DAA4D;gBAC5D,iEAAiE;gBACjE,6DAA6D;gBAC7D,yBAAyB;gBAEzBE,qBAAqBX,EAAEmB,IAAI,CAACV,SAAS,SAAUW,MAAM;oBACnD,uEAAuE;oBACvE,yEAAyE;oBACzE,oEAAoE;oBACpE,OACEA,OAAOC,QAAQ,KAAK,QACpBD,OAAOC,QAAQ,KAAK,UACpBD,OAAOC,QAAQ,KAAK;gBAExB;gBAEAT,eAAeD,sBAAsBJ;gBAErCF,OAAOY,OAAO,CAAChB,OAAOqB,gBAAgB,EAAEV;gBAExC,+BAA+B;gBAC/BJ,KAAK,MAAMI;YACb;QACF;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/util/SafeSeek.js"],"sourcesContent":["class SafeSeek {\n constructor(player, seekToTime) {\n this._player = player;\n this._seekToTime = seekToTime;\n this._hasFinished = false;\n this._keepThisInstanceWhenPlayerSourcesChange = false;\n this._seekWhenSafe();\n }\n\n _seekWhenSafe() {\n var HAVE_FUTURE_DATA = 3;\n\n // `readyState` in Video.js is the same as the HTML5 Media element's `readyState`\n // property.\n //\n // `readyState` is an enum of 5 values (0-4), each of which represent a state of\n // readiness to play. The meaning of the values range from HAVE_NOTHING (0), meaning\n // no data is available to HAVE_ENOUGH_DATA (4), meaning all data is loaded and the\n // video can be played all the way through.\n //\n // In order to seek successfully, the `readyState` must be at least HAVE_FUTURE_DATA\n // (3).\n //\n // @see http://docs.videojs.com/player#readyState\n // @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState\n // @see https://dev.w3.org/html5/spec-preview/media-elements.html#seek-the-media-controller\n if (this._player.readyState() < HAVE_FUTURE_DATA) {\n this._seekFn = this._seek.bind(this);\n // The `canplay` event means that the `readyState` is at least HAVE_FUTURE_DATA.\n this._player.one(\"canplay\", this._seekFn);\n } else {\n this._seek();\n }\n }\n\n onPlayerSourcesChange() {\n if (this._keepThisInstanceWhenPlayerSourcesChange) {\n // By setting this to `false`, we know that if the player sources change again\n // the change did not originate from a quality selection change, the new sources\n // are likely different from the old sources, and so this pending seek no longer\n // applies.\n this._keepThisInstanceWhenPlayerSourcesChange = false;\n } else {\n this.cancel();\n }\n }\n\n onQualitySelectionChange() {\n // `onPlayerSourcesChange` will cancel this pending seek unless we tell it not to.\n // We need to reuse this same pending seek instance because when the player is\n // paused, the `preload` attribute is set to `none`, and the user selects one\n // quality option and then another, the player cannot seek until the player has\n // enough data to do so (and the `canplay` event is fired) and thus on the second\n // selection the player's `currentTime()` is `0` and when the video plays we would\n // seek to `0` instead of the correct time.\n if (!this.hasFinished()) {\n this._keepThisInstanceWhenPlayerSourcesChange = true;\n }\n }\n\n _seek() {\n this._player.currentTime(this._seekToTime);\n this._keepThisInstanceWhenPlayerSourcesChange = false;\n this._hasFinished = true;\n }\n\n hasFinished() {\n return this._hasFinished;\n }\n\n cancel() {\n this._player.off(\"canplay\", this._seekFn);\n this._keepThisInstanceWhenPlayerSourcesChange = false;\n this._hasFinished = true;\n }\n}\n\nexport default SafeSeek;\n"],"names":["SafeSeek","constructor","player","seekToTime","_player","_seekToTime","_hasFinished","_keepThisInstanceWhenPlayerSourcesChange","_seekWhenSafe","HAVE_FUTURE_DATA","readyState","_seekFn","_seek","bind","one","onPlayerSourcesChange","cancel","onQualitySelectionChange","hasFinished","currentTime","off"],"mappings":"AAAA,MAAMA;IACJC,YAAYC,MAAM,EAAEC,UAAU,CAAE;QAC9B,IAAI,CAACC,OAAO,GAAGF;QACf,IAAI,CAACG,WAAW,GAAGF;QACnB,IAAI,CAACG,YAAY,GAAG;QACpB,IAAI,CAACC,wCAAwC,GAAG;QAChD,IAAI,CAACC,aAAa;IACpB;IAEAA,gBAAgB;QACd,IAAIC,mBAAmB;QAEvB,iFAAiF;QACjF,YAAY;QACZ,EAAE;QACF,gFAAgF;QAChF,oFAAoF;QACpF,mFAAmF;QACnF,2CAA2C;QAC3C,EAAE;QACF,oFAAoF;QACpF,OAAO;QACP,EAAE;QACF,iDAAiD;QACjD,oFAAoF;QACpF,2FAA2F;QAC3F,IAAI,IAAI,CAACL,OAAO,CAACM,UAAU,KAAKD,kBAAkB;YAChD,IAAI,CAACE,OAAO,GAAG,IAAI,CAACC,KAAK,CAACC,IAAI,CAAC,IAAI;YACnC,gFAAgF;YAChF,IAAI,CAACT,OAAO,CAACU,GAAG,CAAC,WAAW,IAAI,CAACH,OAAO;QAC1C,OAAO;YACL,IAAI,CAACC,KAAK;QACZ;IACF;IAEAG,wBAAwB;QACtB,IAAI,IAAI,CAACR,wCAAwC,EAAE;YACjD,8EAA8E;YAC9E,gFAAgF;YAChF,gFAAgF;YAChF,WAAW;YACX,IAAI,CAACA,wCAAwC,GAAG;QAClD,OAAO;YACL,IAAI,CAACS,MAAM;QACb;IACF;IAEAC,2BAA2B;QACzB,kFAAkF;QAClF,8EAA8E;QAC9E,6EAA6E;QAC7E,+EAA+E;QAC/E,iFAAiF;QACjF,kFAAkF;QAClF,2CAA2C;QAC3C,IAAI,CAAC,IAAI,CAACC,WAAW,IAAI;YACvB,IAAI,CAACX,wCAAwC,GAAG;QAClD;IACF;IAEAK,QAAQ;QACN,IAAI,CAACR,OAAO,CAACe,WAAW,CAAC,IAAI,CAACd,WAAW;QACzC,IAAI,CAACE,wCAAwC,GAAG;QAChD,IAAI,CAACD,YAAY,GAAG;IACtB;IAEAY,cAAc;QACZ,OAAO,IAAI,CAACZ,YAAY;IAC1B;IAEAU,SAAS;QACP,IAAI,CAACZ,OAAO,CAACgB,GAAG,CAAC,WAAW,IAAI,CAACT,OAAO;QACxC,IAAI,CAACJ,wCAAwC,GAAG;QAChD,IAAI,CAACD,YAAY,GAAG;IACtB;AACF;AAEA,eAAeN,SAAS"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/videojs/quality-selector/util/SafeSeek.js"],"sourcesContent":["class SafeSeek {\r\n constructor(player, seekToTime) {\r\n this._player = player;\r\n this._seekToTime = seekToTime;\r\n this._hasFinished = false;\r\n this._keepThisInstanceWhenPlayerSourcesChange = false;\r\n this._seekWhenSafe();\r\n }\r\n\r\n _seekWhenSafe() {\r\n var HAVE_FUTURE_DATA = 3;\r\n\r\n // `readyState` in Video.js is the same as the HTML5 Media element's `readyState`\r\n // property.\r\n //\r\n // `readyState` is an enum of 5 values (0-4), each of which represent a state of\r\n // readiness to play. The meaning of the values range from HAVE_NOTHING (0), meaning\r\n // no data is available to HAVE_ENOUGH_DATA (4), meaning all data is loaded and the\r\n // video can be played all the way through.\r\n //\r\n // In order to seek successfully, the `readyState` must be at least HAVE_FUTURE_DATA\r\n // (3).\r\n //\r\n // @see http://docs.videojs.com/player#readyState\r\n // @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState\r\n // @see https://dev.w3.org/html5/spec-preview/media-elements.html#seek-the-media-controller\r\n if (this._player.readyState() < HAVE_FUTURE_DATA) {\r\n this._seekFn = this._seek.bind(this);\r\n // The `canplay` event means that the `readyState` is at least HAVE_FUTURE_DATA.\r\n this._player.one(\"canplay\", this._seekFn);\r\n } else {\r\n this._seek();\r\n }\r\n }\r\n\r\n onPlayerSourcesChange() {\r\n if (this._keepThisInstanceWhenPlayerSourcesChange) {\r\n // By setting this to `false`, we know that if the player sources change again\r\n // the change did not originate from a quality selection change, the new sources\r\n // are likely different from the old sources, and so this pending seek no longer\r\n // applies.\r\n this._keepThisInstanceWhenPlayerSourcesChange = false;\r\n } else {\r\n this.cancel();\r\n }\r\n }\r\n\r\n onQualitySelectionChange() {\r\n // `onPlayerSourcesChange` will cancel this pending seek unless we tell it not to.\r\n // We need to reuse this same pending seek instance because when the player is\r\n // paused, the `preload` attribute is set to `none`, and the user selects one\r\n // quality option and then another, the player cannot seek until the player has\r\n // enough data to do so (and the `canplay` event is fired) and thus on the second\r\n // selection the player's `currentTime()` is `0` and when the video plays we would\r\n // seek to `0` instead of the correct time.\r\n if (!this.hasFinished()) {\r\n this._keepThisInstanceWhenPlayerSourcesChange = true;\r\n }\r\n }\r\n\r\n _seek() {\r\n this._player.currentTime(this._seekToTime);\r\n this._keepThisInstanceWhenPlayerSourcesChange = false;\r\n this._hasFinished = true;\r\n }\r\n\r\n hasFinished() {\r\n return this._hasFinished;\r\n }\r\n\r\n cancel() {\r\n this._player.off(\"canplay\", this._seekFn);\r\n this._keepThisInstanceWhenPlayerSourcesChange = false;\r\n this._hasFinished = true;\r\n }\r\n}\r\n\r\nexport default SafeSeek;\r\n"],"names":["SafeSeek","constructor","player","seekToTime","_player","_seekToTime","_hasFinished","_keepThisInstanceWhenPlayerSourcesChange","_seekWhenSafe","HAVE_FUTURE_DATA","readyState","_seekFn","_seek","bind","one","onPlayerSourcesChange","cancel","onQualitySelectionChange","hasFinished","currentTime","off"],"mappings":"AAAA,MAAMA;IACJC,YAAYC,MAAM,EAAEC,UAAU,CAAE;QAC9B,IAAI,CAACC,OAAO,GAAGF;QACf,IAAI,CAACG,WAAW,GAAGF;QACnB,IAAI,CAACG,YAAY,GAAG;QACpB,IAAI,CAACC,wCAAwC,GAAG;QAChD,IAAI,CAACC,aAAa;IACpB;IAEAA,gBAAgB;QACd,IAAIC,mBAAmB;QAEvB,iFAAiF;QACjF,YAAY;QACZ,EAAE;QACF,gFAAgF;QAChF,oFAAoF;QACpF,mFAAmF;QACnF,2CAA2C;QAC3C,EAAE;QACF,oFAAoF;QACpF,OAAO;QACP,EAAE;QACF,iDAAiD;QACjD,oFAAoF;QACpF,2FAA2F;QAC3F,IAAI,IAAI,CAACL,OAAO,CAACM,UAAU,KAAKD,kBAAkB;YAChD,IAAI,CAACE,OAAO,GAAG,IAAI,CAACC,KAAK,CAACC,IAAI,CAAC,IAAI;YACnC,gFAAgF;YAChF,IAAI,CAACT,OAAO,CAACU,GAAG,CAAC,WAAW,IAAI,CAACH,OAAO;QAC1C,OAAO;YACL,IAAI,CAACC,KAAK;QACZ;IACF;IAEAG,wBAAwB;QACtB,IAAI,IAAI,CAACR,wCAAwC,EAAE;YACjD,8EAA8E;YAC9E,gFAAgF;YAChF,gFAAgF;YAChF,WAAW;YACX,IAAI,CAACA,wCAAwC,GAAG;QAClD,OAAO;YACL,IAAI,CAACS,MAAM;QACb;IACF;IAEAC,2BAA2B;QACzB,kFAAkF;QAClF,8EAA8E;QAC9E,6EAA6E;QAC7E,+EAA+E;QAC/E,iFAAiF;QACjF,kFAAkF;QAClF,2CAA2C;QAC3C,IAAI,CAAC,IAAI,CAACC,WAAW,IAAI;YACvB,IAAI,CAACX,wCAAwC,GAAG;QAClD;IACF;IAEAK,QAAQ;QACN,IAAI,CAACR,OAAO,CAACe,WAAW,CAAC,IAAI,CAACd,WAAW;QACzC,IAAI,CAACE,wCAAwC,GAAG;QAChD,IAAI,CAACD,YAAY,GAAG;IACtB;IAEAY,cAAc;QACZ,OAAO,IAAI,CAACZ,YAAY;IAC1B;IAEAU,SAAS;QACP,IAAI,CAACZ,OAAO,CAACgB,GAAG,CAAC,WAAW,IAAI,CAACT,OAAO;QACxC,IAAI,CAACJ,wCAAwC,GAAG;QAChD,IAAI,CAACD,YAAY,GAAG;IACtB;AACF;AAEA,eAAeN,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/index.ts"],"sourcesContent":["export * from \"./VideoBlock.js\";\n"],"names":[],"mappings":"AAAA,cAAc,kBAAkB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/index.ts"],"sourcesContent":["export * from \"./VideoBlock.js\";\r\n"],"names":[],"mappings":"AAAA,cAAc,kBAAkB"}
|
|
@@ -3,6 +3,6 @@ interface ExtensionKitProps {
|
|
|
3
3
|
openAssetHQHandler: openAssetHQType;
|
|
4
4
|
dir?: "ltr" | "rtl";
|
|
5
5
|
}
|
|
6
|
-
export declare const ExtensionKit: ({ dir, openAssetHQHandler, }: ExtensionKitProps) => (import("@tiptap/core").
|
|
6
|
+
export declare const ExtensionKit: ({ dir, openAssetHQHandler, }: ExtensionKitProps) => (import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Mark<import("@tiptap/extension-superscript").SuperscriptExtensionOptions, any>)[];
|
|
7
7
|
export default ExtensionKit;
|
|
8
8
|
//# sourceMappingURL=extension-kit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-kit.d.ts","sourceRoot":"","sources":["../../../../../src/fields/TiptapEditor/extensions/extension-kit.ts"],"names":[],"mappings":"AAiDA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAI9C,UAAU,iBAAiB;IACzB,kBAAkB,EAAE,eAAe,CAAC;IACpC,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,iCAGtB,iBAAiB
|
|
1
|
+
{"version":3,"file":"extension-kit.d.ts","sourceRoot":"","sources":["../../../../../src/fields/TiptapEditor/extensions/extension-kit.ts"],"names":[],"mappings":"AAiDA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAI9C,UAAU,iBAAiB;IACzB,kBAAkB,EAAE,eAAe,CAAC;IACpC,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,iCAGtB,iBAAiB,mMA6HnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/fields/TiptapEditor/extensions/extension-kit.ts"],"sourcesContent":["import {\n AICommand,\n AudioBlock,\n BlockquoteFigure,\n CharacterCount,\n Color,\n Document,\n Dropcursor,\n Facebook,\n Figcaption,\n FileHandler,\n Focus,\n FontFamily,\n FontSize,\n Heading,\n Highlight,\n HorizontalRule,\n LinkPreview,\n ImageBlock,\n InsideLinks,\n Instagram,\n Link,\n Linkedin,\n Placeholder,\n Selection,\n SlashCommand,\n StarterKit,\n Subscript,\n Superscript,\n TaskItem,\n TaskList,\n TextAlign,\n TextStyle,\n Tiktok,\n TrailingNode,\n Twitter,\n Typography,\n Underline,\n VideoBlock,\n Youtube,\n Iframe,\n BulletList,\n} from \"./index.js\";\n\nimport { ImageUpload } from \"./ImageUpload/ImageUpload.js\";\n\nimport History from \"@tiptap/extension-history\";\nimport { Markdown } from \"tiptap-markdown\";\nimport API from \"../lib/api.js\";\nimport { openAssetHQType } from \"../types.js\";\nimport i18next from \"i18next\";\nimport { getAssetActualSize } from \"./ImageUpload/getImageActualSize.js\";\n\ninterface ExtensionKitProps {\n openAssetHQHandler: openAssetHQType;\n dir?: \"ltr\" | \"rtl\";\n}\n\nexport const ExtensionKit = ({\n dir = \"ltr\",\n openAssetHQHandler,\n}: ExtensionKitProps) => [\n Markdown,\n Document,\n TaskList,\n TaskItem.configure({\n nested: true,\n }),\n Selection,\n Heading.configure({\n levels: [1, 2, 3, 4, 5, 6],\n }),\n HorizontalRule,\n StarterKit.configure({\n document: false,\n dropcursor: false,\n heading: false,\n horizontalRule: false,\n blockquote: false,\n history: false,\n codeBlock: false,\n }),\n TextStyle,\n // FontSize,\n // FontFamily,\n // Color,\n TrailingNode,\n Link.configure({\n openOnClick: false,\n }),\n // Highlight.configure({ multicolor: true }),\n Underline,\n CharacterCount.configure({ limit: 50000 }),\n ImageUpload.configure({\n openAssetHQHandler,\n }),\n ImageBlock,\n VideoBlock,\n AudioBlock,\n FileHandler.configure({\n allowedMimeTypes: [\"image/png\", \"image/jpeg\", \"image/gif\", \"image/webp\"],\n onDrop: (currentEditor, files, pos) => {\n const file = files[0];\n (async () => {\n openAssetHQHandler(\n (asset) => {\n let title = asset.title;\n if (\n i18next.language !== \"en\" &&\n !!asset.title_locale[i18next.language.toUpperCase()]\n ) {\n title = asset.title_locale[i18next.language.toUpperCase()];\n }\n const { actualHeight, actualWidth } = getAssetActualSize(asset);\n currentEditor\n .chain()\n .setImageBlockAt({\n pos,\n src: asset?.optimizedImageUrl || asset.fullUrl,\n caption: title,\n actualHeight,\n actualWidth,\n })\n .focus()\n .run();\n },\n file,\n \"image\"\n );\n })();\n },\n onPaste: (currentEditor, files) => {\n files.forEach(async () => {\n const url = await API.uploadImage();\n\n return currentEditor\n .chain()\n .setImageBlockAt({\n pos: currentEditor.state.selection.anchor,\n src: url,\n })\n .focus()\n .run();\n });\n },\n }),\n // Emoji.configure({\n // enableEmoticons: true,\n // suggestion: emojiSuggestion,\n // }),\n TextAlign.extend({\n addKeyboardShortcuts() {\n return {};\n },\n }).configure({\n defaultAlignment: dir === \"rtl\" ? \"right\" : \"left\",\n types: [\"heading\", \"paragraph\"],\n }),\n Subscript,\n Superscript,\n Typography,\n Placeholder.configure({\n includeChildren: true,\n showOnlyCurrent: false,\n placeholder: () => \"\",\n }),\n SlashCommand,\n Focus,\n Figcaption,\n BlockquoteFigure,\n Dropcursor.configure({\n width: 2,\n class: \"ProseMirror-dropcursor border-black\",\n }),\n History,\n Twitter,\n Tiktok,\n Instagram,\n Facebook,\n Linkedin,\n Youtube,\n InsideLinks,\n Iframe,\n AICommand,\n LinkPreview,\n BulletList,\n];\n\nexport default ExtensionKit;\n"],"names":["AICommand","AudioBlock","BlockquoteFigure","CharacterCount","Document","Dropcursor","Facebook","Figcaption","FileHandler","Focus","Heading","HorizontalRule","LinkPreview","ImageBlock","InsideLinks","Instagram","Link","Linkedin","Placeholder","Selection","SlashCommand","StarterKit","Subscript","Superscript","TaskItem","TaskList","TextAlign","TextStyle","Tiktok","TrailingNode","Twitter","Typography","Underline","VideoBlock","Youtube","Iframe","BulletList","ImageUpload","History","Markdown","API","i18next","getAssetActualSize","ExtensionKit","dir","openAssetHQHandler","configure","nested","levels","document","dropcursor","heading","horizontalRule","blockquote","history","codeBlock","openOnClick","limit","allowedMimeTypes","onDrop","currentEditor","files","pos","file","asset","title","language","title_locale","toUpperCase","actualHeight","actualWidth","chain","setImageBlockAt","src","optimizedImageUrl","fullUrl","caption","focus","run","onPaste","forEach","url","uploadImage","state","selection","anchor","extend","addKeyboardShortcuts","defaultAlignment","types","includeChildren","showOnlyCurrent","placeholder","width","class"],"mappings":"AAAA,SACEA,SAAS,EACTC,UAAU,EACVC,gBAAgB,EAChBC,cAAc,EAEdC,QAAQ,EACRC,UAAU,EACVC,QAAQ,EACRC,UAAU,EACVC,WAAW,EACXC,KAAK,EAGLC,OAAO,EAEPC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,IAAI,EACJC,QAAQ,EACRC,W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"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/fields/TiptapEditor/extensions/extension-kit.ts"],"sourcesContent":["import {\r\n AICommand,\r\n AudioBlock,\r\n BlockquoteFigure,\r\n CharacterCount,\r\n Color,\r\n Document,\r\n Dropcursor,\r\n Facebook,\r\n Figcaption,\r\n FileHandler,\r\n Focus,\r\n FontFamily,\r\n FontSize,\r\n Heading,\r\n Highlight,\r\n HorizontalRule,\r\n LinkPreview,\r\n ImageBlock,\r\n InsideLinks,\r\n Instagram,\r\n Link,\r\n Linkedin,\r\n Placeholder,\r\n Selection,\r\n SlashCommand,\r\n StarterKit,\r\n Subscript,\r\n Superscript,\r\n TaskItem,\r\n TaskList,\r\n TextAlign,\r\n TextStyle,\r\n Tiktok,\r\n TrailingNode,\r\n Twitter,\r\n Typography,\r\n Underline,\r\n VideoBlock,\r\n Youtube,\r\n Iframe,\r\n BulletList,\r\n} from \"./index.js\";\r\n\r\nimport { ImageUpload } from \"./ImageUpload/ImageUpload.js\";\r\n\r\nimport History from \"@tiptap/extension-history\";\r\nimport { Markdown } from \"tiptap-markdown\";\r\nimport API from \"../lib/api.js\";\r\nimport { openAssetHQType } from \"../types.js\";\r\nimport i18next from \"i18next\";\r\nimport { getAssetActualSize } from \"./ImageUpload/getImageActualSize.js\";\r\n\r\ninterface ExtensionKitProps {\r\n openAssetHQHandler: openAssetHQType;\r\n dir?: \"ltr\" | \"rtl\";\r\n}\r\n\r\nexport const ExtensionKit = ({\r\n dir = \"ltr\",\r\n openAssetHQHandler,\r\n}: ExtensionKitProps) => [\r\n Markdown,\r\n Document,\r\n TaskList,\r\n TaskItem.configure({\r\n nested: true,\r\n }),\r\n Selection,\r\n Heading.configure({\r\n levels: [1, 2, 3, 4, 5, 6],\r\n }),\r\n HorizontalRule,\r\n StarterKit.configure({\r\n document: false,\r\n dropcursor: false,\r\n heading: false,\r\n horizontalRule: false,\r\n blockquote: false,\r\n history: false,\r\n codeBlock: false,\r\n }),\r\n TextStyle,\r\n // FontSize,\r\n // FontFamily,\r\n // Color,\r\n TrailingNode,\r\n Link.configure({\r\n openOnClick: false,\r\n }),\r\n // Highlight.configure({ multicolor: true }),\r\n Underline,\r\n CharacterCount.configure({ limit: 50000 }),\r\n ImageUpload.configure({\r\n openAssetHQHandler,\r\n }),\r\n ImageBlock,\r\n VideoBlock,\r\n AudioBlock,\r\n FileHandler.configure({\r\n allowedMimeTypes: [\"image/png\", \"image/jpeg\", \"image/gif\", \"image/webp\"],\r\n onDrop: (currentEditor, files, pos) => {\r\n const file = files[0];\r\n (async () => {\r\n openAssetHQHandler(\r\n (asset) => {\r\n let title = asset.title;\r\n if (\r\n i18next.language !== \"en\" &&\r\n !!asset.title_locale[i18next.language.toUpperCase()]\r\n ) {\r\n title = asset.title_locale[i18next.language.toUpperCase()];\r\n }\r\n const { actualHeight, actualWidth } = getAssetActualSize(asset);\r\n currentEditor\r\n .chain()\r\n .setImageBlockAt({\r\n pos,\r\n src: asset?.optimizedImageUrl || asset.fullUrl,\r\n caption: title,\r\n actualHeight,\r\n actualWidth,\r\n })\r\n .focus()\r\n .run();\r\n },\r\n file,\r\n \"image\"\r\n );\r\n })();\r\n },\r\n onPaste: (currentEditor, files) => {\r\n files.forEach(async () => {\r\n const url = await API.uploadImage();\r\n\r\n return currentEditor\r\n .chain()\r\n .setImageBlockAt({\r\n pos: currentEditor.state.selection.anchor,\r\n src: url,\r\n })\r\n .focus()\r\n .run();\r\n });\r\n },\r\n }),\r\n // Emoji.configure({\r\n // enableEmoticons: true,\r\n // suggestion: emojiSuggestion,\r\n // }),\r\n TextAlign.extend({\r\n addKeyboardShortcuts() {\r\n return {};\r\n },\r\n }).configure({\r\n defaultAlignment: dir === \"rtl\" ? \"right\" : \"left\",\r\n types: [\"heading\", \"paragraph\"],\r\n }),\r\n Subscript,\r\n Superscript,\r\n Typography,\r\n Placeholder.configure({\r\n includeChildren: true,\r\n showOnlyCurrent: false,\r\n placeholder: () => \"\",\r\n }),\r\n SlashCommand,\r\n Focus,\r\n Figcaption,\r\n BlockquoteFigure,\r\n Dropcursor.configure({\r\n width: 2,\r\n class: \"ProseMirror-dropcursor border-black\",\r\n }),\r\n History,\r\n Twitter,\r\n Tiktok,\r\n Instagram,\r\n Facebook,\r\n Linkedin,\r\n Youtube,\r\n InsideLinks,\r\n Iframe,\r\n AICommand,\r\n LinkPreview,\r\n BulletList,\r\n];\r\n\r\nexport default ExtensionKit;\r\n"],"names":["AICommand","AudioBlock","BlockquoteFigure","CharacterCount","Document","Dropcursor","Facebook","Figcaption","FileHandler","Focus","Heading","HorizontalRule","LinkPreview","ImageBlock","InsideLinks","Instagram","Link","Linkedin","Placeholder","Selection","SlashCommand","StarterKit","Subscript","Superscript","TaskItem","TaskList","TextAlign","TextStyle","Tiktok","TrailingNode","Twitter","Typography","Underline","VideoBlock","Youtube","Iframe","BulletList","ImageUpload","History","Markdown","API","i18next","getAssetActualSize","ExtensionKit","dir","openAssetHQHandler","configure","nested","levels","document","dropcursor","heading","horizontalRule","blockquote","history","codeBlock","openOnClick","limit","allowedMimeTypes","onDrop","currentEditor","files","pos","file","asset","title","language","title_locale","toUpperCase","actualHeight","actualWidth","chain","setImageBlockAt","src","optimizedImageUrl","fullUrl","caption","focus","run","onPaste","forEach","url","uploadImage","state","selection","anchor","extend","addKeyboardShortcuts","defaultAlignment","types","includeChildren","showOnlyCurrent","placeholder","width","class"],"mappings":"AAAA,SACEA,SAAS,EACTC,UAAU,EACVC,gBAAgB,EAChBC,cAAc,EAEdC,QAAQ,EACRC,UAAU,EACVC,QAAQ,EACRC,UAAU,EACVC,WAAW,EACXC,KAAK,EAGLC,OAAO,EAEPC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,IAAI,EACJC,QAAQ,EACRC,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,UAAU,EACVC,SAAS,EACTC,WAAW,EACXC,QAAQ,EACRC,QAAQ,EACRC,SAAS,EACTC,SAAS,EACTC,MAAM,EACN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,QAAQD,MAAMG,YAAY,CAAC1B,QAAQyB,QAAQ,CAACE,WAAW,GAAG;wBAC5D;wBACA,MAAM,EAAEC,YAAY,EAAEC,WAAW,EAAE,GAAG5B,mBAAmBsB;wBACzDJ,cACGW,KAAK,GACLC,eAAe,CAAC;4BACfV;4BACAW,KAAKT,OAAOU,qBAAqBV,MAAMW,OAAO;4BAC9CC,SAASX;4BACTI;4BACAC;wBACF,GACCO,KAAK,GACLC,GAAG;oBACR,GACAf,MACA;gBAEJ,CAAA;YACF;YACAgB,SAAS,CAACnB,eAAeC;gBACvBA,MAAMmB,OAAO,CAAC;oBACZ,MAAMC,MAAM,MAAMzC,IAAI0C,WAAW;oBAEjC,OAAOtB,cACJW,KAAK,GACLC,eAAe,CAAC;wBACfV,KAAKF,cAAcuB,KAAK,CAACC,SAAS,CAACC,MAAM;wBACzCZ,KAAKQ;oBACP,GACCJ,KAAK,GACLC,GAAG;gBACR;YACF;QACF;QACA,oBAAoB;QACpB,2BAA2B;QAC3B,iCAAiC;QACjC,MAAM;QACNpD,UAAU4D,MAAM,CAAC;YACfC;gBACE,OAAO,CAAC;YACV;QACF,GAAGzC,SAAS,CAAC;YACX0C,kBAAkB5C,QAAQ,QAAQ,UAAU;YAC5C6C,OAAO;gBAAC;gBAAW;aAAY;QACjC;QACAnE;QACAC;QACAQ;QACAb,YAAY4B,SAAS,CAAC;YACpB4C,iBAAiB;YACjBC,iBAAiB;YACjBC,aAAa,IAAM;QACrB;QACAxE;QACAX;QACAF;QACAL;QACAG,WAAWyC,SAAS,CAAC;YACnB+C,OAAO;YACPC,OAAO;QACT;QACAxD;QACAR;QACAF;QACAb;QACAT;QACAW;QACAiB;QACApB;QACAqB;QACAnC;QACAY;QACAwB;KACD,CAAC;AAEF,eAAeO,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/fields/TiptapEditor/extensions/index.ts"],"sourcesContent":["// TODO: File causes circular dependency issue in ESLint\n/* eslint-disable */\nexport { StarterKit } from \"@tiptap/starter-kit\";\nexport { Highlight } from \"@tiptap/extension-highlight\";\nexport { CharacterCount } from \"@tiptap/extension-character-count\";\nexport { Underline } from \"@tiptap/extension-underline\";\nexport { Placeholder } from \"@tiptap/extension-placeholder\";\nexport { Emoji, gitHubEmojis } from \"@tiptap-pro/extension-emoji\";\nexport { TextAlign } from \"@tiptap/extension-text-align\";\nexport { TextStyle } from \"@tiptap/extension-text-style\";\nexport { FontFamily } from \"@tiptap/extension-font-family\";\nexport { Typography } from \"@tiptap/extension-typography\";\nexport { Color } from \"@tiptap/extension-color\";\nexport { FocusClasses as Focus } from \"@tiptap/extension-focus\";\nexport { Dropcursor } from \"@tiptap/extension-dropcursor\";\nexport { CollaborationCursor } from \"@tiptap/extension-collaboration-cursor\";\nexport { Subscript } from \"@tiptap/extension-subscript\";\nexport { TableOfContents } from \"@tiptap-pro/extension-table-of-contents\";\nexport { Superscript } from \"@tiptap/extension-superscript\";\nexport { CodeBlock } from \"@tiptap/extension-code-block\";\nexport { BulletList } from \"@tiptap/extension-bullet-list\";\nexport { OrderedList } from \"@tiptap/extension-ordered-list\";\nexport { Collaboration } from \"@tiptap/extension-collaboration\";\nexport { TaskItem } from \"@tiptap/extension-task-item\";\nexport { TaskList } from \"@tiptap/extension-task-list\";\nexport { FileHandler } from \"@tiptap-pro/extension-file-handler\";\n\nexport { Selection } from \"./Selection/Selection.js\";\nexport { Table, TableCell, TableHeader, TableRow } from \"./Table/index.js\";\nexport { HorizontalRule } from \"./HorizontalRule/HorizontalRule.js\";\nexport { Heading } from \"./Heading/Heading.js\";\nexport { Document } from \"./Document/Document.js\";\nexport { TrailingNode } from \"./TrailingNode/trailing-node.js\";\nexport { SlashCommand } from \"./SlashCommand/SlashCommand.js\";\nexport { FontSize } from \"./FontSize/FontSize.js\";\nexport { Figure } from \"./Figure/Figure.js\";\nexport { Figcaption } from \"./Figcaption/Figcaption.js\";\nexport { BlockquoteFigure } from \"./BlockquoteFigure/BlockquoteFigure.js\";\nexport { Quote } from \"./BlockquoteFigure/Quote/Quote.js\";\nexport { QuoteCaption } from \"./BlockquoteFigure/QuoteCaption/QuoteCaption.js\";\nexport { Link } from \"./Link/Link.js\";\nexport { ImageUpload } from \"./ImageUpload/ImageUpload.js\";\nexport { ImageBlock } from \"./ImageBlock/ImageBlock.js\";\nexport { VideoBlock } from \"./VideoBlock/VideoBlock.js\";\nexport { AudioBlock } from \"./AudioBlock/AudioBlock.js\";\n\nexport { Columns, Column } from \"./MultiColumn/index.js\";\nexport { AICommand } from \"./AICommand/AICommand.js\";\nexport { Iframe } from \"./Iframe/iframe.js\";\nexport {\n Twitter,\n Linkedin,\n Tiktok,\n Facebook,\n Instagram,\n Youtube,\n} from \"./SocialMedia/index.js\";\nexport { Paragraph } from \"./Paragraph/Paragraph.js\";\nexport { InsideLinks } from \"./InsideLinks/insideLinks.js\";\n\nexport { LinkPreview } from \"./LinkPreview/index.js\";\n\n// export * from \"./serverside/index.js\";\n"],"names":["StarterKit","Highlight","CharacterCount","Underline","Placeholder","Emoji","gitHubEmojis","TextAlign","TextStyle","FontFamily","Typography","Color","FocusClasses","Focus","Dropcursor","CollaborationCursor","Subscript","TableOfContents","Superscript","CodeBlock","BulletList","OrderedList","Collaboration","TaskItem","TaskList","FileHandler","Selection","Table","TableCell","TableHeader","TableRow","HorizontalRule","Heading","Document","TrailingNode","SlashCommand","FontSize","Figure","Figcaption","BlockquoteFigure","Quote","QuoteCaption","Link","ImageUpload","ImageBlock","VideoBlock","AudioBlock","Columns","Column","AICommand","Iframe","Twitter","Linkedin","Tiktok","Facebook","Instagram","Youtube","Paragraph","InsideLinks","LinkPreview"],"mappings":"AAAA,wDAAwD;AACxD,kBAAkB,GAClB,SAASA,UAAU,QAAQ,sBAAsB;AACjD,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,cAAc,QAAQ,oCAAoC;AACnE,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,WAAW,QAAQ,gCAAgC;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+BAA+B;AAC3D,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SAASC,UAAU,QAAQ,6BAA6B;AAExD,SAASC,OAAO,EAAEC,MAAM,QAAQ,yBAAyB;AACzD,SAASC,SAAS,QAAQ,2BAA2B;AACrD,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SACEC,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,QAAQ,EACRC,SAAS,EACTC,OAAO,QACF,yBAAyB;AAChC,SAASC,SAAS,QAAQ,2BAA2B;AACrD,SAASC,WAAW,QAAQ,+BAA+B;AAE3D,SAASC,WAAW,QAAQ,yBAAyB,CAErD,yCAAyC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/fields/TiptapEditor/extensions/index.ts"],"sourcesContent":["// TODO: File causes circular dependency issue in ESLint\r\n/* eslint-disable */\r\nexport { StarterKit } from \"@tiptap/starter-kit\";\r\nexport { Highlight } from \"@tiptap/extension-highlight\";\r\nexport { CharacterCount } from \"@tiptap/extension-character-count\";\r\nexport { Underline } from \"@tiptap/extension-underline\";\r\nexport { Placeholder } from \"@tiptap/extension-placeholder\";\r\nexport { Emoji, gitHubEmojis } from \"@tiptap-pro/extension-emoji\";\r\nexport { TextAlign } from \"@tiptap/extension-text-align\";\r\nexport { TextStyle } from \"@tiptap/extension-text-style\";\r\nexport { FontFamily } from \"@tiptap/extension-font-family\";\r\nexport { Typography } from \"@tiptap/extension-typography\";\r\nexport { Color } from \"@tiptap/extension-color\";\r\nexport { FocusClasses as Focus } from \"@tiptap/extension-focus\";\r\nexport { Dropcursor } from \"@tiptap/extension-dropcursor\";\r\nexport { CollaborationCursor } from \"@tiptap/extension-collaboration-cursor\";\r\nexport { Subscript } from \"@tiptap/extension-subscript\";\r\nexport { TableOfContents } from \"@tiptap-pro/extension-table-of-contents\";\r\nexport { Superscript } from \"@tiptap/extension-superscript\";\r\nexport { CodeBlock } from \"@tiptap/extension-code-block\";\r\nexport { BulletList } from \"@tiptap/extension-bullet-list\";\r\nexport { OrderedList } from \"@tiptap/extension-ordered-list\";\r\nexport { Collaboration } from \"@tiptap/extension-collaboration\";\r\nexport { TaskItem } from \"@tiptap/extension-task-item\";\r\nexport { TaskList } from \"@tiptap/extension-task-list\";\r\nexport { FileHandler } from \"@tiptap-pro/extension-file-handler\";\r\n\r\nexport { Selection } from \"./Selection/Selection.js\";\r\nexport { Table, TableCell, TableHeader, TableRow } from \"./Table/index.js\";\r\nexport { HorizontalRule } from \"./HorizontalRule/HorizontalRule.js\";\r\nexport { Heading } from \"./Heading/Heading.js\";\r\nexport { Document } from \"./Document/Document.js\";\r\nexport { TrailingNode } from \"./TrailingNode/trailing-node.js\";\r\nexport { SlashCommand } from \"./SlashCommand/SlashCommand.js\";\r\nexport { FontSize } from \"./FontSize/FontSize.js\";\r\nexport { Figure } from \"./Figure/Figure.js\";\r\nexport { Figcaption } from \"./Figcaption/Figcaption.js\";\r\nexport { BlockquoteFigure } from \"./BlockquoteFigure/BlockquoteFigure.js\";\r\nexport { Quote } from \"./BlockquoteFigure/Quote/Quote.js\";\r\nexport { QuoteCaption } from \"./BlockquoteFigure/QuoteCaption/QuoteCaption.js\";\r\nexport { Link } from \"./Link/Link.js\";\r\nexport { ImageUpload } from \"./ImageUpload/ImageUpload.js\";\r\nexport { ImageBlock } from \"./ImageBlock/ImageBlock.js\";\r\nexport { VideoBlock } from \"./VideoBlock/VideoBlock.js\";\r\nexport { AudioBlock } from \"./AudioBlock/AudioBlock.js\";\r\n\r\nexport { Columns, Column } from \"./MultiColumn/index.js\";\r\nexport { AICommand } from \"./AICommand/AICommand.js\";\r\nexport { Iframe } from \"./Iframe/iframe.js\";\r\nexport {\r\n Twitter,\r\n Linkedin,\r\n Tiktok,\r\n Facebook,\r\n Instagram,\r\n Youtube,\r\n} from \"./SocialMedia/index.js\";\r\nexport { Paragraph } from \"./Paragraph/Paragraph.js\";\r\nexport { InsideLinks } from \"./InsideLinks/insideLinks.js\";\r\n\r\nexport { LinkPreview } from \"./LinkPreview/index.js\";\r\n\r\n// export * from \"./serverside/index.js\";\r\n"],"names":["StarterKit","Highlight","CharacterCount","Underline","Placeholder","Emoji","gitHubEmojis","TextAlign","TextStyle","FontFamily","Typography","Color","FocusClasses","Focus","Dropcursor","CollaborationCursor","Subscript","TableOfContents","Superscript","CodeBlock","BulletList","OrderedList","Collaboration","TaskItem","TaskList","FileHandler","Selection","Table","TableCell","TableHeader","TableRow","HorizontalRule","Heading","Document","TrailingNode","SlashCommand","FontSize","Figure","Figcaption","BlockquoteFigure","Quote","QuoteCaption","Link","ImageUpload","ImageBlock","VideoBlock","AudioBlock","Columns","Column","AICommand","Iframe","Twitter","Linkedin","Tiktok","Facebook","Instagram","Youtube","Paragraph","InsideLinks","LinkPreview"],"mappings":"AAAA,wDAAwD;AACxD,kBAAkB,GAClB,SAASA,UAAU,QAAQ,sBAAsB;AACjD,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,cAAc,QAAQ,oCAAoC;AACnE,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,WAAW,QAAQ,gCAAgC;AAC5D,SAASC,KAAK,EAAEC,YAAY,QAAQ,8BAA8B;AAClE,SAASC,SAAS,QAAQ,+BAA+B;AACzD,SAASC,SAAS,QAAQ,+BAA+B;AACzD,SAASC,UAAU,QAAQ,gCAAgC;AAC3D,SAASC,UAAU,QAAQ,+BAA+B;AAC1D,SAASC,KAAK,QAAQ,0BAA0B;AAChD,SAASC,gBAAgBC,KAAK,QAAQ,0BAA0B;AAChE,SAASC,UAAU,QAAQ,+BAA+B;AAC1D,SAASC,mBAAmB,QAAQ,yCAAyC;AAC7E,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,eAAe,QAAQ,0CAA0C;AAC1E,SAASC,WAAW,QAAQ,gCAAgC;AAC5D,SAASC,SAAS,QAAQ,+BAA+B;AACzD,SAASC,UAAU,QAAQ,gCAAgC;AAC3D,SAASC,WAAW,QAAQ,iCA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version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/EmbedContentInlineRenderer.tsx"],"sourcesContent":["\"use client\";\n\nimport { Portal } from \"@radix-ui/react-portal\";\nimport { ComponentProps, memo, useEffect, useState } from \"react\";\n\nimport { renderEmbedContent } from \"./RenderEmbedClientSide.js\";\n\nconst CustomPortal = memo(\n ({\n content,\n getVideoAspect,\n ...props\n }: ComponentProps<typeof Portal> & { getVideoAspect }) => {\n useEffect(() => {}, []);\n return (\n <Portal {...props}>{renderEmbedContent(content, getVideoAspect)}</Portal>\n );\n }\n);\n\nexport function EmbedContentInlineRenderer({ body, getVideoAspect }) {\n const [mounted, setMounted] = useState(false);\n useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!mounted) return null;\n return (\n <>\n {body.content\n .filter(\n (content) =>\n typeof content?.attrs?.[\"data-id\"] === \"number\" ||\n typeof content?.attrs?.[\"data-id\"] === \"string\"\n )\n .map((content) => {\n return (\n <CustomPortal\n key={`embed-content-inline-${content.attrs[\"data-id\"]}-${content.attrs.key}`}\n container={document?.querySelector(\n `[data-id='${content.attrs[\"data-id\"]}']`\n )}\n content={content}\n getVideoAspect={getVideoAspect}\n />\n );\n })}\n </>\n );\n}\n"],"names":["Portal","memo","useEffect","useState","renderEmbedContent","CustomPortal","content","getVideoAspect","props","EmbedContentInlineRenderer","body","mounted","setMounted","filter","attrs","map","container","document","querySelector","key"],"mappings":"AAAA;;AAEA,SAASA,MAAM,QAAQ,yBAAyB;AAChD,SAAyBC,IAAI,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAElE,SAASC,kBAAkB,QAAQ,6BAA6B;AAEhE,MAAMC,6BAAeJ,KACnB,CAAC,EACCK,OAAO,EACPC,cAAc,EACd,GAAGC,OACgD;IACnDN,UAAU,KAAO,GAAG,EAAE;IACtB,qBACE,KAACF;QAAQ,GAAGQ,KAAK;kBAAGJ,mBAAmBE,SAASC;;AAEpD;AAGF,OAAO,SAASE,2BAA2B,EAAEC,IAAI,EAAEH,cAAc,EAAE;IACjE,MAAM,CAACI,SAASC,WAAW,GAAGT,SAAS;IACvCD,UAAU;QACRU,WAAW;IACb,GAAG,EAAE;IAEL,IAAI,CAACD,SAAS,OAAO;IACrB,qBACE;kBACGD,KAAKJ,OAAO,CACVO,MAAM,CACL,CAACP,UACC,OAAOA,SAASQ,OAAO,CAAC,UAAU,KAAK,YACvC,OAAOR,SAASQ,OAAO,CAAC,UAAU,KAAK,UAE1CC,GAAG,CAAC,CAACT;YACJ,qBACE,KAACD;gBAECW,WAAWC,UAAUC,cACnB,CAAC,UAAU,EAAEZ,QAAQQ,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;gBAE3CR,SAASA;gBACTC,gBAAgBA;eALX,CAAC,qBAAqB,EAAED,QAAQQ,KAAK,CAAC,UAAU,CAAC,CAAC,EAAER,QAAQQ,KAAK,CAACK,GAAG,
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/EmbedContentInlineRenderer.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { Portal } from \"@radix-ui/react-portal\";\r\nimport { ComponentProps, memo, useEffect, useState } from \"react\";\r\n\r\nimport { renderEmbedContent } from \"./RenderEmbedClientSide.js\";\r\n\r\nconst CustomPortal = memo(\r\n ({\r\n content,\r\n getVideoAspect,\r\n ...props\r\n }: ComponentProps<typeof Portal> & { getVideoAspect }) => {\r\n useEffect(() => {}, []);\r\n return (\r\n <Portal {...props}>{renderEmbedContent(content, getVideoAspect)}</Portal>\r\n );\r\n }\r\n);\r\n\r\nexport function EmbedContentInlineRenderer({ body, getVideoAspect }) {\r\n const [mounted, setMounted] = useState(false);\r\n useEffect(() => {\r\n setMounted(true);\r\n }, []);\r\n\r\n if (!mounted) return null;\r\n return (\r\n <>\r\n {body.content\r\n .filter(\r\n (content) =>\r\n typeof content?.attrs?.[\"data-id\"] === \"number\" ||\r\n typeof content?.attrs?.[\"data-id\"] === \"string\"\r\n )\r\n .map((content) => {\r\n return (\r\n <CustomPortal\r\n key={`embed-content-inline-${content.attrs[\"data-id\"]}-${content.attrs.key}`}\r\n container={document?.querySelector(\r\n `[data-id='${content.attrs[\"data-id\"]}']`\r\n )}\r\n content={content}\r\n getVideoAspect={getVideoAspect}\r\n />\r\n );\r\n })}\r\n </>\r\n );\r\n}\r\n"],"names":["Portal","memo","useEffect","useState","renderEmbedContent","CustomPortal","content","getVideoAspect","props","EmbedContentInlineRenderer","body","mounted","setMounted","filter","attrs","map","container","document","querySelector","key"],"mappings":"AAAA;;AAEA,SAASA,MAAM,QAAQ,yBAAyB;AAChD,SAAyBC,IAAI,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAElE,SAASC,kBAAkB,QAAQ,6BAA6B;AAEhE,MAAMC,6BAAeJ,KACnB,CAAC,EACCK,OAAO,EACPC,cAAc,EACd,GAAGC,OACgD;IACnDN,UAAU,KAAO,GAAG,EAAE;IACtB,qBACE,KAACF;QAAQ,GAAGQ,KAAK;kBAAGJ,mBAAmBE,SAASC;;AAEpD;AAGF,OAAO,SAASE,2BAA2B,EAAEC,IAAI,EAAEH,cAAc,EAAE;IACjE,MAAM,CAACI,SAASC,WAAW,GAAGT,SAAS;IACvCD,UAAU;QACRU,WAAW;IACb,GAAG,EAAE;IAEL,IAAI,CAACD,SAAS,OAAO;IACrB,qBACE;kBACGD,KAAKJ,OAAO,CACVO,MAAM,CACL,CAACP,UACC,OAAOA,SAASQ,OAAO,CAAC,UAAU,KAAK,YACvC,OAAOR,SAASQ,OAAO,CAAC,UAAU,KAAK,UAE1CC,GAAG,CAAC,CAACT;YACJ,qBACE,KAACD;gBAECW,WAAWC,UAAUC,cACnB,CAAC,UAAU,EAAEZ,QAAQQ,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;gBAE3CR,SAASA;gBACTC,gBAAgBA;eALX,CAAC,qBAAqB,EAAED,QAAQQ,KAAK,CAAC,UAAU,CAAC,CAAC,EAAER,QAAQQ,KAAK,CAACK,GAAG,CAAC,CAAC;QAQlF;;AAGR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/EmbedContentSideRenderer.tsx"],"sourcesContent":["\"use client\";\n\nimport { Portal } from \"@radix-ui/react-portal\";\nimport { ComponentProps, memo, useEffect, useState } from \"react\";\n\nimport { renderEmbedContent } from \"./RenderEmbedClientSide.js\";\n\nconst CustomPortal = memo(\n ({\n content,\n getVideoAspect,\n ...props\n }: ComponentProps<typeof Portal> & { getVideoAspect }) => {\n useEffect(() => {}, []);\n return (\n <Portal {...props}>{renderEmbedContent(content, getVideoAspect)}</Portal>\n );\n }\n);\n\nexport function EmbedContentSideRenderer({ body, getVideoAspect }) {\n const [mounted, setMounted] = useState(false);\n useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!mounted) return null;\n return (\n <>\n {body.content\n .filter(\n (content) =>\n typeof content?.attrs?.[\"data-id\"] === \"number\" ||\n typeof content?.attrs?.[\"data-id\"] === \"string\"\n )\n .filter((content) => content?.attrs?.side)\n .map((content) => {\n return (\n <CustomPortal\n key={`embed-content-side-${content.attrs[\"data-id\"]}-${content.attrs.key}`}\n container={document?.querySelector(\n `[data-id='${content.attrs[\"data-id\"]}']`\n )}\n content={content}\n getVideoAspect={getVideoAspect}\n />\n );\n })}\n </>\n );\n}\n"],"names":["Portal","memo","useEffect","useState","renderEmbedContent","CustomPortal","content","getVideoAspect","props","EmbedContentSideRenderer","body","mounted","setMounted","filter","attrs","side","map","container","document","querySelector","key"],"mappings":"AAAA;;AAEA,SAASA,MAAM,QAAQ,yBAAyB;AAChD,SAAyBC,IAAI,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAElE,SAASC,kBAAkB,QAAQ,6BAA6B;AAEhE,MAAMC,6BAAeJ,KACnB,CAAC,EACCK,OAAO,EACPC,cAAc,EACd,GAAGC,OACgD;IACnDN,UAAU,KAAO,GAAG,EAAE;IACtB,qBACE,KAACF;QAAQ,GAAGQ,KAAK;kBAAGJ,mBAAmBE,SAASC;;AAEpD;AAGF,OAAO,SAASE,yBAAyB,EAAEC,IAAI,EAAEH,cAAc,EAAE;IAC/D,MAAM,CAACI,SAASC,WAAW,GAAGT,SAAS;IACvCD,UAAU;QACRU,WAAW;IACb,GAAG,EAAE;IAEL,IAAI,CAACD,SAAS,OAAO;IACrB,qBACE;kBACGD,KAAKJ,OAAO,CACVO,MAAM,CACL,CAACP,UACC,OAAOA,SAASQ,OAAO,CAAC,UAAU,KAAK,YACvC,OAAOR,SAASQ,OAAO,CAAC,UAAU,KAAK,UAE1CD,MAAM,CAAC,CAACP,UAAYA,SAASQ,OAAOC,MACpCC,GAAG,CAAC,CAACV;YACJ,qBACE,KAACD;gBAECY,WAAWC,UAAUC,cACnB,CAAC,UAAU,EAAEb,QAAQQ,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;gBAE3CR,SAASA;gBACTC,gBAAgBA;eALX,CAAC,mBAAmB,EAAED,QAAQQ,KAAK,CAAC,UAAU,CAAC,CAAC,EAAER,QAAQQ,KAAK,CAACM,GAAG,
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/EmbedContentSideRenderer.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { Portal } from \"@radix-ui/react-portal\";\r\nimport { ComponentProps, memo, useEffect, useState } from \"react\";\r\n\r\nimport { renderEmbedContent } from \"./RenderEmbedClientSide.js\";\r\n\r\nconst CustomPortal = memo(\r\n ({\r\n content,\r\n getVideoAspect,\r\n ...props\r\n }: ComponentProps<typeof Portal> & { getVideoAspect }) => {\r\n useEffect(() => {}, []);\r\n return (\r\n <Portal {...props}>{renderEmbedContent(content, getVideoAspect)}</Portal>\r\n );\r\n }\r\n);\r\n\r\nexport function EmbedContentSideRenderer({ body, getVideoAspect }) {\r\n const [mounted, setMounted] = useState(false);\r\n useEffect(() => {\r\n setMounted(true);\r\n }, []);\r\n\r\n if (!mounted) return null;\r\n return (\r\n <>\r\n {body.content\r\n .filter(\r\n (content) =>\r\n typeof content?.attrs?.[\"data-id\"] === \"number\" ||\r\n typeof content?.attrs?.[\"data-id\"] === \"string\"\r\n )\r\n .filter((content) => content?.attrs?.side)\r\n .map((content) => {\r\n return (\r\n <CustomPortal\r\n key={`embed-content-side-${content.attrs[\"data-id\"]}-${content.attrs.key}`}\r\n container={document?.querySelector(\r\n `[data-id='${content.attrs[\"data-id\"]}']`\r\n )}\r\n content={content}\r\n getVideoAspect={getVideoAspect}\r\n />\r\n );\r\n })}\r\n </>\r\n );\r\n}\r\n"],"names":["Portal","memo","useEffect","useState","renderEmbedContent","CustomPortal","content","getVideoAspect","props","EmbedContentSideRenderer","body","mounted","setMounted","filter","attrs","side","map","container","document","querySelector","key"],"mappings":"AAAA;;AAEA,SAASA,MAAM,QAAQ,yBAAyB;AAChD,SAAyBC,IAAI,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAElE,SAASC,kBAAkB,QAAQ,6BAA6B;AAEhE,MAAMC,6BAAeJ,KACnB,CAAC,EACCK,OAAO,EACPC,cAAc,EACd,GAAGC,OACgD;IACnDN,UAAU,KAAO,GAAG,EAAE;IACtB,qBACE,KAACF;QAAQ,GAAGQ,KAAK;kBAAGJ,mBAAmBE,SAASC;;AAEpD;AAGF,OAAO,SAASE,yBAAyB,EAAEC,IAAI,EAAEH,cAAc,EAAE;IAC/D,MAAM,CAACI,SAASC,WAAW,GAAGT,SAAS;IACvCD,UAAU;QACRU,WAAW;IACb,GAAG,EAAE;IAEL,IAAI,CAACD,SAAS,OAAO;IACrB,qBACE;kBACGD,KAAKJ,OAAO,CACVO,MAAM,CACL,CAACP,UACC,OAAOA,SAASQ,OAAO,CAAC,UAAU,KAAK,YACvC,OAAOR,SAASQ,OAAO,CAAC,UAAU,KAAK,UAE1CD,MAAM,CAAC,CAACP,UAAYA,SAASQ,OAAOC,MACpCC,GAAG,CAAC,CAACV;YACJ,qBACE,KAACD;gBAECY,WAAWC,UAAUC,cACnB,CAAC,UAAU,EAAEb,QAAQQ,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;gBAE3CR,SAASA;gBACTC,gBAAgBA;eALX,CAAC,mBAAmB,EAAED,QAAQQ,KAAK,CAAC,UAAU,CAAC,CAAC,EAAER,QAAQQ,KAAK,CAACM,GAAG,CAAC,CAAC;QAQhF;;AAGR"}
|