Skip to content

Commit 0dbd017

Browse files
committed
Release v1.2.0
1 parent 1a4d551 commit 0dbd017

28 files changed

Lines changed: 3107 additions & 895 deletions

main.js

Lines changed: 1482 additions & 603 deletions
Large diffs are not rendered by default.

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "discourse-graphs",
33
"name": "Discourse Graph",
4-
"version": "1.1.0",
4+
"version": "1.2.0",
55
"minAppVersion": "1.7.0",
66
"description": "Add semantic structure to your notes with the Discourse Graph protocol.",
77
"author": "Discourse Graphs",

scripts/publish.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ const createGithubRelease = async ({
447447
const octokit = new Octokit({ auth: token });
448448
const owner = OWNER;
449449
const repo = REPO;
450-
const tagName = `v${version}`;
450+
const tagName = `${version}`;
451451
const releaseTitle = releaseName || `Discourse Graph v${version}`;
452452
const isPrerelease = !isExternalRelease(version);
453453

src/components/DiscourseContextView.tsx

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ import {
55
Notice,
66
FrontMatterCache,
77
setIcon,
8+
setTooltip,
89
} from "obsidian";
910
import { createRoot, Root } from "react-dom/client";
1011
import DiscourseGraphPlugin from "~/index";
1112
import { getDiscourseNodeFormatExpression } from "~/utils/getDiscourseNodeFormatExpression";
1213
import { RelationshipSection } from "~/components/RelationshipSection";
1314
import { VIEW_TYPE_DISCOURSE_CONTEXT } from "~/types";
1415
import { PluginProvider, usePlugin } from "~/components/PluginContext";
15-
import { getNodeTypeById } from "~/utils/typeUtils";
16+
import { getNodeTypeById, getAndFormatImportSource } from "~/utils/typeUtils";
1617
import { refreshImportedFile } from "~/utils/importNodes";
1718
import { publishNode } from "~/utils/publishNode";
1819
import { createBaseForNodeType } from "~/utils/baseForNodeType";
@@ -22,6 +23,21 @@ type DiscourseContextProps = {
2223
activeFile: TFile | null;
2324
};
2425

26+
type InfoTooltipProps = {
27+
content: string;
28+
};
29+
30+
const InfoTooltip = ({ content }: InfoTooltipProps) => (
31+
<button
32+
ref={(el) => {
33+
if (el) setTooltip(el, content);
34+
}}
35+
className="clickable-icon text-muted hover:text-normal flex h-4 w-4 items-center justify-center"
36+
>
37+
<div ref={(el) => (el && setIcon(el, "info")) || undefined} />
38+
</button>
39+
);
40+
2541
const DiscourseContext = ({ activeFile }: DiscourseContextProps) => {
2642
const plugin = usePlugin();
2743
const [isRefreshing, setIsRefreshing] = useState(false);
@@ -157,12 +173,16 @@ const DiscourseContext = ({ activeFile }: DiscourseContextProps) => {
157173
)}
158174
{nodeType.name || "Unnamed Node Type"}
159175
<button
176+
ref={(el) => {
177+
if (el) {
178+
const name = nodeType.name || "Unnamed Node Type";
179+
setTooltip(el, `Create Base view for ${name} nodes`);
180+
}
181+
}}
160182
onClick={() => {
161183
void createBaseForNodeType(plugin, nodeType);
162184
}}
163185
className="clickable-icon ml-1"
164-
title={`Create Base view for ${nodeType.name}`}
165-
aria-label={`Create Base view for ${nodeType.name}`}
166186
>
167187
<div
168188
ref={(el) => (el && setIcon(el, "layout-list")) || undefined}
@@ -206,8 +226,19 @@ const DiscourseContext = ({ activeFile }: DiscourseContextProps) => {
206226
)}
207227
</div>
208228

229+
{isImported && (
230+
<div className="mt-3 flex items-center gap-1.5">
231+
<span className="cursor-default rounded bg-amber-300 px-2 py-1 text-xs font-semibold text-amber-950 dark:bg-amber-900/40 dark:text-amber-300">
232+
View only
233+
</span>
234+
<InfoTooltip
235+
content={`Imported from ${getAndFormatImportSource(frontmatter.importedFromRid as string, plugin.settings.spaceNames)}. Direct edits will be overwritten when refreshed.`}
236+
/>
237+
</div>
238+
)}
239+
209240
{nodeType.format && (
210-
<div className="mb-1">
241+
<div className="mb-1 mt-2">
211242
<span className="font-bold">Content: </span>
212243
{extractContentFromTitle(nodeType.format, activeFile.basename)}
213244
</div>

0 commit comments

Comments
 (0)