├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .prettierrc ├── .vscode └── launch.json ├── LICENSE ├── README.md ├── monaco ├── .gitignore ├── README.md ├── package.json ├── webpack.config.js └── yarn.lock ├── package.json ├── public ├── LICENSE.txt ├── README.txt ├── favicon.ico ├── ic-code-tags-16.png ├── ic-code-tags-192.png ├── ic-code-tags-32.png ├── ic-code-tags-48.png ├── ic-code-tags-512.png ├── ic-code-tags-64.png ├── ic-code-tags.svg ├── index.html ├── katex │ └── v0.12.0 │ │ ├── README.md │ │ ├── contrib │ │ ├── auto-render.js │ │ ├── auto-render.min.js │ │ ├── auto-render.mjs │ │ ├── copy-tex.css │ │ ├── copy-tex.js │ │ ├── copy-tex.min.css │ │ ├── copy-tex.min.js │ │ ├── copy-tex.mjs │ │ ├── mathtex-script-type.js │ │ ├── mathtex-script-type.min.js │ │ ├── mathtex-script-type.mjs │ │ ├── mhchem.js │ │ ├── mhchem.min.js │ │ ├── mhchem.mjs │ │ ├── render-a11y-string.js │ │ ├── render-a11y-string.min.js │ │ └── render-a11y-string.mjs │ │ ├── fonts │ │ ├── KaTeX_AMS-Regular.ttf │ │ ├── KaTeX_AMS-Regular.woff │ │ ├── KaTeX_AMS-Regular.woff2 │ │ ├── KaTeX_Caligraphic-Bold.ttf │ │ ├── KaTeX_Caligraphic-Bold.woff │ │ ├── KaTeX_Caligraphic-Bold.woff2 │ │ ├── KaTeX_Caligraphic-Regular.ttf │ │ ├── KaTeX_Caligraphic-Regular.woff │ │ ├── KaTeX_Caligraphic-Regular.woff2 │ │ ├── KaTeX_Fraktur-Bold.ttf │ │ ├── KaTeX_Fraktur-Bold.woff │ │ ├── KaTeX_Fraktur-Bold.woff2 │ │ ├── KaTeX_Fraktur-Regular.ttf │ │ ├── KaTeX_Fraktur-Regular.woff │ │ ├── KaTeX_Fraktur-Regular.woff2 │ │ ├── KaTeX_Main-Bold.ttf │ │ ├── KaTeX_Main-Bold.woff │ │ ├── KaTeX_Main-Bold.woff2 │ │ ├── KaTeX_Main-BoldItalic.ttf │ │ ├── KaTeX_Main-BoldItalic.woff │ │ ├── KaTeX_Main-BoldItalic.woff2 │ │ ├── KaTeX_Main-Italic.ttf │ │ ├── KaTeX_Main-Italic.woff │ │ ├── KaTeX_Main-Italic.woff2 │ │ ├── KaTeX_Main-Regular.ttf │ │ ├── KaTeX_Main-Regular.woff │ │ ├── KaTeX_Main-Regular.woff2 │ │ ├── KaTeX_Math-BoldItalic.ttf │ │ ├── KaTeX_Math-BoldItalic.woff │ │ ├── KaTeX_Math-BoldItalic.woff2 │ │ ├── KaTeX_Math-Italic.ttf │ │ ├── KaTeX_Math-Italic.woff │ │ ├── KaTeX_Math-Italic.woff2 │ │ ├── KaTeX_SansSerif-Bold.ttf │ │ ├── KaTeX_SansSerif-Bold.woff │ │ ├── KaTeX_SansSerif-Bold.woff2 │ │ ├── KaTeX_SansSerif-Italic.ttf │ │ ├── KaTeX_SansSerif-Italic.woff │ │ ├── KaTeX_SansSerif-Italic.woff2 │ │ ├── KaTeX_SansSerif-Regular.ttf │ │ ├── KaTeX_SansSerif-Regular.woff │ │ ├── KaTeX_SansSerif-Regular.woff2 │ │ ├── KaTeX_Script-Regular.ttf │ │ ├── KaTeX_Script-Regular.woff │ │ ├── KaTeX_Script-Regular.woff2 │ │ ├── KaTeX_Size1-Regular.ttf │ │ ├── KaTeX_Size1-Regular.woff │ │ ├── KaTeX_Size1-Regular.woff2 │ │ ├── KaTeX_Size2-Regular.ttf │ │ ├── KaTeX_Size2-Regular.woff │ │ ├── KaTeX_Size2-Regular.woff2 │ │ ├── KaTeX_Size3-Regular.ttf │ │ ├── KaTeX_Size3-Regular.woff │ │ ├── KaTeX_Size3-Regular.woff2 │ │ ├── KaTeX_Size4-Regular.ttf │ │ ├── KaTeX_Size4-Regular.woff │ │ ├── KaTeX_Size4-Regular.woff2 │ │ ├── KaTeX_Typewriter-Regular.ttf │ │ ├── KaTeX_Typewriter-Regular.woff │ │ └── KaTeX_Typewriter-Regular.woff2 │ │ ├── katex.css │ │ ├── katex.js │ │ ├── katex.min.css │ │ ├── katex.min.js │ │ └── katex.mjs ├── manifest.json ├── monaco │ ├── css.worker.bundle.js │ ├── editor.worker.bundle.js │ ├── html.worker.bundle.js │ ├── json.worker.bundle.js │ ├── ts.worker.bundle.js │ └── ts.worker.bundle.js.LICENSE.txt ├── package.json ├── robots.txt └── sample.ext.json ├── src ├── Editor.test.tsx ├── components │ ├── Editor.tsx │ ├── ErrorBoundary.tsx │ ├── Icons.tsx │ ├── PrintDialog.tsx │ └── Settings.tsx ├── index.scss ├── index.tsx ├── lib │ ├── makePrettier.ts │ └── renderMarkdown.ts ├── logo.svg ├── react-app-env.d.ts ├── reportWebVitals.ts ├── setupTests.ts └── stylesheets │ ├── dark.scss │ ├── main.scss │ └── print.scss ├── tsconfig.json ├── types └── sn-editor-kit │ └── index.d.ts └── yarn.lock /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [standardnotes] 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug, needs triage 6 | assignees: TheodoreChu 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | 106 | #### Copied from Create React App #### 107 | 108 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 109 | 110 | # dependencies 111 | /node_modules 112 | /.pnp 113 | .pnp.js 114 | 115 | # testing 116 | /coverage 117 | 118 | # production 119 | /build 120 | 121 | # misc 122 | .DS_Store 123 | .env.local 124 | .env.development.local 125 | .env.test.local 126 | .env.production.local 127 | 128 | npm-debug.log* 129 | yarn-debug.log* 130 | yarn-error.log* -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Chrome", 6 | "type": "chrome", 7 | "request": "launch", 8 | "url": "http://localhost:3001", 9 | "webRoot": "${workspaceFolder}/src", 10 | "sourceMapPathOverrides": { 11 | "webpack:///src/*": "${webRoot}/*" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Code Pro for Standard Notes 2 | 3 | Code Pro is a [derived editor](https://standardnotes.org/help/77/what-are-editors) for [Standard Notes](https://standardnotes.org), a free, [open-source](https://standardnotes.org/knowledge/5/what-is-free-and-open-source-software), and [end-to-end encrypted](https://standardnotes.org/knowledge/2/what-is-end-to-end-encryption) notes app. 4 | 5 | Code Pro is a code editor powered by the [Monaco Editor](https://microsoft.github.io/monaco-editor/) (Visual Studio Code). It is meant for writing Markdown and 60 other programming languages. 6 | 7 | Code Pro is not meant to be used on mobile devices. 8 | 9 | ## Features 10 | 11 | - Syntax highlighting for Markdown and more than 60 other programming languages 12 | - Languages supported: abap, aes, apex, azcli, bat, c, cameligo, clojure, coffeescript, cpp, csharp, csp, css, dart, dockerfile, fsharp, go, graphql, handlebars, hcl, html, ini, java, javascript, json, julia, kotlin, less, lexon, lua, markdown, mips, msdax, mysql, objective-c, pascal, pascaligo, perl, pgsql, php, plaintext, postiats, powerquery, powershell, pug, python, r, razor, redis, redshift, restructuredtext, ruby, rust, sb, scala, scheme, scss, shell, sol, sql, st, swift, systemverilog, tcl, twig, typescript, vb, verilog, xml, yaml 13 | - Autocompletion 14 | - Intelligent autocompletion for CSS, JavaScript, JSON, Less, Handlebars, HTML, Razor, SCSS, and TypeScript 15 | - Sophisticated search and replace 16 | - Prettier formatting for CSS, GraphQL, Markdown, HTML, JavaScript, Less, TypeScript, Sass, and Yaml. Built-in formatting for JSON. 17 | - Settings: language, font size, tab size (`2` or `4`), theme (light, dark, high contrast, or SN themed), and word wrap (`on`, `off`, and `bounded`) 18 | - Per-note settings 19 | - Buttons to save and load default settings 20 | 21 | ## Keyboard Shortcuts 22 | 23 | Perform these shortcuts with the editor 24 | 25 | | Action | Shortcut | 26 | | :-------------------------------------------------------------- | :----------------------------------------------- | 27 | | Toggle word wrap between `on` and `off` (bounded is unaffected) | Alt + Z | 28 | | Format code with Prettier^ | Shift + Alt + F | 29 | | Toggle Tab Key Moves Focus (vs tab spacing) | Ctrl/⌘ + M | 30 | 31 | ^ For CSS, GraphQL, Markdown, HTML, JavaScript, Less, TypeScript, Sass, and Yaml. Some languages, such as JSON, have built-in formatters. 32 | 33 | Each time the editor refreshes (e.g., toggling word wrap, formatting code), the editor remembers your position (line number and column) and centers it on the screen if it's not already in focus. 34 | 35 | ## Settings 36 | 37 | The settings for each note are saved automatically after they are changed. Loading default settings will sync the note's settings with the default settings and save automatically. 38 | 39 | ### Themes 40 | 41 | The Monaco Editor comes with three themes: `vs` (a white/light theme), `vs-dark` (a dark theme like the default theme for VS Code), and `hc-black` (a high contrast dark theme). There is also one more option: `sn-theme`. The `sn-theme` option takes either `vs` or `vs-dark` depending on your system theme and adjusts some of the colors (e.g., link colors) to match the theme. The `sn-theme` is still a work-in-progress. 42 | 43 | ## Development 44 | 45 | **Prerequisites:** Install [Node.js](https://nodejs.org/en/), [Yarn](https://classic.yarnpkg.com/en/docs/install/), and [Git](https://github.com/git-guides/install-git) on your computer. 46 | 47 | The general instructions setting up an environment to develop Standard Notes extensions can be found [here](https://docs.standardnotes.org/extensions/local-setup). You can also follow these instructions: 48 | 49 | 1. Fork the [repository](https://github.com/standardnotes/code-pro) on GitHub. 50 | 2. [Clone](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) your fork of the repository. 51 | 3. Run `cd code-pro` to enter the `code-pro` directory. 52 | 4. Run `yarn install` to install the dependencies on your machine as they are described in `yarn.lock`. 53 | 54 | ### Testing in the browser 55 | 56 | 1. To run the app in development mode, run `yarn start` and visit http://localhost:3001. Press `ctrl/cmd + C` to exit development mode. 57 | 58 | ### Testing in the Standard Notes app 59 | 60 | 1. Create an `ext.json` in the `public` directory. You have three options: 61 | 1. Use `sample.ext.json`. 62 | 2. Create `ext.json` as a copy of `sample.ext.json`. 63 | 3. Follow the instructions [here](https://docs.standardnotes.org/extensions/local-setup) with `url: "http://localhost:3000/index.html"`. 64 | 2. Install http-server using `sudo npm install -g http-server` then run `yarn server` to serve the `./build` directory at http://localhost:3000. 65 | 3. To build the app, run `yarn build`. 66 | 4. Install the editor into the [web](https://app.standardnotes.org) or [desktop](https://standardnotes.org/download) app with `http://localhost:3000/sample.ext.json` or with your custom `ext.json`. Press `ctrl/cmd + C` to shut down the server. 67 | 68 | ### Deployment 69 | 70 | 1. To make the source code prettier, run `yarn pretty`. 71 | 2. To the deploy the build into the `gh-pages` branch of your repository on GitHub, run `yarn deploy-stable`. 72 | 3. To deploy the build into to the `dev` branch for testing, run `yarn deploy-dev`. 73 | 4. To deploy the built into the `build` branch for distributing, run `yarn deploy-build` for distributing builds. 74 | 75 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 76 | 77 | ### Available Scripts 78 | 79 | In the project directory, you can run: 80 | 81 | #### `yarn start` 82 | 83 | Runs the app in the development mode.\ 84 | Open [http://localhost:3001](http://localhost:3001) to view it in the browser. 85 | 86 | The page will reload if you make edits.\ 87 | You will also see any lint errors in the console. 88 | 89 | #### `yarn test` 90 | 91 | Launches the test runner in the interactive watch mode.\ 92 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 93 | 94 | #### `yarn build` 95 | 96 | Builds the app for production to the `build` folder.\ 97 | It correctly bundles React in production mode and optimizes the build for the best performance. 98 | 99 | The build is minified and the filenames include the hashes.\ 100 | Your app is ready to be deployed! 101 | 102 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 103 | 104 | #### `yarn eject` 105 | 106 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 107 | 108 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 109 | 110 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 111 | 112 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 113 | 114 | ### Learn More 115 | 116 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 117 | 118 | To learn React, check out the [React documentation](https://reactjs.org/). 119 | -------------------------------------------------------------------------------- /monaco/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | 106 | #### Copied from Create React App #### 107 | 108 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 109 | 110 | # dependencies 111 | /node_modules 112 | /.pnp 113 | .pnp.js 114 | 115 | # testing 116 | /coverage 117 | 118 | # production 119 | /build 120 | 121 | # misc 122 | .DS_Store 123 | .env.local 124 | .env.development.local 125 | .env.test.local 126 | .env.production.local 127 | 128 | npm-debug.log* 129 | yarn-debug.log* 130 | yarn-error.log* -------------------------------------------------------------------------------- /monaco/README.md: -------------------------------------------------------------------------------- 1 | # Monaco Editor Workers 2 | 3 | This folder contains the workers required to make full use of the Monaco Editor. Build them in the `dist` folder by running `yarn run build`, then copy the workers from `dist` to `../public/monaco` by running `yarn run copy`. Create React App will bundle the remaining of the necessary files because we import the Monaco Editor in [Editor.tsx](../src/components/Editor.tsx) with `import * as monaco from 'monaco-editor';`. 4 | -------------------------------------------------------------------------------- /monaco/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "monaco-editor-workers", 3 | "scripts": { 4 | "build": "NODE_ENV='production' ./node_modules/.bin/webpack --progress", 5 | "copy": "cp ./dist/* ../public/monaco" 6 | }, 7 | "dependencies": { 8 | "monaco-editor-webpack-plugin": "^3.0.0", 9 | "monaco-editor": "^0.22.3", 10 | "webpack-cli": "^4.4.0", 11 | "webpack": "^5.19.0" } 12 | } 13 | -------------------------------------------------------------------------------- /monaco/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | module.exports = { 3 | mode: 'production', 4 | entry: { 5 | 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js', 6 | 'json.worker': 'monaco-editor/esm/vs/language/json/json.worker', 7 | 'css.worker': 'monaco-editor/esm/vs/language/css/css.worker', 8 | 'html.worker': 'monaco-editor/esm/vs/language/html/html.worker', 9 | 'ts.worker': 'monaco-editor/esm/vs/language/typescript/ts.worker', 10 | }, 11 | resolve: { 12 | extensions: ['*', '.js', '.jsx', '.tsx', '.ts'], 13 | }, 14 | output: { 15 | globalObject: 'self', 16 | filename: '[name].bundle.js', 17 | path: path.resolve(__dirname, 'dist'), 18 | }, 19 | }; 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code-pro", 3 | "version": "0.1.0-beta.2", 4 | "description": "Code Pro is a code editor for Standard Notes powered by the Monaco Editor", 5 | "keywords": [ 6 | "Standard Notes", 7 | "Standard Notes Extensions", 8 | "Monaco Editor" 9 | ], 10 | "private": true, 11 | "license": "AGPL-3.0-or-later", 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/standardnotes/code-pro.git" 15 | }, 16 | "bugs": { 17 | "url": "https://github.com/standardnotes/code-pro/issues" 18 | }, 19 | "sn": { 20 | "main": "build/index.html" 21 | }, 22 | "homepage": ".", 23 | "scripts": { 24 | "analyze": "source-map-explorer 'build/static/js/*.js'", 25 | "start": "PORT=3001 react-scripts start", 26 | "build": "react-scripts build", 27 | "clean-deploy-cache": "rm -rf node_modules/.cache/gh-pages", 28 | "predeploy": "yarn run pretty && cp README.md public/README.txt && cp LICENSE public/LICENSE.txt && yarn run build && yarn clean-deploy-cache", 29 | "deploy-build": "yarn run predeploy && gh-pages -b build -d build", 30 | "deploy-dev": "yarn run predeploy && gh-pages -b dev -d build", 31 | "deploy-stable": "yarn run predeploy && gh-pages -b gh-pages -d build", 32 | "test": "react-scripts test", 33 | "eject": "react-scripts eject", 34 | "serve": "serve -s -p 3000 build", 35 | "server-public": "http-server -p 3000 --cors", 36 | "server-root": "http-server ./ -p 3000 --cors", 37 | "server": "http-server ./build -p 3000 --cors", 38 | "pretty": "prettier --write 'src/**/*.{html,css,scss,js,jsx,ts,tsx,json}' README.md public/*.{html,json}" 39 | }, 40 | "dependencies": { 41 | "@testing-library/dom": "^7.29.4", 42 | "@testing-library/jest-dom": "^5.11.9", 43 | "@testing-library/react": "^11.2.3", 44 | "@testing-library/user-event": "^12.6.2", 45 | "@types/jest": "^26.0.20", 46 | "@types/lodash": "^4.14.168", 47 | "@types/node": "^14.14.22", 48 | "@types/react": "^17.0.0", 49 | "@types/react-dom": "^17.0.0", 50 | "filesafe-embed": "^1.0.10", 51 | "filesafe-js": "^1.0.4", 52 | "gh-pages": "^3.1.0", 53 | "husky": "^4.3.8", 54 | "lint-staged": "^10.5.3", 55 | "monaco-editor": "^0.22.3", 56 | "node-sass": "4.14.1", 57 | "prettier": "^2.2.1", 58 | "react": "^17.0.1", 59 | "react-dom": "^17.0.1", 60 | "react-scripts": "4.0.1", 61 | "rehype-highlight": "^4.0.0", 62 | "rehype-katex": "^4.0.0", 63 | "rehype-raw": "^5.0.0", 64 | "rehype-react": "^6.2.0", 65 | "remark-breaks": "^2.0.1", 66 | "remark-external-links": "^8.0.0", 67 | "remark-footnotes": "^3.0.0", 68 | "remark-gemoji": "^6.0.0", 69 | "remark-gfm": "^1.0.0", 70 | "remark-math": "^4.0.0", 71 | "remark-parse": "^9.0.0", 72 | "remark-rehype": "^8.0.0", 73 | "remark-slug": "^6.0.0", 74 | "remark-toc": "^7.0.0", 75 | "sn-editor-kit": "1.0.6", 76 | "sn-stylekit": "2.1.0", 77 | "source-map-explorer": "^2.5.2", 78 | "typescript": "^4.1.3", 79 | "unified": "^9.2.0", 80 | "web-vitals": "^1.1.0" 81 | }, 82 | "eslintConfig": { 83 | "extends": [ 84 | "react-app", 85 | "react-app/jest" 86 | ] 87 | }, 88 | "browserslist": { 89 | "production": [ 90 | ">0.2%", 91 | "not dead", 92 | "not op_mini all" 93 | ], 94 | "development": [ 95 | "last 1 chrome version", 96 | "last 1 firefox version", 97 | "last 1 safari version" 98 | ] 99 | }, 100 | "husky": { 101 | "hooks": { 102 | "pre-commit": "lint-staged" 103 | } 104 | }, 105 | "lint-staged": { 106 | "README.md": [ 107 | "prettier --write" 108 | ], 109 | "src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [ 110 | "prettier --write" 111 | ] 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /public/README.txt: -------------------------------------------------------------------------------- 1 | # Code Pro for Standard Notes 2 | 3 | Code Pro is a [derived editor](https://standardnotes.org/help/77/what-are-editors) for [Standard Notes](https://standardnotes.org), a free, [open-source](https://standardnotes.org/knowledge/5/what-is-free-and-open-source-software), and [end-to-end encrypted](https://standardnotes.org/knowledge/2/what-is-end-to-end-encryption) notes app. 4 | 5 | Code Pro is a code editor powered by the [Monaco Editor](https://microsoft.github.io/monaco-editor/) (Visual Studio Code). It is meant for writing Markdown and 60 other programming languages. 6 | 7 | Code Pro is not meant to be used on mobile devices. 8 | 9 | ## Features 10 | 11 | - Syntax highlighting for Markdown and more than 60 other programming languages 12 | - Languages supported: abap, aes, apex, azcli, bat, c, cameligo, clojure, coffeescript, cpp, csharp, csp, css, dart, dockerfile, fsharp, go, graphql, handlebars, hcl, html, ini, java, javascript, json, julia, kotlin, less, lexon, lua, markdown, mips, msdax, mysql, objective-c, pascal, pascaligo, perl, pgsql, php, plaintext, postiats, powerquery, powershell, pug, python, r, razor, redis, redshift, restructuredtext, ruby, rust, sb, scala, scheme, scss, shell, sol, sql, st, swift, systemverilog, tcl, twig, typescript, vb, verilog, xml, yaml 13 | - Autocompletion 14 | - Intelligent autocompletion for CSS, JavaScript, JSON, Less, Handlebars, HTML, Razor, SCSS, and TypeScript 15 | - Sophisticated search and replace 16 | - Prettier formatting for CSS, GraphQL, Markdown, HTML, JavaScript, Less, TypeScript, Sass, and Yaml. Built-in formatting for JSON. 17 | - Settings: language, font size, tab size (`2` or `4`), theme (light, dark, high contrast, or SN themed), and word wrap (`on`, `off`, and `bounded`) 18 | - Per-note settings 19 | - Buttons to save and load default settings 20 | 21 | ## Keyboard Shortcuts 22 | 23 | Perform these shortcuts with the editor 24 | 25 | | Action | Shortcut | 26 | | :-------------------------------------------------------------- | :----------------------------------------------- | 27 | | Toggle word wrap between `on` and `off` (bounded is unaffected) | Alt + Z | 28 | | Format code with Prettier^ | Shift + Alt + F | 29 | | Toggle Tab Key Moves Focus (vs tab spacing) | Ctrl/⌘ + M | 30 | 31 | ^ For CSS, GraphQL, Markdown, HTML, JavaScript, Less, TypeScript, Sass, and Yaml. Some languages, such as JSON, have built-in formatters. 32 | 33 | Each time the editor refreshes (e.g., toggling word wrap, formatting code), the editor remembers your position (line number and column) and centers it on the screen if it's not already in focus. 34 | 35 | ## Settings 36 | 37 | The settings for each note are saved automatically after they are changed. Loading default settings will sync the note's settings with the default settings and save automatically. 38 | 39 | ### Themes 40 | 41 | The Monaco Editor comes with three themes: `vs` (a white/light theme), `vs-dark` (a dark theme like the default theme for VS Code), and `hc-black` (a high contrast dark theme). There is also one more option: `sn-theme`. The `sn-theme` option takes either `vs` or `vs-dark` depending on your system theme and adjusts some of the colors (e.g., link colors) to match the theme. The `sn-theme` is still a work-in-progress. 42 | 43 | ## Development 44 | 45 | **Prerequisites:** Install [Node.js](https://nodejs.org/en/), [Yarn](https://classic.yarnpkg.com/en/docs/install/), and [Git](https://github.com/git-guides/install-git) on your computer. 46 | 47 | The general instructions setting up an environment to develop Standard Notes extensions can be found [here](https://docs.standardnotes.org/extensions/local-setup). You can also follow these instructions: 48 | 49 | 1. Fork the [repository](https://github.com/standardnotes/code-pro) on GitHub. 50 | 2. [Clone](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) your fork of the repository. 51 | 3. Run `cd code-pro` to enter the `code-pro` directory. 52 | 4. Run `yarn install` to install the dependencies on your machine as they are described in `yarn.lock`. 53 | 54 | ### Testing in the browser 55 | 56 | 1. To run the app in development mode, run `yarn start` and visit http://localhost:3001. Press `ctrl/cmd + C` to exit development mode. 57 | 58 | ### Testing in the Standard Notes app 59 | 60 | 1. Create an `ext.json` in the `public` directory. You have three options: 61 | 1. Use `sample.ext.json`. 62 | 2. Create `ext.json` as a copy of `sample.ext.json`. 63 | 3. Follow the instructions [here](https://docs.standardnotes.org/extensions/local-setup) with `url: "http://localhost:3000/index.html"`. 64 | 2. Install http-server using `sudo npm install -g http-server` then run `yarn server` to serve the `./build` directory at http://localhost:3000. 65 | 3. To build the app, run `yarn build`. 66 | 4. Install the editor into the [web](https://app.standardnotes.org) or [desktop](https://standardnotes.org/download) app with `http://localhost:3000/sample.ext.json` or with your custom `ext.json`. Press `ctrl/cmd + C` to shut down the server. 67 | 68 | ### Deployment 69 | 70 | 1. To make the source code prettier, run `yarn pretty`. 71 | 2. To the deploy the build into the `gh-pages` branch of your repository on GitHub, run `yarn deploy-stable`. 72 | 3. To deploy the build into to the `dev` branch for testing, run `yarn deploy-dev`. 73 | 4. To deploy the built into the `build` branch for distributing, run `yarn deploy-build` for distributing builds. 74 | 75 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 76 | 77 | ### Available Scripts 78 | 79 | In the project directory, you can run: 80 | 81 | #### `yarn start` 82 | 83 | Runs the app in the development mode.\ 84 | Open [http://localhost:3001](http://localhost:3001) to view it in the browser. 85 | 86 | The page will reload if you make edits.\ 87 | You will also see any lint errors in the console. 88 | 89 | #### `yarn test` 90 | 91 | Launches the test runner in the interactive watch mode.\ 92 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 93 | 94 | #### `yarn build` 95 | 96 | Builds the app for production to the `build` folder.\ 97 | It correctly bundles React in production mode and optimizes the build for the best performance. 98 | 99 | The build is minified and the filenames include the hashes.\ 100 | Your app is ready to be deployed! 101 | 102 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 103 | 104 | #### `yarn eject` 105 | 106 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 107 | 108 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 109 | 110 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 111 | 112 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 113 | 114 | ### Learn More 115 | 116 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 117 | 118 | To learn React, check out the [React documentation](https://reactjs.org/). 119 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/favicon.ico -------------------------------------------------------------------------------- /public/ic-code-tags-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/ic-code-tags-16.png -------------------------------------------------------------------------------- /public/ic-code-tags-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/ic-code-tags-192.png -------------------------------------------------------------------------------- /public/ic-code-tags-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/ic-code-tags-32.png -------------------------------------------------------------------------------- /public/ic-code-tags-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/ic-code-tags-48.png -------------------------------------------------------------------------------- /public/ic-code-tags-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/ic-code-tags-512.png -------------------------------------------------------------------------------- /public/ic-code-tags-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/ic-code-tags-64.png -------------------------------------------------------------------------------- /public/ic-code-tags.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | 33 | Code Pro 34 | 35 | 36 | 37 | 38 |
39 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /public/katex/v0.12.0/README.md: -------------------------------------------------------------------------------- 1 | # [KaTeX](https://katex.org/) 2 | 3 | [![npm](https://img.shields.io/npm/v/katex.svg)](https://www.npmjs.com/package/katex) 4 | [![CircleCI](https://circleci.com/gh/KaTeX/KaTeX.svg?style=shield)](https://circleci.com/gh/KaTeX/KaTeX) 5 | [![codecov](https://codecov.io/gh/KaTeX/KaTeX/branch/master/graph/badge.svg)](https://codecov.io/gh/KaTeX/KaTeX) 6 | [![Join the chat at https://gitter.im/KaTeX/KaTeX](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/KaTeX/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 7 | [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=KaTeX/KaTeX)](https://dependabot.com) 8 | [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/katex/badge?style=rounded)](https://www.jsdelivr.com/package/npm/katex) 9 | ![](https://img.badgesize.io/KaTeX/KaTeX/v0.12.0/dist/katex.min.js?compression=gzip) 10 | 11 | KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. 12 | 13 | - **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](http://www.intmath.com/cg5/katex-mathjax-comparison.php). 14 | - **Print quality:** KaTeX's layout is based on Donald Knuth's TeX, the gold standard for math typesetting. 15 | - **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources. 16 | - **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML. 17 | 18 | KaTeX is compatible with all major browsers, including Chrome, Safari, Firefox, Opera, Edge, and IE 11. 19 | 20 | KaTeX supports much (but not all) of LaTeX and many LaTeX packages. See the [list of supported functions](https://katex.org/docs/supported.html). 21 | 22 | Try out KaTeX [on the demo page](https://katex.org/#demo)! 23 | 24 | ## Getting started 25 | 26 | ### Starter template 27 | 28 | ```html 29 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 47 | 48 | 49 | 56 | 57 | ... 58 | 59 | ``` 60 | 61 | You can also [download KaTeX](https://github.com/KaTeX/KaTeX/releases) and host it yourself. 62 | 63 | For details on how to configure auto-render extension, refer to [the documentation](https://katex.org/docs/autorender.html). 64 | 65 | ### API 66 | 67 | Call `katex.render` to render a TeX expression directly into a DOM element. 68 | For example: 69 | 70 | ```js 71 | katex.render('c = \\pm\\sqrt{a^2 + b^2}', element, { 72 | throwOnError: false, 73 | }); 74 | ``` 75 | 76 | Call `katex.renderToString` to generate an HTML string of the rendered math, 77 | e.g., for server-side rendering. For example: 78 | 79 | ```js 80 | var html = katex.renderToString('c = \\pm\\sqrt{a^2 + b^2}', { 81 | throwOnError: false, 82 | }); 83 | // '...' 84 | ``` 85 | 86 | Make sure to include the CSS and font files in both cases. 87 | If you are doing all rendering on the server, there is no need to include the 88 | JavaScript on the client. 89 | 90 | The examples above use the `throwOnError: false` option, which renders invalid 91 | inputs as the TeX source code in red (by default), with the error message as 92 | hover text. For other available options, see the 93 | [API documentation](https://katex.org/docs/api.html), 94 | [options documentation](https://katex.org/docs/options.html), and 95 | [handling errors documentation](https://katex.org/docs/error.html). 96 | 97 | ## Demo and Documentation 98 | 99 | Learn more about using KaTeX [on the website](https://katex.org)! 100 | 101 | ## Contributing 102 | 103 | See [CONTRIBUTING.md](CONTRIBUTING.md) 104 | 105 | ## License 106 | 107 | KaTeX is licensed under the [MIT License](http://opensource.org/licenses/MIT). 108 | -------------------------------------------------------------------------------- /public/katex/v0.12.0/contrib/auto-render.js: -------------------------------------------------------------------------------- 1 | (function webpackUniversalModuleDefinition(root, factory) { 2 | if(typeof exports === 'object' && typeof module === 'object') 3 | module.exports = factory(require("katex")); 4 | else if(typeof define === 'function' && define.amd) 5 | define(["katex"], factory); 6 | else if(typeof exports === 'object') 7 | exports["renderMathInElement"] = factory(require("katex")); 8 | else 9 | root["renderMathInElement"] = factory(root["katex"]); 10 | })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__0__) { 11 | return /******/ (function(modules) { // webpackBootstrap 12 | /******/ // The module cache 13 | /******/ var installedModules = {}; 14 | /******/ 15 | /******/ // The require function 16 | /******/ function __webpack_require__(moduleId) { 17 | /******/ 18 | /******/ // Check if module is in cache 19 | /******/ if(installedModules[moduleId]) { 20 | /******/ return installedModules[moduleId].exports; 21 | /******/ } 22 | /******/ // Create a new module (and put it into the cache) 23 | /******/ var module = installedModules[moduleId] = { 24 | /******/ i: moduleId, 25 | /******/ l: false, 26 | /******/ exports: {} 27 | /******/ }; 28 | /******/ 29 | /******/ // Execute the module function 30 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 31 | /******/ 32 | /******/ // Flag the module as loaded 33 | /******/ module.l = true; 34 | /******/ 35 | /******/ // Return the exports of the module 36 | /******/ return module.exports; 37 | /******/ } 38 | /******/ 39 | /******/ 40 | /******/ // expose the modules object (__webpack_modules__) 41 | /******/ __webpack_require__.m = modules; 42 | /******/ 43 | /******/ // expose the module cache 44 | /******/ __webpack_require__.c = installedModules; 45 | /******/ 46 | /******/ // define getter function for harmony exports 47 | /******/ __webpack_require__.d = function(exports, name, getter) { 48 | /******/ if(!__webpack_require__.o(exports, name)) { 49 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 50 | /******/ } 51 | /******/ }; 52 | /******/ 53 | /******/ // define __esModule on exports 54 | /******/ __webpack_require__.r = function(exports) { 55 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 56 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 57 | /******/ } 58 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 59 | /******/ }; 60 | /******/ 61 | /******/ // create a fake namespace object 62 | /******/ // mode & 1: value is a module id, require it 63 | /******/ // mode & 2: merge all properties of value into the ns 64 | /******/ // mode & 4: return value when already ns object 65 | /******/ // mode & 8|1: behave like require 66 | /******/ __webpack_require__.t = function(value, mode) { 67 | /******/ if(mode & 1) value = __webpack_require__(value); 68 | /******/ if(mode & 8) return value; 69 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 70 | /******/ var ns = Object.create(null); 71 | /******/ __webpack_require__.r(ns); 72 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 73 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 74 | /******/ return ns; 75 | /******/ }; 76 | /******/ 77 | /******/ // getDefaultExport function for compatibility with non-harmony modules 78 | /******/ __webpack_require__.n = function(module) { 79 | /******/ var getter = module && module.__esModule ? 80 | /******/ function getDefault() { return module['default']; } : 81 | /******/ function getModuleExports() { return module; }; 82 | /******/ __webpack_require__.d(getter, 'a', getter); 83 | /******/ return getter; 84 | /******/ }; 85 | /******/ 86 | /******/ // Object.prototype.hasOwnProperty.call 87 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 88 | /******/ 89 | /******/ // __webpack_public_path__ 90 | /******/ __webpack_require__.p = ""; 91 | /******/ 92 | /******/ 93 | /******/ // Load entry module and return exports 94 | /******/ return __webpack_require__(__webpack_require__.s = 1); 95 | /******/ }) 96 | /************************************************************************/ 97 | /******/ ([ 98 | /* 0 */ 99 | /***/ (function(module, exports) { 100 | 101 | module.exports = __WEBPACK_EXTERNAL_MODULE__0__; 102 | 103 | /***/ }), 104 | /* 1 */ 105 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 106 | 107 | "use strict"; 108 | __webpack_require__.r(__webpack_exports__); 109 | 110 | // EXTERNAL MODULE: external "katex" 111 | var external_katex_ = __webpack_require__(0); 112 | var external_katex_default = /*#__PURE__*/__webpack_require__.n(external_katex_); 113 | 114 | // CONCATENATED MODULE: ./contrib/auto-render/splitAtDelimiters.js 115 | /* eslint no-constant-condition:0 */ 116 | var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) { 117 | // Adapted from 118 | // https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx 119 | var index = startIndex; 120 | var braceLevel = 0; 121 | var delimLength = delimiter.length; 122 | 123 | while (index < text.length) { 124 | var character = text[index]; 125 | 126 | if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) { 127 | return index; 128 | } else if (character === "\\") { 129 | index++; 130 | } else if (character === "{") { 131 | braceLevel++; 132 | } else if (character === "}") { 133 | braceLevel--; 134 | } 135 | 136 | index++; 137 | } 138 | 139 | return -1; 140 | }; 141 | 142 | var splitAtDelimiters = function splitAtDelimiters(startData, leftDelim, rightDelim, display) { 143 | var finalData = []; 144 | 145 | for (var i = 0; i < startData.length; i++) { 146 | if (startData[i].type === "text") { 147 | var text = startData[i].data; 148 | var lookingForLeft = true; 149 | var currIndex = 0; 150 | var nextIndex = void 0; 151 | nextIndex = text.indexOf(leftDelim); 152 | 153 | if (nextIndex !== -1) { 154 | currIndex = nextIndex; 155 | finalData.push({ 156 | type: "text", 157 | data: text.slice(0, currIndex) 158 | }); 159 | lookingForLeft = false; 160 | } 161 | 162 | while (true) { 163 | if (lookingForLeft) { 164 | nextIndex = text.indexOf(leftDelim, currIndex); 165 | 166 | if (nextIndex === -1) { 167 | break; 168 | } 169 | 170 | finalData.push({ 171 | type: "text", 172 | data: text.slice(currIndex, nextIndex) 173 | }); 174 | currIndex = nextIndex; 175 | } else { 176 | nextIndex = findEndOfMath(rightDelim, text, currIndex + leftDelim.length); 177 | 178 | if (nextIndex === -1) { 179 | break; 180 | } 181 | 182 | finalData.push({ 183 | type: "math", 184 | data: text.slice(currIndex + leftDelim.length, nextIndex), 185 | rawData: text.slice(currIndex, nextIndex + rightDelim.length), 186 | display: display 187 | }); 188 | currIndex = nextIndex + rightDelim.length; 189 | } 190 | 191 | lookingForLeft = !lookingForLeft; 192 | } 193 | 194 | finalData.push({ 195 | type: "text", 196 | data: text.slice(currIndex) 197 | }); 198 | } else { 199 | finalData.push(startData[i]); 200 | } 201 | } 202 | 203 | return finalData; 204 | }; 205 | 206 | /* harmony default export */ var auto_render_splitAtDelimiters = (splitAtDelimiters); 207 | // CONCATENATED MODULE: ./contrib/auto-render/auto-render.js 208 | /* eslint no-console:0 */ 209 | 210 | 211 | 212 | var auto_render_splitWithDelimiters = function splitWithDelimiters(text, delimiters) { 213 | var data = [{ 214 | type: "text", 215 | data: text 216 | }]; 217 | 218 | for (var i = 0; i < delimiters.length; i++) { 219 | var delimiter = delimiters[i]; 220 | data = auto_render_splitAtDelimiters(data, delimiter.left, delimiter.right, delimiter.display || false); 221 | } 222 | 223 | return data; 224 | }; 225 | /* Note: optionsCopy is mutated by this method. If it is ever exposed in the 226 | * API, we should copy it before mutating. 227 | */ 228 | 229 | 230 | var auto_render_renderMathInText = function renderMathInText(text, optionsCopy) { 231 | var data = auto_render_splitWithDelimiters(text, optionsCopy.delimiters); 232 | 233 | if (data.length === 1 && data[0].type === 'text') { 234 | // There is no formula in the text. 235 | // Let's return null which means there is no need to replace 236 | // the current text node with a new one. 237 | return null; 238 | } 239 | 240 | var fragment = document.createDocumentFragment(); 241 | 242 | for (var i = 0; i < data.length; i++) { 243 | if (data[i].type === "text") { 244 | fragment.appendChild(document.createTextNode(data[i].data)); 245 | } else { 246 | var span = document.createElement("span"); 247 | var math = data[i].data; // Override any display mode defined in the settings with that 248 | // defined by the text itself 249 | 250 | optionsCopy.displayMode = data[i].display; 251 | 252 | try { 253 | if (optionsCopy.preProcess) { 254 | math = optionsCopy.preProcess(math); 255 | } 256 | 257 | external_katex_default.a.render(math, span, optionsCopy); 258 | } catch (e) { 259 | if (!(e instanceof external_katex_default.a.ParseError)) { 260 | throw e; 261 | } 262 | 263 | optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e); 264 | fragment.appendChild(document.createTextNode(data[i].rawData)); 265 | continue; 266 | } 267 | 268 | fragment.appendChild(span); 269 | } 270 | } 271 | 272 | return fragment; 273 | }; 274 | 275 | var renderElem = function renderElem(elem, optionsCopy) { 276 | for (var i = 0; i < elem.childNodes.length; i++) { 277 | var childNode = elem.childNodes[i]; 278 | 279 | if (childNode.nodeType === 3) { 280 | // Text node 281 | var frag = auto_render_renderMathInText(childNode.textContent, optionsCopy); 282 | 283 | if (frag) { 284 | i += frag.childNodes.length - 1; 285 | elem.replaceChild(frag, childNode); 286 | } 287 | } else if (childNode.nodeType === 1) { 288 | (function () { 289 | // Element node 290 | var className = ' ' + childNode.className + ' '; 291 | var shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(function (x) { 292 | return className.indexOf(' ' + x + ' ') === -1; 293 | }); 294 | 295 | if (shouldRender) { 296 | renderElem(childNode, optionsCopy); 297 | } 298 | })(); 299 | } // Otherwise, it's something else, and ignore it. 300 | 301 | } 302 | }; 303 | 304 | var renderMathInElement = function renderMathInElement(elem, options) { 305 | if (!elem) { 306 | throw new Error("No element provided to render"); 307 | } 308 | 309 | var optionsCopy = {}; // Object.assign(optionsCopy, option) 310 | 311 | for (var option in options) { 312 | if (options.hasOwnProperty(option)) { 313 | optionsCopy[option] = options[option]; 314 | } 315 | } // default options 316 | 317 | 318 | optionsCopy.delimiters = optionsCopy.delimiters || [{ 319 | left: "$$", 320 | right: "$$", 321 | display: true 322 | }, { 323 | left: "\\(", 324 | right: "\\)", 325 | display: false 326 | }, // LaTeX uses $…$, but it ruins the display of normal `$` in text: 327 | // {left: "$", right: "$", display: false}, 328 | // \[…\] must come last in this array. Otherwise, renderMathInElement 329 | // will search for \[ before it searches for $$ or \( 330 | // That makes it susceptible to finding a \\[0.3em] row delimiter and 331 | // treating it as if it were the start of a KaTeX math zone. 332 | { 333 | left: "\\[", 334 | right: "\\]", 335 | display: true 336 | }]; 337 | optionsCopy.ignoredTags = optionsCopy.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"]; 338 | optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || []; 339 | optionsCopy.errorCallback = optionsCopy.errorCallback || console.error; // Enable sharing of global macros defined via `\gdef` between different 340 | // math elements within a single call to `renderMathInElement`. 341 | 342 | optionsCopy.macros = optionsCopy.macros || {}; 343 | renderElem(elem, optionsCopy); 344 | }; 345 | 346 | /* harmony default export */ var auto_render = __webpack_exports__["default"] = (renderMathInElement); 347 | 348 | /***/ }) 349 | /******/ ])["default"]; 350 | }); -------------------------------------------------------------------------------- /public/katex/v0.12.0/contrib/auto-render.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),a=function(e,t,r){for(var n=r,o=0,a=e.length;n className.indexOf(' ' + x + ' ') === -1); 175 | 176 | if (shouldRender) { 177 | renderElem(childNode, optionsCopy); 178 | } 179 | } // Otherwise, it's something else, and ignore it. 180 | 181 | } 182 | }; 183 | 184 | const renderMathInElement = function renderMathInElement(elem, options) { 185 | if (!elem) { 186 | throw new Error("No element provided to render"); 187 | } 188 | 189 | const optionsCopy = {}; // Object.assign(optionsCopy, option) 190 | 191 | for (const option in options) { 192 | if (options.hasOwnProperty(option)) { 193 | optionsCopy[option] = options[option]; 194 | } 195 | } // default options 196 | 197 | 198 | optionsCopy.delimiters = optionsCopy.delimiters || [{ 199 | left: "$$", 200 | right: "$$", 201 | display: true 202 | }, { 203 | left: "\\(", 204 | right: "\\)", 205 | display: false 206 | }, // LaTeX uses $…$, but it ruins the display of normal `$` in text: 207 | // {left: "$", right: "$", display: false}, 208 | // \[…\] must come last in this array. Otherwise, renderMathInElement 209 | // will search for \[ before it searches for $$ or \( 210 | // That makes it susceptible to finding a \\[0.3em] row delimiter and 211 | // treating it as if it were the start of a KaTeX math zone. 212 | { 213 | left: "\\[", 214 | right: "\\]", 215 | display: true 216 | }]; 217 | optionsCopy.ignoredTags = optionsCopy.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"]; 218 | optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || []; 219 | optionsCopy.errorCallback = optionsCopy.errorCallback || console.error; // Enable sharing of global macros defined via `\gdef` between different 220 | // math elements within a single call to `renderMathInElement`. 221 | 222 | optionsCopy.macros = optionsCopy.macros || {}; 223 | renderElem(elem, optionsCopy); 224 | }; 225 | 226 | export default renderMathInElement; 227 | -------------------------------------------------------------------------------- /public/katex/v0.12.0/contrib/copy-tex.css: -------------------------------------------------------------------------------- 1 | /* Force selection of entire .katex/.katex-display blocks, so that we can 2 | * copy/paste the entire source code. If you omit this CSS, partial 3 | * selections of a formula will work, but will copy the ugly HTML 4 | * representation instead of the LaTeX source code. (Full selections will 5 | * still produce the LaTeX source code.) 6 | */ 7 | .katex, 8 | .katex-display { 9 | user-select: all; 10 | -moz-user-select: all; 11 | -webkit-user-select: all; 12 | -ms-user-select: all; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /public/katex/v0.12.0/contrib/copy-tex.js: -------------------------------------------------------------------------------- 1 | (function webpackUniversalModuleDefinition(root, factory) { 2 | if(typeof exports === 'object' && typeof module === 'object') 3 | module.exports = factory(); 4 | else if(typeof define === 'function' && define.amd) 5 | define([], factory); 6 | else { 7 | var a = factory(); 8 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; 9 | } 10 | })((typeof self !== 'undefined' ? self : this), function() { 11 | return /******/ (function(modules) { // webpackBootstrap 12 | /******/ // The module cache 13 | /******/ var installedModules = {}; 14 | /******/ 15 | /******/ // The require function 16 | /******/ function __webpack_require__(moduleId) { 17 | /******/ 18 | /******/ // Check if module is in cache 19 | /******/ if(installedModules[moduleId]) { 20 | /******/ return installedModules[moduleId].exports; 21 | /******/ } 22 | /******/ // Create a new module (and put it into the cache) 23 | /******/ var module = installedModules[moduleId] = { 24 | /******/ i: moduleId, 25 | /******/ l: false, 26 | /******/ exports: {} 27 | /******/ }; 28 | /******/ 29 | /******/ // Execute the module function 30 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 31 | /******/ 32 | /******/ // Flag the module as loaded 33 | /******/ module.l = true; 34 | /******/ 35 | /******/ // Return the exports of the module 36 | /******/ return module.exports; 37 | /******/ } 38 | /******/ 39 | /******/ 40 | /******/ // expose the modules object (__webpack_modules__) 41 | /******/ __webpack_require__.m = modules; 42 | /******/ 43 | /******/ // expose the module cache 44 | /******/ __webpack_require__.c = installedModules; 45 | /******/ 46 | /******/ // define getter function for harmony exports 47 | /******/ __webpack_require__.d = function(exports, name, getter) { 48 | /******/ if(!__webpack_require__.o(exports, name)) { 49 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 50 | /******/ } 51 | /******/ }; 52 | /******/ 53 | /******/ // define __esModule on exports 54 | /******/ __webpack_require__.r = function(exports) { 55 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 56 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 57 | /******/ } 58 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 59 | /******/ }; 60 | /******/ 61 | /******/ // create a fake namespace object 62 | /******/ // mode & 1: value is a module id, require it 63 | /******/ // mode & 2: merge all properties of value into the ns 64 | /******/ // mode & 4: return value when already ns object 65 | /******/ // mode & 8|1: behave like require 66 | /******/ __webpack_require__.t = function(value, mode) { 67 | /******/ if(mode & 1) value = __webpack_require__(value); 68 | /******/ if(mode & 8) return value; 69 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 70 | /******/ var ns = Object.create(null); 71 | /******/ __webpack_require__.r(ns); 72 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 73 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 74 | /******/ return ns; 75 | /******/ }; 76 | /******/ 77 | /******/ // getDefaultExport function for compatibility with non-harmony modules 78 | /******/ __webpack_require__.n = function(module) { 79 | /******/ var getter = module && module.__esModule ? 80 | /******/ function getDefault() { return module['default']; } : 81 | /******/ function getModuleExports() { return module; }; 82 | /******/ __webpack_require__.d(getter, 'a', getter); 83 | /******/ return getter; 84 | /******/ }; 85 | /******/ 86 | /******/ // Object.prototype.hasOwnProperty.call 87 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 88 | /******/ 89 | /******/ // __webpack_public_path__ 90 | /******/ __webpack_require__.p = ""; 91 | /******/ 92 | /******/ 93 | /******/ // Load entry module and return exports 94 | /******/ return __webpack_require__(__webpack_require__.s = 1); 95 | /******/ }) 96 | /************************************************************************/ 97 | /******/ ([ 98 | /* 0 */ 99 | /***/ (function(module, exports, __webpack_require__) { 100 | 101 | // extracted by mini-css-extract-plugin 102 | 103 | /***/ }), 104 | /* 1 */ 105 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 106 | 107 | "use strict"; 108 | __webpack_require__.r(__webpack_exports__); 109 | 110 | // EXTERNAL MODULE: ./contrib/copy-tex/copy-tex.css 111 | var copy_tex = __webpack_require__(0); 112 | 113 | // CONCATENATED MODULE: ./contrib/copy-tex/katex2tex.js 114 | // Set these to how you want inline and display math to be delimited. 115 | var defaultCopyDelimiters = { 116 | inline: ['$', '$'], 117 | // alternative: ['\(', '\)'] 118 | display: ['$$', '$$'] // alternative: ['\[', '\]'] 119 | 120 | }; // Replace .katex elements with their TeX source ( element). 121 | // Modifies fragment in-place. Useful for writing your own 'copy' handler, 122 | // as in copy-tex.js. 123 | 124 | var katexReplaceWithTex = function katexReplaceWithTex(fragment, copyDelimiters) { 125 | if (copyDelimiters === void 0) { 126 | copyDelimiters = defaultCopyDelimiters; 127 | } 128 | 129 | // Remove .katex-html blocks that are preceded by .katex-mathml blocks 130 | // (which will get replaced below). 131 | var katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html'); 132 | 133 | for (var i = 0; i < katexHtml.length; i++) { 134 | var element = katexHtml[i]; 135 | 136 | if (element.remove) { 137 | element.remove(null); 138 | } else { 139 | element.parentNode.removeChild(element); 140 | } 141 | } // Replace .katex-mathml elements with their annotation (TeX source) 142 | // descendant, with inline delimiters. 143 | 144 | 145 | var katexMathml = fragment.querySelectorAll('.katex-mathml'); 146 | 147 | for (var _i = 0; _i < katexMathml.length; _i++) { 148 | var _element = katexMathml[_i]; 149 | 150 | var texSource = _element.querySelector('annotation'); 151 | 152 | if (texSource) { 153 | if (_element.replaceWith) { 154 | _element.replaceWith(texSource); 155 | } else { 156 | _element.parentNode.replaceChild(texSource, _element); 157 | } 158 | 159 | texSource.innerHTML = copyDelimiters.inline[0] + texSource.innerHTML + copyDelimiters.inline[1]; 160 | } 161 | } // Switch display math to display delimiters. 162 | 163 | 164 | var displays = fragment.querySelectorAll('.katex-display annotation'); 165 | 166 | for (var _i2 = 0; _i2 < displays.length; _i2++) { 167 | var _element2 = displays[_i2]; 168 | _element2.innerHTML = copyDelimiters.display[0] + _element2.innerHTML.substr(copyDelimiters.inline[0].length, _element2.innerHTML.length - copyDelimiters.inline[0].length - copyDelimiters.inline[1].length) + copyDelimiters.display[1]; 169 | } 170 | 171 | return fragment; 172 | }; 173 | /* harmony default export */ var katex2tex = (katexReplaceWithTex); 174 | // CONCATENATED MODULE: ./contrib/copy-tex/copy-tex.js 175 | // Global copy handler to modify behavior on .katex elements. 176 | 177 | document.addEventListener('copy', function (event) { 178 | var selection = window.getSelection(); 179 | 180 | if (selection.isCollapsed) { 181 | return; // default action OK if selection is empty 182 | } 183 | 184 | var fragment = selection.getRangeAt(0).cloneContents(); 185 | 186 | if (!fragment.querySelector('.katex-mathml')) { 187 | return; // default action OK if no .katex-mathml elements 188 | } // Preserve usual HTML copy/paste behavior. 189 | 190 | 191 | var html = []; 192 | 193 | for (var i = 0; i < fragment.childNodes.length; i++) { 194 | html.push(fragment.childNodes[i].outerHTML); 195 | } 196 | 197 | event.clipboardData.setData('text/html', html.join('')); // Rewrite plain-text version. 198 | 199 | event.clipboardData.setData('text/plain', katex2tex(fragment).textContent); // Prevent normal copy handling. 200 | 201 | event.preventDefault(); 202 | }); 203 | // CONCATENATED MODULE: ./contrib/copy-tex/copy-tex.webpack.js 204 | /** 205 | * This is the webpack entry point for KaTeX. As ECMAScript doesn't support 206 | * CSS modules natively, a separate entry point is used. 207 | */ 208 | 209 | 210 | 211 | /***/ }) 212 | /******/ ])["default"]; 213 | }); -------------------------------------------------------------------------------- /public/katex/v0.12.0/contrib/copy-tex.min.css: -------------------------------------------------------------------------------- 1 | .katex,.katex-display{user-select:all;-moz-user-select:all;-webkit-user-select:all;-ms-user-select:all} 2 | -------------------------------------------------------------------------------- /public/katex/v0.12.0/contrib/copy-tex.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){},function(e,t,n){"use strict";n.r(t);n(0);var r={inline:["$","$"],display:["$$","$$"]},o=function(e,t){void 0===t&&(t=r);for(var n=e.querySelectorAll(".katex-mathml + .katex-html"),o=0;o element). 8 | // Modifies fragment in-place. Useful for writing your own 'copy' handler, 9 | // as in copy-tex.js. 10 | 11 | const katexReplaceWithTex = function katexReplaceWithTex(fragment, copyDelimiters) { 12 | if (copyDelimiters === void 0) { 13 | copyDelimiters = defaultCopyDelimiters; 14 | } 15 | 16 | // Remove .katex-html blocks that are preceded by .katex-mathml blocks 17 | // (which will get replaced below). 18 | const katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html'); 19 | 20 | for (let i = 0; i < katexHtml.length; i++) { 21 | const element = katexHtml[i]; 22 | 23 | if (element.remove) { 24 | element.remove(null); 25 | } else { 26 | element.parentNode.removeChild(element); 27 | } 28 | } // Replace .katex-mathml elements with their annotation (TeX source) 29 | // descendant, with inline delimiters. 30 | 31 | 32 | const katexMathml = fragment.querySelectorAll('.katex-mathml'); 33 | 34 | for (let i = 0; i < katexMathml.length; i++) { 35 | const element = katexMathml[i]; 36 | const texSource = element.querySelector('annotation'); 37 | 38 | if (texSource) { 39 | if (element.replaceWith) { 40 | element.replaceWith(texSource); 41 | } else { 42 | element.parentNode.replaceChild(texSource, element); 43 | } 44 | 45 | texSource.innerHTML = copyDelimiters.inline[0] + texSource.innerHTML + copyDelimiters.inline[1]; 46 | } 47 | } // Switch display math to display delimiters. 48 | 49 | 50 | const displays = fragment.querySelectorAll('.katex-display annotation'); 51 | 52 | for (let i = 0; i < displays.length; i++) { 53 | const element = displays[i]; 54 | element.innerHTML = copyDelimiters.display[0] + element.innerHTML.substr(copyDelimiters.inline[0].length, element.innerHTML.length - copyDelimiters.inline[0].length - copyDelimiters.inline[1].length) + copyDelimiters.display[1]; 55 | } 56 | 57 | return fragment; 58 | }; 59 | 60 | document.addEventListener('copy', function (event) { 61 | const selection = window.getSelection(); 62 | 63 | if (selection.isCollapsed) { 64 | return; // default action OK if selection is empty 65 | } 66 | 67 | const fragment = selection.getRangeAt(0).cloneContents(); 68 | 69 | if (!fragment.querySelector('.katex-mathml')) { 70 | return; // default action OK if no .katex-mathml elements 71 | } // Preserve usual HTML copy/paste behavior. 72 | 73 | 74 | const html = []; 75 | 76 | for (let i = 0; i < fragment.childNodes.length; i++) { 77 | html.push(fragment.childNodes[i].outerHTML); 78 | } 79 | 80 | event.clipboardData.setData('text/html', html.join('')); // Rewrite plain-text version. 81 | 82 | event.clipboardData.setData('text/plain', katexReplaceWithTex(fragment).textContent); // Prevent normal copy handling. 83 | 84 | event.preventDefault(); 85 | }); 86 | -------------------------------------------------------------------------------- /public/katex/v0.12.0/contrib/mathtex-script-type.js: -------------------------------------------------------------------------------- 1 | (function webpackUniversalModuleDefinition(root, factory) { 2 | if(typeof exports === 'object' && typeof module === 'object') 3 | module.exports = factory(require("katex")); 4 | else if(typeof define === 'function' && define.amd) 5 | define(["katex"], factory); 6 | else { 7 | var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]); 8 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; 9 | } 10 | })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__0__) { 11 | return /******/ (function(modules) { // webpackBootstrap 12 | /******/ // The module cache 13 | /******/ var installedModules = {}; 14 | /******/ 15 | /******/ // The require function 16 | /******/ function __webpack_require__(moduleId) { 17 | /******/ 18 | /******/ // Check if module is in cache 19 | /******/ if(installedModules[moduleId]) { 20 | /******/ return installedModules[moduleId].exports; 21 | /******/ } 22 | /******/ // Create a new module (and put it into the cache) 23 | /******/ var module = installedModules[moduleId] = { 24 | /******/ i: moduleId, 25 | /******/ l: false, 26 | /******/ exports: {} 27 | /******/ }; 28 | /******/ 29 | /******/ // Execute the module function 30 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 31 | /******/ 32 | /******/ // Flag the module as loaded 33 | /******/ module.l = true; 34 | /******/ 35 | /******/ // Return the exports of the module 36 | /******/ return module.exports; 37 | /******/ } 38 | /******/ 39 | /******/ 40 | /******/ // expose the modules object (__webpack_modules__) 41 | /******/ __webpack_require__.m = modules; 42 | /******/ 43 | /******/ // expose the module cache 44 | /******/ __webpack_require__.c = installedModules; 45 | /******/ 46 | /******/ // define getter function for harmony exports 47 | /******/ __webpack_require__.d = function(exports, name, getter) { 48 | /******/ if(!__webpack_require__.o(exports, name)) { 49 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 50 | /******/ } 51 | /******/ }; 52 | /******/ 53 | /******/ // define __esModule on exports 54 | /******/ __webpack_require__.r = function(exports) { 55 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 56 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 57 | /******/ } 58 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 59 | /******/ }; 60 | /******/ 61 | /******/ // create a fake namespace object 62 | /******/ // mode & 1: value is a module id, require it 63 | /******/ // mode & 2: merge all properties of value into the ns 64 | /******/ // mode & 4: return value when already ns object 65 | /******/ // mode & 8|1: behave like require 66 | /******/ __webpack_require__.t = function(value, mode) { 67 | /******/ if(mode & 1) value = __webpack_require__(value); 68 | /******/ if(mode & 8) return value; 69 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 70 | /******/ var ns = Object.create(null); 71 | /******/ __webpack_require__.r(ns); 72 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 73 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 74 | /******/ return ns; 75 | /******/ }; 76 | /******/ 77 | /******/ // getDefaultExport function for compatibility with non-harmony modules 78 | /******/ __webpack_require__.n = function(module) { 79 | /******/ var getter = module && module.__esModule ? 80 | /******/ function getDefault() { return module['default']; } : 81 | /******/ function getModuleExports() { return module; }; 82 | /******/ __webpack_require__.d(getter, 'a', getter); 83 | /******/ return getter; 84 | /******/ }; 85 | /******/ 86 | /******/ // Object.prototype.hasOwnProperty.call 87 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 88 | /******/ 89 | /******/ // __webpack_public_path__ 90 | /******/ __webpack_require__.p = ""; 91 | /******/ 92 | /******/ 93 | /******/ // Load entry module and return exports 94 | /******/ return __webpack_require__(__webpack_require__.s = 1); 95 | /******/ }) 96 | /************************************************************************/ 97 | /******/ ([ 98 | /* 0 */ 99 | /***/ (function(module, exports) { 100 | 101 | module.exports = __WEBPACK_EXTERNAL_MODULE__0__; 102 | 103 | /***/ }), 104 | /* 1 */ 105 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 106 | 107 | "use strict"; 108 | __webpack_require__.r(__webpack_exports__); 109 | /* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 110 | /* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__); 111 | 112 | var scripts = document.body.getElementsByTagName("script"); 113 | scripts = Array.prototype.slice.call(scripts); 114 | scripts.forEach(function (script) { 115 | if (!script.type || !script.type.match(/math\/tex/i)) { 116 | return -1; 117 | } 118 | 119 | var display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null; 120 | var katexElement = document.createElement(display ? "div" : "span"); 121 | katexElement.setAttribute("class", display ? "equation" : "inline-equation"); 122 | 123 | try { 124 | katex__WEBPACK_IMPORTED_MODULE_0___default.a.render(script.text, katexElement, { 125 | displayMode: display 126 | }); 127 | } catch (err) { 128 | //console.error(err); linter doesn't like this 129 | katexElement.textContent = script.text; 130 | } 131 | 132 | script.parentNode.replaceChild(katexElement, script); 133 | }); 134 | 135 | /***/ }) 136 | /******/ ])["default"]; 137 | }); -------------------------------------------------------------------------------- /public/katex/v0.12.0/contrib/mathtex-script-type.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],t);else{var r="object"==typeof exports?t(require("katex")):t(e.katex);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),u=document.body.getElementsByTagName("script");(u=Array.prototype.slice.call(u)).forEach(function(e){if(!e.type||!e.type.match(/math\/tex/i))return-1;var t=null!=e.type.match(/mode\s*=\s*display(;|\s|\n|$)/),r=document.createElement(t?"div":"span");r.setAttribute("class",t?"equation":"inline-equation");try{o.a.render(e.text,r,{displayMode:t})}catch(t){r.textContent=e.text}e.parentNode.replaceChild(r,e)})}]).default}); -------------------------------------------------------------------------------- /public/katex/v0.12.0/contrib/mathtex-script-type.mjs: -------------------------------------------------------------------------------- 1 | import katex from '../katex.mjs'; 2 | 3 | let scripts = document.body.getElementsByTagName("script"); 4 | scripts = Array.prototype.slice.call(scripts); 5 | scripts.forEach(function (script) { 6 | if (!script.type || !script.type.match(/math\/tex/i)) { 7 | return -1; 8 | } 9 | 10 | const display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null; 11 | const katexElement = document.createElement(display ? "div" : "span"); 12 | katexElement.setAttribute("class", display ? "equation" : "inline-equation"); 13 | 14 | try { 15 | katex.render(script.text, katexElement, { 16 | displayMode: display 17 | }); 18 | } catch (err) { 19 | //console.error(err); linter doesn't like this 20 | katexElement.textContent = script.text; 21 | } 22 | 23 | script.parentNode.replaceChild(katexElement, script); 24 | }); 25 | -------------------------------------------------------------------------------- /public/katex/v0.12.0/contrib/render-a11y-string.min.js: -------------------------------------------------------------------------------- 1 | !function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],r);else{var t="object"==typeof exports?r(require("katex")):r(e.katex);for(var a in t)("object"==typeof exports?exports:e)[a]=t[a]}}("undefined"!=typeof self?self:this,function(e){return function(e){var r={};function t(a){if(r[a])return r[a].exports;var o=r[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,a){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:a})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(a,o,function(r){return e[r]}.bind(null,o));return a},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=1)}([function(r,t){r.exports=e},function(e,r,t){"use strict";t.r(r);var a=t(0),o=t.n(a),n={"(":"left parenthesis",")":"right parenthesis","[":"open bracket","]":"close bracket","\\{":"left brace","\\}":"right brace","\\lvert":"open vertical bar","\\rvert":"close vertical bar","|":"vertical bar","\\uparrow":"up arrow","\\Uparrow":"up arrow","\\downarrow":"down arrow","\\Downarrow":"down arrow","\\updownarrow":"up down arrow","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow","\\langle":"open angle","\\rangle":"close angle","\\lfloor":"open floor","\\rfloor":"close floor","\\int":"integral","\\intop":"integral","\\lim":"limit","\\ln":"natural log","\\log":"log","\\sin":"sine","\\cos":"cosine","\\tan":"tangent","\\cot":"cotangent","\\sum":"sum","/":"slash",",":"comma",".":"point","-":"negative","+":"plus","~":"tilde",":":"colon","?":"question mark","'":"apostrophe","\\%":"percent"," ":"space","\\ ":"space","\\$":"dollar sign","\\angle":"angle","\\degree":"degree","\\circ":"circle","\\vec":"vector","\\triangle":"triangle","\\pi":"pi","\\prime":"prime","\\infty":"infinity","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\omega":"omega","\\theta":"theta","\\sigma":"sigma","\\lambda":"lambda","\\tau":"tau","\\Delta":"delta","\\delta":"delta","\\mu":"mu","\\rho":"rho","\\nabla":"del","\\ell":"ell","\\ldots":"dots","\\hat":"hat","\\acute":"acute"},s={prime:"prime",degree:"degrees",circle:"degrees",2:"squared",3:"cubed"},i={"|":"open vertical bar",".":""},l={"|":"close vertical bar",".":""},c={"+":"plus","-":"minus","\\pm":"plus minus","\\cdot":"dot","*":"times","/":"divided by","\\times":"times","\\div":"divided by","\\circ":"circle","\\bullet":"bullet"},u={"=":"equals","\\approx":"approximately equals","\u2260":"does not equal","\\geq":"is greater than or equal to","\\ge":"is greater than or equal to","\\leq":"is less than or equal to","\\le":"is less than or equal to",">":"is greater than","<":"is less than","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow",":":"colon"},p={"\\underleftarrow":"left arrow","\\underrightarrow":"right arrow","\\underleftrightarrow":"left-right arrow","\\undergroup":"group","\\underlinesegment":"line segment","\\utilde":"tilde"},d=function(e,r,t){var a;e&&(/^\d+$/.test(a="open"===r?e in i?i[e]:n[e]||e:"close"===r?e in l?l[e]:n[e]||e:"bin"===r?c[e]||e:"rel"===r?u[e]||e:n[e]||e)&&t.length>0&&/^\d+$/.test(t[t.length-1])?t[t.length-1]+=a:a&&t.push(a))},b=function(e,r){var t=[];e.push(t),r(t)},h=function(e,r,t){switch(e.type){case"accent":b(r,function(r){f(e.base,r,t),r.push("with"),d(e.label,"normal",r),r.push("on top")});break;case"accentUnder":b(r,function(r){f(e.base,r,t),r.push("with"),d(p[e.label],"normal",r),r.push("underneath")});break;case"accent-token":break;case"atom":var a=e.text;switch(e.family){case"bin":d(a,"bin",r);break;case"close":d(a,"close",r);break;case"inner":d(e.text,"inner",r);break;case"open":d(a,"open",r);break;case"punct":d(a,"punct",r);break;case"rel":d(a,"rel",r);break;default:throw e.family,new Error('"'+e.family+'" is not a valid atom type')}break;case"color":var o=e.color.replace(/katex-/,"");b(r,function(r){r.push("start color "+o),f(e.body,r,t),r.push("end color "+o)});break;case"color-token":break;case"delimsizing":e.delim&&"."!==e.delim&&d(e.delim,"normal",r);break;case"genfrac":b(r,function(r){var a=e.leftDelim,o=e.rightDelim;e.hasBarLine?(r.push("start fraction"),a&&d(a,"open",r),f(e.numer,r,t),r.push("divided by"),f(e.denom,r,t),o&&d(o,"close",r),r.push("end fraction")):(r.push("start binomial"),a&&d(a,"open",r),f(e.numer,r,t),r.push("over"),f(e.denom,r,t),o&&d(o,"close",r),r.push("end binomial"))});break;case"kern":break;case"leftright":b(r,function(r){d(e.left,"open",r),f(e.body,r,t),d(e.right,"close",r)});break;case"leftright-right":break;case"lap":f(e.body,r,t);break;case"mathord":d(e.text,"normal",r);break;case"op":var n=e.body,i=e.name;n?f(n,r,t):i&&d(i,"normal",r);break;case"op-token":d(e.text,t,r);break;case"ordgroup":f(e.body,r,t);break;case"overline":b(r,function(r){r.push("start overline"),f(e.body,r,t),r.push("end overline")});break;case"phantom":r.push("empty space");break;case"raisebox":f(e.body,r,t);break;case"rule":r.push("rectangle");break;case"sizing":f(e.body,r,t);break;case"spacing":r.push("space");break;case"styling":f(e.body,r,t);break;case"sqrt":b(r,function(r){var a=e.body,o=e.index;if(o)return"3"===m(f(o,[],t)).join(",")?(r.push("cube root of"),f(a,r,t),void r.push("end cube root")):(r.push("root"),r.push("start index"),f(o,r,t),void r.push("end index"));r.push("square root of"),f(a,r,t),r.push("end square root")});break;case"supsub":var l=e.base,c=e.sub,u=e.sup,h=!1;if(l&&(f(l,r,t),h="op"===l.type&&"\\log"===l.name),c){var y=h?"base":"subscript";b(r,function(e){e.push("start "+y),f(c,e,t),e.push("end "+y)})}u&&b(r,function(e){var r=m(f(u,[],t)).join(",");r in s?e.push(s[r]):(e.push("start superscript"),f(u,e,t),e.push("end superscript"))});break;case"text":if("\\textbf"===e.font){b(r,function(r){r.push("start bold text"),f(e.body,r,t),r.push("end bold text")});break}b(r,function(r){r.push("start text"),f(e.body,r,t),r.push("end text")});break;case"textord":d(e.text,t,r);break;case"smash":f(e.body,r,t);break;case"enclose":if(/cancel/.test(e.label)){b(r,function(r){r.push("start cancel"),f(e.body,r,t),r.push("end cancel")});break}if(/box/.test(e.label)){b(r,function(r){r.push("start box"),f(e.body,r,t),r.push("end box")});break}if(/sout/.test(e.label)){b(r,function(r){r.push("start strikeout"),f(e.body,r,t),r.push("end strikeout")});break}throw new Error("KaTeX-a11y: enclose node with "+e.label+" not supported yet");case"vphantom":throw new Error("KaTeX-a11y: vphantom not implemented yet");case"hphantom":throw new Error("KaTeX-a11y: hphantom not implemented yet");case"operatorname":f(e.body,r,t);break;case"array":throw new Error("KaTeX-a11y: array not implemented yet");case"raw":throw new Error("KaTeX-a11y: raw not implemented yet");case"size":break;case"url":throw new Error("KaTeX-a11y: url not implemented yet");case"tag":throw new Error("KaTeX-a11y: tag not implemented yet");case"verb":d("start verbatim","normal",r),d(e.body,"normal",r),d("end verbatim","normal",r);break;case"environment":throw new Error("KaTeX-a11y: environment not implemented yet");case"horizBrace":d("start "+e.label.slice(1),"normal",r),f(e.base,r,t),d("end "+e.label.slice(1),"normal",r);break;case"infix":break;case"includegraphics":throw new Error("KaTeX-a11y: includegraphics not implemented yet");case"font":f(e.body,r,t);break;case"href":throw new Error("KaTeX-a11y: href not implemented yet");case"cr":throw new Error("KaTeX-a11y: cr not implemented yet");case"underline":b(r,function(r){r.push("start underline"),f(e.body,r,t),r.push("end underline")});break;case"xArrow":throw new Error("KaTeX-a11y: xArrow not implemented yet");case"mclass":var g=e.mclass.slice(1);f(e.body,r,g);break;case"mathchoice":f(e.text,r,t);break;case"htmlmathml":f(e.mathml,r,t);break;case"middle":d(e.delim,t,r);break;case"internal":break;case"html":f(e.body,r,t);break;default:throw e.type,new Error("KaTeX a11y un-recognized type: "+e.type)}},f=function e(r,t,a){if(void 0===t&&(t=[]),r instanceof Array)for(var o=0;o "start fraction, 1, divided by, 2, end fraction" 10 | * 11 | * However, other cases do not: 12 | * renderA11yString("f(x) = x^2") 13 | * -> "f, left parenthesis, x, right parenthesis, equals, x, squared" 14 | * 15 | * The commas in the string aim to increase ease of understanding 16 | * when read by a screenreader. 17 | */ 18 | const stringMap = { 19 | "(": "left parenthesis", 20 | ")": "right parenthesis", 21 | "[": "open bracket", 22 | "]": "close bracket", 23 | "\\{": "left brace", 24 | "\\}": "right brace", 25 | "\\lvert": "open vertical bar", 26 | "\\rvert": "close vertical bar", 27 | "|": "vertical bar", 28 | "\\uparrow": "up arrow", 29 | "\\Uparrow": "up arrow", 30 | "\\downarrow": "down arrow", 31 | "\\Downarrow": "down arrow", 32 | "\\updownarrow": "up down arrow", 33 | "\\leftarrow": "left arrow", 34 | "\\Leftarrow": "left arrow", 35 | "\\rightarrow": "right arrow", 36 | "\\Rightarrow": "right arrow", 37 | "\\langle": "open angle", 38 | "\\rangle": "close angle", 39 | "\\lfloor": "open floor", 40 | "\\rfloor": "close floor", 41 | "\\int": "integral", 42 | "\\intop": "integral", 43 | "\\lim": "limit", 44 | "\\ln": "natural log", 45 | "\\log": "log", 46 | "\\sin": "sine", 47 | "\\cos": "cosine", 48 | "\\tan": "tangent", 49 | "\\cot": "cotangent", 50 | "\\sum": "sum", 51 | "/": "slash", 52 | ",": "comma", 53 | ".": "point", 54 | "-": "negative", 55 | "+": "plus", 56 | "~": "tilde", 57 | ":": "colon", 58 | "?": "question mark", 59 | "'": "apostrophe", 60 | "\\%": "percent", 61 | " ": "space", 62 | "\\ ": "space", 63 | "\\$": "dollar sign", 64 | "\\angle": "angle", 65 | "\\degree": "degree", 66 | "\\circ": "circle", 67 | "\\vec": "vector", 68 | "\\triangle": "triangle", 69 | "\\pi": "pi", 70 | "\\prime": "prime", 71 | "\\infty": "infinity", 72 | "\\alpha": "alpha", 73 | "\\beta": "beta", 74 | "\\gamma": "gamma", 75 | "\\omega": "omega", 76 | "\\theta": "theta", 77 | "\\sigma": "sigma", 78 | "\\lambda": "lambda", 79 | "\\tau": "tau", 80 | "\\Delta": "delta", 81 | "\\delta": "delta", 82 | "\\mu": "mu", 83 | "\\rho": "rho", 84 | "\\nabla": "del", 85 | "\\ell": "ell", 86 | "\\ldots": "dots", 87 | // TODO: add entries for all accents 88 | "\\hat": "hat", 89 | "\\acute": "acute" 90 | }; 91 | const powerMap = { 92 | "prime": "prime", 93 | "degree": "degrees", 94 | "circle": "degrees", 95 | "2": "squared", 96 | "3": "cubed" 97 | }; 98 | const openMap = { 99 | "|": "open vertical bar", 100 | ".": "" 101 | }; 102 | const closeMap = { 103 | "|": "close vertical bar", 104 | ".": "" 105 | }; 106 | const binMap = { 107 | "+": "plus", 108 | "-": "minus", 109 | "\\pm": "plus minus", 110 | "\\cdot": "dot", 111 | "*": "times", 112 | "/": "divided by", 113 | "\\times": "times", 114 | "\\div": "divided by", 115 | "\\circ": "circle", 116 | "\\bullet": "bullet" 117 | }; 118 | const relMap = { 119 | "=": "equals", 120 | "\\approx": "approximately equals", 121 | "≠": "does not equal", 122 | "\\geq": "is greater than or equal to", 123 | "\\ge": "is greater than or equal to", 124 | "\\leq": "is less than or equal to", 125 | "\\le": "is less than or equal to", 126 | ">": "is greater than", 127 | "<": "is less than", 128 | "\\leftarrow": "left arrow", 129 | "\\Leftarrow": "left arrow", 130 | "\\rightarrow": "right arrow", 131 | "\\Rightarrow": "right arrow", 132 | ":": "colon" 133 | }; 134 | const accentUnderMap = { 135 | "\\underleftarrow": "left arrow", 136 | "\\underrightarrow": "right arrow", 137 | "\\underleftrightarrow": "left-right arrow", 138 | "\\undergroup": "group", 139 | "\\underlinesegment": "line segment", 140 | "\\utilde": "tilde" 141 | }; 142 | 143 | const buildString = (str, type, a11yStrings) => { 144 | if (!str) { 145 | return; 146 | } 147 | 148 | let ret; 149 | 150 | if (type === "open") { 151 | ret = str in openMap ? openMap[str] : stringMap[str] || str; 152 | } else if (type === "close") { 153 | ret = str in closeMap ? closeMap[str] : stringMap[str] || str; 154 | } else if (type === "bin") { 155 | ret = binMap[str] || str; 156 | } else if (type === "rel") { 157 | ret = relMap[str] || str; 158 | } else { 159 | ret = stringMap[str] || str; 160 | } // If the text to add is a number and there is already a string 161 | // in the list and the last string is a number then we should 162 | // combine them into a single number 163 | 164 | 165 | if (/^\d+$/.test(ret) && a11yStrings.length > 0 && // TODO(kevinb): check that the last item in a11yStrings is a string 166 | // I think we might be able to drop the nested arrays, which would make 167 | // this easier to type - $FlowFixMe 168 | /^\d+$/.test(a11yStrings[a11yStrings.length - 1])) { 169 | a11yStrings[a11yStrings.length - 1] += ret; 170 | } else if (ret) { 171 | a11yStrings.push(ret); 172 | } 173 | }; 174 | 175 | const buildRegion = (a11yStrings, callback) => { 176 | const regionStrings = []; 177 | a11yStrings.push(regionStrings); 178 | callback(regionStrings); 179 | }; 180 | 181 | const handleObject = (tree, a11yStrings, atomType) => { 182 | // Everything else is assumed to be an object... 183 | switch (tree.type) { 184 | case "accent": 185 | { 186 | buildRegion(a11yStrings, a11yStrings => { 187 | buildA11yStrings(tree.base, a11yStrings, atomType); 188 | a11yStrings.push("with"); 189 | buildString(tree.label, "normal", a11yStrings); 190 | a11yStrings.push("on top"); 191 | }); 192 | break; 193 | } 194 | 195 | case "accentUnder": 196 | { 197 | buildRegion(a11yStrings, a11yStrings => { 198 | buildA11yStrings(tree.base, a11yStrings, atomType); 199 | a11yStrings.push("with"); 200 | buildString(accentUnderMap[tree.label], "normal", a11yStrings); 201 | a11yStrings.push("underneath"); 202 | }); 203 | break; 204 | } 205 | 206 | case "accent-token": 207 | { 208 | // Used internally by accent symbols. 209 | break; 210 | } 211 | 212 | case "atom": 213 | { 214 | const text = tree.text; 215 | 216 | switch (tree.family) { 217 | case "bin": 218 | { 219 | buildString(text, "bin", a11yStrings); 220 | break; 221 | } 222 | 223 | case "close": 224 | { 225 | buildString(text, "close", a11yStrings); 226 | break; 227 | } 228 | // TODO(kevinb): figure out what should be done for inner 229 | 230 | case "inner": 231 | { 232 | buildString(tree.text, "inner", a11yStrings); 233 | break; 234 | } 235 | 236 | case "open": 237 | { 238 | buildString(text, "open", a11yStrings); 239 | break; 240 | } 241 | 242 | case "punct": 243 | { 244 | buildString(text, "punct", a11yStrings); 245 | break; 246 | } 247 | 248 | case "rel": 249 | { 250 | buildString(text, "rel", a11yStrings); 251 | break; 252 | } 253 | 254 | default: 255 | { 256 | tree.family; 257 | throw new Error(`"${tree.family}" is not a valid atom type`); 258 | } 259 | } 260 | 261 | break; 262 | } 263 | 264 | case "color": 265 | { 266 | const color = tree.color.replace(/katex-/, ""); 267 | buildRegion(a11yStrings, regionStrings => { 268 | regionStrings.push("start color " + color); 269 | buildA11yStrings(tree.body, regionStrings, atomType); 270 | regionStrings.push("end color " + color); 271 | }); 272 | break; 273 | } 274 | 275 | case "color-token": 276 | { 277 | // Used by \color, \colorbox, and \fcolorbox but not directly rendered. 278 | // It's a leaf node and has no children so just break. 279 | break; 280 | } 281 | 282 | case "delimsizing": 283 | { 284 | if (tree.delim && tree.delim !== ".") { 285 | buildString(tree.delim, "normal", a11yStrings); 286 | } 287 | 288 | break; 289 | } 290 | 291 | case "genfrac": 292 | { 293 | buildRegion(a11yStrings, regionStrings => { 294 | // genfrac can have unbalanced delimiters 295 | const leftDelim = tree.leftDelim, 296 | rightDelim = tree.rightDelim; // NOTE: Not sure if this is a safe assumption 297 | // hasBarLine true -> fraction, false -> binomial 298 | 299 | if (tree.hasBarLine) { 300 | regionStrings.push("start fraction"); 301 | leftDelim && buildString(leftDelim, "open", regionStrings); 302 | buildA11yStrings(tree.numer, regionStrings, atomType); 303 | regionStrings.push("divided by"); 304 | buildA11yStrings(tree.denom, regionStrings, atomType); 305 | rightDelim && buildString(rightDelim, "close", regionStrings); 306 | regionStrings.push("end fraction"); 307 | } else { 308 | regionStrings.push("start binomial"); 309 | leftDelim && buildString(leftDelim, "open", regionStrings); 310 | buildA11yStrings(tree.numer, regionStrings, atomType); 311 | regionStrings.push("over"); 312 | buildA11yStrings(tree.denom, regionStrings, atomType); 313 | rightDelim && buildString(rightDelim, "close", regionStrings); 314 | regionStrings.push("end binomial"); 315 | } 316 | }); 317 | break; 318 | } 319 | 320 | case "kern": 321 | { 322 | // No op: we don't attempt to present kerning information 323 | // to the screen reader. 324 | break; 325 | } 326 | 327 | case "leftright": 328 | { 329 | buildRegion(a11yStrings, regionStrings => { 330 | buildString(tree.left, "open", regionStrings); 331 | buildA11yStrings(tree.body, regionStrings, atomType); 332 | buildString(tree.right, "close", regionStrings); 333 | }); 334 | break; 335 | } 336 | 337 | case "leftright-right": 338 | { 339 | // TODO: double check that this is a no-op 340 | break; 341 | } 342 | 343 | case "lap": 344 | { 345 | buildA11yStrings(tree.body, a11yStrings, atomType); 346 | break; 347 | } 348 | 349 | case "mathord": 350 | { 351 | buildString(tree.text, "normal", a11yStrings); 352 | break; 353 | } 354 | 355 | case "op": 356 | { 357 | const body = tree.body, 358 | name = tree.name; 359 | 360 | if (body) { 361 | buildA11yStrings(body, a11yStrings, atomType); 362 | } else if (name) { 363 | buildString(name, "normal", a11yStrings); 364 | } 365 | 366 | break; 367 | } 368 | 369 | case "op-token": 370 | { 371 | // Used internally by operator symbols. 372 | buildString(tree.text, atomType, a11yStrings); 373 | break; 374 | } 375 | 376 | case "ordgroup": 377 | { 378 | buildA11yStrings(tree.body, a11yStrings, atomType); 379 | break; 380 | } 381 | 382 | case "overline": 383 | { 384 | buildRegion(a11yStrings, function (a11yStrings) { 385 | a11yStrings.push("start overline"); 386 | buildA11yStrings(tree.body, a11yStrings, atomType); 387 | a11yStrings.push("end overline"); 388 | }); 389 | break; 390 | } 391 | 392 | case "phantom": 393 | { 394 | a11yStrings.push("empty space"); 395 | break; 396 | } 397 | 398 | case "raisebox": 399 | { 400 | buildA11yStrings(tree.body, a11yStrings, atomType); 401 | break; 402 | } 403 | 404 | case "rule": 405 | { 406 | a11yStrings.push("rectangle"); 407 | break; 408 | } 409 | 410 | case "sizing": 411 | { 412 | buildA11yStrings(tree.body, a11yStrings, atomType); 413 | break; 414 | } 415 | 416 | case "spacing": 417 | { 418 | a11yStrings.push("space"); 419 | break; 420 | } 421 | 422 | case "styling": 423 | { 424 | // We ignore the styling and just pass through the contents 425 | buildA11yStrings(tree.body, a11yStrings, atomType); 426 | break; 427 | } 428 | 429 | case "sqrt": 430 | { 431 | buildRegion(a11yStrings, regionStrings => { 432 | const body = tree.body, 433 | index = tree.index; 434 | 435 | if (index) { 436 | const indexString = flatten(buildA11yStrings(index, [], atomType)).join(","); 437 | 438 | if (indexString === "3") { 439 | regionStrings.push("cube root of"); 440 | buildA11yStrings(body, regionStrings, atomType); 441 | regionStrings.push("end cube root"); 442 | return; 443 | } 444 | 445 | regionStrings.push("root"); 446 | regionStrings.push("start index"); 447 | buildA11yStrings(index, regionStrings, atomType); 448 | regionStrings.push("end index"); 449 | return; 450 | } 451 | 452 | regionStrings.push("square root of"); 453 | buildA11yStrings(body, regionStrings, atomType); 454 | regionStrings.push("end square root"); 455 | }); 456 | break; 457 | } 458 | 459 | case "supsub": 460 | { 461 | const base = tree.base, 462 | sub = tree.sub, 463 | sup = tree.sup; 464 | let isLog = false; 465 | 466 | if (base) { 467 | buildA11yStrings(base, a11yStrings, atomType); 468 | isLog = base.type === "op" && base.name === "\\log"; 469 | } 470 | 471 | if (sub) { 472 | const regionName = isLog ? "base" : "subscript"; 473 | buildRegion(a11yStrings, function (regionStrings) { 474 | regionStrings.push(`start ${regionName}`); 475 | buildA11yStrings(sub, regionStrings, atomType); 476 | regionStrings.push(`end ${regionName}`); 477 | }); 478 | } 479 | 480 | if (sup) { 481 | buildRegion(a11yStrings, function (regionStrings) { 482 | const supString = flatten(buildA11yStrings(sup, [], atomType)).join(","); 483 | 484 | if (supString in powerMap) { 485 | regionStrings.push(powerMap[supString]); 486 | return; 487 | } 488 | 489 | regionStrings.push("start superscript"); 490 | buildA11yStrings(sup, regionStrings, atomType); 491 | regionStrings.push("end superscript"); 492 | }); 493 | } 494 | 495 | break; 496 | } 497 | 498 | case "text": 499 | { 500 | // TODO: handle other fonts 501 | if (tree.font === "\\textbf") { 502 | buildRegion(a11yStrings, function (regionStrings) { 503 | regionStrings.push("start bold text"); 504 | buildA11yStrings(tree.body, regionStrings, atomType); 505 | regionStrings.push("end bold text"); 506 | }); 507 | break; 508 | } 509 | 510 | buildRegion(a11yStrings, function (regionStrings) { 511 | regionStrings.push("start text"); 512 | buildA11yStrings(tree.body, regionStrings, atomType); 513 | regionStrings.push("end text"); 514 | }); 515 | break; 516 | } 517 | 518 | case "textord": 519 | { 520 | buildString(tree.text, atomType, a11yStrings); 521 | break; 522 | } 523 | 524 | case "smash": 525 | { 526 | buildA11yStrings(tree.body, a11yStrings, atomType); 527 | break; 528 | } 529 | 530 | case "enclose": 531 | { 532 | // TODO: create a map for these. 533 | // TODO: differentiate between a body with a single atom, e.g. 534 | // "cancel a" instead of "start cancel, a, end cancel" 535 | if (/cancel/.test(tree.label)) { 536 | buildRegion(a11yStrings, function (regionStrings) { 537 | regionStrings.push("start cancel"); 538 | buildA11yStrings(tree.body, regionStrings, atomType); 539 | regionStrings.push("end cancel"); 540 | }); 541 | break; 542 | } else if (/box/.test(tree.label)) { 543 | buildRegion(a11yStrings, function (regionStrings) { 544 | regionStrings.push("start box"); 545 | buildA11yStrings(tree.body, regionStrings, atomType); 546 | regionStrings.push("end box"); 547 | }); 548 | break; 549 | } else if (/sout/.test(tree.label)) { 550 | buildRegion(a11yStrings, function (regionStrings) { 551 | regionStrings.push("start strikeout"); 552 | buildA11yStrings(tree.body, regionStrings, atomType); 553 | regionStrings.push("end strikeout"); 554 | }); 555 | break; 556 | } 557 | 558 | throw new Error(`KaTeX-a11y: enclose node with ${tree.label} not supported yet`); 559 | } 560 | 561 | case "vphantom": 562 | { 563 | throw new Error("KaTeX-a11y: vphantom not implemented yet"); 564 | } 565 | 566 | case "hphantom": 567 | { 568 | throw new Error("KaTeX-a11y: hphantom not implemented yet"); 569 | } 570 | 571 | case "operatorname": 572 | { 573 | buildA11yStrings(tree.body, a11yStrings, atomType); 574 | break; 575 | } 576 | 577 | case "array": 578 | { 579 | throw new Error("KaTeX-a11y: array not implemented yet"); 580 | } 581 | 582 | case "raw": 583 | { 584 | throw new Error("KaTeX-a11y: raw not implemented yet"); 585 | } 586 | 587 | case "size": 588 | { 589 | // Although there are nodes of type "size" in the parse tree, they have 590 | // no semantic meaning and should be ignored. 591 | break; 592 | } 593 | 594 | case "url": 595 | { 596 | throw new Error("KaTeX-a11y: url not implemented yet"); 597 | } 598 | 599 | case "tag": 600 | { 601 | throw new Error("KaTeX-a11y: tag not implemented yet"); 602 | } 603 | 604 | case "verb": 605 | { 606 | buildString(`start verbatim`, "normal", a11yStrings); 607 | buildString(tree.body, "normal", a11yStrings); 608 | buildString(`end verbatim`, "normal", a11yStrings); 609 | break; 610 | } 611 | 612 | case "environment": 613 | { 614 | throw new Error("KaTeX-a11y: environment not implemented yet"); 615 | } 616 | 617 | case "horizBrace": 618 | { 619 | buildString(`start ${tree.label.slice(1)}`, "normal", a11yStrings); 620 | buildA11yStrings(tree.base, a11yStrings, atomType); 621 | buildString(`end ${tree.label.slice(1)}`, "normal", a11yStrings); 622 | break; 623 | } 624 | 625 | case "infix": 626 | { 627 | // All infix nodes are replace with other nodes. 628 | break; 629 | } 630 | 631 | case "includegraphics": 632 | { 633 | throw new Error("KaTeX-a11y: includegraphics not implemented yet"); 634 | } 635 | 636 | case "font": 637 | { 638 | // TODO: callout the start/end of specific fonts 639 | // TODO: map \BBb{N} to "the naturals" or something like that 640 | buildA11yStrings(tree.body, a11yStrings, atomType); 641 | break; 642 | } 643 | 644 | case "href": 645 | { 646 | throw new Error("KaTeX-a11y: href not implemented yet"); 647 | } 648 | 649 | case "cr": 650 | { 651 | // This is used by environments. 652 | throw new Error("KaTeX-a11y: cr not implemented yet"); 653 | } 654 | 655 | case "underline": 656 | { 657 | buildRegion(a11yStrings, function (a11yStrings) { 658 | a11yStrings.push("start underline"); 659 | buildA11yStrings(tree.body, a11yStrings, atomType); 660 | a11yStrings.push("end underline"); 661 | }); 662 | break; 663 | } 664 | 665 | case "xArrow": 666 | { 667 | throw new Error("KaTeX-a11y: xArrow not implemented yet"); 668 | } 669 | 670 | case "mclass": 671 | { 672 | // \neq and \ne are macros so we let "htmlmathml" render the mathmal 673 | // side of things and extract the text from that. 674 | const atomType = tree.mclass.slice(1); // $FlowFixMe: drop the leading "m" from the values in mclass 675 | 676 | buildA11yStrings(tree.body, a11yStrings, atomType); 677 | break; 678 | } 679 | 680 | case "mathchoice": 681 | { 682 | // TODO: track which which style we're using, e.g. dispaly, text, etc. 683 | // default to text style if even that may not be the correct style 684 | buildA11yStrings(tree.text, a11yStrings, atomType); 685 | break; 686 | } 687 | 688 | case "htmlmathml": 689 | { 690 | buildA11yStrings(tree.mathml, a11yStrings, atomType); 691 | break; 692 | } 693 | 694 | case "middle": 695 | { 696 | buildString(tree.delim, atomType, a11yStrings); 697 | break; 698 | } 699 | 700 | case "internal": 701 | { 702 | // internal nodes are never included in the parse tree 703 | break; 704 | } 705 | 706 | case "html": 707 | { 708 | buildA11yStrings(tree.body, a11yStrings, atomType); 709 | break; 710 | } 711 | 712 | default: 713 | tree.type; 714 | throw new Error("KaTeX a11y un-recognized type: " + tree.type); 715 | } 716 | }; 717 | 718 | const buildA11yStrings = function buildA11yStrings(tree, a11yStrings, atomType) { 719 | if (a11yStrings === void 0) { 720 | a11yStrings = []; 721 | } 722 | 723 | if (tree instanceof Array) { 724 | for (let i = 0; i < tree.length; i++) { 725 | buildA11yStrings(tree[i], a11yStrings, atomType); 726 | } 727 | } else { 728 | handleObject(tree, a11yStrings, atomType); 729 | } 730 | 731 | return a11yStrings; 732 | }; 733 | 734 | const flatten = function flatten(array) { 735 | let result = []; 736 | array.forEach(function (item) { 737 | if (item instanceof Array) { 738 | result = result.concat(flatten(item)); 739 | } else { 740 | result.push(item); 741 | } 742 | }); 743 | return result; 744 | }; 745 | 746 | const renderA11yString = function renderA11yString(text, settings) { 747 | const tree = katex.__parse(text, settings); 748 | 749 | const a11yStrings = buildA11yStrings(tree, [], "normal"); 750 | return flatten(a11yStrings).join(", "); 751 | }; 752 | 753 | export default renderA11yString; 754 | -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_AMS-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_AMS-Regular.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_AMS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_AMS-Regular.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Caligraphic-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Caligraphic-Bold.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Caligraphic-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Caligraphic-Bold.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Caligraphic-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Caligraphic-Bold.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Caligraphic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Caligraphic-Regular.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Caligraphic-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Caligraphic-Regular.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Caligraphic-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Caligraphic-Regular.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Fraktur-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Fraktur-Bold.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Fraktur-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Fraktur-Bold.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Fraktur-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Fraktur-Bold.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Fraktur-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Fraktur-Regular.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Fraktur-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Fraktur-Regular.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Fraktur-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Fraktur-Regular.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Main-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Main-Bold.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Main-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Main-Bold.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Main-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Main-BoldItalic.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Main-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Main-BoldItalic.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Main-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Main-BoldItalic.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Main-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Main-Italic.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Main-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Main-Italic.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Main-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Main-Regular.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Main-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Main-Regular.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Math-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Math-BoldItalic.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Math-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Math-BoldItalic.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Math-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Math-Italic.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Math-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Math-Italic.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_SansSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_SansSerif-Bold.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_SansSerif-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_SansSerif-Bold.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_SansSerif-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_SansSerif-Bold.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_SansSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_SansSerif-Italic.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_SansSerif-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_SansSerif-Italic.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_SansSerif-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_SansSerif-Italic.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_SansSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_SansSerif-Regular.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_SansSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_SansSerif-Regular.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_SansSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_SansSerif-Regular.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Script-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Script-Regular.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Script-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Script-Regular.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Script-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Script-Regular.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Size1-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Size1-Regular.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Size1-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Size1-Regular.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Size2-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Size2-Regular.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Size2-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Size2-Regular.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Size3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Size3-Regular.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Size3-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Size3-Regular.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Size4-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Size4-Regular.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Size4-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Size4-Regular.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Typewriter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Typewriter-Regular.ttf -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Typewriter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Typewriter-Regular.woff -------------------------------------------------------------------------------- /public/katex/v0.12.0/fonts/KaTeX_Typewriter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/standardnotes/code-pro/fa4479a7c52a98db8752a03147dec01a98eb4679/public/katex/v0.12.0/fonts/KaTeX_Typewriter-Regular.woff2 -------------------------------------------------------------------------------- /public/katex/v0.12.0/katex.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:KaTeX_AMS;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype");font-weight:700;font-style:italic}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype");font-weight:400;font-style:italic}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype");font-weight:700;font-style:italic}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype");font-weight:400;font-style:italic}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype");font-weight:400;font-style:italic}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Script;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size1;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size2;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size3;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size4;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Typewriter;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype");font-weight:400;font-style:normal}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto;border-color:currentColor}.katex *{-ms-high-contrast-adjust:none!important}.katex .katex-version:after{content:"0.12.0"}.katex .katex-mathml{position:absolute;clip:rect(1px,1px,1px,1px);padding:0;border:0;height:1px;width:1px;overflow:hidden}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-weight:700;font-style:italic}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{display:inline-table;table-layout:fixed;border-collapse:collapse}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;vertical-align:bottom;position:relative}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;vertical-align:bottom;font-size:1px;width:2px;min-width:2px}.katex .vbox{-ms-flex-direction:column;flex-direction:column;align-items:baseline}.katex .hbox,.katex .vbox{display:-ms-inline-flexbox;display:inline-flex}.katex .hbox{-ms-flex-direction:row;flex-direction:row;width:100%}.katex .thinbox{display:inline-flex;flex-direction:row;width:0;max-width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{display:inline-block;width:100%;border-bottom-style:solid}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{width:0;position:relative}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{display:inline-block;border:0 solid;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{display:inline-block;width:100%;border-bottom-style:solid}.katex .hdashline{display:inline-block;width:100%;border-bottom-style:dashed}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .op-limits>.vlist-t{text-align:center}.katex .accent>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{display:block;position:absolute;width:100%;height:inherit;fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex svg path{stroke:none}.katex img{border-style:none;min-width:0;min-height:0;max-width:none;max-height:none}.katex .stretchy{width:100%;display:block;position:relative;overflow:hidden}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{width:100%;position:relative;overflow:hidden}.katex .halfarrow-left{position:absolute;left:0;width:50.2%;overflow:hidden}.katex .halfarrow-right{position:absolute;right:0;width:50.2%;overflow:hidden}.katex .brace-left{position:absolute;left:0;width:25.1%;overflow:hidden}.katex .brace-center{position:absolute;left:25%;width:50%;overflow:hidden}.katex .brace-right{position:absolute;right:0;width:25.1%;overflow:hidden}.katex .x-arrow-pad{padding:0 .5em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{box-sizing:border-box;border:.04em solid}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{text-align:left;padding-left:2em} 2 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Code Pro", 3 | "name": "Code Pro Editor for Standard Notes", 4 | "icons": [ 5 | { 6 | "src": "ic-code-tags-16.png", 7 | "sizes": "16x16", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "ic-code-tags-24.png", 12 | "sizes": "24x24", 13 | "type": "image/png" 14 | }, 15 | { 16 | "src": "ic-code-tags-32.png", 17 | "sizes": "32x32", 18 | "type": "image/png" 19 | }, 20 | { 21 | "src": "ic-code-tags-64.png", 22 | "type": "image/png", 23 | "sizes": "64x64" 24 | }, 25 | { 26 | "src": "ic-code-tags-192.png", 27 | "sizes": "192x192", 28 | "type": "image/png" 29 | }, 30 | { 31 | "src": "ic-code-tags-512.png", 32 | "sizes": "512x512", 33 | "type": "image/png" 34 | } 35 | ], 36 | "start_url": ".", 37 | "display": "standalone", 38 | "theme_color": "#000000", 39 | "background_color": "#ffffff" 40 | } 41 | -------------------------------------------------------------------------------- /public/monaco/ts.worker.bundle.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | -------------------------------------------------------------------------------- /public/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code-pro", 3 | "version": "0.1.0-beta.2", 4 | "description": "Code Pro is a code editor for Standard Notes powered by the Monaco Editor", 5 | "keywords": [ 6 | "Standard Notes", 7 | "Standard Notes Extensions", 8 | "Monaco Editor" 9 | ], 10 | "private": true, 11 | "license": "AGPL-3.0-or-later", 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/standardnotes/code-pro.git" 15 | }, 16 | "bugs": { 17 | "url": "https://github.com/standardnotes/code-pro/issues" 18 | }, 19 | "sn": { 20 | "main": "index.html" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: / 4 | -------------------------------------------------------------------------------- /public/sample.ext.json: -------------------------------------------------------------------------------- 1 | { 2 | "identifier": "org.standardnotes.editor-template-cra-typescript", 3 | "name": "Code Pro", 4 | "content_type": "SN|Component", 5 | "area": "editor-editor", 6 | "version": "0.1.0", 7 | "description": "Code Pro is a code editor for Standard Notes powered by the Monaco Editor", 8 | "url": "http://localhost:3000/index.html", 9 | "download_url": "", 10 | "latest_url": "", 11 | "marketing_url": "https://github.com/standardnotes/code-pro", 12 | "thumbnail_url": "" 13 | } 14 | -------------------------------------------------------------------------------- /src/Editor.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render, screen } from '@testing-library/react'; 3 | import Editor from './components/Editor'; 4 | 5 | test('renders Standard Notes documentation link', () => { 6 | render(); 7 | const linkElement = screen.getByText(/Standard Notes documentation/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /src/components/ErrorBoundary.tsx: -------------------------------------------------------------------------------- 1 | import React, { ErrorInfo } from 'react'; 2 | 3 | interface ErrorBoundaryState { 4 | hasError: boolean; 5 | error?: Error; 6 | errorInfo?: ErrorInfo; 7 | } 8 | 9 | /** 10 | * Learn more about Error Boundaries here: 11 | * https://reactjs.org/docs/error-boundaries.html 12 | */ 13 | 14 | export default class ErrorBoundary extends React.Component< 15 | any, 16 | ErrorBoundaryState 17 | > { 18 | constructor(props: any) { 19 | super(props); 20 | this.state = { hasError: false }; 21 | } 22 | 23 | static getDerivedStateFromError(error: Error) { 24 | // Update state so the next render will show the fallback UI. 25 | return { hasError: true }; 26 | } 27 | 28 | componentDidCatch(error: Error, errorInfo: ErrorInfo) { 29 | // You can also log the error to an error reporting service 30 | console.error('Error:', error, '\nError Info:', errorInfo); 31 | this.setState({ 32 | error, 33 | errorInfo, 34 | }); 35 | } 36 | 37 | render() { 38 | if (this.state.hasError) { 39 | // You can render any custom fallback UI 40 | return ( 41 |
42 |

