@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
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { o as parsePreviewSource, s as previewTargetKey } from "./PreviewFocus-C_EelZO5.js";
|
|
2
|
+
//#region src/internal/blockRendering.ts
|
|
3
|
+
const blockRenderingKey = Symbol("cms-block-rendering");
|
|
4
|
+
/** References and slot projection share the installed block contract. */
|
|
5
|
+
function blockRenderingCatalog(blocks) {
|
|
6
|
+
return new Map(blocks.map((definition) => [definition.name, {
|
|
7
|
+
definition,
|
|
8
|
+
inlineSlots: new Set(definition.slots.filter((slot) => slot.kind === "inline-text").map((slot) => slot.name))
|
|
9
|
+
}]));
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/internal/previewRegions.ts
|
|
13
|
+
/** Keep an editor selection visible without moving an already visible preview. */
|
|
14
|
+
function revealPreviewElement(element, viewport) {
|
|
15
|
+
const rect = element.getBoundingClientRect();
|
|
16
|
+
if (rect.bottom > 0 && rect.top < viewport.innerHeight && rect.right > 0 && rect.left < viewport.innerWidth) return;
|
|
17
|
+
element.scrollIntoView({
|
|
18
|
+
behavior: "instant",
|
|
19
|
+
block: "center",
|
|
20
|
+
inline: "nearest"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function renderedRegion(element) {
|
|
24
|
+
if (element.closest("[hidden]")) return false;
|
|
25
|
+
const view = element.ownerDocument.defaultView;
|
|
26
|
+
for (let ancestor = element; ancestor; ancestor = ancestor.parentElement) {
|
|
27
|
+
const style = view?.getComputedStyle(ancestor);
|
|
28
|
+
if (style?.display === "none" || style?.visibility === "hidden" || style?.visibility === "collapse") return false;
|
|
29
|
+
}
|
|
30
|
+
if (element.textContent?.trim() || element.matches("img, video, audio, iframe, input, textarea, select") || element.querySelector("img, video, audio, iframe, input, textarea, select")) return true;
|
|
31
|
+
const rect = element.getBoundingClientRect();
|
|
32
|
+
return rect.width > 0 && rect.height > 0;
|
|
33
|
+
}
|
|
34
|
+
function sourceRegions(root) {
|
|
35
|
+
const owner = root.ownerDocument ?? (root instanceof Document ? root : null);
|
|
36
|
+
if (!owner) return [];
|
|
37
|
+
const comments = owner.createTreeWalker(root, NodeFilter.SHOW_COMMENT);
|
|
38
|
+
const starts = /* @__PURE__ */ new Map();
|
|
39
|
+
const found = [];
|
|
40
|
+
while (comments.nextNode()) {
|
|
41
|
+
const node = comments.currentNode;
|
|
42
|
+
if (!(node instanceof Comment) || !node.data.startsWith("cms-source:")) continue;
|
|
43
|
+
const marker = /^cms-source:(.+):(start|end)$/u.exec(node.data);
|
|
44
|
+
const encoded = marker?.[1];
|
|
45
|
+
const source = parsePreviewSource(encoded ?? null);
|
|
46
|
+
if (!source || !encoded) continue;
|
|
47
|
+
if (marker?.[2] === "start") {
|
|
48
|
+
const stack = starts.get(encoded) ?? [];
|
|
49
|
+
stack.push(node);
|
|
50
|
+
starts.set(encoded, stack);
|
|
51
|
+
} else {
|
|
52
|
+
const start = starts.get(encoded)?.pop();
|
|
53
|
+
if (!start) continue;
|
|
54
|
+
const range = owner.createRange();
|
|
55
|
+
range.setStartAfter(start);
|
|
56
|
+
range.setEndBefore(node);
|
|
57
|
+
found.push({
|
|
58
|
+
source,
|
|
59
|
+
range
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return found;
|
|
64
|
+
}
|
|
65
|
+
function sourceRegionElement(root, range) {
|
|
66
|
+
const common = range.commonAncestorContainer;
|
|
67
|
+
if (range.collapsed) return null;
|
|
68
|
+
const walker = (root.ownerDocument ?? (root instanceof Document ? root : null))?.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);
|
|
69
|
+
while (walker?.nextNode()) {
|
|
70
|
+
const node = walker.currentNode;
|
|
71
|
+
if (node instanceof Element && range.intersectsNode(node) && !node.contains(range.startContainer) && renderedRegion(node)) return node;
|
|
72
|
+
}
|
|
73
|
+
if (common instanceof Element && common !== root && !common.matches("[data-cms-document]") && range.cloneContents().textContent?.trim() && renderedRegion(common)) return common;
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
/** Resolve generated fields, fragment roots, rich-text nodes, and cross-document query output. */
|
|
77
|
+
function previewSourceAt(root, clicked, documentId) {
|
|
78
|
+
let marked = clicked.closest("[data-cms-source]");
|
|
79
|
+
while (marked && documentId && parsePreviewSource(marked.getAttribute("data-cms-source"))?.documentId !== documentId) marked = marked.parentElement?.closest("[data-cms-source]") ?? null;
|
|
80
|
+
const markedSource = marked && root.contains(marked) ? parsePreviewSource(marked.getAttribute("data-cms-source")) : null;
|
|
81
|
+
let source = markedSource;
|
|
82
|
+
let containingRange = null;
|
|
83
|
+
for (const region of sourceRegions(root)) {
|
|
84
|
+
if (documentId && region.source.documentId !== documentId) continue;
|
|
85
|
+
if (!region.range.intersectsNode(clicked) || region.range.collapsed) continue;
|
|
86
|
+
const element = sourceRegionElement(root, region.range);
|
|
87
|
+
if (!element || clicked !== element && clicked.contains(element)) continue;
|
|
88
|
+
if (marked && markedSource && region.range.intersectsNode(marked) && !marked.contains(region.range.startContainer)) continue;
|
|
89
|
+
if (containingRange && (region.range.compareBoundaryPoints(Range.START_TO_START, containingRange) < 0 || region.range.compareBoundaryPoints(Range.END_TO_END, containingRange) > 0)) continue;
|
|
90
|
+
source = region.source.target.kind === "block" ? {
|
|
91
|
+
...region.source,
|
|
92
|
+
approximate: true
|
|
93
|
+
} : region.source;
|
|
94
|
+
containingRange = region.range;
|
|
95
|
+
}
|
|
96
|
+
return source;
|
|
97
|
+
}
|
|
98
|
+
/** Find an exact identity first, then a containing control, block, or document. */
|
|
99
|
+
function previewMatchForSource(root, documentId, target) {
|
|
100
|
+
const marked = [...root.querySelectorAll("[data-cms-source]")].flatMap((element) => {
|
|
101
|
+
const source = parsePreviewSource(element.getAttribute("data-cms-source"));
|
|
102
|
+
return source?.documentId === documentId ? [{
|
|
103
|
+
element,
|
|
104
|
+
source
|
|
105
|
+
}] : [];
|
|
106
|
+
});
|
|
107
|
+
const regions = sourceRegions(root).filter((region) => region.source.documentId === documentId);
|
|
108
|
+
function match(candidate, exact) {
|
|
109
|
+
const key = previewTargetKey(candidate);
|
|
110
|
+
const element = marked.find((entry) => previewTargetKey(entry.source.target) === key && renderedRegion(entry.element));
|
|
111
|
+
if (element) return {
|
|
112
|
+
element: element.element,
|
|
113
|
+
exact: exact && !element.source.approximate
|
|
114
|
+
};
|
|
115
|
+
for (const region of regions) {
|
|
116
|
+
if (previewTargetKey(region.source.target) !== key) continue;
|
|
117
|
+
const element = sourceRegionElement(root, region.range);
|
|
118
|
+
if (element) return {
|
|
119
|
+
element,
|
|
120
|
+
exact: exact && !region.source.approximate
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
const exact = match(target, true);
|
|
126
|
+
if (exact) return exact;
|
|
127
|
+
if (target.kind === "field" || target.kind === "blockField") for (let length = target.path.length - 1; length > 0; length--) {
|
|
128
|
+
const parent = match({
|
|
129
|
+
...target,
|
|
130
|
+
path: target.path.slice(0, length)
|
|
131
|
+
}, false);
|
|
132
|
+
if (parent) return parent;
|
|
133
|
+
}
|
|
134
|
+
if (target.kind === "blockField" || target.kind === "body" && target.blockId) {
|
|
135
|
+
const blockId = target.blockId;
|
|
136
|
+
const block = blockId ? match({
|
|
137
|
+
kind: "block",
|
|
138
|
+
blockId
|
|
139
|
+
}, false) : null;
|
|
140
|
+
if (block) return block;
|
|
141
|
+
}
|
|
142
|
+
return match({ kind: "document" }, false);
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
145
|
+
export { blockRenderingKey as a, blockRenderingCatalog as i, previewSourceAt as n, revealPreviewElement as r, previewMatchForSource as t };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { s as previewTargetKey } from "./PreviewFocus-C_EelZO5.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { toRaw } from "vue";
|
|
4
|
+
//#region src/internal/previewSource.ts
|
|
5
|
+
/** Per-preview object provenance; authored values and public delivery stay untouched. */
|
|
6
|
+
function createPreviewSources(collections = [], blocks = []) {
|
|
7
|
+
const origins = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
function fields(values, definitions, documentId, blockId, path = []) {
|
|
9
|
+
const properties = /* @__PURE__ */ new Map();
|
|
10
|
+
if (!blockId && !path.length) properties.set("title", {
|
|
11
|
+
documentId,
|
|
12
|
+
target: { kind: "title" },
|
|
13
|
+
approximate: false
|
|
14
|
+
});
|
|
15
|
+
const fallback = {
|
|
16
|
+
documentId,
|
|
17
|
+
target: blockId ? {
|
|
18
|
+
kind: "block",
|
|
19
|
+
blockId
|
|
20
|
+
} : { kind: "document" },
|
|
21
|
+
approximate: true
|
|
22
|
+
};
|
|
23
|
+
for (const definition of definitions) {
|
|
24
|
+
const fieldPath = [...path, {
|
|
25
|
+
kind: "field",
|
|
26
|
+
name: definition.name
|
|
27
|
+
}];
|
|
28
|
+
const source = {
|
|
29
|
+
documentId,
|
|
30
|
+
target: blockId ? {
|
|
31
|
+
kind: "blockField",
|
|
32
|
+
blockId,
|
|
33
|
+
path: fieldPath
|
|
34
|
+
} : definition.name === "title" && !path.length ? { kind: "title" } : {
|
|
35
|
+
kind: "field",
|
|
36
|
+
path: fieldPath
|
|
37
|
+
},
|
|
38
|
+
approximate: false
|
|
39
|
+
};
|
|
40
|
+
properties.set(definition.name, source);
|
|
41
|
+
const value = values[definition.name];
|
|
42
|
+
if (definition.kind === "object" && Schema.is(Schema.JsonObject)(value)) fields(value, definition.fields, documentId, blockId, fieldPath);
|
|
43
|
+
else if (definition.kind === "list" && Array.isArray(value)) {
|
|
44
|
+
for (const item of value) {
|
|
45
|
+
if (!Schema.is(Schema.JsonObject)(item) || !Schema.is(Schema.NonEmptyString)(item.id)) continue;
|
|
46
|
+
fields(item, definition.fields, documentId, blockId, [...fieldPath, {
|
|
47
|
+
kind: "item",
|
|
48
|
+
id: item.id
|
|
49
|
+
}]);
|
|
50
|
+
}
|
|
51
|
+
origins.set(toRaw(value), {
|
|
52
|
+
source,
|
|
53
|
+
properties: /* @__PURE__ */ new Map()
|
|
54
|
+
});
|
|
55
|
+
} else if (value !== null && Schema.is(Schema.JsonObject)(value)) origins.set(toRaw(value), {
|
|
56
|
+
source,
|
|
57
|
+
properties: new Map(Object.keys(value).map((key) => [key, source]))
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
const target = path.length ? blockId ? {
|
|
61
|
+
kind: "blockField",
|
|
62
|
+
blockId,
|
|
63
|
+
path
|
|
64
|
+
} : {
|
|
65
|
+
kind: "field",
|
|
66
|
+
path
|
|
67
|
+
} : fallback.target;
|
|
68
|
+
origins.set(toRaw(values), {
|
|
69
|
+
source: {
|
|
70
|
+
documentId,
|
|
71
|
+
target,
|
|
72
|
+
approximate: path.length === 0
|
|
73
|
+
},
|
|
74
|
+
properties
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function register(source, documentId, collection) {
|
|
78
|
+
const definitions = collections.find((candidate) => candidate.collection === collection)?.fields ?? [];
|
|
79
|
+
fields(source.fields, definitions, documentId);
|
|
80
|
+
origins.set(toRaw(source), {
|
|
81
|
+
source: {
|
|
82
|
+
documentId,
|
|
83
|
+
target: { kind: "document" },
|
|
84
|
+
approximate: true
|
|
85
|
+
},
|
|
86
|
+
properties: /* @__PURE__ */ new Map()
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function document(value) {
|
|
90
|
+
const identity = value.identity;
|
|
91
|
+
const source = value.source;
|
|
92
|
+
register(source, identity.documentId, identity.collection);
|
|
93
|
+
origins.set(toRaw(value), {
|
|
94
|
+
source: {
|
|
95
|
+
documentId: identity.documentId,
|
|
96
|
+
target: { kind: "document" },
|
|
97
|
+
approximate: true
|
|
98
|
+
},
|
|
99
|
+
properties: /* @__PURE__ */ new Map()
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function block(values, name, blockId, documentId) {
|
|
103
|
+
fields(values, blocks.find((candidate) => candidate.name === name)?.fields ?? [], documentId, blockId);
|
|
104
|
+
return Object.fromEntries(origins.get(toRaw(values))?.properties ?? []);
|
|
105
|
+
}
|
|
106
|
+
function property(value, name) {
|
|
107
|
+
if (!value || !Schema.is(Schema.JsonObject)(value)) return null;
|
|
108
|
+
return origins.get(toRaw(value))?.properties.get(name) ?? origins.get(toRaw(value))?.source ?? null;
|
|
109
|
+
}
|
|
110
|
+
function object(value) {
|
|
111
|
+
if (!value || !Schema.is(Schema.JsonObject)(value) && !Array.isArray(value)) return null;
|
|
112
|
+
return origins.get(toRaw(value))?.source ?? null;
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
document,
|
|
116
|
+
register,
|
|
117
|
+
block,
|
|
118
|
+
property,
|
|
119
|
+
object
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/** Ambiguous output always selects its common containing block or document. */
|
|
123
|
+
function combinePreviewSources(sources) {
|
|
124
|
+
const available = sources.filter((source) => source !== null);
|
|
125
|
+
const first = available[0];
|
|
126
|
+
if (!first) return null;
|
|
127
|
+
if (available.every((source) => source.documentId === first.documentId && previewTargetKey(source.target) === previewTargetKey(first.target))) return {
|
|
128
|
+
...first,
|
|
129
|
+
approximate: available.some((source) => source.approximate)
|
|
130
|
+
};
|
|
131
|
+
if (available.some((source) => source.documentId !== first.documentId)) return null;
|
|
132
|
+
const blockId = first.target.kind === "block" || first.target.kind === "blockField" ? first.target.blockId : null;
|
|
133
|
+
const sameBlock = blockId && available.every((source) => (source.target.kind === "block" || source.target.kind === "blockField") && source.target.blockId === blockId);
|
|
134
|
+
return {
|
|
135
|
+
documentId: first.documentId,
|
|
136
|
+
target: sameBlock ? {
|
|
137
|
+
kind: "block",
|
|
138
|
+
blockId
|
|
139
|
+
} : { kind: "document" },
|
|
140
|
+
approximate: true
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
export { createPreviewSources as n, combinePreviewSources as t };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { i as MediaId, m as mediaPath, u as MediaSelection } from "./Media-DSyvd14o.js";
|
|
2
|
+
import { n as safeLinkHref, t as LinkTarget } from "./Links-CJYyy7rC.js";
|
|
3
|
+
import { a as imagePath } from "./Image-CJWPLnhP.js";
|
|
4
|
+
import { Schema } from "effect";
|
|
5
|
+
//#region src/internal/rendering.ts
|
|
6
|
+
/** Stable Vue registration name for a configured site block. */
|
|
7
|
+
function blockComponentName(name) {
|
|
8
|
+
return `CmsBlock${name.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("")}`;
|
|
9
|
+
}
|
|
10
|
+
/** Resolve authored references immediately before passing block props to a site component. */
|
|
11
|
+
function resolveBlockProps(props, blockId, referencePaths, fields) {
|
|
12
|
+
function resolve(value, field, path) {
|
|
13
|
+
if (field.kind === "link" && Schema.is(LinkTarget)(value)) {
|
|
14
|
+
if (value.kind === "url") return safeLinkHref(value.href) ? value.href : "";
|
|
15
|
+
const destination = referencePaths[path] ?? value.path;
|
|
16
|
+
return destination.startsWith("/") && safeLinkHref(destination) ? destination : "";
|
|
17
|
+
}
|
|
18
|
+
if (field.kind === "media" && Schema.is(MediaSelection)(value)) return mediaPath(MediaId.make(value.mediaId));
|
|
19
|
+
if (field.kind === "list" && Array.isArray(value)) return value.map((item, index) => Schema.is(Schema.JsonObject)(item) ? resolveObject(item, field.fields, `${path}[${index}]`) : item);
|
|
20
|
+
if (field.kind === "object" && Schema.is(Schema.JsonObject)(value)) return resolveObject(value, field.fields, path);
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
function resolveObject(values, definitions, path) {
|
|
24
|
+
const resolved = Object.assign({}, values);
|
|
25
|
+
for (const field of definitions) {
|
|
26
|
+
const value = values[field.name];
|
|
27
|
+
if (value !== void 0) resolved[field.name] = resolve(value, field, `${path}.${field.name}`);
|
|
28
|
+
}
|
|
29
|
+
return resolved;
|
|
30
|
+
}
|
|
31
|
+
return resolveObject(props, fields, `body.${blockId}`);
|
|
32
|
+
}
|
|
33
|
+
const widths = [
|
|
34
|
+
640,
|
|
35
|
+
1280,
|
|
36
|
+
1920
|
|
37
|
+
];
|
|
38
|
+
/** Use the same bounded delivery policy for body and structured images. */
|
|
39
|
+
function responsiveImageSrcSet(mediaId) {
|
|
40
|
+
return widths.map((width) => `${imagePath(mediaId, {
|
|
41
|
+
width,
|
|
42
|
+
format: "webp",
|
|
43
|
+
quality: 80
|
|
44
|
+
})} ${width}w`).join(", ");
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { resolveBlockProps as n, responsiveImageSrcSet as r, blockComponentName as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __exportAll = (all, no_symbols) => {
|
|
5
|
+
let target = {};
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { __exportAll as t };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { i as MediaId, m as mediaPath } from "../Media-DSyvd14o.js";
|
|
2
|
+
import { i as imageAspectRatio, o as imagePlacementStyle, t as AuthoredImage } from "../Image-CJWPLnhP.js";
|
|
3
|
+
import { r as responsiveImageSrcSet } from "../rendering-D9LVeEKX.js";
|
|
4
|
+
import { Schema } from "effect";
|
|
5
|
+
import { defineComponent, h } from "vue";
|
|
6
|
+
//#region src/runtime/CmsImage.ts
|
|
7
|
+
var CmsImage_default = defineComponent({
|
|
8
|
+
name: "CmsImage",
|
|
9
|
+
props: {
|
|
10
|
+
image: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: void 0
|
|
13
|
+
},
|
|
14
|
+
sizes: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "100vw"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup(props) {
|
|
20
|
+
return () => {
|
|
21
|
+
const image = Schema.is(AuthoredImage)(props.image) ? props.image : void 0;
|
|
22
|
+
return h("div", {
|
|
23
|
+
class: "relative block overflow-hidden",
|
|
24
|
+
style: { aspectRatio: String(imageAspectRatio(image?.frame)) }
|
|
25
|
+
}, image ? h("img", {
|
|
26
|
+
src: mediaPath(MediaId.make(image.mediaId)),
|
|
27
|
+
srcset: responsiveImageSrcSet(MediaId.make(image.mediaId)),
|
|
28
|
+
sizes: props.sizes,
|
|
29
|
+
alt: image.alt ?? "",
|
|
30
|
+
loading: "lazy",
|
|
31
|
+
class: "absolute inset-0 size-full max-w-none",
|
|
32
|
+
style: imagePlacementStyle(image)
|
|
33
|
+
}) : void 0);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { CmsImage_default as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { definePageMeta } from '#imports'
|
|
3
|
+
import DocumentPageContent from './DocumentPageContent'
|
|
4
|
+
|
|
5
|
+
definePageMeta({ key: (route) => route.fullPath })
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<DocumentPageContent :key="$route.fullPath" />
|
|
10
|
+
</template>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { f as revisionPreviewRequested } from "../RevisionPreview-IVwbJ9Wy.js";
|
|
2
|
+
import { t as DocumentRenderer_default } from "../DocumentRenderer-Wz2xaNyf.js";
|
|
3
|
+
import { i as revisionPreviewDestination, r as useCmsDocumentSeo, t as useCmsDocument } from "../nuxtDelivery-BYX_Cddb.js";
|
|
4
|
+
import { n as previewDocumentId, r as previewDocumentQueryKey, t as decodeLocaleConfiguration } from "../localeConfiguration-BPbkLi7-.js";
|
|
5
|
+
import "./delivery/useCmsDocument.js";
|
|
6
|
+
import "./delivery/useCmsDocumentSeo.js";
|
|
7
|
+
import { h } from "vue";
|
|
8
|
+
import { createError, defineNuxtComponent, navigateTo, useNuxtApp, useRouter, useRuntimeConfig } from "nuxt/app";
|
|
9
|
+
//#region src/runtime/DocumentPageContent.ts
|
|
10
|
+
var DocumentPageContent_default = defineNuxtComponent({
|
|
11
|
+
name: "CmsDocumentPage",
|
|
12
|
+
async setup() {
|
|
13
|
+
const nuxtApp = useNuxtApp();
|
|
14
|
+
const route = useRouter().currentRoute.value;
|
|
15
|
+
const previewId = previewDocumentId(route.query[previewDocumentQueryKey]);
|
|
16
|
+
const savedPreview = revisionPreviewRequested(route);
|
|
17
|
+
const locales = decodeLocaleConfiguration(useRuntimeConfig().public.cmsLocales);
|
|
18
|
+
const request = await useCmsDocument(() => route.path);
|
|
19
|
+
if (request.error.value || !request.data.value) throw createError({
|
|
20
|
+
statusCode: request.error.value?.status ?? 404,
|
|
21
|
+
statusMessage: previewId || savedPreview ? "Preview unavailable" : "Document not found"
|
|
22
|
+
});
|
|
23
|
+
const delivered = request.data.value;
|
|
24
|
+
if ("redirectTo" in delivered) {
|
|
25
|
+
await navigateTo(`${delivered.redirectTo}${route.fullPath.slice(route.path.length)}`, {
|
|
26
|
+
redirectCode: 301,
|
|
27
|
+
replace: true
|
|
28
|
+
});
|
|
29
|
+
return () => void 0;
|
|
30
|
+
}
|
|
31
|
+
if (!previewId && !savedPreview && delivered.draft) throw createError({
|
|
32
|
+
statusCode: 503,
|
|
33
|
+
statusMessage: "Public document unavailable"
|
|
34
|
+
});
|
|
35
|
+
const destination = revisionPreviewDestination(delivered, route, locales);
|
|
36
|
+
if (destination) {
|
|
37
|
+
await navigateTo(destination, {
|
|
38
|
+
redirectCode: 302,
|
|
39
|
+
replace: true
|
|
40
|
+
});
|
|
41
|
+
return () => void 0;
|
|
42
|
+
}
|
|
43
|
+
await nuxtApp.runWithContext(() => useCmsDocumentSeo(delivered));
|
|
44
|
+
return () => h(DocumentRenderer_default, { value: delivered });
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
//#endregion
|
|
48
|
+
export { DocumentPageContent_default as default };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { n as FormDefinition } from "../Forms-BuKAXQxr.js";
|
|
2
|
+
import { n as DocumentSource } from "../Document-TgwYKJZM.js";
|
|
3
|
+
import { r as DeliveredQueryItem, t as DeliveredDocument } from "../forms-3xuf0Ym7.js";
|
|
4
|
+
import { Schema } from "effect";
|
|
5
|
+
import { PropType } from "vue";
|
|
6
|
+
//#region ../model/src/PreviewFocus.d.ts
|
|
7
|
+
declare const PreviewFocusTarget: Schema.Union<readonly [Schema.Struct<{
|
|
8
|
+
readonly kind: Schema.Literal<"title">;
|
|
9
|
+
}>, Schema.Struct<{
|
|
10
|
+
readonly kind: Schema.Literal<"document">;
|
|
11
|
+
}>, Schema.Struct<{
|
|
12
|
+
readonly kind: Schema.Literal<"field">;
|
|
13
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
14
|
+
readonly kind: Schema.Literal<"field">;
|
|
15
|
+
readonly name: Schema.NonEmptyString;
|
|
16
|
+
}>, Schema.Struct<{
|
|
17
|
+
readonly kind: Schema.Literal<"item">;
|
|
18
|
+
readonly id: Schema.NonEmptyString;
|
|
19
|
+
}>]>>;
|
|
20
|
+
}>, Schema.Struct<{
|
|
21
|
+
readonly kind: Schema.Literal<"blockField">;
|
|
22
|
+
readonly blockId: Schema.NonEmptyString;
|
|
23
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
24
|
+
readonly kind: Schema.Literal<"field">;
|
|
25
|
+
readonly name: Schema.NonEmptyString;
|
|
26
|
+
}>, Schema.Struct<{
|
|
27
|
+
readonly kind: Schema.Literal<"item">;
|
|
28
|
+
readonly id: Schema.NonEmptyString;
|
|
29
|
+
}>]>>;
|
|
30
|
+
}>, Schema.Struct<{
|
|
31
|
+
readonly kind: Schema.Literal<"block">;
|
|
32
|
+
readonly blockId: Schema.NonEmptyString;
|
|
33
|
+
}>, Schema.Struct<{
|
|
34
|
+
readonly kind: Schema.Literal<"body">;
|
|
35
|
+
readonly path: Schema.$Array<Schema.Int>;
|
|
36
|
+
readonly nodeId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
37
|
+
readonly blockId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
38
|
+
}>]>;
|
|
39
|
+
type PreviewFocusTarget = typeof PreviewFocusTarget.Type;
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/runtime/DocumentRenderer.d.ts
|
|
42
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
43
|
+
value: {
|
|
44
|
+
type: PropType<DeliveredDocument | DeliveredQueryItem>;
|
|
45
|
+
};
|
|
46
|
+
source: {
|
|
47
|
+
type: PropType<DocumentSource>;
|
|
48
|
+
};
|
|
49
|
+
documentId: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
};
|
|
52
|
+
forms: {
|
|
53
|
+
type: PropType<ReadonlyArray<FormDefinition>>;
|
|
54
|
+
};
|
|
55
|
+
formBlockNames: {
|
|
56
|
+
type: PropType<ReadonlyArray<string>>;
|
|
57
|
+
};
|
|
58
|
+
referencePaths: {
|
|
59
|
+
type: PropType<Readonly<Record<string, string>>>;
|
|
60
|
+
};
|
|
61
|
+
previewFocus: {
|
|
62
|
+
type: BooleanConstructor;
|
|
63
|
+
default: undefined;
|
|
64
|
+
};
|
|
65
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
68
|
+
focusTarget: (_target: PreviewFocusTarget) => true;
|
|
69
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
70
|
+
value: {
|
|
71
|
+
type: PropType<DeliveredDocument | DeliveredQueryItem>;
|
|
72
|
+
};
|
|
73
|
+
source: {
|
|
74
|
+
type: PropType<DocumentSource>;
|
|
75
|
+
};
|
|
76
|
+
documentId: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
};
|
|
79
|
+
forms: {
|
|
80
|
+
type: PropType<ReadonlyArray<FormDefinition>>;
|
|
81
|
+
};
|
|
82
|
+
formBlockNames: {
|
|
83
|
+
type: PropType<ReadonlyArray<string>>;
|
|
84
|
+
};
|
|
85
|
+
referencePaths: {
|
|
86
|
+
type: PropType<Readonly<Record<string, string>>>;
|
|
87
|
+
};
|
|
88
|
+
previewFocus: {
|
|
89
|
+
type: BooleanConstructor;
|
|
90
|
+
default: undefined;
|
|
91
|
+
};
|
|
92
|
+
}>> & Readonly<{
|
|
93
|
+
onFocusTarget?: ((_target: {
|
|
94
|
+
readonly kind: "title";
|
|
95
|
+
} | {
|
|
96
|
+
readonly kind: "document";
|
|
97
|
+
} | {
|
|
98
|
+
readonly kind: "field";
|
|
99
|
+
readonly path: readonly ({
|
|
100
|
+
readonly kind: "field";
|
|
101
|
+
readonly name: string;
|
|
102
|
+
} | {
|
|
103
|
+
readonly kind: "item";
|
|
104
|
+
readonly id: string;
|
|
105
|
+
})[];
|
|
106
|
+
} | {
|
|
107
|
+
readonly kind: "blockField";
|
|
108
|
+
readonly blockId: string;
|
|
109
|
+
readonly path: readonly ({
|
|
110
|
+
readonly kind: "field";
|
|
111
|
+
readonly name: string;
|
|
112
|
+
} | {
|
|
113
|
+
readonly kind: "item";
|
|
114
|
+
readonly id: string;
|
|
115
|
+
})[];
|
|
116
|
+
} | {
|
|
117
|
+
readonly kind: "block";
|
|
118
|
+
readonly blockId: string;
|
|
119
|
+
} | {
|
|
120
|
+
readonly kind: "body";
|
|
121
|
+
readonly path: readonly number[];
|
|
122
|
+
readonly blockId?: string | undefined;
|
|
123
|
+
readonly nodeId?: string | undefined;
|
|
124
|
+
}) => any) | undefined;
|
|
125
|
+
}>, {
|
|
126
|
+
previewFocus: boolean;
|
|
127
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
128
|
+
//#endregion
|
|
129
|
+
export { _default as default };
|
package/src/runtime/api.js
CHANGED
|
@@ -1,9 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { n as fetchCmsRequest } from "../plugin-DTYuDaQu.js";
|
|
2
|
+
import { r as RuntimeConfiguration } from "../Config-CMiwciub.js";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { defineEventHandler } from "nuxt/server";
|
|
5
|
+
import { useRuntimeConfig } from "nitro/runtime-config";
|
|
6
|
+
import { isIP } from "node:net";
|
|
7
|
+
import { getRequestIP } from "nitro/h3";
|
|
8
|
+
//#region src/internal/trustedClientIp.ts
|
|
9
|
+
var InvalidClientIp = class extends Error {};
|
|
10
|
+
/** Builds the only client-IP header Better Auth may trust from the network peer. */
|
|
11
|
+
function withTrustedClientIp(request, peerAddress, trustedProxies) {
|
|
12
|
+
const headers = new Headers(request.headers);
|
|
13
|
+
headers.delete("x-cms-client-ip");
|
|
14
|
+
const clientIp = resolveTrustedClientIp(peerAddress, request.headers.get("x-forwarded-for"), trustedProxies);
|
|
15
|
+
if (clientIp) headers.set("x-cms-client-ip", clientIp);
|
|
16
|
+
const body = request.body;
|
|
17
|
+
const options = {
|
|
18
|
+
method: request.method,
|
|
19
|
+
headers,
|
|
20
|
+
body,
|
|
21
|
+
signal: request.signal
|
|
22
|
+
};
|
|
23
|
+
if (body) Object.assign(options, { duplex: "half" });
|
|
24
|
+
return new Request(request.url, options);
|
|
25
|
+
}
|
|
26
|
+
function resolveTrustedClientIp(peerAddress, forwardedFor, trustedProxies) {
|
|
27
|
+
if (!peerAddress || !isIP(peerAddress)) return void 0;
|
|
28
|
+
const peer = normalizeMappedAddress(peerAddress);
|
|
29
|
+
if (!trustedProxies.split(",").map((value) => normalizeMappedAddress(value.trim())).includes(peer)) return peer;
|
|
30
|
+
const forwarded = forwardedFor?.trim();
|
|
31
|
+
if (!forwarded || !isIP(forwarded)) throw new InvalidClientIp("Trusted proxy must supply one valid client IP.");
|
|
32
|
+
return normalizeMappedAddress(forwarded);
|
|
33
|
+
}
|
|
34
|
+
function normalizeMappedAddress(address) {
|
|
35
|
+
return address.startsWith("::ffff:") && isIP(address.slice(7)) === 4 ? address.slice(7) : address;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
4
38
|
//#region src/runtime/api.ts
|
|
5
|
-
var api_default = defineEventHandler((event) =>
|
|
6
|
-
|
|
39
|
+
var api_default = defineEventHandler((event) => {
|
|
40
|
+
if (event.req.method === "GET" && new URL(event.req.url).pathname === "/_cms/health/ready") return fetchCmsRequest(event.req);
|
|
41
|
+
try {
|
|
42
|
+
const trustedProxies = Schema.decodeUnknownSync(RuntimeConfiguration.fields.trustedProxyIps)(useRuntimeConfig().cms.trustedProxyIps);
|
|
43
|
+
const request = withTrustedClientIp(event.req, getRequestIP(event), trustedProxies);
|
|
44
|
+
return fetchCmsRequest(request);
|
|
45
|
+
} catch (cause) {
|
|
46
|
+
if (cause instanceof InvalidClientIp) return Response.json({ error: cause.message }, { status: 400 });
|
|
47
|
+
throw cause;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
7
50
|
//#endregion
|
|
8
51
|
export { api_default as default };
|
|
9
|
-
//# sourceMappingURL=api.js.map
|