Refactor routing in App component to enhance navigation and improve error handling by integrating dynamic routes and updating the NotFound route.
This commit is contained in:
22
node_modules/@shikijs/core/LICENSE
generated
vendored
Normal file
22
node_modules/@shikijs/core/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Pine Wu
|
||||
Copyright (c) 2023 Anthony Fu <https://github.com/antfu>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
5
node_modules/@shikijs/core/README.md
generated
vendored
Normal file
5
node_modules/@shikijs/core/README.md
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# @shikijs/core
|
||||
|
||||
The core functionality of [Shiki](https://github.com/shikijs/shiki), without any grammar of themes bundled.
|
||||
|
||||
It's the same as importing `shiki/core`.
|
295
node_modules/@shikijs/core/dist/index.d.mts
generated
vendored
Normal file
295
node_modules/@shikijs/core/dist/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,295 @@
|
||||
import { CreatedBundledHighlighterOptions, CreateHighlighterFactory, LanguageInput, ThemeInput, HighlighterCoreOptions, CodeToHastOptions, CodeToTokensOptions, TokensResult, RequireKeys, CodeToTokensBaseOptions, ThemedToken, CodeToTokensWithThemesOptions, ThemedTokenWithVariants, BundledHighlighterOptions, HighlighterGeneric, GrammarState, HighlighterCore, ShikiInternal, RegexEngine, LoadWasmOptions, ShikiTransformerContextCommon, CodeToHastRenderOptions, ShikiTransformerContextSource, ThemeRegistrationResolved, TokenizeWithThemeOptions, Grammar, ThemeRegistrationAny, ThemeRegistration, ShikiTransformer, MaybeArray, PlainTextLanguage, SpecialLanguage, SpecialTheme, MaybeGetter, TokenStyles, Position } from '@shikijs/types';
|
||||
export * from '@shikijs/types';
|
||||
import { Root, Element } from 'hast';
|
||||
import { JavaScriptRegexEngineOptions } from '@shikijs/engine-javascript';
|
||||
export { FontStyle, EncodedTokenMetadata as StackElementMetadata } from '@shikijs/vscode-textmate';
|
||||
export { toHtml as hastToHtml } from 'hast-util-to-html';
|
||||
|
||||
/**
|
||||
* Create a `createHighlighter` function with bundled themes, languages, and engine.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* const createHighlighter = createdBundledHighlighter({
|
||||
* langs: {
|
||||
* typescript: () => import('@shikijs/langs/typescript'),
|
||||
* // ...
|
||||
* },
|
||||
* themes: {
|
||||
* nord: () => import('@shikijs/themes/nord'),
|
||||
* // ...
|
||||
* },
|
||||
* engine: () => createOnigurumaEngine(), // or createJavaScriptRegexEngine()
|
||||
* })
|
||||
* ```
|
||||
*
|
||||
* @param options
|
||||
*/
|
||||
declare function createdBundledHighlighter<BundledLangs extends string, BundledThemes extends string>(options: CreatedBundledHighlighterOptions<BundledLangs, BundledThemes>): CreateHighlighterFactory<BundledLangs, BundledThemes>;
|
||||
/**
|
||||
* Create a `createHighlighter` function with bundled themes and languages.
|
||||
*
|
||||
* @deprecated Use `createdBundledHighlighter({ langs, themes, engine })` signature instead.
|
||||
*/
|
||||
declare function createdBundledHighlighter<BundledLangs extends string, BundledThemes extends string>(bundledLanguages: Record<BundledLangs, LanguageInput>, bundledThemes: Record<BundledThemes, ThemeInput>, loadWasm: HighlighterCoreOptions['loadWasm']): CreateHighlighterFactory<BundledLangs, BundledThemes>;
|
||||
interface ShorthandsBundle<L extends string, T extends string> {
|
||||
/**
|
||||
* Shorthand for `codeToHtml` with auto-loaded theme and language.
|
||||
* A singleton highlighter it maintained internally.
|
||||
*
|
||||
* Differences from `highlighter.codeToHtml()`, this function is async.
|
||||
*/
|
||||
codeToHtml: (code: string, options: CodeToHastOptions<L, T>) => Promise<string>;
|
||||
/**
|
||||
* Shorthand for `codeToHtml` with auto-loaded theme and language.
|
||||
* A singleton highlighter it maintained internally.
|
||||
*
|
||||
* Differences from `highlighter.codeToHtml()`, this function is async.
|
||||
*/
|
||||
codeToHast: (code: string, options: CodeToHastOptions<L, T>) => Promise<Root>;
|
||||
/**
|
||||
* Shorthand for `codeToTokens` with auto-loaded theme and language.
|
||||
* A singleton highlighter it maintained internally.
|
||||
*
|
||||
* Differences from `highlighter.codeToTokens()`, this function is async.
|
||||
*/
|
||||
codeToTokens: (code: string, options: CodeToTokensOptions<L, T>) => Promise<TokensResult>;
|
||||
/**
|
||||
* Shorthand for `codeToTokensBase` with auto-loaded theme and language.
|
||||
* A singleton highlighter it maintained internally.
|
||||
*
|
||||
* Differences from `highlighter.codeToTokensBase()`, this function is async.
|
||||
*/
|
||||
codeToTokensBase: (code: string, options: RequireKeys<CodeToTokensBaseOptions<L, T>, 'theme' | 'lang'>) => Promise<ThemedToken[][]>;
|
||||
/**
|
||||
* Shorthand for `codeToTokensWithThemes` with auto-loaded theme and language.
|
||||
* A singleton highlighter it maintained internally.
|
||||
*
|
||||
* Differences from `highlighter.codeToTokensWithThemes()`, this function is async.
|
||||
*/
|
||||
codeToTokensWithThemes: (code: string, options: RequireKeys<CodeToTokensWithThemesOptions<L, T>, 'themes' | 'lang'>) => Promise<ThemedTokenWithVariants[][]>;
|
||||
/**
|
||||
* Get the singleton highlighter.
|
||||
*/
|
||||
getSingletonHighlighter: (options?: Partial<BundledHighlighterOptions<L, T>>) => Promise<HighlighterGeneric<L, T>>;
|
||||
/**
|
||||
* Shorthand for `getLastGrammarState` with auto-loaded theme and language.
|
||||
* A singleton highlighter it maintained internally.
|
||||
*/
|
||||
getLastGrammarState: ((element: ThemedToken[][] | Root) => GrammarState) | ((code: string, options: CodeToTokensBaseOptions<L, T>) => Promise<GrammarState>);
|
||||
}
|
||||
declare function makeSingletonHighlighter<L extends string, T extends string>(createHighlighter: CreateHighlighterFactory<L, T>): (options?: Partial<BundledHighlighterOptions<L, T>>) => Promise<HighlighterGeneric<L, T>>;
|
||||
declare function createSingletonShorthands<L extends string, T extends string>(createHighlighter: CreateHighlighterFactory<L, T>): ShorthandsBundle<L, T>;
|
||||
|
||||
/**
|
||||
* Create a Shiki core highlighter instance, with no languages or themes bundled.
|
||||
* Wasm and each language and theme must be loaded manually.
|
||||
*
|
||||
* @see http://shiki.style/guide/bundles#fine-grained-bundle
|
||||
*/
|
||||
declare function createHighlighterCore(options?: HighlighterCoreOptions): Promise<HighlighterCore>;
|
||||
/**
|
||||
* Create a Shiki core highlighter instance, with no languages or themes bundled.
|
||||
* Wasm and each language and theme must be loaded manually.
|
||||
*
|
||||
* Synchronous version of `createHighlighterCore`, which requires to provide the engine and all themes and languages upfront.
|
||||
*
|
||||
* @see http://shiki.style/guide/bundles#fine-grained-bundle
|
||||
*/
|
||||
declare function createHighlighterCoreSync(options?: HighlighterCoreOptions<true>): HighlighterCore;
|
||||
declare function makeSingletonHighlighterCore(createHighlighter: typeof createHighlighterCore): (options?: Partial<HighlighterCoreOptions>) => Promise<HighlighterCore>;
|
||||
declare const getSingletonHighlighterCore: (options?: Partial<HighlighterCoreOptions>) => Promise<HighlighterCore>;
|
||||
/**
|
||||
* @deprecated Use `createHighlighterCore` or `getSingletonHighlighterCore` instead.
|
||||
*/
|
||||
declare function getHighlighterCore(options?: HighlighterCoreOptions): Promise<HighlighterCore>;
|
||||
|
||||
/**
|
||||
* Get the minimal shiki context for rendering.
|
||||
*/
|
||||
declare function createShikiInternal(options?: HighlighterCoreOptions): Promise<ShikiInternal>;
|
||||
/**
|
||||
* @deprecated Use `createShikiInternal` instead.
|
||||
*/
|
||||
declare function getShikiInternal(options?: HighlighterCoreOptions): Promise<ShikiInternal>;
|
||||
|
||||
/**
|
||||
* Get the minimal shiki context for rendering.
|
||||
*
|
||||
* Synchronous version of `createShikiInternal`, which requires to provide the engine and all themes and languages upfront.
|
||||
*/
|
||||
declare function createShikiInternalSync(options: HighlighterCoreOptions<true>): ShikiInternal;
|
||||
|
||||
/**
|
||||
* @deprecated Import `createJavaScriptRegexEngine` from `@shikijs/engine-javascript` or `shiki/engine/javascript` instead.
|
||||
*/
|
||||
declare function createJavaScriptRegexEngine(options?: JavaScriptRegexEngineOptions): RegexEngine;
|
||||
/**
|
||||
* @deprecated Import `defaultJavaScriptRegexConstructor` from `@shikijs/engine-javascript` or `shiki/engine/javascript` instead.
|
||||
*/
|
||||
declare function defaultJavaScriptRegexConstructor(pattern: string): RegExp;
|
||||
|
||||
/**
|
||||
* @deprecated Import `createOnigurumaEngine` from `@shikijs/engine-oniguruma` or `shiki/engine/oniguruma` instead.
|
||||
*/
|
||||
declare function createOnigurumaEngine(options?: LoadWasmOptions | null): Promise<RegexEngine>;
|
||||
/**
|
||||
* @deprecated Import `createOnigurumaEngine` from `@shikijs/engine-oniguruma` or `shiki/engine/oniguruma` instead.
|
||||
*/
|
||||
declare function createWasmOnigEngine(options?: LoadWasmOptions | null): Promise<RegexEngine>;
|
||||
/**
|
||||
* @deprecated Import `loadWasm` from `@shikijs/engine-oniguruma` or `shiki/engine/oniguruma` instead.
|
||||
*/
|
||||
declare function loadWasm(options: LoadWasmOptions): Promise<void>;
|
||||
|
||||
declare function codeToHast(internal: ShikiInternal, code: string, options: CodeToHastOptions, transformerContext?: ShikiTransformerContextCommon): Root;
|
||||
declare function tokensToHast(tokens: ThemedToken[][], options: CodeToHastRenderOptions, transformerContext: ShikiTransformerContextSource, grammarState?: GrammarState | undefined): Root;
|
||||
|
||||
/**
|
||||
* Get highlighted code in HTML.
|
||||
*/
|
||||
declare function codeToHtml(internal: ShikiInternal, code: string, options: CodeToHastOptions): string;
|
||||
|
||||
/**
|
||||
* High-level code-to-tokens API.
|
||||
*
|
||||
* It will use `codeToTokensWithThemes` or `codeToTokensBase` based on the options.
|
||||
*/
|
||||
declare function codeToTokens(internal: ShikiInternal, code: string, options: CodeToTokensOptions): TokensResult;
|
||||
|
||||
declare function tokenizeAnsiWithTheme(theme: ThemeRegistrationResolved, fileContents: string, options?: TokenizeWithThemeOptions): ThemedToken[][];
|
||||
|
||||
/**
|
||||
* Code to tokens, with a simple theme.
|
||||
*/
|
||||
declare function codeToTokensBase(internal: ShikiInternal, code: string, options?: CodeToTokensBaseOptions): ThemedToken[][];
|
||||
declare function tokenizeWithTheme(code: string, grammar: Grammar, theme: ThemeRegistrationResolved, colorMap: string[], options: TokenizeWithThemeOptions): ThemedToken[][];
|
||||
|
||||
/**
|
||||
* Get tokens with multiple themes
|
||||
*/
|
||||
declare function codeToTokensWithThemes(internal: ShikiInternal, code: string, options: CodeToTokensWithThemesOptions): ThemedTokenWithVariants[][];
|
||||
|
||||
/**
|
||||
* Normalize a textmate theme to shiki theme
|
||||
*/
|
||||
declare function normalizeTheme(rawTheme: ThemeRegistrationAny): ThemeRegistrationResolved;
|
||||
|
||||
interface CssVariablesThemeOptions {
|
||||
/**
|
||||
* Theme name. Need to unique if multiple css variables themes are created
|
||||
*
|
||||
* @default 'css-variables'
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Prefix for css variables
|
||||
*
|
||||
* @default '--shiki-'
|
||||
*/
|
||||
variablePrefix?: string;
|
||||
/**
|
||||
* Default value for css variables, the key is without the prefix
|
||||
*
|
||||
* @example `{ 'token-comment': '#888' }` will generate `var(--shiki-token-comment, #888)` for comments
|
||||
*/
|
||||
variableDefaults?: Record<string, string>;
|
||||
/**
|
||||
* Enable font style
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
fontStyle?: boolean;
|
||||
}
|
||||
/**
|
||||
* A factory function to create a css-variable-based theme
|
||||
*
|
||||
* @see https://shiki.style/guide/theme-colors#css-variables-theme
|
||||
*/
|
||||
declare function createCssVariablesTheme(options?: CssVariablesThemeOptions): ThemeRegistration;
|
||||
|
||||
/**
|
||||
* A built-in transformer to add decorations to the highlighted code.
|
||||
*/
|
||||
declare function transformerDecorations(): ShikiTransformer;
|
||||
|
||||
declare function toArray<T>(x: MaybeArray<T>): T[];
|
||||
/**
|
||||
* Split a string into lines, each line preserves the line ending.
|
||||
*/
|
||||
declare function splitLines(code: string, preserveEnding?: boolean): [string, number][];
|
||||
/**
|
||||
* Check if the language is plaintext that is ignored by Shiki.
|
||||
*
|
||||
* Hard-coded plain text languages: `plaintext`, `txt`, `text`, `plain`.
|
||||
*/
|
||||
declare function isPlainLang(lang: string | null | undefined): lang is PlainTextLanguage;
|
||||
/**
|
||||
* Check if the language is specially handled or bypassed by Shiki.
|
||||
*
|
||||
* Hard-coded languages: `ansi` and plaintexts like `plaintext`, `txt`, `text`, `plain`.
|
||||
*/
|
||||
declare function isSpecialLang(lang: any): lang is SpecialLanguage;
|
||||
/**
|
||||
* Check if the theme is specially handled or bypassed by Shiki.
|
||||
*
|
||||
* Hard-coded themes: `none`.
|
||||
*/
|
||||
declare function isNoneTheme(theme: string | ThemeInput | null | undefined): theme is 'none';
|
||||
/**
|
||||
* Check if the theme is specially handled or bypassed by Shiki.
|
||||
*
|
||||
* Hard-coded themes: `none`.
|
||||
*/
|
||||
declare function isSpecialTheme(theme: string | ThemeInput | null | undefined): theme is SpecialTheme;
|
||||
/**
|
||||
* Utility to append class to a hast node
|
||||
*
|
||||
* If the `property.class` is a string, it will be splitted by space and converted to an array.
|
||||
*/
|
||||
declare function addClassToHast(node: Element, className: string | string[]): Element;
|
||||
/**
|
||||
* Split a token into multiple tokens by given offsets.
|
||||
*
|
||||
* The offsets are relative to the token, and should be sorted.
|
||||
*/
|
||||
declare function splitToken<T extends Pick<ThemedToken, 'content' | 'offset'>>(token: T, offsets: number[]): T[];
|
||||
/**
|
||||
* Split 2D tokens array by given breakpoints.
|
||||
*/
|
||||
declare function splitTokens<T extends Pick<ThemedToken, 'content' | 'offset'>>(tokens: T[][], breakpoints: number[] | Set<number>): T[][];
|
||||
/**
|
||||
* Normalize a getter to a promise.
|
||||
*/
|
||||
declare function normalizeGetter<T>(p: MaybeGetter<T>): Promise<T>;
|
||||
declare function resolveColorReplacements(theme: ThemeRegistrationAny | string, options?: TokenizeWithThemeOptions): Record<string, string | undefined>;
|
||||
declare function applyColorReplacements(color: string, replacements?: Record<string, string | undefined>): string;
|
||||
declare function applyColorReplacements(color?: string | undefined, replacements?: Record<string, string | undefined>): string | undefined;
|
||||
declare function getTokenStyleObject(token: TokenStyles): Record<string, string>;
|
||||
declare function stringifyTokenStyle(token: string | Record<string, string>): string;
|
||||
/**
|
||||
* Creates a converter between index and position in a code block.
|
||||
*
|
||||
* Overflow/underflow are unchecked.
|
||||
*/
|
||||
declare function createPositionConverter(code: string): {
|
||||
lines: string[];
|
||||
indexToPos: (index: number) => Position;
|
||||
posToIndex: (line: number, character: number) => number;
|
||||
};
|
||||
|
||||
type DeprecationTarget = 3;
|
||||
/**
|
||||
* Enable runtime warning for deprecated APIs, for the future versions of Shiki.
|
||||
*
|
||||
* You can pass a major version to only warn for deprecations that will be removed in that version.
|
||||
*
|
||||
* By default, deprecation warning is set to 3 since Shiki v2.0.0
|
||||
*/
|
||||
declare function enableDeprecationWarnings(emitDeprecation?: DeprecationTarget | boolean, emitError?: boolean): void;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
declare function warnDeprecated(message: string, version?: DeprecationTarget): void;
|
||||
|
||||
export { type CssVariablesThemeOptions, type ShorthandsBundle, addClassToHast, applyColorReplacements, codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, createCssVariablesTheme, createHighlighterCore, createHighlighterCoreSync, createJavaScriptRegexEngine, createOnigurumaEngine, createPositionConverter, createShikiInternal, createShikiInternalSync, createSingletonShorthands, createWasmOnigEngine, createdBundledHighlighter, defaultJavaScriptRegexConstructor, enableDeprecationWarnings, getHighlighterCore, getShikiInternal, getSingletonHighlighterCore, getTokenStyleObject, isNoneTheme, isPlainLang, isSpecialLang, isSpecialTheme, loadWasm, makeSingletonHighlighter, makeSingletonHighlighterCore, normalizeGetter, normalizeTheme, resolveColorReplacements, splitLines, splitToken, splitTokens, stringifyTokenStyle, toArray, tokenizeAnsiWithTheme, tokenizeWithTheme, tokensToHast, transformerDecorations, warnDeprecated };
|
295
node_modules/@shikijs/core/dist/index.d.ts
generated
vendored
Normal file
295
node_modules/@shikijs/core/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,295 @@
|
||||
import { CreatedBundledHighlighterOptions, CreateHighlighterFactory, LanguageInput, ThemeInput, HighlighterCoreOptions, CodeToHastOptions, CodeToTokensOptions, TokensResult, RequireKeys, CodeToTokensBaseOptions, ThemedToken, CodeToTokensWithThemesOptions, ThemedTokenWithVariants, BundledHighlighterOptions, HighlighterGeneric, GrammarState, HighlighterCore, ShikiInternal, RegexEngine, LoadWasmOptions, ShikiTransformerContextCommon, CodeToHastRenderOptions, ShikiTransformerContextSource, ThemeRegistrationResolved, TokenizeWithThemeOptions, Grammar, ThemeRegistrationAny, ThemeRegistration, ShikiTransformer, MaybeArray, PlainTextLanguage, SpecialLanguage, SpecialTheme, MaybeGetter, TokenStyles, Position } from '@shikijs/types';
|
||||
export * from '@shikijs/types';
|
||||
import { Root, Element } from 'hast';
|
||||
import { JavaScriptRegexEngineOptions } from '@shikijs/engine-javascript';
|
||||
export { FontStyle, EncodedTokenMetadata as StackElementMetadata } from '@shikijs/vscode-textmate';
|
||||
export { toHtml as hastToHtml } from 'hast-util-to-html';
|
||||
|
||||
/**
|
||||
* Create a `createHighlighter` function with bundled themes, languages, and engine.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* const createHighlighter = createdBundledHighlighter({
|
||||
* langs: {
|
||||
* typescript: () => import('@shikijs/langs/typescript'),
|
||||
* // ...
|
||||
* },
|
||||
* themes: {
|
||||
* nord: () => import('@shikijs/themes/nord'),
|
||||
* // ...
|
||||
* },
|
||||
* engine: () => createOnigurumaEngine(), // or createJavaScriptRegexEngine()
|
||||
* })
|
||||
* ```
|
||||
*
|
||||
* @param options
|
||||
*/
|
||||
declare function createdBundledHighlighter<BundledLangs extends string, BundledThemes extends string>(options: CreatedBundledHighlighterOptions<BundledLangs, BundledThemes>): CreateHighlighterFactory<BundledLangs, BundledThemes>;
|
||||
/**
|
||||
* Create a `createHighlighter` function with bundled themes and languages.
|
||||
*
|
||||
* @deprecated Use `createdBundledHighlighter({ langs, themes, engine })` signature instead.
|
||||
*/
|
||||
declare function createdBundledHighlighter<BundledLangs extends string, BundledThemes extends string>(bundledLanguages: Record<BundledLangs, LanguageInput>, bundledThemes: Record<BundledThemes, ThemeInput>, loadWasm: HighlighterCoreOptions['loadWasm']): CreateHighlighterFactory<BundledLangs, BundledThemes>;
|
||||
interface ShorthandsBundle<L extends string, T extends string> {
|
||||
/**
|
||||
* Shorthand for `codeToHtml` with auto-loaded theme and language.
|
||||
* A singleton highlighter it maintained internally.
|
||||
*
|
||||
* Differences from `highlighter.codeToHtml()`, this function is async.
|
||||
*/
|
||||
codeToHtml: (code: string, options: CodeToHastOptions<L, T>) => Promise<string>;
|
||||
/**
|
||||
* Shorthand for `codeToHtml` with auto-loaded theme and language.
|
||||
* A singleton highlighter it maintained internally.
|
||||
*
|
||||
* Differences from `highlighter.codeToHtml()`, this function is async.
|
||||
*/
|
||||
codeToHast: (code: string, options: CodeToHastOptions<L, T>) => Promise<Root>;
|
||||
/**
|
||||
* Shorthand for `codeToTokens` with auto-loaded theme and language.
|
||||
* A singleton highlighter it maintained internally.
|
||||
*
|
||||
* Differences from `highlighter.codeToTokens()`, this function is async.
|
||||
*/
|
||||
codeToTokens: (code: string, options: CodeToTokensOptions<L, T>) => Promise<TokensResult>;
|
||||
/**
|
||||
* Shorthand for `codeToTokensBase` with auto-loaded theme and language.
|
||||
* A singleton highlighter it maintained internally.
|
||||
*
|
||||
* Differences from `highlighter.codeToTokensBase()`, this function is async.
|
||||
*/
|
||||
codeToTokensBase: (code: string, options: RequireKeys<CodeToTokensBaseOptions<L, T>, 'theme' | 'lang'>) => Promise<ThemedToken[][]>;
|
||||
/**
|
||||
* Shorthand for `codeToTokensWithThemes` with auto-loaded theme and language.
|
||||
* A singleton highlighter it maintained internally.
|
||||
*
|
||||
* Differences from `highlighter.codeToTokensWithThemes()`, this function is async.
|
||||
*/
|
||||
codeToTokensWithThemes: (code: string, options: RequireKeys<CodeToTokensWithThemesOptions<L, T>, 'themes' | 'lang'>) => Promise<ThemedTokenWithVariants[][]>;
|
||||
/**
|
||||
* Get the singleton highlighter.
|
||||
*/
|
||||
getSingletonHighlighter: (options?: Partial<BundledHighlighterOptions<L, T>>) => Promise<HighlighterGeneric<L, T>>;
|
||||
/**
|
||||
* Shorthand for `getLastGrammarState` with auto-loaded theme and language.
|
||||
* A singleton highlighter it maintained internally.
|
||||
*/
|
||||
getLastGrammarState: ((element: ThemedToken[][] | Root) => GrammarState) | ((code: string, options: CodeToTokensBaseOptions<L, T>) => Promise<GrammarState>);
|
||||
}
|
||||
declare function makeSingletonHighlighter<L extends string, T extends string>(createHighlighter: CreateHighlighterFactory<L, T>): (options?: Partial<BundledHighlighterOptions<L, T>>) => Promise<HighlighterGeneric<L, T>>;
|
||||
declare function createSingletonShorthands<L extends string, T extends string>(createHighlighter: CreateHighlighterFactory<L, T>): ShorthandsBundle<L, T>;
|
||||
|
||||
/**
|
||||
* Create a Shiki core highlighter instance, with no languages or themes bundled.
|
||||
* Wasm and each language and theme must be loaded manually.
|
||||
*
|
||||
* @see http://shiki.style/guide/bundles#fine-grained-bundle
|
||||
*/
|
||||
declare function createHighlighterCore(options?: HighlighterCoreOptions): Promise<HighlighterCore>;
|
||||
/**
|
||||
* Create a Shiki core highlighter instance, with no languages or themes bundled.
|
||||
* Wasm and each language and theme must be loaded manually.
|
||||
*
|
||||
* Synchronous version of `createHighlighterCore`, which requires to provide the engine and all themes and languages upfront.
|
||||
*
|
||||
* @see http://shiki.style/guide/bundles#fine-grained-bundle
|
||||
*/
|
||||
declare function createHighlighterCoreSync(options?: HighlighterCoreOptions<true>): HighlighterCore;
|
||||
declare function makeSingletonHighlighterCore(createHighlighter: typeof createHighlighterCore): (options?: Partial<HighlighterCoreOptions>) => Promise<HighlighterCore>;
|
||||
declare const getSingletonHighlighterCore: (options?: Partial<HighlighterCoreOptions>) => Promise<HighlighterCore>;
|
||||
/**
|
||||
* @deprecated Use `createHighlighterCore` or `getSingletonHighlighterCore` instead.
|
||||
*/
|
||||
declare function getHighlighterCore(options?: HighlighterCoreOptions): Promise<HighlighterCore>;
|
||||
|
||||
/**
|
||||
* Get the minimal shiki context for rendering.
|
||||
*/
|
||||
declare function createShikiInternal(options?: HighlighterCoreOptions): Promise<ShikiInternal>;
|
||||
/**
|
||||
* @deprecated Use `createShikiInternal` instead.
|
||||
*/
|
||||
declare function getShikiInternal(options?: HighlighterCoreOptions): Promise<ShikiInternal>;
|
||||
|
||||
/**
|
||||
* Get the minimal shiki context for rendering.
|
||||
*
|
||||
* Synchronous version of `createShikiInternal`, which requires to provide the engine and all themes and languages upfront.
|
||||
*/
|
||||
declare function createShikiInternalSync(options: HighlighterCoreOptions<true>): ShikiInternal;
|
||||
|
||||
/**
|
||||
* @deprecated Import `createJavaScriptRegexEngine` from `@shikijs/engine-javascript` or `shiki/engine/javascript` instead.
|
||||
*/
|
||||
declare function createJavaScriptRegexEngine(options?: JavaScriptRegexEngineOptions): RegexEngine;
|
||||
/**
|
||||
* @deprecated Import `defaultJavaScriptRegexConstructor` from `@shikijs/engine-javascript` or `shiki/engine/javascript` instead.
|
||||
*/
|
||||
declare function defaultJavaScriptRegexConstructor(pattern: string): RegExp;
|
||||
|
||||
/**
|
||||
* @deprecated Import `createOnigurumaEngine` from `@shikijs/engine-oniguruma` or `shiki/engine/oniguruma` instead.
|
||||
*/
|
||||
declare function createOnigurumaEngine(options?: LoadWasmOptions | null): Promise<RegexEngine>;
|
||||
/**
|
||||
* @deprecated Import `createOnigurumaEngine` from `@shikijs/engine-oniguruma` or `shiki/engine/oniguruma` instead.
|
||||
*/
|
||||
declare function createWasmOnigEngine(options?: LoadWasmOptions | null): Promise<RegexEngine>;
|
||||
/**
|
||||
* @deprecated Import `loadWasm` from `@shikijs/engine-oniguruma` or `shiki/engine/oniguruma` instead.
|
||||
*/
|
||||
declare function loadWasm(options: LoadWasmOptions): Promise<void>;
|
||||
|
||||
declare function codeToHast(internal: ShikiInternal, code: string, options: CodeToHastOptions, transformerContext?: ShikiTransformerContextCommon): Root;
|
||||
declare function tokensToHast(tokens: ThemedToken[][], options: CodeToHastRenderOptions, transformerContext: ShikiTransformerContextSource, grammarState?: GrammarState | undefined): Root;
|
||||
|
||||
/**
|
||||
* Get highlighted code in HTML.
|
||||
*/
|
||||
declare function codeToHtml(internal: ShikiInternal, code: string, options: CodeToHastOptions): string;
|
||||
|
||||
/**
|
||||
* High-level code-to-tokens API.
|
||||
*
|
||||
* It will use `codeToTokensWithThemes` or `codeToTokensBase` based on the options.
|
||||
*/
|
||||
declare function codeToTokens(internal: ShikiInternal, code: string, options: CodeToTokensOptions): TokensResult;
|
||||
|
||||
declare function tokenizeAnsiWithTheme(theme: ThemeRegistrationResolved, fileContents: string, options?: TokenizeWithThemeOptions): ThemedToken[][];
|
||||
|
||||
/**
|
||||
* Code to tokens, with a simple theme.
|
||||
*/
|
||||
declare function codeToTokensBase(internal: ShikiInternal, code: string, options?: CodeToTokensBaseOptions): ThemedToken[][];
|
||||
declare function tokenizeWithTheme(code: string, grammar: Grammar, theme: ThemeRegistrationResolved, colorMap: string[], options: TokenizeWithThemeOptions): ThemedToken[][];
|
||||
|
||||
/**
|
||||
* Get tokens with multiple themes
|
||||
*/
|
||||
declare function codeToTokensWithThemes(internal: ShikiInternal, code: string, options: CodeToTokensWithThemesOptions): ThemedTokenWithVariants[][];
|
||||
|
||||
/**
|
||||
* Normalize a textmate theme to shiki theme
|
||||
*/
|
||||
declare function normalizeTheme(rawTheme: ThemeRegistrationAny): ThemeRegistrationResolved;
|
||||
|
||||
interface CssVariablesThemeOptions {
|
||||
/**
|
||||
* Theme name. Need to unique if multiple css variables themes are created
|
||||
*
|
||||
* @default 'css-variables'
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Prefix for css variables
|
||||
*
|
||||
* @default '--shiki-'
|
||||
*/
|
||||
variablePrefix?: string;
|
||||
/**
|
||||
* Default value for css variables, the key is without the prefix
|
||||
*
|
||||
* @example `{ 'token-comment': '#888' }` will generate `var(--shiki-token-comment, #888)` for comments
|
||||
*/
|
||||
variableDefaults?: Record<string, string>;
|
||||
/**
|
||||
* Enable font style
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
fontStyle?: boolean;
|
||||
}
|
||||
/**
|
||||
* A factory function to create a css-variable-based theme
|
||||
*
|
||||
* @see https://shiki.style/guide/theme-colors#css-variables-theme
|
||||
*/
|
||||
declare function createCssVariablesTheme(options?: CssVariablesThemeOptions): ThemeRegistration;
|
||||
|
||||
/**
|
||||
* A built-in transformer to add decorations to the highlighted code.
|
||||
*/
|
||||
declare function transformerDecorations(): ShikiTransformer;
|
||||
|
||||
declare function toArray<T>(x: MaybeArray<T>): T[];
|
||||
/**
|
||||
* Split a string into lines, each line preserves the line ending.
|
||||
*/
|
||||
declare function splitLines(code: string, preserveEnding?: boolean): [string, number][];
|
||||
/**
|
||||
* Check if the language is plaintext that is ignored by Shiki.
|
||||
*
|
||||
* Hard-coded plain text languages: `plaintext`, `txt`, `text`, `plain`.
|
||||
*/
|
||||
declare function isPlainLang(lang: string | null | undefined): lang is PlainTextLanguage;
|
||||
/**
|
||||
* Check if the language is specially handled or bypassed by Shiki.
|
||||
*
|
||||
* Hard-coded languages: `ansi` and plaintexts like `plaintext`, `txt`, `text`, `plain`.
|
||||
*/
|
||||
declare function isSpecialLang(lang: any): lang is SpecialLanguage;
|
||||
/**
|
||||
* Check if the theme is specially handled or bypassed by Shiki.
|
||||
*
|
||||
* Hard-coded themes: `none`.
|
||||
*/
|
||||
declare function isNoneTheme(theme: string | ThemeInput | null | undefined): theme is 'none';
|
||||
/**
|
||||
* Check if the theme is specially handled or bypassed by Shiki.
|
||||
*
|
||||
* Hard-coded themes: `none`.
|
||||
*/
|
||||
declare function isSpecialTheme(theme: string | ThemeInput | null | undefined): theme is SpecialTheme;
|
||||
/**
|
||||
* Utility to append class to a hast node
|
||||
*
|
||||
* If the `property.class` is a string, it will be splitted by space and converted to an array.
|
||||
*/
|
||||
declare function addClassToHast(node: Element, className: string | string[]): Element;
|
||||
/**
|
||||
* Split a token into multiple tokens by given offsets.
|
||||
*
|
||||
* The offsets are relative to the token, and should be sorted.
|
||||
*/
|
||||
declare function splitToken<T extends Pick<ThemedToken, 'content' | 'offset'>>(token: T, offsets: number[]): T[];
|
||||
/**
|
||||
* Split 2D tokens array by given breakpoints.
|
||||
*/
|
||||
declare function splitTokens<T extends Pick<ThemedToken, 'content' | 'offset'>>(tokens: T[][], breakpoints: number[] | Set<number>): T[][];
|
||||
/**
|
||||
* Normalize a getter to a promise.
|
||||
*/
|
||||
declare function normalizeGetter<T>(p: MaybeGetter<T>): Promise<T>;
|
||||
declare function resolveColorReplacements(theme: ThemeRegistrationAny | string, options?: TokenizeWithThemeOptions): Record<string, string | undefined>;
|
||||
declare function applyColorReplacements(color: string, replacements?: Record<string, string | undefined>): string;
|
||||
declare function applyColorReplacements(color?: string | undefined, replacements?: Record<string, string | undefined>): string | undefined;
|
||||
declare function getTokenStyleObject(token: TokenStyles): Record<string, string>;
|
||||
declare function stringifyTokenStyle(token: string | Record<string, string>): string;
|
||||
/**
|
||||
* Creates a converter between index and position in a code block.
|
||||
*
|
||||
* Overflow/underflow are unchecked.
|
||||
*/
|
||||
declare function createPositionConverter(code: string): {
|
||||
lines: string[];
|
||||
indexToPos: (index: number) => Position;
|
||||
posToIndex: (line: number, character: number) => number;
|
||||
};
|
||||
|
||||
type DeprecationTarget = 3;
|
||||
/**
|
||||
* Enable runtime warning for deprecated APIs, for the future versions of Shiki.
|
||||
*
|
||||
* You can pass a major version to only warn for deprecations that will be removed in that version.
|
||||
*
|
||||
* By default, deprecation warning is set to 3 since Shiki v2.0.0
|
||||
*/
|
||||
declare function enableDeprecationWarnings(emitDeprecation?: DeprecationTarget | boolean, emitError?: boolean): void;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
declare function warnDeprecated(message: string, version?: DeprecationTarget): void;
|
||||
|
||||
export { type CssVariablesThemeOptions, type ShorthandsBundle, addClassToHast, applyColorReplacements, codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, createCssVariablesTheme, createHighlighterCore, createHighlighterCoreSync, createJavaScriptRegexEngine, createOnigurumaEngine, createPositionConverter, createShikiInternal, createShikiInternalSync, createSingletonShorthands, createWasmOnigEngine, createdBundledHighlighter, defaultJavaScriptRegexConstructor, enableDeprecationWarnings, getHighlighterCore, getShikiInternal, getSingletonHighlighterCore, getTokenStyleObject, isNoneTheme, isPlainLang, isSpecialLang, isSpecialTheme, loadWasm, makeSingletonHighlighter, makeSingletonHighlighterCore, normalizeGetter, normalizeTheme, resolveColorReplacements, splitLines, splitToken, splitTokens, stringifyTokenStyle, toArray, tokenizeAnsiWithTheme, tokenizeWithTheme, tokensToHast, transformerDecorations, warnDeprecated };
|
2227
node_modules/@shikijs/core/dist/index.mjs
generated
vendored
Normal file
2227
node_modules/@shikijs/core/dist/index.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
19
node_modules/@shikijs/core/dist/shared/core.Bn_XU0Iv.mjs
generated
vendored
Normal file
19
node_modules/@shikijs/core/dist/shared/core.Bn_XU0Iv.mjs
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
let _emitDeprecation = false;
|
||||
let _emitError = false;
|
||||
function enableDeprecationWarnings(emitDeprecation = true, emitError = false) {
|
||||
_emitDeprecation = emitDeprecation;
|
||||
_emitError = emitError;
|
||||
}
|
||||
function warnDeprecated(message, version = 3) {
|
||||
if (!_emitDeprecation)
|
||||
return;
|
||||
if (typeof _emitDeprecation === "number" && version > _emitDeprecation)
|
||||
return;
|
||||
if (_emitError) {
|
||||
throw new Error(`[SHIKI DEPRECATE]: ${message}`);
|
||||
} else {
|
||||
console.trace(`[SHIKI DEPRECATE]: ${message}`);
|
||||
}
|
||||
}
|
||||
|
||||
export { enableDeprecationWarnings as e, warnDeprecated as w };
|
1
node_modules/@shikijs/core/dist/textmate.d.mts
generated
vendored
Normal file
1
node_modules/@shikijs/core/dist/textmate.d.mts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from '@shikijs/vscode-textmate';
|
1
node_modules/@shikijs/core/dist/textmate.d.ts
generated
vendored
Normal file
1
node_modules/@shikijs/core/dist/textmate.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from '@shikijs/vscode-textmate';
|
1
node_modules/@shikijs/core/dist/textmate.mjs
generated
vendored
Normal file
1
node_modules/@shikijs/core/dist/textmate.mjs
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from '@shikijs/vscode-textmate';
|
3
node_modules/@shikijs/core/dist/types.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/core/dist/types.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from '@shikijs/types';
|
||||
import '@shikijs/vscode-textmate';
|
||||
import '@shikijs/engine-oniguruma/wasm-inlined';
|
3
node_modules/@shikijs/core/dist/types.d.ts
generated
vendored
Normal file
3
node_modules/@shikijs/core/dist/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from '@shikijs/types';
|
||||
import '@shikijs/vscode-textmate';
|
||||
import '@shikijs/engine-oniguruma/wasm-inlined';
|
1
node_modules/@shikijs/core/dist/types.mjs
generated
vendored
Normal file
1
node_modules/@shikijs/core/dist/types.mjs
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from '@shikijs/types';
|
2
node_modules/@shikijs/core/dist/wasm-inlined.d.mts
generated
vendored
Normal file
2
node_modules/@shikijs/core/dist/wasm-inlined.d.mts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from '@shikijs/engine-oniguruma/wasm-inlined';
|
||||
export { default } from '@shikijs/engine-oniguruma/wasm-inlined';
|
2
node_modules/@shikijs/core/dist/wasm-inlined.d.ts
generated
vendored
Normal file
2
node_modules/@shikijs/core/dist/wasm-inlined.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from '@shikijs/engine-oniguruma/wasm-inlined';
|
||||
export { default } from '@shikijs/engine-oniguruma/wasm-inlined';
|
5
node_modules/@shikijs/core/dist/wasm-inlined.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/core/dist/wasm-inlined.mjs
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { w as warnDeprecated } from './shared/core.Bn_XU0Iv.mjs';
|
||||
export * from '@shikijs/engine-oniguruma/wasm-inlined';
|
||||
export { default } from '@shikijs/engine-oniguruma/wasm-inlined';
|
||||
|
||||
warnDeprecated("Import from `@shikijs/engine-oniguruma/wasm-inlined` instead");
|
75
node_modules/@shikijs/core/package.json
generated
vendored
Normal file
75
node_modules/@shikijs/core/package.json
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"name": "@shikijs/core",
|
||||
"type": "module",
|
||||
"version": "1.29.2",
|
||||
"description": "Core of Shiki",
|
||||
"author": "Pine Wu <octref@gmail.com>; Anthony Fu <anthonyfu117@hotmail.com>",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/shikijs/shiki#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/shikijs/shiki.git",
|
||||
"directory": "packages/core"
|
||||
},
|
||||
"bugs": "https://github.com/shikijs/shiki/issues",
|
||||
"keywords": [
|
||||
"shiki"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
},
|
||||
"./wasm-inlined": {
|
||||
"types": "./dist/wasm-inlined.d.mts",
|
||||
"default": "./dist/wasm-inlined.mjs"
|
||||
},
|
||||
"./textmate": {
|
||||
"types": "./dist/textmate.d.mts",
|
||||
"default": "./dist/textmate.mjs"
|
||||
},
|
||||
"./types": {
|
||||
"types": "./dist/types.d.mts"
|
||||
},
|
||||
"./dist/*": "./dist/*",
|
||||
"./package.json": "./package.json",
|
||||
"./*": "./dist/*"
|
||||
},
|
||||
"main": "./dist/index.mjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.mts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"wasm-inlined": [
|
||||
"./dist/wasm-inlined.d.mts"
|
||||
],
|
||||
"types": [
|
||||
"./dist/types.d.mts"
|
||||
],
|
||||
"textmate": [
|
||||
"./dist/textmate.d.mts"
|
||||
],
|
||||
"*": [
|
||||
"./dist/*",
|
||||
"./*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@shikijs/vscode-textmate": "^10.0.1",
|
||||
"@types/hast": "^3.0.4",
|
||||
"hast-util-to-html": "^9.0.4",
|
||||
"@shikijs/engine-javascript": "1.29.2",
|
||||
"@shikijs/engine-oniguruma": "1.29.2",
|
||||
"@shikijs/types": "1.29.2"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "unbuild --stub",
|
||||
"test": "vitest"
|
||||
}
|
||||
}
|
22
node_modules/@shikijs/engine-javascript/LICENSE
generated
vendored
Normal file
22
node_modules/@shikijs/engine-javascript/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Pine Wu
|
||||
Copyright (c) 2023 Anthony Fu <https://github.com/antfu>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
9
node_modules/@shikijs/engine-javascript/README.md
generated
vendored
Normal file
9
node_modules/@shikijs/engine-javascript/README.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# @shikijs/engine-javascript
|
||||
|
||||
Engine for Shiki using JavaScript's native RegExp. Uses [Oniguruma-To-ES](https://github.com/slevithan/oniguruma-to-es) to transpile regex syntax and behavior.
|
||||
|
||||
[Documentation](https://shiki.style/guide/regex-engines)
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
4
node_modules/@shikijs/engine-javascript/dist/engine-compile.d.mts
generated
vendored
Normal file
4
node_modules/@shikijs/engine-javascript/dist/engine-compile.d.mts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import '@shikijs/types';
|
||||
import 'oniguruma-to-es';
|
||||
export { J as JavaScriptRegexEngineOptions, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DoNZS58X.mjs';
|
||||
import '@shikijs/vscode-textmate';
|
4
node_modules/@shikijs/engine-javascript/dist/engine-compile.d.ts
generated
vendored
Normal file
4
node_modules/@shikijs/engine-javascript/dist/engine-compile.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import '@shikijs/types';
|
||||
import 'oniguruma-to-es';
|
||||
export { J as JavaScriptRegexEngineOptions, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DoNZS58X.js';
|
||||
import '@shikijs/vscode-textmate';
|
49
node_modules/@shikijs/engine-javascript/dist/engine-compile.mjs
generated
vendored
Normal file
49
node_modules/@shikijs/engine-javascript/dist/engine-compile.mjs
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
import { toRegExp } from 'oniguruma-to-es';
|
||||
import { J as JavaScriptScanner } from './shared/engine-javascript.hzpS1_41.mjs';
|
||||
|
||||
function defaultJavaScriptRegexConstructor(pattern, options) {
|
||||
return toRegExp(
|
||||
pattern,
|
||||
{
|
||||
global: true,
|
||||
hasIndices: true,
|
||||
rules: {
|
||||
// Needed since TextMate grammars merge backrefs across patterns
|
||||
allowOrphanBackrefs: true,
|
||||
// Improves search performance for generated regexes
|
||||
asciiWordBoundaries: true,
|
||||
// Follow `vscode-oniguruma` which enables this Oniguruma option by default
|
||||
captureGroup: true,
|
||||
// Oniguruma uses depth limit `20`; lowered here to keep regexes shorter and maybe
|
||||
// sometimes faster, but can be increased if issues reported due to low limit
|
||||
recursionLimit: 5,
|
||||
// Oniguruma option for `^`->`\A`, `$`->`\Z`; improves search performance without any
|
||||
// change in meaning since TM grammars search line by line
|
||||
singleline: true
|
||||
},
|
||||
...options
|
||||
}
|
||||
);
|
||||
}
|
||||
function createJavaScriptRegexEngine(options = {}) {
|
||||
const _options = Object.assign(
|
||||
{
|
||||
target: "auto",
|
||||
cache: /* @__PURE__ */ new Map()
|
||||
},
|
||||
options
|
||||
);
|
||||
_options.regexConstructor ||= (pattern) => defaultJavaScriptRegexConstructor(pattern, { target: _options.target });
|
||||
return {
|
||||
createScanner(patterns) {
|
||||
return new JavaScriptScanner(patterns, _options);
|
||||
},
|
||||
createString(s) {
|
||||
return {
|
||||
content: s
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export { createJavaScriptRegexEngine, defaultJavaScriptRegexConstructor };
|
12
node_modules/@shikijs/engine-javascript/dist/engine-raw.d.mts
generated
vendored
Normal file
12
node_modules/@shikijs/engine-javascript/dist/engine-raw.d.mts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { RegexEngine } from '@shikijs/types';
|
||||
|
||||
/**
|
||||
* Raw JavaScript regex engine that only supports precompiled grammars.
|
||||
*
|
||||
* This further simplifies the engine by excluding the regex compilation step.
|
||||
*
|
||||
* Zero dependencies.
|
||||
*/
|
||||
declare function createJavaScriptRawEngine(): RegexEngine;
|
||||
|
||||
export { createJavaScriptRawEngine };
|
12
node_modules/@shikijs/engine-javascript/dist/engine-raw.d.ts
generated
vendored
Normal file
12
node_modules/@shikijs/engine-javascript/dist/engine-raw.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { RegexEngine } from '@shikijs/types';
|
||||
|
||||
/**
|
||||
* Raw JavaScript regex engine that only supports precompiled grammars.
|
||||
*
|
||||
* This further simplifies the engine by excluding the regex compilation step.
|
||||
*
|
||||
* Zero dependencies.
|
||||
*/
|
||||
declare function createJavaScriptRawEngine(): RegexEngine;
|
||||
|
||||
export { createJavaScriptRawEngine };
|
22
node_modules/@shikijs/engine-javascript/dist/engine-raw.mjs
generated
vendored
Normal file
22
node_modules/@shikijs/engine-javascript/dist/engine-raw.mjs
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { J as JavaScriptScanner } from './shared/engine-javascript.hzpS1_41.mjs';
|
||||
|
||||
function createJavaScriptRawEngine() {
|
||||
const options = {
|
||||
cache: /* @__PURE__ */ new Map(),
|
||||
regexConstructor: () => {
|
||||
throw new Error("JavaScriptRawEngine: only support precompiled grammar");
|
||||
}
|
||||
};
|
||||
return {
|
||||
createScanner(patterns) {
|
||||
return new JavaScriptScanner(patterns, options);
|
||||
},
|
||||
createString(s) {
|
||||
return {
|
||||
content: s
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export { createJavaScriptRawEngine };
|
5
node_modules/@shikijs/engine-javascript/dist/index.d.mts
generated
vendored
Normal file
5
node_modules/@shikijs/engine-javascript/dist/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export { J as JavaScriptRegexEngineOptions, a as JavaScriptRegexScannerOptions, b as JavaScriptScanner, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DoNZS58X.mjs';
|
||||
export { createJavaScriptRawEngine } from './engine-raw.mjs';
|
||||
import '@shikijs/types';
|
||||
import 'oniguruma-to-es';
|
||||
import '@shikijs/vscode-textmate';
|
5
node_modules/@shikijs/engine-javascript/dist/index.d.ts
generated
vendored
Normal file
5
node_modules/@shikijs/engine-javascript/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export { J as JavaScriptRegexEngineOptions, a as JavaScriptRegexScannerOptions, b as JavaScriptScanner, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DoNZS58X.js';
|
||||
export { createJavaScriptRawEngine } from './engine-raw.js';
|
||||
import '@shikijs/types';
|
||||
import 'oniguruma-to-es';
|
||||
import '@shikijs/vscode-textmate';
|
4
node_modules/@shikijs/engine-javascript/dist/index.mjs
generated
vendored
Normal file
4
node_modules/@shikijs/engine-javascript/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export { createJavaScriptRegexEngine, defaultJavaScriptRegexConstructor } from './engine-compile.mjs';
|
||||
export { createJavaScriptRawEngine } from './engine-raw.mjs';
|
||||
export { J as JavaScriptScanner } from './shared/engine-javascript.hzpS1_41.mjs';
|
||||
import 'oniguruma-to-es';
|
62
node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.DoNZS58X.d.mts
generated
vendored
Normal file
62
node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.DoNZS58X.d.mts
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
import { PatternScanner, RegexEngineString, RegexEngine } from '@shikijs/types';
|
||||
import { OnigurumaToEsOptions } from 'oniguruma-to-es';
|
||||
import { IOnigMatch } from '@shikijs/vscode-textmate';
|
||||
|
||||
interface JavaScriptRegexScannerOptions {
|
||||
/**
|
||||
* Whether to allow invalid regex patterns.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
forgiving?: boolean;
|
||||
/**
|
||||
* Cache for regex patterns.
|
||||
*/
|
||||
cache?: Map<string, RegExp | Error> | null;
|
||||
/**
|
||||
* Custom pattern to RegExp constructor.
|
||||
*
|
||||
* By default `oniguruma-to-es` is used.
|
||||
*/
|
||||
regexConstructor?: (pattern: string) => RegExp;
|
||||
}
|
||||
declare class JavaScriptScanner implements PatternScanner {
|
||||
patterns: (string | RegExp)[];
|
||||
options: JavaScriptRegexScannerOptions;
|
||||
regexps: (RegExp | null)[];
|
||||
constructor(patterns: (string | RegExp)[], options?: JavaScriptRegexScannerOptions);
|
||||
findNextMatchSync(string: string | RegexEngineString, startPosition: number, _options: number): IOnigMatch | null;
|
||||
}
|
||||
|
||||
interface JavaScriptRegexEngineOptions extends JavaScriptRegexScannerOptions {
|
||||
/**
|
||||
* The target ECMAScript version.
|
||||
*
|
||||
* Oniguruma-To-ES uses RegExp features from later versions of ECMAScript to add support for a
|
||||
* few more grammars. If using target `ES2024` or later, the RegExp `v` flag is used which
|
||||
* requires Node.js 20+ or Chrome 112+.
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicodeSets
|
||||
*
|
||||
* For maximum compatibility, you can set it to `ES2018` which uses the RegExp `u` flag.
|
||||
*
|
||||
* Set to `auto` to automatically detect the latest version supported by the environment.
|
||||
*
|
||||
* @default 'auto'
|
||||
*/
|
||||
target?: 'auto' | 'ES2025' | 'ES2024' | 'ES2018';
|
||||
}
|
||||
/**
|
||||
* The default regex constructor for the JavaScript RegExp engine.
|
||||
*/
|
||||
declare function defaultJavaScriptRegexConstructor(pattern: string, options?: OnigurumaToEsOptions): RegExp;
|
||||
/**
|
||||
* Use the modern JavaScript RegExp engine to implement the OnigScanner.
|
||||
*
|
||||
* As Oniguruma supports some features that can't be emulated using native JavaScript regexes, some
|
||||
* patterns are not supported. Errors will be thrown when parsing TextMate grammars with
|
||||
* unsupported patterns, and when the grammar includes patterns that use invalid Oniguruma syntax.
|
||||
* Set `forgiving` to `true` to ignore these errors and skip any unsupported or invalid patterns.
|
||||
*/
|
||||
declare function createJavaScriptRegexEngine(options?: JavaScriptRegexEngineOptions): RegexEngine;
|
||||
|
||||
export { type JavaScriptRegexEngineOptions as J, type JavaScriptRegexScannerOptions as a, JavaScriptScanner as b, createJavaScriptRegexEngine as c, defaultJavaScriptRegexConstructor as d };
|
62
node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.DoNZS58X.d.ts
generated
vendored
Normal file
62
node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.DoNZS58X.d.ts
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
import { PatternScanner, RegexEngineString, RegexEngine } from '@shikijs/types';
|
||||
import { OnigurumaToEsOptions } from 'oniguruma-to-es';
|
||||
import { IOnigMatch } from '@shikijs/vscode-textmate';
|
||||
|
||||
interface JavaScriptRegexScannerOptions {
|
||||
/**
|
||||
* Whether to allow invalid regex patterns.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
forgiving?: boolean;
|
||||
/**
|
||||
* Cache for regex patterns.
|
||||
*/
|
||||
cache?: Map<string, RegExp | Error> | null;
|
||||
/**
|
||||
* Custom pattern to RegExp constructor.
|
||||
*
|
||||
* By default `oniguruma-to-es` is used.
|
||||
*/
|
||||
regexConstructor?: (pattern: string) => RegExp;
|
||||
}
|
||||
declare class JavaScriptScanner implements PatternScanner {
|
||||
patterns: (string | RegExp)[];
|
||||
options: JavaScriptRegexScannerOptions;
|
||||
regexps: (RegExp | null)[];
|
||||
constructor(patterns: (string | RegExp)[], options?: JavaScriptRegexScannerOptions);
|
||||
findNextMatchSync(string: string | RegexEngineString, startPosition: number, _options: number): IOnigMatch | null;
|
||||
}
|
||||
|
||||
interface JavaScriptRegexEngineOptions extends JavaScriptRegexScannerOptions {
|
||||
/**
|
||||
* The target ECMAScript version.
|
||||
*
|
||||
* Oniguruma-To-ES uses RegExp features from later versions of ECMAScript to add support for a
|
||||
* few more grammars. If using target `ES2024` or later, the RegExp `v` flag is used which
|
||||
* requires Node.js 20+ or Chrome 112+.
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicodeSets
|
||||
*
|
||||
* For maximum compatibility, you can set it to `ES2018` which uses the RegExp `u` flag.
|
||||
*
|
||||
* Set to `auto` to automatically detect the latest version supported by the environment.
|
||||
*
|
||||
* @default 'auto'
|
||||
*/
|
||||
target?: 'auto' | 'ES2025' | 'ES2024' | 'ES2018';
|
||||
}
|
||||
/**
|
||||
* The default regex constructor for the JavaScript RegExp engine.
|
||||
*/
|
||||
declare function defaultJavaScriptRegexConstructor(pattern: string, options?: OnigurumaToEsOptions): RegExp;
|
||||
/**
|
||||
* Use the modern JavaScript RegExp engine to implement the OnigScanner.
|
||||
*
|
||||
* As Oniguruma supports some features that can't be emulated using native JavaScript regexes, some
|
||||
* patterns are not supported. Errors will be thrown when parsing TextMate grammars with
|
||||
* unsupported patterns, and when the grammar includes patterns that use invalid Oniguruma syntax.
|
||||
* Set `forgiving` to `true` to ignore these errors and skip any unsupported or invalid patterns.
|
||||
*/
|
||||
declare function createJavaScriptRegexEngine(options?: JavaScriptRegexEngineOptions): RegexEngine;
|
||||
|
||||
export { type JavaScriptRegexEngineOptions as J, type JavaScriptRegexScannerOptions as a, JavaScriptScanner as b, createJavaScriptRegexEngine as c, defaultJavaScriptRegexConstructor as d };
|
93
node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.hzpS1_41.mjs
generated
vendored
Normal file
93
node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.hzpS1_41.mjs
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
const MAX = 4294967295;
|
||||
class JavaScriptScanner {
|
||||
constructor(patterns, options = {}) {
|
||||
this.patterns = patterns;
|
||||
this.options = options;
|
||||
const {
|
||||
forgiving = false,
|
||||
cache,
|
||||
regexConstructor
|
||||
} = options;
|
||||
if (!regexConstructor) {
|
||||
throw new Error("Option `regexConstructor` is not provided");
|
||||
}
|
||||
this.regexps = patterns.map((p) => {
|
||||
if (typeof p !== "string") {
|
||||
return p;
|
||||
}
|
||||
const cached = cache?.get(p);
|
||||
if (cached) {
|
||||
if (cached instanceof RegExp) {
|
||||
return cached;
|
||||
}
|
||||
if (forgiving)
|
||||
return null;
|
||||
throw cached;
|
||||
}
|
||||
try {
|
||||
const regex = regexConstructor(p);
|
||||
cache?.set(p, regex);
|
||||
return regex;
|
||||
} catch (e) {
|
||||
cache?.set(p, e);
|
||||
if (forgiving)
|
||||
return null;
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
}
|
||||
regexps;
|
||||
findNextMatchSync(string, startPosition, _options) {
|
||||
const str = typeof string === "string" ? string : string.content;
|
||||
const pending = [];
|
||||
function toResult(index, match, offset = 0) {
|
||||
return {
|
||||
index,
|
||||
captureIndices: match.indices.map((indice) => {
|
||||
if (indice == null) {
|
||||
return {
|
||||
start: MAX,
|
||||
end: MAX,
|
||||
length: 0
|
||||
};
|
||||
}
|
||||
return {
|
||||
start: indice[0] + offset,
|
||||
end: indice[1] + offset,
|
||||
length: indice[1] - indice[0]
|
||||
};
|
||||
})
|
||||
};
|
||||
}
|
||||
for (let i = 0; i < this.regexps.length; i++) {
|
||||
const regexp = this.regexps[i];
|
||||
if (!regexp)
|
||||
continue;
|
||||
try {
|
||||
regexp.lastIndex = startPosition;
|
||||
const match = regexp.exec(str);
|
||||
if (!match)
|
||||
continue;
|
||||
if (match.index === startPosition) {
|
||||
return toResult(i, match, 0);
|
||||
}
|
||||
pending.push([i, match, 0]);
|
||||
} catch (e) {
|
||||
if (this.options.forgiving)
|
||||
continue;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
if (pending.length) {
|
||||
const minIndex = Math.min(...pending.map((m) => m[1].index));
|
||||
for (const [i, match, offset] of pending) {
|
||||
if (match.index === minIndex) {
|
||||
return toResult(i, match, offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export { JavaScriptScanner as J };
|
45
node_modules/@shikijs/engine-javascript/package.json
generated
vendored
Normal file
45
node_modules/@shikijs/engine-javascript/package.json
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "@shikijs/engine-javascript",
|
||||
"type": "module",
|
||||
"version": "1.29.2",
|
||||
"description": "Engine for Shiki using JavaScript's native RegExp",
|
||||
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/shikijs/shiki#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/shikijs/shiki.git",
|
||||
"directory": "packages/engine-javascript"
|
||||
},
|
||||
"bugs": "https://github.com/shikijs/shiki/issues",
|
||||
"keywords": [
|
||||
"shiki",
|
||||
"shiki-engine"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
},
|
||||
"./raw": {
|
||||
"types": "./dist/engine-raw.d.mts",
|
||||
"default": "./dist/engine-raw.mjs"
|
||||
}
|
||||
},
|
||||
"main": "./dist/index.mjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.mts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@shikijs/vscode-textmate": "^10.0.1",
|
||||
"oniguruma-to-es": "^2.2.0",
|
||||
"@shikijs/types": "1.29.2"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "unbuild --stub"
|
||||
}
|
||||
}
|
22
node_modules/@shikijs/engine-oniguruma/LICENSE
generated
vendored
Normal file
22
node_modules/@shikijs/engine-oniguruma/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Pine Wu
|
||||
Copyright (c) 2023 Anthony Fu <https://github.com/antfu>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
9
node_modules/@shikijs/engine-oniguruma/README.md
generated
vendored
Normal file
9
node_modules/@shikijs/engine-oniguruma/README.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# @shikijs/engine-oniguruma
|
||||
|
||||
Engine for Shiki using Oniguruma RegExp engine in WebAssembly.
|
||||
|
||||
[Documentation](https://shiki.style/guide/regex-engines)
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
70
node_modules/@shikijs/engine-oniguruma/dist/chunk-index.d.d.mts
generated
vendored
Normal file
70
node_modules/@shikijs/engine-oniguruma/dist/chunk-index.d.d.mts
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
interface IOnigCaptureIndex {
|
||||
start: number;
|
||||
end: number;
|
||||
length: number;
|
||||
}
|
||||
interface IOnigMatch {
|
||||
index: number;
|
||||
captureIndices: IOnigCaptureIndex[];
|
||||
}
|
||||
declare const enum FindOption {
|
||||
None = 0,
|
||||
/**
|
||||
* equivalent of ONIG_OPTION_NOT_BEGIN_STRING: (str) isn't considered as begin of string (* fail \A)
|
||||
*/
|
||||
NotBeginString = 1,
|
||||
/**
|
||||
* equivalent of ONIG_OPTION_NOT_END_STRING: (end) isn't considered as end of string (* fail \z, \Z)
|
||||
*/
|
||||
NotEndString = 2,
|
||||
/**
|
||||
* equivalent of ONIG_OPTION_NOT_BEGIN_POSITION: (start) isn't considered as start position of search (* fail \G)
|
||||
*/
|
||||
NotBeginPosition = 4,
|
||||
/**
|
||||
* used for debugging purposes.
|
||||
*/
|
||||
DebugCall = 8
|
||||
}
|
||||
interface OnigScanner {
|
||||
findNextMatchSync(string: string | OnigString, startPosition: number, options: OrMask<FindOption>): IOnigMatch | null;
|
||||
dispose?(): void;
|
||||
}
|
||||
interface OnigString {
|
||||
readonly content: string;
|
||||
dispose?(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* A union of given const enum values.
|
||||
*/
|
||||
type OrMask<T extends number> = number;
|
||||
|
||||
type Awaitable<T> = T | Promise<T>;
|
||||
|
||||
interface PatternScanner extends OnigScanner {
|
||||
}
|
||||
interface RegexEngineString extends OnigString {
|
||||
}
|
||||
/**
|
||||
* Engine for RegExp matching and scanning.
|
||||
*/
|
||||
interface RegexEngine {
|
||||
createScanner: (patterns: (string | RegExp)[]) => PatternScanner;
|
||||
createString: (s: string) => RegexEngineString;
|
||||
}
|
||||
interface WebAssemblyInstantiator {
|
||||
(importObject: Record<string, Record<string, WebAssembly.ImportValue>> | undefined): Promise<WebAssemblyInstance>;
|
||||
}
|
||||
type WebAssemblyInstance = WebAssembly.WebAssemblyInstantiatedSource | WebAssembly.Instance | WebAssembly.Instance['exports'];
|
||||
type OnigurumaLoadOptions = {
|
||||
instantiator: WebAssemblyInstantiator;
|
||||
} | {
|
||||
default: WebAssemblyInstantiator;
|
||||
} | {
|
||||
data: ArrayBufferView | ArrayBuffer | Response;
|
||||
};
|
||||
type LoadWasmOptionsPlain = OnigurumaLoadOptions | WebAssemblyInstantiator | ArrayBufferView | ArrayBuffer | Response;
|
||||
type LoadWasmOptions = Awaitable<LoadWasmOptionsPlain> | (() => Awaitable<LoadWasmOptionsPlain>);
|
||||
|
||||
export type { LoadWasmOptions as L, RegexEngine as R, WebAssemblyInstantiator as W };
|
20
node_modules/@shikijs/engine-oniguruma/dist/index.d.mts
generated
vendored
Normal file
20
node_modules/@shikijs/engine-oniguruma/dist/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { L as LoadWasmOptions, R as RegexEngine } from './chunk-index.d.mjs';
|
||||
|
||||
declare function loadWasm(options: LoadWasmOptions): Promise<void>;
|
||||
|
||||
/**
|
||||
* Set the default wasm loader for `loadWasm`.
|
||||
* @internal
|
||||
*/
|
||||
declare function setDefaultWasmLoader(_loader: LoadWasmOptions): void;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
declare function getDefaultWasmLoader(): LoadWasmOptions | undefined;
|
||||
declare function createOnigurumaEngine(options?: LoadWasmOptions | null): Promise<RegexEngine>;
|
||||
/**
|
||||
* Deprecated. Use `createOnigurumaEngine` instead.
|
||||
*/
|
||||
declare function createWasmOnigEngine(options?: LoadWasmOptions | null): Promise<RegexEngine>;
|
||||
|
||||
export { createOnigurumaEngine, createWasmOnigEngine, getDefaultWasmLoader, loadWasm, setDefaultWasmLoader };
|
455
node_modules/@shikijs/engine-oniguruma/dist/index.mjs
generated
vendored
Normal file
455
node_modules/@shikijs/engine-oniguruma/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,455 @@
|
||||
class ShikiError extends Error {
|
||||
constructor(message) {
|
||||
super(message);
|
||||
this.name = "ShikiError";
|
||||
}
|
||||
}
|
||||
|
||||
function getHeapMax() {
|
||||
return 2147483648;
|
||||
}
|
||||
function _emscripten_get_now() {
|
||||
return typeof performance !== "undefined" ? performance.now() : Date.now();
|
||||
}
|
||||
const alignUp = (x, multiple) => x + (multiple - x % multiple) % multiple;
|
||||
async function main(init) {
|
||||
let wasmMemory;
|
||||
let buffer;
|
||||
const binding = {};
|
||||
function updateGlobalBufferAndViews(buf) {
|
||||
buffer = buf;
|
||||
binding.HEAPU8 = new Uint8Array(buf);
|
||||
binding.HEAPU32 = new Uint32Array(buf);
|
||||
}
|
||||
function _emscripten_memcpy_big(dest, src, num) {
|
||||
binding.HEAPU8.copyWithin(dest, src, src + num);
|
||||
}
|
||||
function emscripten_realloc_buffer(size) {
|
||||
try {
|
||||
wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16);
|
||||
updateGlobalBufferAndViews(wasmMemory.buffer);
|
||||
return 1;
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
function _emscripten_resize_heap(requestedSize) {
|
||||
const oldSize = binding.HEAPU8.length;
|
||||
requestedSize = requestedSize >>> 0;
|
||||
const maxHeapSize = getHeapMax();
|
||||
if (requestedSize > maxHeapSize)
|
||||
return false;
|
||||
for (let cutDown = 1; cutDown <= 4; cutDown *= 2) {
|
||||
let overGrownHeapSize = oldSize * (1 + 0.2 / cutDown);
|
||||
overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);
|
||||
const newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536));
|
||||
const replacement = emscripten_realloc_buffer(newSize);
|
||||
if (replacement)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
const UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined;
|
||||
function UTF8ArrayToString(heapOrArray, idx, maxBytesToRead = 1024) {
|
||||
const endIdx = idx + maxBytesToRead;
|
||||
let endPtr = idx;
|
||||
while (heapOrArray[endPtr] && !(endPtr >= endIdx))
|
||||
++endPtr;
|
||||
if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
|
||||
return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
|
||||
}
|
||||
let str = "";
|
||||
while (idx < endPtr) {
|
||||
let u0 = heapOrArray[idx++];
|
||||
if (!(u0 & 128)) {
|
||||
str += String.fromCharCode(u0);
|
||||
continue;
|
||||
}
|
||||
const u1 = heapOrArray[idx++] & 63;
|
||||
if ((u0 & 224) === 192) {
|
||||
str += String.fromCharCode((u0 & 31) << 6 | u1);
|
||||
continue;
|
||||
}
|
||||
const u2 = heapOrArray[idx++] & 63;
|
||||
if ((u0 & 240) === 224) {
|
||||
u0 = (u0 & 15) << 12 | u1 << 6 | u2;
|
||||
} else {
|
||||
u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63;
|
||||
}
|
||||
if (u0 < 65536) {
|
||||
str += String.fromCharCode(u0);
|
||||
} else {
|
||||
const ch = u0 - 65536;
|
||||
str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
function UTF8ToString(ptr, maxBytesToRead) {
|
||||
return ptr ? UTF8ArrayToString(binding.HEAPU8, ptr, maxBytesToRead) : "";
|
||||
}
|
||||
const asmLibraryArg = {
|
||||
emscripten_get_now: _emscripten_get_now,
|
||||
emscripten_memcpy_big: _emscripten_memcpy_big,
|
||||
emscripten_resize_heap: _emscripten_resize_heap,
|
||||
fd_write: () => 0
|
||||
};
|
||||
async function createWasm() {
|
||||
const info = {
|
||||
env: asmLibraryArg,
|
||||
wasi_snapshot_preview1: asmLibraryArg
|
||||
};
|
||||
const exports = await init(info);
|
||||
wasmMemory = exports.memory;
|
||||
updateGlobalBufferAndViews(wasmMemory.buffer);
|
||||
Object.assign(binding, exports);
|
||||
binding.UTF8ToString = UTF8ToString;
|
||||
}
|
||||
await createWasm();
|
||||
return binding;
|
||||
}
|
||||
|
||||
var __defProp = Object.defineProperty;
|
||||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var __publicField = (obj, key, value) => {
|
||||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
||||
return value;
|
||||
};
|
||||
let onigBinding = null;
|
||||
function throwLastOnigError(onigBinding2) {
|
||||
throw new ShikiError(onigBinding2.UTF8ToString(onigBinding2.getLastOnigError()));
|
||||
}
|
||||
class UtfString {
|
||||
constructor(str) {
|
||||
__publicField(this, "utf16Length");
|
||||
__publicField(this, "utf8Length");
|
||||
__publicField(this, "utf16Value");
|
||||
__publicField(this, "utf8Value");
|
||||
__publicField(this, "utf16OffsetToUtf8");
|
||||
__publicField(this, "utf8OffsetToUtf16");
|
||||
const utf16Length = str.length;
|
||||
const utf8Length = UtfString._utf8ByteLength(str);
|
||||
const computeIndicesMapping = utf8Length !== utf16Length;
|
||||
const utf16OffsetToUtf8 = computeIndicesMapping ? new Uint32Array(utf16Length + 1) : null;
|
||||
if (computeIndicesMapping)
|
||||
utf16OffsetToUtf8[utf16Length] = utf8Length;
|
||||
const utf8OffsetToUtf16 = computeIndicesMapping ? new Uint32Array(utf8Length + 1) : null;
|
||||
if (computeIndicesMapping)
|
||||
utf8OffsetToUtf16[utf8Length] = utf16Length;
|
||||
const utf8Value = new Uint8Array(utf8Length);
|
||||
let i8 = 0;
|
||||
for (let i16 = 0; i16 < utf16Length; i16++) {
|
||||
const charCode = str.charCodeAt(i16);
|
||||
let codePoint = charCode;
|
||||
let wasSurrogatePair = false;
|
||||
if (charCode >= 55296 && charCode <= 56319) {
|
||||
if (i16 + 1 < utf16Length) {
|
||||
const nextCharCode = str.charCodeAt(i16 + 1);
|
||||
if (nextCharCode >= 56320 && nextCharCode <= 57343) {
|
||||
codePoint = (charCode - 55296 << 10) + 65536 | nextCharCode - 56320;
|
||||
wasSurrogatePair = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (computeIndicesMapping) {
|
||||
utf16OffsetToUtf8[i16] = i8;
|
||||
if (wasSurrogatePair)
|
||||
utf16OffsetToUtf8[i16 + 1] = i8;
|
||||
if (codePoint <= 127) {
|
||||
utf8OffsetToUtf16[i8 + 0] = i16;
|
||||
} else if (codePoint <= 2047) {
|
||||
utf8OffsetToUtf16[i8 + 0] = i16;
|
||||
utf8OffsetToUtf16[i8 + 1] = i16;
|
||||
} else if (codePoint <= 65535) {
|
||||
utf8OffsetToUtf16[i8 + 0] = i16;
|
||||
utf8OffsetToUtf16[i8 + 1] = i16;
|
||||
utf8OffsetToUtf16[i8 + 2] = i16;
|
||||
} else {
|
||||
utf8OffsetToUtf16[i8 + 0] = i16;
|
||||
utf8OffsetToUtf16[i8 + 1] = i16;
|
||||
utf8OffsetToUtf16[i8 + 2] = i16;
|
||||
utf8OffsetToUtf16[i8 + 3] = i16;
|
||||
}
|
||||
}
|
||||
if (codePoint <= 127) {
|
||||
utf8Value[i8++] = codePoint;
|
||||
} else if (codePoint <= 2047) {
|
||||
utf8Value[i8++] = 192 | (codePoint & 1984) >>> 6;
|
||||
utf8Value[i8++] = 128 | (codePoint & 63) >>> 0;
|
||||
} else if (codePoint <= 65535) {
|
||||
utf8Value[i8++] = 224 | (codePoint & 61440) >>> 12;
|
||||
utf8Value[i8++] = 128 | (codePoint & 4032) >>> 6;
|
||||
utf8Value[i8++] = 128 | (codePoint & 63) >>> 0;
|
||||
} else {
|
||||
utf8Value[i8++] = 240 | (codePoint & 1835008) >>> 18;
|
||||
utf8Value[i8++] = 128 | (codePoint & 258048) >>> 12;
|
||||
utf8Value[i8++] = 128 | (codePoint & 4032) >>> 6;
|
||||
utf8Value[i8++] = 128 | (codePoint & 63) >>> 0;
|
||||
}
|
||||
if (wasSurrogatePair)
|
||||
i16++;
|
||||
}
|
||||
this.utf16Length = utf16Length;
|
||||
this.utf8Length = utf8Length;
|
||||
this.utf16Value = str;
|
||||
this.utf8Value = utf8Value;
|
||||
this.utf16OffsetToUtf8 = utf16OffsetToUtf8;
|
||||
this.utf8OffsetToUtf16 = utf8OffsetToUtf16;
|
||||
}
|
||||
static _utf8ByteLength(str) {
|
||||
let result = 0;
|
||||
for (let i = 0, len = str.length; i < len; i++) {
|
||||
const charCode = str.charCodeAt(i);
|
||||
let codepoint = charCode;
|
||||
let wasSurrogatePair = false;
|
||||
if (charCode >= 55296 && charCode <= 56319) {
|
||||
if (i + 1 < len) {
|
||||
const nextCharCode = str.charCodeAt(i + 1);
|
||||
if (nextCharCode >= 56320 && nextCharCode <= 57343) {
|
||||
codepoint = (charCode - 55296 << 10) + 65536 | nextCharCode - 56320;
|
||||
wasSurrogatePair = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (codepoint <= 127)
|
||||
result += 1;
|
||||
else if (codepoint <= 2047)
|
||||
result += 2;
|
||||
else if (codepoint <= 65535)
|
||||
result += 3;
|
||||
else
|
||||
result += 4;
|
||||
if (wasSurrogatePair)
|
||||
i++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
createString(onigBinding2) {
|
||||
const result = onigBinding2.omalloc(this.utf8Length);
|
||||
onigBinding2.HEAPU8.set(this.utf8Value, result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
const _OnigString = class {
|
||||
constructor(str) {
|
||||
__publicField(this, "id", ++_OnigString.LAST_ID);
|
||||
__publicField(this, "_onigBinding");
|
||||
__publicField(this, "content");
|
||||
__publicField(this, "utf16Length");
|
||||
__publicField(this, "utf8Length");
|
||||
__publicField(this, "utf16OffsetToUtf8");
|
||||
__publicField(this, "utf8OffsetToUtf16");
|
||||
__publicField(this, "ptr");
|
||||
if (!onigBinding)
|
||||
throw new ShikiError("Must invoke loadWasm first.");
|
||||
this._onigBinding = onigBinding;
|
||||
this.content = str;
|
||||
const utfString = new UtfString(str);
|
||||
this.utf16Length = utfString.utf16Length;
|
||||
this.utf8Length = utfString.utf8Length;
|
||||
this.utf16OffsetToUtf8 = utfString.utf16OffsetToUtf8;
|
||||
this.utf8OffsetToUtf16 = utfString.utf8OffsetToUtf16;
|
||||
if (this.utf8Length < 1e4 && !_OnigString._sharedPtrInUse) {
|
||||
if (!_OnigString._sharedPtr)
|
||||
_OnigString._sharedPtr = onigBinding.omalloc(1e4);
|
||||
_OnigString._sharedPtrInUse = true;
|
||||
onigBinding.HEAPU8.set(utfString.utf8Value, _OnigString._sharedPtr);
|
||||
this.ptr = _OnigString._sharedPtr;
|
||||
} else {
|
||||
this.ptr = utfString.createString(onigBinding);
|
||||
}
|
||||
}
|
||||
convertUtf8OffsetToUtf16(utf8Offset) {
|
||||
if (this.utf8OffsetToUtf16) {
|
||||
if (utf8Offset < 0)
|
||||
return 0;
|
||||
if (utf8Offset > this.utf8Length)
|
||||
return this.utf16Length;
|
||||
return this.utf8OffsetToUtf16[utf8Offset];
|
||||
}
|
||||
return utf8Offset;
|
||||
}
|
||||
convertUtf16OffsetToUtf8(utf16Offset) {
|
||||
if (this.utf16OffsetToUtf8) {
|
||||
if (utf16Offset < 0)
|
||||
return 0;
|
||||
if (utf16Offset > this.utf16Length)
|
||||
return this.utf8Length;
|
||||
return this.utf16OffsetToUtf8[utf16Offset];
|
||||
}
|
||||
return utf16Offset;
|
||||
}
|
||||
dispose() {
|
||||
if (this.ptr === _OnigString._sharedPtr)
|
||||
_OnigString._sharedPtrInUse = false;
|
||||
else
|
||||
this._onigBinding.ofree(this.ptr);
|
||||
}
|
||||
};
|
||||
let OnigString = _OnigString;
|
||||
__publicField(OnigString, "LAST_ID", 0);
|
||||
__publicField(OnigString, "_sharedPtr", 0);
|
||||
// a pointer to a string of 10000 bytes
|
||||
__publicField(OnigString, "_sharedPtrInUse", false);
|
||||
class OnigScanner {
|
||||
constructor(patterns) {
|
||||
__publicField(this, "_onigBinding");
|
||||
__publicField(this, "_ptr");
|
||||
if (!onigBinding)
|
||||
throw new ShikiError("Must invoke loadWasm first.");
|
||||
const strPtrsArr = [];
|
||||
const strLenArr = [];
|
||||
for (let i = 0, len = patterns.length; i < len; i++) {
|
||||
const utfString = new UtfString(patterns[i]);
|
||||
strPtrsArr[i] = utfString.createString(onigBinding);
|
||||
strLenArr[i] = utfString.utf8Length;
|
||||
}
|
||||
const strPtrsPtr = onigBinding.omalloc(4 * patterns.length);
|
||||
onigBinding.HEAPU32.set(strPtrsArr, strPtrsPtr / 4);
|
||||
const strLenPtr = onigBinding.omalloc(4 * patterns.length);
|
||||
onigBinding.HEAPU32.set(strLenArr, strLenPtr / 4);
|
||||
const scannerPtr = onigBinding.createOnigScanner(strPtrsPtr, strLenPtr, patterns.length);
|
||||
for (let i = 0, len = patterns.length; i < len; i++)
|
||||
onigBinding.ofree(strPtrsArr[i]);
|
||||
onigBinding.ofree(strLenPtr);
|
||||
onigBinding.ofree(strPtrsPtr);
|
||||
if (scannerPtr === 0)
|
||||
throwLastOnigError(onigBinding);
|
||||
this._onigBinding = onigBinding;
|
||||
this._ptr = scannerPtr;
|
||||
}
|
||||
dispose() {
|
||||
this._onigBinding.freeOnigScanner(this._ptr);
|
||||
}
|
||||
findNextMatchSync(string, startPosition, arg) {
|
||||
let options = 0 /* None */;
|
||||
if (typeof arg === "number") {
|
||||
options = arg;
|
||||
}
|
||||
if (typeof string === "string") {
|
||||
string = new OnigString(string);
|
||||
const result = this._findNextMatchSync(string, startPosition, false, options);
|
||||
string.dispose();
|
||||
return result;
|
||||
}
|
||||
return this._findNextMatchSync(string, startPosition, false, options);
|
||||
}
|
||||
_findNextMatchSync(string, startPosition, debugCall, options) {
|
||||
const onigBinding2 = this._onigBinding;
|
||||
const resultPtr = onigBinding2.findNextOnigScannerMatch(this._ptr, string.id, string.ptr, string.utf8Length, string.convertUtf16OffsetToUtf8(startPosition), options);
|
||||
if (resultPtr === 0) {
|
||||
return null;
|
||||
}
|
||||
const HEAPU32 = onigBinding2.HEAPU32;
|
||||
let offset = resultPtr / 4;
|
||||
const index = HEAPU32[offset++];
|
||||
const count = HEAPU32[offset++];
|
||||
const captureIndices = [];
|
||||
for (let i = 0; i < count; i++) {
|
||||
const beg = string.convertUtf8OffsetToUtf16(HEAPU32[offset++]);
|
||||
const end = string.convertUtf8OffsetToUtf16(HEAPU32[offset++]);
|
||||
captureIndices[i] = {
|
||||
start: beg,
|
||||
end,
|
||||
length: end - beg
|
||||
};
|
||||
}
|
||||
return {
|
||||
index,
|
||||
captureIndices
|
||||
};
|
||||
}
|
||||
}
|
||||
function isInstantiatorOptionsObject(dataOrOptions) {
|
||||
return typeof dataOrOptions.instantiator === "function";
|
||||
}
|
||||
function isInstantiatorModule(dataOrOptions) {
|
||||
return typeof dataOrOptions.default === "function";
|
||||
}
|
||||
function isDataOptionsObject(dataOrOptions) {
|
||||
return typeof dataOrOptions.data !== "undefined";
|
||||
}
|
||||
function isResponse(dataOrOptions) {
|
||||
return typeof Response !== "undefined" && dataOrOptions instanceof Response;
|
||||
}
|
||||
function isArrayBuffer(data) {
|
||||
return typeof ArrayBuffer !== "undefined" && (data instanceof ArrayBuffer || ArrayBuffer.isView(data)) || typeof Buffer !== "undefined" && Buffer.isBuffer?.(data) || typeof SharedArrayBuffer !== "undefined" && data instanceof SharedArrayBuffer || typeof Uint32Array !== "undefined" && data instanceof Uint32Array;
|
||||
}
|
||||
let initPromise;
|
||||
function loadWasm(options) {
|
||||
if (initPromise)
|
||||
return initPromise;
|
||||
async function _load() {
|
||||
onigBinding = await main(async (info) => {
|
||||
let instance = options;
|
||||
instance = await instance;
|
||||
if (typeof instance === "function")
|
||||
instance = await instance(info);
|
||||
if (typeof instance === "function")
|
||||
instance = await instance(info);
|
||||
if (isInstantiatorOptionsObject(instance)) {
|
||||
instance = await instance.instantiator(info);
|
||||
} else if (isInstantiatorModule(instance)) {
|
||||
instance = await instance.default(info);
|
||||
} else {
|
||||
if (isDataOptionsObject(instance))
|
||||
instance = instance.data;
|
||||
if (isResponse(instance)) {
|
||||
if (typeof WebAssembly.instantiateStreaming === "function")
|
||||
instance = await _makeResponseStreamingLoader(instance)(info);
|
||||
else
|
||||
instance = await _makeResponseNonStreamingLoader(instance)(info);
|
||||
} else if (isArrayBuffer(instance)) {
|
||||
instance = await _makeArrayBufferLoader(instance)(info);
|
||||
} else if (instance instanceof WebAssembly.Module) {
|
||||
instance = await _makeArrayBufferLoader(instance)(info);
|
||||
} else if ("default" in instance && instance.default instanceof WebAssembly.Module) {
|
||||
instance = await _makeArrayBufferLoader(instance.default)(info);
|
||||
}
|
||||
}
|
||||
if ("instance" in instance)
|
||||
instance = instance.instance;
|
||||
if ("exports" in instance)
|
||||
instance = instance.exports;
|
||||
return instance;
|
||||
});
|
||||
}
|
||||
initPromise = _load();
|
||||
return initPromise;
|
||||
}
|
||||
function _makeArrayBufferLoader(data) {
|
||||
return (importObject) => WebAssembly.instantiate(data, importObject);
|
||||
}
|
||||
function _makeResponseStreamingLoader(data) {
|
||||
return (importObject) => WebAssembly.instantiateStreaming(data, importObject);
|
||||
}
|
||||
function _makeResponseNonStreamingLoader(data) {
|
||||
return async (importObject) => {
|
||||
const arrayBuffer = await data.arrayBuffer();
|
||||
return WebAssembly.instantiate(arrayBuffer, importObject);
|
||||
};
|
||||
}
|
||||
|
||||
let _defaultWasmLoader;
|
||||
function setDefaultWasmLoader(_loader) {
|
||||
_defaultWasmLoader = _loader;
|
||||
}
|
||||
function getDefaultWasmLoader() {
|
||||
return _defaultWasmLoader;
|
||||
}
|
||||
async function createOnigurumaEngine(options) {
|
||||
if (options)
|
||||
await loadWasm(options);
|
||||
return {
|
||||
createScanner(patterns) {
|
||||
return new OnigScanner(patterns.map((p) => typeof p === "string" ? p : p.source));
|
||||
},
|
||||
createString(s) {
|
||||
return new OnigString(s);
|
||||
}
|
||||
};
|
||||
}
|
||||
async function createWasmOnigEngine(options) {
|
||||
return createOnigurumaEngine(options);
|
||||
}
|
||||
|
||||
export { createOnigurumaEngine, createWasmOnigEngine, getDefaultWasmLoader, loadWasm, setDefaultWasmLoader };
|
1
node_modules/@shikijs/engine-oniguruma/dist/onig.d.mts
generated
vendored
Normal file
1
node_modules/@shikijs/engine-oniguruma/dist/onig.d.mts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
declare const binary: ArrayBuffer; export default binary;
|
6
node_modules/@shikijs/engine-oniguruma/dist/wasm-inlined.d.mts
generated
vendored
Normal file
6
node_modules/@shikijs/engine-oniguruma/dist/wasm-inlined.d.mts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { W as WebAssemblyInstantiator } from './chunk-index.d.mjs';
|
||||
|
||||
declare const wasmBinary: ArrayBuffer;
|
||||
declare const getWasmInstance: WebAssemblyInstantiator;
|
||||
|
||||
export { getWasmInstance as default, getWasmInstance, wasmBinary };
|
8
node_modules/@shikijs/engine-oniguruma/dist/wasm-inlined.mjs
generated
vendored
Normal file
8
node_modules/@shikijs/engine-oniguruma/dist/wasm-inlined.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
59
node_modules/@shikijs/engine-oniguruma/package.json
generated
vendored
Normal file
59
node_modules/@shikijs/engine-oniguruma/package.json
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "@shikijs/engine-oniguruma",
|
||||
"type": "module",
|
||||
"version": "1.29.2",
|
||||
"description": "Engine for Shiki using Oniguruma RegExp engine in WebAssembly",
|
||||
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/shikijs/shiki#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/shikijs/shiki.git",
|
||||
"directory": "packages/engine-oniguruma"
|
||||
},
|
||||
"bugs": "https://github.com/shikijs/shiki/issues",
|
||||
"keywords": [
|
||||
"shiki",
|
||||
"shiki-engine",
|
||||
"oniguruma"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
},
|
||||
"./wasm-inlined": {
|
||||
"types": "./dist/wasm-inlined.d.mts",
|
||||
"default": "./dist/wasm-inlined.mjs"
|
||||
}
|
||||
},
|
||||
"main": "./dist/index.mjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.mts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"wasm-inlined": [
|
||||
"./dist/wasm-inlined.d.mts"
|
||||
],
|
||||
"*": [
|
||||
"./dist/*",
|
||||
"./*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@shikijs/vscode-textmate": "^10.0.1",
|
||||
"@shikijs/types": "1.29.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vscode-oniguruma": "1.7.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rimraf dist && rollup -c",
|
||||
"dev": "rollup -cw"
|
||||
}
|
||||
}
|
22
node_modules/@shikijs/langs/LICENSE
generated
vendored
Normal file
22
node_modules/@shikijs/langs/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Pine Wu
|
||||
Copyright (c) 2023 Anthony Fu <https://github.com/antfu>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
7
node_modules/@shikijs/langs/README.md
generated
vendored
Normal file
7
node_modules/@shikijs/langs/README.md
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# @shikijs/langs
|
||||
|
||||
TextMate grammars for Shiki.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
3
node_modules/@shikijs/langs/dist/1c-query.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/1c-query.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
2
node_modules/@shikijs/langs/dist/1c-query.mjs
generated
vendored
Normal file
2
node_modules/@shikijs/langs/dist/1c-query.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/* Alias 1c-query for sdbl */
|
||||
export { default } from './sdbl.mjs'
|
3
node_modules/@shikijs/langs/dist/1c.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/1c.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
2
node_modules/@shikijs/langs/dist/1c.mjs
generated
vendored
Normal file
2
node_modules/@shikijs/langs/dist/1c.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/* Alias 1c for bsl */
|
||||
export { default } from './bsl.mjs'
|
3
node_modules/@shikijs/langs/dist/abap.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/abap.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
5
node_modules/@shikijs/langs/dist/abap.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/langs/dist/abap.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/actionscript-3.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/actionscript-3.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
5
node_modules/@shikijs/langs/dist/actionscript-3.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/langs/dist/actionscript-3.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/ada.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/ada.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
5
node_modules/@shikijs/langs/dist/ada.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/langs/dist/ada.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/adoc.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/adoc.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
2
node_modules/@shikijs/langs/dist/adoc.mjs
generated
vendored
Normal file
2
node_modules/@shikijs/langs/dist/adoc.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/* Alias adoc for asciidoc */
|
||||
export { default } from './asciidoc.mjs'
|
3
node_modules/@shikijs/langs/dist/angular-expression.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/angular-expression.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
5
node_modules/@shikijs/langs/dist/angular-expression.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/langs/dist/angular-expression.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/angular-html.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/angular-html.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
16
node_modules/@shikijs/langs/dist/angular-html.mjs
generated
vendored
Normal file
16
node_modules/@shikijs/langs/dist/angular-html.mjs
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import html from './html.mjs'
|
||||
import angular_expression from './angular-expression.mjs'
|
||||
import angular_let_declaration from './angular-let-declaration.mjs'
|
||||
import angular_template from './angular-template.mjs'
|
||||
import angular_template_blocks from './angular-template-blocks.mjs'
|
||||
|
||||
const lang = Object.freeze(JSON.parse("{\"displayName\":\"Angular HTML\",\"injections\":{\"R:text.html - (comment.block, text.html meta.embedded, meta.tag.*.*.html, meta.tag.*.*.*.html, meta.tag.*.*.*.*.html)\":{\"comment\":\"Uses R: to ensure this matches after any other injections.\",\"patterns\":[{\"match\":\"<\",\"name\":\"invalid.illegal.bad-angle-bracket.html\"}]}},\"name\":\"angular-html\",\"patterns\":[{\"include\":\"text.html.basic#core-minus-invalid\"},{\"begin\":\"(</?)(\\\\w[^\\\\s>]*)(?<!/)\",\"beginCaptures\":{\"1\":{\"name\":\"punctuation.definition.tag.begin.html\"},\"2\":{\"name\":\"entity.name.tag.html\"}},\"end\":\"((?: ?/)?>)\",\"endCaptures\":{\"1\":{\"name\":\"punctuation.definition.tag.end.html\"}},\"name\":\"meta.tag.other.unrecognized.html.derivative\",\"patterns\":[{\"include\":\"text.html.basic#attribute\"}]}],\"scopeName\":\"text.html.derivative.ng\",\"embeddedLangs\":[\"html\",\"angular-expression\",\"angular-let-declaration\",\"angular-template\",\"angular-template-blocks\"]}"))
|
||||
|
||||
export default [
|
||||
...html,
|
||||
...angular_expression,
|
||||
...angular_let_declaration,
|
||||
...angular_template,
|
||||
...angular_template_blocks,
|
||||
lang
|
||||
]
|
3
node_modules/@shikijs/langs/dist/angular-inline-style.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/angular-inline-style.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
8
node_modules/@shikijs/langs/dist/angular-inline-style.mjs
generated
vendored
Normal file
8
node_modules/@shikijs/langs/dist/angular-inline-style.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import scss from './scss.mjs'
|
||||
|
||||
const lang = Object.freeze(JSON.parse("{\"injectTo\":[\"source.ts.ng\"],\"injectionSelector\":\"L:source.ts#meta.decorator.ts -comment\",\"name\":\"angular-inline-style\",\"patterns\":[{\"include\":\"#inlineStyles\"}],\"repository\":{\"inlineStyles\":{\"begin\":\"(styles)\\\\s*(:)\",\"beginCaptures\":{\"1\":{\"name\":\"meta.object-literal.key.ts\"},\"2\":{\"name\":\"meta.object-literal.key.ts punctuation.separator.key-value.ts\"}},\"end\":\"(?=,|})\",\"patterns\":[{\"include\":\"#tsParenExpression\"},{\"include\":\"#tsBracketExpression\"},{\"include\":\"#style\"}]},\"style\":{\"begin\":\"\\\\s*([`|'|\\\"])\",\"beginCaptures\":{\"1\":{\"name\":\"string\"}},\"contentName\":\"source.css.scss\",\"end\":\"\\\\1\",\"endCaptures\":{\"0\":{\"name\":\"string\"}},\"patterns\":[{\"include\":\"source.css.scss\"}]},\"tsBracketExpression\":{\"begin\":\"\\\\G\\\\s*(\\\\[)\",\"beginCaptures\":{\"1\":{\"name\":\"meta.array.literal.ts meta.brace.square.ts\"}},\"end\":\"\\\\]\",\"endCaptures\":{\"0\":{\"name\":\"meta.array.literal.ts meta.brace.square.ts\"}},\"patterns\":[{\"include\":\"#style\"}]},\"tsParenExpression\":{\"begin\":\"\\\\G\\\\s*(\\\\()\",\"beginCaptures\":{\"1\":{\"name\":\"meta.brace.round.ts\"}},\"end\":\"\\\\)\",\"endCaptures\":{\"0\":{\"name\":\"meta.brace.round.ts\"}},\"patterns\":[{\"include\":\"$self\"},{\"include\":\"#tsBracketExpression\"},{\"include\":\"#style\"}]}},\"scopeName\":\"inline-styles.ng\",\"embeddedLangs\":[\"scss\"]}"))
|
||||
|
||||
export default [
|
||||
...scss,
|
||||
lang
|
||||
]
|
3
node_modules/@shikijs/langs/dist/angular-inline-template.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/angular-inline-template.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
10
node_modules/@shikijs/langs/dist/angular-inline-template.mjs
generated
vendored
Normal file
10
node_modules/@shikijs/langs/dist/angular-inline-template.mjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import angular_html from './angular-html.mjs'
|
||||
import angular_template from './angular-template.mjs'
|
||||
|
||||
const lang = Object.freeze(JSON.parse("{\"injectTo\":[\"source.ts.ng\"],\"injectionSelector\":\"L:meta.decorator.ts -comment -text.html\",\"name\":\"angular-inline-template\",\"patterns\":[{\"include\":\"#inlineTemplate\"}],\"repository\":{\"inlineTemplate\":{\"begin\":\"(template)\\\\s*(:)\",\"beginCaptures\":{\"1\":{\"name\":\"meta.object-literal.key.ts\"},\"2\":{\"name\":\"meta.object-literal.key.ts punctuation.separator.key-value.ts\"}},\"end\":\"(?=,|})\",\"patterns\":[{\"include\":\"#tsParenExpression\"},{\"include\":\"#ngTemplate\"}]},\"ngTemplate\":{\"begin\":\"\\\\G\\\\s*([`|'|\\\"])\",\"beginCaptures\":{\"1\":{\"name\":\"string\"}},\"contentName\":\"text.html.derivative.ng\",\"end\":\"\\\\1\",\"endCaptures\":{\"0\":{\"name\":\"string\"}},\"patterns\":[{\"include\":\"text.html.derivative.ng\"},{\"include\":\"template.ng\"}]},\"tsParenExpression\":{\"begin\":\"\\\\G\\\\s*(\\\\()\",\"beginCaptures\":{\"1\":{\"name\":\"meta.brace.round.ts\"}},\"end\":\"\\\\)\",\"endCaptures\":{\"0\":{\"name\":\"meta.brace.round.ts\"}},\"patterns\":[{\"include\":\"#tsParenExpression\"},{\"include\":\"#ngTemplate\"}]}},\"scopeName\":\"inline-template.ng\",\"embeddedLangs\":[\"angular-html\",\"angular-template\"]}"))
|
||||
|
||||
export default [
|
||||
...angular_html,
|
||||
...angular_template,
|
||||
lang
|
||||
]
|
3
node_modules/@shikijs/langs/dist/angular-let-declaration.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/angular-let-declaration.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
8
node_modules/@shikijs/langs/dist/angular-let-declaration.mjs
generated
vendored
Normal file
8
node_modules/@shikijs/langs/dist/angular-let-declaration.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import angular_expression from './angular-expression.mjs'
|
||||
|
||||
const lang = Object.freeze(JSON.parse("{\"injectTo\":[\"text.html.derivative\",\"text.html.derivative.ng\",\"source.ts.ng\"],\"injectionSelector\":\"L:text.html -comment -expression.ng -meta.tag -source.css -source.js\",\"name\":\"angular-let-declaration\",\"patterns\":[{\"include\":\"#letDeclaration\"}],\"repository\":{\"letDeclaration\":{\"begin\":\"(@let)\\\\s+([_$[:alpha:]][_$[:alnum:]]*)\\\\s*(=)?\",\"beginCaptures\":{\"1\":{\"name\":\"storage.type.ng\"},\"2\":{\"name\":\"meta.definition.variable.ng\"},\"3\":{\"name\":\"keyword.operator.assignment.ng\"}},\"contentName\":\"meta.definition.variable.ng\",\"end\":\"(?<=;)\",\"patterns\":[{\"include\":\"#letInitializer\"}]},\"letInitializer\":{\"begin\":\"\\\\s*\",\"beginCaptures\":{\"0\":{\"name\":\"keyword.operator.assignment.ng\"}},\"contentName\":\"meta.definition.variable.initializer.ng\",\"end\":\";\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.terminator.statement.ng\"}},\"patterns\":[{\"include\":\"expression.ng\"}]}},\"scopeName\":\"template.let.ng\",\"embeddedLangs\":[\"angular-expression\"]}"))
|
||||
|
||||
export default [
|
||||
...angular_expression,
|
||||
lang
|
||||
]
|
3
node_modules/@shikijs/langs/dist/angular-template-blocks.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/angular-template-blocks.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
10
node_modules/@shikijs/langs/dist/angular-template-blocks.mjs
generated
vendored
Normal file
10
node_modules/@shikijs/langs/dist/angular-template-blocks.mjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import angular_expression from './angular-expression.mjs'
|
||||
import angular_template from './angular-template.mjs'
|
||||
|
||||
const lang = Object.freeze(JSON.parse("{\"injectTo\":[\"text.html.derivative\",\"text.html.derivative.ng\",\"source.ts.ng\"],\"injectionSelector\":\"L:text.html -comment -expression.ng -meta.tag -source.css -source.js\",\"name\":\"angular-template-blocks\",\"patterns\":[{\"include\":\"#block\"}],\"repository\":{\"block\":{\"begin\":\"(@)(if|else if|else|defer|placeholder|loading|error|switch|case|default|for|empty)(?:\\\\s*)\",\"beginCaptures\":{\"1\":{\"patterns\":[{\"include\":\"#transition\"}]},\"2\":{\"name\":\"keyword.control.block.kind.ng\"}},\"end\":\"(?<=\\\\})\",\"name\":\"control.block.ng\",\"patterns\":[{\"include\":\"#blockExpression\"},{\"include\":\"#blockBody\"}]},\"blockBody\":{\"begin\":\"\\\\{\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.block.ts\"}},\"contentName\":\"control.block.body.ng\",\"end\":\"\\\\}\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.block.ts\"}},\"patterns\":[{\"include\":\"text.html.derivative.ng\"},{\"include\":\"template.ng\"}]},\"blockExpression\":{\"begin\":\"\\\\(\",\"beginCaptures\":{\"0\":{\"name\":\"meta.brace.round.ts\"}},\"contentName\":\"control.block.expression.ng\",\"end\":\"\\\\)\",\"endCaptures\":{\"0\":{\"name\":\"meta.brace.round.ts\"}},\"patterns\":[{\"include\":\"expression.ng\"}]},\"transition\":{\"match\":\"@\",\"name\":\"keyword.control.block.transition.ng\"}},\"scopeName\":\"template.blocks.ng\",\"embeddedLangs\":[\"angular-expression\",\"angular-template\"]}"))
|
||||
|
||||
export default [
|
||||
...angular_expression,
|
||||
...angular_template,
|
||||
lang
|
||||
]
|
3
node_modules/@shikijs/langs/dist/angular-template.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/angular-template.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
8
node_modules/@shikijs/langs/dist/angular-template.mjs
generated
vendored
Normal file
8
node_modules/@shikijs/langs/dist/angular-template.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import angular_expression from './angular-expression.mjs'
|
||||
|
||||
const lang = Object.freeze(JSON.parse("{\"injectTo\":[\"text.html.derivative\",\"text.html.derivative.ng\",\"source.ts.ng\"],\"injectionSelector\":\"L:text.html -comment\",\"name\":\"angular-template\",\"patterns\":[{\"include\":\"#interpolation\"}],\"repository\":{\"interpolation\":{\"begin\":\"{{\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.block.ts\"}},\"contentName\":\"expression.ng\",\"end\":\"}}\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.block.ts\"}},\"patterns\":[{\"include\":\"expression.ng\"}]}},\"scopeName\":\"template.ng\",\"embeddedLangs\":[\"angular-expression\"]}"))
|
||||
|
||||
export default [
|
||||
...angular_expression,
|
||||
lang
|
||||
]
|
3
node_modules/@shikijs/langs/dist/angular-ts.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/angular-ts.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
18
node_modules/@shikijs/langs/dist/angular-ts.mjs
generated
vendored
Normal file
18
node_modules/@shikijs/langs/dist/angular-ts.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/apache.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/apache.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
5
node_modules/@shikijs/langs/dist/apache.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/langs/dist/apache.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/apex.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/apex.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
5
node_modules/@shikijs/langs/dist/apex.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/langs/dist/apex.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/apl.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/apl.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
16
node_modules/@shikijs/langs/dist/apl.mjs
generated
vendored
Normal file
16
node_modules/@shikijs/langs/dist/apl.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/applescript.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/applescript.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
5
node_modules/@shikijs/langs/dist/applescript.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/langs/dist/applescript.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/ara.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/ara.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
5
node_modules/@shikijs/langs/dist/ara.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/langs/dist/ara.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/asciidoc.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/asciidoc.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
5
node_modules/@shikijs/langs/dist/asciidoc.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/langs/dist/asciidoc.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/asm.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/asm.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
5
node_modules/@shikijs/langs/dist/asm.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/langs/dist/asm.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/astro.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/astro.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
16
node_modules/@shikijs/langs/dist/astro.mjs
generated
vendored
Normal file
16
node_modules/@shikijs/langs/dist/astro.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/awk.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/awk.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
5
node_modules/@shikijs/langs/dist/awk.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/langs/dist/awk.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/ballerina.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/ballerina.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
5
node_modules/@shikijs/langs/dist/ballerina.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/langs/dist/ballerina.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/bash.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/bash.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
2
node_modules/@shikijs/langs/dist/bash.mjs
generated
vendored
Normal file
2
node_modules/@shikijs/langs/dist/bash.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/* Alias bash for shellscript */
|
||||
export { default } from './shellscript.mjs'
|
3
node_modules/@shikijs/langs/dist/bat.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/bat.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
5
node_modules/@shikijs/langs/dist/bat.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/langs/dist/bat.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@shikijs/langs/dist/batch.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/batch.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
2
node_modules/@shikijs/langs/dist/batch.mjs
generated
vendored
Normal file
2
node_modules/@shikijs/langs/dist/batch.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/* Alias batch for bat */
|
||||
export { default } from './bat.mjs'
|
3
node_modules/@shikijs/langs/dist/be.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/be.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
2
node_modules/@shikijs/langs/dist/be.mjs
generated
vendored
Normal file
2
node_modules/@shikijs/langs/dist/be.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/* Alias be for berry */
|
||||
export { default } from './berry.mjs'
|
3
node_modules/@shikijs/langs/dist/beancount.d.mts
generated
vendored
Normal file
3
node_modules/@shikijs/langs/dist/beancount.d.mts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { LanguageRegistration } from '@shikijs/types'
|
||||
const langs: LanguageRegistration []
|
||||
export default langs
|
5
node_modules/@shikijs/langs/dist/beancount.mjs
generated
vendored
Normal file
5
node_modules/@shikijs/langs/dist/beancount.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user