@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
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { ByteSize, Context, Deferred, Effect, FileSystem, Layer, Pull, Schema, Stream } from "effect";
|
|
2
|
+
import { Readable } from "node:stream";
|
|
3
|
+
import * as NodeStream from "@effect/platform-node/NodeStream";
|
|
4
|
+
import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem";
|
|
5
|
+
import { DeleteObjectCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectsV2Command, PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
|
|
6
|
+
//#region ../server/src/MediaObjects.ts
|
|
7
|
+
var MediaStorageError = class extends Schema.TaggedError()("Media.StorageError", {
|
|
8
|
+
operation: Schema.NonEmptyString,
|
|
9
|
+
cause: Schema.Defect()
|
|
10
|
+
}) {};
|
|
11
|
+
/** The private-object-store seam used by the Media library and its recovery worker. */
|
|
12
|
+
const MediaObjects = Context.Service("@internal/server/MediaObjects");
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region ../s3/src/internal/keys.ts
|
|
15
|
+
function safePath(path, allowEmpty) {
|
|
16
|
+
if (!path) return allowEmpty;
|
|
17
|
+
return path === path.trim() && !path.startsWith("/") && !path.endsWith("/") && !Array.from(path).some((character) => {
|
|
18
|
+
const code = character.codePointAt(0);
|
|
19
|
+
return character === "\\" || code !== void 0 && (code <= 31 || code === 127);
|
|
20
|
+
}) && path.split("/").every((segment) => segment !== "" && segment !== "." && segment !== "..");
|
|
21
|
+
}
|
|
22
|
+
function physicalKey(prefix, key) {
|
|
23
|
+
if (!safePath(prefix, true) || !safePath(key, false)) throw new Error("Unsafe media object key.");
|
|
24
|
+
return prefix ? `${prefix}/${key}` : key;
|
|
25
|
+
}
|
|
26
|
+
/** Listing a folder includes its separator; listing a key prefix does not. */
|
|
27
|
+
function physicalPrefix(prefix, key) {
|
|
28
|
+
if (!key) return prefix ? `${physicalKey("", prefix)}/` : "";
|
|
29
|
+
return key.endsWith("/") ? `${physicalKey(prefix, key.slice(0, -1))}/` : physicalKey(prefix, key);
|
|
30
|
+
}
|
|
31
|
+
/** Ignore provider records outside this installation's namespace. */
|
|
32
|
+
function relativeKey(prefix, key) {
|
|
33
|
+
const namespace = prefix ? `${prefix}/` : "";
|
|
34
|
+
return key && key.startsWith(namespace) ? key.slice(namespace.length) : void 0;
|
|
35
|
+
}
|
|
36
|
+
function validateOptions(options) {
|
|
37
|
+
if (!options.bucket.trim() || !options.region.trim() || !safePath(options.prefix ?? "", true) || options.endpoint !== void 0 && !options.endpoint.trim() || options.credentials && (!options.credentials.accessKeyId.trim() || !options.credentials.secretAccessKey)) return Effect.fail(new MediaStorageError({
|
|
38
|
+
operation: "configure",
|
|
39
|
+
cause: /* @__PURE__ */ new Error("Invalid S3 media configuration.")
|
|
40
|
+
}));
|
|
41
|
+
return Effect.succeed(options);
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region ../s3/src/internal/upload.ts
|
|
45
|
+
const openUpload = Effect.fn("S3MediaObjects.openUpload")(function* (fs, filePath) {
|
|
46
|
+
const pull = yield* Stream.toPull(fs.stream(filePath));
|
|
47
|
+
const first = yield* Pull.catchDone(pull, () => Effect.succeed([])).pipe(Effect.mapError((cause) => new MediaStorageError({
|
|
48
|
+
operation: "put.open",
|
|
49
|
+
cause
|
|
50
|
+
})));
|
|
51
|
+
const error = yield* Deferred.make();
|
|
52
|
+
const closed = yield* Deferred.make();
|
|
53
|
+
const onError = (cause) => Deferred.doneUnsafe(error, Effect.fail(new MediaStorageError({
|
|
54
|
+
operation: "put.read",
|
|
55
|
+
cause
|
|
56
|
+
})));
|
|
57
|
+
return {
|
|
58
|
+
body: yield* Effect.acquireRelease(NodeStream.toReadable(Stream.concat(Stream.fromArray(first), Stream.fromPull(Effect.succeed(pull)))).pipe(Effect.tap((body) => Effect.sync(() => {
|
|
59
|
+
body.on("error", onError);
|
|
60
|
+
body.once("close", () => Deferred.doneUnsafe(closed, Effect.void));
|
|
61
|
+
}))), (body) => Effect.sync(() => body.destroy()).pipe(Effect.andThen(Deferred.await(closed)), Effect.ensuring(Effect.sync(() => body.removeListener("error", onError))))),
|
|
62
|
+
error
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region ../s3/src/internal/client.ts
|
|
67
|
+
const failure = (operation, cause) => new MediaStorageError({
|
|
68
|
+
operation,
|
|
69
|
+
cause
|
|
70
|
+
});
|
|
71
|
+
function isMissing(cause) {
|
|
72
|
+
if (!(cause instanceof Error)) return false;
|
|
73
|
+
return cause.name === "NoSuchKey" || cause.name === "NotFound";
|
|
74
|
+
}
|
|
75
|
+
function make(client, options, fs) {
|
|
76
|
+
const bucket = options.bucket;
|
|
77
|
+
const prefix = options.prefix ?? "";
|
|
78
|
+
const key = (value) => physicalKey(prefix, value);
|
|
79
|
+
const request = Effect.fn("S3MediaObjects.request")(function* (operation, send) {
|
|
80
|
+
return yield* Effect.tryPromise({
|
|
81
|
+
try: send,
|
|
82
|
+
catch: (cause) => failure(operation, cause)
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
const missingAsNull = (effect) => effect.pipe(Effect.catchIf((error) => isMissing(error.cause), () => Effect.succeed(null)));
|
|
86
|
+
const statObject = Effect.fn("S3MediaObjects.stat")(function* (objectKey) {
|
|
87
|
+
const output = yield* request("stat", (signal) => client.send(new HeadObjectCommand({
|
|
88
|
+
Bucket: bucket,
|
|
89
|
+
Key: key(objectKey)
|
|
90
|
+
}), { abortSignal: signal })).pipe(missingAsNull);
|
|
91
|
+
if (!output) return null;
|
|
92
|
+
if (output.ContentLength === void 0 || !output.ContentType) return yield* failure("stat", /* @__PURE__ */ new Error("S3 object metadata is incomplete."));
|
|
93
|
+
return {
|
|
94
|
+
key: objectKey,
|
|
95
|
+
byteSize: output.ContentLength,
|
|
96
|
+
mimeType: output.ContentType
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
return MediaObjects.of({
|
|
100
|
+
check: request("bucket.check", (signal) => client.send(new HeadBucketCommand({ Bucket: bucket }), { abortSignal: signal })).pipe(Effect.timeoutOrElse({
|
|
101
|
+
duration: "3 seconds",
|
|
102
|
+
orElse: () => Effect.fail(failure("bucket.check.timeout", /* @__PURE__ */ new Error("S3 bucket check timed out.")))
|
|
103
|
+
}), Effect.asVoid),
|
|
104
|
+
put: Effect.fn("S3MediaObjects.put")(function* (input) {
|
|
105
|
+
const file = yield* fs.stat(input.filePath).pipe(Effect.mapError((cause) => failure("put.stat", cause)));
|
|
106
|
+
if (ByteSize.toBigInt(file.size) !== BigInt(input.byteSize)) return yield* failure("put.size", /* @__PURE__ */ new Error("The upload size changed before storage."));
|
|
107
|
+
const error = yield* Effect.gen(function* () {
|
|
108
|
+
const upload = yield* openUpload(fs, input.filePath);
|
|
109
|
+
yield* Effect.gen(function* () {
|
|
110
|
+
yield* request("put", (signal) => client.send(new PutObjectCommand({
|
|
111
|
+
Bucket: bucket,
|
|
112
|
+
Key: key(input.key),
|
|
113
|
+
Body: upload.body,
|
|
114
|
+
ContentLength: input.byteSize,
|
|
115
|
+
ContentType: input.mimeType
|
|
116
|
+
}), { abortSignal: signal }));
|
|
117
|
+
const stored = yield* statObject(input.key);
|
|
118
|
+
if (!stored || stored.byteSize !== input.byteSize || stored.mimeType !== input.mimeType) return yield* failure("put.verify", /* @__PURE__ */ new Error("Stored object metadata does not match the upload."));
|
|
119
|
+
}).pipe(Effect.raceFirst(Deferred.await(upload.error)));
|
|
120
|
+
return upload.error;
|
|
121
|
+
}).pipe(Effect.scoped);
|
|
122
|
+
yield* Effect.transposeOption(yield* Deferred.poll(error));
|
|
123
|
+
}),
|
|
124
|
+
read: Effect.fn("S3MediaObjects.read")(function* (objectKey, range) {
|
|
125
|
+
const output = yield* request("read", (signal) => client.send(new GetObjectCommand({
|
|
126
|
+
Bucket: bucket,
|
|
127
|
+
Key: key(objectKey),
|
|
128
|
+
Range: range ? `bytes=${range.start}-${range.end}` : void 0
|
|
129
|
+
}), { abortSignal: signal })).pipe(missingAsNull);
|
|
130
|
+
if (!output) return null;
|
|
131
|
+
if (!output.Body) return yield* failure("read", /* @__PURE__ */ new Error("S3 returned an empty response body."));
|
|
132
|
+
const body = output.Body;
|
|
133
|
+
const stream = yield* Effect.try({
|
|
134
|
+
try: () => body.transformToWebStream(),
|
|
135
|
+
catch: (cause) => failure("read", cause)
|
|
136
|
+
}).pipe(Effect.onError(() => Effect.sync(() => {
|
|
137
|
+
if (body instanceof Readable) body.destroy();
|
|
138
|
+
})));
|
|
139
|
+
if (range && (output.ContentLength !== range.end - range.start + 1 || !output.ContentRange?.startsWith(`bytes ${range.start}-${range.end}/`))) {
|
|
140
|
+
yield* Effect.tryPromise({
|
|
141
|
+
try: () => stream.cancel(),
|
|
142
|
+
catch: (cause) => failure("read.cleanup", cause)
|
|
143
|
+
}).pipe(Effect.ignore);
|
|
144
|
+
return yield* failure("read.range", /* @__PURE__ */ new Error("S3 returned a different byte range."));
|
|
145
|
+
}
|
|
146
|
+
return stream;
|
|
147
|
+
}),
|
|
148
|
+
stat: statObject,
|
|
149
|
+
remove: Effect.fn("S3MediaObjects.remove")(function* (objectKey) {
|
|
150
|
+
yield* request("remove", (signal) => client.send(new DeleteObjectCommand({
|
|
151
|
+
Bucket: bucket,
|
|
152
|
+
Key: key(objectKey)
|
|
153
|
+
}), { abortSignal: signal }));
|
|
154
|
+
}),
|
|
155
|
+
list: Effect.fn("S3MediaObjects.list")(function* (objectPrefix, cursor) {
|
|
156
|
+
const listPrefix = yield* Effect.try({
|
|
157
|
+
try: () => physicalPrefix(prefix, objectPrefix),
|
|
158
|
+
catch: (cause) => failure("list.key", cause)
|
|
159
|
+
});
|
|
160
|
+
const output = yield* request("list", (signal) => client.send(new ListObjectsV2Command({
|
|
161
|
+
Bucket: bucket,
|
|
162
|
+
Prefix: listPrefix,
|
|
163
|
+
ContinuationToken: cursor
|
|
164
|
+
}), { abortSignal: signal }));
|
|
165
|
+
return {
|
|
166
|
+
objects: (output.Contents ?? []).flatMap((entry) => {
|
|
167
|
+
const objectKey = entry.Key === void 0 ? void 0 : relativeKey(prefix, entry.Key);
|
|
168
|
+
return objectKey === void 0 || entry.Size === void 0 ? [] : [{
|
|
169
|
+
key: objectKey,
|
|
170
|
+
byteSize: entry.Size
|
|
171
|
+
}];
|
|
172
|
+
}),
|
|
173
|
+
nextCursor: output.NextContinuationToken
|
|
174
|
+
};
|
|
175
|
+
})
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region ../s3/src/S3MediaObjects.ts
|
|
180
|
+
const layerNoDeps = (options) => Layer.effect(MediaObjects, Effect.gen(function* () {
|
|
181
|
+
const valid = yield* validateOptions(options);
|
|
182
|
+
const fs = yield* FileSystem.FileSystem;
|
|
183
|
+
return make(yield* Effect.acquireRelease(Effect.sync(() => new S3Client({
|
|
184
|
+
region: valid.region,
|
|
185
|
+
endpoint: valid.endpoint,
|
|
186
|
+
forcePathStyle: valid.forcePathStyle,
|
|
187
|
+
credentials: valid.credentials,
|
|
188
|
+
requestChecksumCalculation: "WHEN_REQUIRED"
|
|
189
|
+
})), (opened) => Effect.sync(() => opened.destroy())), valid, fs);
|
|
190
|
+
}));
|
|
191
|
+
const layer = (options) => layerNoDeps(options).pipe(Layer.provide(NodeFileSystem.layer));
|
|
192
|
+
//#endregion
|
|
193
|
+
export { MediaObjects as n, MediaStorageError as r, layer as t };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import "./Media-BQ0uL4w7.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
//#region ../model/src/Seo.d.ts
|
|
4
|
+
declare const SiteSeoSettings: Schema.Struct<{
|
|
5
|
+
readonly siteName: Schema.String;
|
|
6
|
+
readonly canonicalOrigin: Schema.String;
|
|
7
|
+
readonly defaultDescription: Schema.optionalKey<Schema.String>;
|
|
8
|
+
readonly titleTemplate: Schema.optionalKey<Schema.String>;
|
|
9
|
+
readonly socialTitle: Schema.optionalKey<Schema.String>;
|
|
10
|
+
readonly socialDescription: Schema.optionalKey<Schema.String>;
|
|
11
|
+
readonly socialImage: Schema.optionalKey<Schema.Struct<{
|
|
12
|
+
readonly mediaId: Schema.brand<Schema.String, "MediaId">;
|
|
13
|
+
readonly alt: Schema.String;
|
|
14
|
+
}>>;
|
|
15
|
+
readonly index: Schema.Boolean;
|
|
16
|
+
readonly follow: Schema.Boolean;
|
|
17
|
+
readonly identity: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
18
|
+
readonly image: Schema.optionalKey<Schema.Struct<{
|
|
19
|
+
readonly mediaId: Schema.brand<Schema.String, "MediaId">;
|
|
20
|
+
readonly alt: Schema.String;
|
|
21
|
+
}>>;
|
|
22
|
+
readonly name: Schema.String;
|
|
23
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
24
|
+
readonly type: Schema.Literal<"Person">;
|
|
25
|
+
}>, Schema.Struct<{
|
|
26
|
+
readonly logo: Schema.optionalKey<Schema.Struct<{
|
|
27
|
+
readonly mediaId: Schema.brand<Schema.String, "MediaId">;
|
|
28
|
+
readonly alt: Schema.String;
|
|
29
|
+
}>>;
|
|
30
|
+
readonly name: Schema.String;
|
|
31
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
32
|
+
readonly type: Schema.Literal<"Organization">;
|
|
33
|
+
}>, Schema.Struct<{
|
|
34
|
+
readonly logo: Schema.optionalKey<Schema.Struct<{
|
|
35
|
+
readonly mediaId: Schema.brand<Schema.String, "MediaId">;
|
|
36
|
+
readonly alt: Schema.String;
|
|
37
|
+
}>>;
|
|
38
|
+
readonly image: Schema.optionalKey<Schema.Struct<{
|
|
39
|
+
readonly mediaId: Schema.brand<Schema.String, "MediaId">;
|
|
40
|
+
readonly alt: Schema.String;
|
|
41
|
+
}>>;
|
|
42
|
+
readonly telephone: Schema.optionalKey<Schema.String>;
|
|
43
|
+
readonly address: Schema.optionalKey<Schema.Struct<{
|
|
44
|
+
readonly streetAddress: Schema.optionalKey<Schema.String>;
|
|
45
|
+
readonly addressLocality: Schema.optionalKey<Schema.String>;
|
|
46
|
+
readonly addressRegion: Schema.optionalKey<Schema.String>;
|
|
47
|
+
readonly postalCode: Schema.optionalKey<Schema.String>;
|
|
48
|
+
readonly addressCountry: Schema.optionalKey<Schema.String>;
|
|
49
|
+
}>>;
|
|
50
|
+
readonly name: Schema.String;
|
|
51
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
52
|
+
readonly type: Schema.Literal<"LocalBusiness">;
|
|
53
|
+
}>]>>;
|
|
54
|
+
}>;
|
|
55
|
+
interface SiteSeoSettings extends Schema.Schema.Type<typeof SiteSeoSettings> {}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { SiteSeoSettings as t };
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { i as MediaId } from "./Media-DSyvd14o.js";
|
|
2
|
+
import { Predicate, Schema } from "effect";
|
|
3
|
+
//#region ../model/src/internal/canonicalContent.ts
|
|
4
|
+
/** Stable JSON bytes that preserve array order and ignore object property order. */
|
|
5
|
+
function canonicalContent(value) {
|
|
6
|
+
if (Array.isArray(value)) return `[${value.map(canonicalContent).join(",")}]`;
|
|
7
|
+
if (isObject(value)) return `{${Object.entries(value).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, item]) => `${JSON.stringify(key)}:${canonicalContent(item)}`).join(",")}}`;
|
|
8
|
+
return JSON.stringify(value) ?? "null";
|
|
9
|
+
}
|
|
10
|
+
/** The caller already supplies JSON, so only its representation needs narrowing. */
|
|
11
|
+
function isObject(value) {
|
|
12
|
+
return Predicate.isObject(value);
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region ../model/src/ValidationIssue.ts
|
|
16
|
+
const IssuePath = Schema.Array(Schema.Union([Schema.String, Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))]));
|
|
17
|
+
const IssueLocation = Schema.Union([
|
|
18
|
+
Schema.Struct({
|
|
19
|
+
kind: Schema.Literal("field"),
|
|
20
|
+
path: IssuePath
|
|
21
|
+
}),
|
|
22
|
+
Schema.Struct({
|
|
23
|
+
kind: Schema.Literal("block"),
|
|
24
|
+
blockId: Schema.optionalKey(Schema.String),
|
|
25
|
+
path: IssuePath
|
|
26
|
+
}),
|
|
27
|
+
Schema.Struct({
|
|
28
|
+
kind: Schema.Literal("seo"),
|
|
29
|
+
path: IssuePath
|
|
30
|
+
}),
|
|
31
|
+
Schema.Struct({ kind: Schema.Literal("placement") }),
|
|
32
|
+
Schema.Struct({
|
|
33
|
+
kind: Schema.Literal("body"),
|
|
34
|
+
path: Schema.optionalKey(IssuePath)
|
|
35
|
+
}),
|
|
36
|
+
Schema.Struct({ kind: Schema.Literal("document") })
|
|
37
|
+
]);
|
|
38
|
+
const ValidationIssue = Schema.Struct({
|
|
39
|
+
code: Schema.String,
|
|
40
|
+
location: IssueLocation,
|
|
41
|
+
message: Schema.String,
|
|
42
|
+
details: Schema.optionalKey(Schema.JsonObject),
|
|
43
|
+
locale: Schema.optionalKey(Schema.String)
|
|
44
|
+
});
|
|
45
|
+
function issue(code, location, message, details) {
|
|
46
|
+
return details === void 0 ? {
|
|
47
|
+
code,
|
|
48
|
+
location,
|
|
49
|
+
message
|
|
50
|
+
} : {
|
|
51
|
+
code,
|
|
52
|
+
location,
|
|
53
|
+
message,
|
|
54
|
+
details
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** Presentation text is never an identity or compatibility key. */
|
|
58
|
+
function issueKey(value) {
|
|
59
|
+
const details = value.details === void 0 ? null : Object.fromEntries(Object.entries(value.details).filter(([key]) => key !== "label"));
|
|
60
|
+
return canonicalContent([
|
|
61
|
+
value.code,
|
|
62
|
+
value.location,
|
|
63
|
+
details,
|
|
64
|
+
value.locale ?? null
|
|
65
|
+
]);
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region ../model/src/internal/calendarDate.ts
|
|
69
|
+
/** Accept only real calendar dates in the shared authored YYYY-MM-DD representation. */
|
|
70
|
+
function isCalendarDate(value) {
|
|
71
|
+
if (!/^\d{4}-\d{2}-\d{2}$/u.test(value)) return false;
|
|
72
|
+
const date = /* @__PURE__ */ new Date(`${value}T00:00:00.000Z`);
|
|
73
|
+
return Number.isFinite(date.getTime()) && date.toISOString().slice(0, 10) === value;
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region ../model/src/Seo.ts
|
|
77
|
+
/** Installation and initial SEO addresses share one normalized HTTP origin contract. */
|
|
78
|
+
const SiteOrigin = Schema.String.check(Schema.makeFilter(isCanonicalOrigin, { message: "Use an HTTP or HTTPS origin without credentials, a path, query, or fragment." }));
|
|
79
|
+
const SeoImage = Schema.Struct({
|
|
80
|
+
mediaId: MediaId,
|
|
81
|
+
alt: Schema.String
|
|
82
|
+
});
|
|
83
|
+
const DocumentStructuredData = Schema.Union([Schema.Struct({ type: Schema.Literal("WebPage") }), Schema.Struct({
|
|
84
|
+
type: Schema.Literal("Article"),
|
|
85
|
+
headline: Schema.optionalKey(Schema.String),
|
|
86
|
+
datePublished: Schema.optionalKey(Schema.String),
|
|
87
|
+
dateModified: Schema.optionalKey(Schema.String)
|
|
88
|
+
})]);
|
|
89
|
+
/** Page overrides are optional; omitted values inherit the published site settings. */
|
|
90
|
+
const DocumentSeo = Schema.Struct({
|
|
91
|
+
title: Schema.optionalKey(Schema.String),
|
|
92
|
+
description: Schema.optionalKey(Schema.String),
|
|
93
|
+
socialTitle: Schema.optionalKey(Schema.String),
|
|
94
|
+
socialDescription: Schema.optionalKey(Schema.String),
|
|
95
|
+
socialImage: Schema.optionalKey(SeoImage),
|
|
96
|
+
index: Schema.optionalKey(Schema.Boolean),
|
|
97
|
+
follow: Schema.optionalKey(Schema.Boolean),
|
|
98
|
+
canonicalUrl: Schema.optionalKey(Schema.String),
|
|
99
|
+
structuredData: Schema.optionalKey(DocumentStructuredData)
|
|
100
|
+
});
|
|
101
|
+
const identityFields = {
|
|
102
|
+
name: Schema.String,
|
|
103
|
+
url: Schema.optionalKey(Schema.String)
|
|
104
|
+
};
|
|
105
|
+
const SiteIdentity = Schema.Union([
|
|
106
|
+
Schema.Struct({
|
|
107
|
+
type: Schema.Literal("Person"),
|
|
108
|
+
...identityFields,
|
|
109
|
+
image: Schema.optionalKey(SeoImage)
|
|
110
|
+
}),
|
|
111
|
+
Schema.Struct({
|
|
112
|
+
type: Schema.Literal("Organization"),
|
|
113
|
+
...identityFields,
|
|
114
|
+
logo: Schema.optionalKey(SeoImage)
|
|
115
|
+
}),
|
|
116
|
+
Schema.Struct({
|
|
117
|
+
type: Schema.Literal("LocalBusiness"),
|
|
118
|
+
...identityFields,
|
|
119
|
+
logo: Schema.optionalKey(SeoImage),
|
|
120
|
+
image: Schema.optionalKey(SeoImage),
|
|
121
|
+
telephone: Schema.optionalKey(Schema.String),
|
|
122
|
+
address: Schema.optionalKey(Schema.Struct({
|
|
123
|
+
streetAddress: Schema.optionalKey(Schema.String),
|
|
124
|
+
addressLocality: Schema.optionalKey(Schema.String),
|
|
125
|
+
addressRegion: Schema.optionalKey(Schema.String),
|
|
126
|
+
postalCode: Schema.optionalKey(Schema.String),
|
|
127
|
+
addressCountry: Schema.optionalKey(Schema.String)
|
|
128
|
+
}))
|
|
129
|
+
})
|
|
130
|
+
]);
|
|
131
|
+
const SiteSeoSettings = Schema.Struct({
|
|
132
|
+
siteName: Schema.String,
|
|
133
|
+
canonicalOrigin: Schema.String,
|
|
134
|
+
defaultDescription: Schema.optionalKey(Schema.String),
|
|
135
|
+
titleTemplate: Schema.optionalKey(Schema.String),
|
|
136
|
+
socialTitle: Schema.optionalKey(Schema.String),
|
|
137
|
+
socialDescription: Schema.optionalKey(Schema.String),
|
|
138
|
+
socialImage: Schema.optionalKey(SeoImage),
|
|
139
|
+
index: Schema.Boolean,
|
|
140
|
+
follow: Schema.Boolean,
|
|
141
|
+
identity: Schema.optionalKey(SiteIdentity)
|
|
142
|
+
});
|
|
143
|
+
const SiteSeoRevision = Schema.Struct({
|
|
144
|
+
version: Schema.String.check(Schema.isUUID()),
|
|
145
|
+
settings: SiteSeoSettings,
|
|
146
|
+
editedBy: Schema.String,
|
|
147
|
+
editedAt: Schema.String
|
|
148
|
+
});
|
|
149
|
+
const SiteSeoState = Schema.Struct({
|
|
150
|
+
working: SiteSeoRevision,
|
|
151
|
+
published: SiteSeoRevision
|
|
152
|
+
});
|
|
153
|
+
function resolveDocumentSeo(input) {
|
|
154
|
+
const { fields, path, page, site } = input;
|
|
155
|
+
const pageTitle = Schema.is(Schema.String)(fields.title) ? fields.title : site.siteName;
|
|
156
|
+
const title = site.titleTemplate?.replaceAll("%s", page?.title ?? pageTitle) ?? page?.title ?? pageTitle;
|
|
157
|
+
const fieldDescription = Schema.is(Schema.String)(fields.summary) ? fields.summary : void 0;
|
|
158
|
+
const description = page?.description ?? fieldDescription ?? site.defaultDescription;
|
|
159
|
+
return {
|
|
160
|
+
title,
|
|
161
|
+
...description ? { description } : void 0,
|
|
162
|
+
socialTitle: page?.socialTitle ?? site.socialTitle ?? title,
|
|
163
|
+
...page?.socialDescription ?? site.socialDescription ?? description ? { socialDescription: page?.socialDescription ?? site.socialDescription ?? description } : void 0,
|
|
164
|
+
...page?.socialImage ?? site.socialImage ? { socialImage: page?.socialImage ?? site.socialImage } : void 0,
|
|
165
|
+
canonicalUrl: page?.canonicalUrl ?? new URL(path, `${site.canonicalOrigin}/`).href,
|
|
166
|
+
index: site.index && (page?.index ?? true),
|
|
167
|
+
follow: site.follow && (page?.follow ?? true),
|
|
168
|
+
structuredData: page?.structuredData ?? { type: "WebPage" },
|
|
169
|
+
...site.identity ? { identity: site.identity } : void 0
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function inspectDocumentSeo(seo) {
|
|
173
|
+
if (!seo) return [];
|
|
174
|
+
const issues = [];
|
|
175
|
+
const problem = (code, path, message) => issue(code, {
|
|
176
|
+
kind: "seo",
|
|
177
|
+
path
|
|
178
|
+
}, message);
|
|
179
|
+
for (const key of [
|
|
180
|
+
"title",
|
|
181
|
+
"description",
|
|
182
|
+
"socialTitle",
|
|
183
|
+
"socialDescription"
|
|
184
|
+
]) if (seo[key] !== void 0 && !seo[key]?.trim()) issues.push(problem("seo.empty", [key], `${key} cannot be empty.`));
|
|
185
|
+
if (seo.canonicalUrl !== void 0 && !isHttpUrl(seo.canonicalUrl)) issues.push(problem("seo.url", ["canonicalUrl"], "Preferred page address needs a complete HTTP or HTTPS URL."));
|
|
186
|
+
if (seo.socialImage && !seo.socialImage.alt.trim()) issues.push(problem("seo.required", ["socialImage", "alt"], "Shared image needs a description."));
|
|
187
|
+
if (seo.structuredData?.type === "Article") {
|
|
188
|
+
if (seo.structuredData.headline !== void 0 && !seo.structuredData.headline.trim()) issues.push(problem("seo.empty", ["structuredData", "headline"], "Article headline cannot be empty."));
|
|
189
|
+
for (const key of ["datePublished", "dateModified"]) {
|
|
190
|
+
const value = seo.structuredData[key];
|
|
191
|
+
if (value !== void 0 && !isCalendarDate(value)) issues.push(problem("seo.date", ["structuredData", key], `${key} needs a valid calendar date.`));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return issues;
|
|
195
|
+
}
|
|
196
|
+
function inspectSiteSeo(settings) {
|
|
197
|
+
const issues = [];
|
|
198
|
+
const problem = (code, path, message) => issue(code, {
|
|
199
|
+
kind: "seo",
|
|
200
|
+
path
|
|
201
|
+
}, message);
|
|
202
|
+
if (!settings.siteName.trim()) issues.push(problem("seo.siteName", ["siteName"], "Website name is required."));
|
|
203
|
+
if (!isCanonicalOrigin(settings.canonicalOrigin)) issues.push(problem("seo.canonicalOrigin", ["canonicalOrigin"], "Website address needs an HTTP or HTTPS origin."));
|
|
204
|
+
if (settings.titleTemplate !== void 0 && !settings.titleTemplate.includes("%s")) issues.push(problem("seo.titleTemplate", ["titleTemplate"], "Title template needs %s."));
|
|
205
|
+
for (const key of [
|
|
206
|
+
"defaultDescription",
|
|
207
|
+
"socialTitle",
|
|
208
|
+
"socialDescription"
|
|
209
|
+
]) if (settings[key] !== void 0 && !settings[key]?.trim()) issues.push(problem("seo.empty", [key], `${key} cannot be empty.`));
|
|
210
|
+
if (settings.socialImage && !settings.socialImage.alt.trim()) issues.push(problem("seo.required", ["socialImage", "alt"], "Default shared image needs a description."));
|
|
211
|
+
if (settings.identity) {
|
|
212
|
+
if (!settings.identity.name.trim()) issues.push(problem("seo.required", ["identity", "name"], "Website identity needs a name."));
|
|
213
|
+
if (settings.identity.url !== void 0 && !isHttpUrl(settings.identity.url)) issues.push(problem("seo.url", ["identity", "url"], "Website identity needs a complete HTTP or HTTPS URL."));
|
|
214
|
+
if ("image" in settings.identity && settings.identity.image && !settings.identity.image.alt.trim()) issues.push(problem("seo.required", [
|
|
215
|
+
"identity",
|
|
216
|
+
"image",
|
|
217
|
+
"alt"
|
|
218
|
+
], "Website identity image needs a description."));
|
|
219
|
+
if ("logo" in settings.identity && settings.identity.logo && !settings.identity.logo.alt.trim()) issues.push(problem("seo.required", [
|
|
220
|
+
"identity",
|
|
221
|
+
"logo",
|
|
222
|
+
"alt"
|
|
223
|
+
], "Website identity logo needs a description."));
|
|
224
|
+
}
|
|
225
|
+
return issues;
|
|
226
|
+
}
|
|
227
|
+
function siteSeoIssues(settings) {
|
|
228
|
+
return inspectSiteSeo(settings).map((issue) => issue.message);
|
|
229
|
+
}
|
|
230
|
+
function documentSeoMediaIds(seo) {
|
|
231
|
+
return seo?.socialImage ? [seo.socialImage.mediaId] : [];
|
|
232
|
+
}
|
|
233
|
+
function siteSeoMediaIds(settings) {
|
|
234
|
+
return [
|
|
235
|
+
settings.socialImage,
|
|
236
|
+
settings.identity && "image" in settings.identity ? settings.identity.image : void 0,
|
|
237
|
+
settings.identity && "logo" in settings.identity ? settings.identity.logo : void 0
|
|
238
|
+
].flatMap((image) => image ? [image.mediaId] : []);
|
|
239
|
+
}
|
|
240
|
+
function isHttpUrl(value) {
|
|
241
|
+
try {
|
|
242
|
+
const url = new URL(value);
|
|
243
|
+
return (url.protocol === "http:" || url.protocol === "https:") && !!url.hostname && !url.username && !url.password && value === value.trim();
|
|
244
|
+
} catch {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
function isCanonicalOrigin(value) {
|
|
249
|
+
if (!isHttpUrl(value)) return false;
|
|
250
|
+
const url = new URL(value);
|
|
251
|
+
return url.origin === value && url.pathname === "/" && !url.search && !url.hash;
|
|
252
|
+
}
|
|
253
|
+
//#endregion
|
|
254
|
+
export { canonicalContent as _, SiteSeoState as a, inspectSiteSeo as c, siteSeoMediaIds as d, isCalendarDate as f, issueKey as g, issue as h, SiteSeoSettings as i, resolveDocumentSeo as l, ValidationIssue as m, SiteOrigin as n, documentSeoMediaIds as o, IssuePath as p, SiteSeoRevision as r, inspectDocumentSeo as s, DocumentSeo as t, siteSeoIssues as u };
|