@pierre/diffs 1.2.11 → 1.2.12
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 +9 -9
- package/dist/components/CodeView.d.ts +10 -11
- package/dist/components/CodeView.d.ts.map +1 -1
- package/dist/components/CodeView.js +7 -8
- package/dist/components/CodeView.js.map +1 -1
- package/dist/components/File.d.ts +1 -4
- package/dist/components/File.d.ts.map +1 -1
- package/dist/components/File.js +13 -11
- package/dist/components/File.js.map +1 -1
- package/dist/components/FileDiff.d.ts +11 -14
- package/dist/components/FileDiff.d.ts.map +1 -1
- package/dist/components/FileDiff.js +15 -13
- package/dist/components/FileDiff.js.map +1 -1
- package/dist/components/FileStream.d.ts +0 -1
- package/dist/components/FileStream.d.ts.map +1 -1
- package/dist/components/FileStream.js +4 -4
- package/dist/components/FileStream.js.map +1 -1
- package/dist/components/UnresolvedFile.d.ts +2 -2
- package/dist/components/UnresolvedFile.d.ts.map +1 -1
- package/dist/components/UnresolvedFile.js +7 -5
- package/dist/components/UnresolvedFile.js.map +1 -1
- package/dist/components/VirtualizedFile.d.ts +0 -1
- package/dist/components/VirtualizedFile.d.ts.map +1 -1
- package/dist/components/VirtualizedFile.js +19 -18
- package/dist/components/VirtualizedFile.js.map +1 -1
- package/dist/components/VirtualizedFileDiff.d.ts +2 -3
- package/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
- package/dist/components/VirtualizedFileDiff.js +17 -18
- package/dist/components/VirtualizedFileDiff.js.map +1 -1
- package/dist/components/Virtualizer.d.ts +1 -1
- package/dist/components/Virtualizer.d.ts.map +1 -1
- package/dist/components/Virtualizer.js +23 -24
- package/dist/components/Virtualizer.js.map +1 -1
- package/dist/components/VirtulizerDevelopment.d.ts.map +1 -1
- package/dist/components/web-components.d.ts.map +1 -1
- package/dist/components/web-components.js +2 -3
- package/dist/components/web-components.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/highlighter/languages/areLanguagesAttached.d.ts.map +1 -1
- package/dist/highlighter/languages/areLanguagesAttached.js +1 -2
- package/dist/highlighter/languages/areLanguagesAttached.js.map +1 -1
- package/dist/highlighter/languages/attachResolvedLanguages.d.ts +0 -2
- package/dist/highlighter/languages/attachResolvedLanguages.d.ts.map +1 -1
- package/dist/highlighter/languages/attachResolvedLanguages.js +1 -2
- package/dist/highlighter/languages/attachResolvedLanguages.js.map +1 -1
- package/dist/highlighter/languages/cleanUpResolvedLanguages.d.ts.map +1 -1
- package/dist/highlighter/languages/cleanUpResolvedLanguages.js +1 -2
- package/dist/highlighter/languages/cleanUpResolvedLanguages.js.map +1 -1
- package/dist/highlighter/languages/constants.d.ts +0 -1
- package/dist/highlighter/languages/constants.d.ts.map +1 -1
- package/dist/highlighter/languages/constants.js +1 -1
- package/dist/highlighter/languages/constants.js.map +1 -1
- package/dist/highlighter/languages/getResolvedLanguages.d.ts +0 -2
- package/dist/highlighter/languages/getResolvedLanguages.d.ts.map +1 -1
- package/dist/highlighter/languages/getResolvedLanguages.js +1 -2
- package/dist/highlighter/languages/getResolvedLanguages.js.map +1 -1
- package/dist/highlighter/languages/getResolvedOrResolveLanguage.d.ts +0 -2
- package/dist/highlighter/languages/getResolvedOrResolveLanguage.d.ts.map +1 -1
- package/dist/highlighter/languages/getResolvedOrResolveLanguage.js +1 -2
- package/dist/highlighter/languages/getResolvedOrResolveLanguage.js.map +1 -1
- package/dist/highlighter/languages/hasResolvedLanguages.d.ts.map +1 -1
- package/dist/highlighter/languages/hasResolvedLanguages.js +1 -2
- package/dist/highlighter/languages/hasResolvedLanguages.js.map +1 -1
- package/dist/highlighter/languages/registerCustomLanguage.d.ts +0 -1
- package/dist/highlighter/languages/registerCustomLanguage.d.ts.map +1 -1
- package/dist/highlighter/languages/registerCustomLanguage.js +1 -2
- package/dist/highlighter/languages/registerCustomLanguage.js.map +1 -1
- package/dist/highlighter/languages/resolveLanguage.d.ts +0 -2
- package/dist/highlighter/languages/resolveLanguage.d.ts.map +1 -1
- package/dist/highlighter/languages/resolveLanguage.js +4 -5
- package/dist/highlighter/languages/resolveLanguage.js.map +1 -1
- package/dist/highlighter/languages/resolveLanguages.d.ts +0 -2
- package/dist/highlighter/languages/resolveLanguages.d.ts.map +1 -1
- package/dist/highlighter/languages/resolveLanguages.js +1 -2
- package/dist/highlighter/languages/resolveLanguages.js.map +1 -1
- package/dist/highlighter/shared_highlighter.d.ts.map +1 -1
- package/dist/highlighter/shared_highlighter.js +3 -4
- package/dist/highlighter/shared_highlighter.js.map +1 -1
- package/dist/highlighter/themes/areThemesAttached.d.ts.map +1 -1
- package/dist/highlighter/themes/areThemesAttached.js +1 -2
- package/dist/highlighter/themes/areThemesAttached.js.map +1 -1
- package/dist/highlighter/themes/attachResolvedThemes.d.ts.map +1 -1
- package/dist/highlighter/themes/attachResolvedThemes.js +1 -2
- package/dist/highlighter/themes/attachResolvedThemes.js.map +1 -1
- package/dist/highlighter/themes/cleanUpResolvedThemes.d.ts.map +1 -1
- package/dist/highlighter/themes/cleanUpResolvedThemes.js +1 -2
- package/dist/highlighter/themes/cleanUpResolvedThemes.js.map +1 -1
- package/dist/highlighter/themes/constants.d.ts.map +1 -1
- package/dist/highlighter/themes/constants.js +1 -1
- package/dist/highlighter/themes/constants.js.map +1 -1
- package/dist/highlighter/themes/getResolvedOrResolveTheme.d.ts.map +1 -1
- package/dist/highlighter/themes/getResolvedOrResolveTheme.js +1 -2
- package/dist/highlighter/themes/getResolvedOrResolveTheme.js.map +1 -1
- package/dist/highlighter/themes/getResolvedThemes.d.ts.map +1 -1
- package/dist/highlighter/themes/getResolvedThemes.js +1 -2
- package/dist/highlighter/themes/getResolvedThemes.js.map +1 -1
- package/dist/highlighter/themes/hasResolvedThemes.d.ts.map +1 -1
- package/dist/highlighter/themes/hasResolvedThemes.js +1 -2
- package/dist/highlighter/themes/hasResolvedThemes.js.map +1 -1
- package/dist/highlighter/themes/registerCustomCSSVariableTheme.d.ts.map +1 -1
- package/dist/highlighter/themes/registerCustomCSSVariableTheme.js +1 -2
- package/dist/highlighter/themes/registerCustomCSSVariableTheme.js.map +1 -1
- package/dist/highlighter/themes/registerCustomTheme.d.ts.map +1 -1
- package/dist/highlighter/themes/registerCustomTheme.js +1 -2
- package/dist/highlighter/themes/registerCustomTheme.js.map +1 -1
- package/dist/highlighter/themes/resolveTheme.d.ts.map +1 -1
- package/dist/highlighter/themes/resolveTheme.js +1 -2
- package/dist/highlighter/themes/resolveTheme.js.map +1 -1
- package/dist/highlighter/themes/resolveThemes.d.ts.map +1 -1
- package/dist/highlighter/themes/resolveThemes.js +1 -2
- package/dist/highlighter/themes/resolveThemes.js.map +1 -1
- package/dist/highlighter/themes/themeResolution.d.ts.map +1 -1
- package/dist/highlighter/themes/themeResolution.js +1 -2
- package/dist/highlighter/themes/themeResolution.js.map +1 -1
- package/dist/highlighter/themes/themeResolver.d.ts +2 -2
- package/dist/highlighter/themes/themeResolver.d.ts.map +1 -1
- package/dist/highlighter/themes/themeResolver.js +1 -2
- package/dist/highlighter/themes/themeResolver.js.map +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +1 -2
- package/dist/managers/InteractionManager.d.ts.map +1 -1
- package/dist/managers/InteractionManager.js +3 -3
- package/dist/managers/InteractionManager.js.map +1 -1
- package/dist/managers/ResizeManager.d.ts.map +1 -1
- package/dist/managers/ResizeManager.js +1 -1
- package/dist/managers/ResizeManager.js.map +1 -1
- package/dist/managers/ScrollSyncManager.d.ts.map +1 -1
- package/dist/managers/ScrollSyncManager.js +1 -1
- package/dist/managers/ScrollSyncManager.js.map +1 -1
- package/dist/managers/UniversalRenderingManager.d.ts.map +1 -1
- package/dist/managers/UniversalRenderingManager.js +2 -2
- package/dist/managers/UniversalRenderingManager.js.map +1 -1
- package/dist/node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.d.ts +228 -0
- package/dist/node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/@types_unist@3.0.3/node_modules/@types/unist/index.d.ts +84 -0
- package/dist/node_modules/.pnpm/@types_unist@3.0.3/node_modules/@types/unist/index.d.ts.map +1 -0
- package/dist/react/CodeView.d.ts +0 -1
- package/dist/react/CodeView.d.ts.map +1 -1
- package/dist/react/CodeView.js +9 -12
- package/dist/react/CodeView.js.map +1 -1
- package/dist/react/File.d.ts.map +1 -1
- package/dist/react/File.js +2 -5
- package/dist/react/File.js.map +1 -1
- package/dist/react/FileDiff.d.ts.map +1 -1
- package/dist/react/FileDiff.js +2 -5
- package/dist/react/FileDiff.js.map +1 -1
- package/dist/react/MultiFileDiff.d.ts.map +1 -1
- package/dist/react/MultiFileDiff.js +2 -5
- package/dist/react/MultiFileDiff.js.map +1 -1
- package/dist/react/PatchDiff.d.ts.map +1 -1
- package/dist/react/PatchDiff.js +2 -5
- package/dist/react/PatchDiff.js.map +1 -1
- package/dist/react/UnresolvedFile.d.ts +1 -1
- package/dist/react/UnresolvedFile.d.ts.map +1 -1
- package/dist/react/UnresolvedFile.js +2 -5
- package/dist/react/UnresolvedFile.js.map +1 -1
- package/dist/react/Virtualizer.d.ts.map +1 -1
- package/dist/react/Virtualizer.js +2 -5
- package/dist/react/Virtualizer.js.map +1 -1
- package/dist/react/WorkerPoolContext.d.ts +0 -1
- package/dist/react/WorkerPoolContext.d.ts.map +1 -1
- package/dist/react/WorkerPoolContext.js +2 -5
- package/dist/react/WorkerPoolContext.js.map +1 -1
- package/dist/react/constants.d.ts.map +1 -1
- package/dist/react/constants.js +1 -1
- package/dist/react/constants.js.map +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -2
- package/dist/react/jsx.d.ts +0 -2
- package/dist/react/jsx.d.ts.map +1 -1
- package/dist/react/types.d.ts.map +1 -1
- package/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
- package/dist/react/utils/renderDiffChildren.js +4 -5
- package/dist/react/utils/renderDiffChildren.js.map +1 -1
- package/dist/react/utils/renderFileChildren.d.ts.map +1 -1
- package/dist/react/utils/renderFileChildren.js +4 -5
- package/dist/react/utils/renderFileChildren.js.map +1 -1
- package/dist/react/utils/templateRender.d.ts.map +1 -1
- package/dist/react/utils/templateRender.js +1 -2
- package/dist/react/utils/templateRender.js.map +1 -1
- package/dist/react/utils/useFileDiffInstance.d.ts.map +1 -1
- package/dist/react/utils/useFileDiffInstance.js +1 -2
- package/dist/react/utils/useFileDiffInstance.js.map +1 -1
- package/dist/react/utils/useFileInstance.d.ts.map +1 -1
- package/dist/react/utils/useFileInstance.js +1 -2
- package/dist/react/utils/useFileInstance.js.map +1 -1
- package/dist/react/utils/useStableCallback.d.ts.map +1 -1
- package/dist/react/utils/useStableCallback.js +1 -2
- package/dist/react/utils/useStableCallback.js.map +1 -1
- package/dist/react/utils/useUnresolvedFileInstance.d.ts.map +1 -1
- package/dist/react/utils/useUnresolvedFileInstance.js +10 -11
- package/dist/react/utils/useUnresolvedFileInstance.js.map +1 -1
- package/dist/renderers/DiffHunksRenderer.d.ts +1 -2
- package/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
- package/dist/renderers/DiffHunksRenderer.js +23 -20
- package/dist/renderers/DiffHunksRenderer.js.map +1 -1
- package/dist/renderers/FileRenderer.d.ts +1 -3
- package/dist/renderers/FileRenderer.d.ts.map +1 -1
- package/dist/renderers/FileRenderer.js +13 -11
- package/dist/renderers/FileRenderer.js.map +1 -1
- package/dist/renderers/UnresolvedFileHunksRenderer.d.ts +1 -2
- package/dist/renderers/UnresolvedFileHunksRenderer.d.ts.map +1 -1
- package/dist/renderers/UnresolvedFileHunksRenderer.js +1 -2
- package/dist/renderers/UnresolvedFileHunksRenderer.js.map +1 -1
- package/dist/shiki-stream/index.js +1 -2
- package/dist/shiki-stream/stream.d.ts +0 -1
- package/dist/shiki-stream/stream.d.ts.map +1 -1
- package/dist/shiki-stream/stream.js +1 -2
- package/dist/shiki-stream/stream.js.map +1 -1
- package/dist/shiki-stream/tokenizer.d.ts.map +1 -1
- package/dist/shiki-stream/tokenizer.js +1 -1
- package/dist/shiki-stream/tokenizer.js.map +1 -1
- package/dist/shiki-stream/types.d.ts +0 -1
- package/dist/shiki-stream/types.d.ts.map +1 -1
- package/dist/sprite.d.ts.map +1 -1
- package/dist/sprite.js +1 -1
- package/dist/ssr/FileDiffReact.d.ts.map +1 -1
- package/dist/ssr/FileDiffReact.js +4 -7
- package/dist/ssr/FileDiffReact.js.map +1 -1
- package/dist/ssr/index.d.ts +1 -1
- package/dist/ssr/index.js +1 -2
- package/dist/ssr/preloadDiffs.d.ts +1 -1
- package/dist/ssr/preloadDiffs.d.ts.map +1 -1
- package/dist/ssr/preloadDiffs.js +1 -2
- package/dist/ssr/preloadDiffs.js.map +1 -1
- package/dist/ssr/preloadFile.d.ts.map +1 -1
- package/dist/ssr/preloadFile.js +1 -2
- package/dist/ssr/preloadFile.js.map +1 -1
- package/dist/ssr/preloadPatchFile.d.ts.map +1 -1
- package/dist/ssr/preloadPatchFile.js +2 -3
- package/dist/ssr/preloadPatchFile.js.map +1 -1
- package/dist/ssr/renderHTML.d.ts +1 -1
- package/dist/ssr/renderHTML.d.ts.map +1 -1
- package/dist/ssr/renderHTML.js +1 -2
- package/dist/ssr/renderHTML.js.map +1 -1
- package/dist/string-import.d.ts +4 -0
- package/dist/string-import.d.ts.map +1 -1
- package/dist/style.js +3 -3
- package/dist/style.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/areDiffLineAnnotationsEqual.d.ts.map +1 -1
- package/dist/utils/areDiffLineAnnotationsEqual.js +1 -1
- package/dist/utils/areDiffLineAnnotationsEqual.js.map +1 -1
- package/dist/utils/areDiffRenderOptionsEqual.d.ts.map +1 -1
- package/dist/utils/areDiffRenderOptionsEqual.js +1 -2
- package/dist/utils/areDiffRenderOptionsEqual.js.map +1 -1
- package/dist/utils/areDiffTargetsEqual.d.ts.map +1 -1
- package/dist/utils/areDiffTargetsEqual.js +1 -1
- package/dist/utils/areDiffTargetsEqual.js.map +1 -1
- package/dist/utils/areFileRenderOptionsEqual.d.ts.map +1 -1
- package/dist/utils/areFileRenderOptionsEqual.js +1 -2
- package/dist/utils/areFileRenderOptionsEqual.js.map +1 -1
- package/dist/utils/areFilesEqual.d.ts.map +1 -1
- package/dist/utils/areFilesEqual.js +1 -1
- package/dist/utils/areFilesEqual.js.map +1 -1
- package/dist/utils/areHunkDataEqual.d.ts.map +1 -1
- package/dist/utils/areHunkDataEqual.js +1 -1
- package/dist/utils/areHunkDataEqual.js.map +1 -1
- package/dist/utils/areLineAnnotationsEqual.d.ts.map +1 -1
- package/dist/utils/areLineAnnotationsEqual.js +1 -1
- package/dist/utils/areLineAnnotationsEqual.js.map +1 -1
- package/dist/utils/areManagedSnapshotsEqual.d.ts.map +1 -1
- package/dist/utils/areManagedSnapshotsEqual.js +1 -1
- package/dist/utils/areManagedSnapshotsEqual.js.map +1 -1
- package/dist/utils/areMergeConflictActionsEqual.d.ts.map +1 -1
- package/dist/utils/areMergeConflictActionsEqual.js +1 -1
- package/dist/utils/areMergeConflictActionsEqual.js.map +1 -1
- package/dist/utils/areObjectsEqual.d.ts.map +1 -1
- package/dist/utils/areObjectsEqual.js +1 -1
- package/dist/utils/areObjectsEqual.js.map +1 -1
- package/dist/utils/areOptionsEqual.d.ts +0 -2
- package/dist/utils/areOptionsEqual.d.ts.map +1 -1
- package/dist/utils/areOptionsEqual.js +1 -2
- package/dist/utils/areOptionsEqual.js.map +1 -1
- package/dist/utils/arePrePropertiesEqual.d.ts.map +1 -1
- package/dist/utils/arePrePropertiesEqual.js +1 -1
- package/dist/utils/arePrePropertiesEqual.js.map +1 -1
- package/dist/utils/areRenderRangesEqual.d.ts.map +1 -1
- package/dist/utils/areRenderRangesEqual.js +1 -1
- package/dist/utils/areRenderRangesEqual.js.map +1 -1
- package/dist/utils/areSelectionPointsEqual.d.ts.map +1 -1
- package/dist/utils/areSelectionPointsEqual.js +1 -1
- package/dist/utils/areSelectionPointsEqual.js.map +1 -1
- package/dist/utils/areSelectionsEqual.d.ts.map +1 -1
- package/dist/utils/areSelectionsEqual.js +1 -1
- package/dist/utils/areSelectionsEqual.js.map +1 -1
- package/dist/utils/areThemesEqual.d.ts.map +1 -1
- package/dist/utils/areThemesEqual.js +1 -1
- package/dist/utils/areThemesEqual.js.map +1 -1
- package/dist/utils/areVirtualWindowSpecsEqual.d.ts.map +1 -1
- package/dist/utils/areVirtualWindowSpecsEqual.js +1 -1
- package/dist/utils/areVirtualWindowSpecsEqual.js.map +1 -1
- package/dist/utils/areWorkerStatsEqual.d.ts +0 -2
- package/dist/utils/areWorkerStatsEqual.d.ts.map +1 -1
- package/dist/utils/areWorkerStatsEqual.js +1 -1
- package/dist/utils/areWorkerStatsEqual.js.map +1 -1
- package/dist/utils/cleanLastNewline.d.ts.map +1 -1
- package/dist/utils/cleanLastNewline.js +1 -1
- package/dist/utils/cleanLastNewline.js.map +1 -1
- package/dist/utils/computeEstimatedDiffHeights.d.ts.map +1 -1
- package/dist/utils/computeEstimatedDiffHeights.js +1 -2
- package/dist/utils/computeEstimatedDiffHeights.js.map +1 -1
- package/dist/utils/computeVirtualFileMetrics.d.ts.map +1 -1
- package/dist/utils/computeVirtualFileMetrics.js +1 -2
- package/dist/utils/computeVirtualFileMetrics.js.map +1 -1
- package/dist/utils/createAnnotationElement.d.ts +1 -1
- package/dist/utils/createAnnotationElement.d.ts.map +1 -1
- package/dist/utils/createAnnotationElement.js +1 -2
- package/dist/utils/createAnnotationElement.js.map +1 -1
- package/dist/utils/createAnnotationWrapperNode.d.ts.map +1 -1
- package/dist/utils/createAnnotationWrapperNode.js +1 -1
- package/dist/utils/createAnnotationWrapperNode.js.map +1 -1
- package/dist/utils/createContentColumn.d.ts +1 -1
- package/dist/utils/createContentColumn.d.ts.map +1 -1
- package/dist/utils/createContentColumn.js +1 -2
- package/dist/utils/createContentColumn.js.map +1 -1
- package/dist/utils/createEmptyRowBuffer.d.ts +1 -1
- package/dist/utils/createEmptyRowBuffer.d.ts.map +1 -1
- package/dist/utils/createEmptyRowBuffer.js +1 -2
- package/dist/utils/createEmptyRowBuffer.js.map +1 -1
- package/dist/utils/createFileHeaderElement.d.ts +1 -1
- package/dist/utils/createFileHeaderElement.d.ts.map +1 -1
- package/dist/utils/createFileHeaderElement.js +1 -2
- package/dist/utils/createFileHeaderElement.js.map +1 -1
- package/dist/utils/createGutterUtilityContentNode.d.ts.map +1 -1
- package/dist/utils/createGutterUtilityContentNode.js +1 -1
- package/dist/utils/createGutterUtilityContentNode.js.map +1 -1
- package/dist/utils/createGutterUtilityElement.d.ts +1 -1
- package/dist/utils/createGutterUtilityElement.d.ts.map +1 -1
- package/dist/utils/createGutterUtilityElement.js +1 -2
- package/dist/utils/createGutterUtilityElement.js.map +1 -1
- package/dist/utils/createNoNewlineElement.d.ts +1 -1
- package/dist/utils/createNoNewlineElement.d.ts.map +1 -1
- package/dist/utils/createNoNewlineElement.js +1 -2
- package/dist/utils/createNoNewlineElement.js.map +1 -1
- package/dist/utils/createPreElement.d.ts +1 -1
- package/dist/utils/createPreElement.d.ts.map +1 -1
- package/dist/utils/createPreElement.js +1 -3
- package/dist/utils/createPreElement.js.map +1 -1
- package/dist/utils/createRowNodes.d.ts.map +1 -1
- package/dist/utils/createRowNodes.js +1 -1
- package/dist/utils/createRowNodes.js.map +1 -1
- package/dist/utils/createSeparator.d.ts +1 -1
- package/dist/utils/createSeparator.d.ts.map +1 -1
- package/dist/utils/createSeparator.js +1 -2
- package/dist/utils/createSeparator.js.map +1 -1
- package/dist/utils/createSpanNodeFromToken.d.ts.map +1 -1
- package/dist/utils/createSpanNodeFromToken.js +1 -2
- package/dist/utils/createSpanNodeFromToken.js.map +1 -1
- package/dist/utils/createStyleElement.d.ts +1 -1
- package/dist/utils/createStyleElement.d.ts.map +1 -1
- package/dist/utils/createStyleElement.js +1 -2
- package/dist/utils/createStyleElement.js.map +1 -1
- package/dist/utils/createTransformerWithState.d.ts.map +1 -1
- package/dist/utils/createTransformerWithState.js +1 -2
- package/dist/utils/createTransformerWithState.js.map +1 -1
- package/dist/utils/createUnsafeCSSStyleNode.d.ts.map +1 -1
- package/dist/utils/createUnsafeCSSStyleNode.js +1 -2
- package/dist/utils/createUnsafeCSSStyleNode.js.map +1 -1
- package/dist/utils/createWindowFromScrollPosition.d.ts.map +1 -1
- package/dist/utils/createWindowFromScrollPosition.js +5 -5
- package/dist/utils/createWindowFromScrollPosition.js.map +1 -1
- package/dist/utils/cssWrappers.d.ts.map +1 -1
- package/dist/utils/cssWrappers.js +2 -3
- package/dist/utils/cssWrappers.js.map +1 -1
- package/dist/utils/detachString.d.ts.map +1 -1
- package/dist/utils/detachString.js +1 -1
- package/dist/utils/detachString.js.map +1 -1
- package/dist/utils/diffAcceptRejectHunk.d.ts.map +1 -1
- package/dist/utils/diffAcceptRejectHunk.js +1 -2
- package/dist/utils/diffAcceptRejectHunk.js.map +1 -1
- package/dist/utils/formatCSSVariablePrefix.d.ts.map +1 -1
- package/dist/utils/formatCSSVariablePrefix.js +1 -1
- package/dist/utils/formatCSSVariablePrefix.js.map +1 -1
- package/dist/utils/getDiffHunksRendererOptions.d.ts.map +1 -1
- package/dist/utils/getDiffHunksRendererOptions.js +1 -1
- package/dist/utils/getDiffHunksRendererOptions.js.map +1 -1
- package/dist/utils/getFileRendererOptions.d.ts.map +1 -1
- package/dist/utils/getFileRendererOptions.js +1 -1
- package/dist/utils/getFileRendererOptions.js.map +1 -1
- package/dist/utils/getFiletypeFromFileName.d.ts.map +1 -1
- package/dist/utils/getFiletypeFromFileName.js +1 -1
- package/dist/utils/getFiletypeFromFileName.js.map +1 -1
- package/dist/utils/getHighlighterOptions.d.ts.map +1 -1
- package/dist/utils/getHighlighterOptions.js +1 -2
- package/dist/utils/getHighlighterOptions.js.map +1 -1
- package/dist/utils/getHighlighterThemeStyles.d.ts.map +1 -1
- package/dist/utils/getHighlighterThemeStyles.js +1 -2
- package/dist/utils/getHighlighterThemeStyles.js.map +1 -1
- package/dist/utils/getHunkSeparatorSlotName.d.ts.map +1 -1
- package/dist/utils/getHunkSeparatorSlotName.js +1 -1
- package/dist/utils/getHunkSeparatorSlotName.js.map +1 -1
- package/dist/utils/getIconForType.d.ts.map +1 -1
- package/dist/utils/getIconForType.js +1 -1
- package/dist/utils/getIconForType.js.map +1 -1
- package/dist/utils/getLineAnnotationName.d.ts.map +1 -1
- package/dist/utils/getLineAnnotationName.js +1 -1
- package/dist/utils/getLineAnnotationName.js.map +1 -1
- package/dist/utils/getLineEndingType.d.ts.map +1 -1
- package/dist/utils/getLineEndingType.js +1 -1
- package/dist/utils/getLineEndingType.js.map +1 -1
- package/dist/utils/getLineNodes.d.ts +1 -1
- package/dist/utils/getLineNodes.d.ts.map +1 -1
- package/dist/utils/getLineNodes.js +1 -1
- package/dist/utils/getLineNodes.js.map +1 -1
- package/dist/utils/getMergeConflictActionSlotName.d.ts.map +1 -1
- package/dist/utils/getMergeConflictActionSlotName.js +1 -1
- package/dist/utils/getMergeConflictActionSlotName.js.map +1 -1
- package/dist/utils/getMergeConflictLineTypes.d.ts.map +1 -1
- package/dist/utils/getMergeConflictLineTypes.js +1 -2
- package/dist/utils/getMergeConflictLineTypes.js.map +1 -1
- package/dist/utils/getOrCreateCodeNode.d.ts.map +1 -1
- package/dist/utils/getOrCreateCodeNode.js +1 -1
- package/dist/utils/getOrCreateCodeNode.js.map +1 -1
- package/dist/utils/getSingularPatch.d.ts.map +1 -1
- package/dist/utils/getSingularPatch.js +1 -2
- package/dist/utils/getSingularPatch.js.map +1 -1
- package/dist/utils/getThemes.d.ts.map +1 -1
- package/dist/utils/getThemes.js +1 -2
- package/dist/utils/getThemes.js.map +1 -1
- package/dist/utils/getTotalLineCountFromHunks.d.ts.map +1 -1
- package/dist/utils/getTotalLineCountFromHunks.js +1 -1
- package/dist/utils/getTotalLineCountFromHunks.js.map +1 -1
- package/dist/utils/hast_utils.d.ts +1 -1
- package/dist/utils/hast_utils.d.ts.map +1 -1
- package/dist/utils/hast_utils.js +1 -1
- package/dist/utils/hast_utils.js.map +1 -1
- package/dist/utils/hostTheme.d.ts.map +1 -1
- package/dist/utils/hostTheme.js +1 -2
- package/dist/utils/hostTheme.js.map +1 -1
- package/dist/utils/includesFileAnnotations.d.ts.map +1 -1
- package/dist/utils/includesFileAnnotations.js +5 -5
- package/dist/utils/includesFileAnnotations.js.map +1 -1
- package/dist/utils/isDefaultRenderRange.d.ts.map +1 -1
- package/dist/utils/isDefaultRenderRange.js +1 -1
- package/dist/utils/isDefaultRenderRange.js.map +1 -1
- package/dist/utils/isDiffPlainText.d.ts.map +1 -1
- package/dist/utils/isDiffPlainText.js +1 -2
- package/dist/utils/isDiffPlainText.js.map +1 -1
- package/dist/utils/isFilePlainText.d.ts.map +1 -1
- package/dist/utils/isFilePlainText.js +1 -2
- package/dist/utils/isFilePlainText.js.map +1 -1
- package/dist/utils/isStyleNode.d.ts.map +1 -1
- package/dist/utils/isStyleNode.js +1 -1
- package/dist/utils/isStyleNode.js.map +1 -1
- package/dist/utils/isWorkerContext.d.ts.map +1 -1
- package/dist/utils/isWorkerContext.js +1 -1
- package/dist/utils/isWorkerContext.js.map +1 -1
- package/dist/utils/iterateOverDiff.d.ts.map +1 -1
- package/dist/utils/iterateOverDiff.js +44 -45
- package/dist/utils/iterateOverDiff.js.map +1 -1
- package/dist/utils/iterateOverFile.d.ts.map +1 -1
- package/dist/utils/iterateOverFile.js +1 -1
- package/dist/utils/iterateOverFile.js.map +1 -1
- package/dist/utils/normalizeDiffResolution.d.ts.map +1 -1
- package/dist/utils/normalizeDiffResolution.js +1 -1
- package/dist/utils/normalizeDiffResolution.js.map +1 -1
- package/dist/utils/parseDiffDecorations.d.ts.map +1 -1
- package/dist/utils/parseDiffDecorations.js +1 -2
- package/dist/utils/parseDiffDecorations.js.map +1 -1
- package/dist/utils/parseDiffFromFile.d.ts +0 -1
- package/dist/utils/parseDiffFromFile.d.ts.map +1 -1
- package/dist/utils/parseDiffFromFile.js +1 -2
- package/dist/utils/parseDiffFromFile.js.map +1 -1
- package/dist/utils/parseLineType.d.ts.map +1 -1
- package/dist/utils/parseLineType.js +1 -1
- package/dist/utils/parseLineType.js.map +1 -1
- package/dist/utils/parseMergeConflictDiffFromFile.d.ts.map +1 -1
- package/dist/utils/parseMergeConflictDiffFromFile.js +5 -5
- package/dist/utils/parseMergeConflictDiffFromFile.js.map +1 -1
- package/dist/utils/parsePatchFiles.d.ts.map +1 -1
- package/dist/utils/parsePatchFiles.js +6 -7
- package/dist/utils/parsePatchFiles.js.map +1 -1
- package/dist/utils/prefersReducedMotion.d.ts.map +1 -1
- package/dist/utils/prefersReducedMotion.js +1 -1
- package/dist/utils/prefersReducedMotion.js.map +1 -1
- package/dist/utils/prerenderHTMLIfNecessary.d.ts.map +1 -1
- package/dist/utils/prerenderHTMLIfNecessary.js +1 -1
- package/dist/utils/prerenderHTMLIfNecessary.js.map +1 -1
- package/dist/utils/processLine.d.ts +1 -1
- package/dist/utils/processLine.d.ts.map +1 -1
- package/dist/utils/processLine.js +1 -2
- package/dist/utils/processLine.js.map +1 -1
- package/dist/utils/renderDiffWithHighlighter.d.ts.map +1 -1
- package/dist/utils/renderDiffWithHighlighter.js +4 -5
- package/dist/utils/renderDiffWithHighlighter.js.map +1 -1
- package/dist/utils/renderFileWithHighlighter.d.ts.map +1 -1
- package/dist/utils/renderFileWithHighlighter.js +1 -2
- package/dist/utils/renderFileWithHighlighter.js.map +1 -1
- package/dist/utils/resolveConflict.d.ts.map +1 -1
- package/dist/utils/resolveConflict.js +1 -2
- package/dist/utils/resolveConflict.js.map +1 -1
- package/dist/utils/resolveRegion.d.ts.map +1 -1
- package/dist/utils/resolveRegion.js +1 -1
- package/dist/utils/resolveRegion.js.map +1 -1
- package/dist/utils/roundToDevicePixel.d.ts.map +1 -1
- package/dist/utils/roundToDevicePixel.js +1 -1
- package/dist/utils/roundToDevicePixel.js.map +1 -1
- package/dist/utils/scrollbarGutter.d.ts.map +1 -1
- package/dist/utils/scrollbarGutter.js +1 -2
- package/dist/utils/scrollbarGutter.js.map +1 -1
- package/dist/utils/setLanguageOverride.d.ts.map +1 -1
- package/dist/utils/setLanguageOverride.js +1 -1
- package/dist/utils/setLanguageOverride.js.map +1 -1
- package/dist/utils/setWrapperNodeProps.d.ts.map +1 -1
- package/dist/utils/setWrapperNodeProps.js +1 -2
- package/dist/utils/setWrapperNodeProps.js.map +1 -1
- package/dist/utils/shouldUseTokenTransformer.d.ts.map +1 -1
- package/dist/utils/shouldUseTokenTransformer.js +1 -1
- package/dist/utils/shouldUseTokenTransformer.js.map +1 -1
- package/dist/utils/splitFileContents.d.ts.map +1 -1
- package/dist/utils/splitFileContents.js +1 -2
- package/dist/utils/splitFileContents.js.map +1 -1
- package/dist/utils/trimPatchContext.d.ts.map +1 -1
- package/dist/utils/trimPatchContext.js +1 -2
- package/dist/utils/trimPatchContext.js.map +1 -1
- package/dist/utils/virtualDiffLayout.d.ts.map +1 -1
- package/dist/utils/virtualDiffLayout.js +1 -2
- package/dist/utils/virtualDiffLayout.js.map +1 -1
- package/dist/utils/wrapTokenFragments.d.ts +1 -1
- package/dist/utils/wrapTokenFragments.d.ts.map +1 -1
- package/dist/utils/wrapTokenFragments.js +1 -2
- package/dist/utils/wrapTokenFragments.js.map +1 -1
- package/dist/worker/WorkerPoolManager.d.ts.map +1 -1
- package/dist/worker/WorkerPoolManager.js +5 -5
- package/dist/worker/WorkerPoolManager.js.map +1 -1
- package/dist/worker/getOrCreateWorkerPoolSingleton.d.ts.map +1 -1
- package/dist/worker/getOrCreateWorkerPoolSingleton.js +1 -2
- package/dist/worker/getOrCreateWorkerPoolSingleton.js.map +1 -1
- package/dist/worker/index.js +1 -2
- package/dist/worker/types.d.ts.map +1 -1
- package/dist/worker/wasm-B9ZqxnKj.js +8 -0
- package/dist/worker/wasm-B9ZqxnKj.js.map +1 -0
- package/dist/worker/worker-portable.js +2763 -6368
- package/dist/worker/worker-portable.js.map +1 -1
- package/dist/worker/worker.js +89 -124
- package/dist/worker/worker.js.map +1 -1
- package/package.json +15 -13
- package/dist/worker/wasm-qE0LgnY3.js +0 -10
- package/dist/worker/wasm-qE0LgnY3.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollSyncManager.js","names":[],"sources":["../../src/managers/ScrollSyncManager.ts"],"sourcesContent":["export class ScrollSyncManager {\n isDeletionsScrolling: boolean = false;\n isAdditionsScrolling: boolean = false;\n timeoutId: NodeJS.Timeout = -1 as unknown as NodeJS.Timeout;\n codeDeletions: HTMLElement | undefined;\n codeAdditions: HTMLElement | undefined;\n private enabled = false;\n\n cleanUp(): void {\n if (!this.enabled) {\n return;\n }\n this.codeDeletions?.removeEventListener(\n 'scroll',\n this.handleDeletionsScroll\n );\n this.codeAdditions?.removeEventListener(\n 'scroll',\n this.handleAdditionsScroll\n );\n clearTimeout(this.timeoutId);\n this.codeDeletions = undefined;\n this.codeAdditions = undefined;\n this.enabled = false;\n }\n\n setup(\n pre: HTMLPreElement,\n codeDeletions?: HTMLElement,\n codeAdditions?: HTMLElement\n ): void {\n // If no code elements were provided, lets try to find them in\n // the pre element\n if (codeDeletions == null || codeAdditions == null) {\n for (const element of pre.children ?? []) {\n if (!(element instanceof HTMLElement)) {\n continue;\n }\n if ('deletions' in element.dataset) {\n codeDeletions = element;\n } else if ('additions' in element.dataset) {\n codeAdditions = element;\n }\n }\n }\n if (codeAdditions == null || codeDeletions == null) {\n this.cleanUp();\n return;\n }\n\n if (this.codeDeletions !== codeDeletions) {\n this.codeDeletions?.removeEventListener(\n 'scroll',\n this.handleDeletionsScroll\n );\n this.codeDeletions = codeDeletions;\n codeDeletions.addEventListener('scroll', this.handleDeletionsScroll, {\n passive: true,\n });\n }\n if (this.codeAdditions !== codeAdditions) {\n this.codeAdditions?.removeEventListener(\n 'scroll',\n this.handleAdditionsScroll\n );\n this.codeAdditions = codeAdditions;\n codeAdditions.addEventListener('scroll', this.handleAdditionsScroll, {\n passive: true,\n });\n }\n this.enabled = true;\n }\n\n private handleDeletionsScroll = () => {\n if (this.isAdditionsScrolling) {\n return;\n }\n this.isDeletionsScrolling = true;\n clearTimeout(this.timeoutId);\n this.timeoutId = setTimeout(() => {\n this.isDeletionsScrolling = false;\n }, 300);\n this.codeAdditions?.scrollTo({\n left: this.codeDeletions?.scrollLeft,\n });\n };\n\n private handleAdditionsScroll = () => {\n if (this.isDeletionsScrolling) {\n return;\n }\n this.isAdditionsScrolling = true;\n clearTimeout(this.timeoutId);\n this.timeoutId = setTimeout(() => {\n this.isAdditionsScrolling = false;\n }, 300);\n this.codeDeletions?.scrollTo({\n left: this.codeAdditions?.scrollLeft,\n });\n };\n}\n"],"mappings":";AAAA,IAAa,oBAAb,MAA+B;CAC7B,uBAAgC;CAChC,uBAAgC;CAChC,YAA4B;CAC5B;CACA;CACA,
|
|
1
|
+
{"version":3,"file":"ScrollSyncManager.js","names":[],"sources":["../../src/managers/ScrollSyncManager.ts"],"sourcesContent":["export class ScrollSyncManager {\n isDeletionsScrolling: boolean = false;\n isAdditionsScrolling: boolean = false;\n timeoutId: NodeJS.Timeout = -1 as unknown as NodeJS.Timeout;\n codeDeletions: HTMLElement | undefined;\n codeAdditions: HTMLElement | undefined;\n private enabled = false;\n\n cleanUp(): void {\n if (!this.enabled) {\n return;\n }\n this.codeDeletions?.removeEventListener(\n 'scroll',\n this.handleDeletionsScroll\n );\n this.codeAdditions?.removeEventListener(\n 'scroll',\n this.handleAdditionsScroll\n );\n clearTimeout(this.timeoutId);\n this.codeDeletions = undefined;\n this.codeAdditions = undefined;\n this.enabled = false;\n }\n\n setup(\n pre: HTMLPreElement,\n codeDeletions?: HTMLElement,\n codeAdditions?: HTMLElement\n ): void {\n // If no code elements were provided, lets try to find them in\n // the pre element\n if (codeDeletions == null || codeAdditions == null) {\n for (const element of pre.children ?? []) {\n if (!(element instanceof HTMLElement)) {\n continue;\n }\n if ('deletions' in element.dataset) {\n codeDeletions = element;\n } else if ('additions' in element.dataset) {\n codeAdditions = element;\n }\n }\n }\n if (codeAdditions == null || codeDeletions == null) {\n this.cleanUp();\n return;\n }\n\n if (this.codeDeletions !== codeDeletions) {\n this.codeDeletions?.removeEventListener(\n 'scroll',\n this.handleDeletionsScroll\n );\n this.codeDeletions = codeDeletions;\n codeDeletions.addEventListener('scroll', this.handleDeletionsScroll, {\n passive: true,\n });\n }\n if (this.codeAdditions !== codeAdditions) {\n this.codeAdditions?.removeEventListener(\n 'scroll',\n this.handleAdditionsScroll\n );\n this.codeAdditions = codeAdditions;\n codeAdditions.addEventListener('scroll', this.handleAdditionsScroll, {\n passive: true,\n });\n }\n this.enabled = true;\n }\n\n private handleDeletionsScroll = () => {\n if (this.isAdditionsScrolling) {\n return;\n }\n this.isDeletionsScrolling = true;\n clearTimeout(this.timeoutId);\n this.timeoutId = setTimeout(() => {\n this.isDeletionsScrolling = false;\n }, 300);\n this.codeAdditions?.scrollTo({\n left: this.codeDeletions?.scrollLeft,\n });\n };\n\n private handleAdditionsScroll = () => {\n if (this.isDeletionsScrolling) {\n return;\n }\n this.isAdditionsScrolling = true;\n clearTimeout(this.timeoutId);\n this.timeoutId = setTimeout(() => {\n this.isAdditionsScrolling = false;\n }, 300);\n this.codeDeletions?.scrollTo({\n left: this.codeAdditions?.scrollLeft,\n });\n };\n}\n"],"mappings":";AAAA,IAAa,oBAAb,MAA+B;CAC7B,uBAAgC;CAChC,uBAAgC;CAChC,YAA4B;CAC5B;CACA;CACA,UAAkB;CAElB,UAAgB;EACd,IAAI,CAAC,KAAK,SACR;EAEF,KAAK,eAAe,oBAClB,UACA,KAAK,qBACP;EACA,KAAK,eAAe,oBAClB,UACA,KAAK,qBACP;EACA,aAAa,KAAK,SAAS;EAC3B,KAAK,gBAAgB,KAAA;EACrB,KAAK,gBAAgB,KAAA;EACrB,KAAK,UAAU;CACjB;CAEA,MACE,KACA,eACA,eACM;EAGN,IAAI,iBAAiB,QAAQ,iBAAiB,MAC5C,KAAK,MAAM,WAAW,IAAI,YAAY,CAAC,GAAG;GACxC,IAAI,EAAE,mBAAmB,cACvB;GAEF,IAAI,eAAe,QAAQ,SACzB,gBAAgB;QACX,IAAI,eAAe,QAAQ,SAChC,gBAAgB;EAEpB;EAEF,IAAI,iBAAiB,QAAQ,iBAAiB,MAAM;GAClD,KAAK,QAAQ;GACb;EACF;EAEA,IAAI,KAAK,kBAAkB,eAAe;GACxC,KAAK,eAAe,oBAClB,UACA,KAAK,qBACP;GACA,KAAK,gBAAgB;GACrB,cAAc,iBAAiB,UAAU,KAAK,uBAAuB,EACnE,SAAS,KACX,CAAC;EACH;EACA,IAAI,KAAK,kBAAkB,eAAe;GACxC,KAAK,eAAe,oBAClB,UACA,KAAK,qBACP;GACA,KAAK,gBAAgB;GACrB,cAAc,iBAAiB,UAAU,KAAK,uBAAuB,EACnE,SAAS,KACX,CAAC;EACH;EACA,KAAK,UAAU;CACjB;CAEA,8BAAsC;EACpC,IAAI,KAAK,sBACP;EAEF,KAAK,uBAAuB;EAC5B,aAAa,KAAK,SAAS;EAC3B,KAAK,YAAY,iBAAiB;GAChC,KAAK,uBAAuB;EAC9B,GAAG,GAAG;EACN,KAAK,eAAe,SAAS,EAC3B,MAAM,KAAK,eAAe,WAC5B,CAAC;CACH;CAEA,8BAAsC;EACpC,IAAI,KAAK,sBACP;EAEF,KAAK,uBAAuB;EAC5B,aAAa,KAAK,SAAS;EAC3B,KAAK,YAAY,iBAAiB;GAChC,KAAK,uBAAuB;EAC9B,GAAG,GAAG;EACN,KAAK,eAAe,SAAS,EAC3B,MAAM,KAAK,eAAe,WAC5B,CAAC;CACH;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UniversalRenderingManager.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"UniversalRenderingManager.d.ts","names":[],"sources":["../../src/managers/UniversalRenderingManager.ts"],"mappings":";KAAK,QAAA,IAAY,IAAY;AAAA,iBAMb,WAAA,CAAY,QAAkB,EAAR,QAAQ;AAAA,iBAK9B,aAAA,CAAc,QAAkB,EAAR,QAAQ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/managers/UniversalRenderingManager.ts
|
|
2
|
-
|
|
2
|
+
const callbacks = /* @__PURE__ */ new Set();
|
|
3
3
|
let frameId = null;
|
|
4
4
|
function queueRender(callback) {
|
|
5
5
|
callbacks.add(callback);
|
|
@@ -23,7 +23,7 @@ function render(time) {
|
|
|
23
23
|
if (callbacks.size > 0) frameId = requestAnimationFrame(render);
|
|
24
24
|
else frameId = null;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
26
|
//#endregion
|
|
28
27
|
export { dequeueRender, queueRender };
|
|
28
|
+
|
|
29
29
|
//# sourceMappingURL=UniversalRenderingManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UniversalRenderingManager.js","names":[
|
|
1
|
+
{"version":3,"file":"UniversalRenderingManager.js","names":[],"sources":["../../src/managers/UniversalRenderingManager.ts"],"sourcesContent":["type Callback = (time: number) => unknown;\n\nconst callbacks = new Set<Callback>();\nlet frameId: null | number = null;\n\n// TODO(amadeus): Figure out a proper name for this module...\nexport function queueRender(callback: Callback): void {\n callbacks.add(callback);\n frameId ??= requestAnimationFrame(render);\n}\n\nexport function dequeueRender(callback: Callback): void {\n callbacks.delete(callback);\n if (callbacks.size === 0 && frameId != null) {\n cancelAnimationFrame(frameId);\n frameId = null;\n }\n}\n\nfunction render(time: number): void {\n const toIterate = new Set(callbacks);\n callbacks.clear();\n for (const callback of toIterate) {\n try {\n callback(time);\n } catch (error) {\n console.error(error);\n }\n }\n // If render picked up any new callbacks, lets trigger a new\n // requestAnimationFrame\n if (callbacks.size > 0) {\n frameId = requestAnimationFrame(render);\n } else {\n frameId = null;\n }\n}\n"],"mappings":";AAEA,MAAM,4BAAY,IAAI,IAAc;AACpC,IAAI,UAAyB;AAG7B,SAAgB,YAAY,UAA0B;CACpD,UAAU,IAAI,QAAQ;CACtB,YAAY,sBAAsB,MAAM;AAC1C;AAEA,SAAgB,cAAc,UAA0B;CACtD,UAAU,OAAO,QAAQ;CACzB,IAAI,UAAU,SAAS,KAAK,WAAW,MAAM;EAC3C,qBAAqB,OAAO;EAC5B,UAAU;CACZ;AACF;AAEA,SAAS,OAAO,MAAoB;CAClC,MAAM,YAAY,IAAI,IAAI,SAAS;CACnC,UAAU,MAAM;CAChB,KAAK,MAAM,YAAY,WACrB,IAAI;EACF,SAAS,IAAI;CACf,SAAS,OAAO;EACd,QAAQ,MAAM,KAAK;CACrB;CAIF,IAAI,UAAU,OAAO,GACnB,UAAU,sBAAsB,MAAM;MAEtC,UAAU;AAEd"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { Data as Data$1, Node as Node$1 } from "../../../../@types_unist@3.0.3/node_modules/@types/unist/index.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/@types+hast@3.0.4/node_modules/@types/hast/index.d.ts
|
|
4
|
+
// ## Interfaces
|
|
5
|
+
/**
|
|
6
|
+
* Info associated with hast nodes by the ecosystem.
|
|
7
|
+
*
|
|
8
|
+
* This space is guaranteed to never be specified by unist or hast.
|
|
9
|
+
* But you can use it in utilities and plugins to store data.
|
|
10
|
+
*
|
|
11
|
+
* This type can be augmented to register custom data.
|
|
12
|
+
* For example:
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* declare module 'hast' {
|
|
16
|
+
* interface Data {
|
|
17
|
+
* // `someNode.data.myId` is typed as `number | undefined`
|
|
18
|
+
* myId?: number | undefined
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
interface Data extends Data$1 {}
|
|
24
|
+
/**
|
|
25
|
+
* Info associated with an element.
|
|
26
|
+
*/
|
|
27
|
+
interface Properties {
|
|
28
|
+
[PropertyName: string]: boolean | number | string | null | undefined | Array<string | number>;
|
|
29
|
+
}
|
|
30
|
+
// ## Content maps
|
|
31
|
+
/**
|
|
32
|
+
* Union of registered hast nodes that can occur in {@link Element}.
|
|
33
|
+
*
|
|
34
|
+
* To register mote custom hast nodes, add them to {@link ElementContentMap}.
|
|
35
|
+
* They will be automatically added here.
|
|
36
|
+
*/
|
|
37
|
+
type ElementContent = ElementContentMap[keyof ElementContentMap];
|
|
38
|
+
/**
|
|
39
|
+
* Registry of all hast nodes that can occur as children of {@link Element}.
|
|
40
|
+
*
|
|
41
|
+
* For a union of all {@link Element} children, see {@link ElementContent}.
|
|
42
|
+
*/
|
|
43
|
+
interface ElementContentMap {
|
|
44
|
+
comment: Comment;
|
|
45
|
+
element: Element;
|
|
46
|
+
text: Text;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Union of registered hast nodes that can occur in {@link Root}.
|
|
50
|
+
*
|
|
51
|
+
* To register custom hast nodes, add them to {@link RootContentMap}.
|
|
52
|
+
* They will be automatically added here.
|
|
53
|
+
*/
|
|
54
|
+
type RootContent = RootContentMap[keyof RootContentMap];
|
|
55
|
+
/**
|
|
56
|
+
* Registry of all hast nodes that can occur as children of {@link Root}.
|
|
57
|
+
*
|
|
58
|
+
* > 👉 **Note**: {@link Root} does not need to be an entire document.
|
|
59
|
+
* > it can also be a fragment.
|
|
60
|
+
*
|
|
61
|
+
* For a union of all {@link Root} children, see {@link RootContent}.
|
|
62
|
+
*/
|
|
63
|
+
interface RootContentMap {
|
|
64
|
+
comment: Comment;
|
|
65
|
+
doctype: Doctype;
|
|
66
|
+
element: Element;
|
|
67
|
+
text: Text;
|
|
68
|
+
}
|
|
69
|
+
// ## Abstract nodes
|
|
70
|
+
/**
|
|
71
|
+
* Abstract hast node.
|
|
72
|
+
*
|
|
73
|
+
* This interface is supposed to be extended.
|
|
74
|
+
* If you can use {@link Literal} or {@link Parent}, you should.
|
|
75
|
+
* But for example in HTML, a `Doctype` is neither literal nor parent, but
|
|
76
|
+
* still a node.
|
|
77
|
+
*
|
|
78
|
+
* To register custom hast nodes, add them to {@link RootContentMap} and other
|
|
79
|
+
* places where relevant (such as {@link ElementContentMap}).
|
|
80
|
+
*
|
|
81
|
+
* For a union of all registered hast nodes, see {@link Nodes}.
|
|
82
|
+
*/
|
|
83
|
+
interface Node extends Node$1 {
|
|
84
|
+
/**
|
|
85
|
+
* Info from the ecosystem.
|
|
86
|
+
*/
|
|
87
|
+
data?: Data | undefined;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Abstract hast node that contains the smallest possible value.
|
|
91
|
+
*
|
|
92
|
+
* This interface is supposed to be extended if you make custom hast nodes.
|
|
93
|
+
*
|
|
94
|
+
* For a union of all registered hast literals, see {@link Literals}.
|
|
95
|
+
*/
|
|
96
|
+
interface Literal extends Node {
|
|
97
|
+
/**
|
|
98
|
+
* Plain-text value.
|
|
99
|
+
*/
|
|
100
|
+
value: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Abstract hast node that contains other hast nodes (*children*).
|
|
104
|
+
*
|
|
105
|
+
* This interface is supposed to be extended if you make custom hast nodes.
|
|
106
|
+
*
|
|
107
|
+
* For a union of all registered hast parents, see {@link Parents}.
|
|
108
|
+
*/
|
|
109
|
+
interface Parent extends Node {
|
|
110
|
+
/**
|
|
111
|
+
* List of children.
|
|
112
|
+
*/
|
|
113
|
+
children: RootContent[];
|
|
114
|
+
}
|
|
115
|
+
// ## Concrete nodes
|
|
116
|
+
/**
|
|
117
|
+
* HTML comment.
|
|
118
|
+
*/
|
|
119
|
+
interface Comment extends Literal {
|
|
120
|
+
/**
|
|
121
|
+
* Node type of HTML comments in hast.
|
|
122
|
+
*/
|
|
123
|
+
type: "comment";
|
|
124
|
+
/**
|
|
125
|
+
* Data associated with the comment.
|
|
126
|
+
*/
|
|
127
|
+
data?: CommentData | undefined;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Info associated with hast comments by the ecosystem.
|
|
131
|
+
*/
|
|
132
|
+
interface CommentData extends Data {}
|
|
133
|
+
/**
|
|
134
|
+
* HTML document type.
|
|
135
|
+
*/
|
|
136
|
+
interface Doctype extends Node$1 {
|
|
137
|
+
/**
|
|
138
|
+
* Node type of HTML document types in hast.
|
|
139
|
+
*/
|
|
140
|
+
type: "doctype";
|
|
141
|
+
/**
|
|
142
|
+
* Data associated with the doctype.
|
|
143
|
+
*/
|
|
144
|
+
data?: DoctypeData | undefined;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Info associated with hast doctypes by the ecosystem.
|
|
148
|
+
*/
|
|
149
|
+
interface DoctypeData extends Data {}
|
|
150
|
+
/**
|
|
151
|
+
* HTML element.
|
|
152
|
+
*/
|
|
153
|
+
interface Element extends Parent {
|
|
154
|
+
/**
|
|
155
|
+
* Node type of elements.
|
|
156
|
+
*/
|
|
157
|
+
type: "element";
|
|
158
|
+
/**
|
|
159
|
+
* Tag name (such as `'body'`) of the element.
|
|
160
|
+
*/
|
|
161
|
+
tagName: string;
|
|
162
|
+
/**
|
|
163
|
+
* Info associated with the element.
|
|
164
|
+
*/
|
|
165
|
+
properties: Properties;
|
|
166
|
+
/**
|
|
167
|
+
* Children of element.
|
|
168
|
+
*/
|
|
169
|
+
children: ElementContent[];
|
|
170
|
+
/**
|
|
171
|
+
* When the `tagName` field is `'template'`, a `content` field can be
|
|
172
|
+
* present.
|
|
173
|
+
*/
|
|
174
|
+
content?: Root | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* Data associated with the element.
|
|
177
|
+
*/
|
|
178
|
+
data?: ElementData | undefined;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Info associated with hast elements by the ecosystem.
|
|
182
|
+
*/
|
|
183
|
+
interface ElementData extends Data {}
|
|
184
|
+
/**
|
|
185
|
+
* Document fragment or a whole document.
|
|
186
|
+
*
|
|
187
|
+
* Should be used as the root of a tree and must not be used as a child.
|
|
188
|
+
*
|
|
189
|
+
* Can also be used as the value for the content field on a `'template'` element.
|
|
190
|
+
*/
|
|
191
|
+
interface Root extends Parent {
|
|
192
|
+
/**
|
|
193
|
+
* Node type of hast root.
|
|
194
|
+
*/
|
|
195
|
+
type: "root";
|
|
196
|
+
/**
|
|
197
|
+
* Children of root.
|
|
198
|
+
*/
|
|
199
|
+
children: RootContent[];
|
|
200
|
+
/**
|
|
201
|
+
* Data associated with the hast root.
|
|
202
|
+
*/
|
|
203
|
+
data?: RootData | undefined;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Info associated with hast root nodes by the ecosystem.
|
|
207
|
+
*/
|
|
208
|
+
interface RootData extends Data {}
|
|
209
|
+
/**
|
|
210
|
+
* HTML character data (plain text).
|
|
211
|
+
*/
|
|
212
|
+
interface Text extends Literal {
|
|
213
|
+
/**
|
|
214
|
+
* Node type of HTML character data (plain text) in hast.
|
|
215
|
+
*/
|
|
216
|
+
type: "text";
|
|
217
|
+
/**
|
|
218
|
+
* Data associated with the text.
|
|
219
|
+
*/
|
|
220
|
+
data?: TextData | undefined;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Info associated with hast texts by the ecosystem.
|
|
224
|
+
*/
|
|
225
|
+
interface TextData extends Data {}
|
|
226
|
+
//#endregion
|
|
227
|
+
export { Comment, CommentData, Data, Doctype, DoctypeData, Element, ElementContent, ElementContentMap, ElementData, Literal, Node, Parent, Properties, Root, RootContent, RootContentMap, RootData, Text, TextData };
|
|
228
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["UnistData","PropertyName","Array","ElementContentMap","comment","Comment","element","Element","text","Text","RootContentMap","doctype","Doctype","RootContent","Extract","Nodes","UnistLiteral","Root","UnistParent","UnistNode","data","Data","Node","value","children","Literal","type","CommentData","DoctypeData","Parent","tagName","properties","Properties","ElementContent","content","ElementData","RootData","TextData"],"sources":["../../../../../../../../../node_modules/.pnpm/@types+hast@3.0.4/node_modules/@types/hast/index.d.ts"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAsB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AAA,SAAoB,IAAI;;;;;;;;UASxB,IAAA,SAAa,MAAA;;;;EAI1BM,IAAAA;;;;EAIAF,QAAAA,EAAU,WAAA;;;;EAIVJ,IAAAA,GAAO,QAAA;AAAA;;;;UAMM,QAAA,SAAiB,IAAI;;;;UAKrB,IAAA,SAAa,OAAO;;;;EAIjCM,IAAAA;;;;EAIAN,IAAAA,GAAO,QAAA;AAAA;;;;UAMM,QAAA,SAAiB,IAAI"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@types+unist@3.0.3/node_modules/@types/unist/index.d.ts
|
|
2
|
+
// ## Interfaces
|
|
3
|
+
/**
|
|
4
|
+
* Info associated with nodes by the ecosystem.
|
|
5
|
+
*
|
|
6
|
+
* This space is guaranteed to never be specified by unist or specifications
|
|
7
|
+
* implementing unist.
|
|
8
|
+
* But you can use it in utilities and plugins to store data.
|
|
9
|
+
*
|
|
10
|
+
* This type can be augmented to register custom data.
|
|
11
|
+
* For example:
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* declare module 'unist' {
|
|
15
|
+
* interface Data {
|
|
16
|
+
* // `someNode.data.myId` is typed as `number | undefined`
|
|
17
|
+
* myId?: number | undefined
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
interface Data {}
|
|
23
|
+
/**
|
|
24
|
+
* One place in a source file.
|
|
25
|
+
*/
|
|
26
|
+
interface Point {
|
|
27
|
+
/**
|
|
28
|
+
* Line in a source file (1-indexed integer).
|
|
29
|
+
*/
|
|
30
|
+
line: number;
|
|
31
|
+
/**
|
|
32
|
+
* Column in a source file (1-indexed integer).
|
|
33
|
+
*/
|
|
34
|
+
column: number;
|
|
35
|
+
/**
|
|
36
|
+
* Character in a source file (0-indexed integer).
|
|
37
|
+
*/
|
|
38
|
+
offset?: number | undefined;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Position of a node in a source document.
|
|
42
|
+
*
|
|
43
|
+
* A position is a range between two points.
|
|
44
|
+
*/
|
|
45
|
+
interface Position {
|
|
46
|
+
/**
|
|
47
|
+
* Place of the first character of the parsed source region.
|
|
48
|
+
*/
|
|
49
|
+
start: Point;
|
|
50
|
+
/**
|
|
51
|
+
* Place of the first character after the parsed source region.
|
|
52
|
+
*/
|
|
53
|
+
end: Point;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Abstract unist node.
|
|
57
|
+
*
|
|
58
|
+
* The syntactic unit in unist syntax trees are called nodes.
|
|
59
|
+
*
|
|
60
|
+
* This interface is supposed to be extended.
|
|
61
|
+
* If you can use {@link Literal} or {@link Parent}, you should.
|
|
62
|
+
* But for example in markdown, a `thematicBreak` (`***`), is neither literal
|
|
63
|
+
* nor parent, but still a node.
|
|
64
|
+
*/
|
|
65
|
+
interface Node {
|
|
66
|
+
/**
|
|
67
|
+
* Node type.
|
|
68
|
+
*/
|
|
69
|
+
type: string;
|
|
70
|
+
/**
|
|
71
|
+
* Info from the ecosystem.
|
|
72
|
+
*/
|
|
73
|
+
data?: Data | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Position of a node in a source document.
|
|
76
|
+
*
|
|
77
|
+
* Nodes that are generated (not in the original source document) must not
|
|
78
|
+
* have a position.
|
|
79
|
+
*/
|
|
80
|
+
position?: Position | undefined;
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { Data, Node, Point, Position };
|
|
84
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["line","column","offset","start","Point","end","Node","value","type","data","Data","position","Position","children"],"sources":["../../../../../../../../../node_modules/.pnpm/@types+unist@3.0.3/node_modules/@types/unist/index.d.ts"],"x_google_ignoreList":[0],"mappings":";;;;;AAqBqB;AAKrB;;;;;;;;AAaU;AAQV;;;;;;UA1BiB,IAAA;;AAmCH;AA6Bd;UA3DiB,KAAA;;;;EAIbA,IAAAA;EAwEAW;;;EAnEAV,MAAAA;;;;EAIAC,MAAAA;AAAAA;;;;;;UAQa,QAAA;;;;EAIbC,KAAAA,EAAO,KAAA;;;;EAKPE,GAAAA,EAAK,KAAK;AAAA;;;;;;;;;;;UA6BG,IAAA;;;;EAIbG,IAAAA;;;;EAKAC,IAAAA,GAAO,IAAA;;;;;;;EAQPE,QAAAA,GAAW,QAAQ;AAAA"}
|
package/dist/react/CodeView.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CodeViewItem, CodeViewScrollTarget, DiffLineAnnotation, LineAnnotation } from "../types.js";
|
|
2
2
|
import { GetHoveredLineResult } from "../managers/InteractionManager.js";
|
|
3
|
-
import "../index.js";
|
|
4
3
|
import { CodeView as CodeView$1, CodeViewLineSelection, CodeViewOptions } from "../components/CodeView.js";
|
|
5
4
|
import { CSSProperties, ReactNode, Ref } from "react";
|
|
6
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeView.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"CodeView.d.ts","names":[],"sources":["../../src/react/CodeView.tsx"],"mappings":";;;;;;KAyCK,2BAAA,UACM,oBAAA,+BACA,oBAAoB;AAAA,UAErB,iBAAA;EACR,OAAA,GAAU,eAAA,CAAgB,WAAA;EAC1B,SAAA;EACA,KAAA,GAAQ,aAAA;EACR,YAAA,GAAe,GAAA,CAAI,cAAA;EACnB,iBAAA;EACA,aAAA,GAAgB,qBAAA;EAChB,qBAAA,EAAuB,SAAA,EAAW,qBAAA;EAClC,QAAA,EAAU,SAAA,UAAmB,MAAA,EAAQ,UAAA,CAAc,WAAA;EACnD,kBAAA,EAAoB,IAAA,EAAM,YAAA,CAAa,WAAA,IAAe,SAAA;EACtD,kBAAA,EAAoB,IAAA,EAAM,YAAA,CAAa,WAAA,IAAe,SAAA;EACtD,oBAAA,EAAsB,IAAA,EAAM,YAAA,CAAa,WAAA,IAAe,SAAA;EACxD,gB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components/CodeView.js";
|
|
6
4
|
import { areManagedSnapshotsEqual } from "../utils/areManagedSnapshotsEqual.js";
|
|
@@ -11,7 +9,6 @@ import { WorkerPoolContext } from "./WorkerPoolContext.js";
|
|
|
11
9
|
import { forwardRef, memo, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
12
10
|
import { createPortal, flushSync } from "react-dom";
|
|
13
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
|
|
15
12
|
//#region src/react/CodeView.tsx
|
|
16
13
|
const useIsometricEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
17
14
|
function createDefaultCache(controlled) {
|
|
@@ -139,8 +136,8 @@ function CodeViewInner(props, ref) {
|
|
|
139
136
|
});
|
|
140
137
|
useImperativeHandle(ref, () => ({
|
|
141
138
|
addItems(items) {
|
|
142
|
-
const { controlled
|
|
143
|
-
assertUncontrolledCodeViewAction(controlled
|
|
139
|
+
const { controlled, instance } = cachedDataRef.current;
|
|
140
|
+
assertUncontrolledCodeViewAction(controlled, "addItems");
|
|
144
141
|
if (instance == null) console.error("CodeView.addItems: no valid instance to append items with", items);
|
|
145
142
|
else instance.addItems(items);
|
|
146
143
|
},
|
|
@@ -152,8 +149,8 @@ function CodeViewInner(props, ref) {
|
|
|
152
149
|
} else return instance.getItem(id);
|
|
153
150
|
},
|
|
154
151
|
updateItem(item) {
|
|
155
|
-
const { controlled
|
|
156
|
-
assertUncontrolledCodeViewAction(controlled
|
|
152
|
+
const { controlled, instance } = cachedDataRef.current;
|
|
153
|
+
assertUncontrolledCodeViewAction(controlled, "updateItem");
|
|
157
154
|
if (instance == null) {
|
|
158
155
|
console.error("CodeView.updateItem: no valid instance to update item with", item);
|
|
159
156
|
return false;
|
|
@@ -161,8 +158,8 @@ function CodeViewInner(props, ref) {
|
|
|
161
158
|
return instance.updateItem(item);
|
|
162
159
|
},
|
|
163
160
|
updateItemId(oldId, newId) {
|
|
164
|
-
const { controlled
|
|
165
|
-
assertUncontrolledCodeViewAction(controlled
|
|
161
|
+
const { controlled, instance } = cachedDataRef.current;
|
|
162
|
+
assertUncontrolledCodeViewAction(controlled, "updateItemId");
|
|
166
163
|
if (instance == null) {
|
|
167
164
|
console.error("CodeView.updateItemId: no valid instance to update item id with", oldId, newId);
|
|
168
165
|
return false;
|
|
@@ -261,7 +258,7 @@ function createManagedCodeViewOptions({ options, hasCustomHeader, hasGutterRende
|
|
|
261
258
|
if (hasGutterRenderer) options.renderGutterUtility = noopRender;
|
|
262
259
|
return options;
|
|
263
260
|
}
|
|
264
|
-
const SlotPortals = memo(function SlotPortals
|
|
261
|
+
const SlotPortals = memo(function SlotPortals({ managedContentStore, renderCustomHeader, renderHeaderPrefix, renderHeaderMetadata, renderAnnotation, renderGutterUtility }) {
|
|
265
262
|
const subscribe = useStableCallback((listener) => managedContentStore.subscribe(listener));
|
|
266
263
|
const getSnapshot = useStableCallback(() => managedContentStore.getSnapshot());
|
|
267
264
|
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot)?.map((renderedItem) => {
|
|
@@ -303,7 +300,7 @@ function renderCodeViewItemChildren({ renderedItem, renderCustomHeader, renderHe
|
|
|
303
300
|
}
|
|
304
301
|
}
|
|
305
302
|
function noopRender() {}
|
|
306
|
-
|
|
307
303
|
//#endregion
|
|
308
304
|
export { CodeView };
|
|
305
|
+
|
|
309
306
|
//# sourceMappingURL=CodeView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeView.js","names":["CodeViewClass","slotCoordinator: CodeViewCoordinator<LAnnotation> | undefined","controlled","snapshot: CodeViewRenderedItem<LAnnotation>[] | undefined","SlotPortals"],"sources":["../../src/react/CodeView.tsx"],"sourcesContent":["'use client';\n\nimport {\n type CSSProperties,\n forwardRef,\n memo,\n type ReactNode,\n type Ref,\n useContext,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n} from 'react';\nimport { createPortal, flushSync } from 'react-dom';\n\nimport {\n areOptionsEqual,\n CodeView as CodeViewClass,\n type CodeViewCoordinator,\n type CodeViewItem,\n type CodeViewLineSelection,\n type CodeViewOptions,\n type CodeViewRenderedItem,\n type CodeViewScrollTarget,\n type DiffLineAnnotation,\n type GetHoveredLineResult,\n type LineAnnotation,\n} from '../index';\nimport { areManagedSnapshotsEqual } from '../utils/areManagedSnapshotsEqual';\nimport { renderDiffChildren } from './utils/renderDiffChildren';\nimport { renderFileChildren } from './utils/renderFileChildren';\nimport { useStableCallback } from './utils/useStableCallback';\nimport { WorkerPoolContext } from './WorkerPoolContext';\n\nconst useIsometricEffect =\n typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\ntype CodeViewGutterUtilityGetter =\n | (() => GetHoveredLineResult<'file'> | undefined)\n | (() => GetHoveredLineResult<'diff'> | undefined);\n\ninterface CodeViewBaseProps<LAnnotation> {\n options?: CodeViewOptions<LAnnotation>;\n className?: string;\n style?: CSSProperties;\n containerRef?: Ref<HTMLDivElement>;\n disableWorkerPool?: boolean;\n selectedLines?: CodeViewLineSelection | null;\n onSelectedLinesChange?(selection: CodeViewLineSelection | null): void;\n onScroll?(scrollTop: number, viewer: CodeViewClass<LAnnotation>): void;\n renderCustomHeader?(item: CodeViewItem<LAnnotation>): ReactNode;\n renderHeaderPrefix?(item: CodeViewItem<LAnnotation>): ReactNode;\n renderHeaderMetadata?(item: CodeViewItem<LAnnotation>): ReactNode;\n renderAnnotation?(\n annotation: LineAnnotation<LAnnotation> | DiffLineAnnotation<LAnnotation>,\n item: CodeViewItem<LAnnotation>\n ): ReactNode;\n renderGutterUtility?(\n getHoveredLine: CodeViewGutterUtilityGetter,\n item: CodeViewItem<LAnnotation>\n ): ReactNode;\n}\n\nexport interface ControlledCodeViewProps<\n LAnnotation,\n> extends CodeViewBaseProps<LAnnotation> {\n items: readonly CodeViewItem<LAnnotation>[];\n initialItems?: never;\n}\n\nexport interface UncontrolledCodeViewProps<\n LAnnotation,\n> extends CodeViewBaseProps<LAnnotation> {\n // Seeds the imperative CodeView instance once. Later item changes should go\n // through the ref API instead of being reconciled from React props.\n initialItems?: readonly CodeViewItem<LAnnotation>[];\n items?: never;\n}\n\nexport type CodeViewProps<LAnnotation = undefined> =\n | ControlledCodeViewProps<LAnnotation>\n | UncontrolledCodeViewProps<LAnnotation>;\n\nexport interface CodeViewHandle<LAnnotation> {\n addItems(items: readonly CodeViewItem<LAnnotation>[]): void;\n getItem(id: string): CodeViewItem<LAnnotation> | undefined;\n updateItem(item: CodeViewItem<LAnnotation>): boolean;\n updateItemId(oldId: string, newId: string): boolean;\n scrollTo(target: CodeViewScrollTarget): void;\n setSelectedLines(selection: CodeViewLineSelection | null): void;\n getSelectedLines(): CodeViewLineSelection | null;\n clearSelectedLines(): void;\n getInstance(): CodeViewClass<LAnnotation> | undefined;\n}\n\ntype CodeViewComponent = <LAnnotation = undefined>(\n props: CodeViewProps<LAnnotation> & {\n ref?: React.Ref<CodeViewHandle<LAnnotation>>;\n }\n) => React.JSX.Element;\n\ntype SlotPortalsComponent = <LAnnotation = undefined>(\n props: SlotPortalsProps<LAnnotation>\n) => React.JSX.Element;\n\ninterface ManagedContentStore<LAnnotation> {\n getSnapshot(): CodeViewRenderedItem<LAnnotation>[] | undefined;\n publish(snapshot: CodeViewRenderedItem<LAnnotation>[] | undefined): void;\n subscribe(listener: () => void): () => void;\n}\n\ninterface CachedDataRef<LAnnotation> {\n instance: CodeViewClass<LAnnotation> | undefined;\n items: readonly CodeViewItem<LAnnotation>[] | undefined;\n controlled: boolean;\n managedOptions: CodeViewOptions<LAnnotation> | undefined;\n disableFlushSync: boolean;\n slotCoordinator: CodeViewCoordinator<LAnnotation> | undefined;\n}\n\nfunction createDefaultCache<LAnnotation>(\n controlled: boolean\n): CachedDataRef<LAnnotation> {\n return {\n instance: undefined,\n items: undefined,\n controlled,\n managedOptions: undefined,\n disableFlushSync: false,\n slotCoordinator: undefined,\n };\n}\n\nfunction CodeViewInner<LAnnotation = undefined>(\n props: CodeViewProps<LAnnotation>,\n ref: React.ForwardedRef<CodeViewHandle<LAnnotation>>\n): React.JSX.Element {\n const {\n className,\n containerRef,\n disableWorkerPool = false,\n initialItems,\n items: controlledItems,\n onScroll,\n onSelectedLinesChange,\n options,\n renderAnnotation,\n renderCustomHeader,\n renderGutterUtility,\n renderHeaderMetadata,\n renderHeaderPrefix,\n selectedLines,\n style,\n } = props;\n const controlled = controlledItems !== undefined;\n const poolManager = useContext(WorkerPoolContext);\n const cachedDataRef = useRef<CachedDataRef<LAnnotation>>(\n createDefaultCache<LAnnotation>(controlled)\n );\n const hasCustomHeader = renderCustomHeader != null;\n const hasAnnotationRenderer = renderAnnotation != null;\n const hasGutterRenderer = renderGutterUtility != null;\n const hasHeaderRenderers =\n hasCustomHeader ||\n renderHeaderPrefix != null ||\n renderHeaderMetadata != null;\n const hasRenderers =\n hasHeaderRenderers || hasAnnotationRenderer || hasGutterRenderer;\n const emitSelectedLinesChange = useStableCallback(\n (selection: CodeViewLineSelection | null) => {\n onSelectedLinesChange?.(selection);\n }\n );\n const controlledSelection = selectedLines !== undefined;\n\n const managedOptions = useMemo(\n () =>\n createManagedCodeViewOptions({\n options,\n hasCustomHeader,\n hasGutterRenderer,\n onSelectedLinesChange:\n onSelectedLinesChange != null ? emitSelectedLinesChange : undefined,\n controlledSelection,\n }),\n [\n options,\n hasCustomHeader,\n hasGutterRenderer,\n onSelectedLinesChange,\n emitSelectedLinesChange,\n controlledSelection,\n ]\n );\n\n const [slotContentStore] = useState<ManagedContentStore<LAnnotation>>(() =>\n createSlotContentStore()\n );\n const [, forceUpdate] = useState<unknown>({});\n\n const nodeRef = useStableCallback((node: HTMLDivElement | null) => {\n // If we have a pre-existing instance and there's no node or the node being\n // passed in is NOT the same as before, then we need to clean up and\n // garbage collect the old instance\n if (\n cachedDataRef.current.instance != null &&\n (node == null ||\n node !== cachedDataRef.current.instance.getContainerElement())\n ) {\n cachedDataRef.current.instance.cleanUp();\n slotContentStore.publish(undefined);\n cachedDataRef.current = createDefaultCache<LAnnotation>(controlled);\n }\n\n // If our node matches the existing node then we should not attempt to\n // setup. This is a case that should never be possible to hit, but just in\n // case, lets make sure we don't re-setup an instance that is already setup\n // properly\n if (\n node != null &&\n node !== cachedDataRef.current.instance?.getContainerElement()\n ) {\n cachedDataRef.current.instance = new CodeViewClass<LAnnotation>(\n managedOptions,\n !disableWorkerPool ? poolManager : undefined,\n true\n );\n cachedDataRef.current.instance.setup(node);\n }\n\n if (typeof containerRef === 'function') {\n containerRef(node);\n } else if (containerRef != null) {\n containerRef.current = node;\n }\n });\n\n const onSnapshotChange = useStableCallback(\n (snapshot: CodeViewRenderedItem<LAnnotation>[] | undefined) => {\n if (cachedDataRef.current.disableFlushSync) {\n slotContentStore.publish(snapshot);\n } else {\n flushSync(() => {\n slotContentStore.publish(snapshot);\n });\n }\n }\n );\n\n const slotCoordinator: CodeViewCoordinator<LAnnotation> | undefined =\n useMemo(() => {\n if (!hasHeaderRenderers && !hasAnnotationRenderer && !hasGutterRenderer) {\n return undefined;\n } else {\n return {\n hasHeaderRenderers,\n hasAnnotationRenderer,\n hasGutterRenderer,\n onSnapshotChange,\n };\n }\n }, [\n onSnapshotChange,\n hasAnnotationRenderer,\n hasGutterRenderer,\n hasHeaderRenderers,\n ]);\n\n useIsometricEffect(() => {\n return onScroll != null\n ? cachedDataRef.current.instance?.subscribeToScroll(onScroll)\n : undefined;\n });\n\n useIsometricEffect(() => {\n const {\n instance,\n controlled: prevControlled,\n items: prevItems,\n managedOptions: prevManagedOptions,\n slotCoordinator: prevSlotCoordinator,\n } = cachedDataRef.current;\n if (instance == null) {\n return;\n }\n\n try {\n cachedDataRef.current.disableFlushSync = true;\n let shouldRender = false;\n\n if (!areOptionsEqual(managedOptions, prevManagedOptions)) {\n cachedDataRef.current.managedOptions = managedOptions;\n instance.setOptions(managedOptions);\n shouldRender = true;\n }\n\n if (prevControlled !== controlled) {\n console.error(\n 'CodeView: cannot switch between controlled and uncontrolled modes. Remount with a new key instead.'\n );\n return;\n }\n\n if (controlled) {\n if (controlledItems !== prevItems) {\n if (areItemListsEqual(prevItems, controlledItems)) {\n cachedDataRef.current.items = controlledItems;\n } else if (isAppendOnlyItemUpdate(prevItems, controlledItems)) {\n cachedDataRef.current.items = controlledItems;\n instance.addItems(controlledItems.slice(prevItems.length));\n } else {\n cachedDataRef.current.items = controlledItems;\n instance.setItems(controlledItems);\n shouldRender = true;\n }\n }\n }\n // If uncontrolled, we should only ever set items once, and just depend\n // on imperative instance changes going forward\n else if (prevItems == null) {\n const seedItems = initialItems ?? [];\n cachedDataRef.current.items = seedItems;\n if (seedItems.length > 0) {\n instance.setItems(seedItems);\n shouldRender = true;\n }\n }\n\n if (selectedLines !== undefined) {\n instance.setSelectedLines(selectedLines, { notify: false });\n }\n\n const slotPublish = instance.setSlotCoordinator(slotCoordinator);\n let forceInlinePublish = false;\n if (slotCoordinator !== prevSlotCoordinator) {\n if (slotCoordinator == null || prevSlotCoordinator == null) {\n forceInlinePublish = true;\n }\n cachedDataRef.current.slotCoordinator = slotCoordinator;\n }\n\n if (shouldRender || slotPublish) {\n instance.render(true);\n }\n\n // FIXME(amadeus): This feels kinda bad and flakey with regards to how\n // other things are working... it makes me think that we should\n // re-architect the slotCoordinator a bit, and maybe DON'T make it an\n // undefineable thing...\n if (slotPublish && slotCoordinator == null) {\n slotContentStore.publish(undefined);\n }\n\n if (forceInlinePublish) {\n forceUpdate({});\n }\n } finally {\n cachedDataRef.current.disableFlushSync = false;\n }\n });\n\n // Setup the ref handler\n useImperativeHandle(\n ref,\n (): CodeViewHandle<LAnnotation> => ({\n addItems(items) {\n const { controlled, instance } = cachedDataRef.current;\n assertUncontrolledCodeViewAction(controlled, 'addItems');\n if (instance == null) {\n console.error(\n 'CodeView.addItems: no valid instance to append items with',\n items\n );\n } else {\n instance.addItems(items);\n }\n },\n getItem(id) {\n const { instance } = cachedDataRef.current;\n if (instance == null) {\n console.error('CodeView.getItem: no valid instance exists', id);\n return undefined;\n } else {\n return instance.getItem(id);\n }\n },\n updateItem(item) {\n const { controlled, instance } = cachedDataRef.current;\n assertUncontrolledCodeViewAction(controlled, 'updateItem');\n if (instance == null) {\n console.error(\n 'CodeView.updateItem: no valid instance to update item with',\n item\n );\n return false;\n }\n\n return instance.updateItem(item);\n },\n updateItemId(oldId, newId) {\n const { controlled, instance } = cachedDataRef.current;\n assertUncontrolledCodeViewAction(controlled, 'updateItemId');\n if (instance == null) {\n console.error(\n 'CodeView.updateItemId: no valid instance to update item id with',\n oldId,\n newId\n );\n return false;\n }\n\n return instance.updateItemId(oldId, newId);\n },\n scrollTo(target) {\n const { instance } = cachedDataRef.current;\n if (instance == null) {\n console.error(\n 'CodeView.scrollTo: no valid instance to scroll with',\n target\n );\n } else {\n instance.scrollTo(target);\n }\n },\n setSelectedLines(selection) {\n const { instance } = cachedDataRef.current;\n if (instance == null) {\n console.error(\n 'CodeView.setSelectedLines: no valid instance to update selection with',\n selection\n );\n } else {\n instance.setSelectedLines(selection, { notify: false });\n emitSelectedLinesChange(selection);\n }\n },\n getSelectedLines() {\n const { instance } = cachedDataRef.current;\n if (instance == null) {\n console.error('CodeView.getSelectedLines: no valid instance exists');\n return null;\n } else {\n return instance.getSelectedLines();\n }\n },\n clearSelectedLines() {\n const { instance } = cachedDataRef.current;\n if (instance == null) {\n console.error(\n 'CodeView.clearSelectedLines: no valid instance to update selection with'\n );\n } else {\n instance.clearSelectedLines({ notify: false });\n emitSelectedLinesChange(null);\n }\n },\n getInstance() {\n return cachedDataRef.current.instance;\n },\n }),\n [emitSelectedLinesChange]\n );\n\n return (\n <>\n <div ref={nodeRef} className={className} style={style} />\n {hasRenderers && (\n <SlotPortals<LAnnotation>\n managedContentStore={slotContentStore}\n renderCustomHeader={renderCustomHeader}\n renderHeaderPrefix={renderHeaderPrefix}\n renderHeaderMetadata={renderHeaderMetadata}\n renderAnnotation={renderAnnotation}\n renderGutterUtility={renderGutterUtility}\n />\n )}\n </>\n );\n}\n\n// React was a mistake\nexport const CodeView = forwardRef(CodeViewInner) as CodeViewComponent;\n\nfunction isAppendOnlyItemUpdate<LAnnotation>(\n previousItems: readonly CodeViewItem<LAnnotation>[] | undefined,\n nextItems: readonly CodeViewItem<LAnnotation>[]\n): previousItems is readonly CodeViewItem<LAnnotation>[] {\n if (previousItems == null || nextItems.length <= previousItems.length) {\n return false;\n }\n\n if (previousItems.length === 0) {\n return true;\n }\n\n for (let index = 0; index < previousItems.length; index++) {\n if (nextItems[index] !== previousItems[index]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction areItemListsEqual<LAnnotation>(\n previousItems: readonly CodeViewItem<LAnnotation>[] | undefined,\n nextItems: readonly CodeViewItem<LAnnotation>[]\n): boolean {\n if (previousItems == null || previousItems.length !== nextItems.length) {\n return false;\n }\n\n for (let index = 0; index < previousItems.length; index++) {\n if (previousItems[index] !== nextItems[index]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction assertUncontrolledCodeViewAction(\n controlled: boolean,\n action: string\n): void {\n if (!controlled) {\n return;\n }\n\n throw new Error(\n `CodeView.${action} cannot be used when CodeView is controlled. Use initialItems for imperative item updates.`\n );\n}\n\nfunction createSlotContentStore<\n LAnnotation,\n>(): ManagedContentStore<LAnnotation> {\n let snapshot: CodeViewRenderedItem<LAnnotation>[] | undefined;\n const listeners = new Set<() => void>();\n\n return {\n getSnapshot() {\n return snapshot;\n },\n publish(nextSnapshot) {\n if (areManagedSnapshotsEqual(snapshot, nextSnapshot)) {\n return;\n }\n\n snapshot = nextSnapshot;\n for (const listener of listeners) {\n listener();\n }\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n\ninterface CreateManagedCodeViewOptionsProps<LAnnotation> {\n options: CodeViewOptions<LAnnotation> | undefined;\n hasCustomHeader: boolean;\n hasGutterRenderer: boolean;\n onSelectedLinesChange?(selection: CodeViewLineSelection | null): void;\n controlledSelection: boolean;\n}\n\nfunction createManagedCodeViewOptions<LAnnotation>({\n options,\n hasCustomHeader,\n hasGutterRenderer,\n onSelectedLinesChange,\n controlledSelection,\n}: CreateManagedCodeViewOptionsProps<LAnnotation>):\n | CodeViewOptions<LAnnotation>\n | undefined {\n if (\n !hasCustomHeader &&\n !hasGutterRenderer &&\n onSelectedLinesChange == null &&\n !controlledSelection\n ) {\n return options;\n }\n options = { ...options, controlledSelection, onSelectedLinesChange };\n\n // The imperative CodeView adapters use this callback's presence to\n // switch file and diff headers into custom-slot mode. React portals\n // provide the actual header content, so this placeholder\n // intentionally returns nothing.\n if (hasCustomHeader) {\n options.renderCustomHeader = noopRender;\n }\n\n // The imperative CodeView adapters use this callback's presence to\n // create the custom gutter utility slot. React portals provide the\n // actual content, so this placeholder intentionally returns nothing.\n if (hasGutterRenderer) {\n options.renderGutterUtility = noopRender;\n }\n\n return options;\n}\n\ninterface RenderCodeViewItemChildrenProps<LAnnotation> {\n renderedItem: CodeViewRenderedItem<LAnnotation>;\n renderCustomHeader: CodeViewBaseProps<LAnnotation>['renderCustomHeader'];\n renderHeaderPrefix: CodeViewBaseProps<LAnnotation>['renderHeaderPrefix'];\n renderHeaderMetadata: CodeViewBaseProps<LAnnotation>['renderHeaderMetadata'];\n renderAnnotation: CodeViewBaseProps<LAnnotation>['renderAnnotation'];\n renderGutterUtility: CodeViewBaseProps<LAnnotation>['renderGutterUtility'];\n}\n\ninterface SlotPortalsProps<LAnnotation> {\n managedContentStore: ManagedContentStore<LAnnotation>;\n renderCustomHeader: CodeViewBaseProps<LAnnotation>['renderCustomHeader'];\n renderHeaderPrefix: CodeViewBaseProps<LAnnotation>['renderHeaderPrefix'];\n renderHeaderMetadata: CodeViewBaseProps<LAnnotation>['renderHeaderMetadata'];\n renderAnnotation: CodeViewBaseProps<LAnnotation>['renderAnnotation'];\n renderGutterUtility: CodeViewBaseProps<LAnnotation>['renderGutterUtility'];\n}\n\nconst SlotPortals = memo(function SlotPortals<LAnnotation>({\n managedContentStore,\n renderCustomHeader,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n renderGutterUtility,\n}: SlotPortalsProps<LAnnotation>) {\n const subscribe = useStableCallback((listener: () => void) =>\n managedContentStore.subscribe(listener)\n );\n const getSnapshot = useStableCallback(() =>\n managedContentStore.getSnapshot()\n );\n const renderedItems = useSyncExternalStore<\n CodeViewRenderedItem<LAnnotation>[] | undefined\n >(subscribe, getSnapshot, getSnapshot);\n return renderedItems?.map((renderedItem) => {\n return createPortal(\n renderCodeViewItemChildren({\n renderedItem,\n renderCustomHeader,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n renderGutterUtility,\n }),\n renderedItem.element,\n renderedItem.id\n );\n });\n}) as SlotPortalsComponent;\n\nfunction renderCodeViewItemChildren<LAnnotation>({\n renderedItem,\n renderCustomHeader,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n renderGutterUtility,\n}: RenderCodeViewItemChildrenProps<LAnnotation>): ReactNode {\n if (renderedItem.type === 'diff') {\n const { item, instance } = renderedItem;\n return renderDiffChildren({\n fileDiff: item.fileDiff,\n renderCustomHeader:\n renderCustomHeader != null ? () => renderCustomHeader(item) : undefined,\n renderHeaderPrefix:\n renderHeaderPrefix != null ? () => renderHeaderPrefix(item) : undefined,\n renderHeaderMetadata:\n renderHeaderMetadata != null\n ? () => renderHeaderMetadata(item)\n : undefined,\n renderAnnotation:\n renderAnnotation != null\n ? (annotation) => renderAnnotation(annotation, item)\n : undefined,\n lineAnnotations: item.annotations,\n renderGutterUtility:\n renderGutterUtility != null\n ? (getHoveredLine) => renderGutterUtility(getHoveredLine, item)\n : undefined,\n getHoveredLine: instance.getHoveredLine,\n });\n } else {\n const { item, instance } = renderedItem;\n return renderFileChildren({\n file: item.file,\n renderCustomHeader:\n renderCustomHeader != null ? () => renderCustomHeader(item) : undefined,\n renderHeaderPrefix:\n renderHeaderPrefix != null ? () => renderHeaderPrefix(item) : undefined,\n renderHeaderMetadata:\n renderHeaderMetadata != null\n ? () => renderHeaderMetadata(item)\n : undefined,\n renderAnnotation:\n renderAnnotation != null\n ? (annotation) => renderAnnotation(annotation, item)\n : undefined,\n lineAnnotations: item.annotations,\n renderGutterUtility:\n renderGutterUtility != null\n ? (getHoveredLine) => renderGutterUtility(getHoveredLine, item)\n : undefined,\n getHoveredLine: instance.getHoveredLine,\n });\n }\n}\n\nfunction noopRender() {\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsCA,MAAM,qBACJ,OAAO,WAAW,cAAc,YAAY;AAqF9C,SAAS,mBACP,YAC4B;AAC5B,QAAO;EACL,UAAU;EACV,OAAO;EACP;EACA,gBAAgB;EAChB,kBAAkB;EAClB,iBAAiB;EAClB;;AAGH,SAAS,cACP,OACA,KACmB;CACnB,MAAM,EACJ,WACA,cACA,oBAAoB,OACpB,cACA,OAAO,iBACP,UACA,uBACA,SACA,kBACA,oBACA,qBACA,sBACA,oBACA,eACA,UACE;CACJ,MAAM,aAAa,oBAAoB;CACvC,MAAM,cAAc,WAAW,kBAAkB;CACjD,MAAM,gBAAgB,OACpB,mBAAgC,WAAW,CAC5C;CACD,MAAM,kBAAkB,sBAAsB;CAC9C,MAAM,wBAAwB,oBAAoB;CAClD,MAAM,oBAAoB,uBAAuB;CACjD,MAAM,qBACJ,mBACA,sBAAsB,QACtB,wBAAwB;CAC1B,MAAM,eACJ,sBAAsB,yBAAyB;CACjD,MAAM,0BAA0B,mBAC7B,cAA4C;AAC3C,0BAAwB,UAAU;GAErC;CACD,MAAM,sBAAsB,kBAAkB;CAE9C,MAAM,iBAAiB,cAEnB,6BAA6B;EAC3B;EACA;EACA;EACA,uBACE,yBAAyB,OAAO,0BAA0B;EAC5D;EACD,CAAC,EACJ;EACE;EACA;EACA;EACA;EACA;EACA;EACD,CACF;CAED,MAAM,CAAC,oBAAoB,eACzB,wBAAwB,CACzB;CACD,MAAM,GAAG,eAAe,SAAkB,EAAE,CAAC;CAE7C,MAAM,UAAU,mBAAmB,SAA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GACA;GACA;GACD,CAAC,EACF,aAAa,SACb,aAAa,GACd;GACD;EACF;AAEF,SAAS,2BAAwC,EAC/C,cACA,oBACA,oBACA,sBACA,kBACA,uBAC0D;AAC1D,KAAI,aAAa,SAAS,QAAQ;EAChC,MAAM,EAAE,MAAM,aAAa;AAC3B,SAAO,mBAAmB;GACxB,UAAU,KAAK;GACf,oBACE,sBAAsB,aAAa,mBAAmB,KAAK,GAAG;GAChE,oBACE,sBAAsB,aAAa,mBAAmB,KAAK,GAAG;GAChE,sBACE,wBAAwB,aACd,qBAAqB,KAAK,GAChC;GACN,kBACE,oBAAoB,QACf,eAAe,iBAAiB,YAAY,KAAK,GAClD;GACN,iBAAiB,KAAK;GACtB,qBACE,uBAAuB,QAClB,mBAAmB,oBAAoB,gBAAgB,KAAK,GAC7D;GACN,gBAAgB,SAAS;GAC1B,CAAC;QACG;EACL,MAAM,EAAE,MAAM,aAAa;AAC3B,SAAO,mBAAmB;GACxB,MAAM,KAAK;GACX,oBACE,sBAAsB,aAAa,mBAAmB,KAAK,GAAG;GAChE,oBACE,sBAAsB,aAAa,mBAAmB,KAAK,GAAG;GAChE,sBACE,wBAAwB,aACd,qBAAqB,KAAK,GAChC;GACN,kBACE,oBAAoB,QACf,eAAe,iBAAiB,YAAY,KAAK,GAClD;GACN,iBAAiB,KAAK;GACtB,qBACE,uBAAuB,QAClB,mBAAmB,oBAAoB,gBAAgB,KAAK,GAC7D;GACN,gBAAgB,SAAS;GAC1B,CAAC;;;AAIN,SAAS,aAAa"}
|
|
1
|
+
{"version":3,"file":"CodeView.js","names":["CodeViewClass"],"sources":["../../src/react/CodeView.tsx"],"sourcesContent":["'use client';\n\nimport {\n type CSSProperties,\n forwardRef,\n memo,\n type ReactNode,\n type Ref,\n useContext,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n} from 'react';\nimport { createPortal, flushSync } from 'react-dom';\n\nimport {\n areOptionsEqual,\n CodeView as CodeViewClass,\n type CodeViewCoordinator,\n type CodeViewItem,\n type CodeViewLineSelection,\n type CodeViewOptions,\n type CodeViewRenderedItem,\n type CodeViewScrollTarget,\n type DiffLineAnnotation,\n type GetHoveredLineResult,\n type LineAnnotation,\n} from '../index';\nimport { areManagedSnapshotsEqual } from '../utils/areManagedSnapshotsEqual';\nimport { renderDiffChildren } from './utils/renderDiffChildren';\nimport { renderFileChildren } from './utils/renderFileChildren';\nimport { useStableCallback } from './utils/useStableCallback';\nimport { WorkerPoolContext } from './WorkerPoolContext';\n\nconst useIsometricEffect =\n typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\ntype CodeViewGutterUtilityGetter =\n | (() => GetHoveredLineResult<'file'> | undefined)\n | (() => GetHoveredLineResult<'diff'> | undefined);\n\ninterface CodeViewBaseProps<LAnnotation> {\n options?: CodeViewOptions<LAnnotation>;\n className?: string;\n style?: CSSProperties;\n containerRef?: Ref<HTMLDivElement>;\n disableWorkerPool?: boolean;\n selectedLines?: CodeViewLineSelection | null;\n onSelectedLinesChange?(selection: CodeViewLineSelection | null): void;\n onScroll?(scrollTop: number, viewer: CodeViewClass<LAnnotation>): void;\n renderCustomHeader?(item: CodeViewItem<LAnnotation>): ReactNode;\n renderHeaderPrefix?(item: CodeViewItem<LAnnotation>): ReactNode;\n renderHeaderMetadata?(item: CodeViewItem<LAnnotation>): ReactNode;\n renderAnnotation?(\n annotation: LineAnnotation<LAnnotation> | DiffLineAnnotation<LAnnotation>,\n item: CodeViewItem<LAnnotation>\n ): ReactNode;\n renderGutterUtility?(\n getHoveredLine: CodeViewGutterUtilityGetter,\n item: CodeViewItem<LAnnotation>\n ): ReactNode;\n}\n\nexport interface ControlledCodeViewProps<\n LAnnotation,\n> extends CodeViewBaseProps<LAnnotation> {\n items: readonly CodeViewItem<LAnnotation>[];\n initialItems?: never;\n}\n\nexport interface UncontrolledCodeViewProps<\n LAnnotation,\n> extends CodeViewBaseProps<LAnnotation> {\n // Seeds the imperative CodeView instance once. Later item changes should go\n // through the ref API instead of being reconciled from React props.\n initialItems?: readonly CodeViewItem<LAnnotation>[];\n items?: never;\n}\n\nexport type CodeViewProps<LAnnotation = undefined> =\n | ControlledCodeViewProps<LAnnotation>\n | UncontrolledCodeViewProps<LAnnotation>;\n\nexport interface CodeViewHandle<LAnnotation> {\n addItems(items: readonly CodeViewItem<LAnnotation>[]): void;\n getItem(id: string): CodeViewItem<LAnnotation> | undefined;\n updateItem(item: CodeViewItem<LAnnotation>): boolean;\n updateItemId(oldId: string, newId: string): boolean;\n scrollTo(target: CodeViewScrollTarget): void;\n setSelectedLines(selection: CodeViewLineSelection | null): void;\n getSelectedLines(): CodeViewLineSelection | null;\n clearSelectedLines(): void;\n getInstance(): CodeViewClass<LAnnotation> | undefined;\n}\n\ntype CodeViewComponent = <LAnnotation = undefined>(\n props: CodeViewProps<LAnnotation> & {\n ref?: React.Ref<CodeViewHandle<LAnnotation>>;\n }\n) => React.JSX.Element;\n\ntype SlotPortalsComponent = <LAnnotation = undefined>(\n props: SlotPortalsProps<LAnnotation>\n) => React.JSX.Element;\n\ninterface ManagedContentStore<LAnnotation> {\n getSnapshot(): CodeViewRenderedItem<LAnnotation>[] | undefined;\n publish(snapshot: CodeViewRenderedItem<LAnnotation>[] | undefined): void;\n subscribe(listener: () => void): () => void;\n}\n\ninterface CachedDataRef<LAnnotation> {\n instance: CodeViewClass<LAnnotation> | undefined;\n items: readonly CodeViewItem<LAnnotation>[] | undefined;\n controlled: boolean;\n managedOptions: CodeViewOptions<LAnnotation> | undefined;\n disableFlushSync: boolean;\n slotCoordinator: CodeViewCoordinator<LAnnotation> | undefined;\n}\n\nfunction createDefaultCache<LAnnotation>(\n controlled: boolean\n): CachedDataRef<LAnnotation> {\n return {\n instance: undefined,\n items: undefined,\n controlled,\n managedOptions: undefined,\n disableFlushSync: false,\n slotCoordinator: undefined,\n };\n}\n\nfunction CodeViewInner<LAnnotation = undefined>(\n props: CodeViewProps<LAnnotation>,\n ref: React.ForwardedRef<CodeViewHandle<LAnnotation>>\n): React.JSX.Element {\n const {\n className,\n containerRef,\n disableWorkerPool = false,\n initialItems,\n items: controlledItems,\n onScroll,\n onSelectedLinesChange,\n options,\n renderAnnotation,\n renderCustomHeader,\n renderGutterUtility,\n renderHeaderMetadata,\n renderHeaderPrefix,\n selectedLines,\n style,\n } = props;\n const controlled = controlledItems !== undefined;\n const poolManager = useContext(WorkerPoolContext);\n const cachedDataRef = useRef<CachedDataRef<LAnnotation>>(\n createDefaultCache<LAnnotation>(controlled)\n );\n const hasCustomHeader = renderCustomHeader != null;\n const hasAnnotationRenderer = renderAnnotation != null;\n const hasGutterRenderer = renderGutterUtility != null;\n const hasHeaderRenderers =\n hasCustomHeader ||\n renderHeaderPrefix != null ||\n renderHeaderMetadata != null;\n const hasRenderers =\n hasHeaderRenderers || hasAnnotationRenderer || hasGutterRenderer;\n const emitSelectedLinesChange = useStableCallback(\n (selection: CodeViewLineSelection | null) => {\n onSelectedLinesChange?.(selection);\n }\n );\n const controlledSelection = selectedLines !== undefined;\n\n const managedOptions = useMemo(\n () =>\n createManagedCodeViewOptions({\n options,\n hasCustomHeader,\n hasGutterRenderer,\n onSelectedLinesChange:\n onSelectedLinesChange != null ? emitSelectedLinesChange : undefined,\n controlledSelection,\n }),\n [\n options,\n hasCustomHeader,\n hasGutterRenderer,\n onSelectedLinesChange,\n emitSelectedLinesChange,\n controlledSelection,\n ]\n );\n\n const [slotContentStore] = useState<ManagedContentStore<LAnnotation>>(() =>\n createSlotContentStore()\n );\n const [, forceUpdate] = useState<unknown>({});\n\n const nodeRef = useStableCallback((node: HTMLDivElement | null) => {\n // If we have a pre-existing instance and there's no node or the node being\n // passed in is NOT the same as before, then we need to clean up and\n // garbage collect the old instance\n if (\n cachedDataRef.current.instance != null &&\n (node == null ||\n node !== cachedDataRef.current.instance.getContainerElement())\n ) {\n cachedDataRef.current.instance.cleanUp();\n slotContentStore.publish(undefined);\n cachedDataRef.current = createDefaultCache<LAnnotation>(controlled);\n }\n\n // If our node matches the existing node then we should not attempt to\n // setup. This is a case that should never be possible to hit, but just in\n // case, lets make sure we don't re-setup an instance that is already setup\n // properly\n if (\n node != null &&\n node !== cachedDataRef.current.instance?.getContainerElement()\n ) {\n cachedDataRef.current.instance = new CodeViewClass<LAnnotation>(\n managedOptions,\n !disableWorkerPool ? poolManager : undefined,\n true\n );\n cachedDataRef.current.instance.setup(node);\n }\n\n if (typeof containerRef === 'function') {\n containerRef(node);\n } else if (containerRef != null) {\n containerRef.current = node;\n }\n });\n\n const onSnapshotChange = useStableCallback(\n (snapshot: CodeViewRenderedItem<LAnnotation>[] | undefined) => {\n if (cachedDataRef.current.disableFlushSync) {\n slotContentStore.publish(snapshot);\n } else {\n flushSync(() => {\n slotContentStore.publish(snapshot);\n });\n }\n }\n );\n\n const slotCoordinator: CodeViewCoordinator<LAnnotation> | undefined =\n useMemo(() => {\n if (!hasHeaderRenderers && !hasAnnotationRenderer && !hasGutterRenderer) {\n return undefined;\n } else {\n return {\n hasHeaderRenderers,\n hasAnnotationRenderer,\n hasGutterRenderer,\n onSnapshotChange,\n };\n }\n }, [\n onSnapshotChange,\n hasAnnotationRenderer,\n hasGutterRenderer,\n hasHeaderRenderers,\n ]);\n\n useIsometricEffect(() => {\n return onScroll != null\n ? cachedDataRef.current.instance?.subscribeToScroll(onScroll)\n : undefined;\n });\n\n useIsometricEffect(() => {\n const {\n instance,\n controlled: prevControlled,\n items: prevItems,\n managedOptions: prevManagedOptions,\n slotCoordinator: prevSlotCoordinator,\n } = cachedDataRef.current;\n if (instance == null) {\n return;\n }\n\n try {\n cachedDataRef.current.disableFlushSync = true;\n let shouldRender = false;\n\n if (!areOptionsEqual(managedOptions, prevManagedOptions)) {\n cachedDataRef.current.managedOptions = managedOptions;\n instance.setOptions(managedOptions);\n shouldRender = true;\n }\n\n if (prevControlled !== controlled) {\n console.error(\n 'CodeView: cannot switch between controlled and uncontrolled modes. Remount with a new key instead.'\n );\n return;\n }\n\n if (controlled) {\n if (controlledItems !== prevItems) {\n if (areItemListsEqual(prevItems, controlledItems)) {\n cachedDataRef.current.items = controlledItems;\n } else if (isAppendOnlyItemUpdate(prevItems, controlledItems)) {\n cachedDataRef.current.items = controlledItems;\n instance.addItems(controlledItems.slice(prevItems.length));\n } else {\n cachedDataRef.current.items = controlledItems;\n instance.setItems(controlledItems);\n shouldRender = true;\n }\n }\n }\n // If uncontrolled, we should only ever set items once, and just depend\n // on imperative instance changes going forward\n else if (prevItems == null) {\n const seedItems = initialItems ?? [];\n cachedDataRef.current.items = seedItems;\n if (seedItems.length > 0) {\n instance.setItems(seedItems);\n shouldRender = true;\n }\n }\n\n if (selectedLines !== undefined) {\n instance.setSelectedLines(selectedLines, { notify: false });\n }\n\n const slotPublish = instance.setSlotCoordinator(slotCoordinator);\n let forceInlinePublish = false;\n if (slotCoordinator !== prevSlotCoordinator) {\n if (slotCoordinator == null || prevSlotCoordinator == null) {\n forceInlinePublish = true;\n }\n cachedDataRef.current.slotCoordinator = slotCoordinator;\n }\n\n if (shouldRender || slotPublish) {\n instance.render(true);\n }\n\n // FIXME(amadeus): This feels kinda bad and flakey with regards to how\n // other things are working... it makes me think that we should\n // re-architect the slotCoordinator a bit, and maybe DON'T make it an\n // undefineable thing...\n if (slotPublish && slotCoordinator == null) {\n slotContentStore.publish(undefined);\n }\n\n if (forceInlinePublish) {\n forceUpdate({});\n }\n } finally {\n cachedDataRef.current.disableFlushSync = false;\n }\n });\n\n // Setup the ref handler\n useImperativeHandle(\n ref,\n (): CodeViewHandle<LAnnotation> => ({\n addItems(items) {\n const { controlled, instance } = cachedDataRef.current;\n assertUncontrolledCodeViewAction(controlled, 'addItems');\n if (instance == null) {\n console.error(\n 'CodeView.addItems: no valid instance to append items with',\n items\n );\n } else {\n instance.addItems(items);\n }\n },\n getItem(id) {\n const { instance } = cachedDataRef.current;\n if (instance == null) {\n console.error('CodeView.getItem: no valid instance exists', id);\n return undefined;\n } else {\n return instance.getItem(id);\n }\n },\n updateItem(item) {\n const { controlled, instance } = cachedDataRef.current;\n assertUncontrolledCodeViewAction(controlled, 'updateItem');\n if (instance == null) {\n console.error(\n 'CodeView.updateItem: no valid instance to update item with',\n item\n );\n return false;\n }\n\n return instance.updateItem(item);\n },\n updateItemId(oldId, newId) {\n const { controlled, instance } = cachedDataRef.current;\n assertUncontrolledCodeViewAction(controlled, 'updateItemId');\n if (instance == null) {\n console.error(\n 'CodeView.updateItemId: no valid instance to update item id with',\n oldId,\n newId\n );\n return false;\n }\n\n return instance.updateItemId(oldId, newId);\n },\n scrollTo(target) {\n const { instance } = cachedDataRef.current;\n if (instance == null) {\n console.error(\n 'CodeView.scrollTo: no valid instance to scroll with',\n target\n );\n } else {\n instance.scrollTo(target);\n }\n },\n setSelectedLines(selection) {\n const { instance } = cachedDataRef.current;\n if (instance == null) {\n console.error(\n 'CodeView.setSelectedLines: no valid instance to update selection with',\n selection\n );\n } else {\n instance.setSelectedLines(selection, { notify: false });\n emitSelectedLinesChange(selection);\n }\n },\n getSelectedLines() {\n const { instance } = cachedDataRef.current;\n if (instance == null) {\n console.error('CodeView.getSelectedLines: no valid instance exists');\n return null;\n } else {\n return instance.getSelectedLines();\n }\n },\n clearSelectedLines() {\n const { instance } = cachedDataRef.current;\n if (instance == null) {\n console.error(\n 'CodeView.clearSelectedLines: no valid instance to update selection with'\n );\n } else {\n instance.clearSelectedLines({ notify: false });\n emitSelectedLinesChange(null);\n }\n },\n getInstance() {\n return cachedDataRef.current.instance;\n },\n }),\n [emitSelectedLinesChange]\n );\n\n return (\n <>\n <div ref={nodeRef} className={className} style={style} />\n {hasRenderers && (\n <SlotPortals<LAnnotation>\n managedContentStore={slotContentStore}\n renderCustomHeader={renderCustomHeader}\n renderHeaderPrefix={renderHeaderPrefix}\n renderHeaderMetadata={renderHeaderMetadata}\n renderAnnotation={renderAnnotation}\n renderGutterUtility={renderGutterUtility}\n />\n )}\n </>\n );\n}\n\n// React was a mistake\nexport const CodeView = forwardRef(CodeViewInner) as CodeViewComponent;\n\nfunction isAppendOnlyItemUpdate<LAnnotation>(\n previousItems: readonly CodeViewItem<LAnnotation>[] | undefined,\n nextItems: readonly CodeViewItem<LAnnotation>[]\n): previousItems is readonly CodeViewItem<LAnnotation>[] {\n if (previousItems == null || nextItems.length <= previousItems.length) {\n return false;\n }\n\n if (previousItems.length === 0) {\n return true;\n }\n\n for (let index = 0; index < previousItems.length; index++) {\n if (nextItems[index] !== previousItems[index]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction areItemListsEqual<LAnnotation>(\n previousItems: readonly CodeViewItem<LAnnotation>[] | undefined,\n nextItems: readonly CodeViewItem<LAnnotation>[]\n): boolean {\n if (previousItems == null || previousItems.length !== nextItems.length) {\n return false;\n }\n\n for (let index = 0; index < previousItems.length; index++) {\n if (previousItems[index] !== nextItems[index]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction assertUncontrolledCodeViewAction(\n controlled: boolean,\n action: string\n): void {\n if (!controlled) {\n return;\n }\n\n throw new Error(\n `CodeView.${action} cannot be used when CodeView is controlled. Use initialItems for imperative item updates.`\n );\n}\n\nfunction createSlotContentStore<\n LAnnotation,\n>(): ManagedContentStore<LAnnotation> {\n let snapshot: CodeViewRenderedItem<LAnnotation>[] | undefined;\n const listeners = new Set<() => void>();\n\n return {\n getSnapshot() {\n return snapshot;\n },\n publish(nextSnapshot) {\n if (areManagedSnapshotsEqual(snapshot, nextSnapshot)) {\n return;\n }\n\n snapshot = nextSnapshot;\n for (const listener of listeners) {\n listener();\n }\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n\ninterface CreateManagedCodeViewOptionsProps<LAnnotation> {\n options: CodeViewOptions<LAnnotation> | undefined;\n hasCustomHeader: boolean;\n hasGutterRenderer: boolean;\n onSelectedLinesChange?(selection: CodeViewLineSelection | null): void;\n controlledSelection: boolean;\n}\n\nfunction createManagedCodeViewOptions<LAnnotation>({\n options,\n hasCustomHeader,\n hasGutterRenderer,\n onSelectedLinesChange,\n controlledSelection,\n}: CreateManagedCodeViewOptionsProps<LAnnotation>):\n | CodeViewOptions<LAnnotation>\n | undefined {\n if (\n !hasCustomHeader &&\n !hasGutterRenderer &&\n onSelectedLinesChange == null &&\n !controlledSelection\n ) {\n return options;\n }\n options = { ...options, controlledSelection, onSelectedLinesChange };\n\n // The imperative CodeView adapters use this callback's presence to\n // switch file and diff headers into custom-slot mode. React portals\n // provide the actual header content, so this placeholder\n // intentionally returns nothing.\n if (hasCustomHeader) {\n options.renderCustomHeader = noopRender;\n }\n\n // The imperative CodeView adapters use this callback's presence to\n // create the custom gutter utility slot. React portals provide the\n // actual content, so this placeholder intentionally returns nothing.\n if (hasGutterRenderer) {\n options.renderGutterUtility = noopRender;\n }\n\n return options;\n}\n\ninterface RenderCodeViewItemChildrenProps<LAnnotation> {\n renderedItem: CodeViewRenderedItem<LAnnotation>;\n renderCustomHeader: CodeViewBaseProps<LAnnotation>['renderCustomHeader'];\n renderHeaderPrefix: CodeViewBaseProps<LAnnotation>['renderHeaderPrefix'];\n renderHeaderMetadata: CodeViewBaseProps<LAnnotation>['renderHeaderMetadata'];\n renderAnnotation: CodeViewBaseProps<LAnnotation>['renderAnnotation'];\n renderGutterUtility: CodeViewBaseProps<LAnnotation>['renderGutterUtility'];\n}\n\ninterface SlotPortalsProps<LAnnotation> {\n managedContentStore: ManagedContentStore<LAnnotation>;\n renderCustomHeader: CodeViewBaseProps<LAnnotation>['renderCustomHeader'];\n renderHeaderPrefix: CodeViewBaseProps<LAnnotation>['renderHeaderPrefix'];\n renderHeaderMetadata: CodeViewBaseProps<LAnnotation>['renderHeaderMetadata'];\n renderAnnotation: CodeViewBaseProps<LAnnotation>['renderAnnotation'];\n renderGutterUtility: CodeViewBaseProps<LAnnotation>['renderGutterUtility'];\n}\n\nconst SlotPortals = memo(function SlotPortals<LAnnotation>({\n managedContentStore,\n renderCustomHeader,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n renderGutterUtility,\n}: SlotPortalsProps<LAnnotation>) {\n const subscribe = useStableCallback((listener: () => void) =>\n managedContentStore.subscribe(listener)\n );\n const getSnapshot = useStableCallback(() =>\n managedContentStore.getSnapshot()\n );\n const renderedItems = useSyncExternalStore<\n CodeViewRenderedItem<LAnnotation>[] | undefined\n >(subscribe, getSnapshot, getSnapshot);\n return renderedItems?.map((renderedItem) => {\n return createPortal(\n renderCodeViewItemChildren({\n renderedItem,\n renderCustomHeader,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n renderGutterUtility,\n }),\n renderedItem.element,\n renderedItem.id\n );\n });\n}) as SlotPortalsComponent;\n\nfunction renderCodeViewItemChildren<LAnnotation>({\n renderedItem,\n renderCustomHeader,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n renderGutterUtility,\n}: RenderCodeViewItemChildrenProps<LAnnotation>): ReactNode {\n if (renderedItem.type === 'diff') {\n const { item, instance } = renderedItem;\n return renderDiffChildren({\n fileDiff: item.fileDiff,\n renderCustomHeader:\n renderCustomHeader != null ? () => renderCustomHeader(item) : undefined,\n renderHeaderPrefix:\n renderHeaderPrefix != null ? () => renderHeaderPrefix(item) : undefined,\n renderHeaderMetadata:\n renderHeaderMetadata != null\n ? () => renderHeaderMetadata(item)\n : undefined,\n renderAnnotation:\n renderAnnotation != null\n ? (annotation) => renderAnnotation(annotation, item)\n : undefined,\n lineAnnotations: item.annotations,\n renderGutterUtility:\n renderGutterUtility != null\n ? (getHoveredLine) => renderGutterUtility(getHoveredLine, item)\n : undefined,\n getHoveredLine: instance.getHoveredLine,\n });\n } else {\n const { item, instance } = renderedItem;\n return renderFileChildren({\n file: item.file,\n renderCustomHeader:\n renderCustomHeader != null ? () => renderCustomHeader(item) : undefined,\n renderHeaderPrefix:\n renderHeaderPrefix != null ? () => renderHeaderPrefix(item) : undefined,\n renderHeaderMetadata:\n renderHeaderMetadata != null\n ? () => renderHeaderMetadata(item)\n : undefined,\n renderAnnotation:\n renderAnnotation != null\n ? (annotation) => renderAnnotation(annotation, item)\n : undefined,\n lineAnnotations: item.annotations,\n renderGutterUtility:\n renderGutterUtility != null\n ? (getHoveredLine) => renderGutterUtility(getHoveredLine, item)\n : undefined,\n getHoveredLine: instance.getHoveredLine,\n });\n }\n}\n\nfunction noopRender() {\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;;AAsCA,MAAM,qBACJ,OAAO,WAAW,cAAc,YAAY;AAqF9C,SAAS,mBACP,YAC4B;CAC5B,OAAO;EACL,UAAU,KAAA;EACV,OAAO,KAAA;EACP;EACA,gBAAgB,KAAA;EAChB,kBAAkB;EAClB,iBAAiB,KAAA;CACnB;AACF;AAEA,SAAS,cACP,OACA,KACmB;CACnB,MAAM,EACJ,WACA,cACA,oBAAoB,OACpB,cACA,OAAO,iBACP,UACA,uBACA,SACA,kBACA,oBACA,qBACA,sBACA,oBACA,eACA,UACE;CACJ,MAAM,aAAa,oBAAoB,KAAA;CACvC,MAAM,cAAc,WAAW,iBAAiB;CAChD,MAAM,gBAAgB,OACpB,mBAAgC,UAAU,CAC5C;CACA,MAAM,kBAAkB,sBAAsB;CAC9C,MAAM,wBAAwB,oBAAoB;CAClD,MAAM,oBAAoB,uBAAuB;CACjD,MAAM,qBACJ,mBACA,sBAAsB,QACtB,wBAAwB;CAC1B,MAAM,eACJ,sBAAsB,yBAAyB;CACjD,MAAM,0BAA0B,mBAC7B,cAA4C;EAC3C,wBAAwB,SAAS;CACnC,CACF;CACA,MAAM,sBAAsB,kBAAkB,KAAA;CAE9C,MAAM,iBAAiB,cAEnB,6BAA6B;EAC3B;EACA;EACA;EACA,uBACE,yBAAyB,OAAO,0BAA0B,KAAA;EAC5D;CACF,CAAC,GACH;EACE;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,MAAM,CAAC,oBAAoB,eACzB,uBAAuB,CACzB;CACA,MAAM,GAAG,eAAe,SAAkB,CAAC,CAAC;CAE5C,MAAM,UAAU,mBAAmB,SAAgC;EAIjE,IACE,c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3B,CAAC;CACH;AACF;AAEA,SAAS,aAAa,CAEtB"}
|
package/dist/react/File.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"File.d.ts","names":[],"sources":["../../src/react/File.tsx"],"mappings":";;;;iBAWgB,IAAA;EACd,IAAA;EACA,eAAA;EACA,aAAA;EACA,OAAA;EACA,OAAA;EACA,SAAA;EACA,KAAA;EACA,gBAAA;EACA,kBAAA;EACA,kBAAA;EACA,oBAAA;EACA,eAAA;EACA,mBAAA;EACA;AAAA,GACC,SAAA,CAAU,WAAA,IAAe,KAAA,CAAM,GAAA,CAAI,OAAA"}
|