Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"@tiptap/extension-underline": "2.0.0-beta.217",
"@tiptap/pm": "2.0.0-beta.217",
"hast-util-from-dom": "^4.2.0",
"i18next": "^22.4.15",
"lodash": "^4.17.21",
"rehype-parse": "^8.0.4",
"rehype-remark": "^9.1.2",
Expand Down
105 changes: 42 additions & 63 deletions packages/core/src/extensions/Blocks/nodes/Block.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ NESTED BLOCKS
margin-left: 1.5em;
}

.blockGroup .blockGroup > .blockOuter {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to keep the formatting as it was. Admittedly the CSS isn't very readable at the moment, but it would make it much easier to keep track of the more important changes in the PR.

.blockGroup .blockGroup>.blockOuter {
position: relative;
}

.blockGroup .blockGroup > .blockOuter:not([data-prev-depth-changed])::before {
.blockGroup .blockGroup>.blockOuter:not([data-prev-depth-changed])::before {
content: " ";
display: inline;
position: absolute;
Expand All @@ -40,17 +40,15 @@ NESTED BLOCKS
transition: all 0.2s 0.1s;
}

[data-theme="light"] .blockGroup .blockGroup
> .blockOuter:not([data-prev-depth-changed])::before {
[data-theme="light"] .blockGroup .blockGroup>.blockOuter:not([data-prev-depth-changed])::before {
border-left: 1px solid #CCCCCC;
}

[data-theme="dark"] .blockGroup .blockGroup
> .blockOuter:not([data-prev-depth-changed])::before {
[data-theme="dark"] .blockGroup .blockGroup>.blockOuter:not([data-prev-depth-changed])::before {
border-left: 1px solid #999999;
}

.blockGroup .blockGroup > .blockOuter[data-prev-depth-change="-2"]::before {
.blockGroup .blockGroup>.blockOuter[data-prev-depth-change="-2"]::before {
height: 0;
}

Expand All @@ -59,31 +57,39 @@ NESTED BLOCKS
[data-prev-depth-change="1"] {
--x: 1;
}

[data-prev-depth-change="2"] {
--x: 2;
}

[data-prev-depth-change="3"] {
--x: 3;
}

[data-prev-depth-change="4"] {
--x: 4;
}

[data-prev-depth-change="5"] {
--x: 5;
}

[data-prev-depth-change="-1"] {
--x: -1;
}

[data-prev-depth-change="-2"] {
--x: -2;
}

[data-prev-depth-change="-3"] {
--x: -3;
}

[data-prev-depth-change="-4"] {
--x: -4;
}

[data-prev-depth-change="-5"] {
--x: -5;
}
Expand All @@ -100,31 +106,33 @@ NESTED BLOCKS
[data-level="1"] {
--level: 3em;
}

[data-level="2"] {
--level: 2em;
}

[data-level="3"] {
--level: 1.3em;
}

[data-prev-level="1"] {
--prev-level: 3em;
}

[data-prev-level="2"] {
--prev-level: 2em;
}

[data-prev-level="3"] {
--prev-level: 1.3em;
}

.blockOuter[data-prev-type="heading"] > .block > .blockContent {
.blockOuter[data-prev-type="heading"]>.block>.blockContent {
font-size: var(--prev-level);
font-weight: bold;
}

.blockOuter:not([data-prev-type])
> .block
> .blockContent[data-content-type="heading"] {
.blockOuter:not([data-prev-type])>.block>.blockContent[data-content-type="heading"] {
font-size: var(--level);
font-weight: bold;
}
Expand All @@ -145,84 +153,58 @@ NESTED BLOCKS
--prev-index: attr(data-prev-index);
}

.blockOuter[data-prev-type="numberedListItem"]:not([data-prev-index="none"])
> .block
> .blockContent::before {
.blockOuter[data-prev-type="numberedListItem"]:not([data-prev-index="none"])>.block>.blockContent::before {
margin-right: 1.2em;
content: var(--prev-index) ".";
}

.blockOuter:not([data-prev-type])
> .block
> .blockContent[data-content-type="numberedListItem"]::before {
.blockOuter:not([data-prev-type])>.block>.blockContent[data-content-type="numberedListItem"]::before {
margin-right: 1.2em;
content: var(--index) ".";
}

/* Unordered */
/* No list nesting */
.blockOuter[data-prev-type="bulletListItem"] > .block > .blockContent::before {
.blockOuter[data-prev-type="bulletListItem"]>.block>.blockContent::before {
margin-right: 1.2em;
content: "•";
}

.blockOuter:not([data-prev-type])
> .block
> .blockContent[data-content-type="bulletListItem"]::before {
.blockOuter:not([data-prev-type])>.block>.blockContent[data-content-type="bulletListItem"]::before {
margin-right: 1.2em;
content: "•";
}

/* 1 level of list nesting */
[data-content-type="bulletListItem"]
~ .blockGroup
> .blockOuter[data-prev-type="bulletListItem"]
> .block
> .blockContent::before {
[data-content-type="bulletListItem"]~.blockGroup>.blockOuter[data-prev-type="bulletListItem"]>.block>.blockContent::before {
margin-right: 1.2em;
content: "◦";
}

[data-content-type="bulletListItem"]
~ .blockGroup
> .blockOuter:not([data-prev-type])
> .block
> .blockContent[data-content-type="bulletListItem"]::before {
[data-content-type="bulletListItem"]~.blockGroup>.blockOuter:not([data-prev-type])>.block>.blockContent[data-content-type="bulletListItem"]::before {
margin-right: 1.2em;
content: "◦";
}

/* 2 levels of list nesting */
[data-content-type="bulletListItem"]
~ .blockGroup
[data-content-type="bulletListItem"]
~ .blockGroup
> .blockOuter[data-prev-type="bulletListItem"]
> .block
> .blockContent::before {
[data-content-type="bulletListItem"]~.blockGroup [data-content-type="bulletListItem"]~.blockGroup>.blockOuter[data-prev-type="bulletListItem"]>.block>.blockContent::before {
margin-right: 1.2em;
content: "▪";
}

[data-content-type="bulletListItem"]
~ .blockGroup
[data-content-type="bulletListItem"]
~ .blockGroup
> .blockOuter:not([data-prev-type])
> .block
> .blockContent[data-content-type="bulletListItem"]::before {
[data-content-type="bulletListItem"]~.blockGroup [data-content-type="bulletListItem"]~.blockGroup>.blockOuter:not([data-prev-type])>.block>.blockContent[data-content-type="bulletListItem"]::before {
margin-right: 1.2em;
content: "▪";
}

/* PLACEHOLDERS*/

.blockContent > :first-child {
.blockContent> :first-child {
display: inline;
}

.blockContent.isEmpty > :first-child:before,
.blockContent.isFilter > :first-child:before {
.blockContent.isEmpty> :first-child:before,
.blockContent.isFilter> :first-child:before {
/*float: left; */
content: "";
pointer-events: none;
Expand All @@ -232,34 +214,31 @@ NESTED BLOCKS
font-style: italic;
}

[data-theme="light"] .blockContent.isEmpty > :first-child:before,
.blockContent.isFilter > :first-child:before {
[data-theme="light"] .blockContent.isEmpty> :first-child:before,
.blockContent.isFilter> :first-child:before {
color: #CCCCCC;
}

[data-theme="dark"] .blockContent.isEmpty > :first-child:before,
.blockContent.isFilter > :first-child:before {
[data-theme="dark"] .blockContent.isEmpty> :first-child:before,
.blockContent.isFilter> :first-child:before {
color: #999999;
}

/* TODO: would be nicer if defined from code */

.blockContent.isEmpty.hasAnchor > :first-child:before {
content: "Enter text or type '/' for commands";
.blockContent.isEmpty.hasAnchor> :first-child:before {
content: var(--placeholder);
}

.blockContent.isFilter.hasAnchor > :first-child:before {
.blockContent.isFilter.hasAnchor> :first-child:before {
content: "Type to filter";
}

.blockContent[data-content-type="heading"].isEmpty > :first-child::before {
content: "Heading";
.blockContent[data-content-type="heading"].isEmpty> :first-child::before {
content: var(--placeholder);
}

.blockContent[data-content-type="bulletListItem"].isEmpty > :first-child:before,
.blockContent[data-content-type="numberedListItem"].isEmpty
> :first-child:before {
content: "List";
.blockContent[data-content-type="bulletListItem"].isEmpty> :first-child:before,
.blockContent[data-content-type="numberedListItem"].isEmpty> :first-child:before {
content: var(--placeholder);
}

/* TEXT COLORS */
Expand Down
Loading