Bladeren bron

Merge pull request #179 from logseq/feat/modular-css

feat: modular css
Tienson Qin 5 jaren geleden
bovenliggende
commit
d65280f968
88 gewijzigde bestanden met toevoegingen van 979 en 479 verwijderingen
  1. 1 16
      .gitignore
  2. 58 0
      gulpfile.js
  3. 21 8
      package.json
  4. 0 11
      postcss.config.js
  5. 0 0
      resources/404.html
  6. 0 0
      resources/css/Cascadia.woff2
  7. 0 0
      resources/css/FG_Virgil.woff2
  8. 0 0
      resources/css/codemirror.min.css
  9. 3 3
      resources/css/common.css
  10. 1 0
      resources/css/datepicker.css
  11. 0 0
      resources/css/excalidraw.min.css
  12. 0 0
      resources/css/highlight.css
  13. 200 0
      resources/css/inter.css
  14. 0 0
      resources/css/katex.min.css
  15. 0 0
      resources/css/reveal.min.css
  16. 0 0
      resources/css/reveal_black.min.css
  17. 2 2
      resources/css/style.css
  18. 0 0
      resources/css/table.css
  19. 0 0
      resources/fonts/IBMPlexMono-Text-Latin1.woff
  20. 0 0
      resources/fonts/IBMPlexSans-Bold.woff
  21. 0 0
      resources/fonts/IBMPlexSans-Text.woff
  22. 0 0
      resources/fonts/IBMPlexSans-TextItalic.woff
  23. 0 0
      resources/fonts/inter/Inter-Black.woff
  24. 0 0
      resources/fonts/inter/Inter-Black.woff2
  25. 0 0
      resources/fonts/inter/Inter-BlackItalic.woff
  26. 0 0
      resources/fonts/inter/Inter-BlackItalic.woff2
  27. 0 0
      resources/fonts/inter/Inter-Bold.woff
  28. 0 0
      resources/fonts/inter/Inter-Bold.woff2
  29. 0 0
      resources/fonts/inter/Inter-BoldItalic.woff
  30. 0 0
      resources/fonts/inter/Inter-BoldItalic.woff2
  31. 0 0
      resources/fonts/inter/Inter-ExtraBold.woff
  32. 0 0
      resources/fonts/inter/Inter-ExtraBold.woff2
  33. 0 0
      resources/fonts/inter/Inter-ExtraBoldItalic.woff
  34. 0 0
      resources/fonts/inter/Inter-ExtraBoldItalic.woff2
  35. 0 0
      resources/fonts/inter/Inter-ExtraLight.woff
  36. 0 0
      resources/fonts/inter/Inter-ExtraLight.woff2
  37. 0 0
      resources/fonts/inter/Inter-ExtraLightItalic.woff
  38. 0 0
      resources/fonts/inter/Inter-ExtraLightItalic.woff2
  39. 0 0
      resources/fonts/inter/Inter-Italic.woff
  40. 0 0
      resources/fonts/inter/Inter-Italic.woff2
  41. 0 0
      resources/fonts/inter/Inter-Light.woff
  42. 0 0
      resources/fonts/inter/Inter-Light.woff2
  43. 0 0
      resources/fonts/inter/Inter-LightItalic.woff
  44. 0 0
      resources/fonts/inter/Inter-LightItalic.woff2
  45. 0 0
      resources/fonts/inter/Inter-Medium.woff
  46. 0 0
      resources/fonts/inter/Inter-Medium.woff2
  47. 0 0
      resources/fonts/inter/Inter-MediumItalic.woff
  48. 0 0
      resources/fonts/inter/Inter-MediumItalic.woff2
  49. 0 0
      resources/fonts/inter/Inter-Regular.woff
  50. 0 0
      resources/fonts/inter/Inter-Regular.woff2
  51. 0 0
      resources/fonts/inter/Inter-SemiBold.woff
  52. 0 0
      resources/fonts/inter/Inter-SemiBold.woff2
  53. 0 0
      resources/fonts/inter/Inter-SemiBoldItalic.woff
  54. 0 0
      resources/fonts/inter/Inter-SemiBoldItalic.woff2
  55. 0 0
      resources/fonts/inter/Inter-Thin.woff
  56. 0 0
      resources/fonts/inter/Inter-Thin.woff2
  57. 0 0
      resources/fonts/inter/Inter-ThinItalic.woff
  58. 0 0
      resources/fonts/inter/Inter-ThinItalic.woff2
  59. 0 0
      resources/fonts/inter/Inter-italic.var.woff2
  60. 0 0
      resources/fonts/inter/Inter-roman.var.woff2
  61. 0 0
      resources/fonts/inter/Inter.var.woff2
  62. 0 0
      resources/img/credits.png
  63. 0 0
      resources/img/logo.png
  64. 0 0
      resources/index.html
  65. 0 0
      resources/js/codemirror.min.js
  66. 0 0
      resources/js/excalidraw.min.js
  67. 0 0
      resources/js/highlight.min.js
  68. 0 0
      resources/js/katex.min.js
  69. 0 0
      resources/js/lightning-fs.min.js
  70. 0 0
      resources/js/magic_portal.js
  71. 0 0
      resources/js/mldoc.min.js
  72. 0 0
      resources/js/react-force-graph.min.js
  73. 0 0
      resources/js/reveal.min.js
  74. 0 0
      resources/js/sentry.min.js
  75. 0 0
      resources/js/worker.js
  76. 0 0
      resources/public.css
  77. 0 200
      resources/static/css/inter.css
  78. 0 200
      resources/static/fonts/inter/inter.css
  79. 0 1
      resources/static/js/module-loader.edn
  80. 0 1
      resources/static/js/module-loader.json
  81. 2 7
      shadow-cljs.edn
  82. 4 1
      src/main/frontend/config.cljs
  83. 2 4
      src/main/frontend/extensions/code.cljs
  84. 9 0
      src/main/frontend/extensions/code.css
  85. 0 8
      styles.src.css
  86. 5 3
      tailwind.config.js
  87. 3 6
      tailwind.css
  88. 668 8
      yarn.lock

