@openclaw/diffs 2026.9.5 → 2026.9.6
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 +2 -1
- package/dist/assets/viewer-runtime.js +37 -37
- package/dist/index.js +42 -16
- package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts +4 -4
- package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/CodeView.js +8 -6
- package/node_modules/@pierre/diffs/dist/components/CodeView.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/File.d.ts +3 -15
- package/node_modules/@pierre/diffs/dist/components/File.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts +9 -37
- package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/FileDiff.js +15 -12
- package/node_modules/@pierre/diffs/dist/components/FileDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/FileStream.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/components/FileStream.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.d.ts +1 -1
- package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.js +2 -1
- package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts +2 -8
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js +11 -9
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts +2 -8
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js +11 -9
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/Virtualizer.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/components/Virtualizer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/Virtualizer.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/VirtulizerDevelopment.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/components/VirtulizerDevelopment.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/web-components.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/web-components.js +2 -1
- package/node_modules/@pierre/diffs/dist/components/web-components.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/constants.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/constants.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/EditStateManager.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/EditStateManager.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/EditStateManager.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/cloneRetainedDiffSessionSnapshot.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/cloneRetainedDiffSessionSnapshot.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/command.d.ts +2 -1
- package/node_modules/@pierre/diffs/dist/editor/command.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editPrediction.d.ts +3 -2
- package/node_modules/@pierre/diffs/dist/editor/editPrediction.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editPrediction.js +11 -11
- package/node_modules/@pierre/diffs/dist/editor/editPrediction.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editStack.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/editStack.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editStack.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editor.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/editor/editor.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editor.js +24 -19
- package/node_modules/@pierre/diffs/dist/editor/editor.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editor2.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/languages.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/languages.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/languages.js +1 -1
- package/node_modules/@pierre/diffs/dist/editor/languages.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.js +2 -1
- package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/marker.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/marker.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/marker.js +5 -3
- package/node_modules/@pierre/diffs/dist/editor/marker.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/matchBrackets.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/matchBrackets.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/pieceTable.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/pieceTable.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/pieceTable.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/platform.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/editor/platform.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/platform.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/popover.d.ts +12 -12
- package/node_modules/@pierre/diffs/dist/editor/popover.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/popover.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/searchPanel.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/searchPanel.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/searchPanel.js +16 -12
- package/node_modules/@pierre/diffs/dist/editor/searchPanel.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/selection.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/selection.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/selection.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/selectionAction.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/selectionAction.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/selectionAction.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/sprite.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/textDocument.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/textDocument.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/textDocument.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/textDocumentChangeTransaction.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/textDocumentChangeTransaction.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/textMeasure.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/textMeasure.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/tokenizer.d.ts +1 -11
- package/node_modules/@pierre/diffs/dist/editor/tokenizer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/tokenizer.js +8 -4
- package/node_modules/@pierre/diffs/dist/editor/tokenizer.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/types.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/types.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/utils.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/utils.js +11 -7
- package/node_modules/@pierre/diffs/dist/editor/utils.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/areLanguagesAttached.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/areLanguagesAttached.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/attachResolvedLanguages.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/highlighter/languages/attachResolvedLanguages.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/cleanUpResolvedLanguages.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/constants.d.ts +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/constants.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedLanguages.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedLanguages.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedOrResolveLanguage.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedOrResolveLanguage.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/hasResolvedLanguages.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/hasResolvedLanguages.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/registerCustomLanguage.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/registerCustomLanguage.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguage.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguage.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguages.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguages.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.d.ts +1 -6
- package/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/areThemesAttached.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/areThemesAttached.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/attachResolvedThemes.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/attachResolvedThemes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/cleanUpResolvedThemes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/constants.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedOrResolveTheme.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedOrResolveTheme.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedThemes.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedThemes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/hasResolvedThemes.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/hasResolvedThemes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomCSSVariableTheme.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomTheme.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomTheme.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveTheme.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveTheme.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveThemes.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveThemes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolution.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolution.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolver.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolver.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/index.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/managers/InteractionManager.d.ts +2 -26
- package/node_modules/@pierre/diffs/dist/managers/InteractionManager.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/managers/InteractionManager.js +1 -3
- package/node_modules/@pierre/diffs/dist/managers/InteractionManager.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/managers/ResizeManager.d.ts +1 -4
- package/node_modules/@pierre/diffs/dist/managers/ResizeManager.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/managers/ScrollSyncManager.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/node_modules/.pnpm/@types_unist@3.0.3/node_modules/@types/unist/index.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/CodeView.d.ts +9 -1
- package/node_modules/@pierre/diffs/dist/react/CodeView.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/CodeView.js +39 -33
- package/node_modules/@pierre/diffs/dist/react/CodeView.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/EditContext.d.ts +2 -5
- package/node_modules/@pierre/diffs/dist/react/EditContext.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/File.d.ts +1 -23
- package/node_modules/@pierre/diffs/dist/react/File.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/File.js +13 -12
- package/node_modules/@pierre/diffs/dist/react/File.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/FileDiff.d.ts +1 -23
- package/node_modules/@pierre/diffs/dist/react/FileDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/FileDiff.js +13 -12
- package/node_modules/@pierre/diffs/dist/react/FileDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.d.ts +1 -24
- package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.js +13 -12
- package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/PatchDiff.d.ts +1 -23
- package/node_modules/@pierre/diffs/dist/react/PatchDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/PatchDiff.js +13 -12
- package/node_modules/@pierre/diffs/dist/react/PatchDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.d.ts +1 -18
- package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.js +15 -14
- package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/Virtualizer.d.ts +1 -9
- package/node_modules/@pierre/diffs/dist/react/Virtualizer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/Virtualizer.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/WorkerPoolContext.d.ts +2 -6
- package/node_modules/@pierre/diffs/dist/react/WorkerPoolContext.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/constants.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/react/constants.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/jsx.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/react/jsx.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/types.d.ts +1 -1
- package/node_modules/@pierre/diffs/dist/react/types.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/assignRef.d.ts +6 -0
- package/node_modules/@pierre/diffs/dist/react/utils/assignRef.d.ts.map +1 -0
- package/node_modules/@pierre/diffs/dist/react/utils/assignRef.js +9 -0
- package/node_modules/@pierre/diffs/dist/react/utils/assignRef.js.map +1 -0
- package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.d.ts +1 -16
- package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.d.ts +1 -13
- package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/templateRender.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/react/utils/templateRender.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.d.ts +2 -18
- package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.js +31 -17
- package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.d.ts +2 -16
- package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.js +8 -4
- package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useStableCallback.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useUnresolvedFileInstance.d.ts +1 -12
- package/node_modules/@pierre/diffs/dist/react/utils/useUnresolvedFileInstance.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts +4 -9
- package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js +28 -21
- package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/UnresolvedFileHunksRenderer.d.ts +3 -9
- package/node_modules/@pierre/diffs/dist/renderers/UnresolvedFileHunksRenderer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/stream.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/stream.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/stream.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/types.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/types.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/sprite.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.d.ts +1 -8
- package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.js +8 -3
- package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.d.ts +6 -34
- package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/preloadFile.d.ts +1 -6
- package/node_modules/@pierre/diffs/dist/ssr/preloadFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/preloadPatchFile.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/ssr/preloadPatchFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/renderHTML.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/ssr/renderHTML.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/string-import.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/style.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/types.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/types.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/appendItems.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/applyLineTextWithNewline.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areDiffLineAnnotationsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areDiffLineAnnotationsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areDiffRenderOptionsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areDiffRenderOptionsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areDiffTargetsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areDiffTargetsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areFileRenderOptionsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areFileRenderOptionsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areFileTargetsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areFileTargetsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areFilesEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areFilesEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areHunkDataEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areHunkDataEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areLineAnnotationsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areLineAnnotationsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areMergeConflictActionsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areMergeConflictActionsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areObjectsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areOptionsEqual.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/utils/areOptionsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/arePrePropertiesEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/arePrePropertiesEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areRenderRangesEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areRenderRangesEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areSelectionPointsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areSelectionPointsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areSelectionsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areSelectionsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areThemesEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areThemesEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areVirtualWindowSpecsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areVirtualWindowSpecsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areWorkerStatsEqual.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/utils/areWorkerStatsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/awaitWithTimeout.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/cleanLastNewline.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/composeCacheKey.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.d.ts +1 -11
- package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.js +9 -8
- package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/computeVirtualFileMetrics.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/computeVirtualFileMetrics.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createAnnotationElement.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createAnnotationElement.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createAnnotationWrapperNode.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createCodeViewHeaderFooterHostElement.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createContentColumn.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createContentColumn.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createEmptyRowBuffer.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createEmptyRowBuffer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.d.ts +1 -6
- package/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createGutterUtilityContentNode.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createGutterUtilityElement.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createGutterUtilityElement.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createNoNewlineElement.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createNoNewlineElement.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createPreElement.d.ts +1 -11
- package/node_modules/@pierre/diffs/dist/utils/createPreElement.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createRowNodes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createSeparator.d.ts +1 -10
- package/node_modules/@pierre/diffs/dist/utils/createSeparator.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createSeparator.js +12 -10
- package/node_modules/@pierre/diffs/dist/utils/createSeparator.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.js +2 -1
- package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createStyleElement.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createStyleElement.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createUnsafeCSSStyleNode.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createWindowFromScrollPosition.d.ts +1 -9
- package/node_modules/@pierre/diffs/dist/utils/createWindowFromScrollPosition.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/cssWrappers.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/cssWrappers.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/cssWrappers.js +5 -3
- package/node_modules/@pierre/diffs/dist/utils/cssWrappers.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/detachString.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/diffAcceptRejectHunk.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/diffAcceptRejectHunk.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/editSessionAnnotations.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/editSessionAnnotations.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/formatCSSVariablePrefix.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.js +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getHighlighterThemeStyles.d.ts +1 -6
- package/node_modules/@pierre/diffs/dist/utils/getHighlighterThemeStyles.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getHunkSeparatorSlotName.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getHunkSeparatorSlotName.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getHunkSideBoundaries.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getIconForType.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getIconForType.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getLineAnnotationName.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getLineAnnotationName.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getLineEndingType.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getLineNodes.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getLineNodes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getMergeConflictActionSlotName.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/utils/getMergeConflictActionSlotName.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getMergeConflictLineTypes.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getMergeConflictLineTypes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getOrCreateCodeNode.d.ts +1 -7
- package/node_modules/@pierre/diffs/dist/utils/getOrCreateCodeNode.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getSingularPatch.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getSingularPatch.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getThemes.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getThemes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/guardWebKitScrollDuringRebuild.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/hast_utils.d.ts +2 -12
- package/node_modules/@pierre/diffs/dist/utils/hast_utils.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/hostTheme.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/utils/hostTheme.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/includesFileAnnotations.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/includesFileAnnotations.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/isDefaultRenderRange.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/isDefaultRenderRange.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/isDiffPlainText.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/isDiffPlainText.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/isFilePlainText.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/isFilePlainText.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/isGutterUtilityPath.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/isStyleNode.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/isWorkerContext.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.d.ts +1 -10
- package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.js +5 -3
- package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/lineAnnotationIdentity.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/lineAnnotationIdentity.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/normalizeDiffResolution.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/normalizeDiffResolution.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parseDiffDecorations.d.ts +2 -13
- package/node_modules/@pierre/diffs/dist/utils/parseDiffDecorations.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js +2 -1
- package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parseLineType.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/parseLineType.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parseMergeConflictDiffFromFile.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/parseMergeConflictDiffFromFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js +8 -5
- package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/platform.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/prefersReducedMotion.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/prerenderHTMLIfNecessary.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/processLine.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/processLine.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.d.ts +1 -8
- package/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.d.ts +1 -11
- package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/resolveConflict.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/resolveConflict.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/resolveRegion.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/resolveRegion.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/roundToDevicePixel.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/scrollbarGutter.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/scrollbarGutter.js +2 -1
- package/node_modules/@pierre/diffs/dist/utils/scrollbarGutter.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/setLanguageOverride.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/setLanguageOverride.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.d.ts +1 -11
- package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.js +1 -3
- package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/splitFileContents.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/trimPatchContext.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.d.ts +10 -55
- package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/wrapTokenFragments.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/wrapTokenFragments.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts +2 -17
- package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js +8 -5
- package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/worker/getOrCreateWorkerPoolSingleton.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/worker/getOrCreateWorkerPoolSingleton.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/worker/types.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/worker/types.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/worker/worker-portable.d.ts +1 -1
- package/node_modules/@pierre/diffs/dist/worker/worker-portable.js +113 -354
- package/node_modules/@pierre/diffs/dist/worker/worker-portable.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/worker/worker.d.ts +1 -1
- package/node_modules/@pierre/diffs/dist/worker/worker.js +14 -11
- package/node_modules/@pierre/diffs/dist/worker/worker.js.map +1 -1
- package/node_modules/@pierre/diffs/package.json +4 -5
- package/node_modules/zod/README.md +2 -2
- package/node_modules/zod/compile.cjs +19 -0
- package/node_modules/zod/index.cjs +19 -0
- package/node_modules/zod/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +8 -7
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v4/classic/external.ts +2 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
- package/node_modules/zod/src/v4/classic/schemas.ts +243 -168
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +60 -9
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +265 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +40 -2
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +95 -1
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +234 -38
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
- package/node_modules/zod/src/v4/core/api.ts +44 -28
- package/node_modules/zod/src/v4/core/checks.ts +62 -102
- package/node_modules/zod/src/v4/core/compile.ts +218 -93
- package/node_modules/zod/src/v4/core/core.ts +1 -3
- package/node_modules/zod/src/v4/core/doc.ts +6 -2
- package/node_modules/zod/src/v4/core/errors.ts +3 -6
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +185 -81
- package/node_modules/zod/src/v4/core/memoizer.ts +75 -28
- package/node_modules/zod/src/v4/core/parse.ts +37 -16
- package/node_modules/zod/src/v4/core/regexes.ts +14 -4
- package/node_modules/zod/src/v4/core/schemas.ts +296 -132
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +399 -2
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
- package/node_modules/zod/src/v4/core/to-json-schema.ts +9 -7
- package/node_modules/zod/src/v4/core/util.ts +218 -147
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/locales/ar.ts +2 -0
- package/node_modules/zod/src/v4/locales/az.ts +2 -0
- package/node_modules/zod/src/v4/locales/be.ts +2 -0
- package/node_modules/zod/src/v4/locales/bg.ts +2 -0
- package/node_modules/zod/src/v4/locales/bn.ts +2 -0
- package/node_modules/zod/src/v4/locales/ca.ts +2 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +2 -0
- package/node_modules/zod/src/v4/locales/cs.ts +2 -0
- package/node_modules/zod/src/v4/locales/da.ts +2 -0
- package/node_modules/zod/src/v4/locales/de.ts +2 -0
- package/node_modules/zod/src/v4/locales/el.ts +2 -0
- package/node_modules/zod/src/v4/locales/en.ts +2 -0
- package/node_modules/zod/src/v4/locales/eo.ts +2 -0
- package/node_modules/zod/src/v4/locales/es.ts +2 -0
- package/node_modules/zod/src/v4/locales/fa.ts +2 -0
- package/node_modules/zod/src/v4/locales/fi.ts +2 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +2 -0
- package/node_modules/zod/src/v4/locales/fr.ts +2 -0
- package/node_modules/zod/src/v4/locales/gu.ts +2 -0
- package/node_modules/zod/src/v4/locales/he.ts +2 -0
- package/node_modules/zod/src/v4/locales/hi.ts +2 -0
- package/node_modules/zod/src/v4/locales/hr.ts +2 -0
- package/node_modules/zod/src/v4/locales/hu.ts +2 -0
- package/node_modules/zod/src/v4/locales/hy.ts +2 -0
- package/node_modules/zod/src/v4/locales/id.ts +2 -0
- package/node_modules/zod/src/v4/locales/index.ts +1 -0
- package/node_modules/zod/src/v4/locales/is.ts +2 -0
- package/node_modules/zod/src/v4/locales/it.ts +2 -0
- package/node_modules/zod/src/v4/locales/ja.ts +2 -0
- package/node_modules/zod/src/v4/locales/ka.ts +2 -0
- package/node_modules/zod/src/v4/locales/km.ts +2 -0
- package/node_modules/zod/src/v4/locales/kn.ts +2 -0
- package/node_modules/zod/src/v4/locales/ko.ts +2 -0
- package/node_modules/zod/src/v4/locales/lt.ts +2 -0
- package/node_modules/zod/src/v4/locales/mk.ts +2 -0
- package/node_modules/zod/src/v4/locales/ms.ts +2 -0
- package/node_modules/zod/src/v4/locales/ne.ts +2 -0
- package/node_modules/zod/src/v4/locales/nl.ts +2 -0
- package/node_modules/zod/src/v4/locales/nn.ts +2 -0
- package/node_modules/zod/src/v4/locales/no.ts +2 -0
- package/node_modules/zod/src/v4/locales/ota.ts +2 -0
- package/node_modules/zod/src/v4/locales/pl.ts +2 -0
- package/node_modules/zod/src/v4/locales/ps.ts +2 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +2 -0
- package/node_modules/zod/src/v4/locales/pt.ts +2 -0
- package/node_modules/zod/src/v4/locales/ro.ts +2 -0
- package/node_modules/zod/src/v4/locales/ru.ts +2 -0
- package/node_modules/zod/src/v4/locales/sk.ts +2 -0
- package/node_modules/zod/src/v4/locales/sl.ts +2 -0
- package/node_modules/zod/src/v4/locales/sv.ts +2 -0
- package/node_modules/zod/src/v4/locales/ta.ts +2 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +2 -0
- package/node_modules/zod/src/v4/locales/tk.ts +2 -0
- package/node_modules/zod/src/v4/locales/tr.ts +2 -0
- package/node_modules/zod/src/v4/locales/uk.ts +2 -0
- package/node_modules/zod/src/v4/locales/ur.ts +2 -0
- package/node_modules/zod/src/v4/locales/uz.ts +2 -0
- package/node_modules/zod/src/v4/locales/vi.ts +2 -0
- package/node_modules/zod/src/v4/locales/yo.ts +2 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +2 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +2 -0
- package/node_modules/zod/src/v4/mini/external.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +32 -7
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +86 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +23 -0
- package/node_modules/zod/v3/ZodError.cjs +19 -0
- package/node_modules/zod/v3/errors.cjs +19 -0
- package/node_modules/zod/v3/external.cjs +19 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
- package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
- package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
- package/node_modules/zod/v3/helpers/util.cjs +19 -0
- package/node_modules/zod/v3/index.cjs +19 -0
- package/node_modules/zod/v3/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +19 -0
- package/node_modules/zod/v4/classic/checks.cjs +19 -0
- package/node_modules/zod/v4/classic/coerce.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.cjs +19 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/classic/errors.cjs +19 -0
- package/node_modules/zod/v4/classic/external.cjs +22 -1
- package/node_modules/zod/v4/classic/external.d.cts +1 -1
- package/node_modules/zod/v4/classic/external.d.ts +1 -1
- package/node_modules/zod/v4/classic/external.js +1 -1
- package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
- package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
- package/node_modules/zod/v4/classic/in-out.cjs +19 -0
- package/node_modules/zod/v4/classic/index.cjs +19 -0
- package/node_modules/zod/v4/classic/iso.cjs +19 -0
- package/node_modules/zod/v4/classic/parse.cjs +19 -0
- package/node_modules/zod/v4/classic/schemas.cjs +100 -35
- package/node_modules/zod/v4/classic/schemas.d.cts +15 -1
- package/node_modules/zod/v4/classic/schemas.d.ts +15 -1
- package/node_modules/zod/v4/classic/schemas.js +77 -33
- package/node_modules/zod/v4/core/api.cjs +45 -22
- package/node_modules/zod/v4/core/api.d.cts +12 -6
- package/node_modules/zod/v4/core/api.d.ts +12 -6
- package/node_modules/zod/v4/core/api.js +25 -22
- package/node_modules/zod/v4/core/checks.cjs +51 -97
- package/node_modules/zod/v4/core/checks.d.cts +17 -1
- package/node_modules/zod/v4/core/checks.d.ts +17 -1
- package/node_modules/zod/v4/core/checks.js +31 -96
- package/node_modules/zod/v4/core/compile.cjs +173 -78
- package/node_modules/zod/v4/core/compile.d.cts +18 -4
- package/node_modules/zod/v4/core/compile.d.ts +18 -4
- package/node_modules/zod/v4/core/compile.js +154 -79
- package/node_modules/zod/v4/core/core.cjs +20 -1
- package/node_modules/zod/v4/core/core.js +1 -1
- package/node_modules/zod/v4/core/doc.cjs +26 -2
- package/node_modules/zod/v4/core/doc.js +7 -2
- package/node_modules/zod/v4/core/errors.cjs +21 -5
- package/node_modules/zod/v4/core/errors.js +2 -5
- package/node_modules/zod/v4/core/index.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
- package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +188 -72
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +170 -74
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/memoizer.cjs +111 -23
- package/node_modules/zod/v4/core/memoizer.js +69 -23
- package/node_modules/zod/v4/core/parse.cjs +56 -16
- package/node_modules/zod/v4/core/parse.js +37 -16
- package/node_modules/zod/v4/core/regexes.cjs +31 -6
- package/node_modules/zod/v4/core/regexes.d.cts +3 -0
- package/node_modules/zod/v4/core/regexes.d.ts +3 -0
- package/node_modules/zod/v4/core/regexes.js +10 -4
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/schemas.cjs +302 -114
- package/node_modules/zod/v4/core/schemas.d.cts +28 -8
- package/node_modules/zod/v4/core/schemas.d.ts +28 -8
- package/node_modules/zod/v4/core/schemas.js +279 -113
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +28 -7
- package/node_modules/zod/v4/core/to-json-schema.d.cts +4 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +4 -3
- package/node_modules/zod/v4/core/to-json-schema.js +7 -6
- package/node_modules/zod/v4/core/util.cjs +177 -143
- package/node_modules/zod/v4/core/util.d.cts +25 -4
- package/node_modules/zod/v4/core/util.d.ts +25 -4
- package/node_modules/zod/v4/core/util.js +156 -143
- package/node_modules/zod/v4/core/versions.cjs +21 -2
- package/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/core/visit.cjs +19 -0
- package/node_modules/zod/v4/index.cjs +19 -0
- package/node_modules/zod/v4/locales/ar.cjs +2 -0
- package/node_modules/zod/v4/locales/ar.js +2 -0
- package/node_modules/zod/v4/locales/az.cjs +2 -0
- package/node_modules/zod/v4/locales/az.js +2 -0
- package/node_modules/zod/v4/locales/be.cjs +2 -0
- package/node_modules/zod/v4/locales/be.js +2 -0
- package/node_modules/zod/v4/locales/bg.cjs +2 -0
- package/node_modules/zod/v4/locales/bg.js +2 -0
- package/node_modules/zod/v4/locales/bn.cjs +2 -0
- package/node_modules/zod/v4/locales/bn.js +2 -0
- package/node_modules/zod/v4/locales/ca.cjs +2 -0
- package/node_modules/zod/v4/locales/ca.js +2 -0
- package/node_modules/zod/v4/locales/ckb.cjs +2 -0
- package/node_modules/zod/v4/locales/ckb.js +2 -0
- package/node_modules/zod/v4/locales/cs.cjs +2 -0
- package/node_modules/zod/v4/locales/cs.js +2 -0
- package/node_modules/zod/v4/locales/da.cjs +2 -0
- package/node_modules/zod/v4/locales/da.js +2 -0
- package/node_modules/zod/v4/locales/de.cjs +2 -0
- package/node_modules/zod/v4/locales/de.js +2 -0
- package/node_modules/zod/v4/locales/el.cjs +2 -0
- package/node_modules/zod/v4/locales/el.js +2 -0
- package/node_modules/zod/v4/locales/en.cjs +2 -0
- package/node_modules/zod/v4/locales/en.js +2 -0
- package/node_modules/zod/v4/locales/eo.cjs +2 -0
- package/node_modules/zod/v4/locales/eo.js +2 -0
- package/node_modules/zod/v4/locales/es.cjs +2 -0
- package/node_modules/zod/v4/locales/es.js +2 -0
- package/node_modules/zod/v4/locales/fa.cjs +2 -0
- package/node_modules/zod/v4/locales/fa.js +2 -0
- package/node_modules/zod/v4/locales/fi.cjs +2 -0
- package/node_modules/zod/v4/locales/fi.js +2 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
- package/node_modules/zod/v4/locales/fr-CA.js +2 -0
- package/node_modules/zod/v4/locales/fr.cjs +2 -0
- package/node_modules/zod/v4/locales/fr.js +2 -0
- package/node_modules/zod/v4/locales/gu.cjs +2 -0
- package/node_modules/zod/v4/locales/gu.js +2 -0
- package/node_modules/zod/v4/locales/he.cjs +2 -0
- package/node_modules/zod/v4/locales/he.js +2 -0
- package/node_modules/zod/v4/locales/hi.cjs +2 -0
- package/node_modules/zod/v4/locales/hi.js +2 -0
- package/node_modules/zod/v4/locales/hr.cjs +2 -0
- package/node_modules/zod/v4/locales/hr.js +2 -0
- package/node_modules/zod/v4/locales/hu.cjs +2 -0
- package/node_modules/zod/v4/locales/hu.js +2 -0
- package/node_modules/zod/v4/locales/hy.cjs +2 -0
- package/node_modules/zod/v4/locales/hy.js +2 -0
- package/node_modules/zod/v4/locales/id.cjs +2 -0
- package/node_modules/zod/v4/locales/id.js +2 -0
- package/node_modules/zod/v4/locales/index.cjs +22 -1
- package/node_modules/zod/v4/locales/index.d.cts +1 -0
- package/node_modules/zod/v4/locales/index.d.ts +1 -0
- package/node_modules/zod/v4/locales/index.js +1 -0
- package/node_modules/zod/v4/locales/is.cjs +2 -0
- package/node_modules/zod/v4/locales/is.js +2 -0
- package/node_modules/zod/v4/locales/it.cjs +2 -0
- package/node_modules/zod/v4/locales/it.js +2 -0
- package/node_modules/zod/v4/locales/ja.cjs +2 -0
- package/node_modules/zod/v4/locales/ja.js +2 -0
- package/node_modules/zod/v4/locales/ka.cjs +2 -0
- package/node_modules/zod/v4/locales/ka.js +2 -0
- package/node_modules/zod/v4/locales/km.cjs +2 -0
- package/node_modules/zod/v4/locales/km.js +2 -0
- package/node_modules/zod/v4/locales/kn.cjs +2 -0
- package/node_modules/zod/v4/locales/kn.js +2 -0
- package/node_modules/zod/v4/locales/ko.cjs +2 -0
- package/node_modules/zod/v4/locales/ko.js +2 -0
- package/node_modules/zod/v4/locales/lt.cjs +2 -0
- package/node_modules/zod/v4/locales/lt.js +2 -0
- package/node_modules/zod/v4/locales/mk.cjs +2 -0
- package/node_modules/zod/v4/locales/mk.js +2 -0
- package/node_modules/zod/v4/locales/ms.cjs +2 -0
- package/node_modules/zod/v4/locales/ms.js +2 -0
- package/node_modules/zod/v4/locales/ne.cjs +2 -0
- package/node_modules/zod/v4/locales/ne.js +2 -0
- package/node_modules/zod/v4/locales/nl.cjs +2 -0
- package/node_modules/zod/v4/locales/nl.js +2 -0
- package/node_modules/zod/v4/locales/nn.cjs +2 -0
- package/node_modules/zod/v4/locales/nn.js +2 -0
- package/node_modules/zod/v4/locales/no.cjs +2 -0
- package/node_modules/zod/v4/locales/no.js +2 -0
- package/node_modules/zod/v4/locales/ota.cjs +2 -0
- package/node_modules/zod/v4/locales/ota.js +2 -0
- package/node_modules/zod/v4/locales/pl.cjs +2 -0
- package/node_modules/zod/v4/locales/pl.js +2 -0
- package/node_modules/zod/v4/locales/ps.cjs +2 -0
- package/node_modules/zod/v4/locales/ps.js +2 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +2 -0
- package/node_modules/zod/v4/locales/pt-BR.js +2 -0
- package/node_modules/zod/v4/locales/pt.cjs +2 -0
- package/node_modules/zod/v4/locales/pt.js +2 -0
- package/node_modules/zod/v4/locales/ro.cjs +2 -0
- package/node_modules/zod/v4/locales/ro.js +2 -0
- package/node_modules/zod/v4/locales/ru.cjs +2 -0
- package/node_modules/zod/v4/locales/ru.js +2 -0
- package/node_modules/zod/v4/locales/sk.cjs +2 -0
- package/node_modules/zod/v4/locales/sk.js +2 -0
- package/node_modules/zod/v4/locales/sl.cjs +2 -0
- package/node_modules/zod/v4/locales/sl.js +2 -0
- package/node_modules/zod/v4/locales/sv.cjs +2 -0
- package/node_modules/zod/v4/locales/sv.js +2 -0
- package/node_modules/zod/v4/locales/ta.cjs +2 -0
- package/node_modules/zod/v4/locales/ta.js +2 -0
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +2 -0
- package/node_modules/zod/v4/locales/th.js +2 -0
- package/node_modules/zod/v4/locales/tk.cjs +2 -0
- package/node_modules/zod/v4/locales/tk.js +2 -0
- package/node_modules/zod/v4/locales/tr.cjs +2 -0
- package/node_modules/zod/v4/locales/tr.js +2 -0
- package/node_modules/zod/v4/locales/uk.cjs +2 -0
- package/node_modules/zod/v4/locales/uk.js +2 -0
- package/node_modules/zod/v4/locales/ur.cjs +2 -0
- package/node_modules/zod/v4/locales/ur.js +2 -0
- package/node_modules/zod/v4/locales/uz.cjs +2 -0
- package/node_modules/zod/v4/locales/uz.js +2 -0
- package/node_modules/zod/v4/locales/vi.cjs +2 -0
- package/node_modules/zod/v4/locales/vi.js +2 -0
- package/node_modules/zod/v4/locales/yo.cjs +2 -0
- package/node_modules/zod/v4/locales/yo.js +2 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
- package/node_modules/zod/v4/locales/zh-CN.js +2 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
- package/node_modules/zod/v4/locales/zh-TW.js +2 -0
- package/node_modules/zod/v4/mini/checks.cjs +19 -0
- package/node_modules/zod/v4/mini/coerce.cjs +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/mini/external.cjs +22 -1
- package/node_modules/zod/v4/mini/external.d.cts +1 -1
- package/node_modules/zod/v4/mini/external.d.ts +1 -1
- package/node_modules/zod/v4/mini/external.js +1 -1
- package/node_modules/zod/v4/mini/in-out.cjs +19 -0
- package/node_modules/zod/v4/mini/index.cjs +19 -0
- package/node_modules/zod/v4/mini/iso.cjs +19 -0
- package/node_modules/zod/v4/mini/parse.cjs +19 -0
- package/node_modules/zod/v4/mini/schemas.cjs +44 -8
- package/node_modules/zod/v4/mini/schemas.d.cts +6 -1
- package/node_modules/zod/v4/mini/schemas.d.ts +6 -1
- package/node_modules/zod/v4/mini/schemas.js +21 -6
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/openclaw.plugin.json +4 -2
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsePatchFiles.js","names":[],"sources":["../../src/utils/parsePatchFiles.ts"],"sourcesContent":["import {\n ALTERNATE_FILE_NAMES_GIT,\n COMMIT_METADATA_SPLIT,\n FILENAME_HEADER_REGEX,\n FILENAME_HEADER_REGEX_GIT,\n GIT_DIFF_FILE_BREAK_REGEX,\n INDEX_LINE_METADATA,\n} from '../constants';\nimport type {\n ChangeContent,\n ContextContent,\n FileContents,\n FileDiffMetadata,\n Hunk,\n HunkLineType,\n ParsedPatch,\n} from '../types';\nimport { cleanLastNewline } from './cleanLastNewline';\nimport { composeCacheKey } from './composeCacheKey';\nimport { detachString, releaseStringDetachBuffer } from './detachString';\nimport {\n getHunkSideEndBoundary,\n getHunkSideStartBoundary,\n} from './getHunkSideBoundaries';\nimport { realignChangeContentBySimilarity } from './realignChangeContent';\n\ninterface ParsedHunkHeader {\n additionCount: number;\n additionStart: number;\n deletionCount: number;\n deletionStart: number;\n hunkContext?: string;\n}\n\nexport function processPatch(\n data: string,\n cacheKeyPrefix?: string,\n throwOnError?: boolean\n): ParsedPatch {\n try {\n return _processPatch(data, cacheKeyPrefix, throwOnError);\n } finally {\n releaseStringDetachBuffer();\n }\n}\n\nfunction _processPatch(\n data: string,\n cacheKeyPrefix?: string,\n throwOnError = false,\n patchIndex?: number\n): ParsedPatch {\n const isGitDiff = isGitDiffPatch(data);\n const rawFiles = isGitDiff\n ? splitGitDiffFiles(data)\n : splitUnifiedDiffFiles(data);\n let patchMetadata: string | undefined;\n const files: FileDiffMetadata[] = [];\n for (const fileOrPatchMetadata of rawFiles) {\n if (isGitDiff && !GIT_DIFF_FILE_BREAK_REGEX.test(fileOrPatchMetadata)) {\n if (patchMetadata == null) {\n patchMetadata = detachString(fileOrPatchMetadata);\n } else {\n if (throwOnError) {\n throw Error('parsePatchContent: unknown file blob');\n } else {\n console.error(\n 'parsePatchContent: unknown file blob:',\n fileOrPatchMetadata\n );\n }\n }\n // If we get in here, it's most likely the introductory metadata from the\n // patch, or something is fucked with the diff format\n continue;\n } else if (\n !isGitDiff &&\n !startsWithUnifiedDiffFileHeader(fileOrPatchMetadata)\n ) {\n if (patchMetadata == null) {\n patchMetadata = detachString(fileOrPatchMetadata);\n } else {\n if (throwOnError) {\n throw Error('parsePatchContent: unknown file blob');\n } else {\n console.error(\n 'parsePatchContent: unknown file blob:',\n fileOrPatchMetadata\n );\n }\n }\n continue;\n }\n const currentFile = _processFile(fileOrPatchMetadata, {\n cacheKey:\n cacheKeyPrefix != null\n ? patchIndex == null\n ? composeCacheKey(\n 'patch-file',\n cacheKeyPrefix,\n String(files.length)\n )\n : composeCacheKey(\n 'patch-file',\n cacheKeyPrefix,\n String(patchIndex),\n String(files.length)\n )\n : undefined,\n isGitDiff,\n throwOnError,\n });\n if (currentFile != null) {\n files.push(currentFile);\n }\n }\n return { patchMetadata, files };\n}\n\ninterface ProcessFileOptions {\n cacheKey?: string;\n isGitDiff?: boolean;\n oldFile?: FileContents;\n newFile?: FileContents;\n throwOnError?: boolean;\n}\n\nexport function processFile(\n fileDiffString: string,\n options?: ProcessFileOptions\n): FileDiffMetadata | undefined {\n try {\n return _processFile(fileDiffString, options);\n } finally {\n releaseStringDetachBuffer();\n }\n}\n\nfunction _processFile(\n fileDiffString: string,\n {\n cacheKey,\n isGitDiff = GIT_DIFF_FILE_BREAK_REGEX.test(fileDiffString),\n oldFile,\n newFile,\n throwOnError = false,\n }: ProcessFileOptions = {}\n): FileDiffMetadata | undefined {\n let lastHunkEnd = 0;\n const hunks = splitAtLinePrefix(fileDiffString, '@@ ');\n let currentFile: FileDiffMetadata | undefined;\n const isPartial = oldFile == null || newFile == null;\n let deletionLineIndex = 0;\n let additionLineIndex = 0;\n for (const hunk of hunks) {\n const lines = splitWithNewlines(hunk);\n const firstLine = lines[0];\n if (firstLine == null) {\n if (throwOnError) {\n throw Error('parsePatchContent: invalid hunk');\n } else {\n console.error('parsePatchContent: invalid hunk', hunk);\n }\n continue;\n }\n const fileHeader = parseHunkHeader(firstLine);\n let additionLines = 0;\n let deletionLines = 0;\n // Setup currentFile, this should be the first iteration of our hunks, and\n // technically not a hunk\n if (fileHeader == null || currentFile == null) {\n if (currentFile != null) {\n if (throwOnError) {\n throw Error('parsePatchContent: Invalid hunk');\n } else {\n console.error('parsePatchContent: Invalid hunk', hunk);\n }\n continue;\n }\n currentFile = {\n name: '',\n type: 'change',\n hunks: [],\n splitLineCount: 0,\n unifiedLineCount: 0,\n isPartial,\n additionLines:\n !isPartial && oldFile != null && newFile != null\n ? splitFileContents(newFile.contents)\n : [],\n deletionLines:\n !isPartial && oldFile != null && newFile != null\n ? splitFileContents(oldFile.contents)\n : [],\n cacheKey: maybeDetachOptionalString(cacheKey),\n };\n // If either file is technically empty, then we should empty the\n // arrays respectively\n if (currentFile.additionLines.length === 1 && newFile?.contents === '') {\n currentFile.additionLines.length = 0;\n }\n if (currentFile.deletionLines.length === 1 && oldFile?.contents === '') {\n currentFile.deletionLines.length = 0;\n }\n\n for (const line of lines) {\n if (line.startsWith('diff --git')) {\n const filenameMatch = line.trim().match(ALTERNATE_FILE_NAMES_GIT);\n const prevName = filenameMatch?.[1] ?? filenameMatch?.[2];\n const name = filenameMatch?.[3] ?? filenameMatch?.[4];\n if (prevName == null || name == null) {\n if (throwOnError) {\n throw Error('parsePatchContent: invalid git diff header');\n } else {\n console.error('parsePatchContent: invalid git diff header', line);\n }\n continue;\n }\n currentFile.name = detachString(name.trim());\n if (prevName !== name) {\n currentFile.prevName = detachString(prevName.trim());\n }\n continue;\n }\n\n const filenameMatch =\n line.startsWith('---') || line.startsWith('+++')\n ? line.match(\n isGitDiff ? FILENAME_HEADER_REGEX_GIT : FILENAME_HEADER_REGEX\n )\n : null;\n if (filenameMatch != null) {\n const [, type, fileName] = filenameMatch;\n if (type === '---' && fileName !== '/dev/null') {\n const detachedFileName = detachString(fileName.trim());\n currentFile.prevName = detachedFileName;\n currentFile.name = detachedFileName;\n } else if (type === '+++' && fileName !== '/dev/null') {\n currentFile.name = detachString(fileName.trim());\n }\n }\n // Git diffs have a bunch of additional metadata we can pull from\n else if (isGitDiff) {\n if (line.startsWith('new mode ')) {\n currentFile.mode = detachString(\n line.slice('new mode'.length).trim()\n );\n }\n if (line.startsWith('old mode ')) {\n currentFile.prevMode = detachString(\n line.slice('old mode'.length).trim()\n );\n }\n if (line.startsWith('new file mode')) {\n currentFile.type = 'new';\n currentFile.mode = detachString(\n line.slice('new file mode'.length).trim()\n );\n }\n if (line.startsWith('deleted file mode')) {\n currentFile.type = 'deleted';\n currentFile.mode = detachString(\n line.slice('deleted file mode'.length).trim()\n );\n }\n if (line.startsWith('similarity index')) {\n if (line.startsWith('similarity index 100%')) {\n currentFile.type = 'rename-pure';\n } else {\n currentFile.type = 'rename-changed';\n }\n }\n if (line.startsWith('index ')) {\n const [, prevObjectId, newObjectId, mode] =\n line.trim().match(INDEX_LINE_METADATA) ?? [];\n if (prevObjectId != null) {\n currentFile.prevObjectId = detachString(prevObjectId);\n }\n if (newObjectId != null) {\n currentFile.newObjectId = detachString(newObjectId);\n }\n if (mode != null) {\n currentFile.mode = detachString(mode);\n }\n }\n // We have to handle these for pure renames because there won't be\n // --- and +++ lines\n if (line.startsWith('rename from ')) {\n currentFile.prevName = detachString(\n line.slice('rename from '.length).trim()\n );\n }\n if (line.startsWith('rename to ')) {\n currentFile.name = detachString(\n line.slice('rename to '.length).trim()\n );\n }\n }\n }\n continue;\n }\n\n // Otherwise, time to start parsing out the hunk\n let currentContent: ContextContent | ChangeContent | undefined;\n let lastLineType: 'context' | 'addition' | 'deletion' | undefined;\n\n // Strip trailing bare newlines (format-patch separators between commits)\n // if needed\n while (\n lines.length > 0 &&\n (lines[lines.length - 1] === '\\n' ||\n lines[lines.length - 1] === '\\r' ||\n lines[lines.length - 1] === '\\r\\n' ||\n lines[lines.length - 1] === '')\n ) {\n lines.pop();\n }\n\n const { additionStart, deletionStart } = fileHeader;\n deletionLineIndex = isPartial ? deletionLineIndex : deletionStart - 1;\n additionLineIndex = isPartial ? additionLineIndex : additionStart - 1;\n\n const hunkData: Hunk = {\n collapsedBefore: 0,\n\n splitLineCount: 0,\n splitLineStart: 0,\n\n unifiedLineCount: 0,\n unifiedLineStart: 0,\n\n additionCount: fileHeader.additionCount,\n additionStart,\n additionLines,\n\n deletionCount: fileHeader.deletionCount,\n deletionStart,\n deletionLines,\n\n deletionLineIndex,\n additionLineIndex,\n\n hunkContent: [],\n hunkContext: maybeDetachOptionalString(fileHeader.hunkContext),\n hunkSpecs: detachString(firstLine),\n\n noEOFCRAdditions: false,\n noEOFCRDeletions: false,\n };\n\n // Now we process each line of the hunk\n let parsedAdditionLines = 0;\n let parsedDeletionLines = 0;\n for (let lineIndex = 1; lineIndex < lines.length; lineIndex++) {\n const rawLine = lines[lineIndex];\n if (\n parsedAdditionLines >= hunkData.additionCount &&\n parsedDeletionLines >= hunkData.deletionCount &&\n !rawLine.startsWith('\\\\')\n ) {\n const isUnexpectedBodyLine =\n isHunkBodyLine(rawLine) && !isFormatPatchVersionSeparator(rawLine);\n if (!isUnexpectedBodyLine) {\n break;\n }\n if (throwOnError) {\n throw Error('parsePatchContent: hunk has more lines than expected');\n }\n }\n\n const firstChar = rawLine[0];\n // If we can't properly process the line, well, lets just try to salvage\n // things and continue... It's possible an AI generated diff might have\n // some stray blank lines or something in there\n if (\n firstChar !== '+' &&\n firstChar !== '-' &&\n firstChar !== ' ' &&\n firstChar !== '\\\\'\n ) {\n if (throwOnError) {\n throw Error('parsePatchContent: invalid hunk line');\n }\n console.error(\n `parseLineType: Invalid firstChar: \"${firstChar}\", full line: \"${rawLine}\"`\n );\n console.error('processFile: invalid rawLine:', rawLine);\n continue;\n }\n\n const type = parseRawLineType(firstChar);\n if (type === 'addition') {\n if (throwOnError && parsedAdditionLines >= hunkData.additionCount) {\n throw Error('parsePatchContent: hunk has too many addition lines');\n }\n const line = getParsedLineContent(rawLine);\n if (currentContent == null || currentContent.type !== 'change') {\n currentContent = createContentGroup(\n 'change',\n deletionLineIndex,\n additionLineIndex\n );\n hunkData.hunkContent.push(currentContent);\n }\n additionLineIndex++;\n parsedAdditionLines++;\n if (isPartial) {\n currentFile.additionLines.push(line);\n }\n currentContent.additions++;\n additionLines++;\n lastLineType = 'addition';\n } else if (type === 'deletion') {\n if (throwOnError && parsedDeletionLines >= hunkData.deletionCount) {\n throw Error('parsePatchContent: hunk has too many deletion lines');\n }\n const line = getParsedLineContent(rawLine);\n if (currentContent == null || currentContent.type !== 'change') {\n currentContent = createContentGroup(\n 'change',\n deletionLineIndex,\n additionLineIndex\n );\n hunkData.hunkContent.push(currentContent);\n }\n deletionLineIndex++;\n parsedDeletionLines++;\n if (isPartial) {\n currentFile.deletionLines.push(line);\n }\n currentContent.deletions++;\n deletionLines++;\n lastLineType = 'deletion';\n } else if (type === 'context') {\n if (\n throwOnError &&\n (parsedDeletionLines >= hunkData.deletionCount ||\n parsedAdditionLines >= hunkData.additionCount)\n ) {\n throw Error('parsePatchContent: hunk has too many context lines');\n }\n const line = getParsedLineContent(rawLine);\n if (currentContent == null || currentContent.type !== 'context') {\n currentContent = createContentGroup(\n 'context',\n deletionLineIndex,\n additionLineIndex\n );\n hunkData.hunkContent.push(currentContent);\n }\n additionLineIndex++;\n deletionLineIndex++;\n parsedAdditionLines++;\n parsedDeletionLines++;\n if (isPartial) {\n currentFile.deletionLines.push(line);\n currentFile.additionLines.push(line);\n }\n currentContent.lines++;\n lastLineType = 'context';\n } else if (type === 'metadata' && currentContent != null) {\n if (currentContent.type === 'context') {\n hunkData.noEOFCRAdditions = true;\n hunkData.noEOFCRDeletions = true;\n } else if (lastLineType === 'deletion') {\n hunkData.noEOFCRDeletions = true;\n } else if (lastLineType === 'addition') {\n hunkData.noEOFCRAdditions = true;\n }\n // If we're dealing with partial content from a diff, we need to strip\n // newlines manually from the content\n if (\n isPartial &&\n (lastLineType === 'addition' || lastLineType === 'context')\n ) {\n const lastIndex = currentFile.additionLines.length - 1;\n if (lastIndex >= 0) {\n currentFile.additionLines[lastIndex] = cleanLastNewline(\n currentFile.additionLines[lastIndex]\n );\n }\n }\n if (\n isPartial &&\n (lastLineType === 'deletion' || lastLineType === 'context')\n ) {\n const lastIndex = currentFile.deletionLines.length - 1;\n if (lastIndex >= 0) {\n currentFile.deletionLines[lastIndex] = cleanLastNewline(\n currentFile.deletionLines[lastIndex]\n );\n }\n }\n }\n }\n\n if (\n parsedAdditionLines !== hunkData.additionCount ||\n parsedDeletionLines !== hunkData.deletionCount\n ) {\n if (throwOnError) {\n throw Error('parsePatchContent: hunk line count mismatch');\n }\n console.error(\n `parsePatchContent: hunk line count mismatch: \"${firstLine.trimEnd()}\", declared old/new ${hunkData.deletionCount}/${hunkData.additionCount}, parsed old/new ${parsedDeletionLines}/${parsedAdditionLines}`\n );\n // Re-encode each original boundary using the repaired count. Zero-count\n // ranges use the boundary itself as their start; positive ranges use +1.\n const repairedAdditionStart =\n getHunkSideStartBoundary(\n hunkData.additionStart,\n hunkData.additionCount\n ) + (parsedAdditionLines === 0 ? 0 : 1);\n const repairedDeletionStart =\n getHunkSideStartBoundary(\n hunkData.deletionStart,\n hunkData.deletionCount\n ) + (parsedDeletionLines === 0 ? 0 : 1);\n\n // Hydrated hunks index into full-file line arrays, so their indexes must\n // move with repaired starts. Partial hunks index patch-built arrays.\n if (!isPartial) {\n const additionStartDelta =\n repairedAdditionStart - hunkData.additionStart;\n const deletionStartDelta =\n repairedDeletionStart - hunkData.deletionStart;\n hunkData.additionLineIndex += additionStartDelta;\n hunkData.deletionLineIndex += deletionStartDelta;\n for (const content of hunkData.hunkContent) {\n content.additionLineIndex += additionStartDelta;\n content.deletionLineIndex += deletionStartDelta;\n }\n }\n\n hunkData.additionStart = repairedAdditionStart;\n hunkData.deletionStart = repairedDeletionStart;\n hunkData.additionCount = parsedAdditionLines;\n hunkData.deletionCount = parsedDeletionLines;\n }\n\n hunkData.additionLines = additionLines;\n hunkData.deletionLines = deletionLines;\n\n hunkData.collapsedBefore = Math.max(\n getHunkSideStartBoundary(hunkData.additionStart, hunkData.additionCount) -\n lastHunkEnd,\n 0\n );\n currentFile.hunks.push(hunkData);\n lastHunkEnd = getHunkSideEndBoundary(\n hunkData.additionStart,\n hunkData.additionCount\n );\n for (const content of hunkData.hunkContent) {\n if (content.type === 'context') {\n hunkData.splitLineCount += content.lines;\n hunkData.unifiedLineCount += content.lines;\n } else {\n hunkData.splitLineCount += Math.max(\n content.additions,\n content.deletions\n );\n hunkData.unifiedLineCount += content.deletions + content.additions;\n }\n }\n hunkData.splitLineStart =\n currentFile.splitLineCount + hunkData.collapsedBefore;\n hunkData.unifiedLineStart =\n currentFile.unifiedLineCount + hunkData.collapsedBefore;\n\n currentFile.splitLineCount +=\n hunkData.collapsedBefore + hunkData.splitLineCount;\n currentFile.unifiedLineCount +=\n hunkData.collapsedBefore + hunkData.unifiedLineCount;\n }\n if (currentFile == null) {\n return undefined;\n }\n if (\n throwOnError &&\n isPartial &&\n !isGitDiff &&\n currentFile.hunks.length === 0\n ) {\n throw Error('parsePatchContent: unified file has no hunks');\n }\n\n // Account for collapsed lines after the final hunk and increment the\n // split/unified counts properly\n if (\n currentFile.hunks.length > 0 &&\n !isPartial &&\n currentFile.additionLines.length > 0 &&\n currentFile.deletionLines.length > 0\n ) {\n const lastHunk = currentFile.hunks[currentFile.hunks.length - 1];\n const lastHunkEnd = getHunkSideEndBoundary(\n lastHunk.additionStart,\n lastHunk.additionCount\n );\n const totalFileLines = currentFile.additionLines.length;\n const collapsedAfter = Math.max(totalFileLines - lastHunkEnd, 0);\n currentFile.splitLineCount += collapsedAfter;\n currentFile.unifiedLineCount += collapsedAfter;\n }\n\n // If this isn't a git diff style patch, then we'll need to sus out some\n // additional metadata manually\n if (!isGitDiff) {\n if (\n currentFile.prevName != null &&\n currentFile.name !== currentFile.prevName\n ) {\n if (currentFile.hunks.length > 0) {\n currentFile.type = 'rename-changed';\n } else {\n currentFile.type = 'rename-pure';\n }\n }\n // Sort of a hack for detecting deleted/added files...\n else if (\n (oldFile == null || oldFile.contents === '') &&\n newFile != null &&\n newFile.contents !== ''\n ) {\n currentFile.type = 'new';\n } else if (\n oldFile != null &&\n oldFile.contents !== '' &&\n (newFile == null || newFile.contents === '')\n ) {\n currentFile.type = 'deleted';\n }\n }\n if (\n currentFile.type !== 'rename-pure' &&\n currentFile.type !== 'rename-changed'\n ) {\n currentFile.prevName = undefined;\n }\n // Pair change-block lines by similarity instead of the patch's positional\n // ordering. Partial diffs work too: their hunk line indexes point into the\n // patch-built line arrays, which hold every line a block references.\n realignChangeContentBySimilarity(currentFile);\n return currentFile;\n}\n\n/**\n * Parses a patch file string into an array of parsed patches.\n *\n * @param data - The raw patch file content (supports multi-commit patches)\n * @param cacheKeyPrefix - Optional prefix for collision-safe cache keys derived\n * from the prefix, patch index, and file index. This enables caching of\n * rendered diff results in the worker pool.\n * @param throwOnError - When true, invalid data throws. When false, invalid data\n * is reported with `console.error` and the parser attempts to recover when\n * possible. Recovery is best-effort and does not guarantee valid output.\n */\nexport function parsePatchFiles(\n data: string,\n cacheKeyPrefix?: string,\n throwOnError = false\n): ParsedPatch[] {\n // NOTE(amadeus): This function is pretty forgiving in that it can accept a\n // patch file that includes commit metdata, multiple commits, or not\n const patches: ParsedPatch[] = [];\n const rawPatches = hasCommitMetadataBoundary(data)\n ? data.split(COMMIT_METADATA_SPLIT)\n : [data];\n for (const patch of rawPatches) {\n try {\n patches.push(\n _processPatch(\n patch,\n cacheKeyPrefix,\n throwOnError,\n cacheKeyPrefix != null ? patches.length : undefined\n )\n );\n } catch (error) {\n if (throwOnError) {\n throw error;\n } else {\n console.error(error);\n }\n } finally {\n releaseStringDetachBuffer();\n }\n }\n return patches;\n}\n\nfunction hasCommitMetadataBoundary(data: string): boolean {\n return data.startsWith('From ') || data.includes('\\nFrom ');\n}\n\nfunction splitFileContents(contents: string): string[] {\n const lines = splitWithNewlines(contents);\n for (let index = 0; index < lines.length; index++) {\n lines[index] = detachString(lines[index]);\n }\n return lines;\n}\n\nfunction splitWithNewlines(contents: string): string[] {\n if (contents.length === 0) {\n return [''];\n }\n\n const lines: string[] = [];\n let startIndex = 0;\n for (;;) {\n const newlineIndex = contents.indexOf('\\n', startIndex);\n if (newlineIndex === -1) {\n break;\n }\n\n lines.push(contents.slice(startIndex, newlineIndex + 1));\n startIndex = newlineIndex + 1;\n }\n\n if (startIndex < contents.length) {\n lines.push(contents.slice(startIndex));\n }\n return lines;\n}\n\nfunction splitGitDiffFiles(contents: string): string[] {\n return splitAtLinePrefix(contents, 'diff --git');\n}\n\nfunction splitUnifiedDiffFiles(contents: string): string[] {\n if (contents.length === 0) {\n return [''];\n }\n\n const parts: string[] = [];\n let partStartIndex = 0;\n let lineStartIndex = 0;\n let remainingDeletionLines = 0;\n let remainingAdditionLines = 0;\n let hasOpenedUnifiedFile = false;\n\n while (lineStartIndex < contents.length) {\n const nextLineStartIndex = getNextLineStartIndex(contents, lineStartIndex);\n if (remainingDeletionLines <= 0 && remainingAdditionLines <= 0) {\n if (isUnifiedDiffFileHeaderAt(contents, lineStartIndex)) {\n if (lineStartIndex > partStartIndex) {\n parts.push(contents.slice(partStartIndex, lineStartIndex));\n }\n partStartIndex = lineStartIndex;\n hasOpenedUnifiedFile = true;\n lineStartIndex = getNextLineStartIndex(contents, nextLineStartIndex);\n continue;\n }\n\n if (hasOpenedUnifiedFile && contents.startsWith('@@ -', lineStartIndex)) {\n const fileHeader = parseHunkHeader(\n contents.slice(lineStartIndex, nextLineStartIndex)\n );\n if (fileHeader != null) {\n remainingDeletionLines = fileHeader.deletionCount;\n remainingAdditionLines = fileHeader.additionCount;\n }\n }\n lineStartIndex = nextLineStartIndex;\n continue;\n }\n\n const firstChar = contents[lineStartIndex];\n if (firstChar === '\\\\') {\n lineStartIndex = nextLineStartIndex;\n continue;\n }\n\n if (firstChar === ' ') {\n remainingDeletionLines = Math.max(remainingDeletionLines - 1, 0);\n remainingAdditionLines = Math.max(remainingAdditionLines - 1, 0);\n } else if (firstChar === '-') {\n remainingDeletionLines = Math.max(remainingDeletionLines - 1, 0);\n } else if (firstChar === '+') {\n remainingAdditionLines = Math.max(remainingAdditionLines - 1, 0);\n }\n lineStartIndex = nextLineStartIndex;\n }\n\n parts.push(contents.slice(partStartIndex));\n return parts;\n}\n\nfunction startsWithUnifiedDiffFileHeader(contents: string): boolean {\n return isUnifiedDiffFileHeaderAt(contents, 0);\n}\n\nfunction isUnifiedDiffFileHeaderAt(contents: string, lineStartIndex: number) {\n const nextLineStartIndex = getNextLineStartIndex(contents, lineStartIndex);\n return (\n isUnifiedDiffHeaderLineAt(contents, lineStartIndex, '---') &&\n isUnifiedDiffHeaderLineAt(contents, nextLineStartIndex, '+++')\n );\n}\n\nfunction isUnifiedDiffHeaderLineAt(\n contents: string,\n lineStartIndex: number,\n prefix: '---' | '+++'\n): boolean {\n if (!contents.startsWith(prefix, lineStartIndex)) {\n return false;\n }\n\n const separator = contents[lineStartIndex + prefix.length];\n if (separator !== ' ' && separator !== '\\t') {\n return false;\n }\n\n for (\n let index = lineStartIndex + prefix.length + 1;\n index < contents.length;\n index++\n ) {\n const char = contents[index];\n if (char === '\\n' || char === '\\r') {\n break;\n }\n if (char !== ' ' && char !== '\\t') {\n return true;\n }\n }\n return false;\n}\n\nfunction getNextLineStartIndex(\n contents: string,\n lineStartIndex: number\n): number {\n const newlineIndex = contents.indexOf('\\n', lineStartIndex);\n return newlineIndex === -1 ? contents.length : newlineIndex + 1;\n}\n\nfunction isHunkBodyLine(line: string): boolean {\n const firstChar = line[0];\n return firstChar === '+' || firstChar === '-' || firstChar === ' ';\n}\n\nfunction isFormatPatchVersionSeparator(line: string): boolean {\n if (!line.startsWith('--')) {\n return false;\n }\n\n for (let index = 2; index < line.length; index++) {\n const char = line[index];\n if (char !== ' ' && char !== '\\t' && char !== '\\n' && char !== '\\r') {\n return false;\n }\n }\n return true;\n}\n\nfunction parseHunkHeader(line: string): ParsedHunkHeader | undefined {\n if (!line.startsWith('@@ -')) {\n return undefined;\n }\n\n let index = 4;\n const deletionStartResult = readPositiveInteger(line, index);\n if (deletionStartResult == null) {\n return undefined;\n }\n const deletionStart = deletionStartResult.value;\n index = deletionStartResult.endIndex;\n\n let deletionCount = 1;\n if (line[index] === ',') {\n const deletionCountResult = readPositiveInteger(line, index + 1);\n if (deletionCountResult == null) {\n return undefined;\n }\n deletionCount = deletionCountResult.value;\n index = deletionCountResult.endIndex;\n }\n\n if (line[index] !== ' ' || line[index + 1] !== '+') {\n return undefined;\n }\n index += 2;\n\n const additionStartResult = readPositiveInteger(line, index);\n if (additionStartResult == null) {\n return undefined;\n }\n const additionStart = additionStartResult.value;\n index = additionStartResult.endIndex;\n\n let additionCount = 1;\n if (line[index] === ',') {\n const additionCountResult = readPositiveInteger(line, index + 1);\n if (additionCountResult == null) {\n return undefined;\n }\n additionCount = additionCountResult.value;\n index = additionCountResult.endIndex;\n }\n\n if (\n line[index] !== ' ' ||\n line[index + 1] !== '@' ||\n line[index + 2] !== '@'\n ) {\n return undefined;\n }\n\n let hunkContext: string | undefined;\n const contextStartIndex = index + 3;\n if (line[contextStartIndex] === ' ') {\n hunkContext = trimLineEnd(line.slice(contextStartIndex + 1));\n }\n\n return {\n additionCount,\n additionStart,\n deletionCount,\n deletionStart,\n hunkContext,\n };\n}\n\nfunction readPositiveInteger(\n value: string,\n startIndex: number\n): { value: number; endIndex: number } | undefined {\n let index = startIndex;\n let parsedValue = 0;\n for (; index < value.length; index++) {\n const digit = value.charCodeAt(index) - 48;\n if (digit < 0 || digit > 9) {\n break;\n }\n parsedValue = parsedValue * 10 + digit;\n }\n\n if (index === startIndex) {\n return undefined;\n }\n return { value: parsedValue, endIndex: index };\n}\n\nfunction trimLineEnd(value: string): string {\n if (value.endsWith('\\r\\n')) {\n return value.slice(0, -2);\n }\n if (value.endsWith('\\n')) {\n return value.slice(0, -1);\n }\n return value;\n}\n\nfunction isGitDiffPatch(data: string): boolean {\n return data.startsWith('diff --git') || data.includes('\\ndiff --git');\n}\n\nfunction splitAtLinePrefix(contents: string, prefix: string): string[] {\n if (contents.length === 0) {\n return [''];\n }\n\n const newlinePrefix = `\\n${prefix}`;\n const firstBoundaryIndex = contents.startsWith(prefix)\n ? 0\n : findLinePrefixIndex(contents, newlinePrefix, 0);\n if (firstBoundaryIndex === -1) {\n return [contents];\n }\n\n const parts: string[] = [];\n if (firstBoundaryIndex > 0) {\n parts.push(contents.slice(0, firstBoundaryIndex));\n }\n\n let startIndex = firstBoundaryIndex;\n for (;;) {\n const nextBoundaryIndex = findLinePrefixIndex(\n contents,\n newlinePrefix,\n startIndex + 1\n );\n if (nextBoundaryIndex === -1) {\n break;\n }\n\n parts.push(contents.slice(startIndex, nextBoundaryIndex));\n startIndex = nextBoundaryIndex;\n }\n parts.push(contents.slice(startIndex));\n return parts;\n}\n\nfunction findLinePrefixIndex(\n contents: string,\n newlinePrefix: string,\n fromIndex: number\n): number {\n const index = contents.indexOf(newlinePrefix, fromIndex);\n return index === -1 ? -1 : index + 1;\n}\n\nfunction maybeDetachOptionalString<T extends string | undefined>(value: T): T {\n return (value == null ? value : detachString(value)) as T;\n}\n\nfunction parseRawLineType(\n firstChar: string | undefined\n): Exclude<HunkLineType, 'expanded'> {\n return firstChar === ' '\n ? 'context'\n : firstChar === '\\\\'\n ? 'metadata'\n : firstChar === '+'\n ? 'addition'\n : 'deletion';\n}\n\nfunction getParsedLineContent(rawLine: string): string {\n const processedLine = rawLine.slice(1);\n return detachString(processedLine === '' ? '\\n' : processedLine);\n}\n\nfunction createContentGroup(\n type: 'change',\n deletionLineIndex: number,\n additionLineIndex: number\n): ChangeContent;\nfunction createContentGroup(\n type: 'context',\n deletionLineIndex: number,\n additionLineIndex: number\n): ContextContent;\nfunction createContentGroup(\n type: 'change' | 'context',\n deletionLineIndex: number,\n additionLineIndex: number\n): ChangeContent | ContextContent {\n if (type === 'change') {\n return {\n type: 'change',\n additions: 0,\n deletions: 0,\n additionLineIndex,\n deletionLineIndex,\n };\n }\n return {\n type: 'context',\n lines: 0,\n additionLineIndex,\n deletionLineIndex,\n };\n}\n"],"mappings":";;;;;;;AAkCA,SAAgB,aACd,MACA,gBACA,cACa;CACb,IAAI;EACF,OAAO,cAAc,MAAM,gBAAgB,YAAY;CACzD,UAAU;EACR,0BAA0B;CAC5B;AACF;AAEA,SAAS,cACP,MACA,gBACA,eAAe,OACf,YACa;CACb,MAAM,YAAY,eAAe,IAAI;CACrC,MAAM,WAAW,YACb,kBAAkB,IAAI,IACtB,sBAAsB,IAAI;CAC9B,IAAI;CACJ,MAAM,QAA4B,CAAC;CACnC,KAAK,MAAM,uBAAuB,UAAU;EAC1C,IAAI,aAAa,CAAC,0BAA0B,KAAK,mBAAmB,GAAG;GACrE,IAAI,iBAAiB,MACnB,gBAAgB,aAAa,mBAAmB;QAEhD,IAAI,cACF,MAAM,MAAM,sCAAsC;QAElD,QAAQ,MACN,yCACA,mBACF;GAKJ;EACF,OAAO,IACL,CAAC,aACD,CAAC,gCAAgC,mBAAmB,GACpD;GACA,IAAI,iBAAiB,MACnB,gBAAgB,aAAa,mBAAmB;QAEhD,IAAI,cACF,MAAM,MAAM,sCAAsC;QAElD,QAAQ,MACN,yCACA,mBACF;GAGJ;EACF;EACA,MAAM,cAAc,aAAa,qBAAqB;GACpD,UACE,kBAAkB,OACd,cAAc,OACZ,gBACE,cACA,gBACA,OAAO,MAAM,MAAM,CACrB,IACA,gBACE,cACA,gBACA,OAAO,UAAU,GACjB,OAAO,MAAM,MAAM,CACrB,IACF,KAAA;GACN;GACA;EACF,CAAC;EACD,IAAI,eAAe,MACjB,MAAM,KAAK,WAAW;CAE1B;CACA,OAAO;EAAE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ACA,cAAc,OACZ,aACA,cAAc,MACZ,aACA;AACV;AAEA,SAAS,qBAAqB,SAAyB;CACrD,MAAM,gBAAgB,QAAQ,MAAM,CAAC;CACrC,OAAO,aAAa,kBAAkB,KAAK,OAAO,aAAa;AACjE;AAYA,SAAS,mBACP,MACA,mBACA,mBACgC;CAChC,IAAI,SAAS,UACX,OAAO;EACL,MAAM;EACN,WAAW;EACX,WAAW;EACX;EACA;CACF;CAEF,OAAO;EACL,MAAM;EACN,OAAO;EACP;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"parsePatchFiles.js","names":[],"sources":["../../src/utils/parsePatchFiles.ts"],"sourcesContent":["import {\n ALTERNATE_FILE_NAMES_GIT,\n COMMIT_METADATA_SPLIT,\n FILENAME_HEADER_REGEX,\n FILENAME_HEADER_REGEX_GIT,\n GIT_DIFF_FILE_BREAK_REGEX,\n INDEX_LINE_METADATA,\n} from '../constants';\nimport type {\n ChangeContent,\n ContextContent,\n FileContents,\n FileDiffMetadata,\n Hunk,\n HunkLineType,\n ParsedPatch,\n} from '../types';\nimport { cleanLastNewline } from './cleanLastNewline';\nimport { composeCacheKey } from './composeCacheKey';\nimport { detachString, releaseStringDetachBuffer } from './detachString';\nimport {\n getHunkSideEndBoundary,\n getHunkSideStartBoundary,\n} from './getHunkSideBoundaries';\nimport { realignChangeContentBySimilarity } from './realignChangeContent';\n\ninterface ParsedHunkHeader {\n additionCount: number;\n additionStart: number;\n deletionCount: number;\n deletionStart: number;\n hunkContext?: string;\n}\n\nexport function processPatch(\n data: string,\n cacheKeyPrefix?: string,\n throwOnError?: boolean\n): ParsedPatch {\n try {\n return _processPatch(data, cacheKeyPrefix, throwOnError);\n } finally {\n releaseStringDetachBuffer();\n }\n}\n\nfunction _processPatch(\n data: string,\n cacheKeyPrefix?: string,\n throwOnError = false,\n patchIndex?: number\n): ParsedPatch {\n const isGitDiff = isGitDiffPatch(data);\n const rawFiles = isGitDiff\n ? splitGitDiffFiles(data)\n : splitUnifiedDiffFiles(data);\n let patchMetadata: string | undefined;\n const files: FileDiffMetadata[] = [];\n for (const fileOrPatchMetadata of rawFiles) {\n if (isGitDiff && !GIT_DIFF_FILE_BREAK_REGEX.test(fileOrPatchMetadata)) {\n if (patchMetadata == null) {\n patchMetadata = detachString(fileOrPatchMetadata);\n } else {\n if (throwOnError) {\n throw Error('parsePatchContent: unknown file blob');\n } else {\n console.error(\n 'parsePatchContent: unknown file blob:',\n fileOrPatchMetadata\n );\n }\n }\n // If we get in here, it's most likely the introductory metadata from the\n // patch, or something is fucked with the diff format\n continue;\n } else if (\n !isGitDiff &&\n !startsWithUnifiedDiffFileHeader(fileOrPatchMetadata)\n ) {\n if (patchMetadata == null) {\n patchMetadata = detachString(fileOrPatchMetadata);\n } else {\n if (throwOnError) {\n throw Error('parsePatchContent: unknown file blob');\n } else {\n console.error(\n 'parsePatchContent: unknown file blob:',\n fileOrPatchMetadata\n );\n }\n }\n continue;\n }\n const currentFile = _processFile(fileOrPatchMetadata, {\n cacheKey:\n cacheKeyPrefix != null\n ? patchIndex == null\n ? composeCacheKey(\n 'patch-file',\n cacheKeyPrefix,\n String(files.length)\n )\n : composeCacheKey(\n 'patch-file',\n cacheKeyPrefix,\n String(patchIndex),\n String(files.length)\n )\n : undefined,\n isGitDiff,\n throwOnError,\n });\n if (currentFile != null) {\n files.push(currentFile);\n }\n }\n return { patchMetadata, files };\n}\n\ninterface ProcessFileOptions {\n cacheKey?: string;\n isGitDiff?: boolean;\n oldFile?: FileContents;\n newFile?: FileContents;\n throwOnError?: boolean;\n}\n\nexport function processFile(\n fileDiffString: string,\n options?: ProcessFileOptions\n): FileDiffMetadata | undefined {\n try {\n return _processFile(fileDiffString, options);\n } finally {\n releaseStringDetachBuffer();\n }\n}\n\nfunction _processFile(\n fileDiffString: string,\n {\n cacheKey,\n isGitDiff = GIT_DIFF_FILE_BREAK_REGEX.test(fileDiffString),\n oldFile,\n newFile,\n throwOnError = false,\n }: ProcessFileOptions = {}\n): FileDiffMetadata | undefined {\n let lastHunkEnd = 0;\n const hunks = splitAtLinePrefix(fileDiffString, '@@ ');\n let currentFile: FileDiffMetadata | undefined;\n const isPartial = oldFile == null || newFile == null;\n let deletionLineIndex = 0;\n let additionLineIndex = 0;\n for (const hunk of hunks) {\n const lines = splitWithNewlines(hunk);\n const firstLine = lines[0];\n if (firstLine == null) {\n if (throwOnError) {\n throw Error('parsePatchContent: invalid hunk');\n } else {\n console.error('parsePatchContent: invalid hunk', hunk);\n }\n continue;\n }\n const fileHeader = parseHunkHeader(firstLine);\n let additionLines = 0;\n let deletionLines = 0;\n // Setup currentFile, this should be the first iteration of our hunks, and\n // technically not a hunk\n if (fileHeader == null || currentFile == null) {\n if (currentFile != null) {\n if (throwOnError) {\n throw Error('parsePatchContent: Invalid hunk');\n } else {\n console.error('parsePatchContent: Invalid hunk', hunk);\n }\n continue;\n }\n currentFile = {\n name: '',\n type: 'change',\n hunks: [],\n splitLineCount: 0,\n unifiedLineCount: 0,\n isPartial,\n additionLines:\n !isPartial && oldFile != null && newFile != null\n ? splitFileContents(newFile.contents)\n : [],\n deletionLines:\n !isPartial && oldFile != null && newFile != null\n ? splitFileContents(oldFile.contents)\n : [],\n cacheKey: maybeDetachOptionalString(cacheKey),\n };\n // If either file is technically empty, then we should empty the\n // arrays respectively\n if (currentFile.additionLines.length === 1 && newFile?.contents === '') {\n currentFile.additionLines.length = 0;\n }\n if (currentFile.deletionLines.length === 1 && oldFile?.contents === '') {\n currentFile.deletionLines.length = 0;\n }\n\n for (const line of lines) {\n if (line.startsWith('diff --git')) {\n const filenameMatch = line.trim().match(ALTERNATE_FILE_NAMES_GIT);\n const prevName = filenameMatch?.[1] ?? filenameMatch?.[2];\n const name = filenameMatch?.[3] ?? filenameMatch?.[4];\n if (prevName == null || name == null) {\n if (throwOnError) {\n throw Error('parsePatchContent: invalid git diff header');\n } else {\n console.error('parsePatchContent: invalid git diff header', line);\n }\n continue;\n }\n currentFile.name = detachString(name.trim());\n if (prevName !== name) {\n currentFile.prevName = detachString(prevName.trim());\n }\n continue;\n }\n\n const filenameMatch =\n line.startsWith('---') || line.startsWith('+++')\n ? line.match(\n isGitDiff ? FILENAME_HEADER_REGEX_GIT : FILENAME_HEADER_REGEX\n )\n : null;\n if (filenameMatch != null) {\n const [, type, fileName] = filenameMatch;\n if (type === '---' && fileName !== '/dev/null') {\n const detachedFileName = detachString(fileName.trim());\n currentFile.prevName = detachedFileName;\n currentFile.name = detachedFileName;\n } else if (type === '+++' && fileName !== '/dev/null') {\n currentFile.name = detachString(fileName.trim());\n }\n }\n // Git diffs have a bunch of additional metadata we can pull from\n else if (isGitDiff) {\n if (line.startsWith('new mode ')) {\n currentFile.mode = detachString(\n line.slice('new mode'.length).trim()\n );\n }\n if (line.startsWith('old mode ')) {\n currentFile.prevMode = detachString(\n line.slice('old mode'.length).trim()\n );\n }\n if (line.startsWith('new file mode')) {\n currentFile.type = 'new';\n currentFile.mode = detachString(\n line.slice('new file mode'.length).trim()\n );\n }\n if (line.startsWith('deleted file mode')) {\n currentFile.type = 'deleted';\n currentFile.mode = detachString(\n line.slice('deleted file mode'.length).trim()\n );\n }\n if (line.startsWith('similarity index')) {\n if (line.startsWith('similarity index 100%')) {\n currentFile.type = 'rename-pure';\n } else {\n currentFile.type = 'rename-changed';\n }\n }\n if (line.startsWith('index ')) {\n const [, prevObjectId, newObjectId, mode] =\n line.trim().match(INDEX_LINE_METADATA) ?? [];\n if (prevObjectId != null) {\n currentFile.prevObjectId = detachString(prevObjectId);\n }\n if (newObjectId != null) {\n currentFile.newObjectId = detachString(newObjectId);\n }\n if (mode != null) {\n currentFile.mode = detachString(mode);\n }\n }\n // We have to handle these for pure renames because there won't be\n // --- and +++ lines\n if (line.startsWith('rename from ')) {\n currentFile.prevName = detachString(\n line.slice('rename from '.length).trim()\n );\n }\n if (line.startsWith('rename to ')) {\n currentFile.name = detachString(\n line.slice('rename to '.length).trim()\n );\n }\n }\n }\n continue;\n }\n\n // Otherwise, time to start parsing out the hunk\n let currentContent: ContextContent | ChangeContent | undefined;\n let lastLineType: 'context' | 'addition' | 'deletion' | undefined;\n\n // Strip trailing bare newlines (format-patch separators between commits)\n // if needed\n while (\n lines.length > 0 &&\n (lines[lines.length - 1] === '\\n' ||\n lines[lines.length - 1] === '\\r' ||\n lines[lines.length - 1] === '\\r\\n' ||\n lines[lines.length - 1] === '')\n ) {\n lines.pop();\n }\n\n const { additionStart, deletionStart } = fileHeader;\n deletionLineIndex = isPartial ? deletionLineIndex : deletionStart - 1;\n additionLineIndex = isPartial ? additionLineIndex : additionStart - 1;\n\n const hunkData: Hunk = {\n collapsedBefore: 0,\n\n splitLineCount: 0,\n splitLineStart: 0,\n\n unifiedLineCount: 0,\n unifiedLineStart: 0,\n\n additionCount: fileHeader.additionCount,\n additionStart,\n additionLines,\n\n deletionCount: fileHeader.deletionCount,\n deletionStart,\n deletionLines,\n\n deletionLineIndex,\n additionLineIndex,\n\n hunkContent: [],\n hunkContext: maybeDetachOptionalString(fileHeader.hunkContext),\n hunkSpecs: detachString(firstLine),\n\n noEOFCRAdditions: false,\n noEOFCRDeletions: false,\n };\n\n // Now we process each line of the hunk\n let parsedAdditionLines = 0;\n let parsedDeletionLines = 0;\n for (let lineIndex = 1; lineIndex < lines.length; lineIndex++) {\n const rawLine = lines[lineIndex];\n if (\n parsedAdditionLines >= hunkData.additionCount &&\n parsedDeletionLines >= hunkData.deletionCount &&\n !rawLine.startsWith('\\\\')\n ) {\n const isUnexpectedBodyLine =\n isHunkBodyLine(rawLine) && !isFormatPatchVersionSeparator(rawLine);\n if (!isUnexpectedBodyLine) {\n break;\n }\n if (throwOnError) {\n throw Error('parsePatchContent: hunk has more lines than expected');\n }\n }\n\n const firstChar = rawLine[0];\n // If we can't properly process the line, well, lets just try to salvage\n // things and continue... It's possible an AI generated diff might have\n // some stray blank lines or something in there\n if (\n firstChar !== '+' &&\n firstChar !== '-' &&\n firstChar !== ' ' &&\n firstChar !== '\\\\'\n ) {\n if (throwOnError) {\n throw Error('parsePatchContent: invalid hunk line');\n }\n console.error(\n `parseLineType: Invalid firstChar: \"${firstChar}\", full line: \"${rawLine}\"`\n );\n console.error('processFile: invalid rawLine:', rawLine);\n continue;\n }\n\n const type = parseRawLineType(firstChar);\n if (type === 'addition') {\n if (throwOnError && parsedAdditionLines >= hunkData.additionCount) {\n throw Error('parsePatchContent: hunk has too many addition lines');\n }\n const line = getParsedLineContent(rawLine);\n if (currentContent == null || currentContent.type !== 'change') {\n currentContent = createContentGroup(\n 'change',\n deletionLineIndex,\n additionLineIndex\n );\n hunkData.hunkContent.push(currentContent);\n }\n additionLineIndex++;\n parsedAdditionLines++;\n if (isPartial) {\n currentFile.additionLines.push(line);\n }\n currentContent.additions++;\n additionLines++;\n lastLineType = 'addition';\n } else if (type === 'deletion') {\n if (throwOnError && parsedDeletionLines >= hunkData.deletionCount) {\n throw Error('parsePatchContent: hunk has too many deletion lines');\n }\n const line = getParsedLineContent(rawLine);\n if (currentContent == null || currentContent.type !== 'change') {\n currentContent = createContentGroup(\n 'change',\n deletionLineIndex,\n additionLineIndex\n );\n hunkData.hunkContent.push(currentContent);\n }\n deletionLineIndex++;\n parsedDeletionLines++;\n if (isPartial) {\n currentFile.deletionLines.push(line);\n }\n currentContent.deletions++;\n deletionLines++;\n lastLineType = 'deletion';\n } else if (type === 'context') {\n if (\n throwOnError &&\n (parsedDeletionLines >= hunkData.deletionCount ||\n parsedAdditionLines >= hunkData.additionCount)\n ) {\n throw Error('parsePatchContent: hunk has too many context lines');\n }\n const line = getParsedLineContent(rawLine);\n if (currentContent == null || currentContent.type !== 'context') {\n currentContent = createContentGroup(\n 'context',\n deletionLineIndex,\n additionLineIndex\n );\n hunkData.hunkContent.push(currentContent);\n }\n additionLineIndex++;\n deletionLineIndex++;\n parsedAdditionLines++;\n parsedDeletionLines++;\n if (isPartial) {\n currentFile.deletionLines.push(line);\n currentFile.additionLines.push(line);\n }\n currentContent.lines++;\n lastLineType = 'context';\n } else if (type === 'metadata' && currentContent != null) {\n if (currentContent.type === 'context') {\n hunkData.noEOFCRAdditions = true;\n hunkData.noEOFCRDeletions = true;\n } else if (lastLineType === 'deletion') {\n hunkData.noEOFCRDeletions = true;\n } else if (lastLineType === 'addition') {\n hunkData.noEOFCRAdditions = true;\n }\n // If we're dealing with partial content from a diff, we need to strip\n // newlines manually from the content\n if (\n isPartial &&\n (lastLineType === 'addition' || lastLineType === 'context')\n ) {\n const lastIndex = currentFile.additionLines.length - 1;\n if (lastIndex >= 0) {\n currentFile.additionLines[lastIndex] = cleanLastNewline(\n currentFile.additionLines[lastIndex]\n );\n }\n }\n if (\n isPartial &&\n (lastLineType === 'deletion' || lastLineType === 'context')\n ) {\n const lastIndex = currentFile.deletionLines.length - 1;\n if (lastIndex >= 0) {\n currentFile.deletionLines[lastIndex] = cleanLastNewline(\n currentFile.deletionLines[lastIndex]\n );\n }\n }\n }\n }\n\n if (\n parsedAdditionLines !== hunkData.additionCount ||\n parsedDeletionLines !== hunkData.deletionCount\n ) {\n if (throwOnError) {\n throw Error('parsePatchContent: hunk line count mismatch');\n }\n console.error(\n `parsePatchContent: hunk line count mismatch: \"${firstLine.trimEnd()}\", declared old/new ${hunkData.deletionCount}/${hunkData.additionCount}, parsed old/new ${parsedDeletionLines}/${parsedAdditionLines}`\n );\n // Re-encode each original boundary using the repaired count. Zero-count\n // ranges use the boundary itself as their start; positive ranges use +1.\n const repairedAdditionStart =\n getHunkSideStartBoundary(\n hunkData.additionStart,\n hunkData.additionCount\n ) + (parsedAdditionLines === 0 ? 0 : 1);\n const repairedDeletionStart =\n getHunkSideStartBoundary(\n hunkData.deletionStart,\n hunkData.deletionCount\n ) + (parsedDeletionLines === 0 ? 0 : 1);\n\n // Hydrated hunks index into full-file line arrays, so their indexes must\n // move with repaired starts. Partial hunks index patch-built arrays.\n if (!isPartial) {\n const additionStartDelta =\n repairedAdditionStart - hunkData.additionStart;\n const deletionStartDelta =\n repairedDeletionStart - hunkData.deletionStart;\n hunkData.additionLineIndex += additionStartDelta;\n hunkData.deletionLineIndex += deletionStartDelta;\n for (const content of hunkData.hunkContent) {\n content.additionLineIndex += additionStartDelta;\n content.deletionLineIndex += deletionStartDelta;\n }\n }\n\n hunkData.additionStart = repairedAdditionStart;\n hunkData.deletionStart = repairedDeletionStart;\n hunkData.additionCount = parsedAdditionLines;\n hunkData.deletionCount = parsedDeletionLines;\n }\n\n hunkData.additionLines = additionLines;\n hunkData.deletionLines = deletionLines;\n\n hunkData.collapsedBefore = Math.max(\n getHunkSideStartBoundary(hunkData.additionStart, hunkData.additionCount) -\n lastHunkEnd,\n 0\n );\n currentFile.hunks.push(hunkData);\n lastHunkEnd = getHunkSideEndBoundary(\n hunkData.additionStart,\n hunkData.additionCount\n );\n for (const content of hunkData.hunkContent) {\n if (content.type === 'context') {\n hunkData.splitLineCount += content.lines;\n hunkData.unifiedLineCount += content.lines;\n } else {\n hunkData.splitLineCount += Math.max(\n content.additions,\n content.deletions\n );\n hunkData.unifiedLineCount += content.deletions + content.additions;\n }\n }\n hunkData.splitLineStart =\n currentFile.splitLineCount + hunkData.collapsedBefore;\n hunkData.unifiedLineStart =\n currentFile.unifiedLineCount + hunkData.collapsedBefore;\n\n currentFile.splitLineCount +=\n hunkData.collapsedBefore + hunkData.splitLineCount;\n currentFile.unifiedLineCount +=\n hunkData.collapsedBefore + hunkData.unifiedLineCount;\n }\n if (currentFile == null) {\n return undefined;\n }\n if (\n throwOnError &&\n isPartial &&\n !isGitDiff &&\n currentFile.hunks.length === 0\n ) {\n throw Error('parsePatchContent: unified file has no hunks');\n }\n\n // Account for collapsed lines after the final hunk and increment the\n // split/unified counts properly\n if (\n currentFile.hunks.length > 0 &&\n !isPartial &&\n currentFile.additionLines.length > 0 &&\n currentFile.deletionLines.length > 0\n ) {\n const lastHunk = currentFile.hunks[currentFile.hunks.length - 1];\n const lastHunkEnd = getHunkSideEndBoundary(\n lastHunk.additionStart,\n lastHunk.additionCount\n );\n const totalFileLines = currentFile.additionLines.length;\n const collapsedAfter = Math.max(totalFileLines - lastHunkEnd, 0);\n currentFile.splitLineCount += collapsedAfter;\n currentFile.unifiedLineCount += collapsedAfter;\n }\n\n // If this isn't a git diff style patch, then we'll need to sus out some\n // additional metadata manually\n if (!isGitDiff) {\n if (\n currentFile.prevName != null &&\n currentFile.name !== currentFile.prevName\n ) {\n if (currentFile.hunks.length > 0) {\n currentFile.type = 'rename-changed';\n } else {\n currentFile.type = 'rename-pure';\n }\n }\n // Sort of a hack for detecting deleted/added files...\n else if (\n (oldFile == null || oldFile.contents === '') &&\n newFile != null &&\n newFile.contents !== ''\n ) {\n currentFile.type = 'new';\n } else if (\n oldFile != null &&\n oldFile.contents !== '' &&\n (newFile == null || newFile.contents === '')\n ) {\n currentFile.type = 'deleted';\n }\n }\n if (\n currentFile.type !== 'rename-pure' &&\n currentFile.type !== 'rename-changed'\n ) {\n currentFile.prevName = undefined;\n }\n // Pair change-block lines by similarity instead of the patch's positional\n // ordering. Partial diffs work too: their hunk line indexes point into the\n // patch-built line arrays, which hold every line a block references.\n realignChangeContentBySimilarity(currentFile);\n return currentFile;\n}\n\n/**\n * Parses a patch file string into an array of parsed patches.\n *\n * @param data - The raw patch file content (supports multi-commit patches)\n * @param cacheKeyPrefix - Optional prefix for collision-safe cache keys derived\n * from the prefix, patch index, and file index. This enables caching of\n * rendered diff results in the worker pool.\n * @param throwOnError - When true, invalid data throws. When false, invalid data\n * is reported with `console.error` and the parser attempts to recover when\n * possible. Recovery is best-effort and does not guarantee valid output.\n */\nexport function parsePatchFiles(\n data: string,\n cacheKeyPrefix?: string,\n throwOnError = false\n): ParsedPatch[] {\n // NOTE(amadeus): This function is pretty forgiving in that it can accept a\n // patch file that includes commit metdata, multiple commits, or not\n const patches: ParsedPatch[] = [];\n const rawPatches = hasCommitMetadataBoundary(data)\n ? data.split(COMMIT_METADATA_SPLIT)\n : [data];\n for (const patch of rawPatches) {\n try {\n patches.push(\n _processPatch(\n patch,\n cacheKeyPrefix,\n throwOnError,\n cacheKeyPrefix != null ? patches.length : undefined\n )\n );\n } catch (error) {\n if (throwOnError) {\n throw error;\n } else {\n console.error(error);\n }\n } finally {\n releaseStringDetachBuffer();\n }\n }\n return patches;\n}\n\nfunction hasCommitMetadataBoundary(data: string): boolean {\n return data.startsWith('From ') || data.includes('\\nFrom ');\n}\n\nfunction splitFileContents(contents: string): string[] {\n const lines = splitWithNewlines(contents);\n for (let index = 0; index < lines.length; index++) {\n lines[index] = detachString(lines[index]);\n }\n return lines;\n}\n\nfunction splitWithNewlines(contents: string): string[] {\n if (contents.length === 0) {\n return [''];\n }\n\n const lines: string[] = [];\n let startIndex = 0;\n for (;;) {\n const newlineIndex = contents.indexOf('\\n', startIndex);\n if (newlineIndex === -1) {\n break;\n }\n\n lines.push(contents.slice(startIndex, newlineIndex + 1));\n startIndex = newlineIndex + 1;\n }\n\n if (startIndex < contents.length) {\n lines.push(contents.slice(startIndex));\n }\n return lines;\n}\n\nfunction splitGitDiffFiles(contents: string): string[] {\n return splitAtLinePrefix(contents, 'diff --git');\n}\n\nfunction splitUnifiedDiffFiles(contents: string): string[] {\n if (contents.length === 0) {\n return [''];\n }\n\n const parts: string[] = [];\n let partStartIndex = 0;\n let lineStartIndex = 0;\n let remainingDeletionLines = 0;\n let remainingAdditionLines = 0;\n let hasOpenedUnifiedFile = false;\n\n while (lineStartIndex < contents.length) {\n const nextLineStartIndex = getNextLineStartIndex(contents, lineStartIndex);\n if (remainingDeletionLines <= 0 && remainingAdditionLines <= 0) {\n if (isUnifiedDiffFileHeaderAt(contents, lineStartIndex)) {\n if (lineStartIndex > partStartIndex) {\n parts.push(contents.slice(partStartIndex, lineStartIndex));\n }\n partStartIndex = lineStartIndex;\n hasOpenedUnifiedFile = true;\n lineStartIndex = getNextLineStartIndex(contents, nextLineStartIndex);\n continue;\n }\n\n if (hasOpenedUnifiedFile && contents.startsWith('@@ -', lineStartIndex)) {\n const fileHeader = parseHunkHeader(\n contents.slice(lineStartIndex, nextLineStartIndex)\n );\n if (fileHeader != null) {\n remainingDeletionLines = fileHeader.deletionCount;\n remainingAdditionLines = fileHeader.additionCount;\n }\n }\n lineStartIndex = nextLineStartIndex;\n continue;\n }\n\n const firstChar = contents[lineStartIndex];\n if (firstChar === '\\\\') {\n lineStartIndex = nextLineStartIndex;\n continue;\n }\n\n if (firstChar === ' ') {\n remainingDeletionLines = Math.max(remainingDeletionLines - 1, 0);\n remainingAdditionLines = Math.max(remainingAdditionLines - 1, 0);\n } else if (firstChar === '-') {\n remainingDeletionLines = Math.max(remainingDeletionLines - 1, 0);\n } else if (firstChar === '+') {\n remainingAdditionLines = Math.max(remainingAdditionLines - 1, 0);\n }\n lineStartIndex = nextLineStartIndex;\n }\n\n parts.push(contents.slice(partStartIndex));\n return parts;\n}\n\nfunction startsWithUnifiedDiffFileHeader(contents: string): boolean {\n return isUnifiedDiffFileHeaderAt(contents, 0);\n}\n\nfunction isUnifiedDiffFileHeaderAt(contents: string, lineStartIndex: number) {\n const nextLineStartIndex = getNextLineStartIndex(contents, lineStartIndex);\n return (\n isUnifiedDiffHeaderLineAt(contents, lineStartIndex, '---') &&\n isUnifiedDiffHeaderLineAt(contents, nextLineStartIndex, '+++')\n );\n}\n\nfunction isUnifiedDiffHeaderLineAt(\n contents: string,\n lineStartIndex: number,\n prefix: '---' | '+++'\n): boolean {\n if (!contents.startsWith(prefix, lineStartIndex)) {\n return false;\n }\n\n const separator = contents[lineStartIndex + prefix.length];\n if (separator !== ' ' && separator !== '\\t') {\n return false;\n }\n\n for (\n let index = lineStartIndex + prefix.length + 1;\n index < contents.length;\n index++\n ) {\n const char = contents[index];\n if (char === '\\n' || char === '\\r') {\n break;\n }\n if (char !== ' ' && char !== '\\t') {\n return true;\n }\n }\n return false;\n}\n\nfunction getNextLineStartIndex(\n contents: string,\n lineStartIndex: number\n): number {\n const newlineIndex = contents.indexOf('\\n', lineStartIndex);\n return newlineIndex === -1 ? contents.length : newlineIndex + 1;\n}\n\nfunction isHunkBodyLine(line: string): boolean {\n const firstChar = line[0];\n return firstChar === '+' || firstChar === '-' || firstChar === ' ';\n}\n\nfunction isFormatPatchVersionSeparator(line: string): boolean {\n if (!line.startsWith('--')) {\n return false;\n }\n\n for (let index = 2; index < line.length; index++) {\n const char = line[index];\n if (char !== ' ' && char !== '\\t' && char !== '\\n' && char !== '\\r') {\n return false;\n }\n }\n return true;\n}\n\nfunction parseHunkHeader(line: string): ParsedHunkHeader | undefined {\n if (!line.startsWith('@@ -')) {\n return undefined;\n }\n\n let index = 4;\n const deletionStartResult = readPositiveInteger(line, index);\n if (deletionStartResult == null) {\n return undefined;\n }\n const deletionStart = deletionStartResult.value;\n index = deletionStartResult.endIndex;\n\n let deletionCount = 1;\n if (line[index] === ',') {\n const deletionCountResult = readPositiveInteger(line, index + 1);\n if (deletionCountResult == null) {\n return undefined;\n }\n deletionCount = deletionCountResult.value;\n index = deletionCountResult.endIndex;\n }\n\n if (line[index] !== ' ' || line[index + 1] !== '+') {\n return undefined;\n }\n index += 2;\n\n const additionStartResult = readPositiveInteger(line, index);\n if (additionStartResult == null) {\n return undefined;\n }\n const additionStart = additionStartResult.value;\n index = additionStartResult.endIndex;\n\n let additionCount = 1;\n if (line[index] === ',') {\n const additionCountResult = readPositiveInteger(line, index + 1);\n if (additionCountResult == null) {\n return undefined;\n }\n additionCount = additionCountResult.value;\n index = additionCountResult.endIndex;\n }\n\n if (\n line[index] !== ' ' ||\n line[index + 1] !== '@' ||\n line[index + 2] !== '@'\n ) {\n return undefined;\n }\n\n let hunkContext: string | undefined;\n const contextStartIndex = index + 3;\n if (line[contextStartIndex] === ' ') {\n hunkContext = trimLineEnd(line.slice(contextStartIndex + 1));\n }\n\n return {\n additionCount,\n additionStart,\n deletionCount,\n deletionStart,\n hunkContext,\n };\n}\n\nfunction readPositiveInteger(\n value: string,\n startIndex: number\n): { value: number; endIndex: number } | undefined {\n let index = startIndex;\n let parsedValue = 0;\n for (; index < value.length; index++) {\n const digit = value.charCodeAt(index) - 48;\n if (digit < 0 || digit > 9) {\n break;\n }\n parsedValue = parsedValue * 10 + digit;\n }\n\n if (index === startIndex) {\n return undefined;\n }\n return { value: parsedValue, endIndex: index };\n}\n\nfunction trimLineEnd(value: string): string {\n if (value.endsWith('\\r\\n')) {\n return value.slice(0, -2);\n }\n if (value.endsWith('\\n')) {\n return value.slice(0, -1);\n }\n return value;\n}\n\nfunction isGitDiffPatch(data: string): boolean {\n return data.startsWith('diff --git') || data.includes('\\ndiff --git');\n}\n\nfunction splitAtLinePrefix(contents: string, prefix: string): string[] {\n if (contents.length === 0) {\n return [''];\n }\n\n const newlinePrefix = `\\n${prefix}`;\n const firstBoundaryIndex = contents.startsWith(prefix)\n ? 0\n : findLinePrefixIndex(contents, newlinePrefix, 0);\n if (firstBoundaryIndex === -1) {\n return [contents];\n }\n\n const parts: string[] = [];\n if (firstBoundaryIndex > 0) {\n parts.push(contents.slice(0, firstBoundaryIndex));\n }\n\n let startIndex = firstBoundaryIndex;\n for (;;) {\n const nextBoundaryIndex = findLinePrefixIndex(\n contents,\n newlinePrefix,\n startIndex + 1\n );\n if (nextBoundaryIndex === -1) {\n break;\n }\n\n parts.push(contents.slice(startIndex, nextBoundaryIndex));\n startIndex = nextBoundaryIndex;\n }\n parts.push(contents.slice(startIndex));\n return parts;\n}\n\nfunction findLinePrefixIndex(\n contents: string,\n newlinePrefix: string,\n fromIndex: number\n): number {\n const index = contents.indexOf(newlinePrefix, fromIndex);\n return index === -1 ? -1 : index + 1;\n}\n\nfunction maybeDetachOptionalString<T extends string | undefined>(value: T): T {\n return (value == null ? value : detachString(value)) as T;\n}\n\nfunction parseRawLineType(\n firstChar: string | undefined\n): Exclude<HunkLineType, 'expanded'> {\n return firstChar === ' '\n ? 'context'\n : firstChar === '\\\\'\n ? 'metadata'\n : firstChar === '+'\n ? 'addition'\n : 'deletion';\n}\n\nfunction getParsedLineContent(rawLine: string): string {\n const processedLine = rawLine.slice(1);\n return detachString(processedLine === '' ? '\\n' : processedLine);\n}\n\nfunction createContentGroup(\n type: 'change',\n deletionLineIndex: number,\n additionLineIndex: number\n): ChangeContent;\nfunction createContentGroup(\n type: 'context',\n deletionLineIndex: number,\n additionLineIndex: number\n): ContextContent;\nfunction createContentGroup(\n type: 'change' | 'context',\n deletionLineIndex: number,\n additionLineIndex: number\n): ChangeContent | ContextContent {\n if (type === 'change') {\n return {\n type: 'change',\n additions: 0,\n deletions: 0,\n additionLineIndex,\n deletionLineIndex,\n };\n }\n return {\n type: 'context',\n lines: 0,\n additionLineIndex,\n deletionLineIndex,\n };\n}\n"],"mappings":";;;;;;;AAkCA,SAAgB,aACd,MACA,gBACA,cACa;CACb,IAAI;EACF,OAAO,cAAc,MAAM,gBAAgB,YAAY;CACzD,UAAU;EACR,0BAA0B;CAC5B;AACF;AAEA,SAAS,cACP,MACA,gBACA,eAAe,OACf,YACa;CACb,MAAM,YAAY,eAAe,IAAI;CACrC,MAAM,WAAW,YACb,kBAAkB,IAAI,IACtB,sBAAsB,IAAI;CAC9B,IAAI;CACJ,MAAM,QAA4B,CAAC;CACnC,KAAK,MAAM,uBAAuB,UAAU;EAC1C,IAAI,aAAa,CAAC,0BAA0B,KAAK,mBAAmB,GAAG;GACrE,IAAI,iBAAiB,MACnB,gBAAgB,aAAa,mBAAmB;QAEhD,IAAI,cACF,MAAM,MAAM,sCAAsC;QAElD,QAAQ,MACN,yCACA,mBACF;GAKJ;EACF,OAAO,IACL,CAAC,aACD,CAAC,gCAAgC,mBAAmB,GACpD;GACA,IAAI,iBAAiB,MACnB,gBAAgB,aAAa,mBAAmB;QAEhD,IAAI,cACF,MAAM,MAAM,sCAAsC;QAElD,QAAQ,MACN,yCACA,mBACF;GAGJ;EACF;EACA,MAAM,cAAc,aAAa,qBAAqB;GACpD,UACE,kBAAkB,OACd,cAAc,OACZ,gBACE,cACA,gBACA,OAAO,MAAM,MAAM,CACrB,IACA,gBACE,cACA,gBACA,OAAO,UAAU,GACjB,OAAO,MAAM,MAAM,CACrB,IACF,KAAA;GACN;GACA;EACF,CAAC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,OAAQ,SAAS,OAAO,QAAQ,aAAa,KAAK;AACpD;AAEA,SAAS,iBACP,WACmC;CACnC,OAAO,cAAc,MACjB,YACA,cAAc,OACZ,aACA,cAAc,MACZ,aACA;AACV;AAEA,SAAS,qBAAqB,SAAyB;CACrD,MAAM,gBAAgB,QAAQ,MAAM,CAAC;CACrC,OAAO,aAAa,kBAAkB,KAAK,OAAO,aAAa;AACjE;AAYA,SAAS,mBACP,MACA,mBACA,mBACgC;CAChC,IAAI,SAAS,UACX,OAAO;EACL,MAAM;EACN,WAAW;EACX,WAAW;EACX;EACA;CACF;CAEF,OAAO;EACL,MAAM;EACN,OAAO;EACP;EACA;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","names":[],"sources":["../../src/utils/platform.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"platform.d.ts","names":[],"sources":["../../src/utils/platform.ts"],"mappings":";;;;;;;iBAUgB;iBAMA;iBAMA;iBAIA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefersReducedMotion.d.ts","names":[],"sources":["../../src/utils/prefersReducedMotion.ts"],"mappings":";iBAAgB
|
|
1
|
+
{"version":3,"file":"prefersReducedMotion.d.ts","names":[],"sources":["../../src/utils/prefersReducedMotion.ts"],"mappings":";iBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prerenderHTMLIfNecessary.d.ts","names":[],"sources":["../../src/utils/prerenderHTMLIfNecessary.ts"],"mappings":";iBAAgB,
|
|
1
|
+
{"version":3,"file":"prerenderHTMLIfNecessary.d.ts","names":[],"sources":["../../src/utils/prerenderHTMLIfNecessary.ts"],"mappings":";iBAAgB,yBACd,SAAS,aACT"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Element, ElementContent } from "../node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.js";
|
|
2
2
|
import { SharedRenderState } from "../types.js";
|
|
3
|
-
|
|
4
3
|
//#region src/utils/processLine.d.ts
|
|
5
4
|
declare function processLine(node: Element, line: number, state: SharedRenderState): ElementContent;
|
|
6
5
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processLine.d.ts","names":[],"sources":["../../src/utils/processLine.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"processLine.d.ts","names":[],"sources":["../../src/utils/processLine.ts"],"mappings":";;;iBAKgB,YACd,MAAM,SACN,cACA,OAAO,oBACN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realignChangeContent.d.ts","names":[],"sources":["../../src/utils/realignChangeContent.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"realignChangeContent.d.ts","names":[],"sources":["../../src/utils/realignChangeContent.ts"],"mappings":";;;;;;;;;iBAmCgB,iCACd,MAAM,KAAK;;;;;;;;;;;;;;;;;;;iBAoCG,2BACd,MAAM,MACN,MAAM,KAAK"}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { DiffsHighlighter, FileDiffMetadata, ForceDiffPlainTextOptions, RenderDiffOptions, ThemedDiffResult } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/renderDiffWithHighlighter.d.ts
|
|
4
|
-
declare function renderDiffWithHighlighter(diff: FileDiffMetadata, highlighter: DiffsHighlighter, options: RenderDiffOptions, {
|
|
5
|
-
forcePlainText,
|
|
6
|
-
startingLine,
|
|
7
|
-
totalLines,
|
|
8
|
-
expandedHunks,
|
|
9
|
-
collapsedContextThreshold
|
|
10
|
-
}?: ForceDiffPlainTextOptions): ThemedDiffResult;
|
|
3
|
+
declare function renderDiffWithHighlighter(diff: FileDiffMetadata, highlighter: DiffsHighlighter, options: RenderDiffOptions, { forcePlainText, startingLine, totalLines, expandedHunks, collapsedContextThreshold }?: ForceDiffPlainTextOptions): ThemedDiffResult;
|
|
11
4
|
//#endregion
|
|
12
5
|
export { renderDiffWithHighlighter };
|
|
13
6
|
//# sourceMappingURL=renderDiffWithHighlighter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderDiffWithHighlighter.d.ts","names":[],"sources":["../../src/utils/renderDiffWithHighlighter.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderDiffWithHighlighter.d.ts","names":[],"sources":["../../src/utils/renderDiffWithHighlighter.ts"],"mappings":";;iBAmCgB,0BACd,MAAM,kBACN,aAAa,kBACb,SAAS,qBAEP,gBACA,cACA,YACA,eACA,8BACC,4BACF"}
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { DiffsHighlighter, FileContents, ForceFilePlainTextOptions, RenderFileOptions, ThemedFileResult } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/renderFileWithHighlighter.d.ts
|
|
4
|
-
declare function renderFileWithHighlighter(file: FileContents, highlighter: DiffsHighlighter, {
|
|
5
|
-
theme,
|
|
6
|
-
tokenizeMaxLineLength,
|
|
7
|
-
useTokenTransformer
|
|
8
|
-
}: RenderFileOptions, {
|
|
9
|
-
forcePlainText,
|
|
10
|
-
startingLine,
|
|
11
|
-
totalLines,
|
|
12
|
-
lines
|
|
13
|
-
}?: ForceFilePlainTextOptions): ThemedFileResult;
|
|
3
|
+
declare function renderFileWithHighlighter(file: FileContents, highlighter: DiffsHighlighter, { theme, tokenizeMaxLineLength, useTokenTransformer }: RenderFileOptions, { forcePlainText, startingLine, totalLines, lines }?: ForceFilePlainTextOptions): ThemedFileResult;
|
|
14
4
|
//#endregion
|
|
15
5
|
export { renderFileWithHighlighter };
|
|
16
6
|
//# sourceMappingURL=renderFileWithHighlighter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderFileWithHighlighter.d.ts","names":[],"sources":["../../src/utils/renderFileWithHighlighter.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderFileWithHighlighter.d.ts","names":[],"sources":["../../src/utils/renderFileWithHighlighter.ts"],"mappings":";;iBAqBgB,0BACd,MAAM,cACN,aAAa,oBACX,OAAO,uBAAuB,uBAAuB,qBAErD,gBACA,cACA,YACA,UACC,4BACF"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ConflictResolverTypes, FileDiffMetadata, ProcessFileConflictData } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/resolveConflict.d.ts
|
|
4
3
|
declare function resolveConflict(diff: FileDiffMetadata, conflict: ProcessFileConflictData, type: ConflictResolverTypes): FileDiffMetadata;
|
|
5
4
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveConflict.d.ts","names":[],"sources":["../../src/utils/resolveConflict.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveConflict.d.ts","names":[],"sources":["../../src/utils/resolveConflict.ts"],"mappings":";;iBAQgB,gBACd,MAAM,kBACN,UAAU,yBACV,MAAM,wBACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRegion.d.ts","names":[],"sources":["../../src/utils/resolveRegion.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveRegion.d.ts","names":[],"sources":["../../src/utils/resolveRegion.ts"],"mappings":";;UAWU;EACR;EACA;EACA;EACA;EACA,kBAAkB;;iBAYJ,cACd,MAAM,kBACN,QAAQ,yBACP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roundToDevicePixel.d.ts","names":[],"sources":["../../src/utils/roundToDevicePixel.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"roundToDevicePixel.d.ts","names":[],"sources":["../../src/utils/roundToDevicePixel.ts"],"mappings":";;;;;;;;;;iBASgB,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrollbarGutter.d.ts","names":[],"sources":["../../src/utils/scrollbarGutter.ts"],"mappings":";iBAUgB,
|
|
1
|
+
{"version":3,"file":"scrollbarGutter.d.ts","names":[],"sources":["../../src/utils/scrollbarGutter.ts"],"mappings":";iBAUgB,2BACd,YAAY;iBAkCE,yCACd"}
|
|
@@ -19,7 +19,8 @@ function getMeasuredScrollbarGutter(shadowRoot) {
|
|
|
19
19
|
return measuredScrollbarGutter;
|
|
20
20
|
}
|
|
21
21
|
function createMeasuredScrollbarGutterDeclaration(scrollbarGutter) {
|
|
22
|
-
|
|
22
|
+
const value = scrollbarGutter == null ? "var(--diffs-scrollbar-gutter-fallback)" : `${scrollbarGutter}px`;
|
|
23
|
+
return `${DIFFS_SCROLLBAR_GUTTER_MEASURED_PROPERTY}: ${value};`;
|
|
23
24
|
}
|
|
24
25
|
//#endregion
|
|
25
26
|
export { createMeasuredScrollbarGutterDeclaration, getMeasuredScrollbarGutter };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrollbarGutter.js","names":[],"sources":["../../src/utils/scrollbarGutter.ts"],"sourcesContent":["import {\n DIFFS_SCROLLBAR_GUTTER_MEASURED_PROPERTY,\n DIFFS_SCROLLBAR_MEASURE_ATTRIBUTE,\n} from '../constants';\n\nlet measuredScrollbarGutter: number | undefined;\n\n// Measures the horizontal scrollbar used by `[data-code]` once per page. The\n// hidden probe opts into the same selector as real code panes so custom\n// scrollbar CSS is reflected in the measured value.\nexport function getMeasuredScrollbarGutter(\n shadowRoot: ShadowRoot\n): number | undefined {\n if (measuredScrollbarGutter != null) {\n return measuredScrollbarGutter;\n }\n\n const host = shadowRoot.host;\n if (\n typeof HTMLElement !== 'undefined' &&\n host instanceof HTMLElement &&\n !host.isConnected\n ) {\n return undefined;\n }\n\n const wrapper = document.createElement('div');\n wrapper.setAttribute('data-code', '');\n wrapper.setAttribute(DIFFS_SCROLLBAR_MEASURE_ATTRIBUTE, 'true');\n\n const child = document.createElement('div');\n child.style.position = 'relative';\n child.style.width = '200%';\n child.style.height = '200%';\n wrapper.appendChild(child);\n\n shadowRoot.appendChild(wrapper);\n measuredScrollbarGutter = Math.max(\n wrapper.offsetHeight - wrapper.clientHeight,\n 0\n );\n wrapper.remove();\n return measuredScrollbarGutter;\n}\n\nexport function createMeasuredScrollbarGutterDeclaration(\n scrollbarGutter: number | undefined\n): string {\n const value =\n scrollbarGutter == null\n ? 'var(--diffs-scrollbar-gutter-fallback)'\n : `${scrollbarGutter}px`;\n return `${DIFFS_SCROLLBAR_GUTTER_MEASURED_PROPERTY}: ${value};`;\n}\n"],"mappings":";;AAKA,IAAI;AAKJ,SAAgB,2BACd,YACoB;CACpB,IAAI,2BAA2B,MAC7B,OAAO;CAGT,MAAM,OAAO,WAAW;CACxB,IACE,OAAO,gBAAgB,eACvB,gBAAgB,eAChB,CAAC,KAAK,aAEN;CAGF,MAAM,UAAU,SAAS,cAAc,KAAK;CAC5C,QAAQ,aAAa,aAAa,EAAE;CACpC,QAAQ,aAAa,mCAAmC,MAAM;CAE9D,MAAM,QAAQ,SAAS,cAAc,KAAK;CAC1C,MAAM,MAAM,WAAW;CACvB,MAAM,MAAM,QAAQ;CACpB,MAAM,MAAM,SAAS;CACrB,QAAQ,YAAY,KAAK;CAEzB,WAAW,YAAY,OAAO;CAC9B,0BAA0B,KAAK,IAC7B,QAAQ,eAAe,QAAQ,cAC/B,CACF;CACA,QAAQ,OAAO;CACf,OAAO;AACT;AAEA,SAAgB,yCACd,iBACQ;
|
|
1
|
+
{"version":3,"file":"scrollbarGutter.js","names":[],"sources":["../../src/utils/scrollbarGutter.ts"],"sourcesContent":["import {\n DIFFS_SCROLLBAR_GUTTER_MEASURED_PROPERTY,\n DIFFS_SCROLLBAR_MEASURE_ATTRIBUTE,\n} from '../constants';\n\nlet measuredScrollbarGutter: number | undefined;\n\n// Measures the horizontal scrollbar used by `[data-code]` once per page. The\n// hidden probe opts into the same selector as real code panes so custom\n// scrollbar CSS is reflected in the measured value.\nexport function getMeasuredScrollbarGutter(\n shadowRoot: ShadowRoot\n): number | undefined {\n if (measuredScrollbarGutter != null) {\n return measuredScrollbarGutter;\n }\n\n const host = shadowRoot.host;\n if (\n typeof HTMLElement !== 'undefined' &&\n host instanceof HTMLElement &&\n !host.isConnected\n ) {\n return undefined;\n }\n\n const wrapper = document.createElement('div');\n wrapper.setAttribute('data-code', '');\n wrapper.setAttribute(DIFFS_SCROLLBAR_MEASURE_ATTRIBUTE, 'true');\n\n const child = document.createElement('div');\n child.style.position = 'relative';\n child.style.width = '200%';\n child.style.height = '200%';\n wrapper.appendChild(child);\n\n shadowRoot.appendChild(wrapper);\n measuredScrollbarGutter = Math.max(\n wrapper.offsetHeight - wrapper.clientHeight,\n 0\n );\n wrapper.remove();\n return measuredScrollbarGutter;\n}\n\nexport function createMeasuredScrollbarGutterDeclaration(\n scrollbarGutter: number | undefined\n): string {\n const value =\n scrollbarGutter == null\n ? 'var(--diffs-scrollbar-gutter-fallback)'\n : `${scrollbarGutter}px`;\n return `${DIFFS_SCROLLBAR_GUTTER_MEASURED_PROPERTY}: ${value};`;\n}\n"],"mappings":";;AAKA,IAAI;AAKJ,SAAgB,2BACd,YACoB;CACpB,IAAI,2BAA2B,MAC7B,OAAO;CAGT,MAAM,OAAO,WAAW;CACxB,IACE,OAAO,gBAAgB,eACvB,gBAAgB,eAChB,CAAC,KAAK,aAEN;CAGF,MAAM,UAAU,SAAS,cAAc,KAAK;CAC5C,QAAQ,aAAa,aAAa,EAAE;CACpC,QAAQ,aAAa,mCAAmC,MAAM;CAE9D,MAAM,QAAQ,SAAS,cAAc,KAAK;CAC1C,MAAM,MAAM,WAAW;CACvB,MAAM,MAAM,QAAQ;CACpB,MAAM,MAAM,SAAS;CACrB,QAAQ,YAAY,KAAK;CAEzB,WAAW,YAAY,OAAO;CAC9B,0BAA0B,KAAK,IAC7B,QAAQ,eAAe,QAAQ,cAC/B,CACF;CACA,QAAQ,OAAO;CACf,OAAO;AACT;AAEA,SAAgB,yCACd,iBACQ;CACR,MAAM,QACJ,mBAAmB,OACf,2CACA,GAAG,gBAAgB;CACzB,OAAO,GAAG,yCAAyC,IAAI,MAAM;AAC/D"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FileContents, FileDiffMetadata, SupportedLanguages } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/setLanguageOverride.d.ts
|
|
4
3
|
declare function setLanguageOverride(fileOrDiff: FileContents, lang: SupportedLanguages): FileContents;
|
|
5
4
|
declare function setLanguageOverride(fileOrDiff: FileDiffMetadata, lang: SupportedLanguages): FileDiffMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setLanguageOverride.d.ts","names":[],"sources":["../../src/utils/setLanguageOverride.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"setLanguageOverride.d.ts","names":[],"sources":["../../src/utils/setLanguageOverride.ts"],"mappings":";;iBAMgB,oBACd,YAAY,cACZ,MAAM,qBACL;iBACa,oBACd,YAAY,kBACZ,MAAM,qBACL"}
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { PrePropertiesConfig } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/setWrapperNodeProps.d.ts
|
|
4
|
-
declare function setPreNodeProperties(pre: HTMLPreElement, {
|
|
5
|
-
type,
|
|
6
|
-
diffIndicators,
|
|
7
|
-
disableBackground,
|
|
8
|
-
disableLineNumbers,
|
|
9
|
-
overflow,
|
|
10
|
-
split,
|
|
11
|
-
totalLines,
|
|
12
|
-
customProperties
|
|
13
|
-
}: PrePropertiesConfig): HTMLPreElement;
|
|
3
|
+
declare function setPreNodeProperties(pre: HTMLPreElement, { type, diffIndicators, disableBackground, disableLineNumbers, overflow, split, totalLines, customProperties }: PrePropertiesConfig): HTMLPreElement;
|
|
14
4
|
//#endregion
|
|
15
5
|
export { setPreNodeProperties };
|
|
16
6
|
//# sourceMappingURL=setWrapperNodeProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setWrapperNodeProps.d.ts","names":[],"sources":["../../src/utils/setWrapperNodeProps.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"setWrapperNodeProps.d.ts","names":[],"sources":["../../src/utils/setWrapperNodeProps.ts"],"mappings":";;iBAEgB,qBACd,KAAK,kBAEH,MACA,gBACA,mBACA,oBACA,UACA,OACA,YACA,oBACC,sBACF"}
|
|
@@ -16,9 +16,7 @@ function setPreNodeProperties(pre, { type, diffIndicators, disableBackground, di
|
|
|
16
16
|
case "classic":
|
|
17
17
|
pre.setAttribute("data-indicators", diffIndicators);
|
|
18
18
|
break;
|
|
19
|
-
case "none":
|
|
20
|
-
pre.removeAttribute("data-indicators");
|
|
21
|
-
break;
|
|
19
|
+
case "none": pre.removeAttribute("data-indicators");
|
|
22
20
|
}
|
|
23
21
|
if (disableLineNumbers) pre.setAttribute("data-disable-line-numbers", "");
|
|
24
22
|
else pre.removeAttribute("data-disable-line-numbers");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setWrapperNodeProps.js","names":[],"sources":["../../src/utils/setWrapperNodeProps.ts"],"sourcesContent":["import type { PrePropertiesConfig } from '../types';\n\nexport function setPreNodeProperties(\n pre: HTMLPreElement,\n {\n type,\n diffIndicators,\n disableBackground,\n disableLineNumbers,\n overflow,\n split,\n totalLines,\n customProperties,\n }: PrePropertiesConfig\n): HTMLPreElement {\n // NOTE: We always apply custom properties first so the important properties\n // cannot be overridden.\n if (customProperties != null) {\n for (const key in customProperties) {\n const value = customProperties[key];\n if (value != null) {\n pre.setAttribute(key, `${value}`);\n }\n }\n }\n if (type === 'diff') {\n pre.setAttribute('data-diff', '');\n pre.removeAttribute('data-file');\n } else {\n pre.setAttribute('data-file', '');\n pre.removeAttribute('data-diff');\n }\n switch (diffIndicators) {\n case 'bars':\n case 'classic':\n pre.setAttribute('data-indicators', diffIndicators);\n break;\n case 'none':\n pre.removeAttribute('data-indicators');\n break;\n }\n if (disableLineNumbers) {\n pre.setAttribute('data-disable-line-numbers', '');\n } else {\n pre.removeAttribute('data-disable-line-numbers');\n }\n if (disableBackground) {\n pre.removeAttribute('data-background');\n } else {\n pre.setAttribute('data-background', '');\n }\n if (type === 'diff') {\n pre.setAttribute('data-diff-type', split ? 'split' : 'single');\n } else {\n pre.removeAttribute('data-diff-type');\n }\n pre.setAttribute('data-overflow', overflow);\n // Set CSS custom property for line number column width\n pre.style.setProperty(\n '--diffs-min-number-column-width-default',\n `${`${totalLines}`.length}ch`\n );\n return pre;\n}\n"],"mappings":";AAEA,SAAgB,qBACd,KACA,EACE,MACA,gBACA,mBACA,oBACA,UACA,OACA,YACA,oBAEc;CAGhB,IAAI,oBAAoB,MACtB,KAAK,MAAM,OAAO,kBAAkB;EAClC,MAAM,QAAQ,iBAAiB;EAC/B,IAAI,SAAS,MACX,IAAI,aAAa,KAAK,GAAG,OAAO;CAEpC;CAEF,IAAI,SAAS,QAAQ;EACnB,IAAI,aAAa,aAAa,EAAE;EAChC,IAAI,gBAAgB,WAAW;CACjC,OAAO;EACL,IAAI,aAAa,aAAa,EAAE;EAChC,IAAI,gBAAgB,WAAW;CACjC;CACA,QAAQ,gBAAR;EACE,KAAK;EACL,KAAK;GACH,IAAI,aAAa,mBAAmB,cAAc;GAClD;EACF,KAAK
|
|
1
|
+
{"version":3,"file":"setWrapperNodeProps.js","names":[],"sources":["../../src/utils/setWrapperNodeProps.ts"],"sourcesContent":["import type { PrePropertiesConfig } from '../types';\n\nexport function setPreNodeProperties(\n pre: HTMLPreElement,\n {\n type,\n diffIndicators,\n disableBackground,\n disableLineNumbers,\n overflow,\n split,\n totalLines,\n customProperties,\n }: PrePropertiesConfig\n): HTMLPreElement {\n // NOTE: We always apply custom properties first so the important properties\n // cannot be overridden.\n if (customProperties != null) {\n for (const key in customProperties) {\n const value = customProperties[key];\n if (value != null) {\n pre.setAttribute(key, `${value}`);\n }\n }\n }\n if (type === 'diff') {\n pre.setAttribute('data-diff', '');\n pre.removeAttribute('data-file');\n } else {\n pre.setAttribute('data-file', '');\n pre.removeAttribute('data-diff');\n }\n switch (diffIndicators) {\n case 'bars':\n case 'classic':\n pre.setAttribute('data-indicators', diffIndicators);\n break;\n case 'none':\n pre.removeAttribute('data-indicators');\n break;\n }\n if (disableLineNumbers) {\n pre.setAttribute('data-disable-line-numbers', '');\n } else {\n pre.removeAttribute('data-disable-line-numbers');\n }\n if (disableBackground) {\n pre.removeAttribute('data-background');\n } else {\n pre.setAttribute('data-background', '');\n }\n if (type === 'diff') {\n pre.setAttribute('data-diff-type', split ? 'split' : 'single');\n } else {\n pre.removeAttribute('data-diff-type');\n }\n pre.setAttribute('data-overflow', overflow);\n // Set CSS custom property for line number column width\n pre.style.setProperty(\n '--diffs-min-number-column-width-default',\n `${`${totalLines}`.length}ch`\n );\n return pre;\n}\n"],"mappings":";AAEA,SAAgB,qBACd,KACA,EACE,MACA,gBACA,mBACA,oBACA,UACA,OACA,YACA,oBAEc;CAGhB,IAAI,oBAAoB,MACtB,KAAK,MAAM,OAAO,kBAAkB;EAClC,MAAM,QAAQ,iBAAiB;EAC/B,IAAI,SAAS,MACX,IAAI,aAAa,KAAK,GAAG,OAAO;CAEpC;CAEF,IAAI,SAAS,QAAQ;EACnB,IAAI,aAAa,aAAa,EAAE;EAChC,IAAI,gBAAgB,WAAW;CACjC,OAAO;EACL,IAAI,aAAa,aAAa,EAAE;EAChC,IAAI,gBAAgB,WAAW;CACjC;CACA,QAAQ,gBAAR;EACE,KAAK;EACL,KAAK;GACH,IAAI,aAAa,mBAAmB,cAAc;GAClD;EACF,KAAK,QACH,IAAI,gBAAgB,iBAAiB;CAEzC;CACA,IAAI,oBACF,IAAI,aAAa,6BAA6B,EAAE;MAEhD,IAAI,gBAAgB,2BAA2B;CAEjD,IAAI,mBACF,IAAI,gBAAgB,iBAAiB;MAErC,IAAI,aAAa,mBAAmB,EAAE;CAExC,IAAI,SAAS,QACX,IAAI,aAAa,kBAAkB,QAAQ,UAAU,QAAQ;MAE7D,IAAI,gBAAgB,gBAAgB;CAEtC,IAAI,aAAa,iBAAiB,QAAQ;CAE1C,IAAI,MAAM,YACR,2CACA,GAAG,GAAG,aAAa,OAAO,GAC5B;CACA,OAAO;AACT"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InteractionManagerMode, OnTokenEventProps } from "../managers/InteractionManager.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/shouldUseTokenTransformer.d.ts
|
|
4
3
|
interface ShouldUseTokenTransformerProps<TMode extends InteractionManagerMode> {
|
|
5
4
|
onTokenClick?(props: OnTokenEventProps<TMode>, event: MouseEvent): unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shouldUseTokenTransformer.d.ts","names":[],"sources":["../../src/utils/shouldUseTokenTransformer.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"shouldUseTokenTransformer.d.ts","names":[],"sources":["../../src/utils/shouldUseTokenTransformer.ts"],"mappings":";;UAKU,+BAA+B,cAAc;EACrD,cAAc,OAAO,kBAAkB,QAAQ,OAAO;EACtD,cAAc,OAAO,kBAAkB,QAAQ,OAAO;EACtD,cAAc,OAAO,kBAAkB,QAAQ,OAAO;EACtD;;iBAKc,0BACd,wCACA,SAAS,+BAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitFileContents.d.ts","names":[],"sources":["../../src/utils/splitFileContents.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"splitFileContents.d.ts","names":[],"sources":["../../src/utils/splitFileContents.ts"],"mappings":";;;;;;;;iBASgB,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trimPatchContext.d.ts","names":[],"sources":["../../src/utils/trimPatchContext.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"trimPatchContext.d.ts","names":[],"sources":["../../src/utils/trimPatchContext.ts"],"mappings":";;;;;;;iBAoBgB,iBAAiB,eAAe"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ChangeContent, ContextContent, FileDiffMetadata, Hunk } from "../types.js";
|
|
2
2
|
import { CreatePatchOptionsNonabortable } from "diff";
|
|
3
|
-
|
|
4
3
|
//#region src/utils/updateDiffHunks.d.ts
|
|
5
4
|
type HunkContent = ContextContent | ChangeContent;
|
|
6
5
|
type HunkMetadataUpdate = Pick<FileDiffMetadata, 'hunks' | 'splitLineCount' | 'unifiedLineCount' | 'type'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateDiffHunks.d.ts","names":[],"sources":["../../src/utils/updateDiffHunks.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"updateDiffHunks.d.ts","names":[],"sources":["../../src/utils/updateDiffHunks.ts"],"mappings":";;;KAgBK,cAAc,iBAAiB;KAE/B,qBAAqB,KACxB;KAIG,qBAAqB,qBACxB,KAAK;;iBAGS,mBACd,MAAM,kBACN,mBAAmB,iCAClB;iBAwDa,gCACd,MAAM,kBACN;iBAYc,gCACd,MAAM,kBACN,yBACA,mBAAmB,iCAClB;iBAkCa,2BACd,MAAM,kBACN,mBAAmB,iCAClB;;iBAKa,0BACd,MAAM,kBACN,mBAAmB,iCAClB;iBAwBa,gCACd,YAAY,KACV,wFAGF;;iBAyCc,gBACd,MAAM,kBACN,4BAA4B,kBAC5B,mBAAmB,iCAClB;iBA2Ja,4BACd,MAAM,kBACN;iBAiDc,kBACd,SAAS,aACT,wBACA,yBACC;iBAQa,8BAA8B,MAAM;iBAkBpC,8BACd,MAAM,KACJ"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FileDiffMetadata, Hunk, HunkExpansionRegion, HunkSeparators, VirtualFileMetrics } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/virtualDiffLayout.d.ts
|
|
4
3
|
interface ExpandedRegionResult {
|
|
5
4
|
fromStart: number;
|
|
@@ -40,26 +39,11 @@ interface LeadingHunkSeparatorLayoutProps extends HunkSeparatorBaseProps {
|
|
|
40
39
|
hunkIndex: number;
|
|
41
40
|
hunkSpecs: string | undefined;
|
|
42
41
|
}
|
|
43
|
-
declare function getExpandedRegion({
|
|
44
|
-
isPartial,
|
|
45
|
-
rangeSize,
|
|
46
|
-
expandedHunks,
|
|
47
|
-
hunkIndex,
|
|
48
|
-
collapsedContextThreshold
|
|
49
|
-
}: GetExpandedRegionProps): ExpandedRegionResult;
|
|
42
|
+
declare function getExpandedRegion({ isPartial, rangeSize, expandedHunks, hunkIndex, collapsedContextThreshold }: GetExpandedRegionProps): ExpandedRegionResult;
|
|
50
43
|
declare function hasTrailingContext(fileDiff: FileDiffMetadata): boolean;
|
|
51
44
|
declare function hasTrailingContextMismatch(fileDiff: FileDiffMetadata): boolean;
|
|
52
|
-
declare function getTrailingContextRangeSize({
|
|
53
|
-
|
|
54
|
-
errorPrefix
|
|
55
|
-
}: GetTrailingContextRangeSizeProps): number;
|
|
56
|
-
declare function getTrailingExpandedRegion({
|
|
57
|
-
fileDiff,
|
|
58
|
-
hunkIndex,
|
|
59
|
-
expandedHunks,
|
|
60
|
-
collapsedContextThreshold,
|
|
61
|
-
errorPrefix
|
|
62
|
-
}: GetTrailingExpandedRegionProps): ExpandedRegionResult | undefined;
|
|
45
|
+
declare function getTrailingContextRangeSize({ fileDiff, errorPrefix }: GetTrailingContextRangeSizeProps): number;
|
|
46
|
+
declare function getTrailingExpandedRegion({ fileDiff, hunkIndex, expandedHunks, collapsedContextThreshold, errorPrefix }: GetTrailingExpandedRegionProps): ExpandedRegionResult | undefined;
|
|
63
47
|
interface IsAdditionLineRenderableProps {
|
|
64
48
|
fileDiff: FileDiffMetadata;
|
|
65
49
|
/** One-based line number in the new file. */
|
|
@@ -75,12 +59,7 @@ interface IsAdditionLineRenderableProps {
|
|
|
75
59
|
* callers keep their existing missing-row handling. Computed from the same
|
|
76
60
|
* inputs as `iterateOverDiff` so layout math and the oracle cannot diverge.
|
|
77
61
|
*/
|
|
78
|
-
declare function isAdditionLineRenderable({
|
|
79
|
-
fileDiff,
|
|
80
|
-
lineNumber,
|
|
81
|
-
expandedHunks,
|
|
82
|
-
collapsedContextThreshold
|
|
83
|
-
}: IsAdditionLineRenderableProps): boolean;
|
|
62
|
+
declare function isAdditionLineRenderable({ fileDiff, lineNumber, expandedHunks, collapsedContextThreshold }: IsAdditionLineRenderableProps): boolean;
|
|
84
63
|
interface GetNearestRenderableAdditionLineProps extends IsAdditionLineRenderableProps {
|
|
85
64
|
direction: 'up' | 'down';
|
|
86
65
|
}
|
|
@@ -91,37 +70,13 @@ interface GetNearestRenderableAdditionLineProps extends IsAdditionLineRenderable
|
|
|
91
70
|
* over collapsed regions like code folds; it walks the hunk metadata once
|
|
92
71
|
* instead of probing line by line across a gap.
|
|
93
72
|
*/
|
|
94
|
-
declare function getNearestRenderableAdditionLine({
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
expandedHunks,
|
|
99
|
-
collapsedContextThreshold
|
|
100
|
-
}: GetNearestRenderableAdditionLineProps): number | undefined;
|
|
101
|
-
declare function getHunkSeparatorHeight({
|
|
102
|
-
type,
|
|
103
|
-
metrics
|
|
104
|
-
}: HunkSeparatorBaseProps): number;
|
|
105
|
-
declare function getHunkSeparatorGap({
|
|
106
|
-
type,
|
|
107
|
-
metrics
|
|
108
|
-
}: HunkSeparatorBaseProps): number;
|
|
109
|
-
declare function hasLeadingHunkSeparator({
|
|
110
|
-
type,
|
|
111
|
-
hunkIndex,
|
|
112
|
-
hunkSpecs
|
|
113
|
-
}: Omit<LeadingHunkSeparatorLayoutProps, 'metrics'>): boolean;
|
|
73
|
+
declare function getNearestRenderableAdditionLine({ fileDiff, lineNumber, direction, expandedHunks, collapsedContextThreshold }: GetNearestRenderableAdditionLineProps): number | undefined;
|
|
74
|
+
declare function getHunkSeparatorHeight({ type, metrics }: HunkSeparatorBaseProps): number;
|
|
75
|
+
declare function getHunkSeparatorGap({ type, metrics }: HunkSeparatorBaseProps): number;
|
|
76
|
+
declare function hasLeadingHunkSeparator({ type, hunkIndex, hunkSpecs }: Omit<LeadingHunkSeparatorLayoutProps, 'metrics'>): boolean;
|
|
114
77
|
declare function hasTrailingHunkSeparator(type: HunkSeparators): boolean;
|
|
115
|
-
declare function getLeadingHunkSeparatorLayout({
|
|
116
|
-
|
|
117
|
-
metrics,
|
|
118
|
-
hunkIndex,
|
|
119
|
-
hunkSpecs
|
|
120
|
-
}: LeadingHunkSeparatorLayoutProps): HunkSeparatorLayout | undefined;
|
|
121
|
-
declare function getTrailingHunkSeparatorLayout({
|
|
122
|
-
type,
|
|
123
|
-
metrics
|
|
124
|
-
}: HunkSeparatorBaseProps): HunkSeparatorLayout | undefined;
|
|
78
|
+
declare function getLeadingHunkSeparatorLayout({ type, metrics, hunkIndex, hunkSpecs }: LeadingHunkSeparatorLayoutProps): HunkSeparatorLayout | undefined;
|
|
79
|
+
declare function getTrailingHunkSeparatorLayout({ type, metrics }: HunkSeparatorBaseProps): HunkSeparatorLayout | undefined;
|
|
125
80
|
//#endregion
|
|
126
81
|
export { ExpandedRegionResult, GetExpandedRegionProps, GetNearestRenderableAdditionLineProps, GetTrailingContextRangeSizeProps, GetTrailingExpandedRegionProps, HunkSeparatorLayout, IsAdditionLineRenderableProps, getExpandedRegion, getHunkAdditionLineRange, getHunkSeparatorGap, getHunkSeparatorHeight, getLeadingHunkSeparatorLayout, getNearestRenderableAdditionLine, getTrailingContextRangeSize, getTrailingExpandedRegion, getTrailingHunkSeparatorLayout, hasLeadingHunkSeparator, hasTrailingContext, hasTrailingContextMismatch, hasTrailingHunkSeparator, isAdditionLineRenderable };
|
|
127
82
|
//# sourceMappingURL=virtualDiffLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtualDiffLayout.d.ts","names":[],"sources":["../../src/utils/virtualDiffLayout.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"virtualDiffLayout.d.ts","names":[],"sources":["../../src/utils/virtualDiffLayout.ts"],"mappings":";;UAaiB;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA,eAAe,YAAY;EAC3B;EACA;;UAGe;EACf,UAAU;EACV;;UAGe,uCAAuC;EACtD;EACA,eAAe;EACf;;;iBAIc,yBAAyB,MAAM;UAO9B;EACf;EACA;EACA;EACA;;UAGQ;EACR,MAAM;EACN,SAAS;;UAGD,wCAAwC;EAChD;EACA;;iBAKc,oBACd,WACA,WACA,eACA,WACA,6BACC,yBAAyB;iBA6CZ,mBAAmB,UAAU;iBAsB7B,2BACd,UAAU;iBA4BI,8BACd,UACA,eACC;iBA8Ba,4BACd,UACA,WACA,eACA,2BACA,eACC,iCAAiC;UA0CnB;EACf,UAAU;;EAEV;EACA,eAAe,YAAY;EAC3B;;;;;;;;;;iBAWc,2BACd,UACA,YACA,eACA,6BACC;UA+Cc,8CAA8C;EAC7D;;;;;;;;;iBAUc,mCACd,UACA,YACA,WACA,eACA,6BACC;iBAsEa,yBACd,MACA,WACC;iBAIa,sBACd,MACA,WACC;iBAMa,0BACd,MACA,WACA,aACC,KAAK;iBAaQ,yBAAyB,MAAM;iBAK/B,gCACd,MACA,SACA,WACA,aACC,kCAAkC;iBAmBrB,iCACd,MACA,WACC,yBAAyB"}
|