solid-markdown
Advanced tools
Comparing version 2.0.7 to 2.0.8
@@ -1,95 +0,5 @@ | ||
import { Component, JSX } from 'solid-js'; | ||
import { PluggableList } from 'unified'; | ||
import { Position } from 'unist'; | ||
import { ElementContent, Text, Element, Root } from 'hast'; | ||
interface SolidMarkdownProps { | ||
node: Element; | ||
children: Component[]; | ||
/** | ||
* Passed when `options.rawSourcePos` is given | ||
*/ | ||
sourcePosition?: Position; | ||
/** | ||
* Passed when `options.includeElementIndex` is given | ||
*/ | ||
index?: number; | ||
/** | ||
* Passed when `options.includeElementIndex` is given | ||
*/ | ||
siblingCount?: number; | ||
} | ||
type NormalComponents = { | ||
[TagName in keyof JSX.IntrinsicElements]: keyof JSX.IntrinsicElements | Component<JSX.IntrinsicElements[TagName] & SolidMarkdownProps>; | ||
}; | ||
type TransformLink = (href: string, children: ElementContent[], title?: string) => string; | ||
type TransformImage = (src: string, alt: string, title?: string) => string; | ||
type TransformLinkTargetType = "_self" | "_blank" | "_parent" | "_top" | (string & {}); | ||
type TransformLinkTarget = (href: string, children: ElementContent[], title?: string) => TransformLinkTargetType | undefined; | ||
type SolidMarkdownNames = keyof JSX.IntrinsicElements; | ||
type CodeComponent = Component<JSX.IntrinsicElements["code"] & SolidMarkdownProps & { | ||
inline?: boolean; | ||
}>; | ||
type HeadingComponent = Component<JSX.IntrinsicElements["h1"] & SolidMarkdownProps & { | ||
level: number; | ||
}>; | ||
type LiComponent = Component<JSX.IntrinsicElements["li"] & SolidMarkdownProps & { | ||
checked: boolean | null; | ||
index: number; | ||
ordered: boolean; | ||
}>; | ||
type OrderedListComponent = Component<JSX.IntrinsicElements["ol"] & SolidMarkdownProps & { | ||
depth: number; | ||
ordered: true; | ||
}>; | ||
type TableCellComponent = Component<JSX.IntrinsicElements["table"] & SolidMarkdownProps & { | ||
style?: Record<string, unknown>; | ||
isHeader: boolean; | ||
}>; | ||
type TableRowComponent = Component<JSX.IntrinsicElements["tr"] & SolidMarkdownProps & { | ||
isHeader: boolean; | ||
}>; | ||
type UnorderedListComponent = Component<JSX.IntrinsicElements["ul"] & SolidMarkdownProps & { | ||
depth: number; | ||
ordered: false; | ||
}>; | ||
type SpecialComponents = { | ||
code: CodeComponent | SolidMarkdownNames; | ||
h1: HeadingComponent | SolidMarkdownNames; | ||
h2: HeadingComponent | SolidMarkdownNames; | ||
h3: HeadingComponent | SolidMarkdownNames; | ||
h4: HeadingComponent | SolidMarkdownNames; | ||
h5: HeadingComponent | SolidMarkdownNames; | ||
h6: HeadingComponent | SolidMarkdownNames; | ||
li: LiComponent | SolidMarkdownNames; | ||
ol: OrderedListComponent | SolidMarkdownNames; | ||
td: TableCellComponent | SolidMarkdownNames; | ||
th: TableCellComponent | SolidMarkdownNames; | ||
tr: TableRowComponent | SolidMarkdownNames; | ||
ul: UnorderedListComponent | SolidMarkdownNames; | ||
}; | ||
type Components = Omit<Partial<Omit<NormalComponents, keyof SpecialComponents>> & Partial<SpecialComponents>, "text"> & { | ||
text?: Component<{ | ||
node: Text; | ||
}>; | ||
}; | ||
type Options$1 = { | ||
sourcePos: boolean; | ||
rawSourcePos: boolean; | ||
skipHtml: boolean; | ||
includeElementIndex: boolean; | ||
transformLinkUri: null | false | TransformLink; | ||
transformImageUri?: TransformImage; | ||
linkTarget: TransformLinkTargetType | TransformLinkTarget; | ||
components: Components; | ||
}; | ||
type AllowElement = (element: Element, index: number, parent: Element | Root) => boolean | undefined; | ||
type Options = { | ||
allowedElements?: string[]; | ||
disallowedElements?: string[]; | ||
allowElement?: AllowElement; | ||
unwrapDisallowed: boolean; | ||
}; | ||
import { type Component } from "solid-js"; | ||
import { type PluggableList } from "unified"; | ||
import type { Options as TransformOptions } from "./types"; | ||
import { type Options as FilterOptions } from "./rehype-filter"; | ||
type CoreOptions = { | ||
@@ -106,6 +16,5 @@ children: string; | ||
}; | ||
type SolidMarkdownOptions = CoreOptions & PluginOptions & LayoutOptions & Options & Options$1; | ||
type SolidMarkdownComponents = Options$1["components"]; | ||
declare const SolidMarkdown: Component<Partial<SolidMarkdownOptions>>; | ||
export { SolidMarkdown, type SolidMarkdownComponents, type SolidMarkdownOptions }; | ||
export type SolidMarkdownOptions = CoreOptions & PluginOptions & LayoutOptions & FilterOptions & TransformOptions; | ||
export type SolidMarkdownComponents = TransformOptions["components"]; | ||
export declare const SolidMarkdown: Component<Partial<SolidMarkdownOptions>>; | ||
export {}; |
{ | ||
"name": "solid-markdown", | ||
"version": "2.0.7", | ||
"version": "2.0.8", | ||
"description": "Markdown renderer for solid-js", | ||
@@ -51,22 +51,6 @@ "license": "MIT", | ||
"browser": "./dist/index.js", | ||
"exports": { | ||
"solid": { | ||
"development": "./dist/dev.jsx", | ||
"import": "./dist/index.jsx" | ||
}, | ||
"development": { | ||
"import": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/dev.js" | ||
} | ||
}, | ||
"import": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
} | ||
}, | ||
"typesVersions": {}, | ||
"scripts": { | ||
"dev": "vite serve dev", | ||
"build": "tsup", | ||
"build": "vite build && tsc", | ||
"prepublishOnly": "pnpm build", | ||
@@ -73,0 +57,0 @@ "format": "prettier --ignore-path .gitignore -w \"src/**/*.{js,ts,json,css,tsx,jsx}\" \"dev/**/*.{js,ts,json,css,tsx,jsx}\"", |
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
318902
10
7269
1
1