(menuOpen.get() ? "block" : "none")),
position: "fixed",
inset: "0",
zIndex: "999",
}}
/>
{/* Dropdown Menu */}
(menuOpen.get() ? "flex" : "none")),
position: "fixed",
top: "112px",
right: "16px",
background: "var(--ct-color-bg, white)",
border: "1px solid var(--ct-color-border, #e5e5e7)",
borderRadius: "12px",
boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
minWidth: "180px",
zIndex: "1000",
padding: "4px",
}}
>
{/* List of notebooks with ✓ for membership */}
{notebooks.map((notebook) => (
{"\u00A0\u00A0"}
{notebook?.[NAME] ?? "Untitled"}
{computed(() => {
const nbName = (notebook as any)?.[NAME] ?? "";
return containingNotebookNames.includes(nbName)
? " ✓"
: "";
})}
))}
{/* Divider + All Notes - only show if All Notes charm exists */}
allNotesCharm ? "block" : "none"),
height: "1px",
background: "var(--ct-color-border, #e5e5e7)",
margin: "4px 8px",
}}
/>
allNotesCharm ? "flex" : "none"),
justifyContent: "flex-start",
}}
>
{"\u00A0\u00A0"}📁 All Notes
{editorUI}
{backlinks?.map((charm) => (
{charm?.[NAME]}
))}
),
title,
content,
mentioned,
backlinks,
isHidden,
noteId,
grep: patternTool(
({ query, content }: { query: string; content: string }) => {
return computed(() => {
return content.split("\n").filter((c) => c.includes(query));
});
},
{ content },
),
translate: patternTool(
(
{ language, content }: {
language: string;
content: string;
},
) => {
const genResult = generateText({
system: computed(() => `Translate the content to ${language}.`),
prompt: computed(() => `${content}`),
});
return computed(() => {
if (genResult.pending) return undefined;
if (genResult.result == null) return "Error occured";
return genResult.result;
});
},
{ content },
),
editContent: handleEditContent({ content }),
// Minimal UI for embedding in containers (e.g., Record modules)
embeddedUI: editorUI,
};
},
);
export default Note;