+ 1 - 16
.gitignore

@@ -12,22 +12,9 @@ pom.xml.asc
 .hg/
 .hg/
 
 
 node_modules/
 node_modules/
-/resources/static/js/*.map
-/resources/static/js/main.js
-/resources/static/js/cljs-runtime
-/resources/static/js/manifest.edn
-/resources/static/js/publishing/*.map
-/resources/static/js/publishing/main.js
-/resources/static/js/publishing/cljs-runtime
-/resources/static/js/publishing/manifest.edn
-/resources/static/style.css
-/resources/static/js/publishing/code-editor.js
-/resources/static/js/code-editor.js
-/resources/static/js/publishing
+static/
 
 
 .cpcache/
 .cpcache/
-/target
-/checkouts
 /src/gen
 /src/gen
 
 
 *.iml
 *.iml
@@ -39,7 +26,5 @@ node_modules/
 .DS_Store
 .DS_Store
 report.html
 report.html
 strings.csv
 strings.csv
-/resources/static/css/tailwind.min.css
-resources/static/style.css
 
 
 .calva
 .calva

+ 58 - 0
gulpfile.js

@@ -0,0 +1,58 @@
+const path = require('path')
+const gulp = require('gulp')
+const postcss = require('gulp-postcss')
+const concat = require('gulp-concat')
+const cleanCSS = require('gulp-clean-css')
+const del = require('del')
+
+const outputPath = path.join(__dirname, 'static')
+const resourcesPath = path.join(__dirname, 'resources')
+const sourcePath = path.join(__dirname, 'src')
+const resourceFilePath = path.join(resourcesPath, '**')
+
+const tailwind = {
+  paths: [path.join(__dirname, 'tailwind.css'), path.join(sourcePath, '**/*.css')],
+  outputDir: path.join(outputPath, 'css'),
+  outputName: 'tailwind.build.css',
+}
+
+const css = {
+  watchCSS() {
+    return gulp.watch(tailwind.paths, { ignoreInitial: false }, css._buildTailwind)
+  },
+
+  buildCSS(...params) {
+    return gulp.series(css._buildTailwind, css._optimizeCSSForRelease)(...params)
+  },
+
+  _buildTailwind() {
+    return gulp.src(tailwind.paths)
+      .pipe(postcss())
+      .pipe(concat(tailwind.outputName))
+      .pipe(gulp.dest(tailwind.outputDir))
+  },
+
+  _optimizeCSSForRelease() {
+    return gulp.src(path.join(outputPath, 'css', 'style.css'))
+      .pipe(cleanCSS())
+      .pipe(gulp.dest(path.join(outputPath, 'css')))
+  },
+}
+
+const common = {
+  clean() {
+    return del(outputPath)
+  },
+
+  syncResourceFile() {
+    return gulp.src(resourceFilePath).pipe(gulp.dest(outputPath))
+  },
+
+  keepSyncResourceFile() {
+    return gulp.watch(resourceFilePath, { ignoreInitial: false }, common.syncResourceFile)
+  }
+}
+
+exports.clean = common.clean
+exports.watch = gulp.parallel(common.keepSyncResourceFile, css.watchCSS)
+exports.build = gulp.series(common.syncResourceFile, css.buildCSS)

+ 21 - 8
package.json

