@pierre/diffs 1.3.0-beta.5 → 1.3.0-beta.7
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 +13 -11
- package/dist/components/CodeView.d.ts.map +1 -1
- package/dist/components/CodeView.js +53 -14
- package/dist/components/CodeView.js.map +1 -1
- package/dist/components/File.d.ts +4 -5
- package/dist/components/File.d.ts.map +1 -1
- package/dist/components/File.js +37 -19
- package/dist/components/File.js.map +1 -1
- package/dist/components/FileDiff.d.ts +49 -36
- package/dist/components/FileDiff.d.ts.map +1 -1
- package/dist/components/FileDiff.js +173 -75
- 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 +3 -3
- 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 +22 -25
- package/dist/components/VirtualizedFile.js.map +1 -1
- package/dist/components/VirtualizedFileDiff.d.ts +12 -7
- package/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
- package/dist/components/VirtualizedFileDiff.js +192 -64
- 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 +3 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -2
- package/dist/constants.js.map +1 -1
- package/dist/editor/command.d.ts +2 -1
- package/dist/editor/command.d.ts.map +1 -1
- package/dist/editor/command.js +7 -3
- package/dist/editor/command.js.map +1 -1
- package/dist/editor/editStack.d.ts +7 -1
- package/dist/editor/editStack.d.ts.map +1 -1
- package/dist/editor/editStack.js +3 -3
- package/dist/editor/editStack.js.map +1 -1
- package/dist/editor/editor.d.ts +28 -4
- package/dist/editor/editor.d.ts.map +1 -1
- package/dist/editor/editor.js +669 -313
- package/dist/editor/editor.js.map +1 -1
- package/dist/editor/editor2.js +3 -3
- package/dist/editor/editor2.js.map +1 -1
- package/dist/editor/index.js +1 -2
- package/dist/editor/lineAnnotations.d.ts.map +1 -1
- package/dist/editor/lineAnnotations.js +2 -3
- package/dist/editor/lineAnnotations.js.map +1 -1
- package/dist/editor/marker.d.ts +2 -1
- package/dist/editor/marker.d.ts.map +1 -1
- package/dist/editor/marker.js +28 -11
- package/dist/editor/marker.js.map +1 -1
- package/dist/editor/pieceTable.d.ts +4 -2
- package/dist/editor/pieceTable.d.ts.map +1 -1
- package/dist/editor/pieceTable.js +138 -128
- package/dist/editor/pieceTable.js.map +1 -1
- package/dist/editor/platform.d.ts +8 -1
- package/dist/editor/platform.d.ts.map +1 -1
- package/dist/editor/platform.js +16 -5
- package/dist/editor/platform.js.map +1 -1
- package/dist/editor/searchPanel.d.ts +1 -0
- package/dist/editor/searchPanel.d.ts.map +1 -1
- package/dist/editor/searchPanel.js +75 -62
- package/dist/editor/searchPanel.js.map +1 -1
- package/dist/editor/selection.d.ts +42 -5
- package/dist/editor/selection.d.ts.map +1 -1
- package/dist/editor/selection.js +504 -114
- package/dist/editor/selection.js.map +1 -1
- package/dist/editor/selectionAction.d.ts +4 -5
- package/dist/editor/selectionAction.d.ts.map +1 -1
- package/dist/editor/selectionAction.js +14 -64
- package/dist/editor/selectionAction.js.map +1 -1
- package/dist/editor/sprite.d.ts +2 -2
- package/dist/editor/sprite.d.ts.map +1 -1
- package/dist/editor/sprite.js +7 -14
- package/dist/editor/sprite.js.map +1 -1
- package/dist/editor/textDocument.d.ts +5 -4
- package/dist/editor/textDocument.d.ts.map +1 -1
- package/dist/editor/textDocument.js +26 -15
- package/dist/editor/textDocument.js.map +1 -1
- package/dist/editor/textMeasure.d.ts +36 -3
- package/dist/editor/textMeasure.d.ts.map +1 -1
- package/dist/editor/textMeasure.js +104 -17
- package/dist/editor/textMeasure.js.map +1 -1
- package/dist/editor/tokenzier.d.ts +3 -0
- package/dist/editor/tokenzier.d.ts.map +1 -1
- package/dist/editor/tokenzier.js +27 -16
- package/dist/editor/tokenzier.js.map +1 -1
- package/dist/editor/utils.d.ts +4 -1
- package/dist/editor/utils.d.ts.map +1 -1
- package/dist/editor/utils.js +19 -3
- package/dist/editor/utils.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 +12 -10
- package/dist/index.js +4 -3
- package/dist/managers/InteractionManager.d.ts +7 -0
- package/dist/managers/InteractionManager.d.ts.map +1 -1
- package/dist/managers/InteractionManager.js +25 -4
- 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 +1 -1
- package/dist/react/CodeView.d.ts.map +1 -1
- package/dist/react/CodeView.js +17 -16
- package/dist/react/CodeView.js.map +1 -1
- package/dist/react/EditorContext.d.ts +0 -1
- package/dist/react/EditorContext.d.ts.map +1 -1
- package/dist/react/EditorContext.js +2 -5
- package/dist/react/EditorContext.js.map +1 -1
- package/dist/react/File.d.ts +1 -0
- package/dist/react/File.d.ts.map +1 -1
- package/dist/react/File.js +4 -6
- package/dist/react/File.js.map +1 -1
- package/dist/react/FileDiff.d.ts +1 -0
- package/dist/react/FileDiff.d.ts.map +1 -1
- package/dist/react/FileDiff.js +4 -6
- package/dist/react/FileDiff.js.map +1 -1
- package/dist/react/MultiFileDiff.d.ts +4 -4
- package/dist/react/MultiFileDiff.d.ts.map +1 -1
- package/dist/react/MultiFileDiff.js +4 -6
- package/dist/react/MultiFileDiff.js.map +1 -1
- package/dist/react/PatchDiff.d.ts +1 -0
- package/dist/react/PatchDiff.d.ts.map +1 -1
- package/dist/react/PatchDiff.js +4 -6
- package/dist/react/PatchDiff.js.map +1 -1
- package/dist/react/UnresolvedFile.d.ts +2 -1
- package/dist/react/UnresolvedFile.d.ts.map +1 -1
- package/dist/react/UnresolvedFile.js +4 -6
- 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 +2 -2
- 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 +2 -0
- package/dist/react/types.d.ts.map +1 -1
- package/dist/react/utils/renderDiffChildren.d.ts +2 -0
- package/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
- package/dist/react/utils/renderDiffChildren.js +18 -11
- package/dist/react/utils/renderDiffChildren.js.map +1 -1
- package/dist/react/utils/renderFileChildren.d.ts +2 -0
- package/dist/react/utils/renderFileChildren.d.ts.map +1 -1
- package/dist/react/utils/renderFileChildren.js +18 -11
- 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 +15 -18
- 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 +2 -3
- package/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
- package/dist/renderers/DiffHunksRenderer.js +52 -33
- 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 +14 -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 +5 -8
- package/dist/ssr/FileDiffReact.js.map +1 -1
- package/dist/ssr/index.d.ts +2 -2
- package/dist/ssr/index.js +1 -2
- package/dist/ssr/preloadDiffs.d.ts +12 -11
- package/dist/ssr/preloadDiffs.d.ts.map +1 -1
- package/dist/ssr/preloadDiffs.js +15 -8
- 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 +67 -7
- 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 +2 -2
- 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/awaitWithTimeout.d.ts +5 -0
- package/dist/utils/awaitWithTimeout.d.ts.map +1 -0
- package/dist/utils/awaitWithTimeout.js +15 -0
- package/dist/utils/awaitWithTimeout.js.map +1 -0
- 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/cloneFileDiffMetadata.d.ts +7 -0
- package/dist/utils/cloneFileDiffMetadata.d.ts.map +1 -0
- package/dist/utils/cloneFileDiffMetadata.js +16 -0
- package/dist/utils/cloneFileDiffMetadata.js.map +1 -0
- package/dist/utils/computeEstimatedDiffHeights.d.ts +3 -1
- package/dist/utils/computeEstimatedDiffHeights.d.ts.map +1 -1
- package/dist/utils/computeEstimatedDiffHeights.js +9 -3
- package/dist/utils/computeEstimatedDiffHeights.js.map +1 -1
- package/dist/utils/computeFileOffsets.d.ts +9 -1
- package/dist/utils/computeFileOffsets.d.ts.map +1 -1
- package/dist/utils/computeFileOffsets.js +20 -2
- package/dist/utils/computeFileOffsets.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 +6 -3
- 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/getDiffFileInput.d.ts +14 -0
- package/dist/utils/getDiffFileInput.d.ts.map +1 -0
- package/dist/utils/getDiffFileInput.js +24 -0
- package/dist/utils/getDiffFileInput.js.map +1 -0
- package/dist/utils/getDiffHunksRendererOptions.d.ts.map +1 -1
- package/dist/utils/getDiffHunksRendererOptions.js +2 -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 +3 -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/hydratePartialDiff.d.ts +10 -0
- package/dist/utils/hydratePartialDiff.d.ts.map +1 -0
- package/dist/utils/hydratePartialDiff.js +140 -0
- package/dist/utils/hydratePartialDiff.js.map +1 -0
- 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 +47 -48
- package/dist/utils/iterateOverDiff.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 +1 -2
- package/dist/utils/parseDiffFromFile.d.ts.map +1 -1
- package/dist/utils/parseDiffFromFile.js +27 -7
- 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/updateDiffHunks.d.ts +6 -1
- package/dist/utils/updateDiffHunks.d.ts.map +1 -1
- package/dist/utils/updateDiffHunks.js +44 -3
- package/dist/utils/updateDiffHunks.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 +7 -2
- package/dist/worker/WorkerPoolManager.d.ts.map +1 -1
- package/dist/worker/WorkerPoolManager.js +83 -20
- 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.d.ts +2 -2
- package/dist/worker/index.js +1 -2
- package/dist/worker/types.d.ts +7 -1
- 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 +2784 -6406
- package/dist/worker/worker-portable.js.map +1 -1
- package/dist/worker/worker.js +94 -126
- package/dist/worker/worker.js.map +1 -1
- package/package.json +13 -14
- package/dist/worker/wasm-qE0LgnY3.js +0 -10
- package/dist/worker/wasm-qE0LgnY3.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeVirtualFileMetrics.js","names":[],"sources":["../../src/utils/computeVirtualFileMetrics.ts"],"sourcesContent":["import { DEFAULT_VIRTUAL_FILE_METRICS } from '../constants';\nimport type { HunkSeparators, VirtualFileMetrics } from '../types';\n\nexport function computeVirtualFileMetrics(\n metrics?: Partial<VirtualFileMetrics>\n): VirtualFileMetrics {\n return {\n ...DEFAULT_VIRTUAL_FILE_METRICS,\n ...metrics,\n };\n}\n\nexport function getVirtualFileHeaderRegion(\n metrics: VirtualFileMetrics,\n disableFileHeader: boolean\n): number {\n const paddingTop = getVirtualFilePaddingTop(metrics, disableFileHeader);\n return disableFileHeader ? paddingTop : metrics.diffHeaderHeight + paddingTop;\n}\n\nexport function getVirtualFilePaddingTop(\n metrics: VirtualFileMetrics,\n disableFileHeader: boolean\n): number {\n return metrics.paddingTop ?? (disableFileHeader ? metrics.spacing : 0);\n}\n\nexport function getVirtualFilePaddingBottom(\n metrics: VirtualFileMetrics\n): number {\n return metrics.paddingBottom ?? metrics.spacing;\n}\n\nexport function getDefaultHunkSeparatorHeight(type: HunkSeparators): number {\n switch (type) {\n case 'simple':\n return 4;\n case 'metadata':\n case 'line-info':\n case 'line-info-basic':\n case 'custom':\n return 32;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"computeVirtualFileMetrics.js","names":[],"sources":["../../src/utils/computeVirtualFileMetrics.ts"],"sourcesContent":["import { DEFAULT_VIRTUAL_FILE_METRICS } from '../constants';\nimport type { HunkSeparators, VirtualFileMetrics } from '../types';\n\nexport function computeVirtualFileMetrics(\n metrics?: Partial<VirtualFileMetrics>\n): VirtualFileMetrics {\n return {\n ...DEFAULT_VIRTUAL_FILE_METRICS,\n ...metrics,\n };\n}\n\nexport function getVirtualFileHeaderRegion(\n metrics: VirtualFileMetrics,\n disableFileHeader: boolean\n): number {\n const paddingTop = getVirtualFilePaddingTop(metrics, disableFileHeader);\n return disableFileHeader ? paddingTop : metrics.diffHeaderHeight + paddingTop;\n}\n\nexport function getVirtualFilePaddingTop(\n metrics: VirtualFileMetrics,\n disableFileHeader: boolean\n): number {\n return metrics.paddingTop ?? (disableFileHeader ? metrics.spacing : 0);\n}\n\nexport function getVirtualFilePaddingBottom(\n metrics: VirtualFileMetrics\n): number {\n return metrics.paddingBottom ?? metrics.spacing;\n}\n\nexport function getDefaultHunkSeparatorHeight(type: HunkSeparators): number {\n switch (type) {\n case 'simple':\n return 4;\n case 'metadata':\n case 'line-info':\n case 'line-info-basic':\n case 'custom':\n return 32;\n }\n}\n"],"mappings":";;AAGA,SAAgB,0BACd,SACoB;CACpB,OAAO;EACL,GAAG;EACH,GAAG;CACL;AACF;AAEA,SAAgB,2BACd,SACA,mBACQ;CACR,MAAM,aAAa,yBAAyB,SAAS,iBAAiB;CACtE,OAAO,oBAAoB,aAAa,QAAQ,mBAAmB;AACrE;AAEA,SAAgB,yBACd,SACA,mBACQ;CACR,OAAO,QAAQ,eAAe,oBAAoB,QAAQ,UAAU;AACtE;AAEA,SAAgB,4BACd,SACQ;CACR,OAAO,QAAQ,iBAAiB,QAAQ;AAC1C;AAEA,SAAgB,8BAA8B,MAA8B;CAC1E,QAAQ,MAAR;EACE,KAAK,UACH,OAAO;EACT,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,UACH,OAAO;CACX;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { Element } from "../node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.js";
|
|
1
2
|
import { AnnotationSpan } from "../types.js";
|
|
2
|
-
import { Element } from "hast";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/createAnnotationElement.d.ts
|
|
5
5
|
declare function createAnnotationElement(span: AnnotationSpan): Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAnnotationElement.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"createAnnotationElement.d.ts","names":[],"sources":["../../src/utils/createAnnotationElement.ts"],"mappings":";;;;iBAKgB,uBAAA,CAAwB,IAAA,EAAM,cAAA,GAAiB,OAAW"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createHastElement } from "./hast_utils.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/createAnnotationElement.ts
|
|
4
3
|
function createAnnotationElement(span) {
|
|
5
4
|
return createHastElement({
|
|
@@ -15,7 +14,7 @@ function createAnnotationElement(span) {
|
|
|
15
14
|
properties: { "data-line-annotation": `${span.hunkIndex},${span.lineIndex}` }
|
|
16
15
|
});
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
//#endregion
|
|
20
18
|
export { createAnnotationElement };
|
|
19
|
+
|
|
21
20
|
//# sourceMappingURL=createAnnotationElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAnnotationElement.js","names":[],"sources":["../../src/utils/createAnnotationElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport type { AnnotationSpan } from '../types';\nimport { createHastElement } from './hast_utils';\n\nexport function createAnnotationElement(span: AnnotationSpan): HASTElement {\n return createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'div',\n children: span.annotations?.map((slotId) =>\n createHastElement({ tagName: 'slot', properties: { name: slotId } })\n ),\n properties: { 'data-annotation-content': '' },\n }),\n ],\n properties: {\n 'data-line-annotation': `${span.hunkIndex},${span.lineIndex}`,\n },\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createAnnotationElement.js","names":[],"sources":["../../src/utils/createAnnotationElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport type { AnnotationSpan } from '../types';\nimport { createHastElement } from './hast_utils';\n\nexport function createAnnotationElement(span: AnnotationSpan): HASTElement {\n return createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'div',\n children: span.annotations?.map((slotId) =>\n createHastElement({ tagName: 'slot', properties: { name: slotId } })\n ),\n properties: { 'data-annotation-content': '' },\n }),\n ],\n properties: {\n 'data-line-annotation': `${span.hunkIndex},${span.lineIndex}`,\n },\n });\n}\n"],"mappings":";;AAKA,SAAgB,wBAAwB,MAAmC;CACzE,OAAO,kBAAkB;EACvB,SAAS;EACT,UAAU,CACR,kBAAkB;GAChB,SAAS;GACT,UAAU,KAAK,aAAa,KAAK,WAC/B,kBAAkB;IAAE,SAAS;IAAQ,YAAY,EAAE,MAAM,OAAO;GAAE,CAAC,CACrE;GACA,YAAY,EAAE,2BAA2B,GAAG;EAC9C,CAAC,CACH;EACA,YAAY,EACV,wBAAwB,GAAG,KAAK,UAAU,GAAG,KAAK,YACpD;CACF,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAnnotationWrapperNode.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"createAnnotationWrapperNode.d.ts","names":[],"sources":["../../src/utils/createAnnotationWrapperNode.ts"],"mappings":";iBAAgB,2BAAA,CAA4B,IAAA,WAAe,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAnnotationWrapperNode.js","names":[],"sources":["../../src/utils/createAnnotationWrapperNode.ts"],"sourcesContent":["export function createAnnotationWrapperNode(slot: string): HTMLElement {\n const wrapper = document.createElement('div');\n wrapper.dataset.annotationSlot = '';\n wrapper.slot = slot;\n wrapper.style.whiteSpace = 'normal';\n return wrapper;\n}\n"],"mappings":";AAAA,SAAgB,4BAA4B,MAA2B;CACrE,MAAM,UAAU,SAAS,cAAc,
|
|
1
|
+
{"version":3,"file":"createAnnotationWrapperNode.js","names":[],"sources":["../../src/utils/createAnnotationWrapperNode.ts"],"sourcesContent":["export function createAnnotationWrapperNode(slot: string): HTMLElement {\n const wrapper = document.createElement('div');\n wrapper.dataset.annotationSlot = '';\n wrapper.slot = slot;\n wrapper.style.whiteSpace = 'normal';\n return wrapper;\n}\n"],"mappings":";AAAA,SAAgB,4BAA4B,MAA2B;CACrE,MAAM,UAAU,SAAS,cAAc,KAAK;CAC5C,QAAQ,QAAQ,iBAAiB;CACjC,QAAQ,OAAO;CACf,QAAQ,MAAM,aAAa;CAC3B,OAAO;AACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Element, ElementContent } from "hast";
|
|
1
|
+
import { Element, ElementContent } from "../node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.js";
|
|
2
2
|
|
|
3
3
|
//#region src/utils/createContentColumn.d.ts
|
|
4
4
|
declare function createContentColumn(children: ElementContent[], rowCount: number): Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createContentColumn.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"createContentColumn.d.ts","names":[],"sources":["../../src/utils/createContentColumn.ts"],"mappings":";;;iBAIgB,mBAAA,CACd,QAAA,EAAU,cAAA,IACV,QAAA,WACC,OAAW"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createHastElement } from "./hast_utils.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/createContentColumn.ts
|
|
4
3
|
function createContentColumn(children, rowCount) {
|
|
5
4
|
return createHastElement({
|
|
@@ -11,7 +10,7 @@ function createContentColumn(children, rowCount) {
|
|
|
11
10
|
}
|
|
12
11
|
});
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
//#endregion
|
|
16
14
|
export { createContentColumn };
|
|
15
|
+
|
|
17
16
|
//# sourceMappingURL=createContentColumn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createContentColumn.js","names":[],"sources":["../../src/utils/createContentColumn.ts"],"sourcesContent":["import type { ElementContent, Element as HASTElement } from 'hast';\n\nimport { createHastElement } from './hast_utils';\n\nexport function createContentColumn(\n children: ElementContent[],\n rowCount: number\n): HASTElement {\n return createHastElement({\n tagName: 'div',\n children,\n properties: {\n 'data-content': '',\n style: `grid-row: span ${rowCount}`,\n },\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createContentColumn.js","names":[],"sources":["../../src/utils/createContentColumn.ts"],"sourcesContent":["import type { ElementContent, Element as HASTElement } from 'hast';\n\nimport { createHastElement } from './hast_utils';\n\nexport function createContentColumn(\n children: ElementContent[],\n rowCount: number\n): HASTElement {\n return createHastElement({\n tagName: 'div',\n children,\n properties: {\n 'data-content': '',\n style: `grid-row: span ${rowCount}`,\n },\n });\n}\n"],"mappings":";;AAIA,SAAgB,oBACd,UACA,UACa;CACb,OAAO,kBAAkB;EACvB,SAAS;EACT;EACA,YAAY;GACV,gBAAgB;GAChB,OAAO,kBAAkB;EAC3B;CACF,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createEmptyRowBuffer.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"createEmptyRowBuffer.d.ts","names":[],"sources":["../../src/utils/createEmptyRowBuffer.ts"],"mappings":";;;iBAIgB,oBAAA,CAAqB,IAAA,WAAe,OAAW"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createHastElement } from "./hast_utils.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/createEmptyRowBuffer.ts
|
|
4
3
|
function createEmptyRowBuffer(size) {
|
|
5
4
|
return createHastElement({
|
|
@@ -11,7 +10,7 @@ function createEmptyRowBuffer(size) {
|
|
|
11
10
|
}
|
|
12
11
|
});
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
//#endregion
|
|
16
14
|
export { createEmptyRowBuffer };
|
|
15
|
+
|
|
17
16
|
//# sourceMappingURL=createEmptyRowBuffer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createEmptyRowBuffer.js","names":[],"sources":["../../src/utils/createEmptyRowBuffer.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport { createHastElement } from './hast_utils';\n\nexport function createEmptyRowBuffer(size: number): HASTElement {\n return createHastElement({\n tagName: 'div',\n properties: {\n 'data-content-buffer': '',\n 'data-buffer-size': size,\n style: `grid-row: span ${size};min-height:calc(${size} * 1lh)`,\n },\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createEmptyRowBuffer.js","names":[],"sources":["../../src/utils/createEmptyRowBuffer.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport { createHastElement } from './hast_utils';\n\nexport function createEmptyRowBuffer(size: number): HASTElement {\n return createHastElement({\n tagName: 'div',\n properties: {\n 'data-content-buffer': '',\n 'data-buffer-size': size,\n style: `grid-row: span ${size};min-height:calc(${size} * 1lh)`,\n },\n });\n}\n"],"mappings":";;AAIA,SAAgB,qBAAqB,MAA2B;CAC9D,OAAO,kBAAkB;EACvB,SAAS;EACT,YAAY;GACV,uBAAuB;GACvB,oBAAoB;GACpB,OAAO,kBAAkB,KAAK,mBAAmB,KAAK;EACxD;CACF,CAAC;AACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { Element } from "../node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.js";
|
|
1
2
|
import { FileContents, FileDiffMetadata, FileHeaderRenderMode } from "../types.js";
|
|
2
|
-
import { Element } from "hast";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/createFileHeaderElement.d.ts
|
|
5
5
|
interface CreateFileHeaderElementProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createFileHeaderElement.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"createFileHeaderElement.d.ts","names":[],"sources":["../../src/utils/createFileHeaderElement.ts"],"mappings":";;;;UAqBiB,4BAAA;EACf,UAAA,EAAY,gBAAA,GAAmB,YAAA;EAC/B,IAAA,EAAM,oBAAA;EACN,YAAA;AAAA;AAAA,iBAGc,uBAAA;EACd,UAAA;EACA,IAAA;EACA;AAAA,GACC,4BAAA,GAA+B,OAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { CUSTOM_HEADER_SLOT_ID, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID } from "../constants.js";
|
|
1
|
+
import { CUSTOM_HEADER_SLOT_ID, HEADER_FILENAME_SUFFIX_SLOT_ID, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID } from "../constants.js";
|
|
2
2
|
import { createHastElement, createIconElement, createTextNodeElement } from "./hast_utils.js";
|
|
3
3
|
import { getIconForType } from "./getIconForType.js";
|
|
4
|
-
|
|
5
4
|
//#region src/utils/createFileHeaderElement.ts
|
|
6
5
|
function createFileHeaderElement({ fileOrDiff, mode, stickyHeader }) {
|
|
7
6
|
const fileDiff = "type" in fileOrDiff ? fileOrDiff : void 0;
|
|
@@ -53,6 +52,10 @@ function createHeaderElement({ name, prevName, iconType }) {
|
|
|
53
52
|
})],
|
|
54
53
|
properties: { "data-title": "" }
|
|
55
54
|
}));
|
|
55
|
+
children.push(createHastElement({
|
|
56
|
+
tagName: "slot",
|
|
57
|
+
properties: { name: HEADER_FILENAME_SUFFIX_SLOT_ID }
|
|
58
|
+
}));
|
|
56
59
|
return createHastElement({
|
|
57
60
|
tagName: "div",
|
|
58
61
|
children,
|
|
@@ -89,7 +92,7 @@ function createMetadataElement(fileDiff) {
|
|
|
89
92
|
properties: { "data-metadata": "" }
|
|
90
93
|
});
|
|
91
94
|
}
|
|
92
|
-
|
|
93
95
|
//#endregion
|
|
94
96
|
export { createFileHeaderElement };
|
|
97
|
+
|
|
95
98
|
//# sourceMappingURL=createFileHeaderElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createFileHeaderElement.js","names":[
|
|
1
|
+
{"version":3,"file":"createFileHeaderElement.js","names":[],"sources":["../../src/utils/createFileHeaderElement.ts"],"sourcesContent":["import type { ElementContent, Element as HASTElement, Properties } from 'hast';\n\nimport {\n CUSTOM_HEADER_SLOT_ID,\n HEADER_FILENAME_SUFFIX_SLOT_ID,\n HEADER_METADATA_SLOT_ID,\n HEADER_PREFIX_SLOT_ID,\n} from '../constants';\nimport type {\n ChangeTypes,\n FileContents,\n FileDiffMetadata,\n FileHeaderRenderMode,\n} from '../types';\nimport { getIconForType } from './getIconForType';\nimport {\n createHastElement,\n createIconElement,\n createTextNodeElement,\n} from './hast_utils';\n\nexport interface CreateFileHeaderElementProps {\n fileOrDiff: FileDiffMetadata | FileContents;\n mode: FileHeaderRenderMode;\n stickyHeader: boolean;\n}\n\nexport function createFileHeaderElement({\n fileOrDiff,\n mode,\n stickyHeader,\n}: CreateFileHeaderElementProps): HASTElement {\n const fileDiff = 'type' in fileOrDiff ? fileOrDiff : undefined;\n const properties: Properties = {\n 'data-diffs-header': mode,\n 'data-change-type': fileDiff?.type,\n 'data-sticky': stickyHeader ? '' : undefined,\n };\n\n return createHastElement({\n tagName: 'div',\n children: [\n mode === 'custom'\n ? createHastElement({\n tagName: 'slot',\n properties: { name: CUSTOM_HEADER_SLOT_ID },\n })\n : createHeaderElement({\n name: fileOrDiff.name,\n prevName:\n 'prevName' in fileOrDiff ? fileOrDiff.prevName : undefined,\n iconType: fileDiff?.type ?? 'file',\n }),\n ...(mode === 'custom' ? [] : [createMetadataElement(fileDiff)]),\n ],\n properties,\n });\n}\n\ninterface CreateHeaderElementOptions {\n name: string;\n prevName?: string;\n iconType: ChangeTypes | 'file';\n}\n\nfunction createHeaderElement({\n name,\n prevName,\n iconType,\n}: CreateHeaderElementOptions): HASTElement {\n const children: ElementContent[] = [\n createHastElement({\n tagName: 'slot',\n properties: { name: HEADER_PREFIX_SLOT_ID },\n }),\n createIconElement({\n name: getIconForType(iconType),\n properties: { 'data-change-icon': iconType },\n }),\n ];\n if (prevName != null) {\n children.push(\n createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'bdi',\n children: [createTextNodeElement(prevName)],\n }),\n ],\n properties: {\n 'data-prev-name': '',\n },\n })\n );\n children.push(\n createIconElement({\n name: 'diffs-icon-arrow-right-short',\n properties: {\n 'data-rename-icon': '',\n },\n })\n );\n }\n children.push(\n createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'bdi',\n children: [createTextNodeElement(name)],\n }),\n ],\n properties: { 'data-title': '' },\n })\n );\n children.push(\n createHastElement({\n tagName: 'slot',\n properties: { name: HEADER_FILENAME_SUFFIX_SLOT_ID },\n })\n );\n return createHastElement({\n tagName: 'div',\n children,\n properties: { 'data-header-content': '' },\n });\n}\n\nfunction createMetadataElement(\n fileDiff: FileDiffMetadata | undefined\n): HASTElement {\n const children: ElementContent[] = [];\n if (fileDiff != null) {\n let additions = 0;\n let deletions = 0;\n for (const hunk of fileDiff.hunks) {\n additions += hunk.additionLines;\n deletions += hunk.deletionLines;\n }\n if (deletions > 0 || additions === 0) {\n children.push(\n createHastElement({\n tagName: 'span',\n children: [createTextNodeElement(`-${deletions}`)],\n properties: { 'data-deletions-count': '' },\n })\n );\n }\n if (additions > 0 || deletions === 0) {\n children.push(\n createHastElement({\n tagName: 'span',\n children: [createTextNodeElement(`+${additions}`)],\n properties: { 'data-additions-count': '' },\n })\n );\n }\n }\n children.push(\n createHastElement({\n tagName: 'slot',\n properties: { name: HEADER_METADATA_SLOT_ID },\n })\n );\n return createHastElement({\n tagName: 'div',\n children,\n properties: { 'data-metadata': '' },\n });\n}\n"],"mappings":";;;;AA2BA,SAAgB,wBAAwB,EACtC,YACA,MACA,gBAC4C;CAC5C,MAAM,WAAW,UAAU,aAAa,aAAa,KAAA;CACrD,MAAM,aAAyB;EAC7B,qBAAqB;EACrB,oBAAoB,UAAU;EAC9B,eAAe,eAAe,KAAK,KAAA;CACrC;CAEA,OAAO,kBAAkB;EACvB,SAAS;EACT,UAAU,CACR,SAAS,WACL,kBAAkB;GAChB,SAAS;GACT,YAAY,EAAE,MAAM,sBAAsB;EAC5C,CAAC,IACD,oBAAoB;GAClB,MAAM,WAAW;GACjB,UACE,cAAc,aAAa,WAAW,WAAW,KAAA;GACnD,UAAU,UAAU,QAAQ;EAC9B,CAAC,GACL,GAAI,SAAS,WAAW,CAAC,IAAI,CAAC,sBAAsB,QAAQ,CAAC,CAC/D;EACA;CACF,CAAC;AACH;AAQA,SAAS,oBAAoB,EAC3B,MACA,UACA,YAC0C;CAC1C,MAAM,WAA6B,CACjC,kBAAkB;EAChB,SAAS;EACT,YAAY,EAAE,MAAM,sBAAsB;CAC5C,CAAC,GACD,kBAAkB;EAChB,MAAM,eAAe,QAAQ;EAC7B,YAAY,EAAE,oBAAoB,SAAS;CAC7C,CAAC,CACH;CACA,IAAI,YAAY,MAAM;EACpB,SAAS,KACP,kBAAkB;GAChB,SAAS;GACT,UAAU,CACR,kBAAkB;IAChB,SAAS;IACT,UAAU,CAAC,sBAAsB,QAAQ,CAAC;GAC5C,CAAC,CACH;GACA,YAAY,EACV,kBAAkB,GACpB;EACF,CAAC,CACH;EACA,SAAS,KACP,kBAAkB;GAChB,MAAM;GACN,YAAY,EACV,oBAAoB,GACtB;EACF,CAAC,CACH;CACF;CACA,SAAS,KACP,kBAAkB;EAChB,SAAS;EACT,UAAU,CACR,kBAAkB;GAChB,SAAS;GACT,UAAU,CAAC,sBAAsB,IAAI,CAAC;EACxC,CAAC,CACH;EACA,YAAY,EAAE,cAAc,GAAG;CACjC,CAAC,CACH;CACA,SAAS,KACP,kBAAkB;EAChB,SAAS;EACT,YAAY,EAAE,MAAM,+BAA+B;CACrD,CAAC,CACH;CACA,OAAO,kBAAkB;EACvB,SAAS;EACT;EACA,YAAY,EAAE,uBAAuB,GAAG;CAC1C,CAAC;AACH;AAEA,SAAS,sBACP,UACa;CACb,MAAM,WAA6B,CAAC;CACpC,IAAI,YAAY,MAAM;EACpB,IAAI,YAAY;EAChB,IAAI,YAAY;EAChB,KAAK,MAAM,QAAQ,SAAS,OAAO;GACjC,aAAa,KAAK;GAClB,aAAa,KAAK;EACpB;EACA,IAAI,YAAY,KAAK,cAAc,GACjC,SAAS,KACP,kBAAkB;GAChB,SAAS;GACT,UAAU,CAAC,sBAAsB,IAAI,WAAW,CAAC;GACjD,YAAY,EAAE,wBAAwB,GAAG;EAC3C,CAAC,CACH;EAEF,IAAI,YAAY,KAAK,cAAc,GACjC,SAAS,KACP,kBAAkB;GAChB,SAAS;GACT,UAAU,CAAC,sBAAsB,IAAI,WAAW,CAAC;GACjD,YAAY,EAAE,wBAAwB,GAAG;EAC3C,CAAC,CACH;CAEJ;CACA,SAAS,KACP,kBAAkB;EAChB,SAAS;EACT,YAAY,EAAE,MAAM,wBAAwB;CAC9C,CAAC,CACH;CACA,OAAO,kBAAkB;EACvB,SAAS;EACT;EACA,YAAY,EAAE,iBAAiB,GAAG;CACpC,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGutterUtilityContentNode.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"createGutterUtilityContentNode.d.ts","names":[],"sources":["../../src/utils/createGutterUtilityContentNode.ts"],"mappings":";iBAAgB,8BAAA,IAAkC,WAAW"}
|
|
@@ -10,7 +10,7 @@ function createGutterUtilityContentNode() {
|
|
|
10
10
|
gutterUtilityContent.style.touchAction = "none";
|
|
11
11
|
return gutterUtilityContent;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
13
|
//#endregion
|
|
15
14
|
export { createGutterUtilityContentNode };
|
|
15
|
+
|
|
16
16
|
//# sourceMappingURL=createGutterUtilityContentNode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGutterUtilityContentNode.js","names":[],"sources":["../../src/utils/createGutterUtilityContentNode.ts"],"sourcesContent":["export function createGutterUtilityContentNode(): HTMLElement {\n const gutterUtilityContent = document.createElement('div');\n gutterUtilityContent.slot = 'gutter-utility-slot';\n gutterUtilityContent.style.position = 'absolute';\n gutterUtilityContent.style.top = '0';\n gutterUtilityContent.style.bottom = '0';\n gutterUtilityContent.style.textAlign = 'center';\n gutterUtilityContent.style.whiteSpace = 'normal';\n gutterUtilityContent.style.touchAction = 'none';\n return gutterUtilityContent;\n}\n"],"mappings":";AAAA,SAAgB,iCAA8C;CAC5D,MAAM,uBAAuB,SAAS,cAAc,
|
|
1
|
+
{"version":3,"file":"createGutterUtilityContentNode.js","names":[],"sources":["../../src/utils/createGutterUtilityContentNode.ts"],"sourcesContent":["export function createGutterUtilityContentNode(): HTMLElement {\n const gutterUtilityContent = document.createElement('div');\n gutterUtilityContent.slot = 'gutter-utility-slot';\n gutterUtilityContent.style.position = 'absolute';\n gutterUtilityContent.style.top = '0';\n gutterUtilityContent.style.bottom = '0';\n gutterUtilityContent.style.textAlign = 'center';\n gutterUtilityContent.style.whiteSpace = 'normal';\n gutterUtilityContent.style.touchAction = 'none';\n return gutterUtilityContent;\n}\n"],"mappings":";AAAA,SAAgB,iCAA8C;CAC5D,MAAM,uBAAuB,SAAS,cAAc,KAAK;CACzD,qBAAqB,OAAO;CAC5B,qBAAqB,MAAM,WAAW;CACtC,qBAAqB,MAAM,MAAM;CACjC,qBAAqB,MAAM,SAAS;CACpC,qBAAqB,MAAM,YAAY;CACvC,qBAAqB,MAAM,aAAa;CACxC,qBAAqB,MAAM,cAAc;CACzC,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGutterUtilityElement.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"createGutterUtilityElement.d.ts","names":[],"sources":["../../src/utils/createGutterUtilityElement.ts"],"mappings":";;;iBAIgB,0BAAA,IAA8B,OAAW"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createHastElement, createIconElement } from "./hast_utils.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/createGutterUtilityElement.ts
|
|
4
3
|
function createGutterUtilityElement() {
|
|
5
4
|
return createHastElement({
|
|
@@ -14,7 +13,7 @@ function createGutterUtilityElement() {
|
|
|
14
13
|
})]
|
|
15
14
|
});
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
//#endregion
|
|
19
17
|
export { createGutterUtilityElement };
|
|
18
|
+
|
|
20
19
|
//# sourceMappingURL=createGutterUtilityElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGutterUtilityElement.js","names":[],"sources":["../../src/utils/createGutterUtilityElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport { createHastElement, createIconElement } from './hast_utils';\n\nexport function createGutterUtilityElement(): HASTElement {\n return createHastElement({\n tagName: 'button',\n properties: { 'data-utility-button': '', type: 'button' },\n children: [\n createIconElement({\n name: 'diffs-icon-plus',\n properties: { 'data-icon': '' },\n }),\n ],\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createGutterUtilityElement.js","names":[],"sources":["../../src/utils/createGutterUtilityElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport { createHastElement, createIconElement } from './hast_utils';\n\nexport function createGutterUtilityElement(): HASTElement {\n return createHastElement({\n tagName: 'button',\n properties: { 'data-utility-button': '', type: 'button' },\n children: [\n createIconElement({\n name: 'diffs-icon-plus',\n properties: { 'data-icon': '' },\n }),\n ],\n });\n}\n"],"mappings":";;AAIA,SAAgB,6BAA0C;CACxD,OAAO,kBAAkB;EACvB,SAAS;EACT,YAAY;GAAE,uBAAuB;GAAI,MAAM;EAAS;EACxD,UAAU,CACR,kBAAkB;GAChB,MAAM;GACN,YAAY,EAAE,aAAa,GAAG;EAChC,CAAC,CACH;CACF,CAAC;AACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { Element } from "../node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.js";
|
|
1
2
|
import { LineTypes } from "../types.js";
|
|
2
|
-
import { Element } from "hast";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/createNoNewlineElement.d.ts
|
|
5
5
|
declare function createNoNewlineElement(type: LineTypes): Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNoNewlineElement.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"createNoNewlineElement.d.ts","names":[],"sources":["../../src/utils/createNoNewlineElement.ts"],"mappings":";;;;iBAKgB,sBAAA,CAAuB,IAAA,EAAM,SAAA,GAAY,OAAW"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createHastElement, createTextNodeElement } from "./hast_utils.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/createNoNewlineElement.ts
|
|
4
3
|
function createNoNewlineElement(type) {
|
|
5
4
|
return createHastElement({
|
|
@@ -15,7 +14,7 @@ function createNoNewlineElement(type) {
|
|
|
15
14
|
}
|
|
16
15
|
});
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
//#endregion
|
|
20
18
|
export { createNoNewlineElement };
|
|
19
|
+
|
|
21
20
|
//# sourceMappingURL=createNoNewlineElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNoNewlineElement.js","names":[],"sources":["../../src/utils/createNoNewlineElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport type { LineTypes } from '../types';\nimport { createHastElement, createTextNodeElement } from './hast_utils';\n\nexport function createNoNewlineElement(type: LineTypes): HASTElement {\n return createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'span',\n children: [createTextNodeElement('No newline at end of file')],\n }),\n ],\n properties: {\n 'data-no-newline': '',\n 'data-line-type': type,\n 'data-column-content': '',\n },\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createNoNewlineElement.js","names":[],"sources":["../../src/utils/createNoNewlineElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport type { LineTypes } from '../types';\nimport { createHastElement, createTextNodeElement } from './hast_utils';\n\nexport function createNoNewlineElement(type: LineTypes): HASTElement {\n return createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'span',\n children: [createTextNodeElement('No newline at end of file')],\n }),\n ],\n properties: {\n 'data-no-newline': '',\n 'data-line-type': type,\n 'data-column-content': '',\n },\n });\n}\n"],"mappings":";;AAKA,SAAgB,uBAAuB,MAA8B;CACnE,OAAO,kBAAkB;EACvB,SAAS;EACT,UAAU,CACR,kBAAkB;GAChB,SAAS;GACT,UAAU,CAAC,sBAAsB,2BAA2B,CAAC;EAC/D,CAAC,CACH;EACA,YAAY;GACV,mBAAmB;GACnB,kBAAkB;GAClB,uBAAuB;EACzB;CACF,CAAC;AACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { Element, Properties } from "../node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.js";
|
|
1
2
|
import { PrePropertiesConfig } from "../types.js";
|
|
2
|
-
import { Element, Properties } from "hast";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/createPreElement.d.ts
|
|
5
5
|
declare function createPreElement(options: PrePropertiesConfig): Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPreElement.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"createPreElement.d.ts","names":[],"sources":["../../src/utils/createPreElement.ts"],"mappings":";;;;iBAKgB,gBAAA,CAAiB,OAAA,EAAS,mBAAA,GAAsB,OAAW;AAAA,iBAO3D,0BAAA;EACd,cAAA;EACA,iBAAA;EACA,kBAAA;EACA,QAAA;EACA,KAAA;EACA,UAAA;EACA,IAAA;EACA;AAAA,GACC,mBAAA,GAAsB,UAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createHastElement } from "./hast_utils.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/createPreElement.ts
|
|
4
3
|
function createPreElement(options) {
|
|
5
4
|
return createHastElement({
|
|
@@ -17,11 +16,10 @@ function createPreWrapperProperties({ diffIndicators, disableBackground, disable
|
|
|
17
16
|
"data-disable-line-numbers": disableLineNumbers ? "" : void 0,
|
|
18
17
|
"data-background": !disableBackground ? "" : void 0,
|
|
19
18
|
"data-indicators": diffIndicators === "bars" || diffIndicators === "classic" ? diffIndicators : void 0,
|
|
20
|
-
tabIndex: 0,
|
|
21
19
|
style: `--diffs-min-number-column-width-default:${`${totalLines}`.length}ch;`
|
|
22
20
|
};
|
|
23
21
|
}
|
|
24
|
-
|
|
25
22
|
//#endregion
|
|
26
23
|
export { createPreElement, createPreWrapperProperties };
|
|
24
|
+
|
|
27
25
|
//# sourceMappingURL=createPreElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPreElement.js","names":[],"sources":["../../src/utils/createPreElement.ts"],"sourcesContent":["import type { Element as HASTElement, Properties } from 'hast';\n\nimport type { PrePropertiesConfig } from '../types';\nimport { createHastElement } from './hast_utils';\n\nexport function createPreElement(options: PrePropertiesConfig): HASTElement {\n return createHastElement({\n tagName: 'pre',\n properties: createPreWrapperProperties(options),\n });\n}\n\nexport function createPreWrapperProperties({\n diffIndicators,\n disableBackground,\n disableLineNumbers,\n overflow,\n split,\n totalLines,\n type,\n customProperties,\n}: PrePropertiesConfig): Properties {\n const properties: Properties = {\n // NOTE: We always apply custom properties first so the important\n // properties cannot be overridden\n ...customProperties,\n 'data-diff': type === 'diff' ? '' : undefined,\n 'data-file': type === 'file' ? '' : undefined,\n 'data-diff-type':\n type === 'diff' ? (split ? 'split' : 'single') : undefined,\n 'data-overflow': overflow,\n 'data-disable-line-numbers': disableLineNumbers ? '' : undefined,\n 'data-background': !disableBackground ? '' : undefined,\n 'data-indicators':\n diffIndicators === 'bars' || diffIndicators === 'classic'\n ? diffIndicators\n : undefined,\n
|
|
1
|
+
{"version":3,"file":"createPreElement.js","names":[],"sources":["../../src/utils/createPreElement.ts"],"sourcesContent":["import type { Element as HASTElement, Properties } from 'hast';\n\nimport type { PrePropertiesConfig } from '../types';\nimport { createHastElement } from './hast_utils';\n\nexport function createPreElement(options: PrePropertiesConfig): HASTElement {\n return createHastElement({\n tagName: 'pre',\n properties: createPreWrapperProperties(options),\n });\n}\n\nexport function createPreWrapperProperties({\n diffIndicators,\n disableBackground,\n disableLineNumbers,\n overflow,\n split,\n totalLines,\n type,\n customProperties,\n}: PrePropertiesConfig): Properties {\n const properties: Properties = {\n // NOTE: We always apply custom properties first so the important\n // properties cannot be overridden\n ...customProperties,\n 'data-diff': type === 'diff' ? '' : undefined,\n 'data-file': type === 'file' ? '' : undefined,\n 'data-diff-type':\n type === 'diff' ? (split ? 'split' : 'single') : undefined,\n 'data-overflow': overflow,\n 'data-disable-line-numbers': disableLineNumbers ? '' : undefined,\n 'data-background': !disableBackground ? '' : undefined,\n 'data-indicators':\n diffIndicators === 'bars' || diffIndicators === 'classic'\n ? diffIndicators\n : undefined,\n // The pre is intentionally not focusable. It is not the scroll container\n // (`[data-code]` inside it is) and has no keyboard behavior of its own, so\n // a tabindex would only add a tab stop per diff and steal focus from a host\n // wrapper that wants to own keyboard navigation of the selection.\n style: `--diffs-min-number-column-width-default:${`${totalLines}`.length}ch;`,\n };\n\n return properties;\n}\n"],"mappings":";;AAKA,SAAgB,iBAAiB,SAA2C;CAC1E,OAAO,kBAAkB;EACvB,SAAS;EACT,YAAY,2BAA2B,OAAO;CAChD,CAAC;AACH;AAEA,SAAgB,2BAA2B,EACzC,gBACA,mBACA,oBACA,UACA,OACA,YACA,MACA,oBACkC;CAuBlC,OAAO;EAnBL,GAAG;EACH,aAAa,SAAS,SAAS,KAAK,KAAA;EACpC,aAAa,SAAS,SAAS,KAAK,KAAA;EACpC,kBACE,SAAS,SAAU,QAAQ,UAAU,WAAY,KAAA;EACnD,iBAAiB;EACjB,6BAA6B,qBAAqB,KAAK,KAAA;EACvD,mBAAmB,CAAC,oBAAoB,KAAK,KAAA;EAC7C,mBACE,mBAAmB,UAAU,mBAAmB,YAC5C,iBACA,KAAA;EAKN,OAAO,2CAA2C,GAAG,aAAa,OAAO;CAG3D;AAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRowNodes.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"createRowNodes.d.ts","names":[],"sources":["../../src/utils/createRowNodes.ts"],"mappings":";iBAAgB,cAAA,CAAe,IAAA;EAC7B,GAAA,EAAK,WAAA;EACL,OAAA,EAAS,WAAW;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRowNodes.js","names":[],"sources":["../../src/utils/createRowNodes.ts"],"sourcesContent":["export function createRowNodes(line: number): {\n row: HTMLElement;\n content: HTMLElement;\n} {\n const row = document.createElement('div');\n row.dataset.line = `${line}`;\n\n const lineColumn = document.createElement('div');\n lineColumn.dataset.columnNumber = '';\n lineColumn.textContent = `${line}`;\n\n const content = document.createElement('div');\n content.dataset.columnContent = '';\n\n row.appendChild(lineColumn);\n row.appendChild(content);\n return { row, content };\n}\n"],"mappings":";AAAA,SAAgB,eAAe,MAG7B;CACA,MAAM,MAAM,SAAS,cAAc,
|
|
1
|
+
{"version":3,"file":"createRowNodes.js","names":[],"sources":["../../src/utils/createRowNodes.ts"],"sourcesContent":["export function createRowNodes(line: number): {\n row: HTMLElement;\n content: HTMLElement;\n} {\n const row = document.createElement('div');\n row.dataset.line = `${line}`;\n\n const lineColumn = document.createElement('div');\n lineColumn.dataset.columnNumber = '';\n lineColumn.textContent = `${line}`;\n\n const content = document.createElement('div');\n content.dataset.columnContent = '';\n\n row.appendChild(lineColumn);\n row.appendChild(content);\n return { row, content };\n}\n"],"mappings":";AAAA,SAAgB,eAAe,MAG7B;CACA,MAAM,MAAM,SAAS,cAAc,KAAK;CACxC,IAAI,QAAQ,OAAO,GAAG;CAEtB,MAAM,aAAa,SAAS,cAAc,KAAK;CAC/C,WAAW,QAAQ,eAAe;CAClC,WAAW,cAAc,GAAG;CAE5B,MAAM,UAAU,SAAS,cAAc,KAAK;CAC5C,QAAQ,QAAQ,gBAAgB;CAEhC,IAAI,YAAY,UAAU;CAC1B,IAAI,YAAY,OAAO;CACvB,OAAO;EAAE;EAAK;CAAQ;AACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSeparator.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"createSeparator.d.ts","names":[],"sources":["../../src/utils/createSeparator.ts"],"mappings":";;;;UASU,oBAAA;EACR,IAAA,EAAM,cAAc;EACpB,OAAA;EACA,WAAA;EACA,OAAA;EACA,QAAA;EACA,WAAA;EACA,UAAA;AAAA;AAAA,iBAsBc,eAAA;EACd,IAAA;EACA,OAAA;EACA,WAAA;EACA,OAAA;EACA,QAAA;EACA,WAAA;EACA;AAAA,GACC,oBAAA,GAAuB,OAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createHastElement, createIconElement, createTextNodeElement } from "./hast_utils.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/createSeparator.ts
|
|
4
3
|
function createExpandButton(type) {
|
|
5
4
|
return createHastElement({
|
|
@@ -82,7 +81,7 @@ function createSeparator({ type, content, expandIndex, chunked = false, slotName
|
|
|
82
81
|
}
|
|
83
82
|
});
|
|
84
83
|
}
|
|
85
|
-
|
|
86
84
|
//#endregion
|
|
87
85
|
export { createSeparator };
|
|
86
|
+
|
|
88
87
|
//# sourceMappingURL=createSeparator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSeparator.js","names":[
|
|
1
|
+
{"version":3,"file":"createSeparator.js","names":[],"sources":["../../src/utils/createSeparator.ts"],"sourcesContent":["import type { ElementContent, Element as HASTElement } from 'hast';\n\nimport type { ExpansionDirections, HunkSeparators } from '../types';\nimport {\n createHastElement,\n createIconElement,\n createTextNodeElement,\n} from './hast_utils';\n\ninterface CreateSeparatorProps {\n type: HunkSeparators;\n content?: string;\n expandIndex?: number;\n chunked?: boolean;\n slotName?: string;\n isFirstHunk: boolean;\n isLastHunk: boolean;\n}\n\nfunction createExpandButton(type: ExpansionDirections) {\n return createHastElement({\n tagName: 'div',\n children: [\n createIconElement({\n name: type === 'both' ? 'diffs-icon-expand-all' : 'diffs-icon-expand',\n properties: { 'data-icon': '' },\n }),\n ],\n properties: {\n role: 'button',\n 'data-expand-button': '',\n 'data-expand-both': type === 'both' ? '' : undefined,\n 'data-expand-up': type === 'up' ? '' : undefined,\n 'data-expand-down': type === 'down' ? '' : undefined,\n },\n });\n}\n\nexport function createSeparator({\n type,\n content,\n expandIndex,\n chunked = false,\n slotName,\n isFirstHunk,\n isLastHunk,\n}: CreateSeparatorProps): HASTElement {\n let buttonCount = 0;\n const children = [];\n if (type === 'metadata' && content != null) {\n children.push(\n createHastElement({\n tagName: 'div',\n children: [createTextNodeElement(content)],\n properties: { 'data-separator-wrapper': '' },\n })\n );\n }\n if ((type === 'line-info' || type === 'line-info-basic') && content != null) {\n const contentChildren: ElementContent[] = [];\n if (expandIndex != null) {\n if (!chunked) {\n contentChildren.push(\n createExpandButton(\n !isFirstHunk && !isLastHunk ? 'both' : isFirstHunk ? 'down' : 'up'\n )\n );\n buttonCount++;\n } else {\n if (!isFirstHunk) {\n contentChildren.push(createExpandButton('up'));\n buttonCount++;\n }\n if (!isLastHunk) {\n contentChildren.push(createExpandButton('down'));\n buttonCount++;\n }\n }\n }\n contentChildren.push(\n createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'span',\n children: [createTextNodeElement(content)],\n properties: { 'data-unmodified-lines': '' },\n }),\n ],\n properties: { 'data-separator-content': '' },\n })\n );\n if (chunked && expandIndex != null) {\n contentChildren.push(\n createHastElement({\n tagName: 'div',\n children: [createTextNodeElement('Expand all')],\n properties: {\n role: 'button',\n 'data-expand-button': '',\n 'data-expand-all-button': '',\n },\n })\n );\n }\n children.push(\n createHastElement({\n tagName: 'div',\n children: contentChildren,\n properties: {\n 'data-separator-wrapper': '',\n 'data-separator-multi-button': buttonCount > 1 ? '' : undefined,\n },\n })\n );\n }\n if (type === 'custom' && slotName != null) {\n children.push(\n createHastElement({\n tagName: 'slot',\n properties: { name: slotName },\n })\n );\n }\n return createHastElement({\n tagName: 'div',\n children,\n properties: {\n 'data-separator': children.length === 0 ? 'simple' : type,\n 'data-expand-index': expandIndex,\n 'data-separator-first': isFirstHunk ? '' : undefined,\n 'data-separator-last': isLastHunk ? '' : undefined,\n },\n });\n}\n"],"mappings":";;AAmBA,SAAS,mBAAmB,MAA2B;CACrD,OAAO,kBAAkB;EACvB,SAAS;EACT,UAAU,CACR,kBAAkB;GAChB,MAAM,SAAS,SAAS,0BAA0B;GAClD,YAAY,EAAE,aAAa,GAAG;EAChC,CAAC,CACH;EACA,YAAY;GACV,MAAM;GACN,sBAAsB;GACtB,oBAAoB,SAAS,SAAS,KAAK,KAAA;GAC3C,kBAAkB,SAAS,OAAO,KAAK,KAAA;GACvC,oBAAoB,SAAS,SAAS,KAAK,KAAA;EAC7C;CACF,CAAC;AACH;AAEA,SAAgB,gBAAgB,EAC9B,MACA,SACA,aACA,UAAU,OACV,UACA,aACA,cACoC;CACpC,IAAI,cAAc;CAClB,MAAM,WAAW,CAAC;CAClB,IAAI,SAAS,cAAc,WAAW,MACpC,SAAS,KACP,kBAAkB;EAChB,SAAS;EACT,UAAU,CAAC,sBAAsB,OAAO,CAAC;EACzC,YAAY,EAAE,0BAA0B,GAAG;CAC7C,CAAC,CACH;CAEF,KAAK,SAAS,eAAe,SAAS,sBAAsB,WAAW,MAAM;EAC3E,MAAM,kBAAoC,CAAC;EAC3C,IAAI,eAAe,MACjB,IAAI,CAAC,SAAS;GACZ,gBAAgB,KACd,mBACE,CAAC,eAAe,CAAC,aAAa,SAAS,cAAc,SAAS,IAChE,CACF;GACA;EACF,OAAO;GACL,IAAI,CAAC,aAAa;IAChB,gBAAgB,KAAK,mBAAmB,IAAI,CAAC;IAC7C;GACF;GACA,IAAI,CAAC,YAAY;IACf,gBAAgB,KAAK,mBAAmB,MAAM,CAAC;IAC/C;GACF;EACF;EAEF,gBAAgB,KACd,kBAAkB;GAChB,SAAS;GACT,UAAU,CACR,kBAAkB;IAChB,SAAS;IACT,UAAU,CAAC,sBAAsB,OAAO,CAAC;IACzC,YAAY,EAAE,yBAAyB,GAAG;GAC5C,CAAC,CACH;GACA,YAAY,EAAE,0BAA0B,GAAG;EAC7C,CAAC,CACH;EACA,IAAI,WAAW,eAAe,MAC5B,gBAAgB,KACd,kBAAkB;GAChB,SAAS;GACT,UAAU,CAAC,sBAAsB,YAAY,CAAC;GAC9C,YAAY;IACV,MAAM;IACN,sBAAsB;IACtB,0BAA0B;GAC5B;EACF,CAAC,CACH;EAEF,SAAS,KACP,kBAAkB;GAChB,SAAS;GACT,UAAU;GACV,YAAY;IACV,0BAA0B;IAC1B,+BAA+B,cAAc,IAAI,KAAK,KAAA;GACxD;EACF,CAAC,CACH;CACF;CACA,IAAI,SAAS,YAAY,YAAY,MACnC,SAAS,KACP,kBAAkB;EAChB,SAAS;EACT,YAAY,EAAE,MAAM,SAAS;CAC/B,CAAC,CACH;CAEF,OAAO,kBAAkB;EACvB,SAAS;EACT;EACA,YAAY;GACV,kBAAkB,SAAS,WAAW,IAAI,WAAW;GACrD,qBAAqB;GACrB,wBAAwB,cAAc,KAAK,KAAA;GAC3C,uBAAuB,aAAa,KAAK,KAAA;EAC3C;CACF,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSpanNodeFromToken.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"createSpanNodeFromToken.d.ts","names":[],"sources":["../../src/utils/createSpanNodeFromToken.ts"],"mappings":";;;iBAMgB,mBAAA,CAAoB,KAAA,EAAO,WAAA,GAAc,eAAe"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getTokenStyleObject, stringifyTokenStyle } from "shiki";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/createSpanNodeFromToken.ts
|
|
4
3
|
function createSpanFromToken(token) {
|
|
5
4
|
const element = document.createElement("span");
|
|
@@ -7,7 +6,7 @@ function createSpanFromToken(token) {
|
|
|
7
6
|
element.textContent = token.content;
|
|
8
7
|
return element;
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
//#endregion
|
|
12
10
|
export { createSpanFromToken };
|
|
11
|
+
|
|
13
12
|
//# sourceMappingURL=createSpanNodeFromToken.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSpanNodeFromToken.js","names":[],"sources":["../../src/utils/createSpanNodeFromToken.ts"],"sourcesContent":["import {\n getTokenStyleObject,\n stringifyTokenStyle,\n type ThemedToken,\n} from 'shiki';\n\nexport function createSpanFromToken(token: ThemedToken): HTMLSpanElement {\n const element = document.createElement('span');\n const style = token.htmlStyle ?? getTokenStyleObject(token);\n element.style = stringifyTokenStyle(style);\n element.textContent = token.content;\n return element;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createSpanNodeFromToken.js","names":[],"sources":["../../src/utils/createSpanNodeFromToken.ts"],"sourcesContent":["import {\n getTokenStyleObject,\n stringifyTokenStyle,\n type ThemedToken,\n} from 'shiki';\n\nexport function createSpanFromToken(token: ThemedToken): HTMLSpanElement {\n const element = document.createElement('span');\n const style = token.htmlStyle ?? getTokenStyleObject(token);\n element.style = stringifyTokenStyle(style);\n element.textContent = token.content;\n return element;\n}\n"],"mappings":";;AAMA,SAAgB,oBAAoB,OAAqC;CACvE,MAAM,UAAU,SAAS,cAAc,MAAM;CAE7C,QAAQ,QAAQ,oBADF,MAAM,aAAa,oBAAoB,KAAK,CACjB;CACzC,QAAQ,cAAc,MAAM;CAC5B,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createStyleElement.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"createStyleElement.d.ts","names":[],"sources":["../../src/utils/createStyleElement.ts"],"mappings":";;;iBAUgB,kBAAA,CACd,OAAA,UACA,SAAA,aACC,OAAW;AAAA,iBAeE,uBAAA,CAAwB,OAAA,WAAkB,OAAW"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CORE_CSS_ATTRIBUTE, THEME_CSS_ATTRIBUTE, UNSAFE_CSS_ATTRIBUTE } from "../constants.js";
|
|
2
2
|
import { createHastElement, createTextNodeElement } from "./hast_utils.js";
|
|
3
3
|
import { wrapCoreCSS, wrapUnsafeCSS } from "./cssWrappers.js";
|
|
4
|
-
|
|
5
4
|
//#region src/utils/createStyleElement.ts
|
|
6
5
|
function createStyleElement(content, isCoreCSS = false) {
|
|
7
6
|
return createHastElement({
|
|
@@ -20,7 +19,7 @@ function createThemeStyleElement(content) {
|
|
|
20
19
|
properties: { [THEME_CSS_ATTRIBUTE]: "" }
|
|
21
20
|
});
|
|
22
21
|
}
|
|
23
|
-
|
|
24
22
|
//#endregion
|
|
25
23
|
export { createStyleElement, createThemeStyleElement };
|
|
24
|
+
|
|
26
25
|
//# sourceMappingURL=createStyleElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createStyleElement.js","names":[],"sources":["../../src/utils/createStyleElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport {\n CORE_CSS_ATTRIBUTE,\n THEME_CSS_ATTRIBUTE,\n UNSAFE_CSS_ATTRIBUTE,\n} from '../constants';\nimport { wrapCoreCSS, wrapUnsafeCSS } from './cssWrappers';\nimport { createHastElement, createTextNodeElement } from './hast_utils';\n\nexport function createStyleElement(\n content: string,\n isCoreCSS: boolean = false\n): HASTElement {\n return createHastElement({\n tagName: 'style',\n children: [\n createTextNodeElement(\n isCoreCSS ? wrapCoreCSS(content) : wrapUnsafeCSS(content)\n ),\n ],\n properties: {\n [CORE_CSS_ATTRIBUTE]: isCoreCSS ? '' : undefined,\n [UNSAFE_CSS_ATTRIBUTE]: !isCoreCSS ? '' : undefined,\n },\n });\n}\n\nexport function createThemeStyleElement(content: string): HASTElement {\n return createHastElement({\n tagName: 'style',\n children: [createTextNodeElement(content)],\n properties: {\n [THEME_CSS_ATTRIBUTE]: '',\n },\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createStyleElement.js","names":[],"sources":["../../src/utils/createStyleElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport {\n CORE_CSS_ATTRIBUTE,\n THEME_CSS_ATTRIBUTE,\n UNSAFE_CSS_ATTRIBUTE,\n} from '../constants';\nimport { wrapCoreCSS, wrapUnsafeCSS } from './cssWrappers';\nimport { createHastElement, createTextNodeElement } from './hast_utils';\n\nexport function createStyleElement(\n content: string,\n isCoreCSS: boolean = false\n): HASTElement {\n return createHastElement({\n tagName: 'style',\n children: [\n createTextNodeElement(\n isCoreCSS ? wrapCoreCSS(content) : wrapUnsafeCSS(content)\n ),\n ],\n properties: {\n [CORE_CSS_ATTRIBUTE]: isCoreCSS ? '' : undefined,\n [UNSAFE_CSS_ATTRIBUTE]: !isCoreCSS ? '' : undefined,\n },\n });\n}\n\nexport function createThemeStyleElement(content: string): HASTElement {\n return createHastElement({\n tagName: 'style',\n children: [createTextNodeElement(content)],\n properties: {\n [THEME_CSS_ATTRIBUTE]: '',\n },\n });\n}\n"],"mappings":";;;;AAUA,SAAgB,mBACd,SACA,YAAqB,OACR;CACb,OAAO,kBAAkB;EACvB,SAAS;EACT,UAAU,CACR,sBACE,YAAY,YAAY,OAAO,IAAI,cAAc,OAAO,CAC1D,CACF;EACA,YAAY;IACT,qBAAqB,YAAY,KAAK,KAAA;IACtC,uBAAuB,CAAC,YAAY,KAAK,KAAA;EAC5C;CACF,CAAC;AACH;AAEA,SAAgB,wBAAwB,SAA8B;CACpE,OAAO,kBAAkB;EACvB,SAAS;EACT,UAAU,CAAC,sBAAsB,OAAO,CAAC;EACzC,YAAY,GACT,sBAAsB,GACzB;CACF,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTransformerWithState.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"createTransformerWithState.d.ts","names":[],"sources":["../../src/utils/createTransformerWithState.ts"],"mappings":";;;;UAYU,gCAAA;EACR,KAAA,EAAO,iBAAA;EACP,YAAA,EAAc,gBAAA;EACd,OAAA,EAAS,4BAAA;AAAA;AAAA,iBAOK,0BAAA,CACd,mBAAA,YACA,aAAA,aACC,gCAAgC"}
|
|
@@ -2,7 +2,6 @@ import { findCodeElement } from "./hast_utils.js";
|
|
|
2
2
|
import { processLine } from "./processLine.js";
|
|
3
3
|
import { wrapTokenFragments } from "./wrapTokenFragments.js";
|
|
4
4
|
import { transformerStyleToClass } from "@shikijs/transformers";
|
|
5
|
-
|
|
6
5
|
//#region src/utils/createTransformerWithState.ts
|
|
7
6
|
function createTransformerWithState(useTokenTransformer = false, useCSSClasses = false) {
|
|
8
7
|
const state = { lineInfo: [] };
|
|
@@ -84,7 +83,7 @@ const tokenStyleNormalizer = {
|
|
|
84
83
|
}
|
|
85
84
|
}
|
|
86
85
|
};
|
|
87
|
-
|
|
88
86
|
//#endregion
|
|
89
87
|
export { createTransformerWithState };
|
|
88
|
+
|
|
90
89
|
//# sourceMappingURL=createTransformerWithState.js.map
|