-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
1,375 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "@docsmill/print-core", | ||
"version": "0.0.0", | ||
"main": "dist/docsmill-print-core.cjs.js", | ||
"module": "dist/docsmill-print-core.esm.js", | ||
"license": "MIT", | ||
"private": true, | ||
"dependencies": { | ||
"@emotion/react": "11.5.0", | ||
"@docsmill/types": "^0.0.0", | ||
"emery": "^1.4.1" | ||
}, | ||
"peerDependencies": { | ||
"react": "^18.2.0" | ||
}, | ||
"repository": "https://github.com/Thinkmill/docsmill" | ||
} |
3 changes: 1 addition & 2 deletions
3
site/src/components/core/indent.tsx → packages/print-core/src/indent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export { Syntax, codeFontStyleObj, syntaxColors, codeFont } from "./syntax"; | ||
export { SimpleDeclaration } from "./simple-declaration"; | ||
export type { Components } from "./type"; | ||
export { Indent } from "./indent"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** @jsxRuntime classic */ | ||
/** @jsx jsx */ | ||
import { jsx } from "@emotion/react"; | ||
|
||
import { css } from "@emotion/react"; | ||
import { ReactNode } from "react"; | ||
|
||
function mapObj<Key extends string, Input, Output>( | ||
input: Record<Key, Input>, | ||
map: (input: Input) => Output | ||
): Record<Key, Output> { | ||
return Object.fromEntries( | ||
Object.entries(input).map(([key, value]) => [key, map(value as any)]) | ||
) as any; | ||
} | ||
|
||
export const syntaxColors = { | ||
parameter: "#111111", | ||
symbol: "#4876d6", | ||
keyword: "#994cc3", | ||
bracket: "#403f53", | ||
colon: "#0c969b", | ||
comma: "#5f7e97", | ||
string: "#c96765", | ||
intrinsic: "#2c8093", | ||
error: "red", | ||
}; | ||
|
||
export const codeFontStyleObj = { | ||
fontFamily: ` | ||
'Fira Code', | ||
'Source Code Pro', | ||
'fontFamily.mono', | ||
ui-monospace, | ||
SFMono-Regular, | ||
Menlo, | ||
Monaco, | ||
Consolas, | ||
'Liberation Mono', | ||
'Courier New', | ||
monospace | ||
`, | ||
fontVariantLigatures: "none", | ||
}; | ||
|
||
export const codeFont = css(codeFontStyleObj); | ||
|
||
export const syntaxKinds = mapObj(syntaxColors, (color) => | ||
css({ color, ...codeFontStyleObj }) | ||
); | ||
|
||
export function Syntax({ | ||
children, | ||
kind, | ||
}: { | ||
children: ReactNode; | ||
kind: keyof typeof syntaxKinds; | ||
}) { | ||
return <span css={syntaxKinds[kind]}>{children}</span>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@docsmill/types", | ||
"version": "0.0.0", | ||
"main": "dist/docsmill-types.cjs.js", | ||
"module": "dist/docsmill-types.esm.js", | ||
"license": "MIT", | ||
"private": true, | ||
"repository": "https://github.com/Thinkmill/docsmill" | ||
} |
File renamed without changes.
Oops, something went wrong.