@@ -3,9 +3,14 @@
     "version": "0.0.1",
     "version": "0.0.1",
     "private": true,
     "private": true,
     "devDependencies": {
     "devDependencies": {
-        "@fullhuman/postcss-purgecss": "^2.1.2",
         "@tailwindcss/ui": "^0.1.3",
         "@tailwindcss/ui": "^0.1.3",
         "cssnano": "^4.1.10",
         "cssnano": "^4.1.10",
+        "del": "^6.0.0",
+        "gulp": "^4.0.2",
+        "gulp-clean-css": "^4.3.0",
+        "gulp-concat": "^2.6.1",
+        "gulp-postcss": "^9.0.0",
+        "npm-run-all": "^4.1.5",
         "postcss": "^7.0.21",
         "postcss": "^7.0.21",
         "postcss-cli": "^6.1.3",
         "postcss-cli": "^6.1.3",
         "purgecss": "^2.1.0",
         "purgecss": "^2.1.0",
@@ -13,13 +18,21 @@
         "tailwindcss": "^1.3.4"
         "tailwindcss": "^1.3.4"
     },
     },
     "scripts": {
     "scripts": {
-        "watch": "clojure -A:cljs watch app publishing",
-        "release": "clojure -A:cljs release app publishing",
-        "watch-app": "clojure -A:cljs watch app",
-        "release-app": "clojure -A:cljs release app",
-        "debug": "clojure -A:cljs release app --debug",
-        "report": "clojure -A:cljs run shadow.cljs.build-report app report.html",
-        "clean": "/usr/bin/rm -rf target; /usr/bin/rm -rf ./resources/static/js/compiled; /usr/bin/rm -rf ./resources/static/js/cljs-runtime; /usr/bin/rm -rf ./resources/static/js/publishing; /usr/bin/rm -rf ./resources/static/js/main.js;"
+        "watch": "run-p cljs:watch gulp:watch",
+        "release": "run-s cljs:release gulp:build",
+        "watch-app": "run-p cljs:watch-app gulp:watch",
+        "release-app": "run-s cljs:release-app gulp:build",
+        "dev-release-app": "run-s cljs:dev-release-app gulp:build",
+        "clean": "gulp clean",
+        "gulp:watch": "gulp watch",
+        "gulp:build": "NODE_ENV=production gulp build",
+        "cljs:watch": "clojure -A:cljs watch app publishing",
+        "cljs:release": "clojure -A:cljs release app publishing",
+        "cljs:watch-app": "clojure -A:cljs watch app",
+        "cljs:release-app": "clojure -A:cljs release app",
+        "cljs:dev-release-app": "clojure -A:cljs release app --config-merge '{:closure-defines {frontend.config/DEV-RELEASE true}}'",
+        "cljs:debug": "clojure -A:cljs release app --debug",
+        "cljs:report": "clojure -A:cljs run shadow.cljs.build-report app report.html"
     },
     },
     "dependencies": {
     "dependencies": {
         "codemirror": "^5.58.1",
         "codemirror": "^5.58.1",

+ 0 - 11
postcss.config.js

@@ -3,16 +3,5 @@ module.exports = (ctx) => ({
     require("autoprefixer"),
     require("autoprefixer"),
     require("tailwindcss")("tailwind.config.js"),
     require("tailwindcss")("tailwind.config.js"),
     ctx.env === "production" ? require("cssnano")({ preset: "default" }) : null,
     ctx.env === "production" ? require("cssnano")({ preset: "default" }) : null,
-    ctx.env === "production"
-      ? require("@fullhuman/postcss-purgecss")({
-        content: [
-          '../resources/static/js/main.js',
-          // etc.
-        ],
-        // https://tailwindcss.com/docs/controlling-file-size#setting-up-purgecss
-        // without this we miss keeping eg. `w-1/2`
-        defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || [],
-      })
-      : null,
   ],
   ],
 });
 });

+ 0 - 0
resources/static/404.html → resources/404.html


+ 0 - 0
resources/static/css/Cascadia.woff2 → resources/css/Cascadia.woff2


+ 0 - 0
resources/static/css/FG_Virgil.woff2 → resources/css/FG_Virgil.woff2


+ 0 - 0
resources/static/css/codemirror.min.css → resources/css/codemirror.min.css


+ 3 - 3
resources/static/css/common.css → resources/css/common.css

@@ -875,13 +875,13 @@ iframe {
 .aspect-ratio-square {
 .aspect-ratio-square {
     padding-top: 100%;
     padding-top: 100%;
 }
 }
-.aspect-ratio-16/9 {
+.aspect-ratio-16\/9 {
     padding-top: 56.25%;
     padding-top: 56.25%;
 }
 }
-.aspect-ratio-4/3 {
+.aspect-ratio-4\/3 {
     padding-top: 75%;
     padding-top: 75%;
 }
 }
-.aspect-ratio-21/9 {
+.aspect-ratio-21\/9 {
     padding-top: 42.86%;
     padding-top: 42.86%;
 }
 }
 
 

+ 1 - 0
resources/static/css/datepicker.css → resources/css/datepicker.css

@@ -227,3 +227,4 @@
 }
 }
 /*----------------------------------------------------------------------------------------
 /*----------------------------------------------------------------------------------------
   END OF DATE PICKER SECTION...
   END OF DATE PICKER SECTION...
+----------------------------------------------------------------------------------------*/

+ 0 - 0
resources/static/css/excalidraw.min.css → resources/css/excalidraw.min.css


+ 0 - 0
resources/static/css/highlight.css → resources/css/highlight.css


+ 200 - 0
resources/css/inter.css

