Skip to content

Commit

Permalink
0.9.1004
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-cen committed Aug 14, 2024
1 parent 76e2bbe commit fa6cf91
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 60 deletions.
64 changes: 32 additions & 32 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.1003",
"version": "0.9.1004",
"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
30 changes: 14 additions & 16 deletions src/core/react/components/Blink/BlinkComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const BlinkComponent = (props: {
setPreviewPath(suggestions[index]?.cache?.path);
}, [index, suggestions]);

const selectItem = (item: BlinkItem, e?: React.MouseEvent) => {
const selectItem = (item: BlinkItem, force?: boolean) => {
if (!item) return;
if (item.type == "section") return;
if (item.type == "new-note") {
Expand Down Expand Up @@ -225,15 +225,17 @@ export const BlinkComponent = (props: {
});
return;
}
if (props.mode == BlinkMode.Open) {
props.onSelect(item.cache?.path);
props.hide();
return;
}
if (!showBlink) {
props.superstate.ui.openPath(item.cache?.path);
props.hide();
return;
if (item.cache) {
if (props.mode == BlinkMode.Open) {
props.onSelect(item.cache?.path);
props.hide();
return;
}
if (!showBlink || force) {
props.superstate.ui.openPath(item.cache?.path);
props.hide();
return;
}
}

setIndex(suggestions.findIndex((f) => f.cache.path == item.cache?.path));
Expand Down Expand Up @@ -271,11 +273,7 @@ export const BlinkComponent = (props: {
e.preventDefault();
}
if (e.key == "Enter") {
props.superstate.ui.openPath(
suggestions[index].cache.path,
e.ctrlKey || e.metaKey ? (e.altKey ? "split" : "tab") : false
);
props.hide();
selectItem(suggestions[index], true);
e.preventDefault();
}
};
Expand Down Expand Up @@ -362,7 +360,7 @@ export const BlinkComponent = (props: {
: "mk-blink-suggestion",
index == i && "mk-active"
)}
onClick={(e) => selectItem(f, e)}
onClick={(e) => selectItem(f)}
>
{f.type == "section" ? (
<div className="mk-blink-suggestion-title">{f.label}</div>
Expand Down
3 changes: 2 additions & 1 deletion src/core/react/components/SpaceEditor/SpaceListProperty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ export const SpaceListProperty = (props: {
.then((f) => {
if (f)
return props.superstate.reloadContextByPath(
spaceState.path
spaceState.path,
true
);
return f;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ function parseContent(input: string): string {
return match1 ? match1[1] : match2 ? match2[1] : input;
}

function addSlashBeforeHash(input: string): string {
return input.replace(/([^/])#([*^])/g, "$1/#$2");
}
export const ContextNodeView = (
props: FrameNodeViewProps & {
containerRef?: React.RefObject<HTMLDivElement>;
source?: string;
}
) => {
const fullPath = props.state?.props?.value;
const fullPath = addSlashBeforeHash(props.state?.props?.value);
const { updateNode } = useContext(FramesEditorRootContext);
const { id } = useContext(FrameInstanceContext);
const selectLink = (e: any) => {
Expand All @@ -43,7 +46,7 @@ export const ContextNodeView = (
updateNode(props.treeNode.node, {
props: {
...props.treeNode.node.props,
value: wrapQuotes(link + "#^" + defaultContextSchemaID),
value: wrapQuotes(link + "/#^" + defaultContextSchemaID),
},
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const NewPropertyMenuComponent = (
cols: [...f.cols, ...existingProps],
})
)
.then((f) => props.superstate.reloadContextByPath(source));
.then((f) => props.superstate.reloadContextByPath(source, true));
props.hide();
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/react/context/ContextEditorContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export const ContextEditorProvider: React.FC<
await props.superstate.spaceManager
.saveTable(tagSpacePathFromTag(tag), newTable, true)
.then((f) =>
props.superstate.reloadContextByPath(tagSpacePathFromTag(tag))
props.superstate.reloadContextByPath(tagSpacePathFromTag(tag), true)
);
};
// const getSchema = (
Expand Down
12 changes: 6 additions & 6 deletions src/core/spaceManager/spaceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,14 @@ export class SpaceManager {
public createTable (path: string, schema: SpaceTableSchema) {

return this.adapterForPath(path).createTable(path, schema).then(f =>
this.superstate.reloadContextByPath(path));
this.superstate.reloadContextByPath(path, true));
}

public saveTableSchema (path: string, schemaId: string, saveSchema: (prev: SpaceTableSchema) => SpaceTableSchema) {

return this.adapterForPath(path).saveTableSchema(path, schemaId, saveSchema).then(f => {
if (f)
return this.superstate.reloadContextByPath(path)
return this.superstate.reloadContextByPath(path, true)
return f});
}
public saveTable (path: string, table: SpaceTable, force?: boolean) {
Expand All @@ -348,7 +348,7 @@ export class SpaceManager {
public deleteTable (path: string, name: string) {

return this.adapterForPath(path).deleteTable(path, name).then(f => {
return this.superstate.reloadContextByPath(path)});
return this.superstate.reloadContextByPath(path, true)});
}

public readAllKits () {
Expand Down Expand Up @@ -497,12 +497,12 @@ export class SpaceManager {
property.value = values;
}
return this.adapterForPath(path).addSpaceProperty(path, property).then(f =>
this.superstate.reloadContextByPath(path));
this.superstate.reloadContextByPath(path, true));

}
public deleteSpaceProperty (path: string, property: SpaceProperty) {
return this.adapterForPath(path).deleteSpaceProperty(path, property).then(f =>
this.superstate.reloadContextByPath(path));
this.superstate.reloadContextByPath(path, true));
}
public saveSpaceProperty (path: string, property: SpaceProperty, oldProperty: SpaceProperty) {

Expand All @@ -513,7 +513,7 @@ export class SpaceManager {
this.renameProperty(f.path, oldProperty.name, property.name);
})
}
return this.superstate.reloadContextByPath(path)
return this.superstate.reloadContextByPath(path, true)
});
}

Expand Down

0 comments on commit fa6cf91

Please sign in to comment.