Comparing version 1.0.0-beta.0 to 1.0.0-beta.1
@@ -29,3 +29,3 @@ import { jsx as _jsx } from "react/jsx-runtime"; | ||
else { | ||
const { lineNumber, indentation, data, ...props } = result; | ||
const { lineNumber, totalLines, indentation, data, ...props } = result; | ||
return _jsx("div", { ...props }); | ||
@@ -32,0 +32,0 @@ } |
@@ -34,8 +34,8 @@ import { jsx as _jsx } from "react/jsx-runtime"; | ||
const merge = { _stack: stack, _ref: ref }; | ||
return (_jsx(InnerPre, { merge: merge, "data-theme": themeName, "data-lang": lang, className: className, ...rest, children: _jsx(RenderLines, { linesOrGroups: groups, annotationNames: annotationNames, handlers: handlers, inlineAnnotations: inlineAnnotations, indentations: indentations }) })); | ||
return (_jsx(InnerPre, { merge: merge, "data-theme": themeName, "data-lang": lang, className: className, ...rest, children: _jsx(RenderLines, { linesOrGroups: groups, annotationNames: annotationNames, handlers: handlers, inlineAnnotations: inlineAnnotations, indentations: indentations, totalLines: lines.length }) })); | ||
}); | ||
function RenderLines({ linesOrGroups, handlers, inlineAnnotations, indentations, annotationStack = [], annotationNames, }) { | ||
function RenderLines({ linesOrGroups, handlers, inlineAnnotations, indentations, annotationStack = [], annotationNames, totalLines, }) { | ||
return linesOrGroups.map((group) => { | ||
if (isGroup(group)) { | ||
return (_jsx(AnnotatedLines, { group: group, handlers: handlers, inlineAnnotations: inlineAnnotations, annotationStack: annotationStack, indentations: indentations, annotationNames: annotationNames }, group.range[0])); | ||
return (_jsx(AnnotatedLines, { group: group, handlers: handlers, inlineAnnotations: inlineAnnotations, annotationStack: annotationStack, indentations: indentations, annotationNames: annotationNames, totalLines: totalLines }, group.range[0])); | ||
} | ||
@@ -61,7 +61,7 @@ const lineNumber = group.range[0]; | ||
let children = (_jsx(RenderLineContent, { lineContent: lineContent, handlers: handlers, lineNumber: lineNumber })); | ||
const merge = { lineNumber, indentation, _stack: stack }; | ||
const merge = { lineNumber, indentation, totalLines, _stack: stack }; | ||
return (_jsx(InnerLine, { merge: merge, children: children }, lineNumber)); | ||
}); | ||
} | ||
function AnnotatedLines({ group, handlers, inlineAnnotations, annotationStack, indentations, annotationNames, }) { | ||
function AnnotatedLines({ group, handlers, inlineAnnotations, annotationStack, indentations, annotationNames, totalLines, }) { | ||
var _a; | ||
@@ -72,5 +72,5 @@ const { annotation, lines } = group; | ||
if (!Component) { | ||
return (_jsx(RenderLines, { linesOrGroups: lines, handlers: handlers, inlineAnnotations: inlineAnnotations, annotationStack: [annotation, ...annotationStack], indentations: indentations, annotationNames: annotationNames })); | ||
return (_jsx(RenderLines, { linesOrGroups: lines, handlers: handlers, inlineAnnotations: inlineAnnotations, annotationStack: [annotation, ...annotationStack], indentations: indentations, annotationNames: annotationNames, totalLines: totalLines })); | ||
} | ||
return (_jsx(Component, { annotation: annotation, children: _jsx(RenderLines, { linesOrGroups: lines, handlers: handlers, inlineAnnotations: inlineAnnotations, annotationStack: [annotation, ...annotationStack], indentations: indentations, annotationNames: annotationNames }) })); | ||
return (_jsx(Component, { annotation: annotation, children: _jsx(RenderLines, { linesOrGroups: lines, handlers: handlers, inlineAnnotations: inlineAnnotations, annotationStack: [annotation, ...annotationStack], indentations: indentations, annotationNames: annotationNames, totalLines: totalLines }) })); | ||
} | ||
@@ -77,0 +77,0 @@ function toLines(tokens) { |
@@ -104,2 +104,3 @@ /// <reference types="react" /> | ||
lineNumber: number; | ||
totalLines: number; | ||
indentation: number; | ||
@@ -106,0 +107,0 @@ data?: Record<string, any>; |
{ | ||
"name": "codehike", | ||
"version": "1.0.0-beta.0", | ||
"version": "1.0.0-beta.1", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
267486
191
6200