Skip to content

Commit 1929944

Browse files
committed
1.3.3
1 parent fd37c95 commit 1929944

File tree

23 files changed

+561
-340
lines changed

23 files changed

+561
-340
lines changed

main.js

Lines changed: 111 additions & 111 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.3.2",
4+
"version": "1.3.3",
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/assets/ObsidianAssetManager.ts

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
import i18n from "shared/i18n";
22

3-
import { LocalCachePersister } from 'shared/types/persister';
4-
import { IUIManager } from 'shared/types/uiManager';
5-
import { SpaceManagerInterface } from 'shared/types/spaceManager';
63
import MakeMDPlugin from 'main';
74
import { normalizePath } from 'obsidian';
8-
import { lucideIcons } from '../ui/icons';
95
import { emojis } from 'shared/assets/emoji';
106
import {
117
Asset,
128
AssetCacheStats,
139
AssetLoadOptions,
1410
AssetManagerEvents,
15-
AssetMetadata,
1611
AssetType,
1712
AudioAsset,
18-
BaseAsset,
1913
ColorPaletteAsset,
2014
CoverImage,
2115
IAssetManager,
@@ -28,8 +22,11 @@ import {
2822
VisualizationAsset,
2923
VisualizationConfig
3024
} from 'shared/types/assets';
31-
import { safelyParseJSON } from 'shared/utils/json';
25+
import { LocalCachePersister } from 'shared/types/persister';
26+
import { SpaceManagerInterface } from 'shared/types/spaceManager';
27+
import { IUIManager } from 'shared/types/uiManager';
3228
import { ASSETS_SPACE_CONFIG } from 'shared/utils/assetSchemas';
29+
import { lucideIcons } from '../ui/icons';
3330

3431
// Type for file content based on what readPath returns
3532
type FileContent = string | ArrayBuffer | null;
@@ -670,8 +667,6 @@ export class ObsidianAssetManager implements IAssetManager {
670667
{ name: i18n.labels.base50, value: "var(--mk-color-base-50)", category: 'base' },
671668
{ name: i18n.labels.base60, value: "var(--mk-color-base-60)", category: 'base' },
672669
{ name: i18n.labels.base70, value: "var(--mk-color-base-70)", category: 'base' },
673-
{ name: i18n.labels.base80, value: "var(--mk-color-base-80)", category: 'base' },
674-
{ name: i18n.labels.base90, value: "var(--mk-color-base-90)", category: 'base' },
675670
{ name: i18n.labels.base100, value: "var(--mk-color-base-100)", category: 'base' },
676671
],
677672
gradients: [],
@@ -937,6 +932,21 @@ export class ObsidianAssetManager implements IAssetManager {
937932

938933
}
939934

935+
public async resetSinglePalette(paletteId: string): Promise<boolean> {
936+
const defaultPaletteIds = ['default-palette', 'monochrome-palette', 'default-gradient-palette', 'pastel-palette'];
937+
938+
if (!defaultPaletteIds.includes(paletteId)) {
939+
return false;
940+
}
941+
942+
this.assets.delete(paletteId);
943+
944+
const emptyLoadedIds = new Set<string>();
945+
await this.ensureDefaultPalettes(emptyLoadedIds);
946+
947+
return true;
948+
}
949+
940950
// Other required methods
941951
public async reindexAssets(): Promise<void> {
942952
await this.initializeAssets();

src/adapters/obsidian/ui/showMainMenu.tsx

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import {
33
defaultMenu,
44
menuSeparator,
55
} from "core/react/components/UI/Menus/menu/SelectionMenu";
6-
import { InputModal } from "core/react/components/UI/Modals/InputModal";
6+
import { HiddenPaths } from "core/react/components/UI/Modals/HiddenFiles";
77
import { isPhone, isTouchScreen } from "core/utils/ui/screen";
88
import MakeMDPlugin from "main";
99
import { SelectOption, Superstate } from "makemd-core";
10-
import i18n from "shared/i18n";
1110
import { WorkspaceLeaf, WorkspaceMobileDrawer } from "obsidian";
1211
import React from "react";
12+
import i18n from "shared/i18n";
1313
import { windowFromDocument } from "shared/utils/dom";
1414
import { FILE_TREE_VIEW_TYPE } from "./navigator/NavigatorView";
1515

@@ -52,6 +52,22 @@ export const showMainMenu = (
5252
const { spaceActive, leafs } = refreshLeafs();
5353
const menuOptions: SelectOption[] = [];
5454

55+
if (isMobile)
56+
menuOptions.push({
57+
name: superstate.settings.mobileMakeHeader
58+
? i18n.menu.showHeader
59+
: i18n.menu.hideHeader,
60+
icon: "ui//expand",
61+
onClick: () => {
62+
superstate.settings.mobileMakeHeader =
63+
!superstate.settings.mobileMakeHeader;
64+
superstate.saveSettings();
65+
document.body.classList.toggle(
66+
"mk-mobile-header",
67+
superstate.settings.mobileMakeHeader
68+
);
69+
},
70+
});
5571
if (superstate.ui.getWarnings().length > 0) {
5672
menuOptions.push({
5773
name: i18n.menu.showWarnings,
@@ -91,6 +107,18 @@ export const showMainMenu = (
91107

92108
menuOptions.push(menuSeparator);
93109

110+
menuOptions.push({
111+
name: i18n.labels.manageHiddenFiles,
112+
icon: "ui//eye-off",
113+
onClick: (e) => {
114+
superstate.ui.openModal(
115+
i18n.labels.hiddenFiles,
116+
<HiddenPaths superstate={superstate}></HiddenPaths>,
117+
windowFromDocument(e.view.document)
118+
);
119+
},
120+
});
121+
94122
menuOptions.push({
95123
name: i18n.menu.settings,
96124
icon: "ui//settings",
@@ -99,31 +127,15 @@ export const showMainMenu = (
99127
},
100128
});
101129

102-
menuOptions.push(menuSeparator);
103-
104-
if (isMobile) {
105-
menuOptions.push({
106-
name: i18n.views.navigator,
107-
icon: "ui//spaces",
108-
onClick: () => {
109-
const leaves =
110-
plugin.app.workspace.getLeavesOfType(FILE_TREE_VIEW_TYPE);
111-
if (leaves.length > 0) {
112-
plugin.app.workspace.revealLeaf(leaves[0]);
113-
}
114-
},
115-
});
116-
}
117-
118-
leafs.map((l) =>
119-
menuOptions.push({
120-
name: l.getDisplayText(),
121-
icon: "lucide//" + l.view.icon,
122-
onClick: () => {
123-
plugin.app.workspace.revealLeaf(l);
124-
},
125-
})
126-
);
130+
// leafs.map((l) =>
131+
// menuOptions.push({
132+
// name: l.getDisplayText(),
133+
// icon: "lucide//" + l.view.icon,
134+
// onClick: () => {
135+
// plugin.app.workspace.revealLeaf(l);
136+
// },
137+
// })
138+
// );
127139

128140
menuOptions.push(menuSeparator);
129141

src/commands.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,19 @@ export const attachCommands = (plugin: MakeMDPlugin) => {
217217
],
218218
});
219219
}
220+
221+
plugin.addCommand({
222+
id: "mk-set-homepage",
223+
name: "Set Current Space/Path as Homepage",
224+
callback: () => {
225+
const currentPath = plugin.superstate.ui.activePath;
226+
if (currentPath) {
227+
plugin.superstate.settings.homepagePath = currentPath;
228+
plugin.saveSettings();
229+
plugin.superstate.ui.notify(`Homepage set to: ${currentPath}`);
230+
} else {
231+
plugin.superstate.ui.notify("No active path to set as homepage");
232+
}
233+
},
234+
});
220235
};

src/core/react/components/Navigator/Focuses/FocusSelector.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ export const FocusSelector = (props: { superstate: Superstate }) => {
169169
};
170170
});
171171
const width = isTouchScreen(props.superstate.ui) ? 48 : 32;
172+
const isTouch = isTouchScreen(props.superstate.ui);
173+
const menuRef = useRef<HTMLDivElement>();
172174
const calcXOffset = (index: number) => {
173175
if (!projected || projected.insert) return 0;
174176
const fromIndex = activeId;
@@ -239,6 +241,18 @@ export const FocusSelector = (props: { superstate: Superstate }) => {
239241
__html: props.superstate.ui.getSticker("ui//plus"),
240242
}}
241243
></div>
244+
{isTouch && (
245+
<div
246+
className="mk-waypoint-menu"
247+
ref={menuRef}
248+
onClick={(e) => {
249+
props.superstate.ui.mainMenu(menuRef.current, props.superstate);
250+
}}
251+
dangerouslySetInnerHTML={{
252+
__html: props.superstate.ui.getSticker("ui//options"),
253+
}}
254+
></div>
255+
)}
242256
{overId != null && activeId === null && (
243257
<SortablePinnedSpaceItem
244258
id={focuses.length}

src/core/react/components/SpaceView/Contexts/FilterBar/FilterBar.tsx

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ import { nameForField } from "core/utils/frames/frames";
3434
import { isPhone } from "core/utils/ui/screen";
3535
import { isString } from "lodash";
3636
import { SelectOption, SelectOptionType, Superstate } from "makemd-core";
37-
import i18n from "shared/i18n";
3837
import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
3938
import { fieldTypeForField, stickerForField } from "schemas/mdb";
39+
import i18n from "shared/i18n";
4040
import { defaultContextSchemaID } from "shared/schemas/context";
4141
import { FrameEditorMode } from "shared/types/frameExec";
4242
import { SpaceProperty, SpaceTableColumn } from "shared/types/mdb";
@@ -506,8 +506,9 @@ export const FilterBar = (props: {
506506

507507
if (!readMode) {
508508
menuOptions.push(
509-
menuInput(frameSchema.name ?? "", (value) =>
510-
saveSchema({ ...frameSchema, name: value }),
509+
menuInput(
510+
frameSchema.name ?? "",
511+
(value) => saveSchema({ ...frameSchema, name: value }),
511512
""
512513
)
513514
);
@@ -568,7 +569,8 @@ export const FilterBar = (props: {
568569
name: i18n.labels.limit,
569570
icon: "ui//hash",
570571
type: SelectOptionType.Disclosure,
571-
value: predicate?.limit > 0 ? predicate.limit.toString() : i18n.labels.showAll,
572+
value:
573+
predicate?.limit > 0 ? predicate.limit.toString() : i18n.labels.showAll,
572574
onClick: (e) => {
573575
const offset = (e.target as HTMLElement).getBoundingClientRect();
574576
const limitOptions = [0, 10, 25, 50, 100, 200, 500];
@@ -1371,7 +1373,7 @@ export const FilterBar = (props: {
13711373
</div>
13721374
) : (
13731375
<>
1374-
{props.showTitle && (
1376+
{props.showTitle && (expanded || props.setView) && (
13751377
<div className="mk-context-config">
13761378
<ContextTitle superstate={props.superstate}></ContextTitle>
13771379

@@ -1410,18 +1412,23 @@ export const FilterBar = (props: {
14101412
</div>
14111413
)}
14121414
<div className="mk-view-config">
1413-
{!expanded ? props.setView ? (
1414-
<ListSelector
1415-
superstate={props.superstate}
1416-
expanded={false}
1417-
setView={props.setView}
1418-
></ListSelector>
1419-
) : <div className="mk-context-config">
1420-
<ContextTitle superstate={props.superstate}></ContextTitle>
1421-
1422-
<span></span>
1415+
{!expanded ? (
1416+
props.setView ? (
1417+
<ListSelector
1418+
superstate={props.superstate}
1419+
expanded={false}
1420+
setView={props.setView}
1421+
></ListSelector>
1422+
) : (
1423+
<div className="mk-context-config">
1424+
<ContextTitle superstate={props.superstate}></ContextTitle>
14231425

1424-
</div> : <></>}
1426+
<span></span>
1427+
</div>
1428+
)
1429+
) : (
1430+
<></>
1431+
)}
14251432

14261433
{
14271434
<div className="mk-view-options">

0 commit comments

Comments
 (0)