@instincthub/react-ui 0.1.62 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -3
- package/dist/_virtual/_rollupPluginBabelHelpers.js +2 -2
- package/dist/node_modules/.pnpm/@tiptap_core@2.27.1_@tiptap_pm@2.27.1/node_modules/@tiptap/core/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@tiptap_core@2.27.1_@tiptap_pm@2.27.1/node_modules/@tiptap/core/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@tiptap_react@2.27.1_@tiptap_core@2.27.1_@tiptap_pm@2.27.1__@tiptap_pm@2.27.1_react-dom_3687a02a33de69fe477ccd0d970063c0/node_modules/@tiptap/react/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/@tiptap_react@2.27.1_@tiptap_core@2.27.1_@tiptap_pm@2.27.1__@tiptap_pm@2.27.1_react-dom_3687a02a33de69fe477ccd0d970063c0/node_modules/@tiptap/react/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/align-center.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/align-center.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/align-left.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/align-left.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/align-right.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/align-right.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/arrow-down.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/arrow-down.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/arrow-left.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/arrow-left.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/arrow-right.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/arrow-right.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/arrow-up.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/arrow-up.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/ban.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/ban.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/baseline.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/baseline.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/download.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/download.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/file-text.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/file-text.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/film.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/film.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/grip-horizontal.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/grip-horizontal.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/heading-1.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/heading-1.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/heading.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/heading.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/highlighter.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/highlighter.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/lightbulb.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/lightbulb.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/link-2.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/link-2.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/monitor-play.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/monitor-play.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/mouse-pointer-click.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/mouse-pointer-click.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/music.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/music.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/paint-bucket.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/paint-bucket.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/palette.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/palette.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/panel-left.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/panel-left.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/panel-top.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/panel-top.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/paperclip.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/paperclip.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/refresh-cw.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/refresh-cw.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/remove-formatting.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/remove-formatting.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/settings-2.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/settings-2.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/square-chevron-right.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/square-chevron-right.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/type.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/type.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/upload.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/upload.js.map +1 -1
- package/dist/src/assets/css/ui/ihub-text-editor-blocks.css +951 -0
- package/dist/src/assets/css/ui/tables.css +17 -0
- package/dist/src/assets/css/ui/ui-index.css +1 -0
- package/dist/src/components/ui/ComponentLists.js +1 -1
- package/dist/src/components/ui/editor/ihub-editor/IHubTextEditor.js +1 -1
- package/dist/src/components/ui/editor/ihub-editor/blocks/BlockHandle.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/blocks/BlockHandle.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/blocks/BlockKeymap.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/blocks/BlockKeymap.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/blocks/blockLayout.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/blocks/blockLayout.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/blocks/blockOps.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/blocks/blockOps.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/blocks/useBlockDrag.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/blocks/useBlockDrag.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/BubbleToolbar.js +1 -1
- package/dist/src/components/ui/editor/ihub-editor/components/ColorPalette.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/ColorPalette.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/FloatingAddButton.js +1 -1
- package/dist/src/components/ui/editor/ihub-editor/components/SlashCommandMenu.js +1 -1
- package/dist/src/components/ui/editor/ihub-editor/components/TableToolbar.js +1 -1
- package/dist/src/components/ui/editor/ihub-editor/components/blocks/ButtonBlockView.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/blocks/ButtonBlockView.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/blocks/CalloutView.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/blocks/CalloutView.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/blocks/SectionBannerView.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/blocks/SectionBannerView.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/blocks/useDismiss.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/blocks/useDismiss.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/commandIcons.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/commandIcons.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/media/MediaBlockView.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/media/MediaBlockView.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/media/MediaPlaceholder.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/media/MediaPlaceholder.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/media/MediaPreview.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/media/MediaPreview.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/constants.js +1 -1
- package/dist/src/components/ui/editor/ihub-editor/constants.js.map +1 -1
- package/dist/src/components/ui/editor/ihub-editor/extensions/ButtonBlock.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/ButtonBlock.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/Callout.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/Callout.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/MediaBlock.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/MediaBlock.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/PreserveStyles.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/PreserveStyles.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/SectionBanner.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/SectionBanner.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/TableExtensions.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/TableExtensions.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/ToggleBlock.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/ToggleBlock.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/colorUtils.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/colorUtils.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/hooks/useIHubEditor.js +1 -1
- package/dist/src/components/ui/editor/ihub-editor/hooks/useMediaEmbed.js +1 -1
- package/dist/src/components/ui/editor/ihub-editor/hooks/useSurfaceClick.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/hooks/useSurfaceClick.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/table/TableControls.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/table/TableControls.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/table/TableLineMenu.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/table/TableLineMenu.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/table/tableOps.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/table/tableOps.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/table/useTableHover.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/table/useTableHover.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/types.js +1 -1
- package/dist/src/components/ui/editor/ihub-editor/types.js.map +1 -1
- package/dist/src/components/ui/editor/ihub-editor/upload/mediaKinds.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/upload/mediaKinds.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/upload/s3Direct.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/upload/s3Direct.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/upload/uploadFile.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/upload/uploadFile.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/upload/uploadRegistry.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/upload/uploadRegistry.js.map +1 -0
- package/dist/src/components/ui/tables/IHubTableServer.js +1 -1
- package/dist/src/components/ui/tables/utils/tableState.js +1 -1
- package/dist/src/components/ui/tables/utils/tableState.js.map +1 -1
- package/dist/src/types/components/ui/editor/ihub-editor/IHubTextEditor.d.ts +1 -1
- package/dist/src/types/components/ui/editor/ihub-editor/blocks/BlockHandle.d.ts +16 -0
- package/dist/src/types/components/ui/editor/ihub-editor/blocks/BlockKeymap.d.ts +11 -0
- package/dist/src/types/components/ui/editor/ihub-editor/blocks/blockLayout.d.ts +37 -0
- package/dist/src/types/components/ui/editor/ihub-editor/blocks/blockOps.d.ts +45 -0
- package/dist/src/types/components/ui/editor/ihub-editor/blocks/useBlockDrag.d.ts +30 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/ColorPalette.d.ts +14 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/FloatingAddButton.d.ts +3 -2
- package/dist/src/types/components/ui/editor/ihub-editor/components/blocks/ButtonBlockView.d.ts +2 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/blocks/CalloutView.d.ts +2 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/blocks/SectionBannerView.d.ts +2 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/blocks/useDismiss.d.ts +3 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/commandIcons.d.ts +3 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/media/MediaBlockView.d.ts +6 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/media/MediaPlaceholder.d.ts +10 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/media/MediaPreview.d.ts +10 -0
- package/dist/src/types/components/ui/editor/ihub-editor/constants.d.ts +5 -1
- package/dist/src/types/components/ui/editor/ihub-editor/extensions/ButtonBlock.d.ts +21 -0
- package/dist/src/types/components/ui/editor/ihub-editor/extensions/Callout.d.ts +20 -0
- package/dist/src/types/components/ui/editor/ihub-editor/extensions/MediaBlock.d.ts +39 -0
- package/dist/src/types/components/ui/editor/ihub-editor/extensions/PreserveStyles.d.ts +6 -0
- package/dist/src/types/components/ui/editor/ihub-editor/extensions/SectionBanner.d.ts +15 -0
- package/dist/src/types/components/ui/editor/ihub-editor/extensions/TableExtensions.d.ts +14 -0
- package/dist/src/types/components/ui/editor/ihub-editor/extensions/ToggleBlock.d.ts +13 -0
- package/dist/src/types/components/ui/editor/ihub-editor/extensions/colorUtils.d.ts +14 -0
- package/dist/src/types/components/ui/editor/ihub-editor/hooks/useIHubEditor.d.ts +8 -2
- package/dist/src/types/components/ui/editor/ihub-editor/hooks/useMediaEmbed.d.ts +2 -1
- package/dist/src/types/components/ui/editor/ihub-editor/hooks/useSurfaceClick.d.ts +28 -0
- package/dist/src/types/components/ui/editor/ihub-editor/index.d.ts +1 -1
- package/dist/src/types/components/ui/editor/ihub-editor/table/TableControls.d.ts +9 -0
- package/dist/src/types/components/ui/editor/ihub-editor/table/TableLineMenu.d.ts +25 -0
- package/dist/src/types/components/ui/editor/ihub-editor/table/tableOps.d.ts +25 -0
- package/dist/src/types/components/ui/editor/ihub-editor/table/useTableHover.d.ts +25 -0
- package/dist/src/types/components/ui/editor/ihub-editor/types.d.ts +83 -2
- package/dist/src/types/components/ui/editor/ihub-editor/upload/mediaKinds.d.ts +32 -0
- package/dist/src/types/components/ui/editor/ihub-editor/upload/s3Direct.d.ts +5 -0
- package/dist/src/types/components/ui/editor/ihub-editor/upload/uploadFile.d.ts +19 -0
- package/dist/src/types/components/ui/editor/ihub-editor/upload/uploadRegistry.d.ts +15 -0
- package/dist/src/types/components/ui/tables/IHubTableServer.d.ts +6 -0
- package/dist/src/types/components/ui/tables/utils/tableState.d.ts +10 -0
- package/dist/src/types/index.d.ts +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -4
- package/dist/src/components/ui/editor/ihub-editor/extensions/ImageWithCaption.js +0 -2
- package/dist/src/components/ui/editor/ihub-editor/extensions/ImageWithCaption.js.map +0 -1
- package/dist/src/components/ui/editor/ihub-editor/hooks/useImageUpload.js +0 -2
- package/dist/src/components/ui/editor/ihub-editor/hooks/useImageUpload.js.map +0 -1
- package/dist/src/types/components/ui/editor/ihub-editor/components/ImageBlock.d.ts +0 -12
- package/dist/src/types/components/ui/editor/ihub-editor/extensions/ImageWithCaption.d.ts +0 -14
- package/dist/src/types/components/ui/editor/ihub-editor/hooks/useImageUpload.d.ts +0 -11
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type NodeViewProps } from "@tiptap/react";
|
|
2
|
+
import type { MediaKind } from "../../types";
|
|
3
|
+
import type { MediaBlockAttrs } from "../../extensions/MediaBlock";
|
|
4
|
+
/** Resolve a pasted link into block attributes for the chosen kind. */
|
|
5
|
+
export declare function attrsFromLink(url: string, kind: MediaKind): Partial<MediaBlockAttrs> | null;
|
|
6
|
+
export default function MediaBlockView({ node, updateAttributes, deleteNode, selected, editor, extension }: NodeViewProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/src/types/components/ui/editor/ihub-editor/components/media/MediaPlaceholder.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MediaKind } from "../../types";
|
|
2
|
+
interface MediaPlaceholderProps {
|
|
3
|
+
kind: MediaKind;
|
|
4
|
+
canUpload: boolean;
|
|
5
|
+
error?: string | null;
|
|
6
|
+
onFile: (file: File) => void;
|
|
7
|
+
onLink: (url: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export default function MediaPlaceholder({ kind, canUpload, error, onFile, onLink }: MediaPlaceholderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MediaBlockAttrs } from "../../extensions/MediaBlock";
|
|
2
|
+
interface MediaPreviewProps {
|
|
3
|
+
attrs: MediaBlockAttrs;
|
|
4
|
+
src: string;
|
|
5
|
+
/** In edit mode a plain click selects the card instead of downloading. */
|
|
6
|
+
editable?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** In-editor rendering of an uploaded / linked media block, by kind. */
|
|
9
|
+
export default function MediaPreview({ attrs, src, editable }: MediaPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import { SlashCommandItem } from "./types";
|
|
1
|
+
import { IHubEditorFeatures, SlashCommandItem } from "./types";
|
|
2
2
|
export declare const SLASH_COMMANDS: SlashCommandItem[];
|
|
3
|
+
/** Commands available for the enabled feature set. */
|
|
4
|
+
export declare function commandsForFeatures(features: Required<IHubEditorFeatures>): SlashCommandItem[];
|
|
5
|
+
/** Case-insensitive match on title and keywords. */
|
|
6
|
+
export declare function filterCommands(items: SlashCommandItem[], query: string): SlashCommandItem[];
|
|
3
7
|
export declare const KEYBOARD_SHORTCUTS: Record<string, string>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
export interface ButtonBlockAttrs {
|
|
3
|
+
href: string;
|
|
4
|
+
label: string;
|
|
5
|
+
bgColor: string;
|
|
6
|
+
textColor: string;
|
|
7
|
+
align: "left" | "center" | "right";
|
|
8
|
+
}
|
|
9
|
+
declare module "@tiptap/core" {
|
|
10
|
+
interface Commands<ReturnType> {
|
|
11
|
+
buttonBlock: {
|
|
12
|
+
setButtonBlock: (attrs?: Partial<ButtonBlockAttrs>) => ReturnType;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** http(s), site-relative, mailto: and tel: links only. */
|
|
17
|
+
export declare function safeButtonHref(href: unknown): string;
|
|
18
|
+
export declare function buttonInlineStyle(bg: string, color: string): string;
|
|
19
|
+
/** Call-to-action button. Inline styles keep it intact in emails. */
|
|
20
|
+
declare const ButtonBlock: Node<any, any>;
|
|
21
|
+
export default ButtonBlock;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
export type CalloutVariant = "info" | "success" | "warning" | "danger" | "note";
|
|
3
|
+
/** Inline colours so exported HTML (e.g. emails) looks right without the stylesheet. */
|
|
4
|
+
export declare const CALLOUT_STYLES: Record<CalloutVariant, {
|
|
5
|
+
bg: string;
|
|
6
|
+
border: string;
|
|
7
|
+
emoji: string;
|
|
8
|
+
}>;
|
|
9
|
+
declare module "@tiptap/core" {
|
|
10
|
+
interface Commands<ReturnType> {
|
|
11
|
+
callout: {
|
|
12
|
+
setCallout: (attrs?: {
|
|
13
|
+
variant?: CalloutVariant;
|
|
14
|
+
emoji?: string;
|
|
15
|
+
}) => ReturnType;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
declare const Callout: Node<any, any>;
|
|
20
|
+
export default Callout;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
import type { MediaKind } from "../types";
|
|
3
|
+
import type { EditorUploader } from "../upload/uploadFile";
|
|
4
|
+
export interface MediaBlockAttrs {
|
|
5
|
+
kind: MediaKind;
|
|
6
|
+
src?: string | null;
|
|
7
|
+
name?: string | null;
|
|
8
|
+
size?: number | null;
|
|
9
|
+
mime?: string | null;
|
|
10
|
+
caption?: string;
|
|
11
|
+
align?: "left" | "center" | "right";
|
|
12
|
+
width?: string | null;
|
|
13
|
+
pendingId?: string | null;
|
|
14
|
+
uploadError?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface MediaBlockOptions {
|
|
17
|
+
/** Ref so the latest upload props are used without recreating the editor. */
|
|
18
|
+
uploaderRef: {
|
|
19
|
+
current: EditorUploader | null;
|
|
20
|
+
};
|
|
21
|
+
/** Kinds that may be uploaded (drop / paste / picker). */
|
|
22
|
+
uploadKinds: MediaKind[];
|
|
23
|
+
}
|
|
24
|
+
declare module "@tiptap/core" {
|
|
25
|
+
interface Commands<ReturnType> {
|
|
26
|
+
mediaBlock: {
|
|
27
|
+
setMediaBlock: (attrs: Partial<MediaBlockAttrs> & {
|
|
28
|
+
kind: MediaKind;
|
|
29
|
+
}) => ReturnType;
|
|
30
|
+
setImageWithCaption: (options: {
|
|
31
|
+
src: string;
|
|
32
|
+
alt?: string;
|
|
33
|
+
caption?: string;
|
|
34
|
+
}) => ReturnType;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
declare const MediaBlock: Node<MediaBlockOptions, any>;
|
|
39
|
+
export default MediaBlock;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Extension, Node } from "@tiptap/core";
|
|
2
|
+
export declare function stripProperties(style: string | null, properties?: string[]): string | null;
|
|
3
|
+
/** Keeps inline `style` from pasted or loaded HTML (emails, CMS exports). */
|
|
4
|
+
export declare const PreserveStyles: Extension<any, any>;
|
|
5
|
+
/** Generic styled <div> wrapper so layout boxes in pasted HTML survive. */
|
|
6
|
+
export declare const StyledBlock: Node<any, any>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
export type BannerPadding = "sm" | "md" | "lg";
|
|
3
|
+
export declare const BANNER_PADDING: Record<BannerPadding, string>;
|
|
4
|
+
declare module "@tiptap/core" {
|
|
5
|
+
interface Commands<ReturnType> {
|
|
6
|
+
sectionBanner: {
|
|
7
|
+
setSectionBanner: (attrs?: {
|
|
8
|
+
bgColor?: string;
|
|
9
|
+
textColor?: string;
|
|
10
|
+
}) => ReturnType;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
declare const SectionBanner: Node<any, any>;
|
|
15
|
+
export default SectionBanner;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TableView } from "@tiptap/extension-table";
|
|
2
|
+
import type { Node as PMNode } from "@tiptap/pm/model";
|
|
3
|
+
/** Applies preserved attributes to the live <table> the resizable view renders. */
|
|
4
|
+
export declare class TableViewWithAttrs extends TableView {
|
|
5
|
+
/** Style properties this view set, so they can be cleared when the style changes. */
|
|
6
|
+
private appliedProps;
|
|
7
|
+
constructor(node: PMNode, cellMinWidth: number);
|
|
8
|
+
update(node: PMNode): boolean;
|
|
9
|
+
private applyAttrs;
|
|
10
|
+
}
|
|
11
|
+
export declare const IHubTable: import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any>;
|
|
12
|
+
export declare const IHubTableRow: import("@tiptap/core").Node<import("@tiptap/extension-table-row").TableRowOptions, any>;
|
|
13
|
+
export declare const IHubTableCell: import("@tiptap/core").Node<import("@tiptap/extension-table-cell").TableCellOptions, any>;
|
|
14
|
+
export declare const IHubTableHeader: import("@tiptap/core").Node<import("@tiptap/extension-table-header").TableHeaderOptions, any>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
declare module "@tiptap/core" {
|
|
3
|
+
interface Commands<ReturnType> {
|
|
4
|
+
toggleBlock: {
|
|
5
|
+
setToggleBlock: () => ReturnType;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/** Title line of a collapsible toggle. */
|
|
10
|
+
export declare const ToggleSummary: Node<any, any>;
|
|
11
|
+
/** Notion-style collapsible block, exported as native <details>. */
|
|
12
|
+
declare const ToggleBlock: Node<any, any>;
|
|
13
|
+
export default ToggleBlock;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Accept only plain colour values so attributes can't inject extra CSS. */
|
|
2
|
+
export declare function safeColor(value: unknown, fallback: string): string;
|
|
3
|
+
/** Split a style string on ";" outside parentheses and quotes (data: URLs contain ";base64"). */
|
|
4
|
+
export declare function splitDeclarations(style: string): string[];
|
|
5
|
+
/**
|
|
6
|
+
* Drop declarations that can run code, pull remote resources (tracking pixels)
|
|
7
|
+
* or pin content over the page (full-screen overlays).
|
|
8
|
+
*/
|
|
9
|
+
export declare function sanitizeStyle(style: string | null | undefined): string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Read a declaration from the raw style attribute. Unlike el.style.x this keeps
|
|
12
|
+
* the author's value (hex stays hex) and ignores !important.
|
|
13
|
+
*/
|
|
14
|
+
export declare function readStyleValue(el: HTMLElement, property: string): string | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type Extensions } from "@tiptap/core";
|
|
1
|
+
import { type AnyExtension, type Extensions } from "@tiptap/core";
|
|
2
2
|
import { IHubEditorFeatures } from "../types";
|
|
3
|
+
import type { EditorUploader } from "../upload/uploadFile";
|
|
3
4
|
interface UseIHubEditorOptions {
|
|
4
5
|
content?: string;
|
|
5
6
|
placeholder?: string;
|
|
@@ -11,6 +12,11 @@ interface UseIHubEditorOptions {
|
|
|
11
12
|
additionalExtensions?: Extensions;
|
|
12
13
|
onSlashCommandStart?: (props: any) => void;
|
|
13
14
|
onSlashCommandExit?: () => void;
|
|
15
|
+
uploaderRef?: {
|
|
16
|
+
current: EditorUploader | null;
|
|
17
|
+
};
|
|
14
18
|
}
|
|
15
|
-
|
|
19
|
+
/** Build the extension list for the enabled features. Exported for headless tests. */
|
|
20
|
+
export declare function buildExtensions({ placeholder, charLimit, features: featuresProp, additionalExtensions, onSlashCommandStart, onSlashCommandExit, uploaderRef, }: Omit<UseIHubEditorOptions, "content" | "readOnly" | "onChange" | "onBlur">): AnyExtension[];
|
|
21
|
+
export default function useIHubEditor({ content, readOnly, onChange, onBlur, ...rest }: UseIHubEditorOptions): import("@tiptap/react").Editor | null;
|
|
16
22
|
export {};
|
|
@@ -3,5 +3,6 @@ interface UseMediaEmbedOptions {
|
|
|
3
3
|
editor: Editor | null;
|
|
4
4
|
enabled?: boolean;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
/** Turn a pasted YouTube / Vimeo / Loom / Figma / Drive link into an embed block. */
|
|
7
|
+
export default function useMediaEmbed({ editor, enabled }: UseMediaEmbedOptions): void;
|
|
7
8
|
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
export declare function isDragGesture(down: {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
} | null, up: {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
}): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Should a click on the editor area move the caret to the end?
|
|
11
|
+
* Only a plain click (not a drag-select) on the blank writing surface below
|
|
12
|
+
* the last block qualifies. Clicks on menus, toolbars, node views or text
|
|
13
|
+
* are left alone. The old handler treated those as "outside content" and
|
|
14
|
+
* called focus("end"), which made the caret jump.
|
|
15
|
+
*/
|
|
16
|
+
export declare function shouldFocusEnd(options: {
|
|
17
|
+
target: HTMLElement;
|
|
18
|
+
surface: HTMLElement;
|
|
19
|
+
contentDom: HTMLElement;
|
|
20
|
+
clientY: number;
|
|
21
|
+
dragged: boolean;
|
|
22
|
+
selectionCollapsed: boolean;
|
|
23
|
+
}): boolean;
|
|
24
|
+
/** Click-below-content to continue writing, without breaking selections. */
|
|
25
|
+
export default function useSurfaceClick(editor: Editor | null, readOnly: boolean): {
|
|
26
|
+
onMouseDown: (e: React.MouseEvent) => void;
|
|
27
|
+
onClick: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
28
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from "./IHubTextEditor";
|
|
2
|
-
export type { IHubTextEditorProps, IHubEditorFeatures } from "./types";
|
|
2
|
+
export type { IHubTextEditorProps, IHubEditorFeatures, IHubEditorUploadConfig, FileUploadHandler, FileUploadContext, UploadedFileResult, EditorPresignResult, MediaKind, } from "./types";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Editor } from "@tiptap/react";
|
|
3
|
+
interface TableControlsProps {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
6
|
+
}
|
|
7
|
+
/** Notion-style row/column handles and "+" bars for the table under the pointer. */
|
|
8
|
+
export default function TableControls({ editor, containerRef }: TableControlsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Axis } from "./tableOps";
|
|
2
|
+
export interface LineMenuAction {
|
|
3
|
+
insertBefore: () => void;
|
|
4
|
+
insertAfter: () => void;
|
|
5
|
+
moveBefore: () => void;
|
|
6
|
+
moveAfter: () => void;
|
|
7
|
+
duplicate: () => void;
|
|
8
|
+
toggleHeader: () => void;
|
|
9
|
+
setBackground: (color: string | null) => void;
|
|
10
|
+
remove: () => void;
|
|
11
|
+
}
|
|
12
|
+
interface TableLineMenuProps {
|
|
13
|
+
axis: Axis;
|
|
14
|
+
index: number;
|
|
15
|
+
count: number;
|
|
16
|
+
canMove: boolean;
|
|
17
|
+
position: {
|
|
18
|
+
top: number;
|
|
19
|
+
left: number;
|
|
20
|
+
};
|
|
21
|
+
actions: LineMenuAction;
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
}
|
|
24
|
+
export default function TableLineMenu({ axis, index, count, canMove, position, actions, onClose }: TableLineMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Node as PMNode } from "@tiptap/pm/model";
|
|
2
|
+
import type { EditorState, Transaction } from "@tiptap/pm/state";
|
|
3
|
+
export type Axis = "row" | "column";
|
|
4
|
+
export interface TableRef {
|
|
5
|
+
node: PMNode;
|
|
6
|
+
/** Position directly before the table node. */
|
|
7
|
+
pos: number;
|
|
8
|
+
}
|
|
9
|
+
/** Find the table node at (or wrapping) `pos`. */
|
|
10
|
+
export declare function findTableAt(doc: PMNode, pos: number): TableRef | null;
|
|
11
|
+
export declare function hasMergedCells(table: PMNode): boolean;
|
|
12
|
+
export declare function tableSize(table: PMNode): {
|
|
13
|
+
rows: number;
|
|
14
|
+
cols: number;
|
|
15
|
+
};
|
|
16
|
+
/** Absolute position of the cell at (row, col). */
|
|
17
|
+
export declare function cellPos(ref: TableRef, row: number, col: number): number;
|
|
18
|
+
/** Move a row or column to a new index. Returns null when not possible (merged cells / out of range). */
|
|
19
|
+
export declare function moveTableLine(state: EditorState, ref: TableRef, axis: Axis, from: number, to: number): Transaction | null;
|
|
20
|
+
/** Insert a copy of a row / column right after it. */
|
|
21
|
+
export declare function duplicateTableLine(state: EditorState, ref: TableRef, axis: Axis, index: number): Transaction | null;
|
|
22
|
+
/** Set an attribute (e.g. backgroundColor) on every cell in a row or column. */
|
|
23
|
+
export declare function setLineCellAttr(state: EditorState, ref: TableRef, axis: Axis, index: number, attr: string, value: unknown): Transaction;
|
|
24
|
+
/** Select an entire row or column so prosemirror-tables commands act on it. */
|
|
25
|
+
export declare function selectTableLine(state: EditorState, ref: TableRef, axis: Axis, index: number): Transaction;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Editor } from "@tiptap/react";
|
|
3
|
+
export interface Box {
|
|
4
|
+
top: number;
|
|
5
|
+
left: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}
|
|
9
|
+
export interface TableTarget {
|
|
10
|
+
tablePos: number;
|
|
11
|
+
row: number;
|
|
12
|
+
col: number;
|
|
13
|
+
rows: number;
|
|
14
|
+
cols: number;
|
|
15
|
+
table: Box;
|
|
16
|
+
cell: Box;
|
|
17
|
+
}
|
|
18
|
+
/** Resolve the table / row / column under a DOM cell. */
|
|
19
|
+
export declare function targetFromCell(editor: Editor, cellEl: HTMLElement, container: HTMLElement): TableTarget | null;
|
|
20
|
+
/** Track which table cell the pointer (or caret) is on. `freeze` pins the target while a menu is open. */
|
|
21
|
+
export default function useTableHover(editor: Editor, containerRef: React.RefObject<HTMLDivElement | null>, freeze: boolean): {
|
|
22
|
+
target: TableTarget | null;
|
|
23
|
+
setTarget: import("react").Dispatch<import("react").SetStateAction<TableTarget | null>>;
|
|
24
|
+
cancelHide: () => void;
|
|
25
|
+
};
|
|
@@ -1,4 +1,65 @@
|
|
|
1
1
|
import { Extension } from "@tiptap/react";
|
|
2
|
+
import type { AnyExtension } from "@tiptap/core";
|
|
3
|
+
/** Kinds of uploadable / embeddable media blocks. */
|
|
4
|
+
export type MediaKind = "image" | "video" | "audio" | "pdf" | "file" | "embed";
|
|
5
|
+
/** What an upload handler resolves with. A bare string is treated as the URL. */
|
|
6
|
+
export interface UploadedFileResult {
|
|
7
|
+
url: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
size?: number;
|
|
10
|
+
mime?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface FileUploadContext {
|
|
13
|
+
kind: MediaKind;
|
|
14
|
+
/** Report upload progress (0–100). Optional for handlers that can't track it. */
|
|
15
|
+
onProgress: (percent: number) => void;
|
|
16
|
+
}
|
|
17
|
+
export type FileUploadHandler = (file: File, context: FileUploadContext) => Promise<string | UploadedFileResult>;
|
|
18
|
+
/** Response expected from a presign endpoint (same shape as S3MultiUploader). */
|
|
19
|
+
export interface EditorPresignResult {
|
|
20
|
+
/** Short-lived presigned PUT URL. */
|
|
21
|
+
url: string;
|
|
22
|
+
/** Public / CDN URL the file will be served from. */
|
|
23
|
+
cdnUrl: string;
|
|
24
|
+
key?: string;
|
|
25
|
+
/** Server-validated content type for the PUT. */
|
|
26
|
+
contentType?: string;
|
|
27
|
+
/** Extra headers covered by the signature (e.g. x-amz-acl). */
|
|
28
|
+
headers?: Record<string, string>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Upload configuration. Resolution order when a file is added:
|
|
32
|
+
* 1. `onFileUpload` prop (or `onImageUpload` for images)
|
|
33
|
+
* 2. `getPresignedUrl` / `presignEndpoint` / NEXT_PUBLIC_IHUB_EDITOR_PRESIGN_URL
|
|
34
|
+
* 3. `endpoint` / NEXT_PUBLIC_IHUB_EDITOR_UPLOAD_URL (multipart POST, Leadboard style)
|
|
35
|
+
* 4. Direct S3 using the NEXT_PUBLIC_AWS_* variables FileUploader already uses —
|
|
36
|
+
* opt-in only (`directS3: true` or NEXT_PUBLIC_IHUB_EDITOR_DIRECT_S3=true),
|
|
37
|
+
* because the secret key ships to the browser.
|
|
38
|
+
*/
|
|
39
|
+
export interface IHubEditorUploadConfig {
|
|
40
|
+
/** Bearer token sent with presign / endpoint requests via reqOptions. */
|
|
41
|
+
token?: string | null;
|
|
42
|
+
/** Channel id header, forwarded to reqOptions. */
|
|
43
|
+
channel?: string | null;
|
|
44
|
+
getPresignedUrl?: (file: File, kind: MediaKind) => Promise<EditorPresignResult>;
|
|
45
|
+
/** POST {filename, content_type, size, kind} → EditorPresignResult. */
|
|
46
|
+
presignEndpoint?: string;
|
|
47
|
+
/** POST multipart form; JSON response must contain a URL field. */
|
|
48
|
+
endpoint?: string;
|
|
49
|
+
/** Multipart field name for the file (default "file"). */
|
|
50
|
+
fieldName?: string;
|
|
51
|
+
/** Extra multipart fields sent with the file. */
|
|
52
|
+
extraFields?: Record<string, string>;
|
|
53
|
+
/**
|
|
54
|
+
* Opt in to direct browser → S3 uploads with the NEXT_PUBLIC_AWS_* keys.
|
|
55
|
+
* Defaults to NEXT_PUBLIC_IHUB_EDITOR_DIRECT_S3 === "true". Prefer a presign endpoint.
|
|
56
|
+
*/
|
|
57
|
+
directS3?: boolean;
|
|
58
|
+
/** Folder/prefix for direct S3 uploads (default NEXT_PUBLIC_IHUB_EDITOR_S3_FOLDER or "editor"). */
|
|
59
|
+
s3Folder?: string;
|
|
60
|
+
/** Max upload size per kind in MB. */
|
|
61
|
+
maxSizeMB?: Partial<Record<MediaKind, number>>;
|
|
62
|
+
}
|
|
2
63
|
export interface IHubTextEditorProps {
|
|
3
64
|
name?: string;
|
|
4
65
|
label?: string;
|
|
@@ -9,26 +70,42 @@ export interface IHubTextEditorProps {
|
|
|
9
70
|
required?: boolean;
|
|
10
71
|
charLimit?: number;
|
|
11
72
|
features?: IHubEditorFeatures;
|
|
73
|
+
/** Legacy image-only upload handler. Prefer `onFileUpload`. */
|
|
12
74
|
onImageUpload?: (file: File) => Promise<string>;
|
|
75
|
+
/** Upload handler used for image, video, audio, PDF and file blocks. */
|
|
76
|
+
onFileUpload?: FileUploadHandler;
|
|
77
|
+
/** Built-in upload strategies (presign, endpoint, env-driven S3). */
|
|
78
|
+
upload?: IHubEditorUploadConfig;
|
|
13
79
|
className?: string;
|
|
14
80
|
minHeight?: string;
|
|
15
81
|
maxHeight?: string;
|
|
16
82
|
lastUpdated?: string;
|
|
17
83
|
readOnly?: boolean;
|
|
18
|
-
extensions?: Extension
|
|
84
|
+
extensions?: Array<Extension | AnyExtension>;
|
|
19
85
|
}
|
|
20
86
|
export interface IHubEditorFeatures {
|
|
21
87
|
bubbleMenu?: boolean;
|
|
22
88
|
slashCommands?: boolean;
|
|
23
89
|
floatingAddButton?: boolean;
|
|
90
|
+
/** Hover handle on every block: drag to reorder, "+" to add a line, click for options. */
|
|
24
91
|
dragHandle?: boolean;
|
|
25
92
|
focusMode?: boolean;
|
|
26
93
|
imageUpload?: boolean;
|
|
94
|
+
/** Video, audio, PDF and file blocks. */
|
|
95
|
+
fileUploads?: boolean;
|
|
27
96
|
mediaEmbeds?: boolean;
|
|
28
97
|
tables?: boolean;
|
|
29
98
|
codeBlocks?: boolean;
|
|
30
99
|
taskLists?: boolean;
|
|
31
100
|
pullQuotes?: boolean;
|
|
101
|
+
/** Section banners with configurable background/text colour. */
|
|
102
|
+
banners?: boolean;
|
|
103
|
+
callouts?: boolean;
|
|
104
|
+
toggles?: boolean;
|
|
105
|
+
/** Call-to-action button blocks. */
|
|
106
|
+
buttons?: boolean;
|
|
107
|
+
/** Keep inline styles and email-table attributes from pasted / loaded HTML. */
|
|
108
|
+
preserveStyles?: boolean;
|
|
32
109
|
characterCount?: boolean;
|
|
33
110
|
typography?: boolean;
|
|
34
111
|
}
|
|
@@ -36,9 +113,13 @@ export interface SlashCommandItem {
|
|
|
36
113
|
title: string;
|
|
37
114
|
description: string;
|
|
38
115
|
icon: string;
|
|
116
|
+
/** Extra search terms. */
|
|
117
|
+
keywords?: string[];
|
|
118
|
+
/** Feature flag that must be on for the command to show. */
|
|
119
|
+
feature?: keyof IHubEditorFeatures;
|
|
39
120
|
command: (props: {
|
|
40
121
|
editor: any;
|
|
41
|
-
range
|
|
122
|
+
range?: any;
|
|
42
123
|
}) => void;
|
|
43
124
|
}
|
|
44
125
|
export interface LinkPopoverState {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { MediaKind } from "../types";
|
|
2
|
+
export declare const ACCEPT_BY_KIND: Record<MediaKind, string>;
|
|
3
|
+
export declare const DEFAULT_MAX_SIZE_MB: Record<MediaKind, number>;
|
|
4
|
+
export declare const KIND_LABEL: Record<MediaKind, string>;
|
|
5
|
+
/** Pick the block kind that best displays a file. */
|
|
6
|
+
export declare function kindFromMime(mime: string, fileName?: string): MediaKind;
|
|
7
|
+
/** Guess a kind from a pasted URL's extension (used for "Embed link"). */
|
|
8
|
+
export declare function kindFromUrl(url: string, fallback: MediaKind): MediaKind;
|
|
9
|
+
export declare function formatBytes(bytes?: number | null): string;
|
|
10
|
+
export declare function fileExtension(name?: string | null): string;
|
|
11
|
+
export declare function fileNameFromUrl(url: string): string;
|
|
12
|
+
/** Convert a known provider URL into its embeddable iframe URL, or null. */
|
|
13
|
+
export declare function toEmbedUrl(url: string): string | null;
|
|
14
|
+
/** Embeds are limited to known providers so pasted HTML can't frame arbitrary sites. */
|
|
15
|
+
export declare function isAllowedEmbed(url: string): boolean;
|
|
16
|
+
/** Accept only plain widths (e.g. "60%", "480px") so the attribute can't inject CSS. */
|
|
17
|
+
export declare function safeWidth(value: unknown): string | null;
|
|
18
|
+
/** Only allow http(s) and site-relative URLs into src/href attributes. */
|
|
19
|
+
export declare function isSafeUrl(url?: string | null): boolean;
|
|
20
|
+
/** Provider players need scripts + same-origin; forms and top navigation stay blocked. */
|
|
21
|
+
export declare const EMBED_SANDBOX = "allow-scripts allow-same-origin allow-presentation allow-popups";
|
|
22
|
+
/** The src to render for a media block, or "" when it isn't allowed for that kind. */
|
|
23
|
+
export declare function renderableSrc(attrs: {
|
|
24
|
+
kind: MediaKind;
|
|
25
|
+
src?: string | null;
|
|
26
|
+
}): string;
|
|
27
|
+
/**
|
|
28
|
+
* PDFs get an inline viewer only when the URL is really a .pdf (or a local blob).
|
|
29
|
+
* Chrome won't render PDFs in a sandboxed iframe, so this check is what stops a
|
|
30
|
+
* "PDF" block from framing an arbitrary page; other URLs render as a download card.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isInlinePdf(src: string): boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { UploadedFileResult } from "../types";
|
|
2
|
+
export declare function isDirectS3Configured(): boolean;
|
|
3
|
+
export declare function publicUrlForKey(key: string): string;
|
|
4
|
+
export declare function buildObjectKey(fileName: string, folder?: string): string;
|
|
5
|
+
export declare function directS3Upload(file: File, folder?: string, onProgress?: (percent: number) => void): Promise<UploadedFileResult>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FileUploadHandler, IHubEditorUploadConfig, MediaKind, UploadedFileResult } from "../types";
|
|
2
|
+
export type EditorUploader = (file: File, kind: MediaKind, onProgress?: (percent: number) => void) => Promise<UploadedFileResult>;
|
|
3
|
+
export interface UploaderSources {
|
|
4
|
+
onFileUpload?: FileUploadHandler;
|
|
5
|
+
onImageUpload?: (file: File) => Promise<string>;
|
|
6
|
+
upload?: IHubEditorUploadConfig;
|
|
7
|
+
}
|
|
8
|
+
export declare class UploadNotConfiguredError extends Error {
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
11
|
+
/** Find the uploaded file's URL in an arbitrary API response. */
|
|
12
|
+
export declare function extractUrl(payload: unknown): string | null;
|
|
13
|
+
export declare function validateFileSize(file: File, kind: MediaKind, config?: IHubEditorUploadConfig): void;
|
|
14
|
+
/** XHR wrapper so uploads can report real progress. */
|
|
15
|
+
export declare function sendWithProgress(method: string, url: string, body: Document | XMLHttpRequestBodyInit, headers: Record<string, string>, onProgress?: (percent: number) => void): Promise<string>;
|
|
16
|
+
/** Build the uploader used by every media block, following the documented resolution order. */
|
|
17
|
+
export declare function createUploader(sources: UploaderSources): EditorUploader;
|
|
18
|
+
/** True when at least one upload strategy is available. */
|
|
19
|
+
export declare function canUpload(sources: UploaderSources, kind: MediaKind): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/core";
|
|
2
|
+
import type { MediaKind } from "../types";
|
|
3
|
+
import type { EditorUploader } from "./uploadFile";
|
|
4
|
+
export interface UploadStatus {
|
|
5
|
+
progress: number;
|
|
6
|
+
name: string;
|
|
7
|
+
preview: string | null;
|
|
8
|
+
error?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function newUploadId(): string;
|
|
11
|
+
export declare function getUpload(id?: string | null): UploadStatus | undefined;
|
|
12
|
+
export declare function subscribeUpload(id: string, listener: (status: UploadStatus) => void): () => void;
|
|
13
|
+
/** Merge attrs into the media node carrying this pendingId, wherever it now is. */
|
|
14
|
+
export declare function patchMediaNode(editor: Editor, id: string, attrs: Record<string, unknown>): boolean;
|
|
15
|
+
export declare function beginUpload(editor: Editor, id: string, file: File, kind: MediaKind, uploader: EditorUploader): void;
|
|
@@ -5,6 +5,12 @@ export interface IHubTableServerRef {
|
|
|
5
5
|
refresh: () => void;
|
|
6
6
|
/** Forget the remembered page/sort/search for this table and go back to page 1. */
|
|
7
7
|
resetState: () => void;
|
|
8
|
+
/**
|
|
9
|
+
* Mark a row (by its `keyExtractor` value) as the one the user is leaving
|
|
10
|
+
* for, so it is highlighted and focused when they come back. Row clicks do
|
|
11
|
+
* this automatically; call it from action menus that navigate away.
|
|
12
|
+
*/
|
|
13
|
+
rememberRow: (rowKey: string | number) => void;
|
|
8
14
|
}
|
|
9
15
|
interface IHubTableServerPropsType<T> {
|
|
10
16
|
/** Token for authentication */
|
|
@@ -20,6 +20,11 @@ export interface PersistedTableStateType {
|
|
|
20
20
|
*/
|
|
21
21
|
searchParamsKey: string;
|
|
22
22
|
savedAt: number;
|
|
23
|
+
/**
|
|
24
|
+
* `keyExtractor` value of the row the user last opened from this table, so
|
|
25
|
+
* the table can highlight and focus it when they come back.
|
|
26
|
+
*/
|
|
27
|
+
rowKey?: string | number;
|
|
23
28
|
}
|
|
24
29
|
/**
|
|
25
30
|
* Build the storage key that identifies one table.
|
|
@@ -35,6 +40,11 @@ export declare const buildTableStateKey: (persistKey: string | undefined, endpoi
|
|
|
35
40
|
* field that is not the right shape. Returns null when nothing usable is left.
|
|
36
41
|
*/
|
|
37
42
|
export declare const parseTableState: (raw: unknown) => PersistedTableStateType | null;
|
|
43
|
+
/**
|
|
44
|
+
* The row to highlight on return, if the table is showing the same list it
|
|
45
|
+
* was left on. A row key from a different filter set is not on screen anyway.
|
|
46
|
+
*/
|
|
47
|
+
export declare const resolveRestoredRowKey: (stored: PersistedTableStateType | null, currentSearchParamsKey: string) => string | number | null;
|
|
38
48
|
/** Read and validate the persisted state for a table. Never throws. */
|
|
39
49
|
export declare const readTableState: (storageKey: string) => PersistedTableStateType | null;
|
|
40
50
|
/** Persist the current state for a table. Never throws. */
|
|
@@ -73,7 +73,7 @@ export { default as S3MultiUploader } from "./components/forms/uploads/S3MultiUp
|
|
|
73
73
|
export type { S3UploadResponseType, S3MultiUploaderProps, PresignedUploadResult } from "./types";
|
|
74
74
|
export { default as CustomTextEditor } from "./components/ui/editor/CustomTextEditor";
|
|
75
75
|
export { default as IHubTextEditor } from "./components/ui/editor/ihub-editor";
|
|
76
|
-
export type { IHubTextEditorProps, IHubEditorFeatures } from "./components/ui/editor/ihub-editor";
|
|
76
|
+
export type { IHubTextEditorProps, IHubEditorFeatures, IHubEditorUploadConfig, FileUploadHandler, FileUploadContext, UploadedFileResult, EditorPresignResult, MediaKind, } from "./components/ui/editor/ihub-editor";
|
|
77
77
|
export { default as ContentViewer } from "./components/ui/viewer/ContentViewer";
|
|
78
78
|
export { default as ContentViewOrEdit } from "./components/ui/viewer/ContentViewOrEdit";
|
|
79
79
|
export { default as CodeDisplay } from "./components/ui/viewer/CodeDisplay";
|