Skip to content

Commit 1e2b5cf

Browse files
committed
1.2.4
1 parent 4f823de commit 1e2b5cf

File tree

10 files changed

+111
-126
lines changed

10 files changed

+111
-126
lines changed

main.js

Lines changed: 81 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "make-md",
33
"name": "make.md",
4-
"version": "1.2.3",
4+
"version": "1.2.4",
55
"minAppVersion": "0.16.0",
66
"description": "make.md gives you everything you need to organize and personalize your notes.",
77
"author": "make.md",

src/adapters/obsidian/filetypes/markdownAdapter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,10 @@ public app: App;
436436
await this.middleware.createFolder(parent);
437437
parentFolder = getAbstractFileAtPath(this.app, parent);
438438
}
439+
const fileName = name?.length > 0 ? name : this.plugin.superstate.settings.newNotePlaceholder
439440
return this.app.fileManager.createNewMarkdownFile(
440441
parentFolder ? (parentFolder instanceof TFolder) ? parentFolder : parentFolder.parent : this.app.vault.getRoot(),
441-
name).then(async f => {
442+
fileName).then(async f => {
442443
if (content) {
443444
await this.app.vault.modify(f, content);
444445
}

src/commands.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import { moveSpaceFiles } from "adapters/obsidian/filesystem/spaceFileOps";
22
import { openPathFixer } from "adapters/obsidian/fileSystemPathFixer";
33
import { FILE_CONTEXT_VIEW_TYPE } from "adapters/obsidian/ui/explorer/ContextExplorerLeafView";
44
import { showWarningsModal } from "core/react/components/Navigator/SyncWarnings";
5-
import { newSpaceModal } from "core/react/components/UI/Menus/navigator/showSpaceAddMenu";
5+
import {
6+
defaultAddAction,
7+
newSpaceModal,
8+
} from "core/react/components/UI/Menus/navigator/showSpaceAddMenu";
69
import { HiddenPaths } from "core/react/components/UI/Modals/HiddenFiles";
710
import { openInputModal } from "core/react/components/UI/Modals/InputModal";
811
import { addPathToSpaceAtIndex } from "core/superstate/utils/spaces";
@@ -36,6 +39,13 @@ export const attachCommands = (plugin: MakeMDPlugin) => {
3639
);
3740
},
3841
});
42+
plugin.addCommand({
43+
id: "new-note",
44+
name: i18n.buttons.newNote,
45+
callback: () => {
46+
defaultAddAction(plugin.superstate, null, window, false);
47+
},
48+
});
3949
plugin.addCommand({
4050
id: "show-warnings",
4151
name: i18n.menu.showWarnings,

src/core/react/components/SpaceView/Frames/DefaultFrames/DefaultFrames.ts

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,11 @@ import { FrameNode, MDBFrames } from "shared/types/mframe";
3636
layout: `"column"`,
3737
},
3838
},
39-
{
40-
id: 'headerKit',
41-
type: 'frame',
42-
schemaId: 'header',
43-
parentId: 'main',
44-
name: 'Header',
45-
rank: 0,
46-
icon: 'ui//layout-header',
47-
props: {},
48-
styles: {
49-
layout: `'column'`,
50-
width: `'100%'`,
51-
gap: `'8px'`,
52-
marginBottom: `'16px'`
53-
},
54-
ref: 'spaces://$kit/#*pageHeader',
55-
},
39+
5640
{
5741
...contextNode.node,
5842
id: "context",
59-
rank: 1,
43+
rank: 0,
6044
props: {
6145
value: `$contexts.$space.space`,
6246
},
@@ -94,23 +78,7 @@ const folderNoteMainFrame : FrameNode[] = [
9478
layout: `"column"`,
9579
},
9680
},
97-
{
98-
id: 'headerKit',
99-
type: 'frame',
100-
schemaId: 'header',
101-
parentId: 'main',
102-
name: 'Header',
103-
rank: 0,
104-
icon: 'ui//layout-header',
105-
props: {},
106-
styles: {
107-
layout: `'column'`,
108-
width: `'100%'`,
109-
gap: `'8px'`,
110-
marginBottom: `'16px'`
111-
},
112-
ref: 'spaces://$kit/#*pageHeader',
113-
},
81+
11482
{
11583
...flowNode.node,
11684
rank: 1,

src/core/superstate/superstate.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { fileSystemSpaceInfoFromTag } from "core/spaceManager/filesystemAdapter/
44
import { SpaceManager } from "core/spaceManager/spaceManager";
55
import { defaultSpaceSort, saveProperties, saveSpaceCache, saveSpaceMetadataValue } from "core/superstate/utils/spaces";
66
import { builtinSpaces } from "core/types/space";
7+
import { formulas } from "core/utils/formula/formulas";
78
import { buildRootFromMDBFrame } from "core/utils/frames/ast";
89
import { pathByJoins } from "core/utils/spaces/query";
910
import { folderForTagSpace, pathIsSpace } from "core/utils/spaces/space";
@@ -12,13 +13,12 @@ import { parsePathState } from "core/utils/superstate/parser";
1213
import { serializePathState } from "core/utils/superstate/serializer";
1314
import _, { debounce } from "lodash";
1415
import * as math from 'mathjs';
15-
import { formulas } from "core/utils/formula/formulas";
1616
import { rootToFrame } from "schemas/frames";
17+
import { visualizationNode } from "schemas/kits";
18+
import { dataNode } from "schemas/kits/base";
1719
import { calendarView, dateGroup, eventItem } from "schemas/kits/calendar";
1820
import { cardListItem, cardsListItem, columnGroup, columnView, coverListItem, detailItem, fieldsView, flowListItem, gridGroup, imageListItem, listGroup, listItem, listView, masonryGroup, newItemNode, overviewItem, rowGroup } from "schemas/kits/list";
1921
import { buttonNode, callout, dividerNode, linkNode, previewNode, progressNode, ratingNode, tabsNode, toggleNode } from "schemas/kits/ui";
20-
import { dataNode } from "schemas/kits/base";
21-
import { headerKit, visualizationNode } from "schemas/kits";
2222
import { fieldTypeForField, mainFrameID } from "schemas/mdb";
2323
import { tagsSpacePath } from "shared/schemas/builtin";
2424
import { Command } from "shared/types/commands";
@@ -46,9 +46,9 @@ import { SpacesCommandsAdapter } from "./commands";
4646

4747
import { linkContextRow } from "core/utils/contexts/linkContextRow";
4848
import { allMetadata } from "core/utils/metadata";
49+
import { IAssetManager } from "shared/types/assets";
4950
import { Metadata } from "shared/types/metadata";
5051
import { Indexer } from "./workers/indexer/indexer";
51-
import { IAssetManager } from "shared/types/assets";
5252

5353
import Fuse, { FuseIndex } from "fuse.js";
5454
import { SuperstateEvent } from "shared/types/PathState";
@@ -91,7 +91,7 @@ public api: API;
9191

9292

9393
public kit : FrameRoot[] = [
94-
headerKit,
94+
9595
buttonNode(),
9696
dividerNode,
9797
progressNode(),

src/core/utils/frames/frames.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const removeTrailingSemicolon = (str: string) => {
2626
}
2727

2828
export const objectIsConst = (objString: string, type: string): boolean => {
29+
if (objString) return false;
2930
const trimmed = removeTrailingSemicolon(objString.trim())
3031
if (type == 'object' && trimmed.startsWith("{") && trimmed.endsWith("}")) {
3132
return true
@@ -38,6 +39,7 @@ export const objectIsConst = (objString: string, type: string): boolean => {
3839
}
3940

4041
export const stringIsConst = (str: string): boolean => {
42+
if (!str) return false;
4143
// Check for quotes at the start and end without any quotes inside
4244
const hasQuotesAtStartEndOnly = /^["'](?:[^"\\]|\\.)*["'](?:;)?$/.test(str);
4345
const fixedStr = str?.replace(/;+$/, "");

src/css/System/Settings.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@
265265
justify-content: center;
266266
}
267267

268+
.mk-settings-nav-item .mk-icon-small svg {
269+
color: white;
270+
}
271+
268272
.mk-settings-nav-item.mk-active .mk-icon-small {
269273
opacity: 1;
270274
}

src/shared/i18n.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ class I18nLoader {
11031103
},
11041104
newNotePlaceholder: {
11051105
name: "New Note Placeholder",
1106-
desc: "Default name for new notes",
1106+
desc: "Default name for new notes, applies to the Navigator buttons and the New Note command",
11071107
},
11081108
folderIndentationLines: {
11091109
name: "Show Folder Indentation Lines",

styles.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)