| @@ -1,8 +1,6 @@ | ||
| 1 | -import { Lang as LangShiki, Theme } from 'shiki'; | |
| 1 | +import { Lang, Theme } from 'shiki'; | |
| 2 | 2 | |
| 3 | -export type Lang = LangShiki | 'ansi' | 'plaintext'; | |
| 4 | - | |
| 5 | 3 | export type Attributes = { |
| 6 | 4 | code: string; |
| 7 | 5 | codeHTML: string; |
| 8 | 6 | language: Lang; |
| @@ -9,51 +7,14 @@ | ||
| 9 | 7 | theme: Theme; |
| 10 | 8 | align: 'wide' | 'full'; |
| 11 | 9 | bgColor: string; |
| 12 | 10 | textColor: string; |
| 13 | - fontSize: string; | |
| 14 | - fontFamily: string; | |
| 15 | - lineHeight: string; | |
| 16 | 11 | lineNumbers: boolean; |
| 17 | - clampFonts: boolean; | |
| 18 | - editorHeight: string; | |
| 19 | - headerType: string; | |
| 20 | - headerString?: string; | |
| 21 | - footerType?: string; | |
| 22 | - footerString?: string; | |
| 23 | - footerLink?: string; | |
| 24 | - enableMaxHeight?: boolean; | |
| 25 | - seeMoreType?: string; | |
| 26 | - seeMoreString?: string; | |
| 27 | - seeMoreAfterLine?: string; | |
| 28 | - seeMoreTransition?: boolean; | |
| 29 | - seeMoreCollapse?: boolean; | |
| 30 | - seeMoreCollapseString?: string; | |
| 31 | - footerLinkTarget?: boolean; | |
| 32 | - disablePadding: boolean; | |
| 33 | - startingLineNumber: string; | |
| 34 | - // Defunct - Removing it would require n attribute migration | |
| 35 | - // so it's easier to just leave it unused for new blocks. | |
| 36 | - lineNumbersWidth: number; | |
| 37 | - highestLineNumber: number; | |
| 38 | - enableHighlighting: boolean; | |
| 39 | - highlightingHover: boolean; | |
| 40 | - lineHighlights: string; | |
| 41 | - lineHighlightColor: string; | |
| 42 | - enableBlurring: boolean; | |
| 43 | - lineBlurs: string; | |
| 44 | - removeBlurOnHover: boolean; | |
| 12 | + startingLineNumber: number; | |
| 45 | 13 | frame: boolean; |
| 46 | 14 | renderType: string; |
| 47 | 15 | label: string; |
| 48 | 16 | copyButton: boolean; |
| 49 | - copyButtonType: string; | |
| 50 | - copyButtonString: string; | |
| 51 | - copyButtonStringCopied: string; | |
| 52 | - useDecodeURI: boolean; | |
| 53 | - useEscapeShortCodes: boolean; | |
| 54 | - tabSize: number; | |
| 55 | - useTabs: boolean; | |
| 56 | 17 | }; |
| 57 | 18 | export interface AttributesPropsAndSetter { |
| 58 | 19 | attributes: Attributes; |
| 59 | 20 | setAttributes: (attrs: Partial<Attributes>) => void; |
| @@ -65,35 +26,4 @@ | ||
| 65 | 26 | pluginUrl: string; |
| 66 | 27 | }; |
| 67 | 28 | } |
| 68 | 29 | } |
| 69 | - | |
| 70 | -export type CustomStyles = { | |
| 71 | - 'color-text'?: string; // --shiki-color-text | |
| 72 | - 'color-background'?: string; // --shiki-color-background | |
| 73 | - 'token-constant'?: string; // --shiki-token-constant | |
| 74 | - 'token-string'?: string; // --shiki-token-string | |
| 75 | - 'token-comment'?: string; // --shiki-token-comment | |
| 76 | - 'token-keyword'?: string; // --shiki-token-keyword | |
| 77 | - 'token-parameter'?: string; // --shiki-token-parameter | |
| 78 | - 'token-function'?: string; // --shiki-token-function | |
| 79 | - 'token-string-expression'?: string; // --shiki-token-string-expression | |
| 80 | - 'token-punctuation'?: string; // --shiki-token-punctuation | |
| 81 | - 'token-link'?: string; // --shiki-token-link | |
| 82 | - 'line-background'?: string; // custom for this app | |
| 83 | - 'line-number-color'?: string; // custom for this app | |
| 84 | -}; | |
| 85 | -export type HelpUrl = { | |
| 86 | - text: string; | |
| 87 | - url: string; | |
| 88 | -}; | |
| 89 | - | |
| 90 | -export type ThemeOption = Record< | |
| 91 | - string, | |
| 92 | - { | |
| 93 | - name: string; | |
| 94 | - priority?: boolean; | |
| 95 | - custom?: boolean; | |
| 96 | - styles?: CustomStyles; | |
| 97 | - helpUrl?: HelpUrl; | |
| 98 | - } | |
| 99 | ->; | |