@bison-lab/payload-blocks 3.2.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +167 -18
- package/dist/admin.d.mts +5 -2
- package/dist/admin.d.mts.map +1 -1
- package/dist/admin.mjs +362 -4
- package/dist/admin.mjs.map +1 -1
- package/dist/index.d.mts +139 -21
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +373 -46
- package/dist/index.mjs.map +1 -1
- package/dist/link-CnwLtm47.mjs +41 -0
- package/dist/link-CnwLtm47.mjs.map +1 -0
- package/dist/react.d.mts +78 -8
- package/dist/react.d.mts.map +1 -1
- package/dist/react.mjs +222 -146
- package/dist/react.mjs.map +1 -1
- package/dist/rich-text.d.mts +40 -14
- package/dist/rich-text.d.mts.map +1 -1
- package/dist/rich-text.mjs +81 -18
- package/dist/rich-text.mjs.map +1 -1
- package/dist/seam-CmLb3BSo.mjs +99 -0
- package/dist/seam-CmLb3BSo.mjs.map +1 -0
- package/dist/{types-CJAvoZMk.d.mts → types-ODMRyOpH.d.mts} +134 -18
- package/dist/types-ODMRyOpH.d.mts.map +1 -0
- package/package.json +2 -2
- package/dist/cx-BKHSv3xT.mjs +0 -17
- package/dist/cx-BKHSv3xT.mjs.map +0 -1
- package/dist/types-CJAvoZMk.d.mts.map +0 -1
package/dist/admin.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.mjs","names":[],"sources":["../src/admin/min-rows-array-field.tsx"],"sourcesContent":["import { ArrayField, toast, useField, useTranslation } from \"@payloadcms/ui\";\nimport type { ArrayFieldClientComponent, ArrayFieldClientProps } from \"payload\";\nimport { useCallback, useRef } from \"react\";\n\n/**\n * Payload's array field, with *Remove* refused once the rows are down to\n * `minRows`.\n *\n * This wraps the stock `ArrayField` rather than re-implementing it, so every\n * upstream behaviour (sorting, copy/paste, collapse, localisation) stays put\n * and a Payload upgrade carries it along. The catch is where the row menu\n * lives: Payload portals it into `document.body`, out of reach of any CSS or\n * form context this wrapper could scope. What still reaches the wrapper is\n * the React event: synthetic events bubble through portals along the\n * component tree, so a capture handler here sees the click on *Remove*\n * before the menu's own handler does, and can stop it.\n *\n * Because the menu is portaled, the DOM cannot say whether a given *Remove*\n * belongs to this array or to an array nested inside one of its rows. The\n * trigger that opened the menu *is* in the DOM, though, and every menu opens\n * from its trigger. So the handler remembers, per menu opening, whether the\n * trigger sat directly in this field, and only gates the *Remove* that follows.\n */\nexport const MinRowsArrayField: ArrayFieldClientComponent = (props) => {\n const { field, path: pathFromProps } = props;\n const minRows = field.minRows ?? (field.required ? 1 : 0);\n\n const { rows = [] } = useField({\n hasRows: true,\n potentiallyStalePath: pathFromProps,\n });\n const { i18n, t } = useTranslation();\n\n const rootRef = useRef<HTMLDivElement>(null);\n const menuIsOurs = useRef(false);\n\n const onClickCapture = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const target = event.target;\n if (!(target instanceof Element)) return;\n\n const trigger = target.closest(\".array-actions__button\");\n if (trigger) {\n // The nearest array or blocks field around the trigger is the field\n // whose menu is opening. Ours is the first one inside the wrapper.\n const owner = trigger.closest(\".array-field, .blocks-field\");\n menuIsOurs.current =\n owner !== null && owner === rootRef.current?.querySelector(\".array-field\");\n return;\n }\n\n if (!target.closest(\".array-actions__remove\")) return;\n if (!menuIsOurs.current || rows.length > minRows) return;\n\n event.preventDefault();\n event.stopPropagation();\n toast.error(\n t(\"validation:requiresAtLeast\", {\n count: minRows,\n label: rowLabel(field, minRows, i18n.language) ??\n t(minRows > 1 ? \"general:rows\" : \"general:row\"),\n }),\n );\n },\n [field, i18n.language, minRows, rows.length, t],\n );\n\n return (\n <div ref={rootRef} onClickCapture={onClickCapture}>\n <ArrayField {...props} />\n </div>\n );\n};\n\n/**\n * The word for a row, as Payload's own \"requires at least\" banner picks it:\n * the plural label above one, the singular otherwise, the field label failing\n * both. Client-side labels are static — a string or a per-language record.\n */\nfunction rowLabel(\n field: ArrayFieldClientProps[\"field\"],\n minRows: number,\n language: string,\n): string | undefined {\n const label = minRows > 1 ? field.labels?.plural : field.labels?.singular;\n return staticLabel(label, language) ?? staticLabel(field.label, language);\n}\n\nfunction staticLabel(label: unknown, language: string): string | undefined {\n if (typeof label === \"string\") return label;\n if (label && typeof label === \"object\") {\n const byLanguage = label as Record<string, string | undefined>;\n return byLanguage[language] ?? byLanguage.en ?? Object.values(byLanguage)[0];\n }\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,qBAAgD,UAAU;CACrE,MAAM,EAAE,OAAO,MAAM,kBAAkB;CACvC,MAAM,UAAU,MAAM,YAAY,MAAM,WAAW,IAAI;CAEvD,MAAM,EAAE,OAAO,EAAE,KAAK,SAAS;EAC7B,SAAS;EACT,sBAAsB;EACvB,CAAC;CACF,MAAM,EAAE,MAAM,MAAM,gBAAgB;CAEpC,MAAM,UAAU,OAAuB,KAAK;CAC5C,MAAM,aAAa,OAAO,MAAM;AAiChC,QACE,oBAAC,OAAD;EAAK,KAAK;EAAS,gBAhCE,aACpB,UAA4C;GAC3C,MAAM,SAAS,MAAM;AACrB,OAAI,EAAE,kBAAkB,SAAU;GAElC,MAAM,UAAU,OAAO,QAAQ,yBAAyB;AACxD,OAAI,SAAS;IAGX,MAAM,QAAQ,QAAQ,QAAQ,8BAA8B;AAC5D,eAAW,UACT,UAAU,QAAQ,UAAU,QAAQ,SAAS,cAAc,eAAe;AAC5E;;AAGF,OAAI,CAAC,OAAO,QAAQ,yBAAyB,CAAE;AAC/C,OAAI,CAAC,WAAW,WAAW,KAAK,SAAS,QAAS;AAElD,SAAM,gBAAgB;AACtB,SAAM,iBAAiB;AACvB,SAAM,MACJ,EAAE,8BAA8B;IAC9B,OAAO;IACP,OAAO,SAAS,OAAO,SAAS,KAAK,SAAS,IAC5C,EAAE,UAAU,IAAI,iBAAiB,cAAc;IAClD,CAAC,CACH;KAEH;GAAC;GAAO,KAAK;GAAU;GAAS,KAAK;GAAQ;GAAE,CAChD;YAIG,oBAAC,YAAD,EAAY,GAAI,OAAS,CAAA;EACrB,CAAA;;;;;;;AASV,SAAS,SACP,OACA,SACA,UACoB;AAEpB,QAAO,YADO,UAAU,IAAI,MAAM,QAAQ,SAAS,MAAM,QAAQ,UACvC,SAAS,IAAI,YAAY,MAAM,OAAO,SAAS;;AAG3E,SAAS,YAAY,OAAgB,UAAsC;AACzE,KAAI,OAAO,UAAU,SAAU,QAAO;AACtC,KAAI,SAAS,OAAO,UAAU,UAAU;EACtC,MAAM,aAAa;AACnB,SAAO,WAAW,aAAa,WAAW,MAAM,OAAO,OAAO,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"admin.mjs","names":[],"sources":["../src/admin/link-field.tsx","../src/admin/min-rows-array-field.tsx"],"sourcesContent":["import {\n FieldDescription,\n FieldError,\n FieldLabel,\n useConfig,\n useField,\n useFieldPath,\n} from \"@payloadcms/ui\";\nimport type { ClientField, RowFieldClientComponent } from \"payload\";\nimport { useEffect, useId, useMemo, useRef, useState } from \"react\";\n\nimport { linkTypeOf, type LinkPageDoc, type LinkType } from \"../fields/link\";\n\n/**\n * The link picker: one box in place of a link's `type`, `page` and `href`.\n *\n * Type to search the pages collection by its title field; each result shows\n * its path. Paste anything that can only be a destination (`http`, `mailto:`,\n * `tel:`, or a site path starting with `/`) and the one offer is to link to\n * it. Choosing writes the stored shape through Payload's `useField`, so the\n * document saves exactly what the stock fields would have saved, and the\n * chosen state shows a Page or External chip with a clear button.\n *\n * The search asks the collection's REST endpoint for `_status: published`\n * rows, so the draft rule is the server's and is applied on every keystroke.\n * A stored page is fetched by id without that filter, which is how the\n * picker knows to warn that a page chosen earlier has since been unpublished\n * or deleted.\n *\n * Painted with Payload's own theme variables and nothing else, so it reads\n * in both admin themes without a stylesheet of its own; the rules ride along\n * in a `<style href precedence>`, which React 19 hoists into the head and\n * dedupes across instances. Payload 3's admin is React 19 (`@payloadcms/ui`\n * peers `react ^19`), so that is the only React this entry runs under.\n */\n\nconst LABEL = \"Goes to\";\nconst PLACEHOLDER = \"Search pages, or paste a URL\";\nconst DESCRIPTION =\n \"Published pages only. Paste a URL, or a path like /find-a-doctor, to link anywhere else.\";\nconst NO_MATCH = \"No published page matches. Paste a URL to link outside the site.\";\nconst UNPUBLISHED =\n \"This page is no longer published. The site shows this link as plain text, and this document cannot be published until you pick another page or publish that one again.\";\nconst MISSING =\n \"This page no longer exists. Pick another page or paste a URL before publishing.\";\n\nconst SEARCH_DELAY_MS = 200;\nconst SEARCH_LIMIT = 8;\n\n/** Text an editor could only mean as a destination, never as a page title. */\nconst URL_LIKE = /^(https?:\\/\\/|mailto:|tel:|\\/)/i;\n\ntype Option = { kind: \"page\"; page: LinkPageDoc } | { kind: \"url\"; href: string };\n\n/**\n * A row has no name, so its `path` ends in `_index-N` and its fields sit at\n * the parent's level, the way Payload's `getFieldPaths` places them.\n */\nfunction siblingPaths(rowPath: string) {\n const base = rowPath\n .split(\".\")\n .filter((segment) => !segment.startsWith(\"_index-\"))\n .join(\".\");\n const at = (name: string) => (base ? `${base}.${name}` : name);\n return { type: at(\"type\"), page: at(\"page\"), href: at(\"href\") };\n}\n\nfunction pagePath(page: LinkPageDoc): string {\n return page.slug ? `/${page.slug}` : \"\";\n}\n\nexport const LinkField: RowFieldClientComponent = ({ field, path, readOnly }) => {\n // Payload re-renders a custom field with a stale `path` prop while rows are\n // reordered; the context, when there is one, is the row's current path.\n const rowPath = useFieldPath() ?? path;\n const paths = useMemo(() => siblingPaths(rowPath), [rowPath]);\n\n const type = useField<LinkType | null>({ path: paths.type });\n const page = useField<LinkPageDoc | number | string | null>({ path: paths.page });\n const href = useField<string | null>({ path: paths.href });\n\n const pageField = field.fields.find(\n (f): f is Extract<ClientField, { type: \"relationship\" }> =>\n f.type === \"relationship\" && f.name === \"page\",\n );\n const collection =\n typeof pageField?.relationTo === \"string\" ? pageField.relationTo : \"pages\";\n const required = Boolean(pageField?.required);\n\n const { config } = useConfig();\n const titleKey =\n config.collections.find((c) => c.slug === collection)?.admin?.useAsTitle ?? \"id\";\n const endpoint = `${config.serverURL}${config.routes.api}/${collection}`;\n\n const id = useId();\n const inputId = `${id}-input`;\n const listId = `${id}-list`;\n const inputRef = useRef<HTMLInputElement>(null);\n\n const [query, setQuery] = useState(\"\");\n const [open, setOpen] = useState(false);\n const [loading, setLoading] = useState(false);\n const [results, setResults] = useState<LinkPageDoc[]>([]);\n const [active, setActive] = useState(-1);\n const [focusNext, setFocusNext] = useState(false);\n /** The stored page, looked up; `missing` when the id no longer answers. */\n const [stored, setStored] = useState<{ doc: LinkPageDoc | null; missing: boolean } | null>(null);\n /** Pages seen in search results, so choosing one needs no second request. */\n const known = useRef(new Map<string, LinkPageDoc>());\n const searchSeq = useRef(0);\n\n // Which destination the row holds, by the same reading as the stock fields'\n // conditions and `resolveLink`; `null` is nothing chosen yet.\n const linkType = linkTypeOf({ type: type.value, page: page.value, href: href.value });\n const kind: LinkType | null =\n linkType === \"external\" ? (href.value ? \"external\" : null) : page.value ? \"page\" : null;\n\n const pageValue = page.value;\n const pageId = pageValue && typeof pageValue === \"object\" ? null : pageValue;\n\n useEffect(() => {\n if (kind !== \"page\") {\n setStored(null);\n return;\n }\n if (pageValue && typeof pageValue === \"object\") {\n setStored({ doc: pageValue, missing: false });\n return;\n }\n const cached = known.current.get(String(pageId));\n if (cached) {\n setStored({ doc: cached, missing: false });\n return;\n }\n let cancelled = false;\n fetch(`${endpoint}/${pageId}?depth=0`, { credentials: \"include\" })\n .then(async (response) => {\n if (cancelled) return;\n if (!response.ok) {\n setStored({ doc: null, missing: true });\n return;\n }\n const doc = (await response.json()) as LinkPageDoc;\n known.current.set(String(doc.id), doc);\n if (!cancelled) setStored({ doc, missing: false });\n })\n .catch(() => {\n if (!cancelled) setStored({ doc: null, missing: true });\n });\n return () => {\n cancelled = true;\n };\n }, [kind, pageValue, pageId, endpoint]);\n\n const trimmed = query.trim();\n const urlLike = URL_LIKE.test(trimmed);\n\n useEffect(() => {\n if (!open || urlLike) return;\n const seq = (searchSeq.current += 1);\n setLoading(true);\n const timer = setTimeout(() => {\n const params = new URLSearchParams({\n depth: \"0\",\n limit: String(SEARCH_LIMIT),\n sort: titleKey,\n \"where[_status][equals]\": \"published\",\n });\n if (trimmed) params.set(`where[${titleKey}][like]`, trimmed);\n fetch(`${endpoint}?${params.toString()}`, { credentials: \"include\" })\n .then((response) => (response.ok ? response.json() : { docs: [] }))\n .then((body: { docs?: LinkPageDoc[] }) => {\n if (seq !== searchSeq.current) return;\n const docs = body.docs ?? [];\n for (const doc of docs) known.current.set(String(doc.id), doc);\n setResults(docs);\n setLoading(false);\n })\n .catch(() => {\n if (seq !== searchSeq.current) return;\n setResults([]);\n setLoading(false);\n });\n }, SEARCH_DELAY_MS);\n return () => clearTimeout(timer);\n }, [open, urlLike, trimmed, endpoint, titleKey]);\n\n useEffect(() => {\n if (focusNext && inputRef.current) {\n inputRef.current.focus();\n setFocusNext(false);\n }\n }, [focusNext, kind]);\n\n const options: Option[] = urlLike\n ? [{ kind: \"url\", href: trimmed }]\n : results.map((doc) => ({ kind: \"page\", page: doc }));\n\n function choose(option: Option) {\n if (option.kind === \"page\") {\n known.current.set(String(option.page.id), option.page);\n type.setValue(\"page\");\n page.setValue(option.page.id);\n href.setValue(null);\n } else {\n type.setValue(\"external\");\n href.setValue(option.href);\n page.setValue(null);\n }\n setQuery(\"\");\n setOpen(false);\n setActive(-1);\n }\n\n function clear() {\n type.setValue(\"page\");\n page.setValue(null);\n href.setValue(null);\n setStored(null);\n setFocusNext(true);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n if (!open) {\n setOpen(true);\n return;\n }\n setActive((i) => (options.length ? (i + 1) % options.length : -1));\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n setActive((i) =>\n options.length ? (i <= 0 ? options.length - 1 : i - 1) : -1,\n );\n } else if (event.key === \"Enter\") {\n if (!open) return;\n event.preventDefault();\n const pick = options[active] ?? options[0];\n if (pick) choose(pick);\n } else if (event.key === \"Escape\") {\n if (!open) return;\n event.preventDefault();\n event.stopPropagation();\n setOpen(false);\n setActive(-1);\n }\n }\n\n const error = linkType === \"external\" ? href : page;\n const activeId = active >= 0 && open ? `${id}-option-${active}` : undefined;\n\n return (\n <div className=\"field-type bl-link-field\">\n <style href=\"bl-link-field\" precedence=\"default\">\n {CSS}\n </style>\n <FieldLabel htmlFor={inputId} label={LABEL} required={required} />\n <div className=\"bl-link-field__control\">\n {kind === \"page\" ? (\n <>\n <span className=\"bl-link-field__kind\">Page</span>\n <span className=\"bl-link-field__value\">\n {stored?.doc ? (\n <>\n {String(stored.doc[titleKey as keyof LinkPageDoc] ?? stored.doc.id)}\n <span className=\"bl-link-field__path\">{pagePath(stored.doc)}</span>\n </>\n ) : stored?.missing ? (\n `Page ${String(pageId)}`\n ) : (\n \"…\"\n )}\n </span>\n </>\n ) : kind === \"external\" ? (\n <>\n <span className=\"bl-link-field__kind\">External</span>\n <span className=\"bl-link-field__value\">{href.value}</span>\n </>\n ) : (\n <input\n ref={inputRef}\n id={inputId}\n type=\"text\"\n role=\"combobox\"\n className=\"bl-link-field__input\"\n placeholder={PLACEHOLDER}\n autoComplete=\"off\"\n disabled={readOnly}\n value={query}\n aria-expanded={open}\n aria-controls={listId}\n aria-autocomplete=\"list\"\n aria-activedescendant={activeId}\n onChange={(event) => {\n setQuery(event.target.value);\n setActive(-1);\n setOpen(true);\n }}\n onFocus={() => setOpen(true)}\n onBlur={() => setOpen(false)}\n onKeyDown={onKeyDown}\n />\n )}\n {kind && !readOnly ? (\n <button\n type=\"button\"\n className=\"bl-link-field__clear\"\n aria-label=\"Clear\"\n onClick={clear}\n >\n ×\n </button>\n ) : null}\n {open && !kind ? (\n <ul id={listId} role=\"listbox\" className=\"bl-link-field__menu\">\n {options.map((option, i) => (\n <li\n key={option.kind === \"page\" ? String(option.page.id) : option.href}\n id={`${id}-option-${i}`}\n role=\"option\"\n aria-selected={i === active}\n className=\"bl-link-field__option\"\n onMouseDown={(event) => {\n event.preventDefault();\n choose(option);\n }}\n onMouseEnter={() => setActive(i)}\n >\n {option.kind === \"page\" ? (\n <>\n <span>\n {String(option.page[titleKey as keyof LinkPageDoc] ?? option.page.id)}\n </span>\n <span className=\"bl-link-field__path\">{pagePath(option.page)}</span>\n </>\n ) : (\n <>\n <span>Link to this URL</span>\n <span className=\"bl-link-field__path\">{option.href}</span>\n </>\n )}\n </li>\n ))}\n {options.length === 0 && !loading ? (\n <li role=\"presentation\" className=\"bl-link-field__empty\">\n {NO_MATCH}\n </li>\n ) : null}\n </ul>\n ) : null}\n </div>\n {kind === \"page\" && stored && (stored.missing || stored.doc?._status === \"draft\") ? (\n <div role=\"status\" className=\"bl-link-field__warning\">\n {stored.missing ? MISSING : UNPUBLISHED}\n </div>\n ) : null}\n <FieldDescription description={DESCRIPTION} path={paths.page} />\n <FieldError\n path={error.path}\n showError={error.showError}\n message={error.errorMessage}\n />\n </div>\n );\n};\n\n/** Theme variables only: a literal colour would be right in one theme and wrong in the other. */\nconst CSS = `\n.bl-link-field__control{position:relative;display:flex;align-items:center;gap:calc(var(--base) * .4);min-height:calc(var(--base) * 2);padding:calc(var(--base) * .25) calc(var(--base) * .6);border:1px solid var(--theme-elevation-150);border-radius:var(--style-radius-s);background:var(--theme-input-bg);color:var(--theme-elevation-800);font-family:var(--font-body)}\n.bl-link-field__control:focus-within{border-color:var(--theme-elevation-400);box-shadow:0 0 0 1px var(--theme-elevation-400)}\n.bl-link-field__input{flex:1;min-width:0;border:0;background:transparent;color:inherit;font:inherit;outline:none}\n.bl-link-field__input::placeholder{color:var(--theme-elevation-400)}\n.bl-link-field__input:disabled{color:var(--theme-elevation-400)}\n.bl-link-field__kind{flex:none;padding:2px 6px;border-radius:var(--style-radius-s);background:var(--theme-elevation-100);color:var(--theme-elevation-600);font-size:10.5px;letter-spacing:.05em;text-transform:uppercase}\n.bl-link-field__value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}\n.bl-link-field__path{margin-left:calc(var(--base) * .4);color:var(--theme-elevation-500);font-family:var(--font-mono);font-size:11.5px;font-weight:400}\n.bl-link-field__clear{flex:none;width:calc(var(--base) * 1.2);height:calc(var(--base) * 1.2);border:0;border-radius:var(--style-radius-s);background:transparent;color:var(--theme-elevation-500);font-size:18px;line-height:1;cursor:pointer}\n.bl-link-field__clear:hover,.bl-link-field__clear:focus-visible{background:var(--theme-elevation-100);color:var(--theme-elevation-800);outline:none}\n.bl-link-field__menu{position:absolute;left:-1px;right:-1px;top:calc(100% + 4px);z-index:10;margin:0;padding:calc(var(--base) * .2) 0;list-style:none;border:1px solid var(--theme-elevation-150);border-radius:var(--style-radius-s);background:var(--theme-elevation-0);box-shadow:0 8px 24px var(--theme-overlay)}\n.bl-link-field__option{display:flex;justify-content:space-between;gap:calc(var(--base) * .6);padding:calc(var(--base) * .35) calc(var(--base) * .6);cursor:pointer}\n.bl-link-field__option[aria-selected=\"true\"]{background:var(--theme-elevation-100)}\n.bl-link-field__empty{padding:calc(var(--base) * .5) calc(var(--base) * .6);color:var(--theme-elevation-500)}\n.bl-link-field__warning{display:flex;align-items:baseline;gap:calc(var(--base) * .3);margin-top:calc(var(--base) * .3);color:var(--theme-warning-600);font-size:12px}\n.bl-link-field__warning::before{content:\"\";flex:none;width:8px;height:8px;border-radius:50%;background:var(--theme-warning-500);transform:translateY(-1px)}\n`;\n","import { ArrayField, toast, useField, useTranslation } from \"@payloadcms/ui\";\nimport type { ArrayFieldClientComponent, ArrayFieldClientProps } from \"payload\";\nimport { useCallback, useRef } from \"react\";\n\n/**\n * Payload's array field, with *Remove* refused once the rows are down to\n * `minRows`.\n *\n * This wraps the stock `ArrayField` rather than re-implementing it, so every\n * upstream behaviour (sorting, copy/paste, collapse, localisation) stays put\n * and a Payload upgrade carries it along. The catch is where the row menu\n * lives: Payload portals it into `document.body`, out of reach of any CSS or\n * form context this wrapper could scope. What still reaches the wrapper is\n * the React event: synthetic events bubble through portals along the\n * component tree, so a capture handler here sees the click on *Remove*\n * before the menu's own handler does, and can stop it.\n *\n * Because the menu is portaled, the DOM cannot say whether a given *Remove*\n * belongs to this array or to an array nested inside one of its rows. The\n * trigger that opened the menu *is* in the DOM, though, and every menu opens\n * from its trigger. So the handler remembers, per menu opening, whether the\n * trigger sat directly in this field, and only gates the *Remove* that follows.\n */\nexport const MinRowsArrayField: ArrayFieldClientComponent = (props) => {\n const { field, path: pathFromProps } = props;\n const minRows = field.minRows ?? (field.required ? 1 : 0);\n\n const { rows = [] } = useField({\n hasRows: true,\n potentiallyStalePath: pathFromProps,\n });\n const { i18n, t } = useTranslation();\n\n const rootRef = useRef<HTMLDivElement>(null);\n const menuIsOurs = useRef(false);\n\n const onClickCapture = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const target = event.target;\n if (!(target instanceof Element)) return;\n\n const trigger = target.closest(\".array-actions__button\");\n if (trigger) {\n // The nearest array or blocks field around the trigger is the field\n // whose menu is opening. Ours is the first one inside the wrapper.\n const owner = trigger.closest(\".array-field, .blocks-field\");\n menuIsOurs.current =\n owner !== null && owner === rootRef.current?.querySelector(\".array-field\");\n return;\n }\n\n if (!target.closest(\".array-actions__remove\")) return;\n if (!menuIsOurs.current || rows.length > minRows) return;\n\n event.preventDefault();\n event.stopPropagation();\n toast.error(\n t(\"validation:requiresAtLeast\", {\n count: minRows,\n label: rowLabel(field, minRows, i18n.language) ??\n t(minRows > 1 ? \"general:rows\" : \"general:row\"),\n }),\n );\n },\n [field, i18n.language, minRows, rows.length, t],\n );\n\n return (\n <div ref={rootRef} onClickCapture={onClickCapture}>\n <ArrayField {...props} />\n </div>\n );\n};\n\n/**\n * The word for a row, as Payload's own \"requires at least\" banner picks it:\n * the plural label above one, the singular otherwise, the field label failing\n * both. Client-side labels are static — a string or a per-language record.\n */\nfunction rowLabel(\n field: ArrayFieldClientProps[\"field\"],\n minRows: number,\n language: string,\n): string | undefined {\n const label = minRows > 1 ? field.labels?.plural : field.labels?.singular;\n return staticLabel(label, language) ?? staticLabel(field.label, language);\n}\n\nfunction staticLabel(label: unknown, language: string): string | undefined {\n if (typeof label === \"string\") return label;\n if (label && typeof label === \"object\") {\n const byLanguage = label as Record<string, string | undefined>;\n return byLanguage[language] ?? byLanguage.en ?? Object.values(byLanguage)[0];\n }\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAM,QAAQ;AACd,MAAM,cAAc;AACpB,MAAM,cACJ;AACF,MAAM,WAAW;AACjB,MAAM,cACJ;AACF,MAAM,UACJ;AAEF,MAAM,kBAAkB;AACxB,MAAM,eAAe;;AAGrB,MAAM,WAAW;;;;;AAQjB,SAAS,aAAa,SAAiB;CACrC,MAAM,OAAO,QACV,MAAM,IAAI,CACV,QAAQ,YAAY,CAAC,QAAQ,WAAW,UAAU,CAAC,CACnD,KAAK,IAAI;CACZ,MAAM,MAAM,SAAkB,OAAO,GAAG,KAAK,GAAG,SAAS;AACzD,QAAO;EAAE,MAAM,GAAG,OAAO;EAAE,MAAM,GAAG,OAAO;EAAE,MAAM,GAAG,OAAO;EAAE;;AAGjE,SAAS,SAAS,MAA2B;AAC3C,QAAO,KAAK,OAAO,IAAI,KAAK,SAAS;;AAGvC,MAAa,aAAsC,EAAE,OAAO,MAAM,eAAe;CAG/E,MAAM,UAAU,cAAc,IAAI;CAClC,MAAM,QAAQ,cAAc,aAAa,QAAQ,EAAE,CAAC,QAAQ,CAAC;CAE7D,MAAM,OAAO,SAA0B,EAAE,MAAM,MAAM,MAAM,CAAC;CAC5D,MAAM,OAAO,SAA+C,EAAE,MAAM,MAAM,MAAM,CAAC;CACjF,MAAM,OAAO,SAAwB,EAAE,MAAM,MAAM,MAAM,CAAC;CAE1D,MAAM,YAAY,MAAM,OAAO,MAC5B,MACC,EAAE,SAAS,kBAAkB,EAAE,SAAS,OAC3C;CACD,MAAM,aACJ,OAAO,WAAW,eA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AAK;GAAQ;GAAE,CAChD;YAIG,oBAAC,YAAD,EAAY,GAAI,OAAS,CAAA;EACrB,CAAA;;;;;;;AASV,SAAS,SACP,OACA,SACA,UACoB;AAEpB,QAAO,YADO,UAAU,IAAI,MAAM,QAAQ,SAAS,MAAM,QAAQ,UACvC,SAAS,IAAI,YAAY,MAAM,OAAO,SAAS;;AAG3E,SAAS,YAAY,OAAgB,UAAsC;AACzE,KAAI,OAAO,UAAU,SAAU,QAAO;AACtC,KAAI,SAAS,OAAO,UAAU,UAAU;EACtC,MAAM,aAAa;AACnB,SAAO,WAAW,aAAa,WAAW,MAAM,OAAO,OAAO,WAAW,CAAC"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArrayFieldValidation, Block, CollectionSlug, Field, GroupField, TextFieldSingleValidation, UploadField } from "payload";
|
|
1
|
+
import { ArrayFieldValidation, Block, CollectionSlug, Condition, Field, GroupField, RowField, TextFieldSingleValidation, UploadField } from "payload";
|
|
2
2
|
|
|
3
3
|
//#region src/blocks/hero/config.d.ts
|
|
4
4
|
/**
|
|
@@ -43,6 +43,17 @@ declare const TestimonialMasonryBlock: Block;
|
|
|
43
43
|
*/
|
|
44
44
|
declare const NapBlock: Block;
|
|
45
45
|
//#endregion
|
|
46
|
+
//#region src/blocks/stats-band/config.d.ts
|
|
47
|
+
/**
|
|
48
|
+
* A strip of figures: the facts a visitor should take in at a glance.
|
|
49
|
+
*
|
|
50
|
+
* The count, the order and the desktop column count are the editor's. The
|
|
51
|
+
* phone and tablet layouts are the library's: two per row and three per row,
|
|
52
|
+
* with `wide` naming the one stat that takes a full phone row when the count
|
|
53
|
+
* is odd.
|
|
54
|
+
*/
|
|
55
|
+
declare const StatsBandBlock: Block;
|
|
56
|
+
//#endregion
|
|
46
57
|
//#region src/blocks/mega-menu/config.d.ts
|
|
47
58
|
/**
|
|
48
59
|
* The blocks a header global's `items` array takes.
|
|
@@ -54,7 +65,7 @@ declare const NapBlock: Block;
|
|
|
54
65
|
* backgrounds. `LinkBlock` is the plain bar item beside it.
|
|
55
66
|
*
|
|
56
67
|
* Until SPI-52 lands in the Spinal Simplicity repo, no site renders its header
|
|
57
|
-
* from these rows; the Storybook `Blocks/
|
|
68
|
+
* from these rows; the Storybook `CMS Blocks/MegaMenu` fixture is the only
|
|
58
69
|
* header built from them.
|
|
59
70
|
*/
|
|
60
71
|
/** One approved value, as a select option. */
|
|
@@ -116,26 +127,114 @@ interface ImageFieldOptions extends Partial<MediaUploadField> {
|
|
|
116
127
|
declare function imageField(overrides?: ImageFieldOptions): MediaUploadField;
|
|
117
128
|
//#endregion
|
|
118
129
|
//#region src/fields/link.d.ts
|
|
119
|
-
|
|
130
|
+
/**
|
|
131
|
+
* The import-map path of the link picker, `LinkField` in
|
|
132
|
+
* `@bison-lab/payload-blocks/admin`.
|
|
133
|
+
*
|
|
134
|
+
* It sits on the row that holds a link's `type`, `page` and `href`, and
|
|
135
|
+
* replaces those three inputs with one box: type to search published pages,
|
|
136
|
+
* or paste a URL. Referenced here by package specifier, like
|
|
137
|
+
* `MIN_ROWS_ARRAY_FIELD`; a site picks it up with `payload generate:importmap`.
|
|
138
|
+
* Until it does, Payload logs the missing entry and renders the row as
|
|
139
|
+
* nothing (a custom `Field` with no component behind it is an empty element,
|
|
140
|
+
* not the stock fields), so the step is part of adopting this release.
|
|
141
|
+
*/
|
|
142
|
+
declare const LINK_FIELD = "@bison-lab/payload-blocks/admin#LinkField";
|
|
143
|
+
type LinkType = "page" | "external";
|
|
144
|
+
/**
|
|
145
|
+
* A page as the `page` relationship populates it: what `resolveLink` reads,
|
|
146
|
+
* and what the picker shows. A site's generated `Page` is assignable to it.
|
|
147
|
+
* `_status` is absent on a collection without drafts, which counts as
|
|
148
|
+
* published.
|
|
149
|
+
*/
|
|
150
|
+
interface LinkPageDoc {
|
|
151
|
+
id: number | string;
|
|
152
|
+
title?: string | null;
|
|
153
|
+
slug?: string | null;
|
|
154
|
+
_status?: ("draft" | "published") | null;
|
|
155
|
+
}
|
|
156
|
+
/** Where a link goes: the three fields the picker writes. */
|
|
157
|
+
interface LinkDestination {
|
|
158
|
+
/** `page` unless the editor pasted a URL. Rows saved before links had a type carry only `href`. */
|
|
159
|
+
type?: LinkType | null;
|
|
160
|
+
/** The page's id, or the page itself once a `depth >= 1` read populates it. */
|
|
161
|
+
page?: LinkPageDoc | number | string | null;
|
|
162
|
+
/** The pasted URL of an external link. */
|
|
163
|
+
href?: string | null;
|
|
164
|
+
}
|
|
165
|
+
/** The shape `linkField`/`linkFields` produce once Payload generates types. */
|
|
166
|
+
interface LinkValue extends LinkDestination {
|
|
167
|
+
label?: string | null;
|
|
168
|
+
newTab?: boolean | null;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Turns a link's destination into the `href` a renderer emits, or `null`
|
|
172
|
+
* when there is nothing to point at, in which case the renderer shows the
|
|
173
|
+
* label as text. A site passes its own (`RenderBlocks`' `resolveLink`) when
|
|
174
|
+
* a page's path is not `/<slug>`: the package has no way to know a site's
|
|
175
|
+
* routes, the same reason it takes an `imageComponent`.
|
|
176
|
+
*/
|
|
177
|
+
type ResolveLink = (link: LinkDestination) => string | null;
|
|
178
|
+
/**
|
|
179
|
+
* The package's resolver: a published, populated page is `/<slug>`; an
|
|
180
|
+
* external link is its `href` as typed.
|
|
181
|
+
*
|
|
182
|
+
* A page that did not populate is `null`: Payload hands the public read the
|
|
183
|
+
* bare id when the reader may not see the page, which is what an unpublished
|
|
184
|
+
* page looks like from the site. A populated page whose `_status` is `draft`
|
|
185
|
+
* is `null` too, for a read that can see drafts. A row from before links had
|
|
186
|
+
* a `type` is an external link by `linkTypeOf`, here, in the stock fields'
|
|
187
|
+
* conditions and in the picker alike: the site keeps rendering its `href`,
|
|
188
|
+
* the admin shows it as an External chip, and the site's migration to
|
|
189
|
+
* `type: external` only makes the stored row say what every reader already
|
|
190
|
+
* assumes.
|
|
191
|
+
*/
|
|
192
|
+
declare function resolveLink(link: LinkDestination | null | undefined): string | null;
|
|
193
|
+
/**
|
|
194
|
+
* Which of the two stored destinations a row is using. `type` decides; a row
|
|
195
|
+
* with no `type` yet (saved before links had one) is read by what it holds,
|
|
196
|
+
* an `href` making it external, the same reading `resolveLink` and the picker
|
|
197
|
+
* make, so all three agree on every row.
|
|
198
|
+
*/
|
|
199
|
+
declare function linkTypeOf(link: LinkDestination | null | undefined): LinkType;
|
|
200
|
+
interface LinkDestinationOptions {
|
|
201
|
+
/** Require a destination. Defaults to `false`. */
|
|
202
|
+
required?: boolean;
|
|
203
|
+
/** The collection a page link points into. Defaults to `pages`. */
|
|
204
|
+
pagesCollection?: string;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Where a link goes, as stored: `type`, `page` and `href` in one row.
|
|
208
|
+
*
|
|
209
|
+
* The row carries the picker (`LINK_FIELD`), which replaces all three inputs
|
|
210
|
+
* with one box. The stored fields are the website template's shape and stay
|
|
211
|
+
* editable on their own: `page` shows for a page link, `href` for an external
|
|
212
|
+
* one, and `required` binds whichever is active, since Payload skips
|
|
213
|
+
* validation on a field whose condition is false. `page` offers published
|
|
214
|
+
* rows only, and Payload re-checks that on publish, so a page that was
|
|
215
|
+
* unpublished after being picked has to be picked again or republished.
|
|
216
|
+
*/
|
|
217
|
+
declare function linkDestinationFields({
|
|
218
|
+
required,
|
|
219
|
+
pagesCollection
|
|
220
|
+
}?: LinkDestinationOptions): RowField[];
|
|
221
|
+
interface LinkFieldsOptions extends LinkDestinationOptions {
|
|
120
222
|
/** Require the label and destination. Defaults to `false`. */
|
|
121
223
|
required?: boolean;
|
|
122
224
|
/** Wording for the visible text field. Defaults to "Label". */
|
|
123
225
|
labelFieldLabel?: string;
|
|
124
226
|
}
|
|
125
227
|
/**
|
|
126
|
-
* The
|
|
127
|
-
*
|
|
128
|
-
* `href` is plain text rather than a relationship to a `pages` row: a block in
|
|
129
|
-
* this package has to work on a site whose page collection is named something
|
|
130
|
-
* else, or which links out more often than in. Resolving an internal reference
|
|
131
|
-
* is the site's job.
|
|
228
|
+
* The fields a call to action is made of, unwrapped: the destination row,
|
|
229
|
+
* then the label and the new-tab flag.
|
|
132
230
|
*
|
|
133
231
|
* `newTab` drives `target="_blank"` *and* the matching `rel`, which is why no
|
|
134
232
|
* renderer takes one without the other.
|
|
135
233
|
*/
|
|
136
234
|
declare function linkFields({
|
|
137
235
|
required,
|
|
138
|
-
labelFieldLabel
|
|
236
|
+
labelFieldLabel,
|
|
237
|
+
pagesCollection
|
|
139
238
|
}?: LinkFieldsOptions): Field[];
|
|
140
239
|
interface LinkFieldOptions extends LinkFieldsOptions {
|
|
141
240
|
/** Field name. Defaults to `link`. */
|
|
@@ -150,12 +249,6 @@ declare function linkField({
|
|
|
150
249
|
admin,
|
|
151
250
|
...rest
|
|
152
251
|
}?: LinkFieldOptions): GroupField;
|
|
153
|
-
/** The shape `linkField`/`linkFields` produce once Payload generates types. */
|
|
154
|
-
interface LinkValue {
|
|
155
|
-
label?: string | null;
|
|
156
|
-
href?: string | null;
|
|
157
|
-
newTab?: boolean | null;
|
|
158
|
-
}
|
|
159
252
|
//#endregion
|
|
160
253
|
//#region src/fields/heading.d.ts
|
|
161
254
|
interface HeadingFieldsOptions {
|
|
@@ -163,6 +256,12 @@ interface HeadingFieldsOptions {
|
|
|
163
256
|
required?: boolean;
|
|
164
257
|
/** Description shown under the eyebrow input. */
|
|
165
258
|
eyebrowDescription?: string;
|
|
259
|
+
/**
|
|
260
|
+
* Show the three fields only when this holds, e.g. unless the block floats.
|
|
261
|
+
* Pair it with `required: false`: a hidden required field can never be
|
|
262
|
+
* satisfied, and the block could not publish.
|
|
263
|
+
*/
|
|
264
|
+
condition?: Condition;
|
|
166
265
|
}
|
|
167
266
|
/**
|
|
168
267
|
* The eyebrow / title / description trio every marketing band opens with.
|
|
@@ -174,7 +273,8 @@ interface HeadingFieldsOptions {
|
|
|
174
273
|
*/
|
|
175
274
|
declare function headingFields({
|
|
176
275
|
required,
|
|
177
|
-
eyebrowDescription
|
|
276
|
+
eyebrowDescription,
|
|
277
|
+
condition
|
|
178
278
|
}?: HeadingFieldsOptions): Field[];
|
|
179
279
|
//#endregion
|
|
180
280
|
//#region src/fields/min-rows.d.ts
|
|
@@ -341,12 +441,12 @@ interface FaqColumnsBlockData extends BlockRow<"faqColumns"> {
|
|
|
341
441
|
title?: string | null;
|
|
342
442
|
description?: string | null;
|
|
343
443
|
items?: FaqColumnsItemData[] | null;
|
|
444
|
+
/** A link whose visible text is `linkText`, not `label`; the destination is `linkFields()`' shape. */
|
|
344
445
|
cta?: {
|
|
345
446
|
title?: string | null;
|
|
346
447
|
linkText?: string | null;
|
|
347
|
-
href?: string | null;
|
|
348
448
|
newTab?: boolean | null;
|
|
349
|
-
};
|
|
449
|
+
} & LinkDestination;
|
|
350
450
|
sticky?: boolean | null;
|
|
351
451
|
type?: ("single" | "multiple") | null;
|
|
352
452
|
collapsible?: boolean | null;
|
|
@@ -369,6 +469,24 @@ interface TestimonialMasonryBlockData extends BlockRow<"testimonialMasonry"> {
|
|
|
369
469
|
minItemsForFade?: number | null;
|
|
370
470
|
maxVisibleRows?: number | null;
|
|
371
471
|
}
|
|
472
|
+
interface StatsBandItemData {
|
|
473
|
+
value?: string | null;
|
|
474
|
+
label?: string | null;
|
|
475
|
+
href?: string | null;
|
|
476
|
+
wide?: boolean | null;
|
|
477
|
+
id?: string | null;
|
|
478
|
+
}
|
|
479
|
+
interface StatsBandBlockData extends BlockRow<"statsBand"> {
|
|
480
|
+
eyebrow?: string | null;
|
|
481
|
+
title?: string | null;
|
|
482
|
+
description?: string | null;
|
|
483
|
+
items?: StatsBandItemData[] | null;
|
|
484
|
+
/** A select, so the value is the digit as a string. */
|
|
485
|
+
columns?: ("2" | "3" | "4" | "5" | "6") | null;
|
|
486
|
+
tone?: ("card" | "plain") | null;
|
|
487
|
+
align?: ("start" | "center") | null;
|
|
488
|
+
overlap?: boolean | null;
|
|
489
|
+
}
|
|
372
490
|
interface NapDepartmentData {
|
|
373
491
|
name?: string | null;
|
|
374
492
|
departmentType?: string | null;
|
|
@@ -430,7 +548,7 @@ interface MegaMenuBlockData extends BlockRow<"megaMenu"> {
|
|
|
430
548
|
}
|
|
431
549
|
interface NavLinkBlockData extends BlockRow<"navLink">, LinkValue {}
|
|
432
550
|
/** Every block this package ships, as one union. */
|
|
433
|
-
type BisonBlockData = HeroBlockData | RichTextBlockData | ShowcasePanelsBlockData | ProcessStepsBlockData | FaqColumnsBlockData | TestimonialMasonryBlockData | NapBlockData | MegaMenuBlockData | NavLinkBlockData;
|
|
551
|
+
type BisonBlockData = HeroBlockData | RichTextBlockData | ShowcasePanelsBlockData | ProcessStepsBlockData | FaqColumnsBlockData | TestimonialMasonryBlockData | NapBlockData | StatsBandBlockData | MegaMenuBlockData | NavLinkBlockData;
|
|
434
552
|
/** The `blockType` of every block this package ships. */
|
|
435
553
|
type BisonBlockType = BisonBlockData["blockType"];
|
|
436
554
|
//#endregion
|
|
@@ -505,5 +623,5 @@ declare function sampleImage({
|
|
|
505
623
|
alt
|
|
506
624
|
}: SampleImageOptions): MediaDoc;
|
|
507
625
|
//#endregion
|
|
508
|
-
export { type BisonBlockData, type BisonBlockType, type BlockSamples, FaqColumnsBlock, type FaqColumnsBlockData, type FaqColumnsItemData, type HeadingFieldsOptions, HeroBlock, type HeroBlockData, type ImageFieldOptions, LinkBlock, type LinkFieldOptions, type LinkFieldsOptions, type LinkValue, MEGA_MENU_WIDTHS, MIN_ROWS_ARRAY_FIELD, type MediaDoc, type MediaValue, type MegaMenuBlockData, type MegaMenuBlockOptions, type MegaMenuColumnData, type MegaMenuLinkData, type MegaMenuOption, type MegaMenuSectionData, type MegaMenuWidthValue, NapBlock, type NapBlockData, type NapDepartmentData, type NavLinkBlockData, ProcessStepsBlock, type ProcessStepsBlockData, type ProcessStepsItemData, type ResolvedMedia, RichTextBlock, type RichTextBlockData, type RichTextContent, type SampleImageOptions, ShowcasePanelsBlock, type ShowcasePanelsBlockData, type ShowcasePanelsItemData, TestimonialMasonryBlock, type TestimonialMasonryBlockData, type TestimonialMasonryItemData, blockSamples, emptyRows, headingFields, imageField, linkField, linkFields, megaMenuBlock, megaMenuSampleOptions, resolveMedia, sampleImage, validateColumnWidths, validateRemWidth };
|
|
626
|
+
export { type BisonBlockData, type BisonBlockType, type BlockSamples, FaqColumnsBlock, type FaqColumnsBlockData, type FaqColumnsItemData, type HeadingFieldsOptions, HeroBlock, type HeroBlockData, type ImageFieldOptions, LINK_FIELD, LinkBlock, type LinkDestination, type LinkDestinationOptions, type LinkFieldOptions, type LinkFieldsOptions, type LinkPageDoc, type LinkType, type LinkValue, MEGA_MENU_WIDTHS, MIN_ROWS_ARRAY_FIELD, type MediaDoc, type MediaValue, type MegaMenuBlockData, type MegaMenuBlockOptions, type MegaMenuColumnData, type MegaMenuLinkData, type MegaMenuOption, type MegaMenuSectionData, type MegaMenuWidthValue, NapBlock, type NapBlockData, type NapDepartmentData, type NavLinkBlockData, ProcessStepsBlock, type ProcessStepsBlockData, type ProcessStepsItemData, type ResolveLink, type ResolvedMedia, RichTextBlock, type RichTextBlockData, type RichTextContent, type SampleImageOptions, ShowcasePanelsBlock, type ShowcasePanelsBlockData, type ShowcasePanelsItemData, StatsBandBlock, type StatsBandBlockData, type StatsBandItemData, TestimonialMasonryBlock, type TestimonialMasonryBlockData, type TestimonialMasonryItemData, blockSamples, emptyRows, headingFields, imageField, linkDestinationFields, linkField, linkFields, linkTypeOf, megaMenuBlock, megaMenuSampleOptions, resolveLink, resolveMedia, sampleImage, validateColumnWidths, validateRemWidth };
|
|
509
627
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/blocks/hero/config.ts","../src/blocks/rich-text/config.ts","../src/blocks/showcase-panels/config.ts","../src/blocks/process-steps/config.ts","../src/blocks/faq-columns/config.ts","../src/blocks/testimonial-masonry/config.ts","../src/blocks/nap/config.ts","../src/blocks/mega-menu/config.ts","../src/fields/image.ts","../src/fields/link.ts","../src/fields/heading.ts","../src/fields/min-rows.ts","../src/media.ts","../src/types.ts","../src/samples.ts","../src/blocks/mega-menu/sample.ts","../src/sample-image.ts"],"mappings":";;;;;AAcA;;;;;;;cAAa,SAAA,EAAW,KAAA;;;;cCXX,aAAA,EAAe,KAAA;;;;cCGf,mBAAA,EAAqB,KAAA;;;;cCArB,iBAAA,EAAmB,KAAA;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/blocks/hero/config.ts","../src/blocks/rich-text/config.ts","../src/blocks/showcase-panels/config.ts","../src/blocks/process-steps/config.ts","../src/blocks/faq-columns/config.ts","../src/blocks/testimonial-masonry/config.ts","../src/blocks/nap/config.ts","../src/blocks/stats-band/config.ts","../src/blocks/mega-menu/config.ts","../src/fields/image.ts","../src/fields/link.ts","../src/fields/heading.ts","../src/fields/min-rows.ts","../src/media.ts","../src/types.ts","../src/samples.ts","../src/blocks/mega-menu/sample.ts","../src/sample-image.ts"],"mappings":";;;;;AAcA;;;;;;;cAAa,SAAA,EAAW,KAAA;;;;cCXX,aAAA,EAAe,KAAA;;;;cCGf,mBAAA,EAAqB,KAAA;;;;cCArB,iBAAA,EAAmB,KAAA;;;;cCCnB,eAAA,EAAiB,KAAA;;;;cCCjB,uBAAA,EAAyB,KAAA;;;;;ALMtC;;;;;;cMFa,QAAA,EAAU,KAAA;;;;;AJNvB;;;;;;cKyCa,cAAA,EAAgB,KAAA;;;;;APjC7B;;;;;;;;ACXA;;;;UO0BiB,cAAA;EACf,KAAA;EACA,KAAA;AAAA;AAAA,UAGe,oBAAA;ENyChB;EMvCC,QAAA,GAAW,cAAA;EN9BqB;EMgChC,KAAA,GAAQ,cAAA;AAAA;;cAIG,gBAAA;AAAA,KACD,kBAAA,WAA6B,gBAAA;;;;;;;;cAuB5B,oBAAA,EAAsB,oBAAA;;cA4CtB,gBAAA,EAAkB,yBAAA;AAAA,iBAqBf,a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