├── .nvmrc ├── docs ├── .dockerignore ├── src │ ├── pwa-512.png │ ├── components │ │ ├── index.js │ │ ├── mdxComponents │ │ │ ├── loading.js │ │ │ ├── anchor.js │ │ │ ├── LiveProvider.js │ │ │ ├── index.js │ │ │ └── codeBlock.js │ │ ├── search │ │ │ ├── styles.js │ │ │ ├── hitComps.js │ │ │ ├── input.js │ │ │ └── index.js │ │ ├── link.js │ │ ├── theme.js │ │ ├── sidebar │ │ │ ├── treeNode.js │ │ │ ├── index.js │ │ │ └── tree.js │ │ ├── styles │ │ │ ├── Docs.js │ │ │ └── PageNavigationButtons.js │ │ ├── RightSidebar │ │ │ ├── rightSidebar.js │ │ │ └── styles.js │ │ ├── layout.js │ │ └── NextPrevious.js │ ├── custom-sw-code.js │ ├── images │ │ ├── closed.js │ │ ├── opened.js │ │ ├── facebook.inline.svg │ │ ├── help.svg │ │ ├── twitter.inline.svg │ │ └── github.svg │ ├── GithubLink.js │ ├── YoutubeEmbed.js │ ├── utils │ │ └── algolia.js │ └── html.js ├── content │ ├── themes.md │ ├── app-lifecycle.md │ ├── images │ │ ├── hook-all.png │ │ ├── sc-app-flow.png │ │ ├── hook-link-only.png │ │ ├── hook-title-qr.png │ │ ├── 15five-api-data.png │ │ ├── hook-title-link.png │ │ ├── 15five-screenshot.png │ │ ├── choate-staffbase-1.png │ │ ├── get-started-loading.png │ │ ├── get-started-quote-1.png │ │ ├── get-started-quote-2.png │ │ ├── hook-body-only-v2.png │ │ ├── hook-image-only-v2.png │ │ ├── hook-title-only-v2.png │ │ ├── sweetwater-friday-1.JPG │ │ ├── sweetwater-friday-2.JPG │ │ ├── 15five-slide-snippet.png │ │ ├── example-slide-snippet.png │ │ ├── hook-body-only-with-html.png │ │ ├── 15five-data-loader-snippet.png │ │ ├── hook-image-body-with-html.png │ │ └── example-data-loader-snippet.png │ ├── example-codebases.md │ ├── add-to-app-store.md │ ├── index.mdx │ ├── overview.md │ ├── preloading.mdx │ └── example-user-apps.md ├── .prettierrc ├── gatsby-browser.js ├── Dockerfile ├── README.md ├── .eslintrc.json ├── LICENSE ├── config.js ├── package.json ├── gatsby-config.js ├── .gitignore └── gatsby-node.js ├── examples ├── 15five-firebase-cloud-function-example │ ├── functions │ │ ├── .gitignore │ │ ├── package.json │ │ ├── index.js │ │ └── .eslintrc.json │ ├── .firebaserc │ ├── firebase.json │ └── .gitignore ├── react-firebase-example │ ├── public │ │ ├── robots.txt │ │ ├── favicon.ico │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── index.html │ ├── src │ │ ├── context │ │ │ └── ThemedStyleContext.js │ │ ├── setupTests.js │ │ ├── App.test.js │ │ ├── components │ │ │ ├── error │ │ │ │ └── ErrorMessage.js │ │ │ ├── data-loader │ │ │ │ ├── data-loader.scss │ │ │ │ └── DataLoader.js │ │ │ ├── slide-show │ │ │ │ ├── SlideShow.js │ │ │ │ ├── slide-show.scss │ │ │ │ └── Slide.js │ │ │ └── player │ │ │ │ └── ScPlayerInterface.js │ │ ├── index.css │ │ ├── reportWebVitals.js │ │ ├── App.js │ │ ├── App.css │ │ ├── index.js │ │ ├── logo.svg │ │ └── containers │ │ │ └── AppContainer.js │ ├── .gitignore │ ├── package.json │ └── README.md ├── javascript-app │ ├── src │ │ ├── images │ │ │ └── logo.png │ │ ├── index.html │ │ ├── style.css │ │ └── index.js │ ├── .babelrc │ ├── readme.md │ ├── package.json │ └── webpack.config.js ├── typescript-app │ ├── src │ │ ├── images │ │ │ └── logo.png │ │ ├── index.html │ │ ├── style.scss │ │ └── index.ts │ ├── .babelrc │ ├── readme.md │ ├── package.json │ └── webpack.config.js ├── starting-from-webapp │ ├── src │ │ ├── images │ │ │ └── logo.png │ │ ├── index.html │ │ ├── style.scss │ │ └── index.js │ ├── .babelrc │ ├── package.json │ ├── readme.md │ └── webpack.config.js └── 15Five-firebase-webapp-example │ ├── src │ ├── assets │ │ └── 15-five-logo.png │ ├── context │ │ └── ThemedStyleContext.js │ ├── setupTests.js │ ├── containers │ │ ├── app-container.scss │ │ └── AppContainer.js │ ├── App.test.js │ ├── components │ │ ├── error │ │ │ └── ErrorMessage.js │ │ ├── data-loader │ │ │ ├── data-loader.scss │ │ │ └── DataLoader.js │ │ ├── slide-show │ │ │ ├── SlideShow.js │ │ │ ├── slide-show.scss │ │ │ └── Slide.js │ │ └── player │ │ │ └── ScPlayerInterface.js │ ├── reportWebVitals.js │ ├── index.css │ ├── App.js │ ├── App.css │ ├── index.js │ └── logo.svg │ ├── .gitignore │ ├── package.json │ └── README.md ├── package.json ├── lerna.json ├── packages ├── apps-sdk │ ├── tsconfig.json │ ├── src │ │ ├── utils │ │ │ ├── objectUtils.ts │ │ │ └── postMessage.ts │ │ ├── constants.ts │ │ ├── messages.ts │ │ └── types.ts │ ├── README.md │ ├── .eslintrc.js │ ├── CHANGELOG.md │ └── package.json └── apps-editor-sdk │ ├── tsconfig.json │ ├── src │ ├── utils │ │ ├── objectUtils.ts │ │ └── postMessage.ts │ ├── constants.ts │ ├── messages.ts │ └── types.ts │ ├── README.md │ ├── CHANGELOG.md │ ├── .eslintrc.js │ └── package.json ├── .github └── workflows │ └── deploy-docs.yml ├── readme.md └── .gitignore /.nvmrc: -------------------------------------------------------------------------------- 1 | 18.20.4 -------------------------------------------------------------------------------- /docs/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | public 3 | .cache 4 | -------------------------------------------------------------------------------- /examples/15five-firebase-cloud-function-example/functions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /docs/src/pwa-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/src/pwa-512.png -------------------------------------------------------------------------------- /docs/content/themes.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Themes' 3 | --- 4 | 5 | Work in progress. Coming very soon! 6 | -------------------------------------------------------------------------------- /docs/content/app-lifecycle.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'App Lifecycle' 3 | --- 4 | 5 | Work in progress. Coming very soon! 6 | -------------------------------------------------------------------------------- /docs/content/images/hook-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/hook-all.png -------------------------------------------------------------------------------- /docs/content/images/sc-app-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/sc-app-flow.png -------------------------------------------------------------------------------- /examples/react-firebase-example/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /docs/content/images/hook-link-only.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/hook-link-only.png -------------------------------------------------------------------------------- /docs/content/images/hook-title-qr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/hook-title-qr.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "root", 3 | "private": true, 4 | "devDependencies": { 5 | "lerna": "^3.20.2" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/content/images/15five-api-data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/15five-api-data.png -------------------------------------------------------------------------------- /docs/content/images/hook-title-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/hook-title-link.png -------------------------------------------------------------------------------- /docs/content/images/15five-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/15five-screenshot.png -------------------------------------------------------------------------------- /docs/content/images/choate-staffbase-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/choate-staffbase-1.png -------------------------------------------------------------------------------- /docs/content/images/get-started-loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/get-started-loading.png -------------------------------------------------------------------------------- /docs/content/images/get-started-quote-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/get-started-quote-1.png -------------------------------------------------------------------------------- /docs/content/images/get-started-quote-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/get-started-quote-2.png -------------------------------------------------------------------------------- /docs/content/images/hook-body-only-v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/hook-body-only-v2.png -------------------------------------------------------------------------------- /docs/content/images/hook-image-only-v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/hook-image-only-v2.png -------------------------------------------------------------------------------- /docs/content/images/hook-title-only-v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/hook-title-only-v2.png -------------------------------------------------------------------------------- /docs/content/images/sweetwater-friday-1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/sweetwater-friday-1.JPG -------------------------------------------------------------------------------- /docs/content/images/sweetwater-friday-2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/sweetwater-friday-2.JPG -------------------------------------------------------------------------------- /docs/src/components/index.js: -------------------------------------------------------------------------------- 1 | export mdxComponents from './mdxComponents'; 2 | export Layout from './layout'; 3 | export Link from './link'; 4 | -------------------------------------------------------------------------------- /examples/15five-firebase-cloud-function-example/.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "screencloud-15five" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /examples/javascript-app/src/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/examples/javascript-app/src/images/logo.png -------------------------------------------------------------------------------- /examples/typescript-app/src/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/examples/typescript-app/src/images/logo.png -------------------------------------------------------------------------------- /docs/content/images/15five-slide-snippet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/15five-slide-snippet.png -------------------------------------------------------------------------------- /docs/content/images/example-slide-snippet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/example-slide-snippet.png -------------------------------------------------------------------------------- /docs/content/images/hook-body-only-with-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/hook-body-only-with-html.png -------------------------------------------------------------------------------- /docs/content/images/15five-data-loader-snippet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/15five-data-loader-snippet.png -------------------------------------------------------------------------------- /docs/content/images/hook-image-body-with-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/hook-image-body-with-html.png -------------------------------------------------------------------------------- /examples/react-firebase-example/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/examples/react-firebase-example/public/favicon.ico -------------------------------------------------------------------------------- /examples/react-firebase-example/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/examples/react-firebase-example/public/logo192.png -------------------------------------------------------------------------------- /examples/react-firebase-example/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/examples/react-firebase-example/public/logo512.png -------------------------------------------------------------------------------- /examples/starting-from-webapp/src/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/examples/starting-from-webapp/src/images/logo.png -------------------------------------------------------------------------------- /docs/content/images/example-data-loader-snippet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/docs/content/images/example-data-loader-snippet.png -------------------------------------------------------------------------------- /docs/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "jsxBracketSameLine": false, 4 | "singleQuote": true, 5 | "tabWidth": 2, 6 | "trailingComma": "es5" 7 | } 8 | -------------------------------------------------------------------------------- /examples/15five-firebase-cloud-function-example/firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "functions": { 3 | "predeploy": [ 4 | "npm --prefix \"$RESOURCE_DIR\" run lint" 5 | ] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /examples/15Five-firebase-webapp-example/src/assets/15-five-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screencloud/developer/HEAD/examples/15Five-firebase-webapp-example/src/assets/15-five-logo.png -------------------------------------------------------------------------------- /docs/src/custom-sw-code.js: -------------------------------------------------------------------------------- 1 | workbox.routing.registerRoute( 2 | new RegExp('https:.*min.(css|js)'), 3 | workbox.strategies.staleWhileRevalidate({ 4 | cacheName: 'cdn-cache', 5 | }) 6 | ); 7 | -------------------------------------------------------------------------------- /docs/src/components/mdxComponents/loading.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | const LoadingProvider = ({ ...props }) => { 4 | return
; 5 | }; 6 | 7 | export default LoadingProvider; 8 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": ["packages/*"], 3 | "version": "independent", 4 | "ignoreChanges": [ 5 | "packages/*/dist/**", 6 | "**/*.test.ts", 7 | "**/*.spec.ts", 8 | "**/test/**" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /examples/react-firebase-example/src/context/ThemedStyleContext.js: -------------------------------------------------------------------------------- 1 | import { createContext } from "react"; 2 | import { DEFAULT_STYLED_THEME } from "../utils/constants"; 3 | 4 | export const ThemedStyleContext = createContext(DEFAULT_STYLED_THEME); 5 | -------------------------------------------------------------------------------- /examples/15Five-firebase-webapp-example/src/context/ThemedStyleContext.js: -------------------------------------------------------------------------------- 1 | import { createContext } from "react"; 2 | import { DEFAULT_STYLED_THEME } from "../utils/constants"; 3 | 4 | export const ThemedStyleContext = createContext(DEFAULT_STYLED_THEME); 5 | -------------------------------------------------------------------------------- /docs/gatsby-browser.js: -------------------------------------------------------------------------------- 1 | export const onServiceWorkerUpdateReady = () => { 2 | const answer = window.confirm( 3 | `This tutorial has been updated. ` + 4 | `Reload to display the latest version?` 5 | ) 6 | if (answer === true) { 7 | window.location.reload() 8 | } 9 | } -------------------------------------------------------------------------------- /examples/react-firebase-example/src/setupTests.js: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /examples/15Five-firebase-webapp-example/src/setupTests.js: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /examples/15Five-firebase-webapp-example/src/containers/app-container.scss: -------------------------------------------------------------------------------- 1 | .app-container { 2 | display: flex; 3 | flex-direction: row; 4 | width: 100vw; 5 | height: 100vh; 6 | 7 | &_left { 8 | background: #FF3100; 9 | width: 30%; 10 | } 11 | 12 | &_right { 13 | width: 70%; 14 | } 15 | } -------------------------------------------------------------------------------- /examples/react-firebase-example/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(...
9 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/docs/src/components/mdxComponents/LiveProvider.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { LiveProvider, LiveEditor, LiveError, LivePreview } from 'react-live';
3 |
4 | const ReactLiveProvider = ({ code }) => {
5 | return (
6 | ...
9 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/typescript-app/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ...
9 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/react-firebase-example/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/examples/15Five-firebase-webapp-example/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/examples/react-firebase-example/src/index.css:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/examples/react-firebase-example/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/examples/15Five-firebase-webapp-example/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/packages/apps-sdk/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "declaration": true,
4 | "esModuleInterop": true,
5 | "forceConsistentCasingInFileNames": true,
6 | "jsx": "preserve",
7 | "lib": ["dom", "dom.iterable", "esnext"],
8 | "module": "esnext",
9 | "moduleResolution": "node",
10 | "outDir": "lib",
11 | "strict": true,
12 | "target": "es5"
13 | },
14 | "include": ["src"],
15 | "exclude": ["node_modules", "**/__tests__/*"]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/apps-editor-sdk/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "declaration": true,
4 | "esModuleInterop": true,
5 | "forceConsistentCasingInFileNames": true,
6 | "jsx": "preserve",
7 | "lib": ["dom", "dom.iterable", "esnext"],
8 | "module": "esnext",
9 | "moduleResolution": "node",
10 | "outDir": "lib",
11 | "strict": true,
12 | "target": "es5"
13 | },
14 | "include": ["src"],
15 | "exclude": ["node_modules", "**/__tests__/*"]
16 | }
17 |
--------------------------------------------------------------------------------
/docs/src/components/search/hitComps.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Highlight, Snippet } from 'react-instantsearch-dom';
3 | import { Link } from 'gatsby';
4 |
5 | export const PageHit = clickHandler => ({ hit }) => (
6 |
10 | Edit src/App.js and save to reload.
11 |
10 | Edit src/App.js and save to reload.
11 |
36 | {cleanTokens(tokens).map((line, i) => {
37 | let lineClass = {};
38 |
39 | let isDiff = false;
40 |
41 | if (line[0] && line[0].content.length && line[0].content[0] === '+') {
42 | lineClass = { backgroundColor: 'rgba(76, 175, 80, 0.2)' };
43 | isDiff = true;
44 | } else if (line[0] && line[0].content.length && line[0].content[0] === '-') {
45 | lineClass = { backgroundColor: 'rgba(244, 67, 54, 0.2)' };
46 | isDiff = true;
47 | } else if (line[0] && line[0].content === '' && line[1] && line[1].content === '+') {
48 | lineClass = { backgroundColor: 'rgba(76, 175, 80, 0.2)' };
49 | isDiff = true;
50 | } else if (line[0] && line[0].content === '' && line[1] && line[1].content === '-') {
51 | lineClass = { backgroundColor: 'rgba(244, 67, 54, 0.2)' };
52 | isDiff = true;
53 | }
54 | const lineProps = getLineProps({ line, key: i });
55 |
56 | lineProps.style = lineClass;
57 | const diffStyle = {
58 | userSelect: 'none',
59 | MozUserSelect: '-moz-none',
60 | WebkitUserSelect: 'none',
61 | };
62 |
63 | let splitToken;
64 |
65 | return (
66 |
67 | {line.map((token, key) => {
68 | if (isDiff) {
69 | if (
70 | (key === 0 || key === 1) &
71 | (token.content.charAt(0) === '+' || token.content.charAt(0) === '-')
72 | ) {
73 | if (token.content.length > 1) {
74 | splitToken = {
75 | types: ['template-string', 'string'],
76 | content: token.content.slice(1),
77 | };
78 | const firstChar = {
79 | types: ['operator'],
80 | content: token.content.charAt(0),
81 | };
82 |
83 | return (
84 |
85 |
89 |
90 |
91 | );
92 | } else {
93 | return ;
94 | }
95 | }
96 | }
97 | return ;
98 | })}
99 |
100 | );
101 | })}
102 |
103 | )}
104 |