Skip to content

Commit

Permalink
0.9.992 hot patch
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-cen committed Jul 15, 2024
1 parent 72df223 commit ce9460a
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 45 deletions.
57 changes: 35 additions & 22 deletions main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "make-md",
"name": "MAKE.md",
"version": "0.9.991",
"version": "0.9.992",
"minAppVersion": "0.16.0",
"description": "Make.md brings powerful and modern note-taking features to Obsidian. Capture, organize and connect information with more flexibility without any code.",
"author": "MAKE.md",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "make-md",
"version": "0.9.991",
"version": "0.9.992",
"description": "make.md",
"main": "main.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,22 +286,24 @@ const flowEditorRangeset = (state: EditorState, plugin: MakeMDPlugin) => {
from - 3 == state.doc.lineAt(from).from &&
to + 2 == state.doc.lineAt(from).to;
if (type == FlowEditorLinkType.Link) {
values.push({
start: from - 2,
end: from - 2,
decoration: Decoration.widget({
widget: new LinkSticker(info, plugin),
side: -1,
}),
});
values.push({
start: to + 2,
end: to + 2,
decoration: Decoration.widget({
widget: new LinkExpand(info, plugin),
side: 0,
}),
});
if (plugin.superstate.settings.internalLinkSticker)
values.push({
start: from - 2,
end: from - 2,
decoration: Decoration.widget({
widget: new LinkSticker(info, plugin),
side: -1,
}),
});
if (plugin.superstate.settings.internalLinkClickFlow)
values.push({
start: to + 2,
end: to + 2,
decoration: Decoration.widget({
widget: new LinkExpand(info, plugin),
side: -1,
}),
});
if (expandedState == FlowEditorState.Open) {
values.push({
start: to + 2,
Expand Down
4 changes: 2 additions & 2 deletions src/core/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -725,11 +725,11 @@ class T {
desc: "Show the folder note by default when opening a folder",
},
internalLinkFlowEditor: {
name: "Link Toggles to Open Flow Editor",
name: "Show Toggles to Open Flow Editor on Links",
desc: "Turn on to toggle Flow Blocks directly in inline links",
},
internalLinkSticker: {
name: "Link Stickers",
name: "Show Stickers on Links",
desc: "Turn on to toggle stickers shown directly by beside internal links",
},
syncContextToFrontmatter: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ export const TreeItem = (props: TreeItemProps) => {
data.space,
(e.target as HTMLElement).getBoundingClientRect(),
windowFromDocument(e.view.document),
"right"
"right",
data.type == "group" ? () => closeActiveSpace(data.path) : null
);
};
const pathStateUpdated = (payload: { path: string }) => {
Expand Down Expand Up @@ -405,7 +406,7 @@ export const TreeItem = (props: TreeItemProps) => {
<span className="nav-file-tag">{extension}</span>
)}

{!clone && !pathState.readOnly ? (
{!clone && !pathState?.readOnly ? (
<div className="mk-folder-buttons">
<button
aria-label={t.buttons.moreOptions}
Expand Down
13 changes: 12 additions & 1 deletion src/core/react/components/UI/Menus/navigator/pathContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export const showPathContextMenu = (
rect: Rect,
win: Window,
anchor?: Anchors,
triggerRename?: () => void
onClose?: () => void
) => {
const cache = superstate.pathsIndex.get(path);
if (!cache) return;
Expand All @@ -213,6 +213,17 @@ export const showPathContextMenu = (
});
menuOptions.push(menuSeparator);

if (onClose) {
menuOptions.push({
name: i18n.menu.closeSpace,
icon: "ui//close",
onClick: (e) => {
onClose();
},
});
menuOptions.push(menuSeparator);
}

menuOptions.push({
name: i18n.buttons.addToSpace,
icon: "ui//pin",
Expand Down

0 comments on commit ce9460a

Please sign in to comment.