@phtngyn/cms 0.2.0-beta.7 → 0.3.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/LICENSE +18 -10
- package/README.md +59 -401
- package/drizzle/20261003215543_initial/migration.sql +251 -0
- package/drizzle/20261003215543_initial/snapshot.json +1941 -0
- package/package.json +75 -71
- package/src/Authoring.d.ts +41 -49
- package/src/Authoring.js +1 -1
- package/src/Blocks-BrxSemnd.js +40 -0
- package/src/Client.d.ts +8186 -0
- package/src/Client.js +41 -0
- package/src/Collections.d.ts +142 -0
- package/src/Collections.js +142 -0
- package/src/Config-CMiwciub.js +130 -0
- package/src/Config.d.ts +172 -0
- package/src/Config.js +2 -0
- package/src/Configuration-Dk2k3OIc.js +73 -0
- package/src/DataTransfer-BmECvPHB.js +488 -0
- package/src/Database-DSsNCGft.d.ts +3 -0
- package/src/Delivery.d.ts +28 -0
- package/src/Delivery.js +7 -0
- package/src/Document-CKXMSEf1.js +293 -0
- package/src/Document-TgwYKJZM.d.ts +220 -0
- package/src/DocumentRenderer-Wz2xaNyf.js +394 -0
- package/src/EditorSchema-wrDv-id6.js +296 -0
- package/src/Fields-BegSgYhj.d.ts +166 -0
- package/src/Fields-ioGaMEh9.js +130 -0
- package/src/Forms-BuKAXQxr.d.ts +203 -0
- package/src/Forms.d.ts +48 -11
- package/src/Forms.js +342 -7
- package/src/I18n-Ckf9h0rC.js +154 -0
- package/src/I18n.d.ts +45 -2
- package/src/I18n.js +2 -1
- package/src/Image-CJWPLnhP.js +110 -0
- package/src/Links-CJYyy7rC.js +28 -0
- package/src/Links-Dx1yOni8.d.ts +28 -0
- package/src/Locales-Ch7a5xuA.js +67 -0
- package/src/Locales-jwbmJaOp.d.ts +43 -0
- package/src/Locales.d.ts +3 -0
- package/src/Locales.js +3 -0
- package/src/Media-BQ0uL4w7.d.ts +15 -0
- package/src/Media-DSyvd14o.js +87 -0
- package/src/Module.d.ts +2 -10
- package/src/Module.js +1039 -162
- package/src/Operations.d.ts +57 -0
- package/src/Operations.js +263 -0
- package/src/People-DvNZauWw.js +69 -0
- package/src/PreviewFocus-C_EelZO5.js +104 -0
- package/src/Query-C0kGJF5_.d.ts +261 -0
- package/src/RevisionPreview-IVwbJ9Wy.js +133 -0
- package/src/Routes-BaZvm2LE.js +126 -0
- package/src/Routes-DM1rRp3r.d.ts +15 -0
- package/src/S3MediaObjects-y-WacEi9.js +193 -0
- package/src/Seo-BcpqxoAs.d.ts +57 -0
- package/src/Seo-CjNUtUkj.js +254 -0
- package/src/StudioApi-CXLwwocX.js +833 -0
- package/src/StudioErrors-T5zLGQ1M.js +117 -0
- package/src/StudioErrors-kq-E44lQ.d.ts +104 -0
- package/src/StudioServer.d.ts +20 -0
- package/src/StudioServer.js +34 -0
- package/src/answers-DcTg0Xv2.js +41 -0
- package/src/cli.js +681 -187
- package/src/contracts-rprW3ZOB.js +130 -0
- package/src/forms-3xuf0Ym7.d.ts +206 -0
- package/src/localeConfiguration-BPbkLi7-.js +32 -0
- package/src/localeContext-DhF3SPvM.js +59 -0
- package/src/locales-6OD4XGIZ.js +12 -0
- package/src/nuxtDelivery-BYX_Cddb.js +466 -0
- package/src/plugin-DTYuDaQu.js +7171 -0
- package/src/previewContext-dt3ZUh-w.js +4 -0
- package/src/previewRegions-CXjk5cbP.js +145 -0
- package/src/previewSource-fb-q3ESM.js +144 -0
- package/src/rendering-D9LVeEKX.js +47 -0
- package/src/rolldown-runtime-8H4AJuhK.js +14 -0
- package/src/runtime/CmsImage.js +38 -0
- package/src/runtime/DocumentPage.vue +10 -0
- package/src/runtime/DocumentPageContent.js +48 -0
- package/src/runtime/DocumentRenderer.d.ts +129 -0
- package/src/runtime/DocumentRenderer.js +2 -0
- package/src/runtime/api.js +48 -6
- package/src/runtime/delivery/useCmsDocument.js +2 -0
- package/src/runtime/delivery/useCmsDocumentQuery.js +2 -0
- package/src/runtime/delivery/useCmsDocumentSeo.js +2 -114
- package/src/runtime/delivery/useCmsLocale.js +10 -0
- package/src/runtime/plugin.js +2 -40
- package/src/runtime/preview.css +85 -0
- package/src/runtime/preview.js +277 -0
- package/src/runtime/previewSource.js +82 -0
- package/src/runtime/revisionPrivacy.js +13 -0
- package/src/runtime/studio.js +10 -0
- package/src/runtime/studioIcons.js +36 -0
- package/src/validation-3pggwcnm.js +396 -0
- package/src/validation-DpUwPC8Y.js +224 -0
- package/studio/THIRD-PARTY-LICENSES.md +2406 -0
- package/studio/chunks/AccountPage-DL3DitDM.js +288 -0
- package/studio/chunks/AccountPage-DL3DitDM.js.br +0 -0
- package/studio/chunks/AccountPage-DL3DitDM.js.gz +0 -0
- package/studio/chunks/ActivityPage-CLqVUqTh.js +584 -0
- package/studio/chunks/ActivityPage-CLqVUqTh.js.br +0 -0
- package/studio/chunks/ActivityPage-CLqVUqTh.js.gz +0 -0
- package/studio/chunks/Alert-D0D24z_a.js +335 -0
- package/studio/chunks/Alert-D0D24z_a.js.br +0 -0
- package/studio/chunks/Alert-D0D24z_a.js.gz +0 -0
- package/studio/chunks/Badge-BBFs88TI.js +346 -0
- package/studio/chunks/Badge-BBFs88TI.js.br +0 -0
- package/studio/chunks/Badge-BBFs88TI.js.gz +0 -0
- package/studio/chunks/Button-BT3ztSPx.js +14319 -0
- package/studio/chunks/Button-BT3ztSPx.js.br +0 -0
- package/studio/chunks/Button-BT3ztSPx.js.gz +0 -0
- package/studio/chunks/Collapsible-CKnEYIlp.js +246 -0
- package/studio/chunks/Collapsible-CKnEYIlp.js.br +0 -0
- package/studio/chunks/Collapsible-CKnEYIlp.js.gz +0 -0
- package/studio/chunks/ContentInventory-D7nsFA6U.js +1745 -0
- package/studio/chunks/ContentInventory-D7nsFA6U.js.br +0 -0
- package/studio/chunks/ContentInventory-D7nsFA6U.js.gz +0 -0
- package/studio/chunks/ContentPage-DCxt6BeD.js +18 -0
- package/studio/chunks/ContentPage-DCxt6BeD.js.br +0 -0
- package/studio/chunks/ContentPage-DCxt6BeD.js.gz +0 -0
- package/studio/chunks/DashboardSearch-DjyMjJwF.js +2413 -0
- package/studio/chunks/DashboardSearch-DjyMjJwF.js.br +0 -0
- package/studio/chunks/DashboardSearch-DjyMjJwF.js.gz +0 -0
- package/studio/chunks/DocumentLocaleMenu-0EkkOr6_.js +26063 -0
- package/studio/chunks/DocumentLocaleMenu-0EkkOr6_.js.br +0 -0
- package/studio/chunks/DocumentLocaleMenu-0EkkOr6_.js.gz +0 -0
- package/studio/chunks/DropdownMenu-CA9fB0uZ.js +4400 -0
- package/studio/chunks/DropdownMenu-CA9fB0uZ.js.br +0 -0
- package/studio/chunks/DropdownMenu-CA9fB0uZ.js.gz +0 -0
- package/studio/chunks/EditorPage-D_PAYEE4.js +7799 -0
- package/studio/chunks/EditorPage-D_PAYEE4.js.br +0 -0
- package/studio/chunks/EditorPage-D_PAYEE4.js.gz +0 -0
- package/studio/chunks/FormField-CgM6l2Yn.js +198 -0
- package/studio/chunks/FormField-CgM6l2Yn.js.br +0 -0
- package/studio/chunks/FormField-CgM6l2Yn.js.gz +0 -0
- package/studio/chunks/HelpPage-C-vrFcT_.js +552 -0
- package/studio/chunks/HelpPage-C-vrFcT_.js.br +0 -0
- package/studio/chunks/HelpPage-C-vrFcT_.js.gz +0 -0
- package/studio/chunks/Kbd-Ot7TIhVZ.js +271 -0
- package/studio/chunks/Kbd-Ot7TIhVZ.js.br +0 -0
- package/studio/chunks/Kbd-Ot7TIhVZ.js.gz +0 -0
- package/studio/chunks/MediaFolderDialog-DYu-eu-q.js +101 -0
- package/studio/chunks/MediaFolderDialog-DYu-eu-q.js.br +0 -0
- package/studio/chunks/MediaFolderDialog-DYu-eu-q.js.gz +0 -0
- package/studio/chunks/MediaPage-D-jaWtdl.js +923 -0
- package/studio/chunks/MediaPage-D-jaWtdl.js.br +0 -0
- package/studio/chunks/MediaPage-D-jaWtdl.js.gz +0 -0
- package/studio/chunks/MediaPicker-BZs2wUFz.js +837 -0
- package/studio/chunks/MediaPicker-BZs2wUFz.js.br +0 -0
- package/studio/chunks/MediaPicker-BZs2wUFz.js.gz +0 -0
- package/studio/chunks/MediaUploadPanel-C7Kyg6aR.js +1173 -0
- package/studio/chunks/MediaUploadPanel-C7Kyg6aR.js.br +0 -0
- package/studio/chunks/MediaUploadPanel-C7Kyg6aR.js.gz +0 -0
- package/studio/chunks/Modal-D6hSvxHd.js +265 -0
- package/studio/chunks/Modal-D6hSvxHd.js.br +0 -0
- package/studio/chunks/Modal-D6hSvxHd.js.gz +0 -0
- package/studio/chunks/NewDocumentDialog-C8B6_r3J.js +277 -0
- package/studio/chunks/NewDocumentDialog-C8B6_r3J.js.br +0 -0
- package/studio/chunks/NewDocumentDialog-C8B6_r3J.js.gz +0 -0
- package/studio/chunks/Pagination-D9BSo5H2.js +573 -0
- package/studio/chunks/Pagination-D9BSo5H2.js.br +0 -0
- package/studio/chunks/Pagination-D9BSo5H2.js.gz +0 -0
- package/studio/chunks/PeoplePage-CWIXitBD.js +783 -0
- package/studio/chunks/PeoplePage-CWIXitBD.js.br +0 -0
- package/studio/chunks/PeoplePage-CWIXitBD.js.gz +0 -0
- package/studio/chunks/Popover-B63bkTMS.js +128 -0
- package/studio/chunks/Popover-B63bkTMS.js.br +0 -0
- package/studio/chunks/Popover-B63bkTMS.js.gz +0 -0
- package/studio/chunks/PublicationActionDialog-Cm_P0C3I.js +255 -0
- package/studio/chunks/PublicationActionDialog-Cm_P0C3I.js.br +0 -0
- package/studio/chunks/PublicationActionDialog-Cm_P0C3I.js.gz +0 -0
- package/studio/chunks/Routes-DLYHmulE.js +102 -0
- package/studio/chunks/Routes-DLYHmulE.js.br +0 -0
- package/studio/chunks/Routes-DLYHmulE.js.gz +0 -0
- package/studio/chunks/RovingFocusItem-QZNg-wWF.js +95 -0
- package/studio/chunks/RovingFocusItem-QZNg-wWF.js.br +0 -0
- package/studio/chunks/RovingFocusItem-QZNg-wWF.js.gz +0 -0
- package/studio/chunks/ScheduledPage-C0hqrkr5.js +332 -0
- package/studio/chunks/ScheduledPage-C0hqrkr5.js.br +0 -0
- package/studio/chunks/ScheduledPage-C0hqrkr5.js.gz +0 -0
- package/studio/chunks/Search-BEgCe9Aj.js +14646 -0
- package/studio/chunks/Search-BEgCe9Aj.js.br +0 -0
- package/studio/chunks/Search-BEgCe9Aj.js.gz +0 -0
- package/studio/chunks/Select-B50WZMW-.js +2145 -0
- package/studio/chunks/Select-B50WZMW-.js.br +0 -0
- package/studio/chunks/Select-B50WZMW-.js.gz +0 -0
- package/studio/chunks/SelectMenu-DSweWGMz.js +2109 -0
- package/studio/chunks/SelectMenu-DSweWGMz.js.br +0 -0
- package/studio/chunks/SelectMenu-DSweWGMz.js.gz +0 -0
- package/studio/chunks/SeoPage-CNNxGe4h.js +846 -0
- package/studio/chunks/SeoPage-CNNxGe4h.js.br +0 -0
- package/studio/chunks/SeoPage-CNNxGe4h.js.gz +0 -0
- package/studio/chunks/Skeleton-COz8dcrw.js +39 -0
- package/studio/chunks/Skeleton-COz8dcrw.js.br +2 -0
- package/studio/chunks/Skeleton-COz8dcrw.js.gz +0 -0
- package/studio/chunks/Slideover-QMMHAAys.js +289 -0
- package/studio/chunks/Slideover-QMMHAAys.js.br +0 -0
- package/studio/chunks/Slideover-QMMHAAys.js.gz +0 -0
- package/studio/chunks/StudioPage-ngEIDr5d.js +80 -0
- package/studio/chunks/StudioPage-ngEIDr5d.js.br +0 -0
- package/studio/chunks/StudioPage-ngEIDr5d.js.gz +0 -0
- package/studio/chunks/StudioPageToolbar-BwHnqyr6.js +2524 -0
- package/studio/chunks/StudioPageToolbar-BwHnqyr6.js.br +0 -0
- package/studio/chunks/StudioPageToolbar-BwHnqyr6.js.gz +0 -0
- package/studio/chunks/Switch-qKl1aDn7.js +484 -0
- package/studio/chunks/Switch-qKl1aDn7.js.br +0 -0
- package/studio/chunks/Switch-qKl1aDn7.js.gz +0 -0
- package/studio/chunks/ToolPage-DxoVAJVk.js +29 -0
- package/studio/chunks/ToolPage-DxoVAJVk.js.br +0 -0
- package/studio/chunks/ToolPage-DxoVAJVk.js.gz +0 -0
- package/studio/chunks/Tooltip-Bu15m_DB.js +693 -0
- package/studio/chunks/Tooltip-Bu15m_DB.js.br +0 -0
- package/studio/chunks/Tooltip-Bu15m_DB.js.gz +0 -0
- package/studio/chunks/TrashPage-lhqLLdoG.js +12 -0
- package/studio/chunks/TrashPage-lhqLLdoG.js.br +0 -0
- package/studio/chunks/TrashPage-lhqLLdoG.js.gz +0 -0
- package/studio/chunks/VersionsPage-Cqy6UAp9.js +2349 -0
- package/studio/chunks/VersionsPage-Cqy6UAp9.js.br +0 -0
- package/studio/chunks/VersionsPage-Cqy6UAp9.js.gz +0 -0
- package/studio/chunks/VisuallyHiddenInput-Cu8hQLRf.js +113 -0
- package/studio/chunks/VisuallyHiddenInput-Cu8hQLRf.js.br +0 -0
- package/studio/chunks/VisuallyHiddenInput-Cu8hQLRf.js.gz +0 -0
- package/studio/chunks/arrays-CUJkmV4I.js +10 -0
- package/studio/chunks/arrays-CUJkmV4I.js.br +0 -0
- package/studio/chunks/arrays-CUJkmV4I.js.gz +0 -0
- package/studio/chunks/base-DkTekJe8.js +213 -0
- package/studio/chunks/base-DkTekJe8.js.br +0 -0
- package/studio/chunks/base-DkTekJe8.js.gz +0 -0
- package/studio/chunks/content-DUGl3N4d.js +6012 -0
- package/studio/chunks/content-DUGl3N4d.js.br +0 -0
- package/studio/chunks/content-DUGl3N4d.js.gz +0 -0
- package/studio/chunks/destinations-DPIQVQa6.js +227 -0
- package/studio/chunks/destinations-DPIQVQa6.js.br +0 -0
- package/studio/chunks/destinations-DPIQVQa6.js.gz +0 -0
- package/studio/chunks/en-073cjKW4.js +152 -0
- package/studio/chunks/en-073cjKW4.js.br +0 -0
- package/studio/chunks/en-073cjKW4.js.gz +0 -0
- package/studio/chunks/en-Bn8mxPuf.js +134 -0
- package/studio/chunks/en-Bn8mxPuf.js.br +0 -0
- package/studio/chunks/en-Bn8mxPuf.js.gz +0 -0
- package/studio/chunks/en-C9OiaUDZ.js +251 -0
- package/studio/chunks/en-C9OiaUDZ.js.br +0 -0
- package/studio/chunks/en-C9OiaUDZ.js.gz +0 -0
- package/studio/chunks/en-CHAR6jzx.js +147 -0
- package/studio/chunks/en-CHAR6jzx.js.br +0 -0
- package/studio/chunks/en-CHAR6jzx.js.gz +0 -0
- package/studio/chunks/en-Cq4N1vEF.js +93 -0
- package/studio/chunks/en-Cq4N1vEF.js.br +2 -0
- package/studio/chunks/en-Cq4N1vEF.js.gz +0 -0
- package/studio/chunks/en-D2hRqlse.js +140 -0
- package/studio/chunks/en-D2hRqlse.js.br +0 -0
- package/studio/chunks/en-D2hRqlse.js.gz +0 -0
- package/studio/chunks/en-DiUC3-j6.js +144 -0
- package/studio/chunks/en-DiUC3-j6.js.br +0 -0
- package/studio/chunks/en-DiUC3-j6.js.gz +0 -0
- package/studio/chunks/english-Cs_Adu-u.js +8 -0
- package/studio/chunks/english-Cs_Adu-u.js.br +0 -0
- package/studio/chunks/english-Cs_Adu-u.js.gz +0 -0
- package/studio/chunks/esm-D6DqSiL1.js +752 -0
- package/studio/chunks/esm-D6DqSiL1.js.br +0 -0
- package/studio/chunks/esm-D6DqSiL1.js.gz +0 -0
- package/studio/chunks/externalRequest-CTzr2nDq.js +23 -0
- package/studio/chunks/externalRequest-CTzr2nDq.js.br +0 -0
- package/studio/chunks/externalRequest-CTzr2nDq.js.gz +0 -0
- package/studio/chunks/iconify-DR9ryCPv.js +1007 -0
- package/studio/chunks/iconify-DR9ryCPv.js.br +0 -0
- package/studio/chunks/iconify-DR9ryCPv.js.gz +0 -0
- package/studio/chunks/icons-D2MsAaXq.js +183 -0
- package/studio/chunks/icons-D2MsAaXq.js.br +0 -0
- package/studio/chunks/icons-D2MsAaXq.js.gz +0 -0
- package/studio/chunks/leaveGuards-D22fTGgr.js +26 -0
- package/studio/chunks/leaveGuards-D22fTGgr.js.br +0 -0
- package/studio/chunks/leaveGuards-D22fTGgr.js.gz +0 -0
- package/studio/chunks/lucideIcons-EyqyPBsX.js +238 -0
- package/studio/chunks/lucideIcons-EyqyPBsX.js.br +0 -0
- package/studio/chunks/lucideIcons-EyqyPBsX.js.gz +0 -0
- package/studio/chunks/mediaRoute--8cY8rUe.js +17 -0
- package/studio/chunks/mediaRoute--8cY8rUe.js.br +0 -0
- package/studio/chunks/mediaRoute--8cY8rUe.js.gz +0 -0
- package/studio/chunks/newDocumentPlanning-C26DHpvh.js +77 -0
- package/studio/chunks/newDocumentPlanning-C26DHpvh.js.br +0 -0
- package/studio/chunks/newDocumentPlanning-C26DHpvh.js.gz +0 -0
- package/studio/chunks/notifications-OKOLc40v.js +110 -0
- package/studio/chunks/notifications-OKOLc40v.js.br +0 -0
- package/studio/chunks/notifications-OKOLc40v.js.gz +0 -0
- package/studio/chunks/operations-CjNHyrEX.js +57 -0
- package/studio/chunks/operations-CjNHyrEX.js.br +0 -0
- package/studio/chunks/operations-CjNHyrEX.js.gz +0 -0
- package/studio/chunks/overlay-DnqFLZTc.js +1733 -0
- package/studio/chunks/overlay-DnqFLZTc.js.br +0 -0
- package/studio/chunks/overlay-DnqFLZTc.js.gz +0 -0
- package/studio/chunks/presentation-DF83w0hE.js +57 -0
- package/studio/chunks/presentation-DF83w0hE.js.br +0 -0
- package/studio/chunks/presentation-DF83w0hE.js.gz +0 -0
- package/studio/chunks/runtime-core.esm-bundler-DKFA9Rep.js +4557 -0
- package/studio/chunks/runtime-core.esm-bundler-DKFA9Rep.js.br +0 -0
- package/studio/chunks/runtime-core.esm-bundler-DKFA9Rep.js.gz +0 -0
- package/studio/chunks/searchPresentation-DFwxQkt3.js +76 -0
- package/studio/chunks/searchPresentation-DFwxQkt3.js.br +0 -0
- package/studio/chunks/searchPresentation-DFwxQkt3.js.gz +0 -0
- package/studio/chunks/status-DQv6ihkU.js +38 -0
- package/studio/chunks/status-DQv6ihkU.js.br +0 -0
- package/studio/chunks/status-DQv6ihkU.js.gz +0 -0
- package/studio/chunks/studioContext-I8HozGU1.js +4953 -0
- package/studio/chunks/studioContext-I8HozGU1.js.br +0 -0
- package/studio/chunks/studioContext-I8HozGU1.js.gz +0 -0
- package/studio/chunks/studioQueries-BR-9NT5F.js +73 -0
- package/studio/chunks/studioQueries-BR-9NT5F.js.br +0 -0
- package/studio/chunks/studioQueries-BR-9NT5F.js.gz +0 -0
- package/studio/chunks/studioSearch-ByaL-QpM.js +1095 -0
- package/studio/chunks/studioSearch-ByaL-QpM.js.br +0 -0
- package/studio/chunks/studioSearch-ByaL-QpM.js.gz +0 -0
- package/studio/chunks/useAcknowledgedDraft-0_c9sWI6.js +62 -0
- package/studio/chunks/useAcknowledgedDraft-0_c9sWI6.js.br +0 -0
- package/studio/chunks/useAcknowledgedDraft-0_c9sWI6.js.gz +0 -0
- package/studio/chunks/useApi-CUWMwLLw-B3Q3g2nf.js +189 -0
- package/studio/chunks/useApi-CUWMwLLw-B3Q3g2nf.js.br +0 -0
- package/studio/chunks/useApi-CUWMwLLw-B3Q3g2nf.js.gz +0 -0
- package/studio/chunks/useDocumentMessage-BAWvc38w.js +16 -0
- package/studio/chunks/useDocumentMessage-BAWvc38w.js.br +3 -0
- package/studio/chunks/useDocumentMessage-BAWvc38w.js.gz +0 -0
- package/studio/chunks/useFilter-DzyiTR7f.js +87 -0
- package/studio/chunks/useFilter-DzyiTR7f.js.br +0 -0
- package/studio/chunks/useFilter-DzyiTR7f.js.gz +0 -0
- package/studio/chunks/useFormControl-CL7sSCUo.js +8 -0
- package/studio/chunks/useFormControl-CL7sSCUo.js.br +0 -0
- package/studio/chunks/useFormControl-CL7sSCUo.js.gz +0 -0
- package/studio/chunks/useGraceArea-Chcy25IQ.js +154 -0
- package/studio/chunks/useGraceArea-Chcy25IQ.js.br +0 -0
- package/studio/chunks/useGraceArea-Chcy25IQ.js.gz +0 -0
- package/studio/chunks/useLeaveConfirmation-_iCSnKEp.js +44 -0
- package/studio/chunks/useLeaveConfirmation-_iCSnKEp.js.br +8 -0
- package/studio/chunks/useLeaveConfirmation-_iCSnKEp.js.gz +0 -0
- package/studio/chunks/useLinkCopy-CMjQteCy.js +35 -0
- package/studio/chunks/useLinkCopy-CMjQteCy.js.br +0 -0
- package/studio/chunks/useLinkCopy-CMjQteCy.js.gz +0 -0
- package/studio/chunks/usePointerMotion-DwRcwBNQ.js +16 -0
- package/studio/chunks/usePointerMotion-DwRcwBNQ.js.br +0 -0
- package/studio/chunks/usePointerMotion-DwRcwBNQ.js.gz +0 -0
- package/studio/chunks/useStudioNavigation-CLwtSYpb.js +298 -0
- package/studio/chunks/useStudioNavigation-CLwtSYpb.js.br +0 -0
- package/studio/chunks/useStudioNavigation-CLwtSYpb.js.gz +0 -0
- package/studio/chunks/useStudioPages-DR9qmYLg.js +79 -0
- package/studio/chunks/useStudioPages-DR9qmYLg.js.br +0 -0
- package/studio/chunks/useStudioPages-DR9qmYLg.js.gz +0 -0
- package/studio/chunks/utils-mdScC0v0.js +59 -0
- package/studio/chunks/utils-mdScC0v0.js.br +0 -0
- package/studio/chunks/utils-mdScC0v0.js.gz +0 -0
- package/studio/chunks/virtualizer-D1S0bZ4t.js +781 -0
- package/studio/chunks/virtualizer-D1S0bZ4t.js.br +0 -0
- package/studio/chunks/virtualizer-D1S0bZ4t.js.gz +0 -0
- package/studio/help/64f767fe29c2-save-and-publish.svg +7 -0
- package/studio/host.css +1 -1
- package/studio/host.css.br +0 -0
- package/studio/host.css.gz +0 -0
- package/studio/host.js +8757 -39178
- package/studio/host.js.br +0 -0
- package/studio/host.js.gz +0 -0
- package/CHANGELOG.md +0 -13
- package/bin/cms.mjs +0 -2
- package/src/ApplicationTypes.d.ts +0 -84
- package/src/ApplicationTypes.js +0 -1
- package/src/Configuration-Da5B2PVH.js +0 -1191
- package/src/Configuration-Da5B2PVH.js.map +0 -1
- package/src/Configuration.d.ts +0 -82
- package/src/Configuration.js +0 -8
- package/src/Configuration.js.map +0 -1
- package/src/Content.d.ts +0 -68
- package/src/Content.js +0 -373
- package/src/Content.js.map +0 -1
- package/src/ContentTransfer-BxwswWn3.js +0 -86
- package/src/ContentTransfer-BxwswWn3.js.map +0 -1
- package/src/ContentTransfer-Z9FHyLez.d.ts +0 -72
- package/src/DocumentEngine-hh_IGPXO.js +0 -978
- package/src/DocumentEngine-hh_IGPXO.js.map +0 -1
- package/src/DocumentModel.d.ts +0 -52
- package/src/DocumentModel.js +0 -66
- package/src/DocumentModel.js.map +0 -1
- package/src/Forms-CX-hwmJF.js +0 -391
- package/src/Forms-CX-hwmJF.js.map +0 -1
- package/src/Forms-CfNPTiCr.js +0 -110
- package/src/Forms-CfNPTiCr.js.map +0 -1
- package/src/Forms-R0HoTR-o.d.ts +0 -92
- package/src/Forms.js.map +0 -1
- package/src/HttpPaths-c9nLZ9H2.js +0 -21
- package/src/HttpPaths-c9nLZ9H2.js.map +0 -1
- package/src/I18n-zbqpWxki.d.ts +0 -29
- package/src/Media-j1bTritO.js +0 -112
- package/src/Media-j1bTritO.js.map +0 -1
- package/src/Module.js.map +0 -1
- package/src/References-CCPDAPve.js +0 -45
- package/src/References-CCPDAPve.js.map +0 -1
- package/src/S3MediaObjects-Dwhl2deX.js +0 -2742
- package/src/S3MediaObjects-Dwhl2deX.js.map +0 -1
- package/src/Seo-402YumpT.d.ts +0 -198
- package/src/cli/content.js +0 -101
- package/src/cli/content.js.map +0 -1
- package/src/cli.js.map +0 -1
- package/src/connection-BP80q4d-.js +0 -92
- package/src/connection-BP80q4d-.js.map +0 -1
- package/src/dev-lifecycle-CjDq63Ft.js +0 -535
- package/src/dev-lifecycle-CjDq63Ft.js.map +0 -1
- package/src/installation-DYNQQBD3.js +0 -9114
- package/src/installation-DYNQQBD3.js.map +0 -1
- package/src/internal/application-types.js +0 -43
- package/src/internal/application-types.js.map +0 -1
- package/src/internal/authoring-catalog.js +0 -158
- package/src/internal/authoring-catalog.js.map +0 -1
- package/src/internal/authoring-compiler.js +0 -146
- package/src/internal/authoring-compiler.js.map +0 -1
- package/src/internal/authoring-metadata.js +0 -191
- package/src/internal/authoring-metadata.js.map +0 -1
- package/src/internal/cms-config.js +0 -45
- package/src/internal/cms-config.js.map +0 -1
- package/src/internal/configuration.js +0 -228
- package/src/internal/configuration.js.map +0 -1
- package/src/internal/dev-lifecycle.js +0 -3
- package/src/internal/diagnostics.js +0 -47
- package/src/internal/diagnostics.js.map +0 -1
- package/src/internal/document-model.js +0 -376
- package/src/internal/document-model.js.map +0 -1
- package/src/internal/field-metadata.js +0 -7
- package/src/internal/field-metadata.js.map +0 -1
- package/src/internal/form-capabilities.js +0 -12
- package/src/internal/form-capabilities.js.map +0 -1
- package/src/internal/i18n.js +0 -73
- package/src/internal/i18n.js.map +0 -1
- package/src/internal/studio-app.js +0 -68
- package/src/internal/studio-app.js.map +0 -1
- package/src/location-CMNGO3lU.js +0 -35
- package/src/location-CMNGO3lU.js.map +0 -1
- package/src/metadata-DN9_K6Yl.js +0 -201
- package/src/metadata-DN9_K6Yl.js.map +0 -1
- package/src/models-5j67LMqW.js +0 -131
- package/src/models-5j67LMqW.js.map +0 -1
- package/src/models-VmGmG19-.js +0 -628
- package/src/models-VmGmG19-.js.map +0 -1
- package/src/runtime/api.js.map +0 -1
- package/src/runtime/blocks.js +0 -30
- package/src/runtime/blocks.js.map +0 -1
- package/src/runtime/collaboration.js +0 -45
- package/src/runtime/collaboration.js.map +0 -1
- package/src/runtime/delivery/DocumentField.js +0 -23
- package/src/runtime/delivery/DocumentField.js.map +0 -1
- package/src/runtime/delivery/DocumentRenderer.js +0 -61
- package/src/runtime/delivery/DocumentRenderer.js.map +0 -1
- package/src/runtime/delivery/DocumentScope.js +0 -41
- package/src/runtime/delivery/DocumentScope.js.map +0 -1
- package/src/runtime/delivery/blocks.js +0 -8
- package/src/runtime/delivery/blocks.js.map +0 -1
- package/src/runtime/delivery/context.js +0 -12
- package/src/runtime/delivery/context.js.map +0 -1
- package/src/runtime/delivery/document-page.js +0 -21
- package/src/runtime/delivery/document-page.js.map +0 -1
- package/src/runtime/delivery/document.js +0 -43
- package/src/runtime/delivery/document.js.map +0 -1
- package/src/runtime/delivery/error.js +0 -11
- package/src/runtime/delivery/error.js.map +0 -1
- package/src/runtime/delivery/plugin.js +0 -99
- package/src/runtime/delivery/plugin.js.map +0 -1
- package/src/runtime/delivery/preview.d.ts +0 -11
- package/src/runtime/delivery/preview.js +0 -6
- package/src/runtime/delivery/preview.js.map +0 -1
- package/src/runtime/delivery/types.d.ts +0 -2
- package/src/runtime/delivery/types.js +0 -1
- package/src/runtime/delivery/useCmsDocumentSeo.d.ts +0 -67
- package/src/runtime/delivery/useCmsDocumentSeo.js.map +0 -1
- package/src/runtime/delivery/useDocument.d.ts +0 -6
- package/src/runtime/delivery/useDocument.js +0 -23
- package/src/runtime/delivery/useDocument.js.map +0 -1
- package/src/runtime/delivery/useDocumentQuery.d.ts +0 -7
- package/src/runtime/delivery/useDocumentQuery.js +0 -29
- package/src/runtime/delivery/useDocumentQuery.js.map +0 -1
- package/src/runtime/forms/document.js +0 -38
- package/src/runtime/forms/document.js.map +0 -1
- package/src/runtime/forms/useCmsForm.js +0 -257
- package/src/runtime/forms/useCmsForm.js.map +0 -1
- package/src/runtime/i18n/translator.js +0 -51
- package/src/runtime/i18n/translator.js.map +0 -1
- package/src/runtime/i18n/useCmsI18n.d.ts +0 -13
- package/src/runtime/i18n/useCmsI18n.js +0 -38
- package/src/runtime/i18n/useCmsI18n.js.map +0 -1
- package/src/runtime/installation.js +0 -3
- package/src/runtime/plugin.js.map +0 -1
- package/src/runtime/preview/CmsStudioPreviewMarker.js +0 -29
- package/src/runtime/preview/CmsStudioPreviewMarker.js.map +0 -1
- package/src/runtime/preview/comark-document.js +0 -37
- package/src/runtime/preview/comark-document.js.map +0 -1
- package/src/runtime/preview/connection.js +0 -3
- package/src/runtime/preview/controller.js +0 -265
- package/src/runtime/preview/controller.js.map +0 -1
- package/src/runtime/preview/crypto.js +0 -16
- package/src/runtime/preview/crypto.js.map +0 -1
- package/src/runtime/preview/overlay.js +0 -122
- package/src/runtime/preview/overlay.js.map +0 -1
- package/src/runtime/preview/plugin.client.js +0 -68
- package/src/runtime/preview/plugin.client.js.map +0 -1
- package/src/runtime/preview/preview.css +0 -91
- package/src/runtime/preview/protocol.d.ts +0 -16
- package/src/runtime/preview/protocol.js +0 -23
- package/src/runtime/preview/protocol.js.map +0 -1
- package/src/runtime/preview/regions.js +0 -142
- package/src/runtime/preview/regions.js.map +0 -1
- package/src/runtime/preview/store.js +0 -4
- package/src/runtime/sitemap-entries.js +0 -17
- package/src/runtime/sitemap-entries.js.map +0 -1
- package/src/runtime/sitemap.js +0 -23
- package/src/runtime/sitemap.js.map +0 -1
- package/src/runtime/studio-app.js +0 -17
- package/src/runtime/studio-app.js.map +0 -1
- package/src/runtime/studio-document.js +0 -46
- package/src/runtime/studio-document.js.map +0 -1
- package/src/runtime/studio-entry.js +0 -19
- package/src/runtime/studio-entry.js.map +0 -1
- package/src/runtime/studio-navigation.js +0 -11
- package/src/runtime/studio-navigation.js.map +0 -1
- package/src/scalars-CA6kyipS.d.ts +0 -7
- package/src/scalars-CVZqT3L0.js +0 -22
- package/src/scalars-CVZqT3L0.js.map +0 -1
- package/src/store-X1e1o_MF.js +0 -209
- package/src/store-X1e1o_MF.js.map +0 -1
- package/src/types-DZ0IV-Ow.d.ts +0 -101
- package/studio/CreateDocumentDialog-BpjBYGfI.js +0 -335
- package/studio/SelectMenu-KiXwx4Y_.js +0 -34032
- package/studio/collaboration-DcK2F6v9.js +0 -4566
- package/studio/editor-P2rB7Csp.js +0 -30128
- package/studio/rolldown-runtime-Dy4uBu1J.js +0 -11
|
@@ -1,978 +0,0 @@
|
|
|
1
|
-
import { o as PublicPath, r as DocumentId } from "./scalars-CVZqT3L0.js";
|
|
2
|
-
import { P as DocumentSeo, _ as DocumentSourceMapping, b as DocumentValidationResult, l as DocumentIssue, n as CmsMarkdownDocument, r as CompiledDocument, t as CmsDocumentAnalysis } from "./models-VmGmG19-.js";
|
|
3
|
-
import { i as decodeManagedMediaReference, r as decodeAuthoredDocumentReference } from "./References-CCPDAPve.js";
|
|
4
|
-
import { c as resolveCmsComarkAttributes, d as createCmsComarkRenderData, l as withCmsComarkProps, o as normalizeCmsComponentBindings, u as cmsComarkTextContent } from "./Forms-CX-hwmJF.js";
|
|
5
|
-
import { h as SOURCE_MAPPINGS_META_KEY, l as validateCollectionBody, m as createDocumentParser, o as createAuthoringDocumentValidator, p as DOCUMENT_ENGINE_FINGERPRINT } from "./Configuration-Da5B2PVH.js";
|
|
6
|
-
import { DateTime, Effect, Option, Predicate, Result, Schema } from "effect";
|
|
7
|
-
|
|
8
|
-
//#region ../document/src/internal/document-address.ts
|
|
9
|
-
const addressTokenPattern = /:([a-z][\w.]*)(\*)?/giu;
|
|
10
|
-
function parseDocumentAddress(pattern) {
|
|
11
|
-
const tokens = [...pattern.matchAll(addressTokenPattern)].map((match) => ({
|
|
12
|
-
catchAll: match[2] === "*",
|
|
13
|
-
name: match[1] ?? ""
|
|
14
|
-
}));
|
|
15
|
-
if (pattern.replace(addressTokenPattern, "").includes(":") || tokens.some((token) => !token.name)) return Result.fail({
|
|
16
|
-
field: "routes.entry",
|
|
17
|
-
message: `Document address pattern "${pattern}" contains an invalid token.`
|
|
18
|
-
});
|
|
19
|
-
if (tokens.filter((token) => token.catchAll).length > 1) return Result.fail({
|
|
20
|
-
field: "routes.entry",
|
|
21
|
-
message: `Document address pattern "${pattern}" contains more than one catch-all token.`
|
|
22
|
-
});
|
|
23
|
-
if (new Set(tokens.map((token) => token.name)).size !== tokens.length) return Result.fail({
|
|
24
|
-
field: "routes.entry",
|
|
25
|
-
message: `Document address pattern "${pattern}" contains duplicate tokens.`
|
|
26
|
-
});
|
|
27
|
-
return Result.succeed({
|
|
28
|
-
pattern,
|
|
29
|
-
tokens
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function resolveDocumentAddress(address, relativeKey, data) {
|
|
33
|
-
const relativePath = relativeKey === "/" ? "" : relativeKey.slice(1);
|
|
34
|
-
let resolved = address.pattern;
|
|
35
|
-
for (const token of address.tokens) {
|
|
36
|
-
const authored = nestedValue$1(data, token.name);
|
|
37
|
-
const fallback = token.catchAll ? relativePath : void 0;
|
|
38
|
-
const value = authored === void 0 ? fallback : Predicate.isString(authored) && authored.trim() ? authored : void 0;
|
|
39
|
-
if (value === void 0) return Result.fail({
|
|
40
|
-
field: token.name,
|
|
41
|
-
message: authored === void 0 ? `Document address field "${token.name}" is required by pattern "${address.pattern}".` : `Document address field "${token.name}" must be a non-empty string.`
|
|
42
|
-
});
|
|
43
|
-
const normalized = token.catchAll ? normalizeDocumentRelativePath(value) : normalizeDocumentSegment(value);
|
|
44
|
-
if (Result.isFailure(normalized)) return Result.fail(normalized.failure);
|
|
45
|
-
resolved = resolved.replace(`:${token.name}${token.catchAll ? "*" : ""}`, normalized.success);
|
|
46
|
-
}
|
|
47
|
-
return normalizePublicPath(resolved);
|
|
48
|
-
}
|
|
49
|
-
function localizeDocumentPath(key, locale, configuration) {
|
|
50
|
-
if (!configuration || !locale || locale === configuration.defaultLocale && !configuration.prefixDefaultLocale) return key;
|
|
51
|
-
return PublicPath.make(`/${locale}${key === "/" ? "" : key}`);
|
|
52
|
-
}
|
|
53
|
-
function normalizePublicPath(value) {
|
|
54
|
-
const path = `/${value.replace(/\\/gu, "/").replace(/^\/+|\/+$/gu, "")}`.replace(/\/{2,}/gu, "/");
|
|
55
|
-
return Schema.decodeResult(PublicPath)(path).pipe(Result.mapError(() => ({
|
|
56
|
-
field: "path",
|
|
57
|
-
message: `Document path "${value}" cannot be normalized into a public path.`
|
|
58
|
-
})));
|
|
59
|
-
}
|
|
60
|
-
function normalizeDocumentRelativePath(value) {
|
|
61
|
-
if (!value.trim()) return Result.succeed("");
|
|
62
|
-
const segments = value.replace(/\\/gu, "/").split("/").filter(Boolean);
|
|
63
|
-
const normalized = [];
|
|
64
|
-
for (const segment of segments) {
|
|
65
|
-
const result = normalizeDocumentSegment(segment);
|
|
66
|
-
if (Result.isFailure(result)) return result;
|
|
67
|
-
normalized.push(result.success);
|
|
68
|
-
}
|
|
69
|
-
return Result.succeed(normalized.join("/"));
|
|
70
|
-
}
|
|
71
|
-
function normalizeDocumentSegment(value) {
|
|
72
|
-
const normalized = value.trim().normalize("NFKC").toLocaleLowerCase().replace(/[^\p{Letter}\p{Number}_-]+/gu, "-").replace(/^-+|-+$/gu, "");
|
|
73
|
-
return normalized ? Result.succeed(normalized) : Result.fail({ message: `Document path segment "${value}" is empty after normalization.` });
|
|
74
|
-
}
|
|
75
|
-
function nestedValue$1(value, path) {
|
|
76
|
-
return path.split(".").reduce((current, segment) => {
|
|
77
|
-
if (!Schema.is(Schema.JsonObject)(current)) return void 0;
|
|
78
|
-
return current[segment];
|
|
79
|
-
}, value);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region ../document/src/internal/document-engine/errors.ts
|
|
84
|
-
var DocumentEngineConfigurationInvalid = class extends Schema.TaggedError()("DocumentEngine.ConfigurationInvalid", {
|
|
85
|
-
message: Schema.NonEmptyString,
|
|
86
|
-
field: Schema.optionalKey(Schema.NonEmptyString)
|
|
87
|
-
}) {};
|
|
88
|
-
var DocumentParseFailed = class extends Schema.TaggedError()("DocumentEngine.DocumentParseFailed", {
|
|
89
|
-
documentId: DocumentId,
|
|
90
|
-
cause: Schema.Defect()
|
|
91
|
-
}) {};
|
|
92
|
-
var DocumentCompilationFailed = class extends Schema.TaggedError()("DocumentEngine.DocumentCompilationFailed", { issues: Schema.Array(DocumentIssue) }) {};
|
|
93
|
-
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region ../document/src/internal/comark/analysis.ts
|
|
96
|
-
const CMS_STANDARD_TAGS = /* @__PURE__ */ new Set([
|
|
97
|
-
"a",
|
|
98
|
-
"abbr",
|
|
99
|
-
"address",
|
|
100
|
-
"article",
|
|
101
|
-
"aside",
|
|
102
|
-
"b",
|
|
103
|
-
"blockquote",
|
|
104
|
-
"br",
|
|
105
|
-
"button",
|
|
106
|
-
"caption",
|
|
107
|
-
"code",
|
|
108
|
-
"col",
|
|
109
|
-
"colgroup",
|
|
110
|
-
"dd",
|
|
111
|
-
"del",
|
|
112
|
-
"details",
|
|
113
|
-
"div",
|
|
114
|
-
"dl",
|
|
115
|
-
"dt",
|
|
116
|
-
"em",
|
|
117
|
-
"figcaption",
|
|
118
|
-
"figure",
|
|
119
|
-
"footer",
|
|
120
|
-
"h1",
|
|
121
|
-
"h2",
|
|
122
|
-
"h3",
|
|
123
|
-
"h4",
|
|
124
|
-
"h5",
|
|
125
|
-
"h6",
|
|
126
|
-
"header",
|
|
127
|
-
"hr",
|
|
128
|
-
"i",
|
|
129
|
-
"img",
|
|
130
|
-
"kbd",
|
|
131
|
-
"li",
|
|
132
|
-
"main",
|
|
133
|
-
"mark",
|
|
134
|
-
"nav",
|
|
135
|
-
"ol",
|
|
136
|
-
"p",
|
|
137
|
-
"pre",
|
|
138
|
-
"q",
|
|
139
|
-
"s",
|
|
140
|
-
"section",
|
|
141
|
-
"small",
|
|
142
|
-
"span",
|
|
143
|
-
"strong",
|
|
144
|
-
"sub",
|
|
145
|
-
"summary",
|
|
146
|
-
"sup",
|
|
147
|
-
"table",
|
|
148
|
-
"tbody",
|
|
149
|
-
"td",
|
|
150
|
-
"template",
|
|
151
|
-
"tfoot",
|
|
152
|
-
"th",
|
|
153
|
-
"thead",
|
|
154
|
-
"tr",
|
|
155
|
-
"u",
|
|
156
|
-
"ul"
|
|
157
|
-
]);
|
|
158
|
-
function analyzeCmsDocument(body, metadata) {
|
|
159
|
-
const headings = [];
|
|
160
|
-
const components = /* @__PURE__ */ new Set();
|
|
161
|
-
visit$1(body.nodes, (node) => {
|
|
162
|
-
const tag = node[0].toLocaleLowerCase();
|
|
163
|
-
if (/^h[1-6]$/u.test(tag)) headings.push({
|
|
164
|
-
depth: Number(tag.slice(1)),
|
|
165
|
-
id: Predicate.isString(node[1].id) ? node[1].id : "",
|
|
166
|
-
text: cmsComarkTextContent(node).trim()
|
|
167
|
-
});
|
|
168
|
-
else if (!CMS_STANDARD_TAGS.has(tag)) components.add(tag);
|
|
169
|
-
});
|
|
170
|
-
const bodyText = normalizeText(body.nodes.map(cmsComarkTextContent).join(" "));
|
|
171
|
-
const summary = normalizeText(metadata.description ?? firstParagraph(body.nodes) ?? metadata.title);
|
|
172
|
-
const searchText = normalizeText([
|
|
173
|
-
metadata.title,
|
|
174
|
-
metadata.description,
|
|
175
|
-
bodyText
|
|
176
|
-
].filter(Boolean).join(" "));
|
|
177
|
-
return CmsDocumentAnalysis.make({
|
|
178
|
-
components: [...components].sort(),
|
|
179
|
-
headings,
|
|
180
|
-
searchText,
|
|
181
|
-
summary
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
function visit$1(nodes, inspect) {
|
|
185
|
-
for (const node of nodes) {
|
|
186
|
-
if (Predicate.isString(node) || node[0] === null) continue;
|
|
187
|
-
inspect(node);
|
|
188
|
-
const [, , ...children] = node;
|
|
189
|
-
visit$1(children, inspect);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
function firstParagraph(nodes) {
|
|
193
|
-
const paragraph = nodes.find((node) => Array.isArray(node) && node[0] === "p");
|
|
194
|
-
if (!paragraph || Predicate.isString(paragraph) || paragraph[0] === null) return void 0;
|
|
195
|
-
return normalizeText(cmsComarkTextContent(paragraph)) || void 0;
|
|
196
|
-
}
|
|
197
|
-
function normalizeText(value) {
|
|
198
|
-
return value.replace(/\s+/gu, " ").trim();
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
//#endregion
|
|
202
|
-
//#region ../document/src/internal/document-engine/frontmatter-validation.ts
|
|
203
|
-
const validateFrontmatter = Effect.fn("DocumentEngine.validateFrontmatter")(function* (raw, schema, type, documentId) {
|
|
204
|
-
const projection = schema.project(raw);
|
|
205
|
-
const issues = projection.unknownPaths.toSorted().map((path) => unknownFieldIssue(path, type, documentId));
|
|
206
|
-
const result = yield* schema.validate(projection.value);
|
|
207
|
-
if ("issues" in result) {
|
|
208
|
-
issues.push(...result.issues.map((issue) => schemaIssue(issue, projection.value, type, documentId)));
|
|
209
|
-
return {
|
|
210
|
-
data: projection.value,
|
|
211
|
-
issues
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
const parsed = Schema.decodeUnknownOption(Schema.JsonObject)(result.value);
|
|
215
|
-
if (Option.isNone(parsed)) {
|
|
216
|
-
issues.push(issue("schema.constraint", "The collection schema output must be a JSON-compatible object.", type, documentId, "frontmatter"));
|
|
217
|
-
return {
|
|
218
|
-
data: projection.value,
|
|
219
|
-
issues
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
return issues.length === 0 ? {
|
|
223
|
-
data: parsed.value,
|
|
224
|
-
issues
|
|
225
|
-
} : {
|
|
226
|
-
data: projection.value,
|
|
227
|
-
issues
|
|
228
|
-
};
|
|
229
|
-
});
|
|
230
|
-
function unknownFieldIssue(path, type, documentId) {
|
|
231
|
-
if (path === "id") return issue("document.id", "Document identity is managed by the CMS and cannot be authored in frontmatter.", type, documentId, path);
|
|
232
|
-
return issue("schema.unknown", `Frontmatter field "${path}" is not declared by collection "${type.collection}".`, type, documentId, path);
|
|
233
|
-
}
|
|
234
|
-
function schemaIssue(error, input, type, documentId) {
|
|
235
|
-
const field = issuePath(error.path);
|
|
236
|
-
return issue(issueCode(error, input, field), error.message, type, documentId, field || void 0);
|
|
237
|
-
}
|
|
238
|
-
function issueCode(error, input, field) {
|
|
239
|
-
if (error.code === "invalid_type") return nestedValue(input, field) === void 0 ? "schema.required" : "schema.type";
|
|
240
|
-
if (error.code === "invalid_value") return "schema.option";
|
|
241
|
-
return "schema.constraint";
|
|
242
|
-
}
|
|
243
|
-
function issuePath(path) {
|
|
244
|
-
return (path ?? []).map((segment) => Predicate.hasProperty(segment, "key") ? segment.key : segment).map(String).join(".");
|
|
245
|
-
}
|
|
246
|
-
function nestedValue(value, path) {
|
|
247
|
-
if (!path) return value;
|
|
248
|
-
return path.split(".").reduce((current, segment) => {
|
|
249
|
-
if (Array.isArray(current)) {
|
|
250
|
-
const index = Number(segment);
|
|
251
|
-
return Number.isSafeInteger(index) ? current[index] : void 0;
|
|
252
|
-
}
|
|
253
|
-
return Schema.is(Schema.JsonObject)(current) ? current[segment] : void 0;
|
|
254
|
-
}, value);
|
|
255
|
-
}
|
|
256
|
-
function issue(code, message, type, documentId, field) {
|
|
257
|
-
return {
|
|
258
|
-
code,
|
|
259
|
-
collection: type.collection,
|
|
260
|
-
...field === void 0 ? void 0 : { field },
|
|
261
|
-
message,
|
|
262
|
-
severity: "error",
|
|
263
|
-
documentId
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
//#endregion
|
|
268
|
-
//#region ../document/src/internal/document-engine/compilation.ts
|
|
269
|
-
const isDocumentParseFailed$1 = Schema.is(DocumentParseFailed);
|
|
270
|
-
const compileCompiledDocument = Effect.fn("DocumentEngine.compileDocument")(function* (configuration, parseMarkdown, source) {
|
|
271
|
-
const collection = yield* resolveCollection(configuration, source);
|
|
272
|
-
const parsedBody = yield* parseBody(parseMarkdown, source);
|
|
273
|
-
const mappings = yield* sourceMappings(parsedBody, source);
|
|
274
|
-
const body = normalizeCmsComponentBindings(withoutSourceMappings(parsedBody), configuration.components);
|
|
275
|
-
const { collectionFrontmatter, rawSeo } = splitFrontmatter(body.frontmatter);
|
|
276
|
-
const seoProjection = projectSeo(rawSeo, source.identity.documentId);
|
|
277
|
-
const validation = yield* validateFrontmatter(collectionFrontmatter, collection.schema, collection.definition, source.identity.documentId).pipe(Effect.mapError((cause) => new DocumentCompilationFailed({ issues: [{
|
|
278
|
-
code: "schema.constraint",
|
|
279
|
-
collection: collection.definition.collection,
|
|
280
|
-
documentId: source.identity.documentId,
|
|
281
|
-
message: cause.message,
|
|
282
|
-
severity: "error"
|
|
283
|
-
}] })));
|
|
284
|
-
const relativeKey = PublicPath.make(source.placement.kind === "home" ? "/" : `/${source.placement.slug}`);
|
|
285
|
-
const route = source.placement.kind === "home" ? collection.homeRoute : collection.entryRoute;
|
|
286
|
-
const address = resolveDocumentAddress(route, relativeKey, validation.data);
|
|
287
|
-
const key = Result.isSuccess(address) ? address.success : provisionalKey(source.identity.documentId);
|
|
288
|
-
const path = localizeDocumentPath(key, source.identity.locale, configuration.documents.locales);
|
|
289
|
-
const title = stringValue(validation.data.title) ?? stringValue(body.meta.title) ?? (source.placement.kind === "home" ? collection.definition.label : humanize(source.placement.slug));
|
|
290
|
-
const description = stringValue(validation.data.description) ?? stringValue(body.meta.description);
|
|
291
|
-
const issues = Result.isSuccess(address) ? validation.issues : [...validation.issues, addressIssue(address.failure, source.identity.documentId)];
|
|
292
|
-
const canonicalFrontmatter = rawSeo === void 0 ? validation.data : Object.assign({ _seo: rawSeo }, validation.data);
|
|
293
|
-
const canonicalBody = CmsMarkdownDocument.make({
|
|
294
|
-
frontmatter: canonicalFrontmatter,
|
|
295
|
-
meta: body.meta,
|
|
296
|
-
nodes: body.nodes
|
|
297
|
-
});
|
|
298
|
-
const analysis = analyzeCmsDocument(canonicalBody, description === void 0 ? { title } : {
|
|
299
|
-
description,
|
|
300
|
-
title
|
|
301
|
-
});
|
|
302
|
-
return CompiledDocument.make(Object.assign({
|
|
303
|
-
id: source.identity.documentId,
|
|
304
|
-
identity: source.identity,
|
|
305
|
-
placement: source.placement,
|
|
306
|
-
key,
|
|
307
|
-
path,
|
|
308
|
-
collection: source.identity.collection,
|
|
309
|
-
draft: source.draft,
|
|
310
|
-
title,
|
|
311
|
-
data: validation.data,
|
|
312
|
-
issues: [
|
|
313
|
-
...issues,
|
|
314
|
-
...seoProjection.issues,
|
|
315
|
-
...(configuration.validateAuthoringDocument?.(canonicalBody, collection.definition.body) ?? []).map((issue) => ({
|
|
316
|
-
code: "reference.component",
|
|
317
|
-
component: issue.component,
|
|
318
|
-
documentId: source.identity.documentId,
|
|
319
|
-
...issue.field ? { field: issue.field.join(".") } : void 0,
|
|
320
|
-
message: issue.message,
|
|
321
|
-
severity: "error"
|
|
322
|
-
}))
|
|
323
|
-
],
|
|
324
|
-
analysis,
|
|
325
|
-
body: canonicalBody,
|
|
326
|
-
engineFingerprint: DOCUMENT_ENGINE_FINGERPRINT,
|
|
327
|
-
source: {
|
|
328
|
-
mappings,
|
|
329
|
-
...source.publishedAt === void 0 ? void 0 : { publishedAt: source.publishedAt }
|
|
330
|
-
}
|
|
331
|
-
}, source.identity.locale === void 0 ? void 0 : { locale: source.identity.locale }, description === void 0 ? void 0 : { description }, seoProjection.seo === void 0 ? void 0 : { seo: seoProjection.seo }));
|
|
332
|
-
});
|
|
333
|
-
function splitFrontmatter(frontmatter) {
|
|
334
|
-
const { _seo: rawSeo, ...collectionFrontmatter } = frontmatter;
|
|
335
|
-
return {
|
|
336
|
-
collectionFrontmatter,
|
|
337
|
-
rawSeo
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
function projectSeo(rawSeo, documentId) {
|
|
341
|
-
if (rawSeo === void 0) return { issues: [] };
|
|
342
|
-
const decoded = Schema.decodeUnknownResult(DocumentSeo)(rawSeo, { onExcessProperty: "error" });
|
|
343
|
-
if (Result.isSuccess(decoded)) return {
|
|
344
|
-
issues: [],
|
|
345
|
-
seo: decoded.success
|
|
346
|
-
};
|
|
347
|
-
return { issues: [{
|
|
348
|
-
code: "seo.invalid",
|
|
349
|
-
documentId,
|
|
350
|
-
field: "_seo",
|
|
351
|
-
message: `Document SEO is invalid: ${String(decoded.failure)}`,
|
|
352
|
-
severity: "error"
|
|
353
|
-
}] };
|
|
354
|
-
}
|
|
355
|
-
function provisionalKey(documentId) {
|
|
356
|
-
return PublicPath.make(`/_cms-invalid/${documentId}`);
|
|
357
|
-
}
|
|
358
|
-
function addressIssue(error, documentId) {
|
|
359
|
-
return {
|
|
360
|
-
code: "document.invalid",
|
|
361
|
-
documentId,
|
|
362
|
-
...error.field === void 0 ? void 0 : { field: error.field },
|
|
363
|
-
message: error.message,
|
|
364
|
-
severity: "error"
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
function resolveCollection(configuration, source) {
|
|
368
|
-
const collection = configuration.types.find(({ definition }) => definition.collection === source.identity.collection);
|
|
369
|
-
if (!collection) return compilationFailure({
|
|
370
|
-
code: "document.invalid",
|
|
371
|
-
documentId: source.identity.documentId,
|
|
372
|
-
field: "identity.collection",
|
|
373
|
-
message: `Document collection "${source.identity.collection}" does not exist.`,
|
|
374
|
-
severity: "error"
|
|
375
|
-
});
|
|
376
|
-
const locales = configuration.documents.locales;
|
|
377
|
-
const locale = source.identity.locale;
|
|
378
|
-
if (!locales && locale !== void 0 || locales && (locale === void 0 || !locales.locales.includes(locale))) return compilationFailure({
|
|
379
|
-
code: "document.invalid",
|
|
380
|
-
documentId: source.identity.documentId,
|
|
381
|
-
field: "identity.locale",
|
|
382
|
-
message: locale ? `Document locale "${locale}" is not configured.` : "A locale is required for this document.",
|
|
383
|
-
severity: "error"
|
|
384
|
-
});
|
|
385
|
-
return Effect.succeed(collection);
|
|
386
|
-
}
|
|
387
|
-
function parseBody(parseMarkdown, source) {
|
|
388
|
-
return Effect.tryPromise({
|
|
389
|
-
try: () => parseMarkdown(source.markdown),
|
|
390
|
-
catch: (cause) => new DocumentParseFailed({
|
|
391
|
-
cause,
|
|
392
|
-
documentId: source.identity.documentId
|
|
393
|
-
})
|
|
394
|
-
}).pipe(Effect.flatMap(Schema.decodeUnknownEffect(CmsMarkdownDocument)), Effect.mapError((cause) => isDocumentParseFailed$1(cause) ? cause : new DocumentParseFailed({
|
|
395
|
-
cause,
|
|
396
|
-
documentId: source.identity.documentId
|
|
397
|
-
})));
|
|
398
|
-
}
|
|
399
|
-
function sourceMappings(body, source) {
|
|
400
|
-
return Schema.decodeUnknownEffect(Schema.Array(DocumentSourceMapping))(body.meta["__cmsSourceMappings"] ?? []).pipe(Effect.mapError((cause) => new DocumentParseFailed({
|
|
401
|
-
cause,
|
|
402
|
-
documentId: source.identity.documentId
|
|
403
|
-
})));
|
|
404
|
-
}
|
|
405
|
-
function withoutSourceMappings(body) {
|
|
406
|
-
const { [SOURCE_MAPPINGS_META_KEY]: _mappings, ...meta } = body.meta;
|
|
407
|
-
return CmsMarkdownDocument.make({
|
|
408
|
-
frontmatter: body.frontmatter,
|
|
409
|
-
meta,
|
|
410
|
-
nodes: body.nodes
|
|
411
|
-
});
|
|
412
|
-
}
|
|
413
|
-
function compilationFailure(issue) {
|
|
414
|
-
return Effect.fail(new DocumentCompilationFailed({ issues: [issue] }));
|
|
415
|
-
}
|
|
416
|
-
function stringValue(value) {
|
|
417
|
-
return Predicate.isString(value) && value.trim() ? value.trim() : void 0;
|
|
418
|
-
}
|
|
419
|
-
function humanize(value) {
|
|
420
|
-
return value.replace(/[-_]+/gu, " ").replace(/^./u, (character) => character.toLocaleUpperCase());
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
//#endregion
|
|
424
|
-
//#region ../document/src/internal/document-engine/catalog-lookup.ts
|
|
425
|
-
function createCatalogLookup(documents, configuration) {
|
|
426
|
-
const byPath = new Map(documents.map((document) => [document.path, document]));
|
|
427
|
-
const byId = new Map(documents.map((document) => [document.id, document]));
|
|
428
|
-
const byVariant = new Map(documents.map((document) => [localeAndKey(document.locale, document.key), document]));
|
|
429
|
-
const findByKey = (input, locale) => {
|
|
430
|
-
const keyResult = normalizePublicPath(input);
|
|
431
|
-
if (Result.isFailure(keyResult)) return Option.none();
|
|
432
|
-
const key = keyResult.success;
|
|
433
|
-
const locales = configuration.documents.locales;
|
|
434
|
-
if (!locales) return Option.fromNullishOr(byVariant.get(localeAndKey(void 0, key)));
|
|
435
|
-
const requestedLocale = locale ?? locales.defaultLocale;
|
|
436
|
-
const localized = byVariant.get(localeAndKey(requestedLocale, key));
|
|
437
|
-
if (localized) return Option.some(localized);
|
|
438
|
-
if (!locales.fallbackLocale) return Option.none();
|
|
439
|
-
return Option.fromNullishOr(byVariant.get(localeAndKey(locales.fallbackLocale, key)));
|
|
440
|
-
};
|
|
441
|
-
const findByPath = (input) => {
|
|
442
|
-
const pathResult = normalizePublicPath(input);
|
|
443
|
-
if (Result.isFailure(pathResult)) return Option.none();
|
|
444
|
-
const path = pathResult.success;
|
|
445
|
-
const direct = byPath.get(path);
|
|
446
|
-
if (direct) return Option.some(direct);
|
|
447
|
-
const locales = configuration.documents.locales;
|
|
448
|
-
if (!locales) return Option.none();
|
|
449
|
-
const request = localizedRequest(path, locales.locales, locales.defaultLocale, locales.prefixDefaultLocale);
|
|
450
|
-
if (!request) return Option.none();
|
|
451
|
-
const localized = byVariant.get(localeAndKey(request.locale, request.key));
|
|
452
|
-
if (localized) return Option.some(localized);
|
|
453
|
-
if (!locales.fallbackLocale) return Option.none();
|
|
454
|
-
return Option.fromNullishOr(byVariant.get(localeAndKey(locales.fallbackLocale, request.key)));
|
|
455
|
-
};
|
|
456
|
-
return {
|
|
457
|
-
findById: (documentId) => Option.fromNullishOr(byId.get(documentId)),
|
|
458
|
-
findByKey,
|
|
459
|
-
findByPath
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
function localeAndKey(locale, key) {
|
|
463
|
-
return `${locale ?? ""}:${key}`;
|
|
464
|
-
}
|
|
465
|
-
function localizedRequest(path, locales, defaultLocale, prefixDefaultLocale) {
|
|
466
|
-
const segments = path === "/" ? [] : path.slice(1).split("/");
|
|
467
|
-
const possibleLocale = locales.find((locale) => locale === segments[0]);
|
|
468
|
-
const prefixedLocale = possibleLocale && (possibleLocale !== defaultLocale || prefixDefaultLocale) ? possibleLocale : void 0;
|
|
469
|
-
if (prefixedLocale) {
|
|
470
|
-
const keyResult = normalizePublicPath(segments.slice(1).join("/"));
|
|
471
|
-
return Result.isSuccess(keyResult) ? {
|
|
472
|
-
key: keyResult.success,
|
|
473
|
-
locale: prefixedLocale
|
|
474
|
-
} : void 0;
|
|
475
|
-
}
|
|
476
|
-
if (prefixDefaultLocale) return void 0;
|
|
477
|
-
return {
|
|
478
|
-
key: path,
|
|
479
|
-
locale: defaultLocale
|
|
480
|
-
};
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
//#endregion
|
|
484
|
-
//#region ../document/src/internal/document-engine/catalog-issues.ts
|
|
485
|
-
function collisionIssues(documents) {
|
|
486
|
-
const issues = [];
|
|
487
|
-
const byId = /* @__PURE__ */ new Map();
|
|
488
|
-
const byPath = /* @__PURE__ */ new Map();
|
|
489
|
-
const byVariant = /* @__PURE__ */ new Map();
|
|
490
|
-
for (const document of documents) {
|
|
491
|
-
if (byId.get(document.id)) issues.push(collisionIssue(`Document identity collision for "${document.id}".`, document));
|
|
492
|
-
else byId.set(document.id, document);
|
|
493
|
-
const pathCollision = byPath.get(document.path);
|
|
494
|
-
if (pathCollision) issues.push(collisionIssue(`Document route collision at "${document.path}" between documents "${pathCollision.id}" and "${document.id}".`, document, document.path));
|
|
495
|
-
else byPath.set(document.path, document);
|
|
496
|
-
const variant = localeAndKey(document.locale, document.key);
|
|
497
|
-
const variantCollision = byVariant.get(variant);
|
|
498
|
-
if (variantCollision && variantCollision.path !== pathCollision?.path) issues.push(collisionIssue(`Document locale collision at "${document.key}" between documents "${variantCollision.id}" and "${document.id}".`, document, document.key));
|
|
499
|
-
else byVariant.set(variant, document);
|
|
500
|
-
}
|
|
501
|
-
return issues;
|
|
502
|
-
}
|
|
503
|
-
function translationIssues(documents, configuration) {
|
|
504
|
-
const locales = configuration.documents.locales;
|
|
505
|
-
if (!locales) return [];
|
|
506
|
-
const variants = new Set(documents.map((document) => localeAndKey(document.locale, document.key)));
|
|
507
|
-
return [...new Set(documents.map((document) => document.key))].flatMap((key) => locales.locales.flatMap((locale) => variants.has(localeAndKey(locale, key)) ? [] : [{
|
|
508
|
-
code: "i18n.missing-translation",
|
|
509
|
-
key,
|
|
510
|
-
locale,
|
|
511
|
-
message: `Document "${key}" is missing its "${locale}" translation.`,
|
|
512
|
-
severity: "warning"
|
|
513
|
-
}]));
|
|
514
|
-
}
|
|
515
|
-
function collisionIssue(message, document, key) {
|
|
516
|
-
const issue = {
|
|
517
|
-
code: "document.collision",
|
|
518
|
-
message,
|
|
519
|
-
severity: "error",
|
|
520
|
-
documentId: document.id
|
|
521
|
-
};
|
|
522
|
-
return key === void 0 ? issue : Object.assign(issue, { key });
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
//#endregion
|
|
526
|
-
//#region ../document/src/internal/document-engine/reference-target.ts
|
|
527
|
-
function referenceTarget(tag, attributes, mediaBaseUrl) {
|
|
528
|
-
if (tag === "a") return decodeDocumentReference(attributes.get("href"));
|
|
529
|
-
if (tag === "img") {
|
|
530
|
-
const key = mediaKey(attributes.get("src"), mediaBaseUrl);
|
|
531
|
-
return key ? {
|
|
532
|
-
kind: "media",
|
|
533
|
-
key
|
|
534
|
-
} : void 0;
|
|
535
|
-
}
|
|
536
|
-
const normalizedTag = tag.toLocaleLowerCase();
|
|
537
|
-
return CMS_STANDARD_TAGS.has(normalizedTag) ? void 0 : {
|
|
538
|
-
kind: "component",
|
|
539
|
-
name: normalizedTag
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
function targetKey(target) {
|
|
543
|
-
switch (target.kind) {
|
|
544
|
-
case "component": return `component:${target.name.toLocaleLowerCase()}`;
|
|
545
|
-
case "document": return `document:${target.documentId}`;
|
|
546
|
-
case "media": return `media:${target.key}`;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
function decodeDocumentReference(value) {
|
|
550
|
-
if (!Predicate.isString(value)) return void 0;
|
|
551
|
-
const reference = decodeAuthoredDocumentReference(value);
|
|
552
|
-
return reference ? {
|
|
553
|
-
kind: "document",
|
|
554
|
-
...reference
|
|
555
|
-
} : void 0;
|
|
556
|
-
}
|
|
557
|
-
function decodeMediaReference(value, mediaBaseUrl) {
|
|
558
|
-
if (!Predicate.isString(value)) return void 0;
|
|
559
|
-
const reference = decodeManagedMediaReference(value);
|
|
560
|
-
if (!reference) return void 0;
|
|
561
|
-
const key = mediaKey(reference.lastKnownUrl, mediaBaseUrl);
|
|
562
|
-
return key ? {
|
|
563
|
-
kind: "media",
|
|
564
|
-
key,
|
|
565
|
-
mediaId: reference.mediaId
|
|
566
|
-
} : void 0;
|
|
567
|
-
}
|
|
568
|
-
function mediaKey(value, mediaBaseUrl) {
|
|
569
|
-
if (!Predicate.isString(value) || mediaBaseUrl === void 0) return void 0;
|
|
570
|
-
const prefix = `${mediaBaseUrl}/`;
|
|
571
|
-
if (!value.startsWith(prefix)) return void 0;
|
|
572
|
-
const encodedKey = value.slice(prefix.length).split(/[?#]/u, 1)[0];
|
|
573
|
-
if (!encodedKey) return void 0;
|
|
574
|
-
try {
|
|
575
|
-
const segments = encodedKey.split("/").map(decodeURIComponent);
|
|
576
|
-
if (segments.some((segment) => !segment || segment === "." || segment === ".." || segment.includes("/") || segment.includes("\\") || hasControlCharacter(segment))) return;
|
|
577
|
-
const key = segments.join("/");
|
|
578
|
-
return key.startsWith("media/") ? key : void 0;
|
|
579
|
-
} catch {
|
|
580
|
-
return;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
function hasControlCharacter(value) {
|
|
584
|
-
for (const character of value) {
|
|
585
|
-
const codePoint = character.codePointAt(0);
|
|
586
|
-
if (codePoint !== void 0 && (codePoint <= 31 || codePoint === 127)) return true;
|
|
587
|
-
}
|
|
588
|
-
return false;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
//#endregion
|
|
592
|
-
//#region ../document/src/internal/document-engine/references.ts
|
|
593
|
-
const noReferences = Object.freeze([]);
|
|
594
|
-
function createDocumentReferenceIndex(documents, configuration, findById) {
|
|
595
|
-
const all = [];
|
|
596
|
-
const byTarget = /* @__PURE__ */ new Map();
|
|
597
|
-
const issues = /* @__PURE__ */ new Map();
|
|
598
|
-
for (const document of documents) {
|
|
599
|
-
const invalidManagedMedia = (lastKnownUrl) => addIssue(issues, document.id, {
|
|
600
|
-
code: "reference.media",
|
|
601
|
-
documentId: document.id,
|
|
602
|
-
message: `Managed-media reference "${lastKnownUrl}" is outside the configured media library.`,
|
|
603
|
-
severity: "error"
|
|
604
|
-
});
|
|
605
|
-
const indexTarget = (target, nodePath) => {
|
|
606
|
-
if (!target) return;
|
|
607
|
-
const reference = freezeReference({
|
|
608
|
-
nodePath,
|
|
609
|
-
source: {
|
|
610
|
-
documentId: document.id,
|
|
611
|
-
route: document.path
|
|
612
|
-
},
|
|
613
|
-
target
|
|
614
|
-
});
|
|
615
|
-
all.push(reference);
|
|
616
|
-
const key = targetKey(target);
|
|
617
|
-
const matching = byTarget.get(key) ?? [];
|
|
618
|
-
matching.push(reference);
|
|
619
|
-
byTarget.set(key, matching);
|
|
620
|
-
if (target.kind === "document" && Option.isNone(findById(target.documentId))) addIssue(issues, document.id, {
|
|
621
|
-
code: "reference.document",
|
|
622
|
-
documentId: document.id,
|
|
623
|
-
key: target.lastKnownRoute,
|
|
624
|
-
message: `Document link target "${target.documentId}" does not resolve.`,
|
|
625
|
-
severity: "error"
|
|
626
|
-
});
|
|
627
|
-
};
|
|
628
|
-
const seoImageTarget = document.seo?.socialImage ? referenceTarget("img", /* @__PURE__ */ new Map([["src", document.seo.socialImage.url]]), configuration.mediaBaseUrl) : void 0;
|
|
629
|
-
indexTarget(seoImageTarget?.kind === "media" ? Object.assign({}, seoImageTarget, { mediaId: document.seo?.socialImage?.mediaId }) : seoImageTarget, []);
|
|
630
|
-
const collection = configuration.types.find(({ definition }) => definition.collection === document.collection);
|
|
631
|
-
for (const target of propertyTargets(collection?.definition.authoringFields ?? [], document.data, configuration.mediaBaseUrl, invalidManagedMedia)) indexTarget(target, []);
|
|
632
|
-
visit(document.body.nodes, createCmsComarkRenderData(document.body), (tag, attributes, children, nodePath) => {
|
|
633
|
-
const targets = [referenceTarget(tag, attributes, configuration.mediaBaseUrl), ...propertyTargets(configuration.components?.get(tag.toLowerCase())?.authoring.props ?? [], Object.fromEntries([...attributes].flatMap(([key, value]) => value === void 0 ? [] : [[key, value]])), configuration.mediaBaseUrl, invalidManagedMedia)];
|
|
634
|
-
for (const target of targets) indexTarget(target, nodePath);
|
|
635
|
-
});
|
|
636
|
-
}
|
|
637
|
-
const frozenAll = Object.freeze(all);
|
|
638
|
-
const frozenByTarget = new Map([...byTarget].map(([key, references]) => [key, Object.freeze(references)]));
|
|
639
|
-
return {
|
|
640
|
-
index: Object.freeze({
|
|
641
|
-
all: frozenAll,
|
|
642
|
-
impact: (target) => frozenByTarget.get(targetKey(target)) ?? noReferences
|
|
643
|
-
}),
|
|
644
|
-
issues
|
|
645
|
-
};
|
|
646
|
-
}
|
|
647
|
-
function visit(nodes, renderData, onElement, parentPath = []) {
|
|
648
|
-
nodes.forEach((node, index) => {
|
|
649
|
-
if (Predicate.isString(node) || node[0] === null) return;
|
|
650
|
-
const [tag, attributes, ...children] = node;
|
|
651
|
-
const nodePath = [...parentPath, index];
|
|
652
|
-
const resolved = resolveCmsComarkAttributes(attributes, renderData);
|
|
653
|
-
onElement(tag, resolved, children, nodePath);
|
|
654
|
-
visit(children, withCmsComarkProps(renderData, resolved), onElement, nodePath);
|
|
655
|
-
});
|
|
656
|
-
}
|
|
657
|
-
function freezeReference(reference) {
|
|
658
|
-
return Object.freeze({
|
|
659
|
-
nodePath: Object.freeze([...reference.nodePath]),
|
|
660
|
-
source: Object.freeze({ ...reference.source }),
|
|
661
|
-
target: Object.freeze({ ...reference.target })
|
|
662
|
-
});
|
|
663
|
-
}
|
|
664
|
-
function addIssue(issues, documentId, issue) {
|
|
665
|
-
const sourceIssues = issues.get(documentId) ?? [];
|
|
666
|
-
sourceIssues.push(issue);
|
|
667
|
-
issues.set(documentId, sourceIssues);
|
|
668
|
-
}
|
|
669
|
-
function propertyTargets(fields, values, mediaBaseUrl, onInvalidManagedMedia) {
|
|
670
|
-
return fields.flatMap((field) => {
|
|
671
|
-
const value = values[field.name] === void 0 ? field.defaultValue : values[field.name];
|
|
672
|
-
if (field.input === "document") {
|
|
673
|
-
const target = decodeDocumentReference(value);
|
|
674
|
-
return target ? [target] : [];
|
|
675
|
-
}
|
|
676
|
-
if (field.input === "media") {
|
|
677
|
-
const target = decodeMediaReference(value, mediaBaseUrl);
|
|
678
|
-
if (!target && Predicate.isString(value)) {
|
|
679
|
-
const reference = decodeManagedMediaReference(value);
|
|
680
|
-
if (reference) onInvalidManagedMedia(reference.lastKnownUrl);
|
|
681
|
-
}
|
|
682
|
-
return target ? [target] : [];
|
|
683
|
-
}
|
|
684
|
-
if (field.input === "link" || field.input === "image") {
|
|
685
|
-
const target = referenceTarget(field.input === "link" ? "a" : "img", /* @__PURE__ */ new Map([[field.input === "link" ? "href" : "src", value]]), mediaBaseUrl);
|
|
686
|
-
return target ? [target] : [];
|
|
687
|
-
}
|
|
688
|
-
if (field.fields) return (Array.isArray(value) ? value : [value]).flatMap((entry) => Schema.is(Schema.JsonObject)(entry) ? propertyTargets(field.fields ?? [], entry, mediaBaseUrl, onInvalidManagedMedia) : []);
|
|
689
|
-
return [];
|
|
690
|
-
});
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
//#endregion
|
|
694
|
-
//#region ../document/src/internal/document-engine/catalog.ts
|
|
695
|
-
function createDocumentCatalog(configuration, input) {
|
|
696
|
-
const resolved = resolvePlacementGraph(configuration, input);
|
|
697
|
-
if (Result.isFailure(resolved)) return Result.fail(resolved.failure);
|
|
698
|
-
const documents = resolved.success.toSorted((left, right) => left.path.localeCompare(right.path));
|
|
699
|
-
const collisions = collisionIssues(documents);
|
|
700
|
-
if (collisions.length > 0) return Result.fail(new DocumentCompilationFailed({ issues: collisions }));
|
|
701
|
-
const lookup = createCatalogLookup(documents, configuration);
|
|
702
|
-
const references = createDocumentReferenceIndex(documents, configuration, lookup.findById);
|
|
703
|
-
const withReferenceIssues = documents.map((document) => {
|
|
704
|
-
const additional = references.issues.get(document.id) ?? [];
|
|
705
|
-
const projected = resolveSemanticRoutes(document, lookup.findById);
|
|
706
|
-
return additional.length === 0 ? projected : CompiledDocument.make(Object.assign({}, projected, { issues: [...document.issues, ...additional] }));
|
|
707
|
-
});
|
|
708
|
-
const finalLookup = createCatalogLookup(withReferenceIssues, configuration);
|
|
709
|
-
return Result.succeed({
|
|
710
|
-
documents: withReferenceIssues,
|
|
711
|
-
issues: [...withReferenceIssues.flatMap((document) => document.issues), ...translationIssues(withReferenceIssues, configuration)],
|
|
712
|
-
...finalLookup,
|
|
713
|
-
references: references.index
|
|
714
|
-
});
|
|
715
|
-
}
|
|
716
|
-
function resolveSemanticRoutes(document, findById) {
|
|
717
|
-
const nodes = document.body.nodes.map((node) => resolveNodeReferences(node, findById));
|
|
718
|
-
const data = resolveJsonObjectReferences(document.data, findById);
|
|
719
|
-
const frontmatter = resolveJsonObjectReferences(document.body.frontmatter, findById);
|
|
720
|
-
return CompiledDocument.make(Object.assign({}, document, {
|
|
721
|
-
data,
|
|
722
|
-
body: Object.assign({}, document.body, {
|
|
723
|
-
frontmatter,
|
|
724
|
-
nodes
|
|
725
|
-
})
|
|
726
|
-
}));
|
|
727
|
-
}
|
|
728
|
-
function resolveNodeReferences(node, findById) {
|
|
729
|
-
if (Schema.is(Schema.String)(node)) return node;
|
|
730
|
-
const [tag, attributes, ...children] = node;
|
|
731
|
-
if (tag === null) return node;
|
|
732
|
-
return [
|
|
733
|
-
tag,
|
|
734
|
-
resolveJsonObjectReferences(attributes, findById),
|
|
735
|
-
...children.map((child) => resolveNodeReferences(child, findById))
|
|
736
|
-
];
|
|
737
|
-
}
|
|
738
|
-
function resolveJsonObjectReferences(value, findById) {
|
|
739
|
-
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, resolveJsonReferences(entry, findById)]));
|
|
740
|
-
}
|
|
741
|
-
function resolveJsonReferences(value, findById) {
|
|
742
|
-
if (Schema.is(Schema.String)(value)) {
|
|
743
|
-
const reference = decodeDocumentReference(value);
|
|
744
|
-
if (reference?.kind === "document") {
|
|
745
|
-
const target = findById(reference.documentId);
|
|
746
|
-
return Option.isSome(target) ? target.value.path : reference.lastKnownRoute;
|
|
747
|
-
}
|
|
748
|
-
return decodeManagedMediaReference(value)?.lastKnownUrl ?? value;
|
|
749
|
-
}
|
|
750
|
-
if (Array.isArray(value)) return value.map((entry) => resolveJsonReferences(entry, findById));
|
|
751
|
-
if (Schema.is(Schema.JsonObject)(value)) return resolveJsonObjectReferences(value, findById);
|
|
752
|
-
return value;
|
|
753
|
-
}
|
|
754
|
-
function resolvePlacementGraph(configuration, documents) {
|
|
755
|
-
const byId = /* @__PURE__ */ new Map();
|
|
756
|
-
const homes = /* @__PURE__ */ new Map();
|
|
757
|
-
const issues = [];
|
|
758
|
-
for (const document of documents) {
|
|
759
|
-
if (byId.get(document.id)) {
|
|
760
|
-
issues.push(invalid$1(document, `Document identity "${document.id}" appears more than once.`));
|
|
761
|
-
continue;
|
|
762
|
-
}
|
|
763
|
-
byId.set(document.id, document);
|
|
764
|
-
if (document.placement.kind === "home") {
|
|
765
|
-
const key = identityScope(document);
|
|
766
|
-
const existing = homes.get(key);
|
|
767
|
-
if (existing) issues.push(invalid$1(document, `Documents "${existing.id}" and "${document.id}" are both home documents for collection "${document.collection}"${document.locale ? ` in locale "${document.locale}"` : ""}.`));
|
|
768
|
-
else homes.set(key, document);
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
const segments = /* @__PURE__ */ new Map();
|
|
772
|
-
const visiting = /* @__PURE__ */ new Set();
|
|
773
|
-
const resolveSegments = (document) => {
|
|
774
|
-
const cached = segments.get(document.id);
|
|
775
|
-
if (cached) return cached;
|
|
776
|
-
if (visiting.has(document.id)) {
|
|
777
|
-
issues.push(invalid$1(document, `Document placement cycle includes "${document.id}".`, "placement"));
|
|
778
|
-
return;
|
|
779
|
-
}
|
|
780
|
-
visiting.add(document.id);
|
|
781
|
-
let result;
|
|
782
|
-
if (document.placement.kind === "home") result = [];
|
|
783
|
-
else {
|
|
784
|
-
const parent = byId.get(document.placement.parentDocumentId);
|
|
785
|
-
if (!parent) issues.push(invalid$1(document, `Parent document "${document.placement.parentDocumentId}" does not exist in this catalog.`, "placement.parentDocumentId"));
|
|
786
|
-
else if (parent.collection !== document.collection) issues.push(invalid$1(document, "A parent document must belong to the same collection.", "placement.parentDocumentId"));
|
|
787
|
-
else if (parent.locale !== document.locale) issues.push(invalid$1(document, "A parent document must use the same locale.", "placement.parentDocumentId"));
|
|
788
|
-
else {
|
|
789
|
-
const collection = configuration.types.find(({ definition }) => definition.collection === document.collection);
|
|
790
|
-
if (!collection) issues.push(invalid$1(document, `Collection "${document.collection}" is not configured.`));
|
|
791
|
-
else if (!collection.definition.hierarchy && parent.placement.kind !== "home") issues.push(invalid$1(document, "This collection allows entries only directly below its home document.", "placement"));
|
|
792
|
-
else {
|
|
793
|
-
const parentSegments = resolveSegments(parent);
|
|
794
|
-
if (parentSegments) result = [...parentSegments, document.placement.slug];
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
visiting.delete(document.id);
|
|
799
|
-
if (result) segments.set(document.id, result);
|
|
800
|
-
return result;
|
|
801
|
-
};
|
|
802
|
-
for (const document of documents) resolveSegments(document);
|
|
803
|
-
if (issues.length > 0) return Result.fail(new DocumentCompilationFailed({ issues }));
|
|
804
|
-
const projected = documents.map((document) => {
|
|
805
|
-
const collection = configuration.types.find(({ definition }) => definition.collection === document.collection);
|
|
806
|
-
const placementSegments = segments.get(document.id);
|
|
807
|
-
if (!collection || !placementSegments) return document;
|
|
808
|
-
const relativeKey = PublicPath.make(`/${placementSegments.join("/")}`);
|
|
809
|
-
const configuredRoute = document.placement.kind === "home" ? collection.homeRoute : collection.entryRoute;
|
|
810
|
-
const route = resolveDocumentAddress(configuredRoute, relativeKey, document.data);
|
|
811
|
-
if (Result.isFailure(route)) {
|
|
812
|
-
issues.push(invalid$1(document, route.failure.message, route.failure.field));
|
|
813
|
-
return document;
|
|
814
|
-
}
|
|
815
|
-
return CompiledDocument.make(Object.assign({}, document, {
|
|
816
|
-
key: route.success,
|
|
817
|
-
path: localizeDocumentPath(route.success, document.locale, configuration.documents.locales)
|
|
818
|
-
}));
|
|
819
|
-
});
|
|
820
|
-
return issues.length > 0 ? Result.fail(new DocumentCompilationFailed({ issues })) : Result.succeed(projected);
|
|
821
|
-
}
|
|
822
|
-
function identityScope(document) {
|
|
823
|
-
return `${document.collection}:${document.locale ?? ""}`;
|
|
824
|
-
}
|
|
825
|
-
function invalid$1(document, message, field) {
|
|
826
|
-
return {
|
|
827
|
-
code: "document.invalid",
|
|
828
|
-
collection: document.collection,
|
|
829
|
-
documentId: document.id,
|
|
830
|
-
...field === void 0 ? void 0 : { field },
|
|
831
|
-
...document.locale === void 0 ? void 0 : { locale: document.locale },
|
|
832
|
-
message,
|
|
833
|
-
severity: "error"
|
|
834
|
-
};
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
//#endregion
|
|
838
|
-
//#region ../document/src/internal/document-engine/configuration.ts
|
|
839
|
-
function resolveDocumentEngineConfiguration(documents, options) {
|
|
840
|
-
if (documents.types.length === 0) return invalid("Documents must define at least one collection.", "types");
|
|
841
|
-
const collections = /* @__PURE__ */ new Set();
|
|
842
|
-
const resolved = [];
|
|
843
|
-
for (const definition of documents.types) {
|
|
844
|
-
if (collections.has(definition.collection)) return invalid(`Document collection "${definition.collection}" is defined more than once.`, "types");
|
|
845
|
-
collections.add(definition.collection);
|
|
846
|
-
const homeRoute = parseDocumentAddress(definition.routes.home);
|
|
847
|
-
const entryRoute = parseDocumentAddress(definition.routes.entry);
|
|
848
|
-
if (Result.isFailure(homeRoute)) return invalid(homeRoute.failure.message, homeRoute.failure.field);
|
|
849
|
-
if (Result.isFailure(entryRoute)) return invalid(entryRoute.failure.message, entryRoute.failure.field);
|
|
850
|
-
if (homeRoute.success.tokens.length > 0) return invalid(`Document collection "${definition.collection}" home route cannot contain tokens.`, "types");
|
|
851
|
-
if (definition.hierarchy && !entryRoute.success.tokens.some((token) => token.catchAll)) return invalid(`Document collection "${definition.collection}" can only enable hierarchy with a catch-all entry route.`, "types");
|
|
852
|
-
const schema = options.documentModel.types[definition.collection];
|
|
853
|
-
if (!schema) return invalid(`Document collection "${definition.collection}" has no executable schema.`, "documentModel");
|
|
854
|
-
resolved.push({
|
|
855
|
-
definition,
|
|
856
|
-
entryRoute: entryRoute.success,
|
|
857
|
-
homeRoute: homeRoute.success,
|
|
858
|
-
schema
|
|
859
|
-
});
|
|
860
|
-
}
|
|
861
|
-
const locales = documents.locales;
|
|
862
|
-
if (locales) {
|
|
863
|
-
if (new Set(locales.locales).size !== locales.locales.length) return invalid("Document locales must be unique.", "locales.locales");
|
|
864
|
-
if (!locales.locales.includes(locales.defaultLocale)) return invalid(`Default locale "${locales.defaultLocale}" is not configured.`, "locales.defaultLocale");
|
|
865
|
-
if (locales.fallbackLocale && !locales.locales.includes(locales.fallbackLocale)) return invalid(`Fallback locale "${locales.fallbackLocale}" is not configured.`, "locales.fallbackLocale");
|
|
866
|
-
}
|
|
867
|
-
let components;
|
|
868
|
-
let validateAuthoringDocument;
|
|
869
|
-
if (options.components !== void 0) {
|
|
870
|
-
const result = resolveComponents(options.components);
|
|
871
|
-
if (Result.isFailure(result)) return Result.fail(result.failure);
|
|
872
|
-
components = result.success.components;
|
|
873
|
-
validateAuthoringDocument = result.success.validateAuthoringDocument;
|
|
874
|
-
for (const definition of documents.types) {
|
|
875
|
-
const issues = validateCollectionBody(options.components, definition.body);
|
|
876
|
-
if (issues.length) return invalid(`${definition.label}: ${issues.join(" ")}`, "body");
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
const mediaBaseUrl = options.mediaBaseUrl?.replace(/\/+$/u, "");
|
|
880
|
-
const configuration = {
|
|
881
|
-
documents,
|
|
882
|
-
types: resolved
|
|
883
|
-
};
|
|
884
|
-
if (components !== void 0) configuration.components = components;
|
|
885
|
-
if (validateAuthoringDocument !== void 0) configuration.validateAuthoringDocument = validateAuthoringDocument;
|
|
886
|
-
if (mediaBaseUrl !== void 0) configuration.mediaBaseUrl = mediaBaseUrl;
|
|
887
|
-
return Result.succeed(configuration);
|
|
888
|
-
}
|
|
889
|
-
function resolveComponents(definitions) {
|
|
890
|
-
const components = /* @__PURE__ */ new Map();
|
|
891
|
-
for (const component of definitions) {
|
|
892
|
-
const name = component.name.toLocaleLowerCase();
|
|
893
|
-
if (components.has(name)) return invalid(`Document component "${component.name}" is defined more than once.`, "components");
|
|
894
|
-
components.set(name, component);
|
|
895
|
-
}
|
|
896
|
-
try {
|
|
897
|
-
return Result.succeed({
|
|
898
|
-
components,
|
|
899
|
-
validateAuthoringDocument: createAuthoringDocumentValidator(components)
|
|
900
|
-
});
|
|
901
|
-
} catch (cause) {
|
|
902
|
-
return invalid(cause instanceof Error ? cause.message : "The component authoring catalog is invalid.", "components");
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
function invalid(message, field) {
|
|
906
|
-
return Result.fail(new DocumentEngineConfigurationInvalid(field === void 0 ? { message } : {
|
|
907
|
-
field,
|
|
908
|
-
message
|
|
909
|
-
}));
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
//#endregion
|
|
913
|
-
//#region ../document/src/DocumentEngine.ts
|
|
914
|
-
const isDocumentParseFailed = Schema.is(DocumentParseFailed);
|
|
915
|
-
const createDocumentEngine = Effect.fn("DocumentEngine.make")(function* (documents, options) {
|
|
916
|
-
const configuration = yield* Effect.fromResult(resolveDocumentEngineConfiguration(documents, options));
|
|
917
|
-
const parseMarkdown = createDocumentParser();
|
|
918
|
-
const compilations = /* @__PURE__ */ new WeakMap();
|
|
919
|
-
const compile = Effect.fn("DocumentEngine.compile")((source) => compileCompiledDocument(configuration, parseMarkdown, source));
|
|
920
|
-
const compileAll = Effect.fn("DocumentEngine.compileAll")(function* (input) {
|
|
921
|
-
const previous = input.previous ? compilations.get(input.previous) : void 0;
|
|
922
|
-
const compiled = yield* Effect.forEach(input.sources, (source) => {
|
|
923
|
-
const cached = previous?.get(source.identity.documentId);
|
|
924
|
-
return cached && sameCompilationSource(cached.source, source) ? Effect.succeed(cached.document) : compile(source);
|
|
925
|
-
});
|
|
926
|
-
const catalog = yield* Effect.fromResult(createDocumentCatalog(configuration, compiled));
|
|
927
|
-
compilations.set(catalog, new Map(input.sources.map((source, index) => {
|
|
928
|
-
const document = compiled[index];
|
|
929
|
-
if (!document) throw new Error(`Compiled document "${source.identity.documentId}" is missing.`);
|
|
930
|
-
return [source.identity.documentId, {
|
|
931
|
-
document,
|
|
932
|
-
source
|
|
933
|
-
}];
|
|
934
|
-
})));
|
|
935
|
-
return catalog;
|
|
936
|
-
});
|
|
937
|
-
const validate = Effect.fn("DocumentEngine.validate")(function* (source) {
|
|
938
|
-
const result = yield* Effect.result(compile(source));
|
|
939
|
-
if (Result.isSuccess(result)) {
|
|
940
|
-
const document = result.success;
|
|
941
|
-
return DocumentValidationResult.make({
|
|
942
|
-
valid: !document.issues.some((issue) => issue.severity === "error"),
|
|
943
|
-
document,
|
|
944
|
-
issues: document.issues
|
|
945
|
-
});
|
|
946
|
-
}
|
|
947
|
-
const error = result.failure;
|
|
948
|
-
const issues = isDocumentParseFailed(error) ? [{
|
|
949
|
-
code: "markdown.parse",
|
|
950
|
-
message: errorMessage(error.cause),
|
|
951
|
-
severity: "error",
|
|
952
|
-
documentId: error.documentId
|
|
953
|
-
}] : error.issues;
|
|
954
|
-
return DocumentValidationResult.make({
|
|
955
|
-
valid: false,
|
|
956
|
-
issues
|
|
957
|
-
});
|
|
958
|
-
});
|
|
959
|
-
return {
|
|
960
|
-
compile,
|
|
961
|
-
compileAll,
|
|
962
|
-
fingerprint: DOCUMENT_ENGINE_FINGERPRINT,
|
|
963
|
-
validate
|
|
964
|
-
};
|
|
965
|
-
});
|
|
966
|
-
function sameCompilationSource(left, right) {
|
|
967
|
-
return left.identity.documentId === right.identity.documentId && left.identity.collection === right.identity.collection && left.identity.locale === right.identity.locale && left.placement.kind === right.placement.kind && (left.placement.kind === "home" || right.placement.kind === "entry" && left.placement.parentDocumentId === right.placement.parentDocumentId && left.placement.slug === right.placement.slug) && left.draft === right.draft && left.markdown === right.markdown && samePublishedAt(left.publishedAt, right.publishedAt);
|
|
968
|
-
}
|
|
969
|
-
function samePublishedAt(left, right) {
|
|
970
|
-
return left === void 0 || right === void 0 ? left === right : DateTime.Equivalence(left, right);
|
|
971
|
-
}
|
|
972
|
-
function errorMessage(cause) {
|
|
973
|
-
return cause instanceof Error && cause.message ? cause.message : "Markdown could not be parsed.";
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
//#endregion
|
|
977
|
-
export { DocumentCompilationFailed as n, createDocumentEngine as t };
|
|
978
|
-
//# sourceMappingURL=DocumentEngine-hh_IGPXO.js.map
|