tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
27
pulls
pipelines
add min-height on last block for readonly view padding
schlage.town
2 years ago
a35294d0
2dd2887d
+11
-11
1 changed file
expand all
collapse all
unified
split
components
Blocks
index.tsx
+11
-11
components/Blocks/index.tsx
···
23
let foldedBlocks = useUIState((s) => s.foldedBlocks);
24
25
let lastRootBlock = blocks.findLast(
26
-
(f) => !f.listData || f.listData.depth === 1,
27
);
28
29
let lastVisibleBlock = blocks.findLast(
30
(f) =>
31
!f.listData ||
32
!f.listData.path.find(
33
-
(path) => foldedBlocks.includes(path.entity) && f.value !== path.entity,
34
-
),
35
);
36
37
return (
···
53
type: "text",
54
position: generateKeyBetween(
55
lastRootBlock?.position || null,
56
-
null,
57
),
58
newEntityID,
59
});
···
75
!f.listData ||
76
!f.listData.path.find(
77
(path) =>
78
-
foldedBlocks.includes(path.entity) && f.value !== path.entity,
79
-
),
80
)
81
.map((f, index, arr) => {
82
let nextBlock = arr[index + 1];
···
121
let editorState = useEditorStates((s) =>
122
props.lastBlock?.type === "text"
123
? s.editorStates[props.lastBlock.value]
124
-
: null,
125
);
126
127
if (!entity_set.permissions.write) return null;
···
143
permission_set: entity_set.set,
144
position: generateKeyBetween(
145
props.lastBlock?.position || null,
146
-
null,
147
),
148
newEntityID,
149
});
···
181
let { rep } = useReplicache();
182
let entity_set = useEntitySetContext();
183
184
-
if (!entity_set.permissions.write) return <div className="h-4" />;
185
return (
186
<div
187
className="blockListClickableBottomArea shrink-0 h-[50vh]"
···
194
) {
195
focusBlock(
196
{ ...props.lastVisibleBlock, type: "text" },
197
-
{ type: "end" },
198
);
199
} else {
200
// else add a new text block at the end and focus it
···
205
type: "text",
206
position: generateKeyBetween(
207
props.lastRootBlock?.position || null,
208
-
null,
209
),
210
newEntityID,
211
});
···
23
let foldedBlocks = useUIState((s) => s.foldedBlocks);
24
25
let lastRootBlock = blocks.findLast(
26
+
(f) => !f.listData || f.listData.depth === 1
27
);
28
29
let lastVisibleBlock = blocks.findLast(
30
(f) =>
31
!f.listData ||
32
!f.listData.path.find(
33
+
(path) => foldedBlocks.includes(path.entity) && f.value !== path.entity
34
+
)
35
);
36
37
return (
···
53
type: "text",
54
position: generateKeyBetween(
55
lastRootBlock?.position || null,
56
+
null
57
),
58
newEntityID,
59
});
···
75
!f.listData ||
76
!f.listData.path.find(
77
(path) =>
78
+
foldedBlocks.includes(path.entity) && f.value !== path.entity
79
+
)
80
)
81
.map((f, index, arr) => {
82
let nextBlock = arr[index + 1];
···
121
let editorState = useEditorStates((s) =>
122
props.lastBlock?.type === "text"
123
? s.editorStates[props.lastBlock.value]
124
+
: null
125
);
126
127
if (!entity_set.permissions.write) return null;
···
143
permission_set: entity_set.set,
144
position: generateKeyBetween(
145
props.lastBlock?.position || null,
146
+
null
147
),
148
newEntityID,
149
});
···
181
let { rep } = useReplicache();
182
let entity_set = useEntitySetContext();
183
184
+
if (!entity_set.permissions.write) return <div className="h-4 min-h-4" />;
185
return (
186
<div
187
className="blockListClickableBottomArea shrink-0 h-[50vh]"
···
194
) {
195
focusBlock(
196
{ ...props.lastVisibleBlock, type: "text" },
197
+
{ type: "end" }
198
);
199
} else {
200
// else add a new text block at the end and focus it
···
205
type: "text",
206
position: generateKeyBetween(
207
props.lastRootBlock?.position || null,
208
+
null
209
),
210
newEntityID,
211
});