@code-hike/smooth-code
Advanced tools
Comparing version 0.3.0--canary.77.c58a10a.0 to 0.3.0--canary.77.c8f7b29.0
@@ -1,1 +0,25 @@ | ||
export declare function CodeTween(): null; | ||
import React from "react"; | ||
import { IRawTheme } from "vscode-textmate"; | ||
import { FullTween, Code, FocusString } from "@code-hike/utils"; | ||
import { CodeAnnotation } from "./partial-step-parser"; | ||
declare type HTMLProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLPreElement>, HTMLPreElement>; | ||
export declare type CodeTweenProps = { | ||
tween: FullTween<CodeStep>; | ||
progress: number; | ||
config: CodeConfig; | ||
} & HTMLProps; | ||
export declare type CodeStep = { | ||
code: Code; | ||
focus: FocusString; | ||
annotations?: CodeAnnotation[]; | ||
}; | ||
export declare type CodeConfig = { | ||
parentHeight?: any; | ||
minColumns?: number; | ||
minZoom?: number; | ||
maxZoom?: number; | ||
horizontalCenter?: boolean; | ||
theme: IRawTheme; | ||
}; | ||
export declare function CodeTween({ tween, progress, config, ...preProps }: CodeTweenProps): JSX.Element; | ||
export {}; |
@@ -17,2 +17,24 @@ import { IThemedToken } from "shiki"; | ||
export declare function highlightOrPlaceholder(code: string, lang: string, theme: EditorTheme): CodeLine[]; | ||
export declare function highlightCode(code: string, lang: string, theme: EditorTheme): Promise<{ | ||
tokens: { | ||
content: string; | ||
props: { | ||
className?: string | undefined; | ||
style?: { | ||
color: string | undefined; | ||
} | undefined; | ||
}; | ||
}[]; | ||
}[]>; | ||
export declare function highlightTween(code: Tween<string>, lang: string, theme: EditorTheme): Promise<FullTween<{ | ||
tokens: { | ||
content: string; | ||
props: { | ||
className?: string | undefined; | ||
style?: { | ||
color: string | undefined; | ||
} | undefined; | ||
}; | ||
}[]; | ||
}[]>>; | ||
declare type ThemedCode = { | ||
@@ -19,0 +41,0 @@ lines: IThemedToken[][]; |
@@ -1,4 +0,7 @@ | ||
import { Code, CodeProps } from "./code"; | ||
import { CodeTween } from "./code-tween"; | ||
import { HeavyCode, CodeProps } from "./heavy-code"; | ||
import { CodeTween, CodeStep, CodeConfig } from "./code-tween"; | ||
import { CodeAnnotation } from "./step-parser"; | ||
export { Code, CodeProps, CodeTween, CodeAnnotation }; | ||
import { highlightTween, highlightCode } from "./highlighter"; | ||
import { Code } from "./oldcode"; | ||
import { CodeSpring } from "./code-spring"; | ||
export { CodeTween, CodeSpring, CodeAnnotation, CodeStep, CodeConfig, HeavyCode, Code, CodeProps, highlightCode, highlightTween, }; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
import { Dimensions } from "./use-dimensions"; | ||
@@ -3,0 +2,0 @@ import { CodeStep } from "./step-parser"; |
@@ -1,3 +0,2 @@ | ||
import { FullTween } from "@code-hike/utils"; | ||
import { FocusString, ColumnExtremes } from "./focus-parser"; | ||
import { FullTween, FocusString, ColumnExtremes } from "@code-hike/utils"; | ||
import { MergedCode, FocusedCode, MergedLine, LineGroup, AnnotatedLine, MultiLineAnnotation, InlineAnnotation } from "./step-parser"; | ||
@@ -4,0 +3,0 @@ import React from "react"; |
@@ -1,3 +0,2 @@ | ||
import { Tween, FullTween } from "@code-hike/utils"; | ||
import { FocusString } from "./focus-parser"; | ||
import { Tween, FocusString, FullTween } from "@code-hike/utils"; | ||
import { EditorTheme } from "./themes"; | ||
@@ -12,2 +11,3 @@ import React from "react"; | ||
data: any; | ||
theme: EditorTheme; | ||
}) => React.ReactElement; | ||
@@ -52,2 +52,3 @@ data?: any; | ||
data: any; | ||
theme: EditorTheme; | ||
Component: (props: { | ||
@@ -57,2 +58,3 @@ style: React.CSSProperties; | ||
data: any; | ||
theme: EditorTheme; | ||
}) => React.ReactElement; | ||
@@ -66,2 +68,3 @@ }; | ||
data: any; | ||
theme: EditorTheme; | ||
Component: (props: { | ||
@@ -71,2 +74,3 @@ style?: React.CSSProperties; | ||
data: any; | ||
theme: EditorTheme; | ||
}) => React.ReactElement; | ||
@@ -73,0 +77,0 @@ }; |
import { IRawTheme } from "vscode-textmate"; | ||
import DEFAULT_THEME from "shiki/themes/dark-plus.json"; | ||
interface EditorTheme extends IRawTheme { | ||
type?: string; | ||
} | ||
export { getThemeDefaultColors, EditorTheme }; | ||
export { getThemeDefaultColors, EditorTheme, DEFAULT_THEME }; | ||
declare function getThemeDefaultColors(theme: EditorTheme): { | ||
@@ -7,0 +8,0 @@ fg: string; |
import React from "react"; | ||
import { FocusString } from "./focus-parser"; | ||
import { Tween } from "@code-hike/utils"; | ||
import { FocusString, Tween } from "@code-hike/utils"; | ||
declare type Dimensions = { | ||
@@ -5,0 +4,0 @@ containerWidth: number; |
{ | ||
"name": "@code-hike/smooth-code", | ||
"version": "0.3.0--canary.77.c58a10a.0", | ||
"version": "0.3.0--canary.77.c8f7b29.0", | ||
"main": "dist/index.cjs.js", | ||
"typings": "dist/index.d.ts", | ||
"module": "dist/index.esm.js", | ||
"sideEffects": false, | ||
"style": "dist/index.css", | ||
@@ -17,19 +18,18 @@ "files": [ | ||
"devDependencies": { | ||
"@code-hike/script": "0.3.0--canary.77.c58a10a.0", | ||
"@code-hike/script": "0.3.0--canary.77.c8f7b29.0", | ||
"@types/diff": "^4.0.2", | ||
"@types/jest": "^24.0.15", | ||
"@types/react": "^16.9.38", | ||
"@types/react": "^17.0.2", | ||
"jest": "^26.5.3", | ||
"react": "^16.13.1", | ||
"react": "^17.0.2", | ||
"ts-jest": "^26.4.1" | ||
}, | ||
"dependencies": { | ||
"@code-hike/code-diff": "0.3.0--canary.77.c58a10a.0", | ||
"@code-hike/smooth-lines": "0.3.0--canary.77.c58a10a.0", | ||
"@code-hike/utils": "0.3.0--canary.77.c58a10a.0", | ||
"@code-hike/highlighter": "0.3.0--canary.77.c8f7b29.0", | ||
"@code-hike/utils": "0.3.0--canary.77.c8f7b29.0", | ||
"diff": "^4.0.2", | ||
"shiki": "^0.9.5" | ||
"use-spring": "^0.2.3" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=16.8" | ||
"react": "^16.8.3 || ^17 || ^18" | ||
}, | ||
@@ -50,3 +50,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "c58a10af94bfbb73197c59ff8331d2b2635c9c29" | ||
"gitHead": "c8f7b2929ddc229854ed919b6427e77291be9cbd" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
174909
5
3631
+ Addeduse-spring@^0.2.3
+ Added@code-hike/highlighter@0.3.0--canary.77.c8f7b29.0(transitive)
+ Added@code-hike/utils@0.3.0--canary.77.c8f7b29.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedreact@18.3.1(transitive)
+ Addedreact-dom@18.3.1(transitive)
+ Addedscheduler@0.23.2(transitive)
+ Addeduse-spring@0.2.4(transitive)
- Removedshiki@^0.9.5
- Removed@code-hike/code-diff@0.3.0--canary.77.c58a10a.0(transitive)
- Removed@code-hike/smooth-lines@0.3.0--canary.77.c58a10a.0(transitive)
- Removed@code-hike/utils@0.3.0--canary.77.c58a10a.0(transitive)
- Removedprismjs@1.29.0(transitive)
- Removedreact@19.0.0(transitive)