diff --git a/.dockerignore b/.dockerignore index 7a01509475f2..58f0a901aab4 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ * +!.env !.env.development !.env.production !.eslintrc.json diff --git a/.env.development b/.env.development deleted file mode 100644 index 72b67ecea7bd..000000000000 --- a/.env.development +++ /dev/null @@ -1,24 +0,0 @@ -REACT_APP_BACKEND_V2_GET_URL=https://json-dev.excalidraw.com/api/v2/ -REACT_APP_BACKEND_V2_POST_URL=https://json-dev.excalidraw.com/api/v2/post/ - -REACT_APP_LIBRARY_URL=https://libraries.excalidraw.com -REACT_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries - -# collaboration WebSocket server (https://github.com/excalidraw/excalidraw-room) -REACT_APP_WS_SERVER_URL=http://localhost:3002 - -# set this only if using the collaboration workflow we use on excalidraw.com -REACT_APP_PORTAL_URL= - -REACT_APP_FIREBASE_CONFIG='{"apiKey":"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8","authDomain":"excalidraw-oss-dev.firebaseapp.com","projectId":"excalidraw-oss-dev","storageBucket":"excalidraw-oss-dev.appspot.com","messagingSenderId":"664559512677","appId":"1:664559512677:web:a385181f2928d328a7aa8c"}' - -# put these in your .env.local, or make sure you don't commit! -# must be lowercase `true` when turned on -# -# whether to enable Service Workers in development -REACT_APP_DEV_ENABLE_SW= -# whether to disable live reload / HMR. Usuaully what you want to do when -# debugging Service Workers. -REACT_APP_DEV_DISABLE_LIVE_RELOAD= - -FAST_REFRESH=false diff --git a/.env.development.default b/.env.development.default new file mode 100644 index 000000000000..f5cc4b5e70b8 --- /dev/null +++ b/.env.development.default @@ -0,0 +1,20 @@ +REACT_APP_BACKEND_V2_GET_URL=http://localhost:8080/api/v2/scenes/ +REACT_APP_BACKEND_V2_POST_URL=http://localhost:8080/api/v2/scenes/ +REACT_APP_LIBRARY_URL=https://libraries.excalidraw.com +REACT_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries/ +REACT_APP_STORAGE_BACKEND=http +REACT_APP_HTTP_STORAGE_BACKEND_URL=http://localhost:8080/api/v2 +REACT_APP_WS_SERVER_URL=http://localhost:5001 +REDIS_PASSWORD=123 +REACT_APP_PORTAL_URL= + +# put these in your .env.local, or make sure you don't commit! +# must be lowercase `true` when turned on +# +# whether to enable Service Workers in development +REACT_APP_DEV_ENABLE_SW= +# whether to disable live reload / HMR. Usuaully what you want to do when +# debugging Service Workers. +REACT_APP_DEV_DISABLE_LIVE_RELOAD= + +FAST_REFRESH=false \ No newline at end of file diff --git a/.env.production b/.env.production deleted file mode 100644 index 183db7ea2ac5..000000000000 --- a/.env.production +++ /dev/null @@ -1,17 +0,0 @@ -REACT_APP_BACKEND_V2_GET_URL=https://json.excalidraw.com/api/v2/ -REACT_APP_BACKEND_V2_POST_URL=https://json.excalidraw.com/api/v2/post/ - -REACT_APP_LIBRARY_URL=https://libraries.excalidraw.com -REACT_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries - -REACT_APP_PORTAL_URL=https://portal.excalidraw.com -# Fill to set socket server URL used for collaboration. -# Meant for forks only: excalidraw.com uses custom REACT_APP_PORTAL_URL flow -REACT_APP_WS_SERVER_URL= - -REACT_APP_FIREBASE_CONFIG='{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}' - -# production-only vars -REACT_APP_GOOGLE_ANALYTICS_ID=UA-387204-13 - -REACT_APP_PLUS_APP=https://app.excalidraw.com diff --git a/.env.production.default b/.env.production.default new file mode 100644 index 000000000000..525970f446ce --- /dev/null +++ b/.env.production.default @@ -0,0 +1,14 @@ +REACT_APP_BACKEND_V2_GET_URL=http://localhost:8080/api/v2/scenes/ +REACT_APP_BACKEND_V2_POST_URL=http://localhost:8080/api/v2/scenes/ +REACT_APP_LIBRARY_URL=https://libraries.excalidraw.com +REACT_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries/ +REACT_APP_STORAGE_BACKEND=http +REACT_APP_HTTP_STORAGE_BACKEND_URL=http://localhost:5011/api/v2 +REACT_APP_WS_SERVER_URL=http://localhost:5012 +REDIS_PASSWORD= +REACT_APP_PORTAL_URL= + +# production-only vars +REACT_APP_GOOGLE_ANALYTICS_ID= + +REACT_APP_PLUS_APP= \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4a3f6f367d7e..e0b53f495d7f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,10 @@ .DS_Store .env.development.local +.env.development .env.local +.env .env.production.local +.env.production .env.test.local .envrc .eslintcache diff --git a/Dockerfile b/Dockerfile index d1fa424e532b..41c0e1a45125 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,21 @@ -FROM node:14-alpine AS build +FROM node:18-alpine AS build WORKDIR /opt/node_app +FROM build as production_buildstage + COPY package.json yarn.lock ./ RUN yarn --ignore-optional --network-timeout 600000 -ARG NODE_ENV=production - COPY . . + +ARG NODE_ENV=production RUN yarn build:app:docker -FROM nginx:1.21-alpine +FROM nginx:1.21-alpine as production -COPY --from=build /opt/node_app/build /usr/share/nginx/html +COPY --from=production_buildstage /opt/node_app/build /usr/share/nginx/html HEALTHCHECK CMD wget -q -O /dev/null http://localhost || exit 1 + +FROM build as development \ No newline at end of file diff --git a/README.md b/README.md index 21e2716d0359..9b0312ef2691 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,42 @@ +# Excalidraw without firebase + +This is a fork from the [excalidraw project](https://github.com/excalidraw/excalidraw) with changes inspired and partly taken from [Kilian Decaderincourt](https://gitlab.com/kiliandeca/excalidraw-fork) to enable support for rooms without using firebase.
+ +## Setup with docker + +Please copy the .env.development.default or .env.production.default file to .env (or with environment without default at the end) and change it according to your needs, see [react-scripts](https://create-react-app.dev/docs/adding-custom-environment-variables/). + +### Development + +``` +docker-compose up -d +docker-compose exec excalidraw yarn install +docker-compose exec excalidraw yarn start +``` + +Hint: Collab mode requires a secure context (https). Localhost works as well, but not http over local network. + +#### Commands + +| Command | Description | +| ------------------ | --------------------------------- | +| `yarn` | Install the dependencies | +| `yarn start` | Run the project | +| `yarn fix` | Reformat all files with Prettier | +| `yarn test` | Run tests | +| `yarn test:update` | Update test snapshots | +| `yarn test:code` | Test for formatting with Prettier | + +### Production + +``` +docker-compose -f docker-compose-prod.yml up -d +``` + + +## Additional licence + +The excalidraw [logo](https://thenounproject.com/icon/2357486/) in this repo – created by [Verry](https://thenounproject.com/verry.dsign.creative) – is licenced under [CC BY 3.0 Unported](https://creativecommons.org/licenses/by/3.0/).
Excalidraw logo: Sketch handrawn like diagrams. @@ -42,3 +81,4 @@ Visit our documentation on [https://docs.excalidraw.com](https://docs.excalidraw ## Who's integrating Excalidraw [Google Cloud](https://googlecloudcheatsheet.withgoogle.com/architecture) • [Meta](https://meta.com/) • [CodeSandbox](https://codesandbox.io/) • [Obsidian Excalidraw](https://github.com/zsviczian/obsidian-excalidraw-plugin) • [Replit](https://replit.com/) • [Slite](https://slite.com/) • [Notion](https://notion.so/) • [HackerRank](https://www.hackerrank.com/) +``` \ No newline at end of file diff --git a/docker-compose-prod.yml b/docker-compose-prod.yml new file mode 100644 index 000000000000..a4d421e9ab49 --- /dev/null +++ b/docker-compose-prod.yml @@ -0,0 +1,42 @@ +version: "3.8" + +services: + excalidraw: + build: + context: . + target: production + container_name: excalidraw + ports: + - "5010:80" + restart: always + stdin_open: true + healthcheck: + disable: true + environment: + - NODE_ENV=production + + excalidraw-storage-backend: + build: https://github.com/kitsteam/excalidraw-storage-backend.git#main + ports: + - "5011:8080" + restart: always + environment: + STORAGE_URI: redis://:${REDIS_PASSWORD}@redis:6379 + STORAGE_TTL: 2592000000 + + excalidraw-room: + image: excalidraw/excalidraw-room + restart: always + ports: + - "5012:80" + + redis: + image: redis + command: redis-server --requirepass ${REDIS_PASSWORD} + restart: always + volumes: + - redis_data:/data + +volumes: + notused: + redis_data: diff --git a/docker-compose.yml b/docker-compose.yml index b82053e57b73..69824386c923 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,10 +2,10 @@ version: "3.8" services: excalidraw: + stdin_open: true build: context: . - args: - - NODE_ENV=development + target: development container_name: excalidraw ports: - "3000:80" @@ -16,10 +16,27 @@ services: environment: - NODE_ENV=development volumes: - - ./:/opt/node_app/app:delegated - - ./package.json:/opt/node_app/package.json - - ./yarn.lock:/opt/node_app/yarn.lock - - notused:/opt/node_app/app/node_modules + - node_modules:/opt/node_app/node_modules + - ./:/opt/node_app/ + + excalidraw-storage-backend: + build: https://github.com/kitsteam/excalidraw-storage-backend.git#main + ports: + - "8080:8080" + environment: + STORAGE_URI: redis://:${REDIS_PASSWORD}@redis:6379 + STORAGE_TTL: 2592000000 + excalidraw-room: + image: excalidraw/excalidraw-room + ports: + - "5001:80" + + redis: + image: redis + command: redis-server --requirepass ${REDIS_PASSWORD} + volumes: + - redis_data:/data volumes: - notused: + redis_data: + node_modules: diff --git a/package.json b/package.json index a19b2fb89f4d..6758af53bcfe 100644 --- a/package.json +++ b/package.json @@ -50,8 +50,10 @@ "png-chunks-extract": "1.0.0", "points-on-curve": "0.2.0", "pwacompat": "2.0.17", + "qr-code-styling": "1.6.0-rc.1", "react": "18.2.0", "react-dom": "18.2.0", + "react-router-dom": "6.8.1", "react-scripts": "5.0.1", "roughjs": "4.5.2", "sass": "1.51.0", @@ -117,7 +119,7 @@ "locales-coverage:description": "node scripts/locales-coverage-description.js", "prepare": "husky install", "prettier": "prettier \"**/*.{css,scss,json,md,html,yml}\" --ignore-path=.eslintignore", - "start": "react-scripts start", + "start": "PORT=80 react-scripts start", "start:production": "npm run build && npx http-server build -a localhost -p 5001 -o", "test:all": "yarn test:typecheck && yarn test:code && yarn test:other && yarn test:app --watchAll=false", "test:app": "react-scripts test --passWithNoTests", diff --git a/public/FiraSans-Bold.otf b/public/FiraSans-Bold.otf new file mode 100644 index 000000000000..01821595fcb4 Binary files /dev/null and b/public/FiraSans-Bold.otf differ diff --git a/public/FiraSans-Light.otf b/public/FiraSans-Light.otf new file mode 100644 index 000000000000..1445a4afd444 Binary files /dev/null and b/public/FiraSans-Light.otf differ diff --git a/public/FiraSans-Regular.otf b/public/FiraSans-Regular.otf new file mode 100644 index 000000000000..98ef98c8db44 Binary files /dev/null and b/public/FiraSans-Regular.otf differ diff --git a/public/GitHub-Mark-32px.png b/public/GitHub-Mark-32px.png new file mode 100644 index 000000000000..8b25551a9792 Binary files /dev/null and b/public/GitHub-Mark-32px.png differ diff --git a/public/SIL_OFL.txt b/public/SIL_OFL.txt new file mode 100644 index 000000000000..8a1303f86b63 --- /dev/null +++ b/public/SIL_OFL.txt @@ -0,0 +1,45 @@ +Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ with Reserved Font Name Fira Sans. + +Copyright (c) 2014, Telefonica S.A. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. + +The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the copyright statement(s). + +"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. + +"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. + +5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. \ No newline at end of file diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png index 40af4de2f9f9..4a87b4c1413c 100644 Binary files a/public/apple-touch-icon.png and b/public/apple-touch-icon.png differ diff --git a/public/excalidraw-logo-white.svg b/public/excalidraw-logo-white.svg new file mode 100644 index 000000000000..d0ecc2cc9087 --- /dev/null +++ b/public/excalidraw-logo-white.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/public/favicon.ico b/public/favicon.ico index 518c8962efec..6cfa0c457f25 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/fonts.css b/public/fonts.css index 166afd8dd57e..1c7263a091c6 100644 --- a/public/fonts.css +++ b/public/fonts.css @@ -36,3 +36,20 @@ font-display: swap; font-weight: 700; } + +@font-face { + font-family: "FiraSans"; + src: url("FiraSans-Regular.otf") format("opentype"); +} + +@font-face { + font-family: "FiraSans"; + font-weight: light; + src: url("FiraSans-Light.otf") format("opentype"); +} + +@font-face { + font-family: "FiraSans"; + font-weight: bold; + src: url("FiraSans-Bold.otf") format("opentype"); +} diff --git a/public/index.html b/public/index.html index 35640c0dcd55..cc7f74c60fe9 100644 --- a/public/index.html +++ b/public/index.html @@ -103,6 +103,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/public/kits-logo.svg b/public/kits-logo.svg new file mode 100644 index 000000000000..0747e0b0ed48 --- /dev/null +++ b/public/kits-logo.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/manifest.json b/public/manifest.json index 85dc878f2ada..57fccc314545 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -4,14 +4,70 @@ "description": "Excalidraw is a whiteboard tool that lets you easily sketch diagrams that have a hand-drawn feel to them.", "icons": [ { - "src": "logo-180x180.png", + "src": "web/icons/icon-72x72.png", + "sizes": "72x72", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "web/icons/icon-96x96.png", + "sizes": "96x96", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "web/icons/icon-128x128.png", + "sizes": "128x128", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "web/icons/icon-144x144.png", + "sizes": "144x144", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "web/icons/icon-152x152.png", + "sizes": "152x152", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "web/icons/icon-167x167.png", + "sizes": "167x167", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "web/icons/icon-180x180.png", "sizes": "180x180", - "type": "image/png" + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "web/icons/icon-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "web/icons/icon-256x256.png", + "sizes": "256x256", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "web/icons/icon-384x384.png", + "sizes": "384x384", + "type": "image/png", + "purpose": "maskable any" }, { - "src": "apple-touch-icon.png", + "src": "web/icons/icon-512x512.png", + "sizes": "512x512", "type": "image/png", - "sizes": "256x256" + "purpose": "maskable any" } ], "start_url": "/", diff --git a/public/og-fb-v1.png b/public/og-fb-v1.png index b626ee60a0c4..619718d6b5ae 100644 Binary files a/public/og-fb-v1.png and b/public/og-fb-v1.png differ diff --git a/public/og-general-v1.png b/public/og-general-v1.png index 0a6fbb343cd1..901a491a91a3 100644 Binary files a/public/og-general-v1.png and b/public/og-general-v1.png differ diff --git a/public/og-image-sm.png b/public/og-image-sm.png index 5e88dba059f7..17da3eb5ff0d 100644 Binary files a/public/og-image-sm.png and b/public/og-image-sm.png differ diff --git a/public/og-image.png b/public/og-image.png index 8f05f7babd1f..0e03809173ea 100644 Binary files a/public/og-image.png and b/public/og-image.png differ diff --git a/public/og-twitter-v1.png b/public/og-twitter-v1.png index e7834c334b93..884bdf14d9ec 100644 Binary files a/public/og-twitter-v1.png and b/public/og-twitter-v1.png differ diff --git a/public/web/icons/icon-128x128.png b/public/web/icons/icon-128x128.png new file mode 100644 index 000000000000..cc2907c0cce3 Binary files /dev/null and b/public/web/icons/icon-128x128.png differ diff --git a/public/web/icons/icon-144x144.png b/public/web/icons/icon-144x144.png new file mode 100644 index 000000000000..b15989d4788f Binary files /dev/null and b/public/web/icons/icon-144x144.png differ diff --git a/public/web/icons/icon-152x152.png b/public/web/icons/icon-152x152.png new file mode 100644 index 000000000000..abae683f73b8 Binary files /dev/null and b/public/web/icons/icon-152x152.png differ diff --git a/public/web/icons/icon-167x167.png b/public/web/icons/icon-167x167.png new file mode 100644 index 000000000000..a37d8f9138c3 Binary files /dev/null and b/public/web/icons/icon-167x167.png differ diff --git a/public/web/icons/icon-180x180.png b/public/web/icons/icon-180x180.png new file mode 100644 index 000000000000..a24f2932a827 Binary files /dev/null and b/public/web/icons/icon-180x180.png differ diff --git a/public/web/icons/icon-192x192.png b/public/web/icons/icon-192x192.png new file mode 100644 index 000000000000..c4491a8acb4e Binary files /dev/null and b/public/web/icons/icon-192x192.png differ diff --git a/public/web/icons/icon-256x256.png b/public/web/icons/icon-256x256.png new file mode 100644 index 000000000000..3417c335e825 Binary files /dev/null and b/public/web/icons/icon-256x256.png differ diff --git a/public/web/icons/icon-384x384.png b/public/web/icons/icon-384x384.png new file mode 100644 index 000000000000..53d77e9774b9 Binary files /dev/null and b/public/web/icons/icon-384x384.png differ diff --git a/public/web/icons/icon-512x512.png b/public/web/icons/icon-512x512.png new file mode 100644 index 000000000000..934e3c0e043a Binary files /dev/null and b/public/web/icons/icon-512x512.png differ diff --git a/public/web/icons/icon-72x72.png b/public/web/icons/icon-72x72.png new file mode 100644 index 000000000000..f59a32c5972a Binary files /dev/null and b/public/web/icons/icon-72x72.png differ diff --git a/public/web/icons/icon-96x96.png b/public/web/icons/icon-96x96.png new file mode 100644 index 000000000000..46d00f553b5c Binary files /dev/null and b/public/web/icons/icon-96x96.png differ diff --git a/src/actions/actionCanvas.tsx b/src/actions/actionCanvas.tsx index 1154d1ef104b..6408235694c6 100644 --- a/src/actions/actionCanvas.tsx +++ b/src/actions/actionCanvas.tsx @@ -83,6 +83,7 @@ export const actionClearCanvas = register({ gridSize: appState.gridSize, showStats: appState.showStats, pasteDialog: appState.pasteDialog, + showInfoDialog: false, activeTool: appState.activeTool.type === "image" ? { ...appState.activeTool, type: "selection" } diff --git a/src/actions/types.ts b/src/actions/types.ts index 54bd5a26f3df..9079471f1eca 100644 --- a/src/actions/types.ts +++ b/src/actions/types.ts @@ -87,6 +87,7 @@ export type ActionName = | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" + | "toggleInfos" | "group" | "ungroup" | "goToCollaborator" diff --git a/src/appState.ts b/src/appState.ts index f02d5943c7e7..c4df85e1298f 100644 --- a/src/appState.ts +++ b/src/appState.ts @@ -19,6 +19,8 @@ export const getDefaultAppState = (): Omit< "offsetTop" | "offsetLeft" | "width" | "height" > => { return { + featureFlagWelcomeScreen: false, + featureFlagLibraryButton: false, showWelcomeScreen: false, theme: THEME.LIGHT, collaborators: new Map(), @@ -111,7 +113,9 @@ const APP_STATE_STORAGE_CONF = (< T extends Record, >(config: { [K in keyof T]: K extends keyof AppState ? T[K] : never }) => config)({ - showWelcomeScreen: { browser: true, export: false, server: false }, + featureFlagWelcomeScreen: { browser: false, export: false, server: false }, + featureFlagLibraryButton: { browser: false, export: false, server: false }, + showWelcomeScreen: { browser: false, export: false, server: false }, theme: { browser: true, export: false, server: false }, collaborators: { browser: false, export: false, server: false }, currentChartType: { browser: true, export: false, server: false }, diff --git a/src/components/App.tsx b/src/components/App.tsx index f01faa279ea8..206095dde69c 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -606,6 +606,7 @@ class App extends React.Component { onImageAction={this.onImageAction} renderWelcomeScreen={ !this.state.isLoading && + this.state.featureFlagWelcomeScreen && this.state.showWelcomeScreen && this.state.activeTool.type === "selection" && !this.scene.getElementsIncludingDeleted().length diff --git a/src/components/Card.tsx b/src/components/Card.tsx index 2ba5a97a56da..d3d928709b52 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -1,5 +1,5 @@ import OpenColor from "open-color"; - +import "./Kits.scss"; import "./Card.scss"; export const Card: React.FC<{ @@ -11,15 +11,15 @@ export const Card: React.FC<{ className="Card" style={{ ["--card-color" as any]: - color === "primary" ? "var(--color-primary)" : OpenColor[color][7], + color === "primary" ? "var(--color-primary)" : 'var(--kits-primary)', ["--card-color-darker" as any]: color === "primary" ? "var(--color-primary-darker)" - : OpenColor[color][8], + : 'var(--kits-primary-darker)', ["--card-color-darkest" as any]: color === "primary" ? "var(--color-primary-darkest)" - : OpenColor[color][9], + : 'var(--kits-primary-darkest)', }} > {children} diff --git a/src/components/HelpDialog.scss b/src/components/HelpDialog.scss index 8a0a08f3c43e..7f6edb1ce0ca 100644 --- a/src/components/HelpDialog.scss +++ b/src/components/HelpDialog.scss @@ -104,6 +104,7 @@ box-sizing: border-box; font-size: 0.625rem; background-color: var(--color-primary-light); + color: var(--white); border-radius: var(--border-radius-md); padding: 0.5rem; word-break: keep-all; diff --git a/src/components/HelpDialog.tsx b/src/components/HelpDialog.tsx index 8cb775fc5d1c..60c73c07baa0 100644 --- a/src/components/HelpDialog.tsx +++ b/src/components/HelpDialog.tsx @@ -21,7 +21,7 @@ const Header = () => ( @@ -30,7 +30,7 @@ const Header = () => ( diff --git a/src/components/ImageExportDialog.tsx b/src/components/ImageExportDialog.tsx index fb2c1ec81032..3fd98eb009ab 100644 --- a/src/components/ImageExportDialog.tsx +++ b/src/components/ImageExportDialog.tsx @@ -47,9 +47,9 @@ const ExportButton: React.FC<{