Something went wrong.

43 |

44 | Error Name: {this.state.error?.name} 45 |

46 |

47 | Error Message: {this.state.error?.message} 48 |

49 |

50 | Error Info: {this.state.errorInfo} 51 |

52 |

Please see the developer console for details.

53 |
54 |

55 | If the error persists and is not related to the content of your 56 | note, then please{' '} 57 | 62 | report the issue on GitHub 63 | {' '} 64 | and we will try to fix it. 65 |

66 |
67 | ); 68 | } 69 | 70 | return this.props.children; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/components/Icons.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const infoColor = 'var(--sn-stylekit-info-color)'; 4 | const foregroundColor = 'var(--sn-stylekit-foreground-color)'; 5 | 6 | interface Icons { 7 | condition?: boolean; 8 | fill?: string; 9 | role: string; 10 | } 11 | 12 | export const ChevronIconDown: React.FC = ({ fill, role }) => ( 13 | 14 | 23 | 27 | 28 | 29 | ); 30 | 31 | export const ChevronIconRight: React.FC = ({ fill, role }) => ( 32 | 33 | 42 | 46 | 47 | 48 | ); 49 | 50 | export const CloseIcon: React.FC = ({ fill, role }) => ( 51 | 60 | 64 | 65 | ); 66 | 67 | export const EyeIcon: React.FC = ({ condition, fill, role }) => ( 68 | 77 | 81 | 82 | ); 83 | 84 | export const GearIcon: React.FC = ({ condition, fill, role }) => ( 85 | 94 | 98 | 99 | ); 100 | 101 | export const PencilIcon: React.FC = ({ condition, fill, role }) => ( 102 | 111 | 115 | 116 | ); 117 | 118 | export const PrintIcon: React.FC = ({ fill, role }) => ( 119 | 128 | 132 | 133 | ); 134 | 135 | export const RefreshIcon: React.FC = ({ fill, role }) => ( 136 | 145 | 149 | 150 | ); 151 | 152 | export const SaveIcon: React.FC = ({ fill, role }) => ( 153 | 154 | 163 | 167 | 168 | 169 | ); 170 | 171 | export const UndoIcon: React.FC = ({ fill, role }) => ( 172 | 181 | 185 | 186 | ); 187 | 188 | export const WindowIcon: React.FC = ({ fill, role }) => ( 189 | 190 | 199 | 203 | 204 | 205 | ); 206 | -------------------------------------------------------------------------------- /src/components/PrintDialog.tsx: -------------------------------------------------------------------------------- 1 | // import { Method } from '@testing-library/react'; 2 | import React from 'react'; 3 | import { CloseIcon } from './Icons'; 4 | import { HtmlElementId } from './Editor'; 5 | 6 | interface PrintDialogTypes { 7 | cancelText: string; 8 | confirmText: string; 9 | helpLink: string; 10 | onCancel: () => void; 11 | onConfirm: () => void; 12 | onUndo: () => void; 13 | title: string; 14 | } 15 | 16 | const PrintDialog: React.FC = ({ 17 | cancelText, 18 | confirmText, 19 | helpLink, 20 | onCancel, 21 | onConfirm, 22 | onUndo, 23 | title, 24 | }) => ( 25 |
26 |
27 |
28 |
29 |
30 |