@@ -0,0 +1,200 @@
+@font-face {
+  font-family: 'Inter';
+  font-style:  normal;
+  font-weight: 100;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-Thin.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-Thin.woff?v=3.15") format("woff");
+}
+@font-face {
+  font-family: 'Inter';
+  font-style:  italic;
+  font-weight: 100;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-ThinItalic.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-ThinItalic.woff?v=3.15") format("woff");
+}
+
+@font-face {
+  font-family: 'Inter';
+  font-style:  normal;
+  font-weight: 200;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-ExtraLight.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-ExtraLight.woff?v=3.15") format("woff");
+}
+@font-face {
+  font-family: 'Inter';
+  font-style:  italic;
+  font-weight: 200;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-ExtraLightItalic.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-ExtraLightItalic.woff?v=3.15") format("woff");
+}
+
+@font-face {
+  font-family: 'Inter';
+  font-style:  normal;
+  font-weight: 300;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-Light.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-Light.woff?v=3.15") format("woff");
+}
+@font-face {
+  font-family: 'Inter';
+  font-style:  italic;
+  font-weight: 300;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-LightItalic.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-LightItalic.woff?v=3.15") format("woff");
+}
+
+@font-face {
+  font-family: 'Inter';
+  font-style:  normal;
+  font-weight: 400;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-Regular.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-Regular.woff?v=3.15") format("woff");
+}
+@font-face {
+  font-family: 'Inter';
+  font-style:  italic;
+  font-weight: 400;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-Italic.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-Italic.woff?v=3.15") format("woff");
+}
+
+@font-face {
+  font-family: 'Inter';
+  font-style:  normal;
+  font-weight: 500;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-Medium.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-Medium.woff?v=3.15") format("woff");
+}
+@font-face {
+  font-family: 'Inter';
+  font-style:  italic;
+  font-weight: 500;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-MediumItalic.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-MediumItalic.woff?v=3.15") format("woff");
+}
+
+@font-face {
+  font-family: 'Inter';
+  font-style:  normal;
+  font-weight: 600;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-SemiBold.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-SemiBold.woff?v=3.15") format("woff");
+}
+@font-face {
+  font-family: 'Inter';
+  font-style:  italic;
+  font-weight: 600;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-SemiBoldItalic.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-SemiBoldItalic.woff?v=3.15") format("woff");
+}
+
+@font-face {
+  font-family: 'Inter';
+  font-style:  normal;
+  font-weight: 700;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-Bold.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-Bold.woff?v=3.15") format("woff");
+}
+@font-face {
+  font-family: 'Inter';
+  font-style:  italic;
+  font-weight: 700;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-BoldItalic.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-BoldItalic.woff?v=3.15") format("woff");
+}
+
+@font-face {
+  font-family: 'Inter';
+  font-style:  normal;
+  font-weight: 800;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-ExtraBold.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-ExtraBold.woff?v=3.15") format("woff");
+}
+@font-face {
+  font-family: 'Inter';
+  font-style:  italic;
+  font-weight: 800;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-ExtraBoldItalic.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-ExtraBoldItalic.woff?v=3.15") format("woff");
+}
+
+@font-face {
+  font-family: 'Inter';
+  font-style:  normal;
+  font-weight: 900;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-Black.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-Black.woff?v=3.15") format("woff");
+}
+@font-face {
+  font-family: 'Inter';
+  font-style:  italic;
+  font-weight: 900;
+  font-display: swap;
+  src: url("/static/fonts/inter/Inter-BlackItalic.woff2?v=3.15") format("woff2"),
+       url("/static/fonts/inter/Inter-BlackItalic.woff?v=3.15") format("woff");
+}
+
+/* -------------------------------------------------------
+Variable font.
+Usage:
+
+  html { font-family: 'Inter', sans-serif; }
+  @supports (font-variation-settings: normal) {
+    html { font-family: 'Inter var', sans-serif; }
+  }
+*/
+@font-face {
+  font-family: 'Inter var';
+  font-weight: 100 900;
+  font-display: swap;
+  font-style: normal;
+  font-named-instance: 'Regular';
+  src: url("/static/fonts/inter/Inter-roman.var.woff2?v=3.15") format("woff2");
+}
+@font-face {
+  font-family: 'Inter var';
+  font-weight: 100 900;
+  font-display: swap;
+  font-style: italic;
+  font-named-instance: 'Italic';
+  src: url("/static/fonts/inter/Inter-italic.var.woff2?v=3.15") format("woff2");
+}
+
+
+/* --------------------------------------------------------------------------
+[EXPERIMENTAL] Multi-axis, single variable font.
+
+Slant axis is not yet widely supported (as of February 2019) and thus this
+multi-axis single variable font is opt-in rather than the default.
+
+When using this, you will probably need to set font-variation-settings
+explicitly, e.g.
+
+  * { font-variation-settings: "slnt" 0deg }
+  .italic { font-variation-settings: "slnt" 10deg }
+
+*/
+@font-face {
+  font-family: 'Inter var experimental';
+  font-weight: 100 900;
+  font-display: swap;
+  font-style: oblique 0deg 10deg;
+  src: url("/static/fonts/inter/Inter.var.woff2?v=3.15") format("woff2");
+}

+ 0 - 0
resources/static/css/katex.min.css → resources/css/katex.min.css


+ 0 - 0
resources/static/css/reveal.min.css → resources/css/reveal.min.css


+ 0 - 0
resources/static/css/reveal_black.min.css → resources/css/reveal_black.min.css


+ 2 - 2
resources/static/css/style.css → resources/css/style.css

@@ -1,9 +1,9 @@
 @charset "utf-8";
 @charset "utf-8";
-@import "../fonts/inter/inter.css";
+@import "./inter.css";
 @import "./reveal.min.css";
 @import "./reveal.min.css";
 @import "./reveal_black.min.css";
 @import "./reveal_black.min.css";
 @import "./katex.min.css";
 @import "./katex.min.css";
-@import "./tailwind.min.css";
+@import "./tailwind.build.css"; /* Build by gulp. Check `_buildTailwind` for more detail */
 @import "./common.css";
 @import "./common.css";
 @import "./datepicker.css";
 @import "./datepicker.css";
 @import "./highlight.css";
 @import "./highlight.css";

+ 0 - 0
resources/static/css/table.css → resources/css/table.css


