@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,466 @@
|
|
|
1
|
+
import { l as resolveDocumentSeo } from "./Seo-CjNUtUkj.js";
|
|
2
|
+
import { m as mediaPath } from "./Media-DSyvd14o.js";
|
|
3
|
+
import { _ as savedRevisionPreviewSelection, f as revisionPreviewRequested, g as savedRevisionPreviewRequested, l as revisionPreviewNavigationLocation, o as RevisionPreviewDocument, p as revisionPreviewToken, s as RevisionPreviewQueryPage } from "./RevisionPreview-IVwbJ9Wy.js";
|
|
4
|
+
import { t as previewContextKey } from "./previewContext-dt3ZUh-w.js";
|
|
5
|
+
import { t as contentLanguageAttributes } from "./locales-6OD4XGIZ.js";
|
|
6
|
+
import { n as previewDocumentId, r as previewDocumentQueryKey, t as decodeLocaleConfiguration } from "./localeConfiguration-BPbkLi7-.js";
|
|
7
|
+
import { o as switchLocalePath, r as localeFromPath } from "./Routes-BaZvm2LE.js";
|
|
8
|
+
import { n as revisionPreviewLocale } from "./localeContext-DhF3SPvM.js";
|
|
9
|
+
import { Schema } from "effect";
|
|
10
|
+
import { computed, inject, toValue, useId, watch } from "vue";
|
|
11
|
+
import { createError, useAsyncData, useHead, useNuxtApp, useRequestFetch, useRouter, useRuntimeConfig, useState } from "nuxt/app";
|
|
12
|
+
//#region src/internal/pageSeo.ts
|
|
13
|
+
function identitySchema(identity, assetOrigin) {
|
|
14
|
+
const common = {
|
|
15
|
+
"@context": "https://schema.org",
|
|
16
|
+
"@type": identity.type,
|
|
17
|
+
name: identity.name,
|
|
18
|
+
...identity.url ? { url: identity.url } : void 0
|
|
19
|
+
};
|
|
20
|
+
const imageUrl = (mediaId) => new URL(mediaPath(mediaId), assetOrigin).href;
|
|
21
|
+
switch (identity.type) {
|
|
22
|
+
case "Person": return {
|
|
23
|
+
...common,
|
|
24
|
+
...identity.image ? { image: imageUrl(identity.image.mediaId) } : void 0
|
|
25
|
+
};
|
|
26
|
+
case "Organization": return {
|
|
27
|
+
...common,
|
|
28
|
+
...identity.logo ? { logo: imageUrl(identity.logo.mediaId) } : void 0
|
|
29
|
+
};
|
|
30
|
+
case "LocalBusiness": return {
|
|
31
|
+
...common,
|
|
32
|
+
...identity.address ? { address: identity.address } : void 0,
|
|
33
|
+
...identity.image ? { image: imageUrl(identity.image.mediaId) } : void 0,
|
|
34
|
+
...identity.logo ? { logo: imageUrl(identity.logo.mediaId) } : void 0,
|
|
35
|
+
...identity.telephone ? { telephone: identity.telephone } : void 0
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** Build public head tags only from the published revision. */
|
|
40
|
+
function pageSeoHead(delivered, site, locales) {
|
|
41
|
+
const source = delivered.source;
|
|
42
|
+
const seo = resolveDocumentSeo({
|
|
43
|
+
fields: source.fields,
|
|
44
|
+
path: delivered.canonicalPath,
|
|
45
|
+
page: source.settings.seo,
|
|
46
|
+
site
|
|
47
|
+
});
|
|
48
|
+
const locale = delivered.locale;
|
|
49
|
+
const image = seo.socialImage ? new URL(mediaPath(seo.socialImage.mediaId), site.canonicalOrigin).href : void 0;
|
|
50
|
+
const meta = [
|
|
51
|
+
{
|
|
52
|
+
name: "robots",
|
|
53
|
+
content: `${seo.index ? "index" : "noindex"}, ${seo.follow ? "follow" : "nofollow"}`
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
property: "og:title",
|
|
57
|
+
content: seo.socialTitle
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
property: "og:url",
|
|
61
|
+
content: seo.canonicalUrl
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
if (seo.description) meta.push({
|
|
65
|
+
name: "description",
|
|
66
|
+
content: seo.description
|
|
67
|
+
});
|
|
68
|
+
if (seo.socialDescription) meta.push({
|
|
69
|
+
property: "og:description",
|
|
70
|
+
content: seo.socialDescription
|
|
71
|
+
});
|
|
72
|
+
if (image) meta.push({
|
|
73
|
+
property: "og:image",
|
|
74
|
+
content: image
|
|
75
|
+
});
|
|
76
|
+
if (image && seo.socialImage?.alt) meta.push({
|
|
77
|
+
property: "og:image:alt",
|
|
78
|
+
content: seo.socialImage.alt
|
|
79
|
+
});
|
|
80
|
+
if (locale) {
|
|
81
|
+
const { language, region } = new Intl.Locale(locale);
|
|
82
|
+
if (region) meta.push({
|
|
83
|
+
property: "og:locale",
|
|
84
|
+
content: `${language}_${region}`
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
const structuredData = {
|
|
88
|
+
"@context": "https://schema.org",
|
|
89
|
+
"@type": seo.structuredData.type,
|
|
90
|
+
name: seo.title,
|
|
91
|
+
url: seo.canonicalUrl
|
|
92
|
+
};
|
|
93
|
+
if (seo.description) structuredData.description = seo.description;
|
|
94
|
+
if (image) structuredData.image = image;
|
|
95
|
+
if (locale) structuredData.inLanguage = locale;
|
|
96
|
+
if (seo.structuredData.type === "Article") {
|
|
97
|
+
structuredData.headline = seo.structuredData.headline ?? seo.title;
|
|
98
|
+
if (seo.structuredData.datePublished) structuredData.datePublished = seo.structuredData.datePublished;
|
|
99
|
+
if (seo.structuredData.dateModified) structuredData.dateModified = seo.structuredData.dateModified;
|
|
100
|
+
}
|
|
101
|
+
const head = {
|
|
102
|
+
title: seo.title,
|
|
103
|
+
titleTemplate: null,
|
|
104
|
+
meta,
|
|
105
|
+
link: [{
|
|
106
|
+
rel: "canonical",
|
|
107
|
+
href: seo.canonicalUrl
|
|
108
|
+
}, ...(delivered.alternatives ?? []).map((alternative) => ({
|
|
109
|
+
rel: "alternate",
|
|
110
|
+
hreflang: alternative.locale,
|
|
111
|
+
href: new URL(alternative.path, `${site.canonicalOrigin}/`).href
|
|
112
|
+
}))],
|
|
113
|
+
script: [...seo.identity ? [identitySchema(seo.identity, site.canonicalOrigin)] : [], structuredData].map((node) => ({
|
|
114
|
+
type: "application/ld+json",
|
|
115
|
+
innerHTML: JSON.stringify(node).replaceAll("<", "\\u003c")
|
|
116
|
+
}))
|
|
117
|
+
};
|
|
118
|
+
return locale ? {
|
|
119
|
+
...head,
|
|
120
|
+
htmlAttrs: contentLanguageAttributes(locale, locales)
|
|
121
|
+
} : head;
|
|
122
|
+
}
|
|
123
|
+
/** A draft preview uses working defaults and never requests indexing. */
|
|
124
|
+
function previewSeoHead(source, site, locale, locales) {
|
|
125
|
+
const seo = resolveDocumentSeo({
|
|
126
|
+
fields: source.fields,
|
|
127
|
+
path: "/",
|
|
128
|
+
page: source.settings.seo,
|
|
129
|
+
site
|
|
130
|
+
});
|
|
131
|
+
const head = {
|
|
132
|
+
title: seo.title,
|
|
133
|
+
titleTemplate: null,
|
|
134
|
+
meta: [
|
|
135
|
+
{
|
|
136
|
+
name: "robots",
|
|
137
|
+
content: "noindex, nofollow"
|
|
138
|
+
},
|
|
139
|
+
...seo.description ? [{
|
|
140
|
+
name: "description",
|
|
141
|
+
content: seo.description
|
|
142
|
+
}] : [],
|
|
143
|
+
{
|
|
144
|
+
property: "og:title",
|
|
145
|
+
content: seo.socialTitle
|
|
146
|
+
},
|
|
147
|
+
...seo.socialDescription ? [{
|
|
148
|
+
property: "og:description",
|
|
149
|
+
content: seo.socialDescription
|
|
150
|
+
}] : []
|
|
151
|
+
]
|
|
152
|
+
};
|
|
153
|
+
return locale ? {
|
|
154
|
+
...head,
|
|
155
|
+
htmlAttrs: contentLanguageAttributes(locale, locales)
|
|
156
|
+
} : head;
|
|
157
|
+
}
|
|
158
|
+
/** Site-owned pages use the same tags as the default page for each delivery mode. */
|
|
159
|
+
function deliverySeoHead(delivered, site, preview, locales) {
|
|
160
|
+
if (!delivered || "redirectTo" in delivered) return { meta: [{
|
|
161
|
+
name: "robots",
|
|
162
|
+
content: "noindex, nofollow"
|
|
163
|
+
}] };
|
|
164
|
+
if (!site) return {};
|
|
165
|
+
const source = delivered.source;
|
|
166
|
+
const locale = delivered.locale;
|
|
167
|
+
return preview || "draft" in delivered && delivered.draft ? previewSeoHead(source, site, locale, locales) : pageSeoHead(delivered, site, locales);
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/internal/revisionDelivery.ts
|
|
171
|
+
/** The reserved preview address is the only URL representation for a retained, unconfigured language. */
|
|
172
|
+
function revisionPreviewDestination(document, route, configuration) {
|
|
173
|
+
if (route.path !== "/_cms/revision-preview" || document.path === "/_cms/revision-preview") return null;
|
|
174
|
+
const requested = document.requestedLocale;
|
|
175
|
+
if (requested && !configuration?.supported.some((definition) => definition.code === requested)) return null;
|
|
176
|
+
const path = requested ? switchLocalePath(document.path, requested, configuration) : document.path;
|
|
177
|
+
const destination = new URL(`${path}${route.fullPath.slice(route.path.length)}`, "https://cms.invalid");
|
|
178
|
+
destination.searchParams.delete("documentId");
|
|
179
|
+
destination.searchParams.delete("revisionId");
|
|
180
|
+
return revisionPreviewNavigationLocation(`${destination.pathname}${destination.search}${destination.hash}`, route);
|
|
181
|
+
}
|
|
182
|
+
/** Adapt the saved-revision transport once so site-owned queries and pages keep their normal shape. */
|
|
183
|
+
function revisionDelivery(document) {
|
|
184
|
+
const { renderPlan, issues, expiresAt, primary, livePath } = document;
|
|
185
|
+
return {
|
|
186
|
+
identity: document.identity,
|
|
187
|
+
savedRevisionId: document.revision.id,
|
|
188
|
+
draft: primary,
|
|
189
|
+
path: document.logicalPath ?? document.previewPath,
|
|
190
|
+
canonicalPath: document.livePath ?? document.logicalPath ?? document.previewPath,
|
|
191
|
+
...document.locale ? { locale: document.locale } : void 0,
|
|
192
|
+
...document.requestedLocale ? { requestedLocale: document.requestedLocale } : void 0,
|
|
193
|
+
source: {
|
|
194
|
+
format: 1,
|
|
195
|
+
...document.content,
|
|
196
|
+
settings: document.settings
|
|
197
|
+
},
|
|
198
|
+
referencePaths: Object.fromEntries(Object.entries(document.referencePaths).map(([name, path]) => [name, path ?? ""])),
|
|
199
|
+
forms: document.forms,
|
|
200
|
+
renderPlan,
|
|
201
|
+
renderIssues: issues,
|
|
202
|
+
renderFailures: [],
|
|
203
|
+
revisionPreview: {
|
|
204
|
+
expiresAt,
|
|
205
|
+
primary,
|
|
206
|
+
livePath
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region src/runtime/delivery/internal/useDeliveryContext.ts
|
|
212
|
+
const endpoints = {
|
|
213
|
+
document: {
|
|
214
|
+
public: "/_cms/delivery",
|
|
215
|
+
preview: "/_cms/api/preview/delivery",
|
|
216
|
+
revision: "/_cms/revision-preview/delivery",
|
|
217
|
+
savedRevision: "/_cms/api/revision-preview/delivery"
|
|
218
|
+
},
|
|
219
|
+
query: {
|
|
220
|
+
public: "/_cms/query",
|
|
221
|
+
preview: "/_cms/api/preview/query",
|
|
222
|
+
revision: "/_cms/revision-preview/query",
|
|
223
|
+
savedRevision: "/_cms/api/revision-preview/query"
|
|
224
|
+
},
|
|
225
|
+
seo: {
|
|
226
|
+
public: "/_cms/seo/published",
|
|
227
|
+
preview: "/_cms/api/seo/working",
|
|
228
|
+
revision: "/_cms/seo/published",
|
|
229
|
+
savedRevision: "/_cms/seo/published"
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
/** Resolve credentials, cache identity and response interpretation together for each read. */
|
|
233
|
+
function useDeliveryContext(route, revisionScope) {
|
|
234
|
+
const selection = computed(() => {
|
|
235
|
+
const current = toValue(route);
|
|
236
|
+
const documentId = previewDocumentId(current.query[previewDocumentQueryKey]);
|
|
237
|
+
const revision = revisionPreviewRequested(current);
|
|
238
|
+
const savedRevision = savedRevisionPreviewRequested(current);
|
|
239
|
+
const saved = savedRevisionPreviewSelection(current);
|
|
240
|
+
const scope = revision ? revisionScope?.() : void 0;
|
|
241
|
+
const locale = revisionPreviewLocale(current);
|
|
242
|
+
if (revision && !scope) throw new Error("Revision delivery context is unavailable.");
|
|
243
|
+
return {
|
|
244
|
+
mode: savedRevision ? "savedRevision" : revision ? "revision" : documentId ? "preview" : "public",
|
|
245
|
+
revision,
|
|
246
|
+
preview: revision || documentId !== null,
|
|
247
|
+
token: revisionPreviewToken(current),
|
|
248
|
+
locale,
|
|
249
|
+
parameters: savedRevision ? {
|
|
250
|
+
documentId: saved?.documentId ?? "",
|
|
251
|
+
revisionId: saved?.revisionId ?? ""
|
|
252
|
+
} : {},
|
|
253
|
+
identity: revision ? [
|
|
254
|
+
"revision",
|
|
255
|
+
scope,
|
|
256
|
+
locale ?? ""
|
|
257
|
+
] : documentId ? [documentId, current.query.v ?? ""] : null
|
|
258
|
+
};
|
|
259
|
+
});
|
|
260
|
+
function request(resource, input) {
|
|
261
|
+
const selected = selection.value;
|
|
262
|
+
const headers = {};
|
|
263
|
+
if (resource !== "seo" && selected.token) headers.authorization = `Bearer ${selected.token}`;
|
|
264
|
+
return {
|
|
265
|
+
endpoint: endpoints[resource][selected.mode],
|
|
266
|
+
key: JSON.stringify([
|
|
267
|
+
`cms-${resource}`,
|
|
268
|
+
selected.identity,
|
|
269
|
+
input
|
|
270
|
+
]),
|
|
271
|
+
revision: selected.revision,
|
|
272
|
+
locale: selected.locale,
|
|
273
|
+
parameters: selected.parameters,
|
|
274
|
+
headers
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function document(path) {
|
|
278
|
+
return computed(() => {
|
|
279
|
+
const value = toValue(path);
|
|
280
|
+
const selected = request("document", value);
|
|
281
|
+
const locale = value === "/_cms/revision-preview" ? selected.locale : void 0;
|
|
282
|
+
const options = {
|
|
283
|
+
query: {
|
|
284
|
+
...selected.parameters,
|
|
285
|
+
path: value,
|
|
286
|
+
...locale === void 0 ? void 0 : { locale }
|
|
287
|
+
},
|
|
288
|
+
headers: selected.headers
|
|
289
|
+
};
|
|
290
|
+
return {
|
|
291
|
+
key: selected.key,
|
|
292
|
+
async read(fetch, signal) {
|
|
293
|
+
if (selected.revision) return revisionDelivery(Schema.decodeUnknownSync(RevisionPreviewDocument)(await fetch(selected.endpoint, {
|
|
294
|
+
...options,
|
|
295
|
+
signal
|
|
296
|
+
})));
|
|
297
|
+
const delivered = await fetch(selected.endpoint, {
|
|
298
|
+
...options,
|
|
299
|
+
signal
|
|
300
|
+
});
|
|
301
|
+
return "redirectTo" in delivered || !delivered.renderPlan ? delivered : {
|
|
302
|
+
...delivered,
|
|
303
|
+
renderFailures: []
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
function query(input, locales) {
|
|
310
|
+
return computed(() => {
|
|
311
|
+
const inputValue = toValue(input);
|
|
312
|
+
const value = {
|
|
313
|
+
...inputValue,
|
|
314
|
+
...inputValue.where ? { where: Object.fromEntries(Object.entries(inputValue.where).map(([name, entry]) => [name, Array.isArray(entry) ? [...entry] : entry])) } : void 0,
|
|
315
|
+
...inputValue.sort ? { sort: inputValue.sort.map((sort) => ({ ...sort })) } : void 0
|
|
316
|
+
};
|
|
317
|
+
const requestedLocale = value.locale ?? selection.value.locale ?? localeFromPath(toValue(route).path, locales);
|
|
318
|
+
const body = requestedLocale === void 0 ? value : {
|
|
319
|
+
...value,
|
|
320
|
+
locale: requestedLocale
|
|
321
|
+
};
|
|
322
|
+
const selected = request("query", body);
|
|
323
|
+
const options = {
|
|
324
|
+
method: "POST",
|
|
325
|
+
query: selected.parameters,
|
|
326
|
+
body,
|
|
327
|
+
headers: selected.headers
|
|
328
|
+
};
|
|
329
|
+
return {
|
|
330
|
+
key: selected.key,
|
|
331
|
+
async read(fetch, signal) {
|
|
332
|
+
if (selected.revision) {
|
|
333
|
+
const page = Schema.decodeUnknownSync(RevisionPreviewQueryPage)(await fetch(selected.endpoint, {
|
|
334
|
+
...options,
|
|
335
|
+
signal
|
|
336
|
+
}));
|
|
337
|
+
return {
|
|
338
|
+
items: page.items.map(revisionDelivery),
|
|
339
|
+
total: page.total
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
const page = await fetch(selected.endpoint, {
|
|
343
|
+
...options,
|
|
344
|
+
signal
|
|
345
|
+
});
|
|
346
|
+
return {
|
|
347
|
+
...page,
|
|
348
|
+
items: page.items.map((item) => item.renderPlan ? {
|
|
349
|
+
...item,
|
|
350
|
+
renderFailures: []
|
|
351
|
+
} : item)
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
function seo() {
|
|
358
|
+
return computed(() => {
|
|
359
|
+
const selected = request("seo");
|
|
360
|
+
return {
|
|
361
|
+
key: selected.key,
|
|
362
|
+
read: (fetch, signal) => fetch(selected.endpoint, { signal })
|
|
363
|
+
};
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
return {
|
|
367
|
+
preview: computed(() => selection.value.preview),
|
|
368
|
+
document,
|
|
369
|
+
query,
|
|
370
|
+
seo
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region src/runtime/delivery/internal/createDeliveryComposables.ts
|
|
375
|
+
/** Bind delivery reads to the installation's Nuxt request and rendering context. */
|
|
376
|
+
function createDeliveryComposables(runtime) {
|
|
377
|
+
function read(plan, fallback, owner) {
|
|
378
|
+
const fetch = runtime.fetch();
|
|
379
|
+
const request = runtime.data(() => JSON.stringify([owner, plan.value.key]), async (signal) => {
|
|
380
|
+
const selected = plan.value;
|
|
381
|
+
return {
|
|
382
|
+
key: selected.key,
|
|
383
|
+
value: await selected.read(fetch, signal)
|
|
384
|
+
};
|
|
385
|
+
});
|
|
386
|
+
const exposed = {
|
|
387
|
+
data: computed({
|
|
388
|
+
get: () => request.data.value?.key === plan.value.key ? request.data.value.value : fallback(),
|
|
389
|
+
set: (value) => {
|
|
390
|
+
request.data.value = {
|
|
391
|
+
key: plan.value.key,
|
|
392
|
+
value
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
}),
|
|
396
|
+
pending: request.pending,
|
|
397
|
+
error: request.error,
|
|
398
|
+
status: request.status,
|
|
399
|
+
refresh: request.refresh,
|
|
400
|
+
execute: request.execute,
|
|
401
|
+
clear: request.clear
|
|
402
|
+
};
|
|
403
|
+
return Object.assign(request.then(() => exposed), exposed);
|
|
404
|
+
}
|
|
405
|
+
/** Read a site path from the active delivery context and refresh when it changes. */
|
|
406
|
+
function useCmsDocument(path) {
|
|
407
|
+
const preview = inject(previewContextKey, null);
|
|
408
|
+
const request = read(useDeliveryContext(runtime.route(), runtime.revisionScope).document(path), () => void 0, runtime.identity());
|
|
409
|
+
if (preview) watch(request.data, (value) => {
|
|
410
|
+
if (value && !("redirectTo" in value) && preview.documentId.value) preview.sources?.document(value);
|
|
411
|
+
}, {
|
|
412
|
+
immediate: true,
|
|
413
|
+
flush: "sync"
|
|
414
|
+
});
|
|
415
|
+
return request;
|
|
416
|
+
}
|
|
417
|
+
/** Query the active delivery context; reactive input changes refetch the page. */
|
|
418
|
+
function useCmsDocumentQuery(input) {
|
|
419
|
+
const preview = inject(previewContextKey, null);
|
|
420
|
+
const request = read(useDeliveryContext(runtime.route(), runtime.revisionScope).query(input, runtime.locales?.()), () => ({
|
|
421
|
+
items: [],
|
|
422
|
+
total: 0
|
|
423
|
+
}), runtime.identity());
|
|
424
|
+
if (preview) watch(request.data, (value) => {
|
|
425
|
+
if (preview.documentId.value) for (const item of value?.items ?? []) preview.sources?.document(item);
|
|
426
|
+
}, {
|
|
427
|
+
immediate: true,
|
|
428
|
+
flush: "sync"
|
|
429
|
+
});
|
|
430
|
+
return request;
|
|
431
|
+
}
|
|
432
|
+
/** Apply CMS page SEO to a site-owned Nuxt page after its Document has loaded. */
|
|
433
|
+
async function useCmsDocumentSeo(document) {
|
|
434
|
+
const app = runtime.app();
|
|
435
|
+
const locales = runtime.locales?.();
|
|
436
|
+
const context = useDeliveryContext(runtime.route(), runtime.revisionScope);
|
|
437
|
+
const settings = await read(context.seo(), () => void 0, "site-seo");
|
|
438
|
+
if (settings.error.value || !settings.data.value) throw runtime.error({
|
|
439
|
+
statusCode: settings.error.value?.statusCode ?? 503,
|
|
440
|
+
statusMessage: "Site SEO unavailable"
|
|
441
|
+
});
|
|
442
|
+
await app.runWithContext(() => runtime.head(() => deliverySeoHead(toValue(document), settings.data.value, context.preview.value, locales)));
|
|
443
|
+
}
|
|
444
|
+
return {
|
|
445
|
+
useCmsDocument,
|
|
446
|
+
useCmsDocumentQuery,
|
|
447
|
+
useCmsDocumentSeo
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
//#endregion
|
|
451
|
+
//#region src/runtime/delivery/internal/nuxtDelivery.ts
|
|
452
|
+
const { useCmsDocument, useCmsDocumentQuery, useCmsDocumentSeo } = createDeliveryComposables({
|
|
453
|
+
route: () => useRouter().currentRoute,
|
|
454
|
+
revisionScope: () => useState("cms-revision-scope").value,
|
|
455
|
+
locales: () => decodeLocaleConfiguration(useRuntimeConfig().public.cmsLocales),
|
|
456
|
+
identity: useId,
|
|
457
|
+
data: (key, read) => useAsyncData(key, (_app, { signal }) => read(signal)),
|
|
458
|
+
fetch: useRequestFetch,
|
|
459
|
+
head: (read) => {
|
|
460
|
+
useHead(read);
|
|
461
|
+
},
|
|
462
|
+
app: useNuxtApp,
|
|
463
|
+
error: createError
|
|
464
|
+
});
|
|
465
|
+
//#endregion
|
|
466
|
+
export { revisionPreviewDestination as i, useCmsDocumentQuery as n, useCmsDocumentSeo as r, useCmsDocument as t };
|