@phtngyn/cms 0.2.0-beta.8 → 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 -404
- 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 +1040 -152
- 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 +8793 -39395
- package/studio/host.js.br +0 -0
- package/studio/host.js.gz +0 -0
- package/CHANGELOG.md +0 -14
- package/bin/cms.mjs +0 -2
- package/src/ApplicationTypes.d.ts +0 -84
- package/src/ApplicationTypes.js +0 -1
- package/src/Configuration-CMweD9bn.js +0 -1191
- package/src/Configuration-CMweD9bn.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-tYtwbBjr.js +0 -978
- package/src/DocumentEngine-tYtwbBjr.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-Be3vshPJ.js +0 -20
- package/src/HttpPaths-Be3vshPJ.js.map +0 -1
- package/src/I18n-wxswIRyY.d.ts +0 -30
- 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-BXfjaZOu.js +0 -2756
- package/src/S3MediaObjects-BXfjaZOu.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-3I_pozUl.js +0 -535
- package/src/dev-lifecycle-3I_pozUl.js.map +0 -1
- package/src/installation-DxqSSVbH.js +0 -9105
- package/src/installation-DxqSSVbH.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 -104
- 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 -58
- 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-C4_JBo1w.js +0 -335
- package/studio/SelectMenu-wXqxymUw.js +0 -34045
- package/studio/collaboration-DcK2F6v9.js +0 -4566
- package/studio/editor-P2rB7Csp.js +0 -30128
- package/studio/rolldown-runtime-Dy4uBu1J.js +0 -11
package/src/store-X1e1o_MF.js
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { o as PublicPath, r as DocumentId } from "./scalars-CVZqT3L0.js";
|
|
2
|
-
import { it as CollectionName, n as CmsMarkdownDocument } from "./models-VmGmG19-.js";
|
|
3
|
-
import { f as mutableJson, p as mutableJsonObject } from "./Forms-CX-hwmJF.js";
|
|
4
|
-
import { n as editorMetadata } from "./metadata-DN9_K6Yl.js";
|
|
5
|
-
import { prepareFormDocument } from "./runtime/forms/document.js";
|
|
6
|
-
import { CMS_PREVIEW_EDGE_PROPERTY, CMS_PREVIEW_KIND_PROPERTY, CMS_PREVIEW_MARKER_TAG, CMS_PREVIEW_NODE_PROPERTY } from "./runtime/preview/protocol.js";
|
|
7
|
-
import { toPreviewRenderDocument } from "./runtime/preview/comark-document.js";
|
|
8
|
-
import { Predicate, Result, Schema } from "effect";
|
|
9
|
-
import { shallowRef } from "vue";
|
|
10
|
-
import { createComarkContext } from "comark";
|
|
11
|
-
|
|
12
|
-
//#region ../document/src/PreviewProjection.ts
|
|
13
|
-
var PreviewProjectionInvalid = class extends Schema.TaggedError()("PreviewProjection.Invalid", {
|
|
14
|
-
message: Schema.NonEmptyString,
|
|
15
|
-
cause: Schema.Defect()
|
|
16
|
-
}) {};
|
|
17
|
-
const NATIVE_BLOCK_TAGS = /* @__PURE__ */ new Set([
|
|
18
|
-
"blockquote",
|
|
19
|
-
"h1",
|
|
20
|
-
"h2",
|
|
21
|
-
"h3",
|
|
22
|
-
"h4",
|
|
23
|
-
"h5",
|
|
24
|
-
"h6",
|
|
25
|
-
"hr",
|
|
26
|
-
"img",
|
|
27
|
-
"li",
|
|
28
|
-
"math",
|
|
29
|
-
"ol",
|
|
30
|
-
"p",
|
|
31
|
-
"pre",
|
|
32
|
-
"table",
|
|
33
|
-
"tbody",
|
|
34
|
-
"td",
|
|
35
|
-
"th",
|
|
36
|
-
"thead",
|
|
37
|
-
"tr",
|
|
38
|
-
"ul"
|
|
39
|
-
]);
|
|
40
|
-
function projectPreviewDocument(body, markers) {
|
|
41
|
-
return Result.try({
|
|
42
|
-
try: () => projectPreviewDocumentUnsafe(body, markers),
|
|
43
|
-
catch: (cause) => new PreviewProjectionInvalid({
|
|
44
|
-
cause,
|
|
45
|
-
message: cause instanceof Error && cause.message ? cause.message : "The preview projection is invalid."
|
|
46
|
-
})
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function projectPreviewDocumentUnsafe(body, markers) {
|
|
50
|
-
const fallbacks = {};
|
|
51
|
-
let identifiedTargets = 0;
|
|
52
|
-
function cloneNode(node, componentId, slotId) {
|
|
53
|
-
if (Predicate.isString(node) || node[0] === null) return [mutableJson(node)];
|
|
54
|
-
const [tag, originalAttributes, ...originalChildren] = node;
|
|
55
|
-
const isSlot = tag === "template";
|
|
56
|
-
const isNative = NATIVE_BLOCK_TAGS.has(tag);
|
|
57
|
-
const attributes = mutableJsonObject(originalAttributes);
|
|
58
|
-
const metadata = editorMetadata(attributes);
|
|
59
|
-
const id = metadata?.nodeId;
|
|
60
|
-
if (id) {
|
|
61
|
-
identifiedTargets++;
|
|
62
|
-
const parentId = slotId ?? componentId;
|
|
63
|
-
if (parentId) fallbacks[id] = parentId;
|
|
64
|
-
}
|
|
65
|
-
const nextComponentId = !isNative && !isSlot && id ? id : componentId;
|
|
66
|
-
const implicitSlotId = id && metadata?.implicitSlotId && !isNative && !isSlot && hasImplicitDefaultContent(originalChildren) ? metadata.implicitSlotId : void 0;
|
|
67
|
-
const children = originalChildren.flatMap((child) => {
|
|
68
|
-
const childSlotId = explicitSlotId(child) ?? (isSlot ? id : implicitSlotId) ?? slotId;
|
|
69
|
-
const projected = cloneNode(child, nextComponentId, childSlotId);
|
|
70
|
-
return implicitSlotId && !isSlot && !isSlotNode(child) ? previewRange(implicitSlotId, "field", projected, markers) : projected;
|
|
71
|
-
});
|
|
72
|
-
if (id && implicitSlotId) fallbacks[implicitSlotId] = id;
|
|
73
|
-
if (isSlot && id && componentId) fallbacks[id] = componentId;
|
|
74
|
-
const cloned = [
|
|
75
|
-
tag,
|
|
76
|
-
attributes,
|
|
77
|
-
...children
|
|
78
|
-
];
|
|
79
|
-
if (isSlot && id && componentId) return [[
|
|
80
|
-
tag,
|
|
81
|
-
attributes,
|
|
82
|
-
...previewRange(id, "field", children, markers)
|
|
83
|
-
]];
|
|
84
|
-
if (id && isNative) return previewRange(id, "native", [cloned], markers);
|
|
85
|
-
if (id && !isSlot) return previewRange(id, "component", [cloned], markers);
|
|
86
|
-
return [cloned];
|
|
87
|
-
}
|
|
88
|
-
const nodes = body.nodes.flatMap((node) => cloneNode(node));
|
|
89
|
-
if (body.nodes.length && !identifiedTargets) throw new Error("Studio preview requires an identified authoring document.");
|
|
90
|
-
return {
|
|
91
|
-
body: CmsMarkdownDocument.make({
|
|
92
|
-
frontmatter: mutableJsonObject(body.frontmatter),
|
|
93
|
-
meta: mutableJsonObject(body.meta),
|
|
94
|
-
nodes
|
|
95
|
-
}),
|
|
96
|
-
fallbacks
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function previewRange(nodeId, kind, children, markers) {
|
|
100
|
-
const marker = (edge) => [markers.tag, {
|
|
101
|
-
[markers.edgeProperty]: edge,
|
|
102
|
-
[markers.kindProperty]: kind,
|
|
103
|
-
[markers.nodeProperty]: nodeId
|
|
104
|
-
}];
|
|
105
|
-
return [
|
|
106
|
-
marker("start"),
|
|
107
|
-
...children,
|
|
108
|
-
marker("end")
|
|
109
|
-
];
|
|
110
|
-
}
|
|
111
|
-
function explicitSlotId(node) {
|
|
112
|
-
if (Predicate.isString(node) || node[0] !== "template") return void 0;
|
|
113
|
-
return editorMetadata(node[1])?.nodeId;
|
|
114
|
-
}
|
|
115
|
-
function isSlotNode(node) {
|
|
116
|
-
return !Predicate.isString(node) && node[0] === "template";
|
|
117
|
-
}
|
|
118
|
-
function hasImplicitDefaultContent(nodes) {
|
|
119
|
-
return !nodes.some((node) => Array.isArray(node) && node[0] === "template" && node[1].name === "default") && nodes.some((node) => Predicate.isString(node) ? Boolean(node) : node[0] !== "template");
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
//#endregion
|
|
123
|
-
//#region src/runtime/preview/store.ts
|
|
124
|
-
function createStudioPreviewStore(route, forms = () => []) {
|
|
125
|
-
const context = createComarkContext();
|
|
126
|
-
const patches = shallowRef(/* @__PURE__ */ new Map());
|
|
127
|
-
const registrations = /* @__PURE__ */ new Map();
|
|
128
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
129
|
-
const manifest = () => ({
|
|
130
|
-
documents: renderedDocuments(registrations.values(), patches.value),
|
|
131
|
-
route: route()
|
|
132
|
-
});
|
|
133
|
-
const notify = () => {
|
|
134
|
-
const value = manifest();
|
|
135
|
-
for (const listener of listeners) listener(value);
|
|
136
|
-
};
|
|
137
|
-
return {
|
|
138
|
-
manifest,
|
|
139
|
-
async patch(document) {
|
|
140
|
-
const preview = createPreviewDocument(document.body);
|
|
141
|
-
const patched = prepareFormDocument({
|
|
142
|
-
...document,
|
|
143
|
-
body: preview.body
|
|
144
|
-
}, forms(), true);
|
|
145
|
-
patches.value = new Map(patches.value).set(document.id, patched);
|
|
146
|
-
const renderBody = toPreviewRenderDocument(patched.body);
|
|
147
|
-
context.get(document.id, renderBody).set(renderBody);
|
|
148
|
-
notify();
|
|
149
|
-
return preview.fallbacks;
|
|
150
|
-
},
|
|
151
|
-
register(document, role) {
|
|
152
|
-
const registration = Symbol(document.id);
|
|
153
|
-
registrations.set(registration, {
|
|
154
|
-
document,
|
|
155
|
-
role
|
|
156
|
-
});
|
|
157
|
-
notify();
|
|
158
|
-
return () => {
|
|
159
|
-
registrations.delete(registration);
|
|
160
|
-
notify();
|
|
161
|
-
};
|
|
162
|
-
},
|
|
163
|
-
resolve(document) {
|
|
164
|
-
return patches.value.get(document.id) ?? document;
|
|
165
|
-
},
|
|
166
|
-
routeChanged: notify,
|
|
167
|
-
subscribe(listener) {
|
|
168
|
-
listeners.add(listener);
|
|
169
|
-
listener(manifest());
|
|
170
|
-
return () => listeners.delete(listener);
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
function renderedDocuments(registrations, patches) {
|
|
175
|
-
const priority = {
|
|
176
|
-
embedded: 1,
|
|
177
|
-
primary: 4,
|
|
178
|
-
related: 2,
|
|
179
|
-
summary: 3
|
|
180
|
-
};
|
|
181
|
-
const documents = /* @__PURE__ */ new Map();
|
|
182
|
-
for (const registration of registrations) {
|
|
183
|
-
const document = patches.get(registration.document.id) ?? registration.document;
|
|
184
|
-
const current = documents.get(document.id);
|
|
185
|
-
if (current && priority[current.role] >= priority[registration.role]) continue;
|
|
186
|
-
documents.set(document.id, {
|
|
187
|
-
collection: CollectionName.make(document.collection),
|
|
188
|
-
documentId: DocumentId.make(document.id),
|
|
189
|
-
path: PublicPath.make(document.path),
|
|
190
|
-
role: registration.role,
|
|
191
|
-
title: document.title
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
return [...documents.values()].sort((left, right) => priority[right.role] - priority[left.role] || left.title.localeCompare(right.title));
|
|
195
|
-
}
|
|
196
|
-
function createPreviewDocument(body) {
|
|
197
|
-
const projection = projectPreviewDocument(body, {
|
|
198
|
-
edgeProperty: CMS_PREVIEW_EDGE_PROPERTY,
|
|
199
|
-
kindProperty: CMS_PREVIEW_KIND_PROPERTY,
|
|
200
|
-
nodeProperty: CMS_PREVIEW_NODE_PROPERTY,
|
|
201
|
-
tag: CMS_PREVIEW_MARKER_TAG
|
|
202
|
-
});
|
|
203
|
-
if (Result.isFailure(projection)) throw projection.failure;
|
|
204
|
-
return projection.success;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
//#endregion
|
|
208
|
-
export { createStudioPreviewStore as t };
|
|
209
|
-
//# sourceMappingURL=store-X1e1o_MF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store-X1e1o_MF.js","names":["CmsMarkdownDocumentSchema"],"sources":["../../../../document/src/PreviewProjection.ts","../../../src/runtime/preview/store.ts"],"sourcesContent":["import type { CmsMarkdownDocument, MarkdownNode } from '@internal/protocol/Documents'\nimport type { EditorNodeId } from '@internal/protocol/Documents'\nimport { CmsMarkdownDocument as CmsMarkdownDocumentSchema } from '@internal/protocol/Documents'\nimport { Predicate, Result, Schema } from 'effect'\nimport { mutableJson, mutableJsonObject } from './internal/comark/document-adapter'\nimport { editorMetadata } from './internal/editor/metadata'\n\nexport interface PreviewProjectionMarkers {\n readonly edgeProperty: string\n readonly kindProperty: string\n readonly nodeProperty: string\n readonly tag: string\n}\n\nexport interface PreviewProjection {\n readonly body: CmsMarkdownDocument\n readonly fallbacks: Readonly<Record<string, string>>\n}\n\nexport class PreviewProjectionInvalid extends Schema.TaggedError<PreviewProjectionInvalid>()(\n 'PreviewProjection.Invalid',\n {\n message: Schema.NonEmptyString,\n cause: Schema.Defect(),\n },\n) {}\n\nconst NATIVE_BLOCK_TAGS = new Set([\n 'blockquote',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'hr',\n 'img',\n 'li',\n 'math',\n 'ol',\n 'p',\n 'pre',\n 'table',\n 'tbody',\n 'td',\n 'th',\n 'thead',\n 'tr',\n 'ul',\n])\n\nexport function projectPreviewDocument(\n body: CmsMarkdownDocument,\n markers: PreviewProjectionMarkers,\n): Result.Result<PreviewProjection, PreviewProjectionInvalid> {\n return Result.try({\n try: () => projectPreviewDocumentUnsafe(body, markers),\n catch: (cause) =>\n new PreviewProjectionInvalid({\n cause,\n message: cause instanceof Error && cause.message ? cause.message : 'The preview projection is invalid.',\n }),\n })\n}\n\nfunction projectPreviewDocumentUnsafe(body: CmsMarkdownDocument, markers: PreviewProjectionMarkers): PreviewProjection {\n const fallbacks: Record<string, string> = {}\n let identifiedTargets = 0\n\n function cloneNode(\n node: MarkdownNode,\n componentId?: EditorNodeId,\n slotId?: EditorNodeId,\n ): ReadonlyArray<Schema.Json> {\n if (Predicate.isString(node) || node[0] === null) return [mutableJson(node)]\n const [tag, originalAttributes, ...originalChildren] = node\n const isSlot = tag === 'template'\n const isNative = NATIVE_BLOCK_TAGS.has(tag)\n const attributes = mutableJsonObject(originalAttributes)\n const metadata = editorMetadata(attributes)\n const id = metadata?.nodeId\n\n if (id) {\n identifiedTargets++\n const parentId = slotId ?? componentId\n\n if (parentId) fallbacks[id] = parentId\n }\n\n const nextComponentId = !isNative && !isSlot && id ? id : componentId\n\n const implicitSlotId =\n id && metadata?.implicitSlotId && !isNative && !isSlot && hasImplicitDefaultContent(originalChildren)\n ? metadata.implicitSlotId\n : undefined\n\n const children = originalChildren.flatMap((child) => {\n const childSlotId = explicitSlotId(child) ?? (isSlot ? id : implicitSlotId) ?? slotId\n const projected = cloneNode(child, nextComponentId, childSlotId)\n\n return implicitSlotId && !isSlot && !isSlotNode(child)\n ? previewRange(implicitSlotId, 'field', projected, markers)\n : projected\n })\n\n if (id && implicitSlotId) fallbacks[implicitSlotId] = id\n\n if (isSlot && id && componentId) fallbacks[id] = componentId\n\n const cloned: Schema.Json = [tag, attributes, ...children]\n\n if (isSlot && id && componentId) return [[tag, attributes, ...previewRange(id, 'field', children, markers)]]\n\n if (id && isNative) return previewRange(id, 'native', [cloned], markers)\n\n if (id && !isSlot) return previewRange(id, 'component', [cloned], markers)\n\n return [cloned]\n }\n\n const nodes = body.nodes.flatMap((node) => cloneNode(node))\n\n if (body.nodes.length && !identifiedTargets)\n throw new Error('Studio preview requires an identified authoring document.')\n\n return {\n body: CmsMarkdownDocumentSchema.make({\n frontmatter: mutableJsonObject(body.frontmatter),\n meta: mutableJsonObject(body.meta),\n nodes,\n }),\n fallbacks,\n }\n}\n\nfunction previewRange(\n nodeId: EditorNodeId,\n kind: 'component' | 'field' | 'native',\n children: ReadonlyArray<Schema.Json>,\n markers: PreviewProjectionMarkers,\n): ReadonlyArray<Schema.Json> {\n const marker = (edge: 'end' | 'start'): Schema.Json => [\n markers.tag,\n {\n [markers.edgeProperty]: edge,\n [markers.kindProperty]: kind,\n [markers.nodeProperty]: nodeId,\n },\n ]\n\n return [marker('start'), ...children, marker('end')]\n}\n\nfunction explicitSlotId(node: MarkdownNode): EditorNodeId | undefined {\n if (Predicate.isString(node) || node[0] !== 'template') return undefined\n\n return editorMetadata(node[1])?.nodeId\n}\n\nfunction isSlotNode(node: MarkdownNode): boolean {\n return !Predicate.isString(node) && node[0] === 'template'\n}\n\nfunction hasImplicitDefaultContent(nodes: ReadonlyArray<MarkdownNode>): boolean {\n const hasExplicitDefault = nodes.some(\n (node) => Array.isArray(node) && node[0] === 'template' && node[1].name === 'default',\n )\n\n return (\n !hasExplicitDefault && nodes.some((node) => (Predicate.isString(node) ? Boolean(node) : node[0] !== 'template'))\n )\n}\n","import { prepareFormDocument } from '../forms/document'\nimport type { ComponentDefinition } from '@internal/protocol/Configuration'\nimport type { RenderedCompiledDocument, RenderedDocumentManifest } from '@internal/protocol/Preview'\nimport { projectPreviewDocument } from '@internal/document/PreviewProjection'\nimport { CollectionName } from '@internal/protocol/Configuration'\nimport { DocumentId, PublicPath } from '@internal/protocol/Documents'\nimport { Result } from 'effect'\nimport { createComarkContext } from 'comark'\nimport { shallowRef } from 'vue'\nimport type { DeliveryDocument as PreviewCompiledDocument } from '../delivery/types'\nimport type { DocumentPreviewStore, PreviewDocumentRole } from '../delivery/preview'\nimport { toPreviewRenderDocument } from './comark-document'\nimport {\n CMS_PREVIEW_EDGE_PROPERTY,\n CMS_PREVIEW_KIND_PROPERTY,\n CMS_PREVIEW_MARKER_TAG,\n CMS_PREVIEW_NODE_PROPERTY,\n} from './protocol'\n\nexport { documentPreviewStoreKey, type DocumentPreviewStore, type PreviewDocumentRole } from '../delivery/preview'\n\nexport type { DeliveryDocument as PreviewCompiledDocument } from '../delivery/types'\n\nexport interface StudioPreviewStore extends DocumentPreviewStore {\n readonly manifest: () => RenderedDocumentManifest\n readonly patch: (document: PreviewCompiledDocument) => Promise<Readonly<Record<string, string>>>\n readonly routeChanged: () => void\n readonly subscribe: (listener: (manifest: RenderedDocumentManifest) => void) => () => void\n}\n\nexport function createStudioPreviewStore(\n route: () => RenderedDocumentManifest['route'],\n forms: () => ReadonlyArray<ComponentDefinition> = () => [],\n): StudioPreviewStore {\n const context = createComarkContext()\n const patches = shallowRef(new Map<string, PreviewCompiledDocument>())\n\n const registrations = new Map<\n symbol,\n { readonly document: PreviewCompiledDocument; readonly role: PreviewDocumentRole }\n >()\n\n const listeners = new Set<(manifest: RenderedDocumentManifest) => void>()\n\n const manifest = (): RenderedDocumentManifest => ({\n documents: renderedDocuments(registrations.values(), patches.value),\n route: route(),\n })\n\n const notify = (): void => {\n const value = manifest()\n\n for (const listener of listeners) listener(value)\n }\n\n return {\n manifest,\n // oxlint-disable-next-line effecttsgo/async-function -- The Promise contract turns synchronous projection failures into patch rejections for the preview controller.\n async patch(document) {\n const preview = createPreviewDocument(document.body)\n const patched = prepareFormDocument({ ...document, body: preview.body }, forms(), true)\n patches.value = new Map(patches.value).set(document.id, patched)\n const renderBody = toPreviewRenderDocument(patched.body)\n context.get(document.id, renderBody).set(renderBody)\n notify()\n\n return preview.fallbacks\n },\n register(document, role) {\n const registration = Symbol(document.id)\n registrations.set(registration, { document, role })\n notify()\n\n return () => {\n registrations.delete(registration)\n notify()\n }\n },\n resolve(document) {\n return patches.value.get(document.id) ?? document\n },\n routeChanged: notify,\n subscribe(listener) {\n listeners.add(listener)\n listener(manifest())\n\n return () => listeners.delete(listener)\n },\n }\n}\n\nfunction renderedDocuments(\n registrations: Iterable<{ readonly document: PreviewCompiledDocument; readonly role: PreviewDocumentRole }>,\n patches: ReadonlyMap<string, PreviewCompiledDocument>,\n): ReadonlyArray<RenderedCompiledDocument> {\n const priority = { embedded: 1, primary: 4, related: 2, summary: 3 } satisfies Record<PreviewDocumentRole, number>\n const documents = new Map<string, RenderedCompiledDocument>()\n\n for (const registration of registrations) {\n const document = patches.get(registration.document.id) ?? registration.document\n const current = documents.get(document.id)\n\n if (current && priority[current.role] >= priority[registration.role]) continue\n documents.set(document.id, {\n collection: CollectionName.make(document.collection),\n documentId: DocumentId.make(document.id),\n path: PublicPath.make(document.path),\n role: registration.role,\n title: document.title,\n })\n }\n\n return [...documents.values()].sort(\n (left, right) => priority[right.role] - priority[left.role] || left.title.localeCompare(right.title),\n )\n}\n\nfunction createPreviewDocument(body: PreviewCompiledDocument['body']) {\n const projection = projectPreviewDocument(body, {\n edgeProperty: CMS_PREVIEW_EDGE_PROPERTY,\n kindProperty: CMS_PREVIEW_KIND_PROPERTY,\n nodeProperty: CMS_PREVIEW_NODE_PROPERTY,\n tag: CMS_PREVIEW_MARKER_TAG,\n })\n\n if (Result.isFailure(projection)) throw projection.failure\n\n return projection.success\n}\n"],"mappings":"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"}
|
package/src/types-DZ0IV-Ow.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { n as ResolvedSeo, t as DocumentSeo } from "./Seo-402YumpT.js";
|
|
2
|
-
import { DateTime } from "effect";
|
|
3
|
-
//#region src/runtime/delivery/types.d.ts
|
|
4
|
-
type DeliveryJson = null | boolean | number | string | ReadonlyArray<DeliveryJson> | DeliveryJsonObject;
|
|
5
|
-
interface DeliveryJsonObject {
|
|
6
|
-
readonly [key: string]: DeliveryJson;
|
|
7
|
-
}
|
|
8
|
-
type DeliveryMarkdownNode = string | readonly [null, DeliveryJsonObject, string] | readonly [string, DeliveryJsonObject, ...DeliveryMarkdownNode[]];
|
|
9
|
-
interface DeliveryMarkdownDocument {
|
|
10
|
-
readonly frontmatter: DeliveryJsonObject;
|
|
11
|
-
readonly meta: DeliveryJsonObject;
|
|
12
|
-
readonly nodes: ReadonlyArray<DeliveryMarkdownNode>;
|
|
13
|
-
}
|
|
14
|
-
interface DeliveryDocument {
|
|
15
|
-
readonly analysis: {
|
|
16
|
-
readonly components: ReadonlyArray<string>;
|
|
17
|
-
readonly headings: ReadonlyArray<{
|
|
18
|
-
readonly depth: number;
|
|
19
|
-
readonly id: string;
|
|
20
|
-
readonly text: string;
|
|
21
|
-
}>;
|
|
22
|
-
readonly searchText: string;
|
|
23
|
-
readonly summary: string;
|
|
24
|
-
};
|
|
25
|
-
readonly body: DeliveryMarkdownDocument;
|
|
26
|
-
readonly alternatives?: ReadonlyArray<{
|
|
27
|
-
readonly locale: string;
|
|
28
|
-
readonly path: string;
|
|
29
|
-
}>;
|
|
30
|
-
readonly collection: string;
|
|
31
|
-
readonly data: DeliveryJsonObject;
|
|
32
|
-
readonly description?: string;
|
|
33
|
-
readonly draft: boolean;
|
|
34
|
-
readonly engineFingerprint: string;
|
|
35
|
-
readonly id: string;
|
|
36
|
-
readonly identity: {
|
|
37
|
-
readonly collection: string;
|
|
38
|
-
readonly documentId: string;
|
|
39
|
-
readonly locale?: string;
|
|
40
|
-
};
|
|
41
|
-
readonly issues: ReadonlyArray<{
|
|
42
|
-
readonly code: string;
|
|
43
|
-
readonly collection?: string;
|
|
44
|
-
readonly field?: string;
|
|
45
|
-
readonly key?: string;
|
|
46
|
-
readonly locale?: string;
|
|
47
|
-
readonly message: string;
|
|
48
|
-
readonly severity: 'error' | 'warning';
|
|
49
|
-
readonly documentId?: string;
|
|
50
|
-
}>;
|
|
51
|
-
readonly key: string;
|
|
52
|
-
readonly locale?: string;
|
|
53
|
-
readonly path: string;
|
|
54
|
-
readonly placement: {
|
|
55
|
-
readonly kind: 'home';
|
|
56
|
-
} | {
|
|
57
|
-
readonly kind: 'entry';
|
|
58
|
-
readonly parentDocumentId: string;
|
|
59
|
-
readonly slug: string;
|
|
60
|
-
};
|
|
61
|
-
readonly resolvedSeo?: ResolvedSeo;
|
|
62
|
-
readonly seo?: DocumentSeo;
|
|
63
|
-
readonly source: {
|
|
64
|
-
readonly mappings: ReadonlyArray<{
|
|
65
|
-
readonly nodePath: ReadonlyArray<number>;
|
|
66
|
-
readonly range: {
|
|
67
|
-
readonly end: {
|
|
68
|
-
readonly column: number;
|
|
69
|
-
readonly line: number;
|
|
70
|
-
readonly offset: number;
|
|
71
|
-
};
|
|
72
|
-
readonly start: {
|
|
73
|
-
readonly column: number;
|
|
74
|
-
readonly line: number;
|
|
75
|
-
readonly offset: number;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
}>;
|
|
79
|
-
readonly publishedAt?: DateTime.Utc;
|
|
80
|
-
};
|
|
81
|
-
readonly title: string;
|
|
82
|
-
}
|
|
83
|
-
interface DeliveryDocumentPage {
|
|
84
|
-
readonly items: ReadonlyArray<DeliveryDocument>;
|
|
85
|
-
readonly total: number;
|
|
86
|
-
}
|
|
87
|
-
interface DeliveryDocumentQuerySort {
|
|
88
|
-
readonly direction?: 'asc' | 'desc';
|
|
89
|
-
readonly field: string;
|
|
90
|
-
}
|
|
91
|
-
interface DeliveryDocumentQuery {
|
|
92
|
-
readonly collection?: string;
|
|
93
|
-
readonly locale?: string;
|
|
94
|
-
readonly limit: number;
|
|
95
|
-
readonly offset?: number;
|
|
96
|
-
readonly sort?: DeliveryDocumentQuerySort | ReadonlyArray<DeliveryDocumentQuerySort>;
|
|
97
|
-
readonly where?: Readonly<Record<string, boolean | number | string | null | ReadonlyArray<boolean | number | string | null>>>;
|
|
98
|
-
}
|
|
99
|
-
//#endregion
|
|
100
|
-
export { DeliveryJson as a, DeliveryMarkdownNode as c, DeliveryDocumentQuerySort as i, DeliveryDocumentPage as n, DeliveryJsonObject as o, DeliveryDocumentQuery as r, DeliveryMarkdownDocument as s, DeliveryDocument as t };
|
|
101
|
-
//# sourceMappingURL=types-DZ0IV-Ow.d.ts.map
|
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
import { $ as e, Bt as t, Dt as n, Et as r, It as i, Nt as a, Pt as o, Q as s, Y as c, at as l, cn as u, dn as d, en as f, et as p, ht as m, mt as h, nt as g, on as _, q as ee, st as v, tt as y, wt as b } from "./editor-P2rB7Csp.js";
|
|
2
|
-
import { Ai as x, Ar as te, F as ne, I as re, L as ie, Mr as S, Nr as C, O as w, P as T, Pa as E, fa as D, j as ae, ji as O, jr as k, ki as A, n as j, or as M, r as oe, sr as se, t as N, yr as ce, z as le } from "./SelectMenu-wXqxymUw.js";
|
|
3
|
-
//#region virtual:nuxt-ui-templates/ui/collapsible.ts
|
|
4
|
-
var P = { slots: {
|
|
5
|
-
root: "",
|
|
6
|
-
content: "data-[state=open]:animate-[collapsible-down_200ms_var(--ease-out)] data-[state=closed]:animate-[collapsible-up_200ms_var(--ease-out)] data-[state=closed]:overflow-hidden"
|
|
7
|
-
} }, ue = {
|
|
8
|
-
__name: "Collapsible",
|
|
9
|
-
props: {
|
|
10
|
-
as: {
|
|
11
|
-
type: null,
|
|
12
|
-
required: !1
|
|
13
|
-
},
|
|
14
|
-
class: {
|
|
15
|
-
type: null,
|
|
16
|
-
required: !1
|
|
17
|
-
},
|
|
18
|
-
ui: {
|
|
19
|
-
type: Object,
|
|
20
|
-
required: !1
|
|
21
|
-
},
|
|
22
|
-
defaultOpen: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
required: !1
|
|
25
|
-
},
|
|
26
|
-
open: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
required: !1
|
|
29
|
-
},
|
|
30
|
-
disabled: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
required: !1
|
|
33
|
-
},
|
|
34
|
-
unmountOnHide: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
required: !1,
|
|
37
|
-
default: !0
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
emits: ["update:open"],
|
|
41
|
-
setup(e, { emit: r }) {
|
|
42
|
-
let i = e, a = r, c = o(), d = C("collapsible", i), f = D(), h = S(E(d, "as", "defaultOpen", "open", "disabled", "unmountOnHide"), a), g = s(() => k({
|
|
43
|
-
extend: P,
|
|
44
|
-
...f.ui?.collapsible || {}
|
|
45
|
-
})());
|
|
46
|
-
return (e, r) => (b(), p(_(O), m(_(h), {
|
|
47
|
-
"data-slot": "root",
|
|
48
|
-
class: g.value.root({ class: [_(d).ui?.root, _(d).class] })
|
|
49
|
-
}), {
|
|
50
|
-
default: t(({ open: r }) => [c.default ? (b(), p(_(A), {
|
|
51
|
-
key: 0,
|
|
52
|
-
"as-child": ""
|
|
53
|
-
}, {
|
|
54
|
-
default: t(() => [n(e.$slots, "default", { open: r })]),
|
|
55
|
-
_: 2
|
|
56
|
-
}, 1024)) : y("", !0), l(_(x), {
|
|
57
|
-
"data-slot": "content",
|
|
58
|
-
class: u(g.value.content({ class: _(d).ui?.content }))
|
|
59
|
-
}, {
|
|
60
|
-
default: t(() => [n(e.$slots, "content")]),
|
|
61
|
-
_: 3
|
|
62
|
-
}, 8, ["class"])]),
|
|
63
|
-
_: 3
|
|
64
|
-
}, 16, ["class"]));
|
|
65
|
-
}
|
|
66
|
-
}, de = { key: 2 }, fe = { class: "grid grid-flow-col auto-cols-fr overflow-x-auto rounded-md border border-default" }, pe = ["aria-pressed", "onClick"], me = { class: "block truncate" }, F = { key: 3 }, I = {
|
|
67
|
-
key: 4,
|
|
68
|
-
class: "overflow-hidden rounded-md border border-default bg-elevated/20"
|
|
69
|
-
}, L = {
|
|
70
|
-
type: "button",
|
|
71
|
-
class: "group flex w-full min-w-0 items-center gap-3 px-3 py-2.5 text-left transition-[background-color,transform] duration-150 ease-out hover:bg-elevated/50 active:scale-[0.99] motion-reduce:transition-none"
|
|
72
|
-
}, R = { class: "min-w-0 flex-1" }, he = { class: "block truncate text-xs text-muted" }, ge = { class: "shrink-0 text-xs font-medium text-muted group-hover:text-highlighted" }, _e = { class: "grid gap-4 border-t border-default px-3 py-3 sm:grid-cols-2" }, ve = {
|
|
73
|
-
key: 5,
|
|
74
|
-
class: "-mt-2 text-xs text-error"
|
|
75
|
-
}, ye = {
|
|
76
|
-
key: 6,
|
|
77
|
-
class: "-mt-2 text-xs text-error"
|
|
78
|
-
}, be = { class: "flex w-full justify-end gap-2" }, z = "__top_level__", B = /* @__PURE__ */ v({
|
|
79
|
-
__name: "CreateDocumentDialog",
|
|
80
|
-
props: /*@__PURE__*/ h({
|
|
81
|
-
catalog: {},
|
|
82
|
-
context: {}
|
|
83
|
-
}, {
|
|
84
|
-
open: { type: Boolean },
|
|
85
|
-
openModifiers: {}
|
|
86
|
-
}),
|
|
87
|
-
emits: /*@__PURE__*/ h(["close"], ["update:open"]),
|
|
88
|
-
setup(n, { emit: o }) {
|
|
89
|
-
let m = o, h = a(n, "open"), v = T(), x = v.bootstrap.documents, S = x.types.filter((e) => e.canCreate), C = (x.locales?.locales ?? []).map((e) => ({
|
|
90
|
-
label: $(e),
|
|
91
|
-
value: String(e)
|
|
92
|
-
})), E = f(""), D = f(!1), O = f(""), k = f(""), A = f(!1), P = f(""), B = f(z), V = f(x.locales?.defaultLocale ?? ""), H = f(!1), U = s(() => {
|
|
93
|
-
let e = S.map((e) => ({
|
|
94
|
-
collection: e.collection,
|
|
95
|
-
key: `entry:${e.collection}`,
|
|
96
|
-
kind: "entry",
|
|
97
|
-
label: e.label,
|
|
98
|
-
type: e,
|
|
99
|
-
urlHint: e.routes.entry.replace(/:[a-z][\w.]*\*?/giu, "…")
|
|
100
|
-
}));
|
|
101
|
-
return [...S.filter((e) => !n.catalog.entries.value.some((t) => t.document.collection === e.collection && t.document.locale === (V.value || void 0) && t.document.placement.kind === "home")).flatMap((e) => {
|
|
102
|
-
let t = j(x, {
|
|
103
|
-
collection: e.collection,
|
|
104
|
-
locale: V.value || void 0,
|
|
105
|
-
placement: { kind: "home" },
|
|
106
|
-
title: "Home"
|
|
107
|
-
});
|
|
108
|
-
return M(t) || n.catalog.entries.value.some((e) => e.document.path === t.success.path) ? [] : [{
|
|
109
|
-
collection: e.collection,
|
|
110
|
-
key: `home:${e.collection}`,
|
|
111
|
-
kind: "home",
|
|
112
|
-
label: "Home",
|
|
113
|
-
type: e,
|
|
114
|
-
urlHint: t.success.path
|
|
115
|
-
}];
|
|
116
|
-
}), ...e];
|
|
117
|
-
}), W = s(() => U.value.find((e) => e.key === P.value)), G = s(() => n.catalog.entries.value.find((e) => e.document.collection === W.value?.collection && e.document.locale === (V.value || void 0) && e.document.placement.kind === "home")), xe = s(() => U.value.length > 1 ? "Choose a page type and add a title." : "Add a title to get started."), Se = s(() => W.value?.kind === "home" ? "Homepage" : B.value === z || B.value === G.value?.document.id ? "Top level" : n.catalog.byId(B.value)?.document.title ?? "Selected location"), Ce = s(() => {
|
|
118
|
-
let e = [Se.value];
|
|
119
|
-
return C.length && e.unshift($(V.value)), e.join(" · ");
|
|
120
|
-
}), K = s(() => {
|
|
121
|
-
if (W.value?.kind === "home") return { kind: "home" };
|
|
122
|
-
let e = B.value === z ? G.value?.document.id : B.value;
|
|
123
|
-
return e ? {
|
|
124
|
-
kind: "entry",
|
|
125
|
-
parentDocumentId: e,
|
|
126
|
-
slug: k.value
|
|
127
|
-
} : void 0;
|
|
128
|
-
}), q = s(() => {
|
|
129
|
-
let e = W.value, t = K.value;
|
|
130
|
-
if (!e || !t || e.kind === "entry" && !k.value.trim()) return;
|
|
131
|
-
let r = {
|
|
132
|
-
collection: e.collection,
|
|
133
|
-
placement: t,
|
|
134
|
-
title: O.value || "Untitled"
|
|
135
|
-
}, i = r.placement.kind === "entry" ? n.catalog.byId(r.placement.parentDocumentId)?.document.path : void 0;
|
|
136
|
-
return j(x, V.value ? {
|
|
137
|
-
...r,
|
|
138
|
-
locale: V.value
|
|
139
|
-
} : r, i);
|
|
140
|
-
}), J = s(() => {
|
|
141
|
-
let e = q.value;
|
|
142
|
-
return e && se(e) ? e.success : void 0;
|
|
143
|
-
}), Y = s(() => {
|
|
144
|
-
let e = q.value;
|
|
145
|
-
return e && M(e) ? e.failure : "";
|
|
146
|
-
}), X = s(() => J.value && n.catalog.entries.value.some((e) => e.document.path === J.value?.path)), we = s(() => {
|
|
147
|
-
let e = W.value;
|
|
148
|
-
if (!e || e.kind === "home" || !e.type.hierarchy) return [];
|
|
149
|
-
let t = n.catalog.entries.value.flatMap((t) => t.document.collection !== e.collection || t.document.locale !== (V.value || void 0) || t.document.placement.kind === "home" ? [] : [{
|
|
150
|
-
description: String(t.document.path),
|
|
151
|
-
label: t.document.title,
|
|
152
|
-
value: String(t.document.id)
|
|
153
|
-
}]);
|
|
154
|
-
return n.context?.parent && !t.some((e) => e.value === n.context.parent) && t.push({
|
|
155
|
-
description: n.context.parent,
|
|
156
|
-
label: "Selected location",
|
|
157
|
-
value: n.context.parent
|
|
158
|
-
}), [{
|
|
159
|
-
description: "Add this page directly below the homepage.",
|
|
160
|
-
label: "Top level",
|
|
161
|
-
value: z
|
|
162
|
-
}, ...t];
|
|
163
|
-
}), Z = s(() => !!O.value.trim() && !!W.value && !!J.value && !X.value);
|
|
164
|
-
i(O, (e) => {
|
|
165
|
-
A.value || (k.value = oe(e));
|
|
166
|
-
}), i(P, () => B.value = z, { flush: "sync" }), i(V, () => {
|
|
167
|
-
B.value = z, W.value || (P.value = Q());
|
|
168
|
-
}, { flush: "sync" }), i(h, (e) => {
|
|
169
|
-
e && (E.value = "", O.value = "", k.value = "", A.value = !1, H.value = !1, V.value = n.context?.locale ?? x.locales?.defaultLocale ?? "", P.value = n.context?.collection ? `entry:${n.context.collection}` : Q(), B.value = n.context?.parent === G.value?.document.id ? z : n.context?.parent || z, n.context?.slug && (k.value = n.context.slug, A.value = !0));
|
|
170
|
-
}, { immediate: !0 });
|
|
171
|
-
async function Te() {
|
|
172
|
-
let e = W.value, t = K.value;
|
|
173
|
-
if (Z.value && e && t && !D.value) {
|
|
174
|
-
D.value = !0, E.value = "";
|
|
175
|
-
try {
|
|
176
|
-
let r = {
|
|
177
|
-
collection: e.collection,
|
|
178
|
-
placement: t,
|
|
179
|
-
title: O.value
|
|
180
|
-
}, i = await v.gateway.documents.create(V.value ? {
|
|
181
|
-
...r,
|
|
182
|
-
locale: V.value
|
|
183
|
-
} : r);
|
|
184
|
-
await n.catalog.refresh(!0);
|
|
185
|
-
let a = n.catalog.byId(i.documentId);
|
|
186
|
-
if (!a) throw Error("The page was created but could not be opened.");
|
|
187
|
-
m("close", a.document.id);
|
|
188
|
-
} catch (e) {
|
|
189
|
-
E.value = le(e);
|
|
190
|
-
} finally {
|
|
191
|
-
D.value = !1;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
function Q() {
|
|
196
|
-
return U.value[0]?.key ?? "";
|
|
197
|
-
}
|
|
198
|
-
function $(e) {
|
|
199
|
-
try {
|
|
200
|
-
return new Intl.DisplayNames(void 0, { type: "language" }).of(e) ?? e.toLocaleUpperCase();
|
|
201
|
-
} catch {
|
|
202
|
-
return e.toLocaleUpperCase();
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
return (n, i) => {
|
|
206
|
-
let a = ie, o = ne, s = re, f = te, m = w, v = N, x = ue, S = ce, T = ae;
|
|
207
|
-
return b(), p(T, {
|
|
208
|
-
open: h.value,
|
|
209
|
-
"onUpdate:open": i[7] ||= (e) => h.value = e,
|
|
210
|
-
title: "Create page",
|
|
211
|
-
description: xe.value,
|
|
212
|
-
ui: { content: "max-w-lg" }
|
|
213
|
-
}, {
|
|
214
|
-
body: t(() => [e("form", {
|
|
215
|
-
id: "create-document-form",
|
|
216
|
-
class: "space-y-4",
|
|
217
|
-
onSubmit: ee(Te, ["prevent"])
|
|
218
|
-
}, [
|
|
219
|
-
E.value ? (b(), p(a, {
|
|
220
|
-
key: 0,
|
|
221
|
-
description: E.value,
|
|
222
|
-
color: "error",
|
|
223
|
-
variant: "subtle"
|
|
224
|
-
}, null, 8, ["description"])) : y("", !0),
|
|
225
|
-
U.value.length ? U.value.length > 1 ? (b(), g("fieldset", de, [i[8] ||= e("legend", { class: "mb-2 text-sm font-medium text-highlighted" }, "Page type", -1), e("div", fe, [(b(!0), g(c, null, r(U.value, (t) => (b(), g("button", {
|
|
226
|
-
key: t.key,
|
|
227
|
-
type: "button",
|
|
228
|
-
"aria-pressed": t.key === P.value,
|
|
229
|
-
class: u(["min-w-28 border-l border-default px-3 py-2 text-center text-sm transition-[color,background-color,transform] duration-150 ease-out first:border-l-0 active:scale-[0.98] motion-reduce:transition-none", t.key === P.value ? "bg-muted font-medium text-highlighted" : "bg-default text-muted hover:bg-muted/50 hover:text-highlighted"]),
|
|
230
|
-
onClick: (e) => P.value = t.key
|
|
231
|
-
}, [e("span", me, d(t.label), 1)], 10, pe))), 128))])])) : y("", !0) : (b(), p(a, {
|
|
232
|
-
key: 1,
|
|
233
|
-
title: "Document creation is not configured",
|
|
234
|
-
description: "A developer needs to make at least one collection creatable in Studio.",
|
|
235
|
-
color: "warning",
|
|
236
|
-
variant: "subtle"
|
|
237
|
-
})),
|
|
238
|
-
W.value ? (b(), g("div", F, [l(s, {
|
|
239
|
-
label: "Title",
|
|
240
|
-
required: ""
|
|
241
|
-
}, {
|
|
242
|
-
default: t(() => [l(o, {
|
|
243
|
-
modelValue: O.value,
|
|
244
|
-
"onUpdate:modelValue": i[0] ||= (e) => O.value = e,
|
|
245
|
-
autofocus: "",
|
|
246
|
-
placeholder: "About us",
|
|
247
|
-
class: "w-full"
|
|
248
|
-
}, null, 8, ["modelValue"])]),
|
|
249
|
-
_: 1
|
|
250
|
-
})])) : y("", !0),
|
|
251
|
-
W.value ? (b(), g("div", I, [l(x, {
|
|
252
|
-
open: H.value,
|
|
253
|
-
"onUpdate:open": i[5] ||= (e) => H.value = e
|
|
254
|
-
}, {
|
|
255
|
-
content: t(() => [e("div", _e, [
|
|
256
|
-
_(C).length ? (b(), p(s, {
|
|
257
|
-
key: 0,
|
|
258
|
-
label: "Language"
|
|
259
|
-
}, {
|
|
260
|
-
default: t(() => [l(m, {
|
|
261
|
-
modelValue: V.value,
|
|
262
|
-
"onUpdate:modelValue": i[1] ||= (e) => V.value = e,
|
|
263
|
-
items: _(C),
|
|
264
|
-
"value-key": "value",
|
|
265
|
-
class: "w-full"
|
|
266
|
-
}, null, 8, ["modelValue", "items"])]),
|
|
267
|
-
_: 1
|
|
268
|
-
})) : y("", !0),
|
|
269
|
-
W.value.kind === "entry" && W.value.type.hierarchy ? (b(), p(s, {
|
|
270
|
-
key: 1,
|
|
271
|
-
label: "Location",
|
|
272
|
-
class: u(_(C).length ? "" : "sm:col-span-2")
|
|
273
|
-
}, {
|
|
274
|
-
default: t(() => [l(v, {
|
|
275
|
-
modelValue: B.value,
|
|
276
|
-
"onUpdate:modelValue": i[2] ||= (e) => B.value = e,
|
|
277
|
-
"aria-label": "Location",
|
|
278
|
-
items: we.value,
|
|
279
|
-
"value-key": "value",
|
|
280
|
-
"filter-fields": ["label", "description"],
|
|
281
|
-
"search-input": { placeholder: "Search pages…" },
|
|
282
|
-
class: "w-full"
|
|
283
|
-
}, null, 8, ["modelValue", "items"])]),
|
|
284
|
-
_: 1
|
|
285
|
-
}, 8, ["class"])) : y("", !0),
|
|
286
|
-
W.value.kind === "entry" ? (b(), p(s, {
|
|
287
|
-
key: 2,
|
|
288
|
-
label: "Page address",
|
|
289
|
-
description: "The final part of this page's web address.",
|
|
290
|
-
class: "sm:col-span-2",
|
|
291
|
-
required: ""
|
|
292
|
-
}, {
|
|
293
|
-
default: t(() => [l(o, {
|
|
294
|
-
modelValue: k.value,
|
|
295
|
-
"onUpdate:modelValue": [i[3] ||= (e) => k.value = e, i[4] ||= (e) => A.value = !0],
|
|
296
|
-
placeholder: "about-us",
|
|
297
|
-
class: "w-full"
|
|
298
|
-
}, null, 8, ["modelValue"])]),
|
|
299
|
-
_: 1
|
|
300
|
-
})) : y("", !0)
|
|
301
|
-
])]),
|
|
302
|
-
default: t(() => [e("button", L, [
|
|
303
|
-
e("span", R, [e("span", he, d(Ce.value), 1), e("span", { class: u(["mt-0.5 block truncate font-mono text-xs", X.value || Y.value ? "text-error" : "text-highlighted"]) }, d(J.value?.path || W.value.urlHint), 3)]),
|
|
304
|
-
e("span", ge, d(H.value ? "Done" : "Edit details"), 1),
|
|
305
|
-
l(f, {
|
|
306
|
-
name: "i-lucide-chevron-down",
|
|
307
|
-
class: u(["size-3.5 shrink-0 text-dimmed transition-transform duration-150 ease-out motion-reduce:transition-none", H.value ? "rotate-180" : ""])
|
|
308
|
-
}, null, 8, ["class"])
|
|
309
|
-
])]),
|
|
310
|
-
_: 1
|
|
311
|
-
}, 8, ["open"])])) : y("", !0),
|
|
312
|
-
X.value ? (b(), g("p", ve, "This page address is already in use.")) : Y.value ? (b(), g("p", ye, d(Y.value), 1)) : y("", !0)
|
|
313
|
-
], 32)]),
|
|
314
|
-
footer: t(() => [e("div", be, [l(S, {
|
|
315
|
-
color: "neutral",
|
|
316
|
-
variant: "ghost",
|
|
317
|
-
label: "Cancel",
|
|
318
|
-
class: "transition-transform duration-150 ease-out active:scale-[0.97] motion-reduce:transition-none",
|
|
319
|
-
onClick: i[6] ||= (e) => h.value = !1
|
|
320
|
-
}), l(S, {
|
|
321
|
-
type: "submit",
|
|
322
|
-
form: "create-document-form",
|
|
323
|
-
color: "neutral",
|
|
324
|
-
label: "Create page",
|
|
325
|
-
class: "transition-transform duration-150 ease-out active:scale-[0.97] motion-reduce:transition-none",
|
|
326
|
-
loading: D.value,
|
|
327
|
-
disabled: !Z.value
|
|
328
|
-
}, null, 8, ["loading", "disabled"])])]),
|
|
329
|
-
_: 1
|
|
330
|
-
}, 8, ["open", "description"]);
|
|
331
|
-
};
|
|
332
|
-
}
|
|
333
|
-
});
|
|
334
|
-
//#endregion
|
|
335
|
-
export { B as default };
|