@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,261 @@
|
|
|
1
|
+
import { i as RevisionRenderNode } from "./Document-TgwYKJZM.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
//#region ../model/src/Query.d.ts
|
|
4
|
+
declare const DocumentQuerySort: Schema.Struct<{
|
|
5
|
+
readonly field: Schema.NonEmptyString;
|
|
6
|
+
readonly direction: Schema.optionalKey<Schema.Literals<readonly ["asc", "desc"]>>;
|
|
7
|
+
}>;
|
|
8
|
+
type DocumentQuerySort = typeof DocumentQuerySort.Type;
|
|
9
|
+
declare const DocumentQuery: Schema.Struct<{
|
|
10
|
+
readonly collection: Schema.optionalKey<Schema.NonEmptyString>;
|
|
11
|
+
readonly locale: Schema.optionalKey<Schema.NonEmptyString>;
|
|
12
|
+
readonly limit: Schema.Int;
|
|
13
|
+
readonly offset: Schema.optionalKey<Schema.Int>;
|
|
14
|
+
readonly where: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.Null]>, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.Null]>>]>>>;
|
|
15
|
+
readonly sort: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
16
|
+
readonly field: Schema.NonEmptyString;
|
|
17
|
+
readonly direction: Schema.optionalKey<Schema.Literals<readonly ["asc", "desc"]>>;
|
|
18
|
+
}>>>;
|
|
19
|
+
}>;
|
|
20
|
+
type DocumentQuery = typeof DocumentQuery.Type;
|
|
21
|
+
declare const DocumentQueryItem: Schema.Struct<{
|
|
22
|
+
readonly path: Schema.String;
|
|
23
|
+
readonly canonicalPath: Schema.String;
|
|
24
|
+
readonly locale: Schema.optionalKey<Schema.NonEmptyString>;
|
|
25
|
+
readonly requestedLocale: Schema.optionalKey<Schema.NonEmptyString>;
|
|
26
|
+
readonly identity: Schema.Struct<{
|
|
27
|
+
readonly documentId: Schema.brand<Schema.String, "DocumentId">;
|
|
28
|
+
readonly collection: Schema.NonEmptyString;
|
|
29
|
+
}>;
|
|
30
|
+
readonly source: Schema.Struct<{
|
|
31
|
+
readonly settings: Schema.Struct<{
|
|
32
|
+
readonly placement: Schema.Union<readonly [Schema.Struct<{
|
|
33
|
+
readonly kind: Schema.Literal<"home">;
|
|
34
|
+
}>, Schema.Struct<{
|
|
35
|
+
readonly kind: Schema.Literal<"entry">;
|
|
36
|
+
readonly parentDocumentId: Schema.brand<Schema.String, "DocumentId">;
|
|
37
|
+
readonly slug: Schema.NonEmptyString;
|
|
38
|
+
}>]>;
|
|
39
|
+
readonly seo: Schema.optionalKey<Schema.Struct<{
|
|
40
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
41
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
42
|
+
readonly socialTitle: Schema.optionalKey<Schema.String>;
|
|
43
|
+
readonly socialDescription: Schema.optionalKey<Schema.String>;
|
|
44
|
+
readonly socialImage: Schema.optionalKey<Schema.Struct<{
|
|
45
|
+
readonly mediaId: Schema.brand<Schema.String, "MediaId">;
|
|
46
|
+
readonly alt: Schema.String;
|
|
47
|
+
}>>;
|
|
48
|
+
readonly index: Schema.optionalKey<Schema.Boolean>;
|
|
49
|
+
readonly follow: Schema.optionalKey<Schema.Boolean>;
|
|
50
|
+
readonly canonicalUrl: Schema.optionalKey<Schema.String>;
|
|
51
|
+
readonly structuredData: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
52
|
+
readonly type: Schema.Literal<"WebPage">;
|
|
53
|
+
}>, Schema.Struct<{
|
|
54
|
+
readonly type: Schema.Literal<"Article">;
|
|
55
|
+
readonly headline: Schema.optionalKey<Schema.String>;
|
|
56
|
+
readonly datePublished: Schema.optionalKey<Schema.String>;
|
|
57
|
+
readonly dateModified: Schema.optionalKey<Schema.String>;
|
|
58
|
+
}>]>>;
|
|
59
|
+
}>>;
|
|
60
|
+
readonly translatedSeo: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
61
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
62
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
63
|
+
readonly socialTitle: Schema.optionalKey<Schema.String>;
|
|
64
|
+
readonly socialDescription: Schema.optionalKey<Schema.String>;
|
|
65
|
+
readonly socialImage: Schema.optionalKey<Schema.Struct<{
|
|
66
|
+
readonly mediaId: Schema.brand<Schema.String, "MediaId">;
|
|
67
|
+
readonly alt: Schema.String;
|
|
68
|
+
}>>;
|
|
69
|
+
readonly index: Schema.optionalKey<Schema.Boolean>;
|
|
70
|
+
readonly follow: Schema.optionalKey<Schema.Boolean>;
|
|
71
|
+
readonly canonicalUrl: Schema.optionalKey<Schema.String>;
|
|
72
|
+
readonly structuredData: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
73
|
+
readonly type: Schema.Literal<"WebPage">;
|
|
74
|
+
}>, Schema.Struct<{
|
|
75
|
+
readonly type: Schema.Literal<"Article">;
|
|
76
|
+
readonly headline: Schema.optionalKey<Schema.String>;
|
|
77
|
+
readonly datePublished: Schema.optionalKey<Schema.String>;
|
|
78
|
+
readonly dateModified: Schema.optionalKey<Schema.String>;
|
|
79
|
+
}>]>>;
|
|
80
|
+
}>>>;
|
|
81
|
+
}>;
|
|
82
|
+
readonly translations: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
83
|
+
readonly fields: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
84
|
+
readonly body: Schema.Struct<{
|
|
85
|
+
readonly type: Schema.Literal<"doc">;
|
|
86
|
+
readonly content: Schema.$Array<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
87
|
+
}>;
|
|
88
|
+
}>>>;
|
|
89
|
+
readonly fields: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
90
|
+
readonly body: Schema.Struct<{
|
|
91
|
+
readonly type: Schema.Literal<"doc">;
|
|
92
|
+
readonly content: Schema.$Array<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
93
|
+
}>;
|
|
94
|
+
readonly format: Schema.Literal<1>;
|
|
95
|
+
}>;
|
|
96
|
+
readonly savedRevisionId: Schema.brand<Schema.String, "RevisionId">;
|
|
97
|
+
readonly draft: Schema.Boolean;
|
|
98
|
+
readonly publishedAt: Schema.optionalKey<Schema.String>;
|
|
99
|
+
readonly referencePaths: Schema.$Record<Schema.String, Schema.String>;
|
|
100
|
+
readonly renderPlan: Schema.optionalKey<Schema.Struct<{
|
|
101
|
+
readonly fields: Schema.Struct<{
|
|
102
|
+
readonly mode: Schema.Literals<readonly ["current", "readable"]>;
|
|
103
|
+
readonly values: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
104
|
+
}>;
|
|
105
|
+
readonly body: Schema.$Array<Schema.Codec<RevisionRenderNode, RevisionRenderNode, never, never>>;
|
|
106
|
+
}>>;
|
|
107
|
+
readonly renderIssues: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
108
|
+
readonly severity: Schema.Literal<"warning">;
|
|
109
|
+
readonly recovery: Schema.Literals<readonly ["render", "readable", "placeholder", "disabled"]>;
|
|
110
|
+
readonly code: Schema.String;
|
|
111
|
+
readonly location: Schema.Union<readonly [Schema.Struct<{
|
|
112
|
+
readonly kind: Schema.Literal<"field">;
|
|
113
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
114
|
+
}>, Schema.Struct<{
|
|
115
|
+
readonly kind: Schema.Literal<"block">;
|
|
116
|
+
readonly blockId: Schema.optionalKey<Schema.String>;
|
|
117
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
118
|
+
}>, Schema.Struct<{
|
|
119
|
+
readonly kind: Schema.Literal<"seo">;
|
|
120
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
121
|
+
}>, Schema.Struct<{
|
|
122
|
+
readonly kind: Schema.Literal<"placement">;
|
|
123
|
+
}>, Schema.Struct<{
|
|
124
|
+
readonly kind: Schema.Literal<"body">;
|
|
125
|
+
readonly path: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>>;
|
|
126
|
+
}>, Schema.Struct<{
|
|
127
|
+
readonly kind: Schema.Literal<"document">;
|
|
128
|
+
}>]>;
|
|
129
|
+
readonly message: Schema.String;
|
|
130
|
+
readonly details: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
131
|
+
readonly locale: Schema.optionalKey<Schema.String>;
|
|
132
|
+
}>>>;
|
|
133
|
+
readonly alternatives: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
134
|
+
readonly locale: Schema.String;
|
|
135
|
+
readonly path: Schema.String;
|
|
136
|
+
}>>>;
|
|
137
|
+
}>;
|
|
138
|
+
type DocumentQueryItem = typeof DocumentQueryItem.Type;
|
|
139
|
+
declare const DocumentQueryPage: Schema.Struct<{
|
|
140
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
141
|
+
readonly path: Schema.String;
|
|
142
|
+
readonly canonicalPath: Schema.String;
|
|
143
|
+
readonly locale: Schema.optionalKey<Schema.NonEmptyString>;
|
|
144
|
+
readonly requestedLocale: Schema.optionalKey<Schema.NonEmptyString>;
|
|
145
|
+
readonly identity: Schema.Struct<{
|
|
146
|
+
readonly documentId: Schema.brand<Schema.String, "DocumentId">;
|
|
147
|
+
readonly collection: Schema.NonEmptyString;
|
|
148
|
+
}>;
|
|
149
|
+
readonly source: Schema.Struct<{
|
|
150
|
+
readonly settings: Schema.Struct<{
|
|
151
|
+
readonly placement: Schema.Union<readonly [Schema.Struct<{
|
|
152
|
+
readonly kind: Schema.Literal<"home">;
|
|
153
|
+
}>, Schema.Struct<{
|
|
154
|
+
readonly kind: Schema.Literal<"entry">;
|
|
155
|
+
readonly parentDocumentId: Schema.brand<Schema.String, "DocumentId">;
|
|
156
|
+
readonly slug: Schema.NonEmptyString;
|
|
157
|
+
}>]>;
|
|
158
|
+
readonly seo: Schema.optionalKey<Schema.Struct<{
|
|
159
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
160
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
161
|
+
readonly socialTitle: Schema.optionalKey<Schema.String>;
|
|
162
|
+
readonly socialDescription: Schema.optionalKey<Schema.String>;
|
|
163
|
+
readonly socialImage: Schema.optionalKey<Schema.Struct<{
|
|
164
|
+
readonly mediaId: Schema.brand<Schema.String, "MediaId">;
|
|
165
|
+
readonly alt: Schema.String;
|
|
166
|
+
}>>;
|
|
167
|
+
readonly index: Schema.optionalKey<Schema.Boolean>;
|
|
168
|
+
readonly follow: Schema.optionalKey<Schema.Boolean>;
|
|
169
|
+
readonly canonicalUrl: Schema.optionalKey<Schema.String>;
|
|
170
|
+
readonly structuredData: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
171
|
+
readonly type: Schema.Literal<"WebPage">;
|
|
172
|
+
}>, Schema.Struct<{
|
|
173
|
+
readonly type: Schema.Literal<"Article">;
|
|
174
|
+
readonly headline: Schema.optionalKey<Schema.String>;
|
|
175
|
+
readonly datePublished: Schema.optionalKey<Schema.String>;
|
|
176
|
+
readonly dateModified: Schema.optionalKey<Schema.String>;
|
|
177
|
+
}>]>>;
|
|
178
|
+
}>>;
|
|
179
|
+
readonly translatedSeo: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
180
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
181
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
182
|
+
readonly socialTitle: Schema.optionalKey<Schema.String>;
|
|
183
|
+
readonly socialDescription: Schema.optionalKey<Schema.String>;
|
|
184
|
+
readonly socialImage: Schema.optionalKey<Schema.Struct<{
|
|
185
|
+
readonly mediaId: Schema.brand<Schema.String, "MediaId">;
|
|
186
|
+
readonly alt: Schema.String;
|
|
187
|
+
}>>;
|
|
188
|
+
readonly index: Schema.optionalKey<Schema.Boolean>;
|
|
189
|
+
readonly follow: Schema.optionalKey<Schema.Boolean>;
|
|
190
|
+
readonly canonicalUrl: Schema.optionalKey<Schema.String>;
|
|
191
|
+
readonly structuredData: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
192
|
+
readonly type: Schema.Literal<"WebPage">;
|
|
193
|
+
}>, Schema.Struct<{
|
|
194
|
+
readonly type: Schema.Literal<"Article">;
|
|
195
|
+
readonly headline: Schema.optionalKey<Schema.String>;
|
|
196
|
+
readonly datePublished: Schema.optionalKey<Schema.String>;
|
|
197
|
+
readonly dateModified: Schema.optionalKey<Schema.String>;
|
|
198
|
+
}>]>>;
|
|
199
|
+
}>>>;
|
|
200
|
+
}>;
|
|
201
|
+
readonly translations: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
202
|
+
readonly fields: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
203
|
+
readonly body: Schema.Struct<{
|
|
204
|
+
readonly type: Schema.Literal<"doc">;
|
|
205
|
+
readonly content: Schema.$Array<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
206
|
+
}>;
|
|
207
|
+
}>>>;
|
|
208
|
+
readonly fields: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
209
|
+
readonly body: Schema.Struct<{
|
|
210
|
+
readonly type: Schema.Literal<"doc">;
|
|
211
|
+
readonly content: Schema.$Array<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
212
|
+
}>;
|
|
213
|
+
readonly format: Schema.Literal<1>;
|
|
214
|
+
}>;
|
|
215
|
+
readonly savedRevisionId: Schema.brand<Schema.String, "RevisionId">;
|
|
216
|
+
readonly draft: Schema.Boolean;
|
|
217
|
+
readonly publishedAt: Schema.optionalKey<Schema.String>;
|
|
218
|
+
readonly referencePaths: Schema.$Record<Schema.String, Schema.String>;
|
|
219
|
+
readonly renderPlan: Schema.optionalKey<Schema.Struct<{
|
|
220
|
+
readonly fields: Schema.Struct<{
|
|
221
|
+
readonly mode: Schema.Literals<readonly ["current", "readable"]>;
|
|
222
|
+
readonly values: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
223
|
+
}>;
|
|
224
|
+
readonly body: Schema.$Array<Schema.Codec<RevisionRenderNode, RevisionRenderNode, never, never>>;
|
|
225
|
+
}>>;
|
|
226
|
+
readonly renderIssues: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
227
|
+
readonly severity: Schema.Literal<"warning">;
|
|
228
|
+
readonly recovery: Schema.Literals<readonly ["render", "readable", "placeholder", "disabled"]>;
|
|
229
|
+
readonly code: Schema.String;
|
|
230
|
+
readonly location: Schema.Union<readonly [Schema.Struct<{
|
|
231
|
+
readonly kind: Schema.Literal<"field">;
|
|
232
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
233
|
+
}>, Schema.Struct<{
|
|
234
|
+
readonly kind: Schema.Literal<"block">;
|
|
235
|
+
readonly blockId: Schema.optionalKey<Schema.String>;
|
|
236
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
237
|
+
}>, Schema.Struct<{
|
|
238
|
+
readonly kind: Schema.Literal<"seo">;
|
|
239
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
240
|
+
}>, Schema.Struct<{
|
|
241
|
+
readonly kind: Schema.Literal<"placement">;
|
|
242
|
+
}>, Schema.Struct<{
|
|
243
|
+
readonly kind: Schema.Literal<"body">;
|
|
244
|
+
readonly path: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>>;
|
|
245
|
+
}>, Schema.Struct<{
|
|
246
|
+
readonly kind: Schema.Literal<"document">;
|
|
247
|
+
}>]>;
|
|
248
|
+
readonly message: Schema.String;
|
|
249
|
+
readonly details: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
250
|
+
readonly locale: Schema.optionalKey<Schema.String>;
|
|
251
|
+
}>>>;
|
|
252
|
+
readonly alternatives: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
253
|
+
readonly locale: Schema.String;
|
|
254
|
+
readonly path: Schema.String;
|
|
255
|
+
}>>>;
|
|
256
|
+
}>>;
|
|
257
|
+
readonly total: Schema.Int;
|
|
258
|
+
}>;
|
|
259
|
+
type DocumentQueryPage = typeof DocumentQueryPage.Type;
|
|
260
|
+
//#endregion
|
|
261
|
+
export { DocumentQuerySort as i, DocumentQueryItem as n, DocumentQueryPage as r, DocumentQuery as t };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { A as RevisionPreviewIssue, h as DocumentSettings, j as RevisionRenderPlan, l as DocumentId, s as DocumentContent, u as DocumentIdentity, x as RevisionId } from "./Document-CKXMSEf1.js";
|
|
2
|
+
import { t as Locale } from "./Locales-Ch7a5xuA.js";
|
|
3
|
+
import { c as FormSteps, o as FormReference } from "./contracts-rprW3ZOB.js";
|
|
4
|
+
import { Schema } from "effect";
|
|
5
|
+
//#region ../model/src/RevisionPreview.ts
|
|
6
|
+
/** The website adapter renders this dedicated route; it carries the token in its URL. */
|
|
7
|
+
const revisionPreviewPath = "/_cms/revision-preview";
|
|
8
|
+
const revisionPreviewQueryKey = "__cms_revision";
|
|
9
|
+
const savedRevisionPreviewDocumentQueryKey = "__cms_saved_document";
|
|
10
|
+
const savedRevisionPreviewQueryKey = "__cms_saved_revision";
|
|
11
|
+
const SavedRevisionPreviewSelection = Schema.Struct({
|
|
12
|
+
documentId: DocumentId,
|
|
13
|
+
revisionId: RevisionId
|
|
14
|
+
});
|
|
15
|
+
const RevisionLinkId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand("RevisionLinkId"));
|
|
16
|
+
const RevisionLinkToken = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9_-]{43}$/u));
|
|
17
|
+
/** A saved preview stays attached to an ordinary site address without a shared browser cookie. */
|
|
18
|
+
function revisionPreviewLocation(path, token, locale) {
|
|
19
|
+
const url = previewUrl(path);
|
|
20
|
+
Schema.decodeSync(RevisionLinkToken)(token);
|
|
21
|
+
url.searchParams.set(url.pathname === "/_cms/revision-preview" ? "token" : revisionPreviewQueryKey, token);
|
|
22
|
+
if (locale) url.searchParams.set("locale", locale);
|
|
23
|
+
return `${url.pathname}${url.search}${url.hash}`;
|
|
24
|
+
}
|
|
25
|
+
/** Session-authenticated preview selects saved content without issuing a sharing credential. */
|
|
26
|
+
function savedRevisionPreviewLocation(path, documentId, revisionId, locale) {
|
|
27
|
+
const url = previewUrl(path);
|
|
28
|
+
Schema.decodeSync(SavedRevisionPreviewSelection)({
|
|
29
|
+
documentId,
|
|
30
|
+
revisionId
|
|
31
|
+
});
|
|
32
|
+
url.searchParams.set(url.pathname === "/_cms/revision-preview" ? "documentId" : savedRevisionPreviewDocumentQueryKey, documentId);
|
|
33
|
+
url.searchParams.set(url.pathname === "/_cms/revision-preview" ? "revisionId" : savedRevisionPreviewQueryKey, revisionId);
|
|
34
|
+
if (locale) url.searchParams.set("locale", locale);
|
|
35
|
+
return `${url.pathname}${url.search}${url.hash}`;
|
|
36
|
+
}
|
|
37
|
+
function previewUrl(path) {
|
|
38
|
+
const url = new URL(path, "https://cms.invalid");
|
|
39
|
+
if (url.origin !== "https://cms.invalid") throw new Error("Revision preview must belong to this site.");
|
|
40
|
+
for (const key of [
|
|
41
|
+
"__cms_preview",
|
|
42
|
+
revisionPreviewQueryKey,
|
|
43
|
+
savedRevisionPreviewDocumentQueryKey,
|
|
44
|
+
savedRevisionPreviewQueryKey,
|
|
45
|
+
"token",
|
|
46
|
+
"locale"
|
|
47
|
+
]) url.searchParams.delete(key);
|
|
48
|
+
if (url.pathname === "/_cms/revision-preview") {
|
|
49
|
+
url.searchParams.delete("documentId");
|
|
50
|
+
url.searchParams.delete("revisionId");
|
|
51
|
+
}
|
|
52
|
+
return url;
|
|
53
|
+
}
|
|
54
|
+
function revisionPreviewRequested(route) {
|
|
55
|
+
return route.path === "/_cms/revision-preview" || Object.hasOwn(route.query, "__cms_revision") || savedRevisionPreviewRequested(route);
|
|
56
|
+
}
|
|
57
|
+
function revisionPreviewToken(route) {
|
|
58
|
+
if (savedRevisionPreviewRequested(route)) return null;
|
|
59
|
+
const value = route.query[route.path === "/_cms/revision-preview" ? "token" : revisionPreviewQueryKey];
|
|
60
|
+
return Schema.is(RevisionLinkToken)(value) ? value : null;
|
|
61
|
+
}
|
|
62
|
+
function savedRevisionPreviewRequested(route) {
|
|
63
|
+
return Object.hasOwn(route.query, "__cms_saved_document") || Object.hasOwn(route.query, "__cms_saved_revision") || route.path === "/_cms/revision-preview" && (Object.hasOwn(route.query, "documentId") || Object.hasOwn(route.query, "revisionId"));
|
|
64
|
+
}
|
|
65
|
+
function savedRevisionPreviewSelection(route) {
|
|
66
|
+
const selection = {
|
|
67
|
+
documentId: route.query[route.path === "/_cms/revision-preview" ? "documentId" : savedRevisionPreviewDocumentQueryKey],
|
|
68
|
+
revisionId: route.query[route.path === "/_cms/revision-preview" ? "revisionId" : savedRevisionPreviewQueryKey]
|
|
69
|
+
};
|
|
70
|
+
return Schema.is(SavedRevisionPreviewSelection)(selection) ? selection : null;
|
|
71
|
+
}
|
|
72
|
+
/** Preserve the active saved selection across ordinary site routes and language switches. */
|
|
73
|
+
function revisionPreviewNavigationLocation(path, route, locale) {
|
|
74
|
+
const selection = savedRevisionPreviewSelection(route);
|
|
75
|
+
if (selection) return savedRevisionPreviewLocation(path, selection.documentId, selection.revisionId, locale);
|
|
76
|
+
const token = revisionPreviewToken(route);
|
|
77
|
+
return token ? revisionPreviewLocation(path, token, locale) : null;
|
|
78
|
+
}
|
|
79
|
+
const RevisionLink = Schema.Struct({
|
|
80
|
+
id: RevisionLinkId,
|
|
81
|
+
documentId: DocumentId,
|
|
82
|
+
revisionId: RevisionId,
|
|
83
|
+
createdAt: Schema.String,
|
|
84
|
+
createdBy: Schema.String,
|
|
85
|
+
expiresAt: Schema.String,
|
|
86
|
+
revokedAt: Schema.NullOr(Schema.String),
|
|
87
|
+
revokedBy: Schema.NullOr(Schema.String)
|
|
88
|
+
});
|
|
89
|
+
const CreateRevisionLink = Schema.Struct({
|
|
90
|
+
revisionId: RevisionId,
|
|
91
|
+
expiresAt: Schema.optionalKey(Schema.String)
|
|
92
|
+
});
|
|
93
|
+
/** The plaintext token is returned once. Listing links never returns a token or digest. */
|
|
94
|
+
const IssuedRevisionLink = Schema.Struct({
|
|
95
|
+
link: RevisionLink,
|
|
96
|
+
token: RevisionLinkToken,
|
|
97
|
+
previewPath: Schema.Literal(revisionPreviewPath)
|
|
98
|
+
});
|
|
99
|
+
const RevisionPreviewForm = Schema.Struct({
|
|
100
|
+
...FormReference.fields,
|
|
101
|
+
name: Schema.String,
|
|
102
|
+
steps: FormSteps,
|
|
103
|
+
preview: Schema.Literal(true)
|
|
104
|
+
});
|
|
105
|
+
const RevisionPreviewDocument = Schema.Struct({
|
|
106
|
+
mode: Schema.Literal("revision"),
|
|
107
|
+
primary: Schema.Boolean,
|
|
108
|
+
identity: DocumentIdentity,
|
|
109
|
+
revision: Schema.Struct({
|
|
110
|
+
id: RevisionId,
|
|
111
|
+
number: Schema.Int.check(Schema.isGreaterThan(0)),
|
|
112
|
+
savedAt: Schema.String
|
|
113
|
+
}),
|
|
114
|
+
expiresAt: Schema.NullOr(Schema.String),
|
|
115
|
+
previewPath: Schema.Literal(revisionPreviewPath),
|
|
116
|
+
logicalPath: Schema.NullOr(Schema.String),
|
|
117
|
+
livePath: Schema.NullOr(Schema.String),
|
|
118
|
+
locale: Schema.optionalKey(Locale),
|
|
119
|
+
requestedLocale: Schema.optionalKey(Locale),
|
|
120
|
+
settings: DocumentSettings,
|
|
121
|
+
content: DocumentContent,
|
|
122
|
+
renderPlan: RevisionRenderPlan,
|
|
123
|
+
issues: Schema.Array(RevisionPreviewIssue),
|
|
124
|
+
/** null explicitly disables a destination; a renderer must never fall back to its stored old path. */
|
|
125
|
+
referencePaths: Schema.Record(Schema.String, Schema.NullOr(Schema.String)),
|
|
126
|
+
forms: Schema.Array(RevisionPreviewForm)
|
|
127
|
+
});
|
|
128
|
+
const RevisionPreviewQueryPage = Schema.Struct({
|
|
129
|
+
items: Schema.Array(RevisionPreviewDocument),
|
|
130
|
+
total: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))
|
|
131
|
+
});
|
|
132
|
+
//#endregion
|
|
133
|
+
export { savedRevisionPreviewSelection as _, RevisionLinkToken as a, SavedRevisionPreviewSelection as c, revisionPreviewQueryKey as d, revisionPreviewRequested as f, savedRevisionPreviewRequested as g, savedRevisionPreviewQueryKey as h, RevisionLinkId as i, revisionPreviewNavigationLocation as l, savedRevisionPreviewDocumentQueryKey as m, IssuedRevisionLink as n, RevisionPreviewDocument as o, revisionPreviewToken as p, RevisionLink as r, RevisionPreviewQueryPage as s, CreateRevisionLink as t, revisionPreviewPath as u };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { i as studioErrorReason } from "./StudioErrors-T5zLGQ1M.js";
|
|
2
|
+
//#region ../model/src/Routes.ts
|
|
3
|
+
/** Projects paths from stable identities and revisioned placement without changing either. */
|
|
4
|
+
function projectRoutes(documents, collections, locales) {
|
|
5
|
+
const byId = new Map(documents.map((document) => [document.identity.documentId, document]));
|
|
6
|
+
const byCollection = new Map(collections.map((collection) => [collection.collection, collection.pattern]));
|
|
7
|
+
const cache = /* @__PURE__ */ new Map();
|
|
8
|
+
const active = /* @__PURE__ */ new Set();
|
|
9
|
+
const issues = [];
|
|
10
|
+
const homes = /* @__PURE__ */ new Set();
|
|
11
|
+
const localePrefix = locales?.prefixDefault ? `/${locales.defaultLocale}` : "";
|
|
12
|
+
function issue(code, documentId, reason) {
|
|
13
|
+
issues.push(reason.details ? {
|
|
14
|
+
code,
|
|
15
|
+
documentId,
|
|
16
|
+
message: reason.message,
|
|
17
|
+
details: reason.details
|
|
18
|
+
} : {
|
|
19
|
+
code,
|
|
20
|
+
documentId,
|
|
21
|
+
message: reason.message
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function pathFor(document) {
|
|
25
|
+
const { documentId, collection } = document.identity;
|
|
26
|
+
if (cache.has(documentId)) return cache.get(documentId);
|
|
27
|
+
if (active.has(documentId)) return issue("cycle", documentId, studioErrorReason("errors.route.cycle"));
|
|
28
|
+
const pattern = byCollection.get(collection);
|
|
29
|
+
if (!pattern) return issue("collection", documentId, studioErrorReason("errors.route.collection", { collection }));
|
|
30
|
+
if (!pattern.startsWith("/") || pattern.startsWith("//") || !pattern.endsWith("/:path*")) return issue("pattern", documentId, studioErrorReason("errors.route.pattern", { collection }));
|
|
31
|
+
const prefix = `${localePrefix}${pattern.slice(0, -7)}`;
|
|
32
|
+
active.add(documentId);
|
|
33
|
+
let segments = [];
|
|
34
|
+
if (document.placement.kind === "home") {
|
|
35
|
+
const homeKey = collection;
|
|
36
|
+
if (homes.has(homeKey)) issue("home", documentId, studioErrorReason("errors.route.home"));
|
|
37
|
+
homes.add(homeKey);
|
|
38
|
+
} else {
|
|
39
|
+
const parent = byId.get(document.placement.parentDocumentId);
|
|
40
|
+
if (!parent || parent.identity.collection !== collection) {
|
|
41
|
+
active.delete(documentId);
|
|
42
|
+
return issue("parent", documentId, studioErrorReason("errors.route.parent"));
|
|
43
|
+
}
|
|
44
|
+
const parentPath = pathFor(parent);
|
|
45
|
+
if (!parentPath) {
|
|
46
|
+
active.delete(documentId);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
segments = [...parentPath.slice(prefix.length).split("/").filter(Boolean).map(decodeURIComponent), document.placement.slug];
|
|
50
|
+
}
|
|
51
|
+
active.delete(documentId);
|
|
52
|
+
const path = normalizePath(`${prefix}/${segments.map(encodeURIComponent).join("/")}`);
|
|
53
|
+
cache.set(documentId, path);
|
|
54
|
+
if (locales && (localeFromPath(path, locales) !== locales.defaultLocale || canonicalLocalePath(path, locales) !== path)) issue("locale", documentId, studioErrorReason("errors.route.locale", { path }));
|
|
55
|
+
return path;
|
|
56
|
+
}
|
|
57
|
+
const routes = [];
|
|
58
|
+
const occupied = /* @__PURE__ */ new Map();
|
|
59
|
+
for (const document of documents) {
|
|
60
|
+
const path = pathFor(document);
|
|
61
|
+
if (!path) continue;
|
|
62
|
+
const previous = occupied.get(path);
|
|
63
|
+
if (previous && previous !== document.identity.documentId) issue("collision", document.identity.documentId, studioErrorReason("errors.route.collision", { path }));
|
|
64
|
+
else occupied.set(path, document.identity.documentId);
|
|
65
|
+
routes.push({
|
|
66
|
+
documentId: document.identity.documentId,
|
|
67
|
+
path
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
routes,
|
|
72
|
+
issues
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function normalizePath(path) {
|
|
76
|
+
return path === "/" ? path : path.replace(/\/$/u, "");
|
|
77
|
+
}
|
|
78
|
+
function splitSitePath(path) {
|
|
79
|
+
const suffixIndex = path.search(/[?#]/u);
|
|
80
|
+
const pathname = suffixIndex === -1 ? path : path.slice(0, suffixIndex);
|
|
81
|
+
if (!pathname.startsWith("/") || pathname.startsWith("//")) throw new Error("A locale path must start with one slash.");
|
|
82
|
+
return {
|
|
83
|
+
pathname,
|
|
84
|
+
suffix: suffixIndex === -1 ? "" : path.slice(suffixIndex)
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function prefixedLocale(pathname, routes) {
|
|
88
|
+
const first = pathname.split("/")[1] ?? "";
|
|
89
|
+
return routes.supported.some((definition) => definition.code === first) ? first : void 0;
|
|
90
|
+
}
|
|
91
|
+
/** Removes only an exact configured language prefix, keeping the query and fragment. */
|
|
92
|
+
function unlocalizedPath(path, routes) {
|
|
93
|
+
const { pathname, suffix } = splitSitePath(path);
|
|
94
|
+
if (!routes) return path;
|
|
95
|
+
const current = prefixedLocale(pathname, routes);
|
|
96
|
+
return `${current ? pathname.slice(current.length + 1) || "/" : pathname}${suffix}`;
|
|
97
|
+
}
|
|
98
|
+
/** Resolves the configured language from a site path, including an optional default prefix. */
|
|
99
|
+
function localeFromPath(path, routes) {
|
|
100
|
+
if (!routes) return void 0;
|
|
101
|
+
return prefixedLocale(splitSitePath(path).pathname, routes) ?? routes.defaultLocale;
|
|
102
|
+
}
|
|
103
|
+
/** Prefixes an unlocalized site path according to the CMS route policy. */
|
|
104
|
+
function localePath(path, locale, routes) {
|
|
105
|
+
const { pathname, suffix } = splitSitePath(path);
|
|
106
|
+
if (!routes) return path;
|
|
107
|
+
if (!routes.supported.some((definition) => definition.code === locale)) throw new Error(`Unknown locale "${locale}".`);
|
|
108
|
+
return `${`${routes.prefixDefault || locale !== routes.defaultLocale ? `/${locale}` : ""}${pathname === "/" ? "" : pathname}` || "/"}${suffix}`;
|
|
109
|
+
}
|
|
110
|
+
/** Returns the configured URL form for a path that already identifies its language. */
|
|
111
|
+
function canonicalLocalePath(path, routes) {
|
|
112
|
+
const { pathname } = splitSitePath(path);
|
|
113
|
+
if (!routes) return path;
|
|
114
|
+
const current = prefixedLocale(pathname, routes);
|
|
115
|
+
return localePath(unlocalizedPath(path, routes), current ?? routes.defaultLocale, routes);
|
|
116
|
+
}
|
|
117
|
+
/** Switches the language of a shared Document address. */
|
|
118
|
+
function switchLocalePath(path, locale, routes) {
|
|
119
|
+
return localePath(unlocalizedPath(path, routes), locale, routes);
|
|
120
|
+
}
|
|
121
|
+
/** Resolve the single stored Document route from any configured language address. */
|
|
122
|
+
function documentRoutePath(path, locales) {
|
|
123
|
+
return locales ? switchLocalePath(path, locales.defaultLocale, locales) : path;
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
export { projectRoutes as a, localePath as i, documentRoutePath as n, switchLocalePath as o, localeFromPath as r, unlocalizedPath as s, canonicalLocalePath as t };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./Document-TgwYKJZM.js";
|
|
2
|
+
import { r as LocaleConfiguration } from "./Locales-jwbmJaOp.js";
|
|
3
|
+
//#region ../model/src/Routes.d.ts
|
|
4
|
+
/** Removes only an exact configured language prefix, keeping the query and fragment. */
|
|
5
|
+
declare function unlocalizedPath(path: string, routes?: LocaleConfiguration): string;
|
|
6
|
+
/** Resolves the configured language from a site path, including an optional default prefix. */
|
|
7
|
+
declare function localeFromPath(path: string, routes?: LocaleConfiguration): string | undefined;
|
|
8
|
+
/** Prefixes an unlocalized site path according to the CMS route policy. */
|
|
9
|
+
declare function localePath(path: string, locale: string, routes?: LocaleConfiguration): string;
|
|
10
|
+
/** Returns the configured URL form for a path that already identifies its language. */
|
|
11
|
+
declare function canonicalLocalePath(path: string, routes?: LocaleConfiguration): string;
|
|
12
|
+
/** Switches the language of a shared Document address. */
|
|
13
|
+
declare function switchLocalePath(path: string, locale: string, routes?: LocaleConfiguration): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { unlocalizedPath as a, switchLocalePath as i, localeFromPath as n, localePath as r, canonicalLocalePath as t };
|