+ 0 - 0
resources/static/fonts/IBMPlexMono-Text-Latin1.woff → resources/fonts/IBMPlexMono-Text-Latin1.woff


+ 0 - 0
resources/static/fonts/IBMPlexSans-Bold.woff → resources/fonts/IBMPlexSans-Bold.woff


+ 0 - 0
resources/static/fonts/IBMPlexSans-Text.woff → resources/fonts/IBMPlexSans-Text.woff


+ 0 - 0
resources/static/fonts/IBMPlexSans-TextItalic.woff → resources/fonts/IBMPlexSans-TextItalic.woff


+ 0 - 0
resources/static/fonts/inter/Inter-Black.woff → resources/fonts/inter/Inter-Black.woff


+ 0 - 0
resources/static/fonts/inter/Inter-Black.woff2 → resources/fonts/inter/Inter-Black.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-BlackItalic.woff → resources/fonts/inter/Inter-BlackItalic.woff


+ 0 - 0
resources/static/fonts/inter/Inter-BlackItalic.woff2 → resources/fonts/inter/Inter-BlackItalic.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-Bold.woff → resources/fonts/inter/Inter-Bold.woff


+ 0 - 0
resources/static/fonts/inter/Inter-Bold.woff2 → resources/fonts/inter/Inter-Bold.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-BoldItalic.woff → resources/fonts/inter/Inter-BoldItalic.woff


+ 0 - 0
resources/static/fonts/inter/Inter-BoldItalic.woff2 → resources/fonts/inter/Inter-BoldItalic.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-ExtraBold.woff → resources/fonts/inter/Inter-ExtraBold.woff


+ 0 - 0
resources/static/fonts/inter/Inter-ExtraBold.woff2 → resources/fonts/inter/Inter-ExtraBold.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-ExtraBoldItalic.woff → resources/fonts/inter/Inter-ExtraBoldItalic.woff


+ 0 - 0
resources/static/fonts/inter/Inter-ExtraBoldItalic.woff2 → resources/fonts/inter/Inter-ExtraBoldItalic.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-ExtraLight.woff → resources/fonts/inter/Inter-ExtraLight.woff


+ 0 - 0
resources/static/fonts/inter/Inter-ExtraLight.woff2 → resources/fonts/inter/Inter-ExtraLight.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-ExtraLightItalic.woff → resources/fonts/inter/Inter-ExtraLightItalic.woff


+ 0 - 0
resources/static/fonts/inter/Inter-ExtraLightItalic.woff2 → resources/fonts/inter/Inter-ExtraLightItalic.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-Italic.woff → resources/fonts/inter/Inter-Italic.woff


+ 0 - 0
resources/static/fonts/inter/Inter-Italic.woff2 → resources/fonts/inter/Inter-Italic.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-Light.woff → resources/fonts/inter/Inter-Light.woff


+ 0 - 0
resources/static/fonts/inter/Inter-Light.woff2 → resources/fonts/inter/Inter-Light.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-LightItalic.woff → resources/fonts/inter/Inter-LightItalic.woff


+ 0 - 0
resources/static/fonts/inter/Inter-LightItalic.woff2 → resources/fonts/inter/Inter-LightItalic.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-Medium.woff → resources/fonts/inter/Inter-Medium.woff


+ 0 - 0
resources/static/fonts/inter/Inter-Medium.woff2 → resources/fonts/inter/Inter-Medium.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-MediumItalic.woff → resources/fonts/inter/Inter-MediumItalic.woff


+ 0 - 0
resources/static/fonts/inter/Inter-MediumItalic.woff2 → resources/fonts/inter/Inter-MediumItalic.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-Regular.woff → resources/fonts/inter/Inter-Regular.woff


+ 0 - 0
resources/static/fonts/inter/Inter-Regular.woff2 → resources/fonts/inter/Inter-Regular.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-SemiBold.woff → resources/fonts/inter/Inter-SemiBold.woff


+ 0 - 0
resources/static/fonts/inter/Inter-SemiBold.woff2 → resources/fonts/inter/Inter-SemiBold.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-SemiBoldItalic.woff → resources/fonts/inter/Inter-SemiBoldItalic.woff


+ 0 - 0
resources/static/fonts/inter/Inter-SemiBoldItalic.woff2 → resources/fonts/inter/Inter-SemiBoldItalic.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-Thin.woff → resources/fonts/inter/Inter-Thin.woff


+ 0 - 0
resources/static/fonts/inter/Inter-Thin.woff2 → resources/fonts/inter/Inter-Thin.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-ThinItalic.woff → resources/fonts/inter/Inter-ThinItalic.woff


+ 0 - 0
resources/static/fonts/inter/Inter-ThinItalic.woff2 → resources/fonts/inter/Inter-ThinItalic.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-italic.var.woff2 → resources/fonts/inter/Inter-italic.var.woff2


+ 0 - 0
resources/static/fonts/inter/Inter-roman.var.woff2 → resources/fonts/inter/Inter-roman.var.woff2


+ 0 - 0
resources/static/fonts/inter/Inter.var.woff2 → resources/fonts/inter/Inter.var.woff2


+ 0 - 0
resources/static/img/credits.png → resources/img/credits.png


+ 0 - 0
resources/static/img/logo.png → resources/img/logo.png


+ 0 - 0
resources/static/index.html → resources/index.html


