@siladev/qalam-refs
v0.1.0
Published
Optional internal reference picker helpers for Qalam hosts
Readme
@siladev/qalam-refs
Optional satellite helpers for app-owned internal references in Qalam.
Qalam core stays generic: it stores internal references as normal link marks
with opaque hrefs such as drshaal:material/13. This package owns the
opinionated UX layer: ref kinds, search, a small picker, and toolbar insertion.
The API is intentionally v0.1 and should be validated by real host apps before anything here is promoted into Qalam core.
import { QalamRefsProvider, QalamEditorWithRefs } from "@siladev/qalam-refs";
const refKinds = [{
scheme: "drshaal:material",
label: "Material",
search: async (query, signal) => [{ id: "13", title: query || "Material 13" }],
toHref: (id) => `drshaal:material/${id}`,
toUrl: (id) => `/materials/${id}`,
}];
<QalamRefsProvider kinds={refKinds}>
<QalamEditorWithRefs />
</QalamRefsProvider>