UNPKG

alinea

Version:
47 lines (45 loc) 1.07 kB
import "../../chunks/chunk-NZLE2WMY.js"; // src/field/link/Link.ts import { filePicker } from "alinea/field/link/FileLink"; import { createLink, createLinks } from "alinea/field/link/LinkField"; import { entryPicker } from "alinea/picker/entry"; import { urlPicker } from "alinea/picker/url"; import { EntryLink } from "./EntryLink.js"; function link(label, options = {}) { return createLink(label, { ...options, pickers: { entry: entryPicker({ ...options, title: "Select a page", max: 1, selection: EntryLink }), url: urlPicker(options), file: filePicker(false, options) } }); } ((link2) => { function multiple(label, options = {}) { return createLinks(label, { ...options, pickers: { entry: entryPicker({ ...options, title: "Select a page", selection: EntryLink }), url: urlPicker(options), file: filePicker(true, options) } }); } link2.multiple = multiple; })(link || (link = {})); export { link };