+ 0 - 0
resources/static/js/codemirror.min.js → resources/js/codemirror.min.js


+ 0 - 0
resources/static/js/excalidraw.min.js → resources/js/excalidraw.min.js


+ 0 - 0
resources/static/js/highlight.min.js → resources/js/highlight.min.js


+ 0 - 0
resources/static/js/katex.min.js → resources/js/katex.min.js


+ 0 - 0
resources/static/js/lightning-fs.min.js → resources/js/lightning-fs.min.js


+ 0 - 0
resources/static/js/magic_portal.js → resources/js/magic_portal.js


+ 0 - 0
resources/static/js/mldoc.min.js → resources/js/mldoc.min.js


+ 0 - 0
resources/static/js/react-force-graph.min.js → resources/js/react-force-graph.min.js


+ 0 - 0
resources/static/js/reveal.min.js → resources/js/reveal.min.js


+ 0 - 0
resources/static/js/sentry.min.js → resources/js/sentry.min.js


+ 0 - 0
resources/static/js/worker.js → resources/js/worker.js


+ 0 - 0
resources/static/public.css → resources/public.css


+ 0 - 200
resources/static/css/inter.css

@@ -1,200 +0,0 @@
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 100;
-  font-display: swap;
-  src: url("Inter-Thin-BETA.woff2") format("woff2"),
-       url("Inter-Thin-BETA.woff") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 100;
-  font-display: swap;
-  src: url("Inter-ThinItalic-BETA.woff2") format("woff2"),
-       url("Inter-ThinItalic-BETA.woff") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 200;
-  font-display: swap;
-  src: url("Inter-ExtraLight-BETA.woff2") format("woff2"),
-       url("Inter-ExtraLight-BETA.woff") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 200;
-  font-display: swap;
-  src: url("Inter-ExtraLightItalic-BETA.woff2") format("woff2"),
-       url("Inter-ExtraLightItalic-BETA.woff") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 300;
-  font-display: swap;
-  src: url("Inter-Light-BETA.woff2") format("woff2"),
-       url("Inter-Light-BETA.woff") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 300;
-  font-display: swap;
-  src: url("Inter-LightItalic-BETA.woff2") format("woff2"),
-       url("Inter-LightItalic-BETA.woff") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 400;
-  font-display: swap;
-  src: url("Inter-Regular.woff2") format("woff2"),
-       url("Inter-Regular.woff") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 400;
-  font-display: swap;
-  src: url("Inter-Italic.woff2") format("woff2"),
-       url("Inter-Italic.woff") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 500;
-  font-display: swap;
-  src: url("Inter-Medium.woff2") format("woff2"),
-       url("Inter-Medium.woff") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 500;
-  font-display: swap;
-  src: url("Inter-MediumItalic.woff2") format("woff2"),
-       url("Inter-MediumItalic.woff") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 600;
-  font-display: swap;
-  src: url("Inter-SemiBold.woff2") format("woff2"),
-       url("Inter-SemiBold.woff") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 600;
-  font-display: swap;
-  src: url("Inter-SemiBoldItalic.woff2") format("woff2"),
-       url("Inter-SemiBoldItalic.woff") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 700;
-  font-display: swap;
-  src: url("Inter-Bold.woff2") format("woff2"),
-       url("Inter-Bold.woff") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 700;
-  font-display: swap;
-  src: url("Inter-BoldItalic.woff2") format("woff2"),
-       url("Inter-BoldItalic.woff") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 800;
-  font-display: swap;
-  src: url("Inter-ExtraBold.woff2") format("woff2"),
-       url("Inter-ExtraBold.woff") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 800;
-  font-display: swap;
-  src: url("Inter-ExtraBoldItalic.woff2") format("woff2"),
-       url("Inter-ExtraBoldItalic.woff") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 900;
-  font-display: swap;
-  src: url("Inter-Black.woff2") format("woff2"),
-       url("Inter-Black.woff") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 900;
-  font-display: swap;
-  src: url("Inter-BlackItalic.woff2") format("woff2"),
-       url("Inter-BlackItalic.woff") format("woff");
-}
-
-/* -------------------------------------------------------
-Variable font.
-Usage:
-
-  html { font-family: 'Inter', sans-serif; }
-  @supports (font-variation-settings: normal) {
-    html { font-family: 'Inter var', sans-serif; }
-  }
-*/
-@font-face {
-  font-family: 'Inter var';
-  font-weight: 100 900;
-  font-display: swap;
-  font-style: normal;
-  font-named-instance: 'Regular';
-  src: url("Inter-upright.var.woff2") format("woff2");
-}
-@font-face {
-  font-family: 'Inter var';
-  font-weight: 100 900;
-  font-display: swap;
-  font-style: italic;
-  font-named-instance: 'Italic';
-  src: url("Inter-italic.var.woff2") format("woff2");
-}
-
-
-/* --------------------------------------------------------------------------
-[EXPERIMENTAL] Multi-axis, single variable font.
-
-Slant axis is not yet widely supported (as of February 2019) and thus this
-multi-axis single variable font is opt-in rather than the default.
-
-When using this, you will probably need to set font-variation-settings
-explicitly, e.g.
-
-  * { font-variation-settings: "slnt" 0deg }
-  .italic { font-variation-settings: "slnt" 10deg }
-
-*/
-@font-face {
-  font-family: 'Inter var experimental';
-  font-weight: 100 900;
-  font-display: swap;
-  font-style: oblique 0deg 10deg;
-  src: url("Inter.var.woff2") format("woff2");
-}

