From dd6c5937485fea07637660cf818a890ddda4df69 Mon Sep 17 00:00:00 2001 From: sorenjohanson Date: Sat, 7 Sep 2024 10:16:02 +0000 Subject: [PATCH] removed: external resources --- excalidraw-app/index.html | 563 ++++++++++++---------------- package.json | 2 +- packages/excalidraw/fonts/index.ts | 78 ++-- scripts/woff2/woff2-vite-plugins.js | 27 +- 4 files changed, 279 insertions(+), 391 deletions(-) diff --git a/excalidraw-app/index.html b/excalidraw-app/index.html index 1305d3a89496..947b22a5e1e9 100644 --- a/excalidraw-app/index.html +++ b/excalidraw-app/index.html @@ -1,90 +1,77 @@ - - - Excalidraw | Hand-drawn look & feel • Collaborative • Secure - - - - - - - - + + + Excalidraw | Hand-drawn look & feel • Collaborative • Secure + + + + - - - - - - - - + + + + - - + + + + + + + + - - - - - - - + setTheme(getTheme()); + } catch (e) { + console.error("Error setting dark mode", e); + } + + + + - - <% if (typeof PROD !='undefined' && PROD==true) { %> + + <% if (typeof PROD !='undefined' && PROD==true) { %> + - - - - - <% } %> - - - - - + + + + + <% } %> + + + + + - - + + - - - + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - <% if ("%VITE_APP_DEV_DISABLE_LIVE_RELOAD%"==="true" ) { %> - - <% } %> - + + <% if ("%VITE_APP_DEV_DISABLE_LIVE_RELOAD%"==="true" ) { %> + + <% } %> + - - - + @media screen and (min-width: 1200px) { + #root { + -webkit-touch-callout: default; + -webkit-user-select: auto; + -khtml-user-select: auto; + -moz-user-select: auto; + -ms-user-select: auto; + user-select: auto; + } + } + + - - -
-

Excalidraw

-
-
- - <% if ("%VITE_APP_DEV_DISABLE_LIVE_RELOAD%" !=='true' ) { %> + + +
+

Excalidraw

+
+
+ + <% if ("%VITE_APP_DEV_DISABLE_LIVE_RELOAD%" !=='true' ) { %> - --> <% } %> - - + + + \ No newline at end of file diff --git a/package.json b/package.json index c0552aba18ff..94f21ce33b79 100644 --- a/package.json +++ b/package.json @@ -88,4 +88,4 @@ "resolutions": { "@types/react": "18.2.0" } -} +} \ No newline at end of file diff --git a/packages/excalidraw/fonts/index.ts b/packages/excalidraw/fonts/index.ts index 39f6bf8da207..607825009678 100644 --- a/packages/excalidraw/fonts/index.ts +++ b/packages/excalidraw/fonts/index.ts @@ -12,7 +12,7 @@ import { FONT_FAMILY } from "../constants"; import { LOCAL_FONT_PROTOCOL, FONT_METADATA, - RANGES, + //RANGES, type FontMetadata, } from "./metadata"; import { ExcalidrawFont, type Font } from "./ExcalidrawFont"; @@ -24,14 +24,14 @@ import Cascadia from "./assets/CascadiaCode-Regular.woff2"; import ComicShanns from "./assets/ComicShanns-Regular.woff2"; import LiberationSans from "./assets/LiberationSans-Regular.woff2"; -import LilitaLatin from "https://fonts.gstatic.com/s/lilitaone/v15/i7dPIFZ9Zz-WBtRtedDbYEF8RXi4EwQ.woff2"; -import LilitaLatinExt from "https://fonts.gstatic.com/s/lilitaone/v15/i7dPIFZ9Zz-WBtRtedDbYE98RXi4EwSsbg.woff2"; +// import LilitaLatin from "https://fonts.gstatic.com/s/lilitaone/v15/i7dPIFZ9Zz-WBtRtedDbYEF8RXi4EwQ.woff2"; +// import LilitaLatinExt from "https://fonts.gstatic.com/s/lilitaone/v15/i7dPIFZ9Zz-WBtRtedDbYE98RXi4EwSsbg.woff2"; -import NunitoLatin from "https://fonts.gstatic.com/s/nunito/v26/XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTQ3j6zbXWjgeg.woff2"; -import NunitoLatinExt from "https://fonts.gstatic.com/s/nunito/v26/XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTo3j6zbXWjgevT5.woff2"; -import NunitoCyrilic from "https://fonts.gstatic.com/s/nunito/v26/XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTA3j6zbXWjgevT5.woff2"; -import NunitoCyrilicExt from "https://fonts.gstatic.com/s/nunito/v26/XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTk3j6zbXWjgevT5.woff2"; -import NunitoVietnamese from "https://fonts.gstatic.com/s/nunito/v26/XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTs3j6zbXWjgevT5.woff2"; +// import NunitoLatin from "https://fonts.gstatic.com/s/nunito/v26/XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTQ3j6zbXWjgeg.woff2"; +// import NunitoLatinExt from "https://fonts.gstatic.com/s/nunito/v26/XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTo3j6zbXWjgevT5.woff2"; +// import NunitoCyrilic from "https://fonts.gstatic.com/s/nunito/v26/XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTA3j6zbXWjgevT5.woff2"; +// import NunitoCyrilicExt from "https://fonts.gstatic.com/s/nunito/v26/XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTk3j6zbXWjgevT5.woff2"; +// import NunitoVietnamese from "https://fonts.gstatic.com/s/nunito/v26/XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTs3j6zbXWjgevT5.woff2"; export class Fonts { // it's ok to track fonts across multiple instances only once, so let's use @@ -240,37 +240,37 @@ export class Fonts { uri: ComicShanns, }); - _register( - "Lilita One", - FONT_METADATA[FONT_FAMILY["Lilita One"]], - { uri: LilitaLatinExt, descriptors: { unicodeRange: RANGES.LATIN_EXT } }, - { uri: LilitaLatin, descriptors: { unicodeRange: RANGES.LATIN } }, - ); - - _register( - "Nunito", - FONT_METADATA[FONT_FAMILY.Nunito], - { - uri: NunitoCyrilicExt, - descriptors: { unicodeRange: RANGES.CYRILIC_EXT, weight: "500" }, - }, - { - uri: NunitoCyrilic, - descriptors: { unicodeRange: RANGES.CYRILIC, weight: "500" }, - }, - { - uri: NunitoVietnamese, - descriptors: { unicodeRange: RANGES.VIETNAMESE, weight: "500" }, - }, - { - uri: NunitoLatinExt, - descriptors: { unicodeRange: RANGES.LATIN_EXT, weight: "500" }, - }, - { - uri: NunitoLatin, - descriptors: { unicodeRange: RANGES.LATIN, weight: "500" }, - }, - ); + // _register( + // "Lilita One", + // FONT_METADATA[FONT_FAMILY["Lilita One"]], + // { uri: LilitaLatinExt, descriptors: { unicodeRange: RANGES.LATIN_EXT } }, + // { uri: LilitaLatin, descriptors: { unicodeRange: RANGES.LATIN } }, + // ); + + // _register( + // "Nunito", + // FONT_METADATA[FONT_FAMILY.Nunito], + // { + // uri: NunitoCyrilicExt, + // descriptors: { unicodeRange: RANGES.CYRILIC_EXT, weight: "500" }, + // }, + // { + // uri: NunitoCyrilic, + // descriptors: { unicodeRange: RANGES.CYRILIC, weight: "500" }, + // }, + // { + // uri: NunitoVietnamese, + // descriptors: { unicodeRange: RANGES.VIETNAMESE, weight: "500" }, + // }, + // { + // uri: NunitoLatinExt, + // descriptors: { unicodeRange: RANGES.LATIN_EXT, weight: "500" }, + // }, + // { + // uri: NunitoLatin, + // descriptors: { unicodeRange: RANGES.LATIN, weight: "500" }, + // }, + // ); Fonts._initialized = true; diff --git a/scripts/woff2/woff2-vite-plugins.js b/scripts/woff2/woff2-vite-plugins.js index f25488e86f04..3c530d8d092f 100644 --- a/scripts/woff2/woff2-vite-plugins.js +++ b/scripts/woff2/woff2-vite-plugins.js @@ -1,5 +1,5 @@ -const OSS_FONTS_CDN = - "https://excalidraw.nyc3.cdn.digitaloceanspaces.com/fonts/oss/"; +// const OSS_FONTS_CDN = +// "https://excalidraw.nyc3.cdn.digitaloceanspaces.com/fonts/oss/"; /** * Custom vite plugin to convert url woff2 imports into a text. @@ -51,9 +51,7 @@ module.exports.woff2BrowserPlugin = () => { @font-face { font-family: "Assistant"; - src: url(${OSS_FONTS_CDN}Assistant-Regular-DVxZuzxb.woff2) - format("woff2"), - url(./Assistant-Regular.woff2) format("woff2"); + src: url(./Assistant-Regular-DVxZuzxb.woff2) format("woff2"); font-weight: 400; style: normal; display: swap; @@ -61,9 +59,7 @@ module.exports.woff2BrowserPlugin = () => { @font-face { font-family: "Assistant"; - src: url(${OSS_FONTS_CDN}Assistant-Medium-DrcxCXg3.woff2) - format("woff2"), - url(./Assistant-Medium.woff2) format("woff2"); + src: url(./Assistant-Medium-DrcxCXg3.woff2) format("woff2"); font-weight: 500; style: normal; display: swap; @@ -71,9 +67,7 @@ module.exports.woff2BrowserPlugin = () => { @font-face { font-family: "Assistant"; - src: url(${OSS_FONTS_CDN}Assistant-SemiBold-SCI4bEL9.woff2) - format("woff2"), - url(./Assistant-SemiBold.woff2) format("woff2"); + src: url(./Assistant-SemiBold-SCI4bEL9.woff2) format("woff2"); font-weight: 600; style: normal; display: swap; @@ -81,9 +75,7 @@ module.exports.woff2BrowserPlugin = () => { @font-face { font-family: "Assistant"; - src: url(${OSS_FONTS_CDN}Assistant-Bold-gm-uSS1B.woff2) - format("woff2"), - url(./Assistant-Bold.woff2) format("woff2"); + src: url(./Assistant-Bold-gm-uSS1B.woff2) format("woff2"); font-weight: 700; style: normal; display: swap; @@ -97,7 +89,6 @@ module.exports.woff2BrowserPlugin = () => { ` @@ -105,21 +96,21 @@ module.exports.woff2BrowserPlugin = () => {