themed-markdown 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +65 -35
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7078 -20738
- package/dist/index.mjs +29671 -0
- package/dist/industryMarkdown/components/DocumentView.d.ts +23 -0
- package/dist/industryMarkdown/components/DocumentView.d.ts.map +1 -0
- package/dist/industryMarkdown/components/IndustryBashCommandDropdown.d.ts +14 -0
- package/dist/industryMarkdown/components/IndustryBashCommandDropdown.d.ts.map +1 -0
- package/dist/industryMarkdown/components/IndustryEditableMarkdownSlide.d.ts +13 -0
- package/dist/industryMarkdown/components/IndustryEditableMarkdownSlide.d.ts.map +1 -0
- package/dist/industryMarkdown/components/IndustryHtmlModal.d.ts +16 -0
- package/dist/industryMarkdown/components/IndustryHtmlModal.d.ts.map +1 -0
- package/dist/industryMarkdown/components/IndustryLazyMermaidDiagram.d.ts +14 -0
- package/dist/industryMarkdown/components/IndustryLazyMermaidDiagram.d.ts.map +1 -0
- package/dist/industryMarkdown/components/IndustryMarkdownComponents.d.ts +44 -0
- package/dist/industryMarkdown/components/IndustryMarkdownComponents.d.ts.map +1 -0
- package/dist/industryMarkdown/components/IndustryMarkdownSlide.d.ts +102 -0
- package/dist/industryMarkdown/components/IndustryMarkdownSlide.d.ts.map +1 -0
- package/dist/industryMarkdown/components/IndustryMarkdownSlide.stories.d.ts +16 -0
- package/dist/industryMarkdown/components/IndustryMarkdownSlide.stories.d.ts.map +1 -0
- package/dist/industryMarkdown/components/IndustryMermaidDiagram.d.ts +22 -0
- package/dist/industryMarkdown/components/IndustryMermaidDiagram.d.ts.map +1 -0
- package/dist/industryMarkdown/components/IndustryMermaidModal.d.ts +11 -0
- package/dist/industryMarkdown/components/IndustryMermaidModal.d.ts.map +1 -0
- package/dist/industryMarkdown/components/IndustryPlaceholderModal.d.ts +12 -0
- package/dist/industryMarkdown/components/IndustryPlaceholderModal.d.ts.map +1 -0
- package/dist/industryMarkdown/components/IndustryZoomableMermaidDiagram.d.ts +12 -0
- package/dist/industryMarkdown/components/IndustryZoomableMermaidDiagram.d.ts.map +1 -0
- package/dist/industryMarkdown/components/SlidePresentation.d.ts +22 -0
- package/dist/industryMarkdown/components/SlidePresentation.d.ts.map +1 -0
- package/dist/industryMarkdown/index.d.ts +19 -0
- package/dist/industryMarkdown/index.d.ts.map +1 -0
- package/dist/industryMarkdown/types/customMarkdownChunks.d.ts +24 -0
- package/dist/industryMarkdown/types/customMarkdownChunks.d.ts.map +1 -0
- package/dist/industryMarkdown/types/keyboard.d.ts +18 -0
- package/dist/industryMarkdown/types/keyboard.d.ts.map +1 -0
- package/dist/industryMarkdown/types/markdownComponents.d.ts +48 -0
- package/dist/industryMarkdown/types/markdownComponents.d.ts.map +1 -0
- package/dist/industryMarkdown/types/presentation.d.ts +66 -0
- package/dist/industryMarkdown/types/presentation.d.ts.map +1 -0
- package/dist/industryMarkdown/utils/bashCommandParser.d.ts +14 -0
- package/dist/industryMarkdown/utils/bashCommandParser.d.ts.map +1 -0
- package/dist/industryMarkdown/utils/componentUtils.d.ts +15 -0
- package/dist/industryMarkdown/utils/componentUtils.d.ts.map +1 -0
- package/dist/industryMarkdown/utils/imageUrlUtils.d.ts +15 -0
- package/dist/industryMarkdown/utils/imageUrlUtils.d.ts.map +1 -0
- package/dist/industryMarkdown/utils/markdownUtils.d.ts +6 -0
- package/dist/industryMarkdown/utils/markdownUtils.d.ts.map +1 -0
- package/dist/industryMarkdown/utils/presentationUtils.d.ts +52 -0
- package/dist/industryMarkdown/utils/presentationUtils.d.ts.map +1 -0
- package/dist/industryTheme/ThemeProvider.d.ts +24 -0
- package/dist/industryTheme/ThemeProvider.d.ts.map +1 -0
- package/dist/industryTheme/index.d.ts +146 -0
- package/dist/industryTheme/index.d.ts.map +1 -0
- package/dist/industryTheme/utils.d.ts +32 -0
- package/dist/industryTheme/utils.d.ts.map +1 -0
- package/dist/tests/markdown-slide-tests/presentationUtils.test.d.ts +2 -0
- package/dist/tests/markdown-slide-tests/presentationUtils.test.d.ts.map +1 -0
- package/package.json +10 -4
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Extract text content from React children
|
|
4
|
+
*/
|
|
5
|
+
export declare const extractTextFromChildren: (children: React.ReactNode) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Simple link component with loading indicator support
|
|
8
|
+
*/
|
|
9
|
+
export declare const LinkWithLoadingIndicator: React.FC<{
|
|
10
|
+
href: string;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
onClick?: (href: string, event?: React.MouseEvent) => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=componentUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentUtils.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/utils/componentUtils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,UAAU,KAAK,CAAC,SAAS,KAAG,MAiBnE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAmBA,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RepositoryInfo } from '../types/presentation';
|
|
2
|
+
/**
|
|
3
|
+
* Determines if a URL is relative (not absolute)
|
|
4
|
+
*/
|
|
5
|
+
export declare function isRelativeUrl(url: string): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Transforms a relative image URL to a GitHub raw URL
|
|
8
|
+
*/
|
|
9
|
+
export declare function transformImageUrl(src: string, repositoryInfo?: RepositoryInfo): string;
|
|
10
|
+
/**
|
|
11
|
+
* Transforms image URLs in markdown content
|
|
12
|
+
* This can be used to preprocess markdown content before rendering
|
|
13
|
+
*/
|
|
14
|
+
export declare function transformMarkdownImageUrls(markdownContent: string, repositoryInfo?: RepositoryInfo): string;
|
|
15
|
+
//# sourceMappingURL=imageUrlUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageUrlUtils.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/utils/imageUrlUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAuBlD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CA8CtF;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,MAAM,EACvB,cAAc,CAAC,EAAE,cAAc,GAC9B,MAAM,CAeR"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ContentChunk } from '../types/customMarkdownChunks';
|
|
2
|
+
/**
|
|
3
|
+
* Parses markdown content within a slide into chunks (markdown and mermaid)
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseMarkdownChunks(markdownContent: string, idPrefix: string): ContentChunk[];
|
|
6
|
+
//# sourceMappingURL=markdownUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdownUtils.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/utils/markdownUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAa7D;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,YAAY,EAAE,CAuE7F"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { MarkdownPresentation, MarkdownSlide, MarkdownSource, RepositoryInfo } from '../types/presentation';
|
|
2
|
+
/**
|
|
3
|
+
* Extract the title from slide content (first heading or first line)
|
|
4
|
+
*/
|
|
5
|
+
export declare function extractSlideTitle(content: string): string;
|
|
6
|
+
export declare function parseMarkdownIntoPresentationFromSource(source: MarkdownSource): MarkdownPresentation;
|
|
7
|
+
export declare function createGithubFileSource(content: string, repositoryInfo: RepositoryInfo): MarkdownSource;
|
|
8
|
+
/**
|
|
9
|
+
* Enhanced version of markdown slide parsing that preserves location information
|
|
10
|
+
* and returns a structured Presentation object
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseMarkdownIntoPresentation(markdownContent: string): MarkdownPresentation;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param errorMessage Depricated
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare function createPresentationWithErrorMessage(errorMessage: string): MarkdownPresentation;
|
|
19
|
+
/**
|
|
20
|
+
* Helper function to reconstruct the original markdown content from a Presentation object
|
|
21
|
+
*/
|
|
22
|
+
export declare function reconstructMarkdownContent(presentation: MarkdownPresentation): string;
|
|
23
|
+
/**
|
|
24
|
+
* Get all slide titles from a presentation
|
|
25
|
+
*/
|
|
26
|
+
export declare function getAllSlideTitles(presentation: MarkdownPresentation): string[];
|
|
27
|
+
/**
|
|
28
|
+
* Find a slide by title (returns first match)
|
|
29
|
+
*/
|
|
30
|
+
export declare function findSlideByTitle(presentation: MarkdownPresentation, title: string): MarkdownSlide | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Find slide index by title (returns first match)
|
|
33
|
+
*/
|
|
34
|
+
export declare function findSlideIndexByTitle(presentation: MarkdownPresentation, title: string): number;
|
|
35
|
+
/**
|
|
36
|
+
* Update a slide's title (creates a new slide object)
|
|
37
|
+
*/
|
|
38
|
+
export declare function updateSlideTitle(slide: MarkdownSlide, newTitle: string): MarkdownSlide;
|
|
39
|
+
/**
|
|
40
|
+
* Serialize a MarkdownPresentation back to markdown string
|
|
41
|
+
* This is an alias for reconstructMarkdownContent for clearer API
|
|
42
|
+
*/
|
|
43
|
+
export declare function serializePresentationToMarkdown(presentation: MarkdownPresentation): string;
|
|
44
|
+
/**
|
|
45
|
+
* Update a slide's content and regenerate its metadata
|
|
46
|
+
*/
|
|
47
|
+
export declare function updateSlideContent(slide: MarkdownSlide, newContent: string): MarkdownSlide;
|
|
48
|
+
/**
|
|
49
|
+
* Create a new presentation with updated slide at the specified index
|
|
50
|
+
*/
|
|
51
|
+
export declare function updatePresentationSlide(presentation: MarkdownPresentation, index: number, newContent: string): MarkdownPresentation;
|
|
52
|
+
//# sourceMappingURL=presentationUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentationUtils.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/utils/presentationUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,aAAa,EAEb,cAAc,EAEd,cAAc,EACf,MAAM,uBAAuB,CAAC;AAe/B;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAkBzD;AAED,wBAAgB,uCAAuC,CACrD,MAAM,EAAE,cAAc,GACrB,oBAAoB,CAetB;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,cAAc,GAC7B,cAAc,CAQhB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,MAAM,GAAG,oBAAoB,CAwH3F;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAAC,YAAY,EAAE,MAAM,GAAG,oBAAoB,CAmB7F;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,oBAAoB,GAAG,MAAM,CAwBrF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAE9E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,oBAAoB,EAClC,KAAK,EAAE,MAAM,GACZ,aAAa,GAAG,SAAS,CAE3B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/F;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,CAKtF;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,oBAAoB,GAAG,MAAM,CAE1F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,aAAa,CAU1F;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,oBAAoB,EAClC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,oBAAoB,CActB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Theme } from './index';
|
|
3
|
+
interface ThemeContextValue {
|
|
4
|
+
theme: Theme;
|
|
5
|
+
colorMode: 'light' | 'dark';
|
|
6
|
+
setColorMode: (mode: 'light' | 'dark') => void;
|
|
7
|
+
toggleColorMode: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const useTheme: (options?: {
|
|
10
|
+
allowFallback?: boolean;
|
|
11
|
+
}) => ThemeContextValue;
|
|
12
|
+
export declare const useThemeSafe: () => ThemeContextValue;
|
|
13
|
+
export declare const getThemeWithMode: (baseTheme: Theme, colorMode: "light" | "dark") => Theme;
|
|
14
|
+
interface ThemeProviderProps {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
theme?: Theme;
|
|
17
|
+
initialColorMode?: 'light' | 'dark';
|
|
18
|
+
}
|
|
19
|
+
export declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
20
|
+
export declare const withTheme: <P extends object>(Component: React.ComponentType<P & {
|
|
21
|
+
theme: Theme;
|
|
22
|
+
}>) => (props: P) => React.JSX.Element;
|
|
23
|
+
export default ThemeProvider;
|
|
24
|
+
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../industryTheme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAkD,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzF,OAAO,EAAE,KAAK,EAAyB,MAAM,SAAS,CAAC;AAGvD,UAAU,iBAAiB;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAC/C,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AA+BD,eAAO,MAAM,QAAQ,GAAI,UAAU;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,KAAG,iBAiBhE,CAAC;AAGF,eAAO,MAAM,YAAY,yBAA0C,CAAC;AAGpE,eAAO,MAAM,gBAAgB,GAAI,WAAW,KAAK,EAAE,WAAW,OAAO,GAAG,MAAM,KAAG,KAchF,CAAC;AAGF,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACrC;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuCtD,CAAC;AAGF,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,MAAM,EACxC,WAAW,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC,MAE5C,OAAO,CAAC,sBAIjB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme UI spec-compliant theme system for PrincipleMD
|
|
3
|
+
* Based on https://theme-ui.com/theme-spec
|
|
4
|
+
*/
|
|
5
|
+
type ButtonVariant = {
|
|
6
|
+
color?: string;
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
bg?: string;
|
|
9
|
+
borderColor?: string;
|
|
10
|
+
borderWidth?: number;
|
|
11
|
+
borderStyle?: string;
|
|
12
|
+
padding?: string | number;
|
|
13
|
+
fontSize?: number | string;
|
|
14
|
+
fontWeight?: number;
|
|
15
|
+
cursor?: string;
|
|
16
|
+
'&:hover'?: Partial<ButtonVariant>;
|
|
17
|
+
'&:active'?: Partial<ButtonVariant>;
|
|
18
|
+
'&:disabled'?: Partial<ButtonVariant>;
|
|
19
|
+
};
|
|
20
|
+
type TextVariant = {
|
|
21
|
+
fontSize?: number | string;
|
|
22
|
+
fontWeight?: number | string;
|
|
23
|
+
lineHeight?: number | string;
|
|
24
|
+
color?: string;
|
|
25
|
+
fontFamily?: string;
|
|
26
|
+
};
|
|
27
|
+
type CardVariant = {
|
|
28
|
+
padding?: string | number;
|
|
29
|
+
backgroundColor?: string;
|
|
30
|
+
bg?: string;
|
|
31
|
+
borderRadius?: number;
|
|
32
|
+
boxShadow?: string;
|
|
33
|
+
border?: string;
|
|
34
|
+
borderColor?: string;
|
|
35
|
+
};
|
|
36
|
+
export interface Theme {
|
|
37
|
+
space: number[];
|
|
38
|
+
fonts: {
|
|
39
|
+
body: string;
|
|
40
|
+
heading: string;
|
|
41
|
+
monospace: string;
|
|
42
|
+
};
|
|
43
|
+
fontSizes: number[];
|
|
44
|
+
fontScale?: number;
|
|
45
|
+
fontWeights: {
|
|
46
|
+
body: number;
|
|
47
|
+
heading: number;
|
|
48
|
+
bold: number;
|
|
49
|
+
light: number;
|
|
50
|
+
medium: number;
|
|
51
|
+
semibold: number;
|
|
52
|
+
};
|
|
53
|
+
lineHeights: {
|
|
54
|
+
body: number;
|
|
55
|
+
heading: number;
|
|
56
|
+
tight: number;
|
|
57
|
+
relaxed: number;
|
|
58
|
+
};
|
|
59
|
+
breakpoints: string[];
|
|
60
|
+
sizes: number[];
|
|
61
|
+
radii: number[];
|
|
62
|
+
shadows: string[];
|
|
63
|
+
zIndices: number[];
|
|
64
|
+
colors: {
|
|
65
|
+
text: string;
|
|
66
|
+
background: string;
|
|
67
|
+
primary: string;
|
|
68
|
+
secondary: string;
|
|
69
|
+
accent: string;
|
|
70
|
+
highlight: string;
|
|
71
|
+
muted: string;
|
|
72
|
+
success: string;
|
|
73
|
+
warning: string;
|
|
74
|
+
error: string;
|
|
75
|
+
info: string;
|
|
76
|
+
border: string;
|
|
77
|
+
backgroundSecondary: string;
|
|
78
|
+
backgroundTertiary: string;
|
|
79
|
+
backgroundLight: string;
|
|
80
|
+
backgroundHover: string;
|
|
81
|
+
surface: string;
|
|
82
|
+
textSecondary: string;
|
|
83
|
+
textTertiary: string;
|
|
84
|
+
textMuted: string;
|
|
85
|
+
modes: {
|
|
86
|
+
dark: Partial<Colors>;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
buttons: {
|
|
90
|
+
primary: ButtonVariant;
|
|
91
|
+
secondary: ButtonVariant;
|
|
92
|
+
ghost: ButtonVariant;
|
|
93
|
+
};
|
|
94
|
+
text: {
|
|
95
|
+
heading: TextVariant;
|
|
96
|
+
body: TextVariant;
|
|
97
|
+
caption: TextVariant;
|
|
98
|
+
};
|
|
99
|
+
cards: {
|
|
100
|
+
primary: CardVariant;
|
|
101
|
+
secondary: CardVariant;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
interface Colors {
|
|
105
|
+
text: string;
|
|
106
|
+
background: string;
|
|
107
|
+
primary: string;
|
|
108
|
+
secondary: string;
|
|
109
|
+
accent: string;
|
|
110
|
+
highlight: string;
|
|
111
|
+
muted: string;
|
|
112
|
+
success: string;
|
|
113
|
+
warning: string;
|
|
114
|
+
error: string;
|
|
115
|
+
info: string;
|
|
116
|
+
border: string;
|
|
117
|
+
backgroundSecondary: string;
|
|
118
|
+
backgroundTertiary: string;
|
|
119
|
+
backgroundLight: string;
|
|
120
|
+
backgroundHover: string;
|
|
121
|
+
surface: string;
|
|
122
|
+
textSecondary: string;
|
|
123
|
+
textTertiary: string;
|
|
124
|
+
textMuted: string;
|
|
125
|
+
}
|
|
126
|
+
export declare const theme: Theme;
|
|
127
|
+
/**
|
|
128
|
+
* Scale font sizes in a theme by a given factor
|
|
129
|
+
*/
|
|
130
|
+
export declare function scaleThemeFonts(theme: Theme, scale: number): Theme;
|
|
131
|
+
/**
|
|
132
|
+
* Increase font scale by 10%
|
|
133
|
+
*/
|
|
134
|
+
export declare function increaseFontScale(theme: Theme): Theme;
|
|
135
|
+
/**
|
|
136
|
+
* Decrease font scale by 10%
|
|
137
|
+
*/
|
|
138
|
+
export declare function decreaseFontScale(theme: Theme): Theme;
|
|
139
|
+
/**
|
|
140
|
+
* Reset font scale to 100%
|
|
141
|
+
*/
|
|
142
|
+
export declare function resetFontScale(theme: Theme): Theme;
|
|
143
|
+
export { ThemeProvider, useTheme, useThemeSafe, withTheme, getThemeWithMode, } from './ThemeProvider';
|
|
144
|
+
export { getColor, getSpace, getFontSize, getRadius, getShadow, getZIndex, responsive, sx, createStyle, mergeThemes, } from './utils';
|
|
145
|
+
export default theme;
|
|
146
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../industryTheme/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,KAAK,aAAa,GAAG;IACnB,KAAK,CAAC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AK,CAWlE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAIrD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAIrD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAElD;AAGD,OAAO,EACL,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,EAAE,EACF,WAAW,EACX,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Theme } from './index';
|
|
2
|
+
type StyleValue = string | number | StyleValue[] | {
|
|
3
|
+
[key: string]: StyleValue;
|
|
4
|
+
};
|
|
5
|
+
type StyleObject = Record<string, StyleValue>;
|
|
6
|
+
/**
|
|
7
|
+
* Utility functions for working with the Theme UI spec-compliant theme
|
|
8
|
+
*/
|
|
9
|
+
export declare const getColor: (theme: Theme, colorKey: string) => string;
|
|
10
|
+
export declare const getSpace: (theme: Theme, index: number) => number;
|
|
11
|
+
export declare const getFontSize: (theme: Theme, index: number) => number;
|
|
12
|
+
export declare const getRadius: (theme: Theme, index: number) => number;
|
|
13
|
+
export declare const getShadow: (theme: Theme, index: number) => string;
|
|
14
|
+
export declare const getZIndex: (theme: Theme, index: number) => number;
|
|
15
|
+
export declare const responsive: (values: (string | number)[]) => object;
|
|
16
|
+
export declare const sx: (styles: StyleObject) => StyleObject;
|
|
17
|
+
export declare const createStyle: (theme: Theme, styleObj: StyleObject) => StyleObject;
|
|
18
|
+
export declare const mergeThemes: (baseTheme: Theme, ...overrides: Partial<Theme>[]) => Theme;
|
|
19
|
+
declare const _default: {
|
|
20
|
+
getColor: (theme: Theme, colorKey: string) => string;
|
|
21
|
+
getSpace: (theme: Theme, index: number) => number;
|
|
22
|
+
getFontSize: (theme: Theme, index: number) => number;
|
|
23
|
+
getRadius: (theme: Theme, index: number) => number;
|
|
24
|
+
getShadow: (theme: Theme, index: number) => string;
|
|
25
|
+
getZIndex: (theme: Theme, index: number) => number;
|
|
26
|
+
responsive: (values: (string | number)[]) => object;
|
|
27
|
+
sx: (styles: StyleObject) => StyleObject;
|
|
28
|
+
createStyle: (theme: Theme, styleObj: StyleObject) => StyleObject;
|
|
29
|
+
mergeThemes: (baseTheme: Theme, ...overrides: Partial<Theme>[]) => Theme;
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|
|
32
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../industryTheme/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CAAC;AACjF,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAE9C;;GAEG;AAGH,eAAO,MAAM,QAAQ,GAAI,OAAO,KAAK,EAAE,UAAU,MAAM,KAAG,MAKzD,CAAC;AAGF,eAAO,MAAM,QAAQ,GAAI,OAAO,KAAK,EAAE,OAAO,MAAM,KAAG,MAEtD,CAAC;AAGF,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,EAAE,OAAO,MAAM,KAAG,MAEzD,CAAC;AAGF,eAAO,MAAM,SAAS,GAAI,OAAO,KAAK,EAAE,OAAO,MAAM,KAAG,MAEvD,CAAC;AAGF,eAAO,MAAM,SAAS,GAAI,OAAO,KAAK,EAAE,OAAO,MAAM,KAAG,MAEvD,CAAC;AAGF,eAAO,MAAM,SAAS,GAAI,OAAO,KAAK,EAAE,OAAO,MAAM,KAAG,MAEvD,CAAC;AAGF,eAAO,MAAM,UAAU,GAAI,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAG,MAUxD,CAAC;AAGF,eAAO,MAAM,EAAE,GAAI,QAAQ,WAAW,gBAAW,CAAC;AAGlD,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,EAAE,UAAU,WAAW,KAAG,WAmCjE,CAAC;AAGF,eAAO,MAAM,WAAW,GAAI,WAAW,KAAK,EAAE,GAAG,WAAW,OAAO,CAAC,KAAK,CAAC,EAAE,KAAG,KA2B9E,CAAC;;sBAlH8B,KAAK,YAAY,MAAM,KAAG,MAAM;sBAQhC,KAAK,SAAS,MAAM,KAAG,MAAM;yBAK1B,KAAK,SAAS,MAAM,KAAG,MAAM;uBAK/B,KAAK,SAAS,MAAM,KAAG,MAAM;uBAK7B,KAAK,SAAS,MAAM,KAAG,MAAM;uBAK7B,KAAK,SAAS,MAAM,KAAG,MAAM;yBAK3B,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAG,MAAM;iBAapC,WAAW;yBAGH,KAAK,YAAY,WAAW,KAAG,WAAW;6BAsCtC,KAAK,gBAAgB,OAAO,CAAC,KAAK,CAAC,EAAE,KAAG,KAAK;;AA6BpF,wBAWE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentationUtils.test.d.ts","sourceRoot":"","sources":["../../../tests/markdown-slide-tests/presentationUtils.test.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "themed-markdown",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Industry-themed markdown renderer with presentation capabilities",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -14,8 +14,12 @@
|
|
|
14
14
|
"./industryTheme": "./dist/industryTheme/index.js"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "bun run clean && bun run build:
|
|
18
|
-
"build:
|
|
17
|
+
"build": "bun run clean && bun run build:esm && bun run build:cjs && bun run build:types && bun run copy:css && bun run copy:types",
|
|
18
|
+
"build:esm": "bun build ./industryMarkdown/index.ts --outfile ./dist/index.mjs --format esm --target browser --external highlight.js",
|
|
19
|
+
"build:cjs": "bun build ./industryMarkdown/index.ts --outfile ./dist/index.js --format cjs --target browser --external highlight.js",
|
|
20
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationMap",
|
|
21
|
+
"copy:css": "cp node_modules/highlight.js/styles/atom-one-dark.css ./dist/index.css",
|
|
22
|
+
"copy:types": "cp dist/industryMarkdown/index.d.ts dist/index.d.ts && cp dist/industryMarkdown/index.d.ts.map dist/index.d.ts.map",
|
|
19
23
|
"dev": "bun run build --watch",
|
|
20
24
|
"test": "bun test",
|
|
21
25
|
"test:watch": "bun test --watch",
|
|
@@ -24,7 +28,9 @@
|
|
|
24
28
|
"lint:fix": "eslint . --ext .ts,.tsx --fix",
|
|
25
29
|
"format": "prettier --write .",
|
|
26
30
|
"format:check": "prettier --check .",
|
|
27
|
-
"clean": "rm -rf dist coverage"
|
|
31
|
+
"clean": "rm -rf dist coverage",
|
|
32
|
+
"storybook": "storybook dev -p 6006",
|
|
33
|
+
"build-storybook": "storybook build"
|
|
28
34
|
},
|
|
29
35
|
"keywords": [
|
|
30
36
|
"markdown",
|