+ 0 - 200
resources/static/fonts/inter/inter.css

@@ -1,200 +0,0 @@
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 100;
-  font-display: swap;
-  src: url("Inter-Thin.woff2?v=3.15") format("woff2"),
-       url("Inter-Thin.woff?v=3.15") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 100;
-  font-display: swap;
-  src: url("Inter-ThinItalic.woff2?v=3.15") format("woff2"),
-       url("Inter-ThinItalic.woff?v=3.15") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 200;
-  font-display: swap;
-  src: url("Inter-ExtraLight.woff2?v=3.15") format("woff2"),
-       url("Inter-ExtraLight.woff?v=3.15") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 200;
-  font-display: swap;
-  src: url("Inter-ExtraLightItalic.woff2?v=3.15") format("woff2"),
-       url("Inter-ExtraLightItalic.woff?v=3.15") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 300;
-  font-display: swap;
-  src: url("Inter-Light.woff2?v=3.15") format("woff2"),
-       url("Inter-Light.woff?v=3.15") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 300;
-  font-display: swap;
-  src: url("Inter-LightItalic.woff2?v=3.15") format("woff2"),
-       url("Inter-LightItalic.woff?v=3.15") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 400;
-  font-display: swap;
-  src: url("Inter-Regular.woff2?v=3.15") format("woff2"),
-       url("Inter-Regular.woff?v=3.15") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 400;
-  font-display: swap;
-  src: url("Inter-Italic.woff2?v=3.15") format("woff2"),
-       url("Inter-Italic.woff?v=3.15") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 500;
-  font-display: swap;
-  src: url("Inter-Medium.woff2?v=3.15") format("woff2"),
-       url("Inter-Medium.woff?v=3.15") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 500;
-  font-display: swap;
-  src: url("Inter-MediumItalic.woff2?v=3.15") format("woff2"),
-       url("Inter-MediumItalic.woff?v=3.15") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 600;
-  font-display: swap;
-  src: url("Inter-SemiBold.woff2?v=3.15") format("woff2"),
-       url("Inter-SemiBold.woff?v=3.15") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 600;
-  font-display: swap;
-  src: url("Inter-SemiBoldItalic.woff2?v=3.15") format("woff2"),
-       url("Inter-SemiBoldItalic.woff?v=3.15") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 700;
-  font-display: swap;
-  src: url("Inter-Bold.woff2?v=3.15") format("woff2"),
-       url("Inter-Bold.woff?v=3.15") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 700;
-  font-display: swap;
-  src: url("Inter-BoldItalic.woff2?v=3.15") format("woff2"),
-       url("Inter-BoldItalic.woff?v=3.15") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 800;
-  font-display: swap;
-  src: url("Inter-ExtraBold.woff2?v=3.15") format("woff2"),
-       url("Inter-ExtraBold.woff?v=3.15") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 800;
-  font-display: swap;
-  src: url("Inter-ExtraBoldItalic.woff2?v=3.15") format("woff2"),
-       url("Inter-ExtraBoldItalic.woff?v=3.15") format("woff");
-}
-
-@font-face {
-  font-family: 'Inter';
-  font-style:  normal;
-  font-weight: 900;
-  font-display: swap;
-  src: url("Inter-Black.woff2?v=3.15") format("woff2"),
-       url("Inter-Black.woff?v=3.15") format("woff");
-}
-@font-face {
-  font-family: 'Inter';
-  font-style:  italic;
-  font-weight: 900;
-  font-display: swap;
-  src: url("Inter-BlackItalic.woff2?v=3.15") format("woff2"),
-       url("Inter-BlackItalic.woff?v=3.15") format("woff");
-}
-
-/* -------------------------------------------------------
-Variable font.
-Usage:
-
-  html { font-family: 'Inter', sans-serif; }
-  @supports (font-variation-settings: normal) {
-    html { font-family: 'Inter var', sans-serif; }
-  }
-*/
-@font-face {
-  font-family: 'Inter var';
-  font-weight: 100 900;
-  font-display: swap;
-  font-style: normal;
-  font-named-instance: 'Regular';
-  src: url("Inter-roman.var.woff2?v=3.15") format("woff2");
-}
-@font-face {
-  font-family: 'Inter var';
-  font-weight: 100 900;
-  font-display: swap;
-  font-style: italic;
-  font-named-instance: 'Italic';
-  src: url("Inter-italic.var.woff2?v=3.15") format("woff2");
-}
-
-
-/* --------------------------------------------------------------------------
-[EXPERIMENTAL] Multi-axis, single variable font.
-
-Slant axis is not yet widely supported (as of February 2019) and thus this
-multi-axis single variable font is opt-in rather than the default.
-
-When using this, you will probably need to set font-variation-settings
-explicitly, e.g.
-
-  * { font-variation-settings: "slnt" 0deg }
-  .italic { font-variation-settings: "slnt" 10deg }
-
-*/
-@font-face {
-  font-family: 'Inter var experimental';
-  font-weight: 100 900;
-  font-display: swap;
-  font-style: oblique 0deg 10deg;
-  src: url("Inter.var.woff2?v=3.15") format("woff2");
-}

