Skip to content

Commit

Permalink
1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-cen committed Dec 29, 2024
1 parent c452a2b commit 981da41
Show file tree
Hide file tree
Showing 15 changed files with 96 additions and 77 deletions.
90 changes: 45 additions & 45 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": "1.0.1",
"version": "1.0.2",
"minAppVersion": "0.16.0",
"description": "Make.md gives you everything you need to organize and personalize your notes.",
"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": "1.0.0",
"version": "1.0.2",
"description": "make.md",
"main": "main.js",
"scripts": {
Expand Down
5 changes: 0 additions & 5 deletions src/basics/cmExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ import { tooltips } from "./tooltip";
export const cmExtensions = (plugin: MakeBasicsPlugin, mobile: boolean) => {
const extensions : Extension[] = [...editBlockExtensions()];

if (plugin.settings.makerMode) {



extensions.push(
...[toggleMarkExtension, tooltips({ parent: document.body })]
);
Expand All @@ -48,7 +44,6 @@ export const cmExtensions = (plugin: MakeBasicsPlugin, mobile: boolean) => {
extensions.push(internalLinkToggle);
} else {
extensions.push(internalLinkHover(plugin));
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/basics/enactor/enactor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface Enactor {
): void;
selectLink(e: React.MouseEvent, onSelect: (path: string) => void): void;
selectSpace(e: React.MouseEvent, onSelect: (path: string) => void): void;
pathExists(path: string): Promise<boolean>;
selectImage(onSelect: (path: string) => void, win: Window): void;
isSpace(path: string): boolean;
loadExtensions(firstLoad: boolean): void;
Expand Down
3 changes: 3 additions & 0 deletions src/basics/enactor/makemd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,9 @@ export class MakeMDEnactor implements Enactor {
// }
// menu.showAtMouseEvent(ev);
}
pathExists(path: string) {
return this.superstate.spaceManager.pathExists(path);
}
openPath(path: string, source?: HTMLElement) {
const uri = this.uriByString(path);
openPathInElement(
Expand Down
3 changes: 3 additions & 0 deletions src/basics/enactor/obsidian.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ export class ObsidianEnactor implements Enactor {
selectSpace(e: React.MouseEvent, onSelect: (path: string) => void) {
return this.notify("Not implemented");
}
pathExists(path: string) {
return this.plugin.app.vault.adapter.exists(path);
}
selectImage(onSelect: (path: string) => void, win: Window) {
return this.notify("Not implemented");
}
Expand Down
1 change: 0 additions & 1 deletion src/basics/schemas/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export const BasicDefaultSettings: MakeBasicsSettings = {
mobileMakeBar: false,
mobileSidepanel: false,
inlineStyler: true,
makerMode: true,
inlineStylerColors: false,
editorFlow: true,
internalLinkClickFlow: true,
Expand Down
1 change: 0 additions & 1 deletion src/basics/types/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export interface MakeBasicsSettings {
menuTriggerChar: string;
inlineStickerMenu: boolean;
emojiTriggerChar: string;
makerMode: boolean;
dataviewInlineContext: boolean;

}
4 changes: 1 addition & 3 deletions src/basics/ui/UINote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ export const UINote = forwardRef((props: NoteViewProps, ref) => {

const path = props.plugin.enactor.uriByString(props.path, props.source);

const pathExists = await props.plugin.app.vault.adapter.exists(
path.basePath
);
const pathExists = await props.plugin.enactor.pathExists(path.basePath);
const isFolder = props.plugin.enactor.isSpace(path.basePath);
const filePath =
isFolder && props.forceNote
Expand Down
5 changes: 3 additions & 2 deletions src/core/react/components/MarkdownEditor/BannerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const BannerView = (props: {
pathState?.metadata.property?.[props.superstate.settings.fmKeySticker]
?.length > 0;
setHasSticker(hasSticker);

setOffset(
pathState?.metadata.property?.[
props.superstate.settings.fmKeyBannerOffset
Expand All @@ -52,7 +53,7 @@ export const BannerView = (props: {
pathState?.metadata.property?.[
props.superstate.settings.fmKeyBannerOffset
]
) * 100
)
).toString()}%`
: "center"
);
Expand Down Expand Up @@ -166,7 +167,7 @@ export const BannerView = (props: {
newValue = Math.min(newValue, 100);
currentValue.current = newValue;

saveOffset(newValue);
setOffset(newValue + "%");

return pos;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export const FlowNodeView = (
};
return (
<div className="mk-node-flow">
{pathState ? (
!props.state?.styles?.["--mk-min-mode"] ? (
{pathState &&
(!props.state?.styles?.["--mk-min-mode"] ? (
<div className="mk-node-link">
<PathCrumb superstate={props.superstate} path={pathState.path}>
{!hideToggle && (
Expand All @@ -123,7 +123,16 @@ export const FlowNodeView = (
</div>
) : (
<></>
)
))}
{props.state && expanded && props.state?.props?.value?.length > 0 ? (
<PathView
id={id}
superstate={props.superstate}
path={pathState?.path ?? props.state?.props?.value}
containerRef={props.containerRef}
styles={{}}
readOnly={true}
></PathView>
) : (
selectionMode > FrameEditorMode.Read && (
<div
Expand All @@ -144,16 +153,6 @@ export const FlowNodeView = (
</div>
)
)}
{props.state && expanded && props.state?.props?.value?.length > 0 && (
<PathView
id={id}
superstate={props.superstate}
path={pathState?.path ?? props.state?.props?.value}
containerRef={props.containerRef}
styles={{}}
readOnly={true}
></PathView>
)}
</div>
);
};
20 changes: 19 additions & 1 deletion src/core/spaceManager/filesystemAdapter/filesystemAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,24 @@ export class FilesystemSpaceAdapter implements SpaceAdapter {
return [...this.fileSystem.allFiles().filter(f => type ? type.some(g => g == 'folder' ? f.isFolder : f.extension == g) : true).map(g => g.path).filter(f => !excludeSpacesPredicate(this.spaceManager.superstate.settings, f))];
}
public async pathExists (path: string) {
const uri = this.uriByPath(path);
if (uri.scheme == 'spaces') {
if (uri.authority.charAt(0) == '$') {
const builtIn = Object.keys(builtinSpaces).find(f => f == uri.authority.slice(1));
if (builtIn) {
return true;
}
}

if (uri.authority.charAt(0) == '#')
{
return true;
}
if (path == '/') {
return true;
}

}
return this.fileSystem.fileExists(path)
}
public async createItemAtPath (parent: string, type: string, name: string, content?: any) {
Expand Down Expand Up @@ -831,7 +849,7 @@ const defaultSpaceTemplate = this.defaultFrame(path);
const builtins = Object.keys(builtinSpaces).map(f => this.spaceManager.spaceInfoForPath(`spaces://$${f}`));

const getAllTagContextFiles = () : SpaceInfo[] => this.readTags().map(f => fileSystemSpaceInfoFromTag(this.spaceManager, tagPathToTag(f))) as SpaceInfo[] ?? [];
const allTagSpaces = this.spaceManager.superstate.settings.enableDefaultSpaces ? getAllTagContextFiles() : [];
const allTagSpaces = getAllTagContextFiles();
return [...builtins, ...allTagSpaces, ...allFolders]
}
return allFolders;
Expand Down
6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,12 @@ this.markdownAdapter = new ObsidianMarkdownFiletypeAdapter(this);
await this.loadSpaces();
this.loadContext();

if (Object.keys(this.superstate.settings as Record<string, any>).some(f => f == "makerMode")){
this.superstate.settings.basics = (this.superstate.settings as any).makerMode;
delete (this.superstate.settings as any).makerMode;
this.saveSettings();
}

if (this.superstate.settings.basics) {
this.basics = new MakeBasicsPlugin(this);
this.basics.loadBasics();
Expand Down
5 changes: 1 addition & 4 deletions src/shared/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -968,10 +968,7 @@ class T {
name: "Mark Sans 🧪",
desc: `Use the editor without Markdown.`,
},
editorMakerMode: {
name: "Flow (Beta)",
desc: `An integrated and intuitive editor experience`,
},

editorMakePlacholder: {
name: "Flow Menu Hint Text",
desc: `Show a hint text on how to open the Flow Menu Shortcut`,
Expand Down

0 comments on commit 981da41

Please sign in to comment.