This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
stdenv,
|
||||
stdenvNoCC,
|
||||
fetchzip,
|
||||
runCommand,
|
||||
config,
|
||||
makeWrapper,
|
||||
nodejs,
|
||||
@@ -13,6 +14,7 @@
|
||||
openssl,
|
||||
inputs,
|
||||
system,
|
||||
frontendPatches ? [ ./gitea-document-typography.patch ],
|
||||
}:
|
||||
|
||||
let
|
||||
@@ -153,6 +155,7 @@ let
|
||||
pname = "affine-frontend";
|
||||
inherit version src yarnOfflineCache;
|
||||
missingHashes = ./missing-hashes.json;
|
||||
patches = frontendPatches;
|
||||
|
||||
nativeBuildInputs = [
|
||||
nodejs
|
||||
@@ -186,6 +189,23 @@ let
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
|
||||
frontendStatic = runCommand "affine-frontend-static-${version}" {
|
||||
inherit version;
|
||||
passthru = { inherit revision; };
|
||||
meta = {
|
||||
description = "Source-built AFFiNE web assets with document typography patches";
|
||||
license = [ lib.licenses.mit lib.licenses.mpl20 ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
} ''
|
||||
mkdir -p "$out/admin" "$out/mobile" "$out/licenses"
|
||||
cp -RL ${frontend}/web/. "$out/"
|
||||
cp -RL ${frontend}/admin/. "$out/admin/"
|
||||
cp -RL ${frontend}/mobile/. "$out/mobile/"
|
||||
cp ${src}/LICENSE ${src}/LICENSE-MIT "$out/licenses/"
|
||||
cp ${src}/packages/backend/server/LICENSE "$out/licenses/AFFINE-EE-and-MPL"
|
||||
'';
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "affine";
|
||||
@@ -282,7 +302,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit frontend native prismaEngines prismaQueryEngine prismaSchemaEngine yarnOfflineCache18;
|
||||
inherit frontend frontendStatic native prismaEngines prismaQueryEngine prismaSchemaEngine yarnOfflineCache18;
|
||||
};
|
||||
|
||||
meta = {
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
diff --git a/blocksuite/affine/blocks/root/src/page/page-root-block.ts b/blocksuite/affine/blocks/root/src/page/page-root-block.ts
|
||||
--- a/blocksuite/affine/blocks/root/src/page/page-root-block.ts
|
||||
+++ b/blocksuite/affine/blocks/root/src/page/page-root-block.ts
|
||||
@@ -103,0 +104,138 @@ export class PageRootBlockComponent extends BlockComponent<RootBlockModel> {
|
||||
+
|
||||
+ /* Page document typography excludes canvas and database block trees. */
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-paragraph:not(affine-edgeless-root *, affine-database *)
|
||||
+ > .affine-block-component {
|
||||
+ margin: 0 !important;
|
||||
+ }
|
||||
+
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-list:not(affine-edgeless-root *, affine-database *)
|
||||
+ > .affine-block-component {
|
||||
+ margin: 0 0 4px !important;
|
||||
+ }
|
||||
+
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-paragraph:not(affine-edgeless-root *, affine-database *)
|
||||
+ .affine-paragraph-rich-text-wrapper.text:not(affine-edgeless-root *, affine-database *),
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-list:not(affine-edgeless-root *, affine-database *)
|
||||
+ .affine-list-rich-text-wrapper:not(affine-edgeless-root *, affine-database *) {
|
||||
+ line-height: 1.5;
|
||||
+ }
|
||||
+
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-paragraph:not(affine-edgeless-root *, affine-database *)
|
||||
+ .affine-paragraph-rich-text-wrapper.text:not(affine-edgeless-root *, affine-database *) {
|
||||
+ margin: 0 0 16px;
|
||||
+ }
|
||||
+
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-paragraph:not(affine-edgeless-root *, affine-database *)
|
||||
+ .affine-paragraph-rich-text-wrapper:not(affine-edgeless-root *, affine-database *):is(.h1, .h2, .h3, .h4, .h5, .h6) {
|
||||
+ margin: 24px 0 16px;
|
||||
+ font-weight: 600;
|
||||
+ line-height: 1.25;
|
||||
+ letter-spacing: normal;
|
||||
+ }
|
||||
+
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-paragraph:not(affine-edgeless-root *, affine-database *)
|
||||
+ .affine-paragraph-rich-text-wrapper.h1:not(affine-edgeless-root *, affine-database *) {
|
||||
+ padding-bottom: 0.3em;
|
||||
+ font-size: calc(var(--affine-font-base) * 2);
|
||||
+ border-bottom: 1px solid var(--affine-divider-color);
|
||||
+ }
|
||||
+
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-paragraph:not(affine-edgeless-root *, affine-database *)
|
||||
+ .affine-paragraph-rich-text-wrapper.h2:not(affine-edgeless-root *, affine-database *) {
|
||||
+ padding-bottom: 0.3em;
|
||||
+ font-size: calc(var(--affine-font-base) * 1.5);
|
||||
+ border-bottom: 1px solid var(--affine-divider-color);
|
||||
+ }
|
||||
+
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-paragraph:not(affine-edgeless-root *, affine-database *)
|
||||
+ .affine-paragraph-rich-text-wrapper.h3:not(affine-edgeless-root *, affine-database *) {
|
||||
+ font-size: calc(var(--affine-font-base) * 1.25);
|
||||
+ }
|
||||
+
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-paragraph:not(affine-edgeless-root *, affine-database *)
|
||||
+ .affine-paragraph-rich-text-wrapper.h4:not(affine-edgeless-root *, affine-database *) {
|
||||
+ font-size: var(--affine-font-base);
|
||||
+ }
|
||||
+
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-paragraph:not(affine-edgeless-root *, affine-database *)
|
||||
+ .affine-paragraph-rich-text-wrapper.h5:not(affine-edgeless-root *, affine-database *) {
|
||||
+ font-size: calc(var(--affine-font-base) * 0.875);
|
||||
+ }
|
||||
+
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-paragraph:not(affine-edgeless-root *, affine-database *)
|
||||
+ .affine-paragraph-rich-text-wrapper.h6:not(affine-edgeless-root *, affine-database *) {
|
||||
+ font-size: calc(var(--affine-font-base) * 0.85);
|
||||
+ }
|
||||
+
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-paragraph:not(affine-edgeless-root *, affine-database *)
|
||||
+ .affine-paragraph-rich-text-wrapper:not(affine-edgeless-root *, affine-database *):is(.h1, .h2, .h3, .h4, .h5, .h6)
|
||||
+ code:not(affine-edgeless-root *, affine-database *) {
|
||||
+ font-size: inherit;
|
||||
+ }
|
||||
+
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-paragraph:not(affine-edgeless-root *, affine-database *)
|
||||
+ .affine-paragraph-rich-text-wrapper.quote:not(affine-edgeless-root *, affine-database *) {
|
||||
+ margin: 0 0 16px;
|
||||
+ padding: 0 0 0 15px;
|
||||
+ line-height: 1.5;
|
||||
+ }
|
||||
+
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-paragraph:not(affine-edgeless-root *, affine-database *)
|
||||
+ .affine-paragraph-rich-text-wrapper.quote:not(affine-edgeless-root *, affine-database *)::after {
|
||||
+ width: 0.25em;
|
||||
+ height: 100%;
|
||||
+ margin: 0;
|
||||
+ border-radius: 0;
|
||||
+ }
|
||||
+
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-paragraph:not(affine-edgeless-root *, affine-database *)
|
||||
+ code:not(affine-edgeless-root *, affine-database *),
|
||||
+ affine-page-root
|
||||
+ .affine-page-root-block-container
|
||||
+ affine-list:not(affine-edgeless-root *, affine-database *)
|
||||
+ code:not(affine-edgeless-root *, affine-database *) {
|
||||
+ font-family: var(--affine-font-code-family);
|
||||
+ font-size: 85%;
|
||||
+ font-variant-ligatures: none;
|
||||
+ }
|
||||
+
|
||||
+ @container viewport (width <= 640px) {
|
||||
+ .affine-page-viewport.affine-page-viewport
|
||||
+ > div:first-child:has(> [data-affine-editor-container].page-mode):not(affine-edgeless-root *, affine-database *) {
|
||||
+ display: block !important;
|
||||
+ width: 100% !important;
|
||||
+ min-width: 0 !important;
|
||||
+ }
|
||||
+ }
|
||||
+5
-2
@@ -182,11 +182,14 @@ in {
|
||||
pg-15-ext-plsh = buildPlShExt pkgs "15";
|
||||
stable-video-diffusion-api = pkgs.callPackage ./stable-video-diffusion-api {};
|
||||
media-browser = pkgs.callPackage ./media-browser {};
|
||||
} // pkgs.lib.optionalAttrs (system == "x86_64-linux") {
|
||||
} // pkgs.lib.optionalAttrs (system == "x86_64-linux") (let
|
||||
affine = pkgs.callPackage ./affine {
|
||||
inherit inputs system;
|
||||
nodejs = pkgs.nodejs_22;
|
||||
};
|
||||
} // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
in {
|
||||
inherit affine;
|
||||
affine-frontend-static = affine.frontendStatic;
|
||||
}) // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
with-attic-cache = pkgs.callPackage ./with-attic-cache {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user