+ 0 - 1
resources/static/js/module-loader.edn

@@ -1 +0,0 @@
-{:module-uris {:main [], :code-editor ["/static/js/code-editor.js"]}, :module-infos {:main nil, :code-editor #{:main}}}

+ 0 - 1
resources/static/js/module-loader.json

@@ -1 +0,0 @@
-{"module-uris":{"main":[],"code-editor":["/static/js/code-editor.js"]},"module-infos":{"main":null,"code-editor":["main"]}}

+ 2 - 7
shadow-cljs.edn

@@ -11,18 +11,13 @@
              {:entries [frontend.extensions.code]
              {:entries [frontend.extensions.code]
               :depends-on #{:main}}}
               :depends-on #{:main}}}
 
 
-   :output-dir "./resources/static/js"
+   :output-dir "./static/js"
    :asset-path "/static/js"
    :asset-path "/static/js"
    :release {:asset-path "https://asset.logseq.com/static/js"}
    :release {:asset-path "https://asset.logseq.com/static/js"}
    :compiler-options {:infer-externs :auto
    :compiler-options {:infer-externs :auto
                       :output-feature-set :es6
                       :output-feature-set :es6
                       :externs ["datascript/externs.js"
                       :externs ["datascript/externs.js"
                                 "externs.js"]}
                                 "externs.js"]}
-   ;; TODO: purge-css not working properly
-   ;; :build-hooks [(shadow.hooks/purge-css
-   ;;                {:css-source "node_modules/@tailwindcss/ui/dist/tailwind-ui.min.css"
-   ;;                 :js-globs   ["resources/static/js/*.js"]
-   ;;                 :public-dir    "resources/static/css"})]
    :devtools
    :devtools
    ;; before live-reloading any code call this function
    ;; before live-reloading any code call this function
    {:before-load frontend.core/stop
    {:before-load frontend.core/stop
@@ -39,7 +34,7 @@
 
 
    :release {:asset-path "https://asset.logseq.com/static/js"}
    :release {:asset-path "https://asset.logseq.com/static/js"}
 
 
-   :output-dir "../resources/static/js/publishing"
+   :output-dir "./static/js/publishing"
    :asset-path "/static/js"
    :asset-path "/static/js"
 
 
    :closure-defines {frontend.config/PUBLISHING true}
    :closure-defines {frontend.config/PUBLISHING true}

+ 4 - 1
src/main/frontend/config.cljs

@@ -4,7 +4,10 @@
             [frontend.state :as state]
             [frontend.state :as state]
             [frontend.util :as util]))
             [frontend.util :as util]))
 
 
-(defonce dev? ^boolean goog.DEBUG)
+(goog-define DEV-RELEASE false)
+(defonce dev-release? DEV-RELEASE)
+(defonce dev? ^boolean (or dev-release? goog.DEBUG))
+
 (goog-define PUBLISHING false)
 (goog-define PUBLISHING false)
 (defonce publishing? PUBLISHING)
 (defonce publishing? PUBLISHING)
 
 

+ 2 - 4
src/main/frontend/extensions/code.cljs

@@ -137,10 +137,8 @@
                  (when-let [pos-meta (::pos-meta state)]
                  (when-let [pos-meta (::pos-meta state)]
                    (reset! pos-meta (last (:rum/args state)))))}
                    (reset! pos-meta (last (:rum/args state)))))}
   [state config id attr code pos_meta]
   [state config id attr code pos_meta]
-  [:div.relative
-   [:div.absolute.top-0.right-0.p-1.text-sm.text-gray-500
-    {:style {:z-index 2
-             :background "white"}}
+  [:div.extensions__code
+   [:div.extensions__code-lang
     (let [mode (get attr :data-lang "javascript")]
     (let [mode (get attr :data-lang "javascript")]
       (if (= mode "text/x-clojure")
       (if (= mode "text/x-clojure")
         "clojure"
         "clojure"

+ 9 - 0
src/main/frontend/extensions/code.css

@@ -0,0 +1,9 @@
+.extensions__code {
+    @apply relative
+}
+
+.extensions__code-lang {
+    @apply absolute top-0 right-0 p-1 text-sm text-gray-500;
+    z-index: 2;
+    background: white;
+}

+ 0 - 8
styles.src.css

@@ -1,8 +0,0 @@
-@tailwind base;
-@tailwind components;
-
-.green-example {
-    @apply text-green-700 bg-green-200;
-}
-
-@tailwind utilities;

+ 5 - 3
tailwind.config.js

@@ -1,6 +1,8 @@
 module.exports = {
 module.exports = {
-  theme: {
-    extend: {},
-  },
+  purge: [
+    './src/**/*.js',
+    './src/**/*.cljs',
+    './resources/**/*.html',
+  ],
   plugins: [require("@tailwindcss/ui")],
   plugins: [require("@tailwindcss/ui")],
 };
 };

+ 3 - 6
tailwind.css

@@ -1,6 +1,3 @@
-@charset "utf-8";
-/* purgecss start ignore */
-@tailwind  base;
-@tailwind  components;
-/* purgecss end ignore */
-@tailwind  utilities;
+@tailwind base;
+@tailwind components;
+@tailwind utilities;

File diff suppressed because it is too large
+ 668 - 8
yarn.lock


Some files were not shown because too many files changed in this diff