{title}

31 | 41 |
42 |

43 | Need help deciding? Check out the{' '} 44 | 45 | documentation 46 | 47 | . 48 |

49 |
50 |
51 |
52 |
53 | 56 | 59 |
60 |
61 |
62 |
63 | ); 64 | 65 | export default PrintDialog; 66 | -------------------------------------------------------------------------------- /src/components/Settings.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { 3 | ChevronIconDown, 4 | ChevronIconRight, 5 | EyeIcon, 6 | PencilIcon, 7 | PrintIcon, 8 | RefreshIcon, 9 | SaveIcon, 10 | WindowIcon, 11 | } from './Icons'; 12 | 13 | import { HtmlElementId, SettingsInterface } from './Editor'; 14 | 15 | interface SettingsProps extends SettingsInterface { 16 | confirmPrintUrl: () => void; 17 | debugMode: boolean; 18 | editMode: boolean; 19 | handleInputChange: (event: React.ChangeEvent) => void; 20 | handleSelectChange: (event: React.ChangeEvent) => void; 21 | loadDefaultSettings: (callback: () => void) => void; 22 | refreshEditor: () => void; 23 | saveSettings: () => void; 24 | saveDefaultSettings: () => void; 25 | showSettings: boolean; 26 | toggleEditMode: () => void; 27 | toggleShowSettings: () => void; 28 | toggleViewMode: () => void; 29 | viewMode: boolean; 30 | } 31 | 32 | interface SettingsState { 33 | [x: string]: string | number | boolean; 34 | } 35 | 36 | export default class Settings extends React.Component< 37 | SettingsProps, 38 | SettingsState 39 | > { 40 | constructor(props: SettingsProps) { 41 | super(props); 42 | this.state = {}; 43 | } 44 | 45 | onFocus = () => { 46 | const settings = document.getElementById(HtmlElementId.settings); 47 | if (settings) { 48 | settings.classList.add('focused'); 49 | } 50 | }; 51 | 52 | onBlur = () => { 53 | const settings = document.getElementById(HtmlElementId.settings); 54 | if (settings) { 55 | settings.classList.remove('focused'); 56 | } 57 | }; 58 | 59 | loadDefaultSettings = () => { 60 | const callback = () => { 61 | /** Save settings after loading the default settings */ 62 | this.props.saveSettings(); 63 | }; 64 | this.props.loadDefaultSettings(callback); 65 | }; 66 | 67 | render() { 68 | return ( 69 |
75 |
76 | 85 | 94 | 103 | 112 | {!this.props.showSettings && ( 113 | 121 | )} 122 | {this.props.showSettings && ( 123 | 131 | )} 132 |
133 | {this.props.showSettings && [ 134 |
135 | 141 |
142 | 220 |
221 |
, 222 |
223 | 229 |
230 | 253 |
254 |
, 255 |
256 | 264 |
265 | 277 |
278 |
, 279 |
280 | 286 |
287 | 297 |
298 |
, 299 |
300 | 306 |
307 | 319 |
320 |
, 321 |
322 | 328 |
329 | 340 |
341 |
, 342 | ]} 343 |
344 | {this.props.showSettings && [ 345 | , 354 | , 363 | ]} 364 |
365 |
366 | ); 367 | } 368 | } 369 | -------------------------------------------------------------------------------- /src/index.scss: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.scss'; 4 | import reportWebVitals from './reportWebVitals'; 5 | 6 | import Editor from './components/Editor'; 7 | import './stylesheets/main.scss'; 8 | ReactDOM.render( 9 | 10 | 11 | , 12 | document.getElementById('root') 13 | ); 14 | 15 | // If you want to start measuring performance in your app, pass a function 16 | // to log results (for example: reportWebVitals(console.log)) 17 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 18 | reportWebVitals(); 19 | -------------------------------------------------------------------------------- /src/lib/makePrettier.ts: -------------------------------------------------------------------------------- 1 | /** Prettier */ 2 | import prettier from 'prettier'; 3 | import parserBabel from 'prettier/parser-babel'; 4 | import parserCss from 'prettier/parser-postcss'; 5 | import parserGraphql from 'prettier/parser-graphql'; 6 | import parserHtml from 'prettier/parser-html'; 7 | import parserMarkdown from 'prettier/parser-markdown'; 8 | import parserTypescript from 'prettier/parser-typescript'; 9 | import parserYaml from 'prettier/parser-yaml'; 10 | 11 | /** Make Prettier */ 12 | export const makePrettier = (language: string, text: string) => { 13 | try { 14 | if (language === 'css') { 15 | const formattedText = prettier.format(text, { 16 | parser: 'css', 17 | plugins: [parserCss], 18 | }); 19 | return formattedText; 20 | } else if (language === 'graphql') { 21 | const formattedText = prettier.format(text, { 22 | parser: 'graphql', 23 | plugins: [parserGraphql], 24 | }); 25 | return formattedText; 26 | } else if (language === 'markdown') { 27 | const formattedText = prettier.format(text, { 28 | parser: 'markdown', 29 | plugins: [parserMarkdown], 30 | }); 31 | return formattedText; 32 | } else if (language === 'html') { 33 | const formattedText = prettier.format(text, { 34 | parser: 'html', 35 | plugins: [parserHtml], 36 | }); 37 | return formattedText; 38 | } else if (language === 'javascript') { 39 | const formattedText = prettier.format(text, { 40 | parser: 'babel', 41 | plugins: [parserBabel], 42 | }); 43 | return formattedText; 44 | } else if (language === 'less') { 45 | const formattedText = prettier.format(text, { 46 | parser: 'less', 47 | plugins: [parserCss], 48 | }); 49 | return formattedText; 50 | } else if (language === 'typescript') { 51 | const formattedText = prettier.format(text, { 52 | parser: 'typescript', 53 | plugins: [parserTypescript], 54 | }); 55 | return formattedText; 56 | } else if (language === 'scss') { 57 | const formattedText = prettier.format(text, { 58 | parser: 'scss', 59 | plugins: [parserCss], 60 | }); 61 | return formattedText; 62 | } else if (language === 'yaml') { 63 | const formattedText = prettier.format(text, { 64 | parser: 'yaml', 65 | plugins: [parserYaml], 66 | }); 67 | return formattedText; 68 | } 69 | } catch (error) { 70 | console.error('Error formatting code:', error); 71 | } 72 | }; 73 | -------------------------------------------------------------------------------- /src/lib/renderMarkdown.ts: -------------------------------------------------------------------------------- 1 | import React, { ReactNode } from 'react'; 2 | import unified from 'unified'; 3 | import parse from 'remark-parse'; 4 | import remark2rehype from 'remark-rehype'; 5 | import rehype2react from 'rehype-react'; 6 | import { debounce } from 'lodash'; 7 | 8 | // Remark 9 | const breaks = require('remark-breaks'); 10 | const externalLinks = require('remark-external-links'); 11 | const footnotes = require('remark-footnotes'); 12 | const gfm = require('remark-gfm'); 13 | const gemoji = require('remark-gemoji'); 14 | const math = require('remark-math'); 15 | const slug = require('remark-slug'); 16 | const toc = require('remark-toc'); 17 | 18 | // Rehype 19 | const highlight = require('rehype-highlight'); 20 | const rehypeKatex = require('rehype-katex'); 21 | const raw = require('rehype-raw'); 22 | 23 | const processor = unified() 24 | .use(parse) 25 | .use(gfm) 26 | .use(breaks) 27 | .use(slug) 28 | .use(toc, { maxDepth: 6 }) 29 | .use(externalLinks) 30 | .use(footnotes, { inlineNotes: true }) 31 | .use(gemoji) 32 | .use(remark2rehype, { allowDangerousHtml: true }) 33 | .use(raw) 34 | .use(math) 35 | .use(rehypeKatex) 36 | .use(highlight, { ignoreMissing: true }) 37 | .use(rehype2react, { createElement: React.createElement }); 38 | 39 | export const processMarkdown = (text: string) => { 40 | //console.log('processedMarkdown'); 41 | const markdown = processor.processSync(text).result as ReactNode; 42 | return markdown; 43 | }; 44 | 45 | /** Debounce the rendering of markdown to prevent lag 46 | * when rendering long notes or lots of Markdown or KaTeX */ 47 | export const renderMarkdown = debounce((text: string): React.ReactNode => { 48 | //console.log('renderMarkdown', text.substring(0, 10)); 49 | const markdown = processMarkdown(text); 50 | return markdown; 51 | }, 500); 52 | 53 | export const getCodeText = (language: string, text: string): string => { 54 | if (language !== 'markdown' && language !== 'html' && text) { 55 | return '```' + language + '\n' + text + '\n```'; 56 | } else { 57 | return text; 58 | } 59 | }; 60 | -------------------------------------------------------------------------------- /src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals'; 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry); 7 | getFID(onPerfEntry); 8 | getFCP(onPerfEntry); 9 | getLCP(onPerfEntry); 10 | getTTFB(onPerfEntry); 11 | }); 12 | } 13 | }; 14 | 15 | export default reportWebVitals; 16 | -------------------------------------------------------------------------------- /src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /src/stylesheets/dark.scss: -------------------------------------------------------------------------------- 1 | @media (prefers-color-scheme: dark) { 2 | // This is the Midnight theme available here: 3 | // https://github.com/sn-extensions/midnight-theme 4 | // Licensed under AGPL-3.0 5 | :root { 6 | --primary-bg-color: #292937; 7 | --secondary-bg-color: #313142; 8 | --editor-bg-color: #202020; 9 | --border-color: #13131a; 10 | --ui-text-color: #d8d8d8; 11 | 12 | --sn-stylekit-info-color: #086dd6; 13 | --sn-stylekit-info-contrast-color: white; 14 | 15 | --sn-stylekit-neutral-color: #7c7c7c; 16 | --sn-stylekit-neutral-contrast-color: white; 17 | 18 | --sn-stylekit-success-color: #2b9612; 19 | --sn-stylekit-success-contrast-color: white; 20 | 21 | --sn-stylekit-warning-color: #f6a200; 22 | --sn-stylekit-warning-contrast-color: white; 23 | 24 | --sn-stylekit-danger-color: #f80324; 25 | --sn-stylekit-danger-contrast-color: white; 26 | 27 | --sn-desktop-titlebar-bg-color: var(--primary-bg-color); 28 | --sn-desktop-titlebar-border-color: var(--border-color); 29 | --sn-desktop-titlebar-ui-color: var(--ui-text-color); 30 | --sn-desktop-titlebar-ui-hover-color: var(--sn-stylekit-info-color); 31 | 32 | // StyleKit Vars 33 | --sn-stylekit-shadow-color: #20202b; 34 | 35 | --sn-stylekit-background-color: #20202b; 36 | --sn-stylekit-border-color: var(--border-color); 37 | --sn-stylekit-foreground-color: var(--ui-text-color); 38 | 39 | --sn-stylekit-contrast-background-color: var(--secondary-bg-color); 40 | --sn-stylekit-contrast-foreground-color: var(--ui-text-color); 41 | --sn-stylekit-contrast-border-color: var(--border-color); 42 | 43 | --sn-stylekit-secondary-background-color: #292937; 44 | --sn-stylekit-secondary-foreground-color: var(--ui-text-color); 45 | --sn-stylekit-secondary-border-color: var(--border-color); 46 | 47 | --sn-stylekit-secondary-contrast-background-color: #45445a; 48 | --sn-stylekit-secondary-contrast-foreground-color: var(--ui-text-color); 49 | --sn-stylekit-secondary-contrast-border-color: var(--border-color); 50 | 51 | --sn-stylekit-editor-background-color: var(--sn-stylekit-background-color); 52 | --sn-stylekit-editor-foreground-color: var(--sn-stylekit-foreground-color); 53 | 54 | --sn-stylekit-paragraph-text-color: var(--ui-text-color); 55 | 56 | --sn-stylekit-scrollbar-track-border-color: var(--border-color); 57 | --sn-stylekit-scrollbar-thumb-color: var(--sn-stylekit-info-color); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/stylesheets/main.scss: -------------------------------------------------------------------------------- 1 | @import '~sn-stylekit/dist/stylekit.css'; 2 | @import '~highlight.js/scss/vs.scss'; 3 | 4 | :root { 5 | --sn-stylekit-font-size-editor: 16px; 6 | --sn-stylekit-monospace-font: SFMono-Regular, Consolas, Liberation Mono, Menlo, 7 | 'Ubuntu Mono', 'Courier New', monospace; 8 | } 9 | 10 | body, 11 | html { 12 | background-color: transparent; 13 | background-color: var(--sn-stylekit-background-color); 14 | font-family: var(--sn-stylekit-sans-serif-font); 15 | font-size: var(--sn-stylekit-base-font-size); 16 | height: 100%; 17 | margin: 0; 18 | padding: 0; 19 | width: 100%; 20 | /* This is used to prevent KaTeX from overflowing the page */ 21 | overflow-y: hidden; 22 | } 23 | 24 | * { 25 | // To prevent gray flash when focusing input on mobile Safari 26 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 27 | } 28 | 29 | .sn-component { 30 | display: flex; 31 | flex-direction: column; 32 | font-size: var(--sn-stylekit-font-size-editor); 33 | min-height: 100vh; 34 | @media screen and (max-width: 420px) { 35 | min-height: -webkit-fill-available; 36 | } 37 | &.vs { 38 | background-color: #fffffe; 39 | .settings { 40 | color: #000000; 41 | } 42 | } 43 | &.vs-dark { 44 | background-color: #1e1e1e; 45 | .settings { 46 | color: #d4d4d4; 47 | } 48 | } 49 | &.hc-black { 50 | background-color: #000000; 51 | .settings { 52 | color: #ffffff; 53 | } 54 | } 55 | } 56 | 57 | /* Content */ 58 | #contentContainer { 59 | display: flex; 60 | flex-direction: row; 61 | &.editMode { 62 | .MonacoEditorContainerParentDiv { 63 | width: 100%; 64 | } 65 | } 66 | &.viewMode { 67 | #viewContainer { 68 | width: 100%; 69 | } 70 | } 71 | &.editMode.viewMode { 72 | .MonacoEditorContainerParentDiv, 73 | #viewContainer { 74 | width: 50%; 75 | } 76 | } 77 | height: var(--heightVar); 78 | /* Needs both max and min for the MonacoEditorContainerParentDiv */ 79 | max-height: var(--heightVar); 80 | min-height: var(--heightVar); 81 | --heightVar: calc(100vh - 2em); 82 | @media screen and (max-width: 1172px) { 83 | --heightVar: calc(100vh - 3.25em); 84 | } 85 | @media screen and (max-width: 1068px) { 86 | --heightVar: calc(100vh - 3.5em); 87 | } 88 | /* For three lines of settings */ 89 | @media screen and (max-width: 840px) { 90 | --heightVar: calc(100vh - 5.5em); 91 | } 92 | /* Make settings small when hidden */ 93 | &.hideSettings { 94 | --heightVar: calc(100vh - 2em); 95 | } 96 | } 97 | 98 | /** Monaco Editor Parent div*/ 99 | .MonacoEditorContainerParentDiv { 100 | min-width: 150px; 101 | // Hides the horizontal scroll bar when using the Monaco Editor 102 | // Otherwise the horizontal scroll bar will flash when the Monaco editor suggests words 103 | overflow-x: hidden !important; 104 | overflow-y: hidden; 105 | padding-top: 1em; 106 | width: 100%; 107 | } 108 | 109 | .MonacoEditorContainer, 110 | .MonacoDiffEditorContainer { 111 | height: 100%; 112 | width: 100%; 113 | } 114 | 115 | /* view mode */ 116 | #viewContainer, 117 | .error-boundary, 118 | .note-dialog { 119 | background-color: var(--sn-stylekit-background-color); 120 | font-size: var(--sn-stylekit-font-size-editor); 121 | @media screen and (max-width: 650px) { 122 | font-size: 18px; 123 | } 124 | line-height: 1.7; 125 | overflow: auto; 126 | padding: 1em; 127 | 128 | a { 129 | color: var(--sn-stylekit-info-color); // #086dd6; 130 | text-decoration: none; 131 | } 132 | 133 | a:hover { 134 | text-decoration: underline; 135 | } 136 | 137 | blockquote { 138 | margin: 0; 139 | margin-top: 0; 140 | margin-bottom: 16px; 141 | padding: 0 1em; 142 | color: #6a737d; 143 | border-left: 0.25em solid #dfe2e5; 144 | } 145 | 146 | hr { 147 | border: 0.5px solid var(--sn-stylekit-border-color); 148 | } 149 | 150 | img { 151 | max-width: 100%; // 645.500px; 152 | } 153 | 154 | table { 155 | display: block; 156 | width: 100%; 157 | overflow: auto; 158 | margin-top: 0; 159 | margin-bottom: 16px; 160 | border-spacing: 0; 161 | border-collapse: collapse; 162 | 163 | tr { 164 | background-color: transparent; // #fff; 165 | border-top: 1px solid var(--sn-stylekit-contrast-border-color); // #c6cbd1; 166 | } 167 | 168 | td, 169 | th { 170 | padding: 6px 13px; 171 | border: 1px solid var(--sn-stylekit-contrast-border-color); // #dfe2e5; 172 | } 173 | 174 | tr:nth-child(2n) { 175 | background-color: var( 176 | --sn-stylekit-contrast-background-color 177 | ); // #f6f8fa; 178 | code, 179 | pre { 180 | background-color: var(--sn-stylekit-background-color); 181 | } 182 | } 183 | } 184 | summary { 185 | .link { 186 | display: inline; 187 | color: var(--sn-stylekit-info-color); 188 | } 189 | .link:hover { 190 | text-decoration: underline; 191 | } 192 | } 193 | 194 | h1, 195 | h2, 196 | h3 { 197 | line-height: normal; 198 | } 199 | 200 | /* Code */ 201 | code, 202 | pre { 203 | font-family: var(--sn-stylekit-monospace-font); 204 | } 205 | .hljs { 206 | color: var(--sn-stylekit-contrast-foreground-color); 207 | } 208 | .hljs-tag { 209 | color: var(--sn-stylekit-foreground-color); 210 | } 211 | 212 | code { 213 | box-sizing: border-box; 214 | word-wrap: break-word; 215 | padding: 0.2em 0.4em; 216 | margin: 0; 217 | font-size: 85%; 218 | background-color: var( 219 | --sn-stylekit-contrast-background-color 220 | ); // rgba(27,31,35,.05); 221 | border-radius: 3px; 222 | } 223 | 224 | pre { 225 | padding: 16px; 226 | overflow: auto; 227 | font-size: 85%; 228 | line-height: 1.45; 229 | background-color: var( 230 | --sn-stylekit-contrast-background-color 231 | ); // rgba(27,31,35,.05);// #f6f8fa; the latter doesn't work well on dark mode 232 | color: var(--sn-stylekit-foreground-color); 233 | border-radius: 3px; 234 | word-wrap: normal; 235 | margin-top: 0; 236 | margin-bottom: 16px; 237 | } 238 | 239 | pre > code { 240 | padding: 0; 241 | margin: 0; 242 | font-size: 100%; 243 | word-break: normal; 244 | white-space: pre; 245 | background: transparent; 246 | background-color: transparent; 247 | border: 0; 248 | } 249 | 250 | pre code { 251 | display: inline; 252 | max-width: auto; 253 | padding: 0; 254 | margin: 0; 255 | overflow: visible; 256 | line-height: inherit; 257 | word-wrap: normal; 258 | background-color: initial; 259 | border: 0; 260 | } 261 | } 262 | 263 | .error-boundary > :nth-child(1), 264 | #viewContainer > div > :nth-child(1) { 265 | margin-top: 0px; 266 | } 267 | 268 | /** Settings */ 269 | #settingsContainer { 270 | display: flex; 271 | flex-direction: row; 272 | margin-bottom: auto; 273 | margin-top: auto; 274 | opacity: 0.2; 275 | overflow-x: auto; 276 | padding-bottom: 0.1em; 277 | padding-left: 1em; 278 | padding-top: 0.1em; 279 | transition: opacity 400ms ease-out; 280 | @media screen and (max-width: 720px) { 281 | padding-left: 0.5em; 282 | } 283 | @media screen and (max-width: 500px) { 284 | opacity: 0.5; 285 | } 286 | /* If screen is big enough to fit all buttons */ 287 | @media screen and (min-width: 840px) { 288 | &.hide { 289 | opacity: 0; 290 | } 291 | } 292 | &:focus, 293 | &:hover, 294 | &.focused { 295 | opacity: 1; 296 | transition: opacity 250ms ease-in; 297 | } 298 | } 299 | 300 | .settings { 301 | color: var(--sn-stylekit-foreground-color); 302 | display: flex; 303 | padding-right: 0.5em; 304 | &.buttons { 305 | padding-right: 0px; 306 | } 307 | &.buttons .button { 308 | margin-right: 0.5em; 309 | } 310 | .button { 311 | border-width: 0px; 312 | max-height: 22.6px; 313 | padding: 0px 0.5em; 314 | } 315 | input[type='checkbox' i]:hover, 316 | select:hover { 317 | cursor: pointer; 318 | } 319 | .label { 320 | display: block; 321 | font-size: 16px; 322 | text-align: center; 323 | } 324 | label { 325 | min-height: 22.6px; 326 | } 327 | select { 328 | background-color: var(--sn-stylekit-background-color); 329 | color: var(--sn-stylekit-foreground-color); 330 | //font-size: var(--sn-stylekit-font-size-editor); 331 | font-size: 16px; 332 | } 333 | @media screen and (max-width: 1068px) { 334 | flex-direction: column; 335 | &.buttons { 336 | flex-direction: row; 337 | } 338 | } 339 | } 340 | 341 | /* Persist for all themes */ 342 | .MonacoEditorContainer { 343 | /* This hides the shadow at the top of the editor */ 344 | .monaco-editor .scroll-decoration { 345 | box-shadow: none; 346 | } 347 | } 348 | 349 | /* Only for Sn theme */ 350 | .sn-theme { 351 | .monaco-editor .line-numbers { 352 | color: var(--sn-stylekit-foreground-color); 353 | opacity: 0.6; 354 | } 355 | 356 | /** This is the editing / input container */ 357 | .monaco-editor, 358 | .monaco-editor .margin, /* This is the line numbers container */ 359 | .monaco-editor-background, 360 | .monaco-editor .inputarea.ime-input { 361 | background-color: var(--sn-stylekit-background-color); 362 | } 363 | 364 | /* Find widget */ 365 | .monaco-editor .find-widget { 366 | box-shadow: 0 2px 8px var(--sn-stylekit-shadow-color); 367 | background-color: var(--sn-stylekit-contrast-background-color); 368 | } 369 | .monaco-editor .find-widget > .find-part .monaco-inputbox, 370 | .monaco-editor .find-widget > .replace-part .monaco-inputbox { 371 | background-color: var(--sn-stylekit-background-color) !important; 372 | border-color: var(--sn-stylekit-border-color) !important; 373 | } 374 | .monaco-editor .find-widget .monaco-inputbox.synthetic-focus { 375 | outline-color: var(--sn-stylekit-info-color); 376 | } 377 | .monaco-editor .find-widget > .find-part .monaco-inputbox > .wrapper > .input, 378 | .monaco-editor 379 | .find-widget 380 | > .replace-part 381 | .monaco-inputbox 382 | > .wrapper 383 | > .input { 384 | color: var(--sn-stylekit-foreground-color) !important; 385 | } 386 | .monaco-editor .find-widget.no-results .matchesCount { 387 | color: var(--sn-stylekit-danger-color); 388 | } 389 | 390 | /* Mini Map */ 391 | .monaco-editor .minimap-shadow-visible { 392 | box-shadow: var(--sn-stylekit-shadow-color) -6px 0 6px -6px inset; 393 | } 394 | 395 | /* Quick input widget */ 396 | .quick-input-widget.show-file-icons { 397 | background-color: var(--sn-stylekit-contrast-background-color) !important; 398 | color: var(--sn-stylekit-foreground-color) !important; 399 | box-shadow: var(--sn-stylekit-shadow-color) 0px 5px 8px !important; 400 | } 401 | 402 | /* This is for the text and keyboard items in the list when you right click and press F1 403 | and also the icons in the find widget */ 404 | .monaco-editor .monaco-list-row, 405 | .monaco-editor .monaco-keybinding-key, 406 | .monaco-editor .find-widget, 407 | .mtk1 { 408 | color: var(--sn-stylekit-foreground-color); 409 | } 410 | 411 | /* This is for 'recently used' and 'other commands' */ 412 | .monaco-editor .quick-input-list-separator { 413 | color: var(--sn-stylekit-info-color); 414 | } 415 | 416 | @media (prefers-color-scheme: light) { 417 | /* This is for normal text */ 418 | .mtk10 { 419 | color: var(--sn-stylekit-foreground-color); 420 | } 421 | /* This is for headers */ 422 | .mtk6 { 423 | color: var(--sn-stylekit-success-color); 424 | } 425 | /* This is for links */ 426 | .mtk20, 427 | .mtk20.detected-link, 428 | .mtk21, 429 | .mtk21.detected-link { 430 | color: var(--sn-stylekit-info-color); 431 | opacity: 0.95; 432 | } 433 | } 434 | 435 | @media (prefers-color-scheme: dark) { 436 | /* This is for headers */ 437 | .mtk9 { 438 | color: var(--sn-stylekit-success-color); 439 | opacity: 0.95; 440 | } 441 | /* This is for links */ 442 | .mtk5, 443 | .mtk5.detected-link { 444 | color: var(--sn-stylekit-info-color); 445 | opacity: 0.95; 446 | } 447 | } 448 | } 449 | 450 | .error-boundary { 451 | background-color: var(--sn-stylekit-background-color); 452 | color: var(--sn-stylekit-foreground-color); 453 | font-size: var(--sn-stylekit-font-size-editor); 454 | } 455 | 456 | /* For Print */ 457 | .note-overlay { 458 | position: fixed !important; 459 | width: 100%; 460 | height: 100%; 461 | top: 0; 462 | left: 0; 463 | right: 0; 464 | bottom: 0; 465 | z-index: 100; 466 | } 467 | 468 | /* Also for Print */ 469 | .note-dialog { 470 | /* Positioning */ 471 | max-width: 700px; 472 | width: 100%; 473 | position: absolute; 474 | top: 50%; 475 | left: 50%; 476 | transform: translate(-50%, -50%); 477 | z-index: 200; 478 | /* Content */ 479 | line-height: normal; 480 | padding: 0px; 481 | /* Button */ 482 | button { 483 | color: var(--sn-stylekit-foreground-color); 484 | background-color: transparent; 485 | border-width: 0px; 486 | font-family: var(--sn-stylekit-sans-serif-font); 487 | font-size: var(--sn-stylekit-font-size-editor); 488 | } 489 | button:hover { 490 | background-color: var(--sn-stylekit-contrast-background-color); 491 | cursor: pointer; 492 | } 493 | button:focus { 494 | outline: -webkit-focus-ring-color auto 1px; 495 | outline-color: -webkit-focus-ring-color; 496 | outline-style: auto; 497 | outline-width: 1px; 498 | } 499 | /* Title */ 500 | .title-section { 501 | padding-top: 0px; 502 | h1, 503 | h2 { 504 | margin: 0.2em 0px; 505 | } 506 | } 507 | /* Section */ 508 | .sk-panel-section:last-child { 509 | margin-bottom: 0px; 510 | } 511 | /* Footer */ 512 | .sk-button.info, 513 | .sk-button.neutral { 514 | font-size: var(--sn-stylekit-font-size-editor); 515 | @media screen and (max-width: 650px) { 516 | font-size: 18px; 517 | } 518 | } 519 | } 520 | 521 | .inline-text-and-svg { 522 | display: inline-flex; 523 | padding-left: 0px; 524 | padding-right: 0px; 525 | svg { 526 | opacity: 0.75; 527 | margin-bottom: auto; 528 | margin-top: auto; 529 | } 530 | } 531 | 532 | @import './print.scss'; 533 | @import './dark.scss'; 534 | -------------------------------------------------------------------------------- /src/stylesheets/print.scss: -------------------------------------------------------------------------------- 1 | @media print { 2 | .print-url { 3 | a[href]:after { 4 | content: ' (' attr(href) ')'; 5 | } 6 | } 7 | 8 | .sn-component, 9 | textarea { 10 | outline: none; 11 | } 12 | 13 | html, 14 | body { 15 | overflow: unset; 16 | } 17 | 18 | #contentContainer { 19 | height: 100%; 20 | max-height: unset; 21 | padding-top: 0px; 22 | width: 100%; 23 | #viewContainer { 24 | width: 100% !important; 25 | pre code { 26 | white-space: pre-wrap; 27 | word-break: break-word; 28 | } 29 | } 30 | } 31 | 32 | .MonacoEditorContainerParentDiv, 33 | #settingsContainer { 34 | display: none; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "esModuleInterop": true, 8 | "allowSyntheticDefaultImports": true, 9 | "strict": true, 10 | "forceConsistentCasingInFileNames": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "module": "esnext", 13 | "moduleResolution": "node", 14 | "resolveJsonModule": true, 15 | "isolatedModules": true, 16 | "noEmit": true, 17 | "jsx": "react-jsx", 18 | "typeRoots": ["./types", "./node_modules/@types"] 19 | }, 20 | "include": ["src"], 21 | "exclude": ["node_modules", "types"] 22 | } 23 | -------------------------------------------------------------------------------- /types/sn-editor-kit/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'sn-editor-kit'; 2 | --------------------------------------------------------------------------------