Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
0fd43a6
init
mdroidian Aug 9, 2024
455603f
additions
mdroidian Aug 19, 2024
9ddb742
nanopub node config
mdroidian Aug 20, 2024
b92bf02
add nanopub to getDiscourseNodes, use template in dialog
mdroidian Aug 20, 2024
35d4e9e
move orcid to main config
mdroidian Aug 28, 2024
ccd84c1
initial ContributorManager
mdroidian Aug 28, 2024
b68e9ba
rename nodeconfig
mdroidian Aug 28, 2024
2326a56
get publish working
mdroidian Aug 28, 2024
343697a
WIP rdf mapping/generation
mdroidian Aug 28, 2024
dc5faf9
working publish
mdroidian Sep 5, 2024
78765bf
resolve body
mdroidian Sep 13, 2024
9077b53
contributors to preview, ui additions/changes
mdroidian Sep 13, 2024
b11531f
alias predicates, add timestamp
mdroidian Sep 13, 2024
00cc732
lift state up from PreviewNanopub, some misc changes
mdroidian Sep 13, 2024
73ae333
dev url
mdroidian Sep 14, 2024
b72a9ee
add error message if no ORCID
mdroidian Sep 18, 2024
8e5a592
rework CreditRole to label,uri,verb and alias credit roles
mdroidian Sep 18, 2024
77c1637
segmente template into TripleTypes, handle nodeType
mdroidian Sep 18, 2024
e7a0e58
subvert discourseNodeTypeCache
mdroidian Sep 18, 2024
8eb7d98
update preview/template with TripleTypes
mdroidian Sep 18, 2024
e33e27d
add and handle requireContributor switch
mdroidian Sep 18, 2024
6e99fab
minor fixes/additions
mdroidian Sep 18, 2024
9a08662
check if nanopub is enabled
mdroidian Sep 24, 2024
dd90f5d
getDiscourseNode no-cache option
mdroidian Sep 24, 2024
abacd02
minor fix
mdroidian Sep 26, 2024
20ecf6c
more checks, unset error on tab seelct
mdroidian Sep 26, 2024
cb7f52a
cleanup
mdroidian Sep 26, 2024
df49bb9
orcid test fix
mdroidian Sep 26, 2024
bc6dc40
add visual notification that we are publishing an example nanopub
mdroidian Sep 26, 2024
f99b3e4
add error email to publishNanopub
mdroidian Sep 26, 2024
62dc694
gracefully handle null users
mdroidian Oct 4, 2024
d1a9141
tailwind config
mdroidian Oct 10, 2024
8347550
remove title additions on unload
mdroidian Oct 10, 2024
36b9ab3
addCommand to get all nanopubs that have defined contributors
mdroidian Oct 10, 2024
2ae2dec
refactor export settings, allow for overrides, remove frontmatter, us…
mdroidian Oct 10, 2024
f349b25
add placeholder tooltips
mdroidian Oct 10, 2024
5b0cd46
popup styles
mdroidian Oct 10, 2024
6d3459c
hide template,rdf,dev tabs if not dev
mdroidian Oct 10, 2024
12ea036
custom body definition
mdroidian Oct 10, 2024
7e3a76b
initial bulk publish UI
mdroidian Oct 18, 2024
61b18c8
type fix
mdroidian Oct 22, 2024
ae7c6af
html export
mdroidian Oct 24, 2024
702284b
fixes and refactors, add kpxl:DiscourseGraphNanopub
mdroidian Oct 24, 2024
fde96f5
inline description preview
mdroidian Oct 24, 2024
1177a9c
.
mdroidian Oct 27, 2024
608dd3a
.
mdroidian Oct 28, 2024
9540bfc
add initial SourceManager
mdroidian Nov 17, 2024
916db5c
.
mdroidian Nov 20, 2024
024707e
config fixes/safeguards
mdroidian Nov 20, 2024
4d74e74
Source Manager additions
mdroidian Nov 20, 2024
33b11a4
misc
mdroidian Nov 20, 2024
07110d8
add list of contributors/orcids, add orcids to nanopub
mdroidian Nov 27, 2024
7acd332
.
mdroidian Dec 1, 2024
88ac129
store current user ORCID with contributors
mdroidian Dec 13, 2024
fa4c828
add is published (to nanopub) condition
mdroidian Dec 13, 2024
3e57e35
add has contributor condition (requires refactoring how we are storin…
mdroidian Jun 9, 2025
132cd0f
.
mdroidian Jun 9, 2025
a25dcfe
Update GitHub Actions workflow to trigger on workflow_dispatch in add…
mdroidian Jun 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Publish Extension
on: pull_request

on:
pull_request:
workflow_dispatch:

env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"widgets"
],
"dependencies": {
"@nanopub/sign": "^0.1.4",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify the nanopub package version and security.

The new dependency @nanopub/sign supports the nanopub functionality. Please ensure this version is current and secure.


🌐 Web query:

What is the latest version of @nanopub/sign npm package and are there any known security vulnerabilities?

💡 Result:

The latest version of the @nanopub/sign npm package is 0.1.3, released on March 31, 2024. (libraries.io)

As of now, there are no known security vulnerabilities associated with this package. To ensure your project remains secure, it's advisable to regularly update your dependencies and monitor for any new vulnerabilities.

You can use the npm audit command to scan your project for known vulnerabilities and the npm audit fix command to automatically update packages to their latest secure versions. (geeksforgeeks.org)

Additionally, consider using automated tools like Snyk or WhiteSource Bolt to continuously monitor your project's dependencies for security issues. (geeksforgeeks.org)

By following these practices, you can help maintain the security and integrity of your project.

Citations:


Update @nanopub/sign to a valid published version

It looks like you’ve added

"@nanopub/sign": "^0.1.4"

but the latest published release is 0.1.3 (Mar 31, 2024). Please update to:

- "@nanopub/sign": "^0.1.4",
+ "@nanopub/sign": "^0.1.3",

There are currently no known security vulnerabilities for this package. To keep dependencies safe, consider running npm audit (and npm audit fix) or integrating tools like Snyk or WhiteSource Bolt for continuous monitoring.

  • File: package.json
  • Line: 29
🤖 Prompt for AI Agents
In package.json at line 29, the dependency "@nanopub/sign" is set to version
"^0.1.4" which is not a published version. Update this version to the latest
valid published release "0.1.3" to ensure the dependency is correctly resolved
and avoid potential installation errors. Additionally, consider running `npm
audit` and integrating security monitoring tools to maintain dependency
security.

"@samepage/external": "^0.71.10",
"@tldraw/tldraw": "^2.0.0-alpha.12",
"contrast-color": "^1.0.1",
Expand Down
26 changes: 26 additions & 0 deletions src/components/Export.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ import localStorageSet from "roamjs-components/util/localStorageSet";
import isLiveBlock from "roamjs-components/queries/isLiveBlock";
import createPage from "roamjs-components/writes/createPage";
import { createInitialTldrawProps } from "../utils/createInitialTldrawProps";
import { render as renderNanopub } from "./nanopub/ExportNanopub";
import { OnloadArgs } from "roamjs-components/types";

const ExportProgress = ({ id }: { id: string }) => {
const [progress, setProgress] = useState(0);
Expand Down Expand Up @@ -99,6 +101,7 @@ const EXPORT_DESTINATIONS = [
{ id: "app", label: "Store in Roam", active: false },
{ id: "samepage", label: "Store with SamePage", active: false },
{ id: "github", label: "Send to GitHub", active: true },
{ id: "nanopub", label: "Publish as Nanopub", active: true },
];
const SEND_TO_DESTINATIONS = ["page", "graph"];

Expand Down Expand Up @@ -525,6 +528,7 @@ const ExportDialog: ExportDialogComponent = ({
items={exportTypes.map((e) => e.name)}
activeItem={activeExportType}
onItemSelect={(et) => setActiveExportType(et)}
disabled={activeExportType === "nanopub"}
/>
</Label>
<div>
Expand Down Expand Up @@ -646,6 +650,16 @@ const ExportDialog: ExportDialogComponent = ({
const exportType = exportTypes.find(
(e) => e.name === activeExportType
);

if (activeExportDestination === "nanopub") {
const allResults =
typeof results === "function"
? await results(isSamePageEnabled)
: results || [];
handleNanopubExport(allResults, getExtensionAPI());
return;
}

if (exportType && window.RoamLazy) {
setDialogOpen(true);
setLoading(false);
Expand Down Expand Up @@ -804,6 +818,18 @@ const ExportDialog: ExportDialogComponent = ({
</>
);

const handleNanopubExport = (
results: Result[],
extensionAPI: OnloadArgs["extensionAPI"]
) => {
onClose();
renderNanopub({
results,
onClose: () => {},
extensionAPI,
});
};

return (
<>
<Dialog
Expand Down
7 changes: 6 additions & 1 deletion src/components/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ type QueryEditorComponent = (props: {
setHasResults?: () => void;
hideCustomSwitch?: boolean;
showAlias?: boolean;
hideQueryButton?: boolean;
}) => JSX.Element;

const QueryEditor: QueryEditorComponent = ({
Expand All @@ -445,6 +446,7 @@ const QueryEditor: QueryEditorComponent = ({
setHasResults,
hideCustomSwitch,
showAlias,
hideQueryButton,
}) => {
useEffect(() => {
const previewQuery = ((e: CustomEvent) => {
Expand Down Expand Up @@ -896,7 +898,10 @@ const QueryEditor: QueryEditorComponent = ({
onBlur={() => setShowDisabledMessage(false)}
text={"Query"}
onClick={disabledMessage ? undefined : onQuery}
className={disabledMessage ? "bp3-disabled" : ""}
className={`
${disabledMessage ? "bp3-disabled" : ""}
${hideQueryButton ? "hidden" : ""}
`}
style={{
maxHeight: 32,
}}
Expand Down
85 changes: 85 additions & 0 deletions src/components/SettingsDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import React from "react";
import {
Dialog,
Button,
Classes,
IconName,
MaybeElement,
} from "@blueprintjs/core";
import renderOverlay from "roamjs-components/util/renderOverlay";

type SelectItem = {
id: string;
text: string;
icon?: IconName | MaybeElement;
onClick: () => void;
};

type SelectDialogProps = {
isOpen: boolean;
onClose: () => void;
title: string;
items: SelectItem[];
errorMessage?: string;
width?: string;
};

const SelectDialog = ({
isOpen,
onClose,
title,
items,
errorMessage,
width = "20rem",
}: SelectDialogProps) => {
return (
<Dialog
isOpen={isOpen}
onClose={onClose}
canOutsideClickClose
canEscapeKeyClose
className="roamjs-canvas-dialog"
style={{ width }}
>
<div className={`${Classes.DIALOG_BODY} py-4 px-0 m-0`}>
<div className="flex flex-col">
<div className="text-lg font-bold p-2 mb-2 mx-5 mt-0">{title}</div>
<button
// Visually hidden button to catch initial focus
// this allows the Dialog to be called via command palette WITH the keyboard
// then use keyboard arrow keys to navigate
className="sr-only"
tabIndex={0}
aria-hidden="true"
/>
{items.length > 0 ? (
items.map((item, i) => (
<div key={item.id} className="flex items-center">
<Button
minimal
text={item.text}
className="p-2 px-7 focus:outline-none focus:bg-gray-300 justify-start flex-grow"
icon={item.icon}
style={{
caretColor: "transparent",
}}
onClick={() => {
item.onClick();
onClose();
}}
/>
</div>
))
) : (
<div className="p-4 text-center">
{errorMessage || "No items available"}
</div>
)}
</div>
</div>
</Dialog>
);
};

export const renderSelectDialog = (props: SelectDialogProps) =>
renderOverlay({ Overlay: SelectDialog, props });
Loading