@djangocfg/ui-tools 2.1.417 → 2.1.419
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/dist/audio-player/index.cjs +1 -2
- package/dist/audio-player/index.cjs.map +1 -1
- package/dist/audio-player/index.d.cts +3 -11
- package/dist/audio-player/index.d.ts +3 -11
- package/dist/audio-player/index.mjs +1 -2
- package/dist/audio-player/index.mjs.map +1 -1
- package/dist/file-icon/index.cjs +3 -3
- package/dist/file-icon/index.cjs.map +1 -1
- package/dist/file-icon/index.mjs +3 -3
- package/dist/file-icon/index.mjs.map +1 -1
- package/dist/tree/index.cjs +0 -3
- package/dist/tree/index.cjs.map +1 -1
- package/dist/tree/index.mjs +0 -3
- package/dist/tree/index.mjs.map +1 -1
- package/package.json +117 -36
- package/src/common/FloatingToolbar/actions/CopyAction.tsx +31 -0
- package/src/{components → common}/FloatingToolbar/actions/DownloadAction.tsx +15 -10
- package/src/common/FloatingToolbar/actions/ExpandAction.tsx +33 -0
- package/src/common/FloatingToolbar/actions/FullscreenAction.tsx +38 -0
- package/src/{components → common}/FloatingToolbar/index.tsx +39 -0
- package/src/lib/http.ts +64 -0
- package/src/tools/chat/index.ts +1 -1
- package/src/tools/chat/launcher/ChatFAB.tsx +66 -74
- package/src/tools/chat/launcher/header/ChatHeaderActionButton.tsx +2 -3
- package/src/tools/chat/lazy.tsx +1 -1
- package/src/tools/chat/messages/MessageBubble.tsx +1 -1
- package/src/tools/chat/messages/blocks/builtin.tsx +1 -1
- package/src/tools/chat/messages/blocks/renderers/CodeBlock.tsx +2 -2
- package/src/tools/chat/messages/blocks/renderers/JsonBlock.tsx +12 -1
- package/src/tools/data/DataGrid/lazy.tsx +1 -1
- package/src/tools/data/DataTable/lazy.tsx +1 -1
- package/src/tools/data/JsonTree/JsonViewer.tsx +720 -0
- package/src/tools/data/JsonTree/README.md +126 -73
- package/src/tools/data/JsonTree/index.tsx +3 -95
- package/src/tools/data/JsonTree/lazy.tsx +10 -50
- package/src/tools/data/JsonTree/types.ts +82 -63
- package/src/tools/data/Kanban/lazy.tsx +1 -1
- package/src/tools/data/Listbox/lazy.tsx +1 -1
- package/src/tools/data/Masonry/lazy.tsx +1 -1
- package/src/tools/data/Timeline/lazy.tsx +1 -1
- package/src/tools/data/Tree/components/TreeRow.tsx +0 -11
- package/src/tools/data/Tree/lazy.tsx +1 -1
- package/src/tools/dev/Map/lazy.tsx +1 -1
- package/src/tools/dev/Mermaid/Mermaid.client.tsx +2 -2
- package/src/tools/dev/Mermaid/lazy.tsx +1 -1
- package/src/tools/dev/api/ApiRefTable/ApiRefTable.tsx +65 -0
- package/src/tools/dev/api/ApiRefTable/README.md +31 -0
- package/src/tools/dev/api/ApiRefTable/components/Row.tsx +96 -0
- package/src/tools/dev/api/ApiRefTable/components/TypeDisplay.tsx +44 -0
- package/src/tools/dev/api/ApiRefTable/index.ts +6 -0
- package/src/tools/dev/api/ApiRefTable/lazy.tsx +21 -0
- package/src/tools/dev/api/ApiRefTable/types.ts +82 -0
- package/src/tools/dev/api/ApiRefTable/utils.ts +42 -0
- package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/ApiIntroSection.tsx +1 -1
- package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/CodeSamples/index.tsx +1 -1
- package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/Header/index.tsx +1 -1
- package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/Responses/ResponseBody.tsx +7 -21
- package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/RequestPanel.tsx +1 -1
- package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/ResponsePanel/PrettyView.tsx +13 -19
- package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/ResponsePanel/types.ts +1 -1
- package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/lazy.tsx +1 -1
- package/src/tools/dev/api/RequestViewer/README.md +33 -0
- package/src/tools/dev/api/RequestViewer/RequestViewer.tsx +121 -0
- package/src/tools/dev/api/RequestViewer/components/BodyTab.tsx +44 -0
- package/src/tools/dev/api/RequestViewer/components/EmptyState.tsx +13 -0
- package/src/tools/dev/api/RequestViewer/components/HeadersTab.tsx +78 -0
- package/src/tools/dev/api/RequestViewer/components/TimingTab.tsx +113 -0
- package/src/tools/dev/api/RequestViewer/components/utils.ts +31 -0
- package/src/tools/dev/api/RequestViewer/index.ts +16 -0
- package/src/tools/dev/api/RequestViewer/lazy.tsx +30 -0
- package/src/tools/dev/api/RequestViewer/types.ts +81 -0
- package/src/tools/dev/code/DiffViewer/DiffViewer.tsx +144 -0
- package/src/tools/dev/code/DiffViewer/README.md +33 -0
- package/src/tools/dev/code/DiffViewer/components/CopyButton.tsx +49 -0
- package/src/tools/dev/code/DiffViewer/components/DiffLineContent.tsx +48 -0
- package/src/tools/dev/code/DiffViewer/components/SplitView.tsx +220 -0
- package/src/tools/dev/code/DiffViewer/components/UnifiedView.tsx +154 -0
- package/src/tools/dev/code/DiffViewer/hooks/useDiff.ts +47 -0
- package/src/tools/dev/code/DiffViewer/hooks/useHighlighter.ts +54 -0
- package/src/tools/dev/code/DiffViewer/index.ts +22 -0
- package/src/tools/dev/code/DiffViewer/lazy.tsx +22 -0
- package/src/tools/dev/code/DiffViewer/types.ts +109 -0
- package/src/tools/dev/code/DiffViewer/utils/computeDiff.ts +159 -0
- package/src/tools/dev/{MarkdownMessage → code/MarkdownMessage}/CollapseToggle.tsx +1 -1
- package/src/tools/dev/{MarkdownMessage → code/MarkdownMessage}/MarkdownMessage.tsx +1 -1
- package/src/tools/dev/{MarkdownMessage → code/MarkdownMessage}/components.tsx +2 -2
- package/src/tools/dev/{PrettyCode → code/PrettyCode}/PrettyCode.client.tsx +2 -2
- package/src/tools/dev/{PrettyCode → code/PrettyCode}/lazy.tsx +1 -1
- package/src/tools/dev/ops/EnvTable/EnvTable.tsx +228 -0
- package/src/tools/dev/ops/EnvTable/README.md +29 -0
- package/src/tools/dev/ops/EnvTable/hooks/useEnvMask.ts +121 -0
- package/src/tools/dev/ops/EnvTable/index.ts +12 -0
- package/src/tools/dev/ops/EnvTable/lazy.tsx +21 -0
- package/src/tools/dev/ops/EnvTable/types.ts +76 -0
- package/src/tools/dev/ops/LogViewer/LogViewer.tsx +194 -0
- package/src/tools/dev/ops/LogViewer/README.md +30 -0
- package/src/tools/dev/ops/LogViewer/components/LogRow.tsx +151 -0
- package/src/tools/dev/ops/LogViewer/components/Toolbar.tsx +199 -0
- package/src/tools/dev/ops/LogViewer/hooks/useAutoScroll.ts +68 -0
- package/src/tools/dev/ops/LogViewer/hooks/useLogFilter.ts +58 -0
- package/src/tools/dev/ops/LogViewer/index.ts +18 -0
- package/src/tools/dev/ops/LogViewer/lazy.tsx +25 -0
- package/src/tools/dev/ops/LogViewer/types.ts +142 -0
- package/src/tools/dev/ops/LogViewer/utils/ansi.ts +231 -0
- package/src/tools/forms/CodeEditor/components/Editor.tsx +19 -0
- package/src/tools/forms/CodeEditor/hooks/useEditorTheme.ts +13 -73
- package/src/tools/forms/CodeEditor/lazy.tsx +1 -1
- package/src/tools/forms/CodeEditor/types/index.ts +7 -0
- package/src/tools/forms/FileUpload/lazy.tsx +1 -1
- package/src/tools/forms/JsonEditor/JsonEditor.tsx +115 -0
- package/src/tools/forms/JsonEditor/index.ts +1 -0
- package/src/tools/forms/JsonEditor/lazy.tsx +24 -0
- package/src/tools/forms/JsonForm/index.ts +1 -1
- package/src/tools/forms/JsonForm/lazy.tsx +1 -1
- package/src/tools/forms/MarkdownEditor/MarkdownEditor.tsx +40 -0
- package/src/tools/forms/MarkdownEditor/lazy.tsx +1 -1
- package/src/tools/forms/MarkdownEditor/styles.css +174 -21
- package/src/tools/forms/NotionEditor/CustomKeymap.ts +48 -0
- package/src/tools/forms/NotionEditor/LinkDialog.tsx +133 -0
- package/src/tools/forms/NotionEditor/NotionEditor.tsx +304 -0
- package/src/tools/forms/NotionEditor/README.md +237 -0
- package/src/tools/forms/NotionEditor/SlashExtension.ts +32 -0
- package/src/tools/forms/NotionEditor/SlashList.tsx +136 -0
- package/src/tools/forms/NotionEditor/TaskItemView.tsx +41 -0
- package/src/tools/forms/NotionEditor/createSlashSuggestion.ts +121 -0
- package/src/tools/forms/NotionEditor/extensions.ts +105 -0
- package/src/tools/forms/NotionEditor/index.ts +1 -0
- package/src/tools/forms/NotionEditor/lazy.tsx +44 -0
- package/src/tools/forms/NotionEditor/slashItems.ts +159 -0
- package/src/tools/forms/NotionEditor/styles.css +478 -0
- package/src/tools/forms/NotionEditor/types.ts +28 -0
- package/src/tools/index.ts +153 -13
- package/src/tools/input/Combobox/lazy.tsx +1 -1
- package/src/tools/input/CronScheduler/components/CronPreview.README.md +28 -0
- package/src/tools/input/CronScheduler/components/CronPreview.tsx +136 -0
- package/src/tools/input/CronScheduler/components/index.ts +3 -0
- package/src/tools/input/CronScheduler/index.tsx +5 -1
- package/src/tools/input/CronScheduler/lazy.tsx +5 -1
- package/src/tools/input/CronScheduler/utils/cron-next-runs.ts +122 -0
- package/src/tools/input/CronScheduler/utils/index.ts +1 -0
- package/src/tools/input/Scroller/lazy.tsx +1 -1
- package/src/tools/input/Sortable/lazy.tsx +1 -1
- package/src/tools/input/SpeechRecognition/lazy.tsx +1 -1
- package/src/tools/input/SpeechRecognition/widgets/VoiceComposerSlot.tsx +41 -36
- package/src/tools/media/AudioPlayer/PlayerShell.tsx +3 -11
- package/src/tools/media/AudioPlayer/types.ts +4 -11
- package/src/tools/media/ImageViewer/components/ImageToolbar.tsx +58 -47
- package/src/tools/media/ImageViewer/components/ImageViewer.tsx +35 -19
- package/src/tools/media/ImageViewer/lazy.tsx +1 -1
- package/src/tools/media/ImageViewer/types.ts +4 -0
- package/src/tools/media/LottiePlayer/lazy.tsx +1 -1
- package/src/tools/media/VideoPlayer/VideoPlayer.tsx +47 -1
- package/src/tools/media/VideoPlayer/parts/fullscreen.tsx +21 -4
- package/src/tools/media/VideoPlayer/parts/pip.tsx +21 -4
- package/src/tools/media/VideoPlayer/parts/play-button.tsx +21 -4
- package/src/tools/media/VideoPlayer/parts/playback-rate.tsx +19 -3
- package/src/tools/media/VideoPlayer/parts/volume.tsx +237 -18
- package/src/tools/media/VideoPlayer/styles/video-player.css +87 -7
- package/src/tools/media/VideoPlayer/types.ts +4 -0
- package/src/tools/overlay/ResponsiveDialog/lazy.tsx +1 -1
- package/src/tools/overlay/ScrollSpy/lazy.tsx +1 -1
- package/src/tools/overlay/SelectionToolbar/lazy.tsx +1 -1
- package/src/tools/overlay/Tour/lazy.tsx +1 -1
- package/src/tools/visual/Marquee/lazy.tsx +1 -1
- package/src/tools/visual/QRCode/lazy.tsx +1 -1
- package/src/tools/visual/charts/ActivityGraph/ActivityGraph.tsx +195 -0
- package/src/tools/visual/charts/ActivityGraph/README.md +28 -0
- package/src/tools/visual/charts/ActivityGraph/index.ts +8 -0
- package/src/tools/visual/charts/ActivityGraph/lazy.tsx +21 -0
- package/src/tools/visual/charts/ActivityGraph/types.ts +59 -0
- package/src/tools/visual/charts/ActivityGraph/utils.ts +88 -0
- package/src/tools/visual/charts/CommitGraph/CommitGraph.tsx +80 -0
- package/src/tools/visual/charts/CommitGraph/README.md +28 -0
- package/src/tools/visual/charts/CommitGraph/components/CommitDetail.tsx +107 -0
- package/src/tools/visual/charts/CommitGraph/components/CommitRow.tsx +122 -0
- package/src/tools/visual/charts/CommitGraph/components/Rails.tsx +171 -0
- package/src/tools/visual/charts/CommitGraph/hooks/useGraphLayout.ts +169 -0
- package/src/tools/visual/charts/CommitGraph/hooks/useLaneColors.ts +45 -0
- package/src/tools/visual/charts/CommitGraph/index.ts +14 -0
- package/src/tools/visual/charts/CommitGraph/lazy.tsx +25 -0
- package/src/tools/visual/charts/CommitGraph/types.ts +85 -0
- package/src/tools/visual/charts/CommitGraph/utils.ts +53 -0
- package/src/tools/visual/{Gauge → charts/Gauge}/lazy.tsx +1 -1
- package/src/tools/visual/charts/Sparkline/README.md +29 -0
- package/src/tools/visual/charts/Sparkline/Sparkline.tsx +217 -0
- package/src/tools/visual/charts/Sparkline/index.ts +9 -0
- package/src/tools/visual/charts/Sparkline/lazy.tsx +26 -0
- package/src/tools/visual/charts/Sparkline/types.ts +58 -0
- package/src/tools/visual/design/ColorPalette/ColorPalette.tsx +129 -0
- package/src/tools/visual/design/ColorPalette/README.md +34 -0
- package/src/tools/visual/design/ColorPalette/components/Swatch.tsx +102 -0
- package/src/tools/visual/design/ColorPalette/hooks/useCopyToClipboard.ts +41 -0
- package/src/tools/visual/design/ColorPalette/index.ts +12 -0
- package/src/tools/visual/design/ColorPalette/lazy.tsx +21 -0
- package/src/tools/visual/design/ColorPalette/types.ts +63 -0
- package/src/tools/visual/design/ColorPalette/utils.ts +83 -0
- package/src/tools/visual/{ColorPicker → design/ColorPicker}/lazy.tsx +1 -1
- package/src/tools/visual/{FileIcon → design/FileIcon}/treeAdapter.tsx +1 -1
- package/src/tools/visual/{Fps → indicators/Fps}/lazy.tsx +1 -1
- package/src/tools/visual/{Rating → indicators/Rating}/lazy.tsx +1 -1
- package/src/tools/visual/indicators/StatusIndicator/README.md +28 -0
- package/src/tools/visual/indicators/StatusIndicator/StatusIndicator.tsx +83 -0
- package/src/tools/visual/indicators/StatusIndicator/index.ts +14 -0
- package/src/tools/visual/indicators/StatusIndicator/lazy.tsx +21 -0
- package/src/tools/visual/indicators/StatusIndicator/types.ts +133 -0
- package/src/components/FloatingToolbar/actions/CopyAction.tsx +0 -22
- package/src/components/FloatingToolbar/actions/ExpandAction.tsx +0 -25
- package/src/components/FloatingToolbar/actions/FullscreenAction.tsx +0 -30
- package/src/tools/data/JsonTree/components/JsonContent.tsx +0 -197
- package/src/tools/data/JsonTree/hooks/useJsonExpand.ts +0 -50
- /package/src/{components → common}/FloatingToolbar/FloatingToolbar.css +0 -0
- /package/src/{components → common}/FloatingToolbar/actions/index.ts +0 -0
- /package/src/{components → common}/FloatingToolbar/hooks/useElementCorner.ts +0 -0
- /package/src/{components → common}/FloatingToolbar/hooks/useScrollIsolation.ts +0 -0
- /package/src/{components → common}/index.ts +0 -0
- /package/src/{components → common}/lazy-wrapper.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/README.md +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/DocsView.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/CodeSamples/LanguageTabs.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/CodeSamples/useCodeSnippet.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/Header/MetaActions.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/Header/MethodBadge.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/Header/PathDisplay.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/Parameters/ParamGroup.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/Parameters/ParamRow.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/Parameters/index.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/RequestBody/index.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/Responses/ResponseRow.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/Responses/StatusTag.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/Responses/index.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/SchemaFields/FieldRow.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/SchemaFields/buildTree.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/SchemaFields/index.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/SchemaFields/types.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/Section/SectionHeader.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/Section/defaults.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/Section/index.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/context.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/hooks/useSectionHash.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/index.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/store/index.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/store/selectors.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/EndpointDoc/types.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/SchemaCopyMenu.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/Sidebar/BrandHeader.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/Sidebar/CategoryBlock.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/Sidebar/EndpointRow.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/Sidebar/SchemaSection.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/Sidebar/SearchInput.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/Sidebar/SidebarBody.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/Sidebar/Toolbar.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/Sidebar/buildVM.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/Sidebar/index.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/Sidebar/types.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/Sidebar/useDebouncedValue.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/SlideInPlayground.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/TryItSheet.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/anchor.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/grouping.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/index.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/DocsLayout/sidebarLabel.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/index.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/BodyFormEditor.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/EndpointDraftSync.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/EndpointResetButton.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/ResponsePanel/PreviewView.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/ResponsePanel/RawView.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/ResponsePanel/StatusBar.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/ResponsePanel/ViewTabs.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/ResponsePanel/detectContent.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/ResponsePanel/index.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/ResponsePanel/useResponseView.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/SendButton.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/components/shared/ui.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/constants.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/context/PlaygroundContext.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/hooks/index.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/hooks/useDocsUrlSync.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/hooks/useEndpointDraft.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/hooks/useMobile.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/hooks/useOpenApiSchema.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/index.tsx +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/types.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/utils/apiKeyManager.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/utils/codeSamples.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/utils/formatters.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/utils/index.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/utils/operationToHar.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/utils/sampler.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/utils/schemaExport.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/utils/scrollParent.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/utils/url.ts +0 -0
- /package/src/tools/dev/{OpenapiViewer → api/OpenapiViewer}/utils/versionManager.ts +0 -0
- /package/src/tools/dev/{MarkdownMessage → code/MarkdownMessage}/ActionRow.tsx +0 -0
- /package/src/tools/dev/{MarkdownMessage → code/MarkdownMessage}/ChatMessageRow.tsx +0 -0
- /package/src/tools/dev/{MarkdownMessage → code/MarkdownMessage}/CodeBlock.tsx +0 -0
- /package/src/tools/dev/{MarkdownMessage → code/MarkdownMessage}/README.md +0 -0
- /package/src/tools/dev/{MarkdownMessage → code/MarkdownMessage}/index.ts +0 -0
- /package/src/tools/dev/{MarkdownMessage → code/MarkdownMessage}/linkRules.ts +0 -0
- /package/src/tools/dev/{MarkdownMessage → code/MarkdownMessage}/plainText.ts +0 -0
- /package/src/tools/dev/{MarkdownMessage → code/MarkdownMessage}/sanitize.ts +0 -0
- /package/src/tools/dev/{MarkdownMessage → code/MarkdownMessage}/types.ts +0 -0
- /package/src/tools/dev/{PrettyCode → code/PrettyCode}/README.md +0 -0
- /package/src/tools/dev/{PrettyCode → code/PrettyCode}/index.tsx +0 -0
- /package/src/tools/dev/{PrettyCode → code/PrettyCode}/registerPrismLanguages.ts +0 -0
- /package/src/tools/visual/{Gauge → charts/Gauge}/Gauge.tsx +0 -0
- /package/src/tools/visual/{Gauge → charts/Gauge}/index.ts +0 -0
- /package/src/tools/visual/{Gauge → charts/Gauge}/types.ts +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/ColorPicker.tsx +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/context/ColorPickerContext.tsx +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/context/ColorPickerStore.tsx +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/context/index.ts +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/index.ts +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/lib/color-utils.ts +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/parts/ColorPickerAlphaSlider.tsx +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/parts/ColorPickerArea.tsx +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/parts/ColorPickerEyeDropper.tsx +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/parts/ColorPickerFormatSelect.tsx +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/parts/ColorPickerHueSlider.tsx +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/parts/ColorPickerInput.tsx +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/parts/ColorPickerSwatch.tsx +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/parts/index.ts +0 -0
- /package/src/tools/visual/{ColorPicker → design/ColorPicker}/types.ts +0 -0
- /package/src/tools/visual/{FileIcon → design/FileIcon}/FileIcon.tsx +0 -0
- /package/src/tools/visual/{FileIcon → design/FileIcon}/get-file-icon.ts +0 -0
- /package/src/tools/visual/{FileIcon → design/FileIcon}/icons/icon-data.ts +0 -0
- /package/src/tools/visual/{FileIcon → design/FileIcon}/index.ts +0 -0
- /package/src/tools/visual/{FileIcon → design/FileIcon}/loader.ts +0 -0
- /package/src/tools/visual/{FileIcon → design/FileIcon}/specialFolders.ts +0 -0
- /package/src/tools/visual/{Fps → indicators/Fps}/Fps.tsx +0 -0
- /package/src/tools/visual/{Fps → indicators/Fps}/index.ts +0 -0
- /package/src/tools/visual/{Fps → indicators/Fps}/types.ts +0 -0
- /package/src/tools/visual/{Rating → indicators/Rating}/Rating.tsx +0 -0
- /package/src/tools/visual/{Rating → indicators/Rating}/index.ts +0 -0
- /package/src/tools/visual/{Rating → indicators/Rating}/types.ts +0 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
/* ─────────────────────────────────────────────────────────────────────
|
|
2
|
+
* NotionEditor — Notion-style WYSIWYG. Reuses the typography decisions
|
|
3
|
+
* from MarkdownEditor's `styles.css` (font, heading scale, list spacing,
|
|
4
|
+
* code styling) but adds:
|
|
5
|
+
* - drag-handle gutter + grabber styling
|
|
6
|
+
* - bubble-menu floating toolbar
|
|
7
|
+
* - slash-menu popover
|
|
8
|
+
* - table cell selection ring
|
|
9
|
+
* - code-block lowlight token colours (Prism-compatible)
|
|
10
|
+
* ───────────────────────────────────────────────────────────────────── */
|
|
11
|
+
|
|
12
|
+
.notion-editor {
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.notion-editor .notion-editor-content {
|
|
18
|
+
outline: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.notion-editor .tiptap,
|
|
22
|
+
.notion-editor .ProseMirror {
|
|
23
|
+
color: var(--color-foreground, var(--foreground));
|
|
24
|
+
font-family:
|
|
25
|
+
-apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
|
|
26
|
+
"Helvetica Neue", Arial, sans-serif;
|
|
27
|
+
font-size: 16px;
|
|
28
|
+
line-height: 1.65;
|
|
29
|
+
-webkit-font-smoothing: antialiased;
|
|
30
|
+
-moz-osx-font-smoothing: grayscale;
|
|
31
|
+
text-rendering: optimizeLegibility;
|
|
32
|
+
/* Left padding leaves room for the drag-handle gutter so it never
|
|
33
|
+
* overlaps with text. */
|
|
34
|
+
padding-left: 32px;
|
|
35
|
+
padding-right: 8px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Empty placeholder. Tiptap's Placeholder extension stamps
|
|
39
|
+
* `is-editor-empty` on the doc when nothing has been typed, plus
|
|
40
|
+
* `is-empty` + `data-placeholder` on the active empty node. We match
|
|
41
|
+
* BOTH conditions so the ghost prompt shows on a brand-new editor and
|
|
42
|
+
* on whichever empty block the caret is parked in — but never on
|
|
43
|
+
* unrelated empty blocks (that would look like literal text content). */
|
|
44
|
+
.notion-editor .tiptap .is-editor-empty:first-child::before,
|
|
45
|
+
.notion-editor .tiptap .ProseMirror-focused > .is-empty::before {
|
|
46
|
+
content: attr(data-placeholder);
|
|
47
|
+
float: left;
|
|
48
|
+
height: 0;
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
opacity: 0.35;
|
|
51
|
+
font-weight: 400;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Links */
|
|
55
|
+
.notion-editor .tiptap a {
|
|
56
|
+
color: var(--color-primary, var(--primary));
|
|
57
|
+
text-decoration: underline;
|
|
58
|
+
text-underline-offset: 2px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Headings */
|
|
62
|
+
.notion-editor .tiptap h1 {
|
|
63
|
+
font-size: 2em;
|
|
64
|
+
font-weight: 700;
|
|
65
|
+
line-height: 1.2;
|
|
66
|
+
margin: 1em 0 0.3em;
|
|
67
|
+
letter-spacing: -0.02em;
|
|
68
|
+
}
|
|
69
|
+
.notion-editor .tiptap h2 {
|
|
70
|
+
font-size: 1.5em;
|
|
71
|
+
font-weight: 600;
|
|
72
|
+
line-height: 1.3;
|
|
73
|
+
margin: 0.9em 0 0.25em;
|
|
74
|
+
letter-spacing: -0.01em;
|
|
75
|
+
}
|
|
76
|
+
.notion-editor .tiptap h3 {
|
|
77
|
+
font-size: 1.25em;
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
line-height: 1.35;
|
|
80
|
+
margin: 0.8em 0 0.2em;
|
|
81
|
+
}
|
|
82
|
+
.notion-editor .tiptap h4 {
|
|
83
|
+
font-size: 1.1em;
|
|
84
|
+
font-weight: 600;
|
|
85
|
+
line-height: 1.4;
|
|
86
|
+
margin: 0.7em 0 0.2em;
|
|
87
|
+
}
|
|
88
|
+
.notion-editor .tiptap > :is(h1, h2, h3, h4):first-child {
|
|
89
|
+
margin-top: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.notion-editor .tiptap p {
|
|
93
|
+
margin: 0.25em 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Lists */
|
|
97
|
+
.notion-editor .tiptap ul,
|
|
98
|
+
.notion-editor .tiptap ol {
|
|
99
|
+
padding-left: 1.5em;
|
|
100
|
+
margin: 0.35em 0;
|
|
101
|
+
}
|
|
102
|
+
.notion-editor .tiptap ul {
|
|
103
|
+
list-style: disc;
|
|
104
|
+
}
|
|
105
|
+
.notion-editor .tiptap ol {
|
|
106
|
+
list-style: decimal;
|
|
107
|
+
}
|
|
108
|
+
.notion-editor .tiptap ul ul {
|
|
109
|
+
list-style: circle;
|
|
110
|
+
}
|
|
111
|
+
.notion-editor .tiptap ul ul ul {
|
|
112
|
+
list-style: square;
|
|
113
|
+
}
|
|
114
|
+
.notion-editor .tiptap li {
|
|
115
|
+
margin: 0.15em 0;
|
|
116
|
+
}
|
|
117
|
+
.notion-editor .tiptap li > p {
|
|
118
|
+
margin: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* Task list — backed by a React NodeView that mounts our ui-core
|
|
122
|
+
* <Checkbox>. Selectors target the wrapper class set by `TaskItemView`.
|
|
123
|
+
*
|
|
124
|
+
* Alignment math (the part that always goes wrong):
|
|
125
|
+
* editor font-size: 16px
|
|
126
|
+
* line-height: 1.65 → line box ≈ 26.4px
|
|
127
|
+
* cap-height of text: ≈ 11.5px, sits ≈ 7.5px from line top
|
|
128
|
+
* checkbox box: 16px square (ui-core default)
|
|
129
|
+
* ⇒ to centre the checkbox on the cap-height row, top = (26.4 − 16) / 2 ≈ 5px
|
|
130
|
+
*
|
|
131
|
+
* Using `align-items: flex-start` + a fixed `margin-top` keeps multi-line
|
|
132
|
+
* task items working: the checkbox stays parked at the top of the first
|
|
133
|
+
* line and the text wraps freely below. `align-items: center` would
|
|
134
|
+
* recentre on multi-line items and drift the checkbox into the middle. */
|
|
135
|
+
.notion-editor .tiptap ul[data-type="taskList"] {
|
|
136
|
+
list-style: none;
|
|
137
|
+
padding-left: 0;
|
|
138
|
+
margin-left: 0;
|
|
139
|
+
}
|
|
140
|
+
.notion-editor .tiptap .notion-task-item {
|
|
141
|
+
display: flex;
|
|
142
|
+
/* `align-items: baseline` lets the checkbox sit on the *text baseline*
|
|
143
|
+
* of the first line — independent of checkbox size, font-size, or
|
|
144
|
+
* line-height. Works correctly across themes / presets that scale the
|
|
145
|
+
* Checkbox token (macOS vs default). For multi-line items the checkbox
|
|
146
|
+
* still anchors to the first line (because baseline is per-line) which
|
|
147
|
+
* is what Notion does. Earlier `align-items: flex-start + margin-top:Xpx`
|
|
148
|
+
* was brittle: it assumed a fixed checkbox size + line-height. */
|
|
149
|
+
align-items: baseline;
|
|
150
|
+
gap: 0.5em;
|
|
151
|
+
padding: 2px 0;
|
|
152
|
+
}
|
|
153
|
+
.notion-editor .tiptap .notion-task-checkbox {
|
|
154
|
+
flex-shrink: 0;
|
|
155
|
+
/* `translateY(2px)` nudges the optical centre of the checkbox box onto
|
|
156
|
+
* the cap-height line. Without this the checkbox sits visually a bit
|
|
157
|
+
* high because its bounding box centres on the baseline, not cap-height.
|
|
158
|
+
* Tiny constant — independent of checkbox / font size. */
|
|
159
|
+
transform: translateY(2px);
|
|
160
|
+
}
|
|
161
|
+
.notion-editor .tiptap .notion-task-text {
|
|
162
|
+
flex: 1;
|
|
163
|
+
min-width: 0;
|
|
164
|
+
}
|
|
165
|
+
.notion-editor .tiptap .notion-task-item[data-checked] .notion-task-text {
|
|
166
|
+
opacity: 0.55;
|
|
167
|
+
text-decoration: line-through;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* Blockquote */
|
|
171
|
+
.notion-editor .tiptap blockquote {
|
|
172
|
+
border-left: 3px solid var(--color-border, var(--border));
|
|
173
|
+
padding: 0.2em 0 0.2em 1em;
|
|
174
|
+
margin: 0.6em 0;
|
|
175
|
+
color: color-mix(in oklab, var(--color-foreground, var(--foreground)) 80%, transparent);
|
|
176
|
+
}
|
|
177
|
+
.notion-editor .tiptap blockquote > :first-child { margin-top: 0; }
|
|
178
|
+
.notion-editor .tiptap blockquote > :last-child { margin-bottom: 0; }
|
|
179
|
+
|
|
180
|
+
/* Divider */
|
|
181
|
+
.notion-editor .tiptap hr {
|
|
182
|
+
border: none;
|
|
183
|
+
border-top: 1px solid var(--color-border, var(--border));
|
|
184
|
+
margin: 1.5em 0;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* Inline code */
|
|
188
|
+
.notion-editor .tiptap code {
|
|
189
|
+
background: color-mix(in oklab, var(--color-muted, var(--muted)) 70%, transparent);
|
|
190
|
+
color: var(--color-foreground, var(--foreground));
|
|
191
|
+
padding: 0.15em 0.35em;
|
|
192
|
+
border-radius: 4px;
|
|
193
|
+
font-size: 0.875em;
|
|
194
|
+
font-family: "SF Mono", ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
|
|
195
|
+
border: 1px solid color-mix(in oklab, var(--color-border, var(--border)) 60%, transparent);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* Code block (lowlight) — always dark, regardless of host theme.
|
|
199
|
+
* Rationale: syntax highlighting palettes are calibrated for dark
|
|
200
|
+
* backgrounds; a "light-on-light" code block on a light app theme looks
|
|
201
|
+
* washed out and reads worse than the same block on dark. Notion / Linear
|
|
202
|
+
* / GitHub all force-dark code blocks on light themes too. We hardcode
|
|
203
|
+
* a One Dark-flavour surface and let the token colours below sit on it. */
|
|
204
|
+
.notion-editor .tiptap pre {
|
|
205
|
+
background: #1e2127;
|
|
206
|
+
color: #d7dae0;
|
|
207
|
+
padding: 0.9em 1em;
|
|
208
|
+
border-radius: 6px;
|
|
209
|
+
margin: 0.75em 0;
|
|
210
|
+
font-family: "SF Mono", ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
|
|
211
|
+
font-size: 0.875em;
|
|
212
|
+
line-height: 1.55;
|
|
213
|
+
overflow-x: auto;
|
|
214
|
+
border: 1px solid rgba(255, 255, 255, 0.06);
|
|
215
|
+
}
|
|
216
|
+
.notion-editor .tiptap pre code {
|
|
217
|
+
background: transparent;
|
|
218
|
+
border: none;
|
|
219
|
+
padding: 0;
|
|
220
|
+
border-radius: 0;
|
|
221
|
+
font-size: inherit;
|
|
222
|
+
color: inherit;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* Lowlight token colours — One Dark Pro palette. `@tiptap/extension-code-
|
|
226
|
+
* block-lowlight` emits `.hljs-*` class names; we colour against the fixed
|
|
227
|
+
* dark surface above so the palette stays readable on every host theme. */
|
|
228
|
+
.notion-editor .hljs-comment,
|
|
229
|
+
.notion-editor .hljs-quote { color: #5c6370; font-style: italic; }
|
|
230
|
+
.notion-editor .hljs-keyword,
|
|
231
|
+
.notion-editor .hljs-selector-tag,
|
|
232
|
+
.notion-editor .hljs-built_in { color: #c678dd; }
|
|
233
|
+
.notion-editor .hljs-string,
|
|
234
|
+
.notion-editor .hljs-attr { color: #98c379; }
|
|
235
|
+
.notion-editor .hljs-number,
|
|
236
|
+
.notion-editor .hljs-literal { color: #d19a66; }
|
|
237
|
+
.notion-editor .hljs-function .hljs-title,
|
|
238
|
+
.notion-editor .hljs-title.function_ { color: #61afef; }
|
|
239
|
+
.notion-editor .hljs-class .hljs-title,
|
|
240
|
+
.notion-editor .hljs-type { color: #e5c07b; }
|
|
241
|
+
.notion-editor .hljs-tag,
|
|
242
|
+
.notion-editor .hljs-name { color: #e06c75; }
|
|
243
|
+
.notion-editor .hljs-attribute { color: #d19a66; }
|
|
244
|
+
.notion-editor .hljs-variable,
|
|
245
|
+
.notion-editor .hljs-template-variable { color: #e06c75; }
|
|
246
|
+
.notion-editor .hljs-symbol,
|
|
247
|
+
.notion-editor .hljs-bullet,
|
|
248
|
+
.notion-editor .hljs-link { color: #56b6c2; }
|
|
249
|
+
.notion-editor .hljs-meta { color: #61afef; }
|
|
250
|
+
.notion-editor .hljs-deletion { background: rgba(224, 108, 117, 0.2); }
|
|
251
|
+
.notion-editor .hljs-addition { background: rgba(152, 195, 121, 0.2); }
|
|
252
|
+
|
|
253
|
+
/* Tables */
|
|
254
|
+
.notion-editor .tiptap table {
|
|
255
|
+
border-collapse: collapse;
|
|
256
|
+
width: 100%;
|
|
257
|
+
margin: 0.75em 0;
|
|
258
|
+
font-size: 0.95em;
|
|
259
|
+
table-layout: fixed;
|
|
260
|
+
}
|
|
261
|
+
.notion-editor .tiptap th,
|
|
262
|
+
.notion-editor .tiptap td {
|
|
263
|
+
border: 1px solid var(--color-border, var(--border));
|
|
264
|
+
padding: 0.45em 0.75em;
|
|
265
|
+
vertical-align: top;
|
|
266
|
+
text-align: left;
|
|
267
|
+
min-width: 4ch;
|
|
268
|
+
position: relative;
|
|
269
|
+
}
|
|
270
|
+
.notion-editor .tiptap th {
|
|
271
|
+
background: color-mix(in oklab, var(--color-muted, var(--muted)) 60%, transparent);
|
|
272
|
+
font-weight: 600;
|
|
273
|
+
}
|
|
274
|
+
.notion-editor .tiptap .selectedCell::after {
|
|
275
|
+
/* ProseMirror table cell selection ring. */
|
|
276
|
+
background: color-mix(in oklab, var(--color-primary, var(--primary)) 20%, transparent);
|
|
277
|
+
content: "";
|
|
278
|
+
position: absolute;
|
|
279
|
+
inset: 0;
|
|
280
|
+
pointer-events: none;
|
|
281
|
+
z-index: 2;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* Images */
|
|
285
|
+
.notion-editor .tiptap img {
|
|
286
|
+
max-width: 100%;
|
|
287
|
+
height: auto;
|
|
288
|
+
border-radius: 6px;
|
|
289
|
+
margin: 0.5em 0;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/* Marks */
|
|
293
|
+
.notion-editor .tiptap strong { font-weight: 700; }
|
|
294
|
+
.notion-editor .tiptap em { font-style: italic; }
|
|
295
|
+
.notion-editor .tiptap s { text-decoration: line-through; }
|
|
296
|
+
.notion-editor .tiptap mark {
|
|
297
|
+
background: color-mix(in oklab, var(--color-primary, var(--primary)) 25%, transparent);
|
|
298
|
+
color: inherit;
|
|
299
|
+
padding: 0 0.15em;
|
|
300
|
+
border-radius: 2px;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/* Selection */
|
|
304
|
+
.notion-editor .tiptap ::selection {
|
|
305
|
+
background: color-mix(in oklab, var(--color-primary, var(--primary)) 25%, transparent);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/* ─────────────────────────────────────────────────────────────────────
|
|
309
|
+
* Global drag handle (tiptap-extension-global-drag-handle)
|
|
310
|
+
*
|
|
311
|
+
* The extension mints a single `.drag-handle` element and reparents it
|
|
312
|
+
* to the hovered block on `mouseover`. We mask a fixed 2×3 dot grid
|
|
313
|
+
* (Notion's ⠿ grip) — earlier attempts used `background-repeat: round`
|
|
314
|
+
* which tiled the dot pattern and produced a 3×5 grid that looked like
|
|
315
|
+
* a literal halftone block. A `mask-image` with `mask-repeat: no-repeat`
|
|
316
|
+
* pins exactly six dots regardless of the handle's box size.
|
|
317
|
+
* ───────────────────────────────────────────────────────────────────── */
|
|
318
|
+
.drag-handle {
|
|
319
|
+
position: fixed;
|
|
320
|
+
opacity: 0;
|
|
321
|
+
transition: opacity 120ms ease-out;
|
|
322
|
+
height: 1.4rem;
|
|
323
|
+
width: 1.1rem;
|
|
324
|
+
display: flex;
|
|
325
|
+
align-items: center;
|
|
326
|
+
justify-content: center;
|
|
327
|
+
border-radius: 4px;
|
|
328
|
+
cursor: grab;
|
|
329
|
+
background-color: transparent;
|
|
330
|
+
|
|
331
|
+
/* Painted as a `mask-image` of `lucide-react`'s `GripVertical` icon
|
|
332
|
+
* (six stroked circles at x∈{9,15}, y∈{5,12,19}, r=1, stroke-width=2,
|
|
333
|
+
* viewBox 24×24). Using lucide ensures the grabber matches every other
|
|
334
|
+
* icon in the app at the pixel level; we just can't render it as a
|
|
335
|
+
* <GripVertical/> component because `tiptap-extension-global-drag-handle`
|
|
336
|
+
* mints the DOM node imperatively. `mask` + `background-color` keeps
|
|
337
|
+
* the colour theme-driven. */
|
|
338
|
+
-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='12' r='1'/><circle cx='9' cy='5' r='1'/><circle cx='9' cy='19' r='1'/><circle cx='15' cy='12' r='1'/><circle cx='15' cy='5' r='1'/><circle cx='15' cy='19' r='1'/></svg>");
|
|
339
|
+
mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='12' r='1'/><circle cx='9' cy='5' r='1'/><circle cx='9' cy='19' r='1'/><circle cx='15' cy='12' r='1'/><circle cx='15' cy='5' r='1'/><circle cx='15' cy='19' r='1'/></svg>");
|
|
340
|
+
-webkit-mask-repeat: no-repeat;
|
|
341
|
+
mask-repeat: no-repeat;
|
|
342
|
+
-webkit-mask-position: center;
|
|
343
|
+
mask-position: center;
|
|
344
|
+
-webkit-mask-size: 18px 18px;
|
|
345
|
+
mask-size: 18px 18px;
|
|
346
|
+
background-color: color-mix(in oklab, var(--color-foreground, var(--foreground)) 45%, transparent);
|
|
347
|
+
}
|
|
348
|
+
.drag-handle:hover {
|
|
349
|
+
background-color: var(--color-foreground, var(--foreground));
|
|
350
|
+
}
|
|
351
|
+
.drag-handle:active {
|
|
352
|
+
cursor: grabbing;
|
|
353
|
+
}
|
|
354
|
+
.drag-handle.hide {
|
|
355
|
+
opacity: 0 !important;
|
|
356
|
+
pointer-events: none;
|
|
357
|
+
}
|
|
358
|
+
/* Reveal the handle whenever the editor surface is hovered. */
|
|
359
|
+
.notion-editor:hover .drag-handle {
|
|
360
|
+
opacity: 1;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/* ─────────────────────────────────────────────────────────────────────
|
|
364
|
+
* Bubble menu — floating selection toolbar
|
|
365
|
+
* ───────────────────────────────────────────────────────────────────── */
|
|
366
|
+
.notion-bubble-menu {
|
|
367
|
+
display: flex;
|
|
368
|
+
gap: 2px;
|
|
369
|
+
padding: 4px;
|
|
370
|
+
background: var(--color-popover, var(--popover));
|
|
371
|
+
color: var(--color-popover-foreground, var(--popover-foreground));
|
|
372
|
+
border: 1px solid var(--color-border, var(--border));
|
|
373
|
+
border-radius: 8px;
|
|
374
|
+
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
|
|
375
|
+
z-index: 50;
|
|
376
|
+
}
|
|
377
|
+
.notion-bubble-btn {
|
|
378
|
+
width: 28px;
|
|
379
|
+
height: 28px;
|
|
380
|
+
display: inline-flex;
|
|
381
|
+
align-items: center;
|
|
382
|
+
justify-content: center;
|
|
383
|
+
background: transparent;
|
|
384
|
+
border: none;
|
|
385
|
+
border-radius: 4px;
|
|
386
|
+
cursor: pointer;
|
|
387
|
+
color: var(--color-foreground, var(--foreground));
|
|
388
|
+
opacity: 0.7;
|
|
389
|
+
transition: opacity 120ms, background 120ms;
|
|
390
|
+
}
|
|
391
|
+
.notion-bubble-btn:hover {
|
|
392
|
+
opacity: 1;
|
|
393
|
+
background: var(--color-muted, var(--muted));
|
|
394
|
+
}
|
|
395
|
+
.notion-bubble-btn--active {
|
|
396
|
+
opacity: 1;
|
|
397
|
+
background: var(--color-muted, var(--muted));
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* ─────────────────────────────────────────────────────────────────────
|
|
401
|
+
* Slash menu popover
|
|
402
|
+
* ───────────────────────────────────────────────────────────────────── */
|
|
403
|
+
.notion-slash-list {
|
|
404
|
+
background: var(--color-popover, var(--popover));
|
|
405
|
+
color: var(--color-popover-foreground, var(--popover-foreground));
|
|
406
|
+
border: 1px solid var(--color-border, var(--border));
|
|
407
|
+
border-radius: 10px;
|
|
408
|
+
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
|
|
409
|
+
padding: 4px;
|
|
410
|
+
width: 280px;
|
|
411
|
+
max-height: 320px;
|
|
412
|
+
overflow-y: auto;
|
|
413
|
+
display: flex;
|
|
414
|
+
flex-direction: column;
|
|
415
|
+
gap: 1px;
|
|
416
|
+
}
|
|
417
|
+
.notion-slash-item {
|
|
418
|
+
display: flex;
|
|
419
|
+
align-items: center;
|
|
420
|
+
gap: 10px;
|
|
421
|
+
width: 100%;
|
|
422
|
+
padding: 6px 8px;
|
|
423
|
+
border: none;
|
|
424
|
+
background: transparent;
|
|
425
|
+
border-radius: 6px;
|
|
426
|
+
cursor: pointer;
|
|
427
|
+
text-align: left;
|
|
428
|
+
color: inherit;
|
|
429
|
+
font-size: 13px;
|
|
430
|
+
transition: background 80ms;
|
|
431
|
+
}
|
|
432
|
+
.notion-slash-item--active,
|
|
433
|
+
.notion-slash-item:hover {
|
|
434
|
+
background: var(--color-muted, var(--muted));
|
|
435
|
+
}
|
|
436
|
+
.notion-slash-empty {
|
|
437
|
+
padding: 10px 12px;
|
|
438
|
+
color: color-mix(in oklab, var(--color-foreground, var(--foreground)) 55%, transparent);
|
|
439
|
+
font-size: 12px;
|
|
440
|
+
text-align: center;
|
|
441
|
+
}
|
|
442
|
+
.notion-slash-icon {
|
|
443
|
+
width: 32px;
|
|
444
|
+
height: 32px;
|
|
445
|
+
display: inline-flex;
|
|
446
|
+
align-items: center;
|
|
447
|
+
justify-content: center;
|
|
448
|
+
flex-shrink: 0;
|
|
449
|
+
border: 1px solid var(--color-border, var(--border));
|
|
450
|
+
border-radius: 6px;
|
|
451
|
+
background: color-mix(in oklab, var(--color-muted, var(--muted)) 40%, transparent);
|
|
452
|
+
}
|
|
453
|
+
.notion-slash-meta {
|
|
454
|
+
display: flex;
|
|
455
|
+
flex-direction: column;
|
|
456
|
+
min-width: 0;
|
|
457
|
+
flex: 1;
|
|
458
|
+
}
|
|
459
|
+
.notion-slash-hint {
|
|
460
|
+
flex-shrink: 0;
|
|
461
|
+
padding: 1px 6px;
|
|
462
|
+
border: 1px solid var(--color-border, var(--border));
|
|
463
|
+
border-radius: 4px;
|
|
464
|
+
font-size: 10.5px;
|
|
465
|
+
font-family: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
|
|
466
|
+
color: color-mix(in oklab, var(--color-foreground, var(--foreground)) 55%, transparent);
|
|
467
|
+
background: color-mix(in oklab, var(--color-muted, var(--muted)) 30%, transparent);
|
|
468
|
+
}
|
|
469
|
+
.notion-slash-title {
|
|
470
|
+
font-weight: 500;
|
|
471
|
+
font-size: 13px;
|
|
472
|
+
line-height: 1.3;
|
|
473
|
+
}
|
|
474
|
+
.notion-slash-desc {
|
|
475
|
+
font-size: 11.5px;
|
|
476
|
+
opacity: 0.6;
|
|
477
|
+
line-height: 1.3;
|
|
478
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/react';
|
|
2
|
+
|
|
3
|
+
export interface NotionEditorProps {
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (markdown: string) => void;
|
|
6
|
+
/** Markdown placeholder shown when document is empty. */
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/** Disable editing — turns the editor into a read-only renderer. */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Focus the editor on mount. Pair with `key={path}` upstream when the
|
|
11
|
+
* host wants a fresh focus per source change. */
|
|
12
|
+
autoFocus?: boolean;
|
|
13
|
+
/** Called when the user presses Cmd/Ctrl+S inside the editor. Receives
|
|
14
|
+
* the current markdown. The browser default is suppressed. */
|
|
15
|
+
onSave?: (markdown: string) => void;
|
|
16
|
+
/** Extra class name on the outer wrapper. */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Minimum height of the editor surface in px. Default 320. */
|
|
19
|
+
minHeight?: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Imperative handle exposed via `ref`. Compatible with `ComposerHandle`
|
|
23
|
+
* shape used by the chat suite (focus / moveCursorToEnd). */
|
|
24
|
+
export interface NotionEditorHandle {
|
|
25
|
+
focus: () => void;
|
|
26
|
+
moveCursorToEnd: () => void;
|
|
27
|
+
getEditor: () => Editor | null;
|
|
28
|
+
}
|