@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,2349 @@
|
|
|
1
|
+
import { en as e, m as t, t as n } from "./Button-BT3ztSPx.js";
|
|
2
|
+
import { Ct as r, Ft as i, It as a, K as o, Q as s, at as c, et as l, gt as u, jt as d, mt as f, no as p, on as m, st as h, tn as g } from "./Search-BEgCe9Aj.js";
|
|
3
|
+
import { A as _, D as v, E as y, M as b, T as x, _ as S, c as C, d as w, g as T, i as E, j as D, k as ee, n as O, r as k, v as A } from "./studioContext-I8HozGU1.js";
|
|
4
|
+
import { _ as j, g as M } from "./useApi-CUWMwLLw-B3Q3g2nf.js";
|
|
5
|
+
import { $r as N, $t as P, A as F, Ar as I, B as te, Ci as L, Cr as R, E as z, In as B, K as V, M as H, N as U, Nn as W, Or as G, Qt as ne, R as re, V as K, en as ie, fa as q, fr as ae, gn as J, hr as oe, k as Y, o as X, on as se, ra as Z, ui as Q, un as ce, ur as le, zn as ue } from "./runtime-core.esm-bundler-DKFA9Rep.js";
|
|
6
|
+
import { t as de } from "./Select-B50WZMW-.js";
|
|
7
|
+
import { n as fe } from "./overlay-DnqFLZTc.js";
|
|
8
|
+
import { t as pe } from "./DropdownMenu-CA9fB0uZ.js";
|
|
9
|
+
import { G as me, H as he, U as ge, V as _e, W as ve, _ as ye, a as be, at as xe, c as Se, i as Ce, n as we, nt as Te, o as Ee, pt as De, q as Oe, r as ke, rt as Ae, s as je, t as Me, v as Ne, y as Pe, z as Fe } from "./DocumentLocaleMenu-0EkkOr6_.js";
|
|
10
|
+
import { t as Ie } from "./FormField-CgM6l2Yn.js";
|
|
11
|
+
import { t as Le } from "./Tooltip-Bu15m_DB.js";
|
|
12
|
+
import { t as Re } from "./notifications-OKOLc40v.js";
|
|
13
|
+
import { r as ze } from "./leaveGuards-D22fTGgr.js";
|
|
14
|
+
import { t as Be } from "./english-Cs_Adu-u.js";
|
|
15
|
+
import { t as Ve } from "./Alert-D0D24z_a.js";
|
|
16
|
+
import { n as He } from "./useStudioNavigation-CLwtSYpb.js";
|
|
17
|
+
import { t as Ue } from "./Modal-D6hSvxHd.js";
|
|
18
|
+
import { n as We, t as Ge } from "./studioQueries-BR-9NT5F.js";
|
|
19
|
+
import { t as Ke } from "./StudioPage-ngEIDr5d.js";
|
|
20
|
+
import { n as qe, r as Je, t as Ye } from "./StudioPageToolbar-BwHnqyr6.js";
|
|
21
|
+
import { t as Xe } from "./Skeleton-COz8dcrw.js";
|
|
22
|
+
import { t as Ze } from "./useDocumentMessage-BAWvc38w.js";
|
|
23
|
+
import { t as Qe } from "./PublicationActionDialog-Cm_P0C3I.js";
|
|
24
|
+
import { t as $e } from "./useLinkCopy-CMjQteCy.js";
|
|
25
|
+
//#region ../model/src/RevisionChanges.ts
|
|
26
|
+
function et(e, t) {
|
|
27
|
+
let n = [];
|
|
28
|
+
tt(e.fields, t.fields, [], n), ot(e.body.content, t.body.content, [], n);
|
|
29
|
+
for (let r of /* @__PURE__ */ new Set([...Object.keys(e.translations ?? {}), ...Object.keys(t.translations ?? {})])) {
|
|
30
|
+
let i = e.translations?.[r], a = t.translations?.[r];
|
|
31
|
+
if (!i || !a) {
|
|
32
|
+
n.push({
|
|
33
|
+
...nt([], i ? "Translation" : void 0, a ? "Translation" : void 0),
|
|
34
|
+
locale: r,
|
|
35
|
+
label: "Translation"
|
|
36
|
+
});
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
let o = [];
|
|
40
|
+
tt(i.fields, a.fields, [], o), ot(i.body.content, a.body.content, [], o), n.push(...o.map((e) => ({
|
|
41
|
+
...e,
|
|
42
|
+
locale: r
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
return n;
|
|
46
|
+
}
|
|
47
|
+
function tt(e, t, n, r) {
|
|
48
|
+
for (let i of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) {
|
|
49
|
+
if (i === ":id") continue;
|
|
50
|
+
let a = e[i], o = t[i];
|
|
51
|
+
if (yt(a, o)) continue;
|
|
52
|
+
let s = [...n, i];
|
|
53
|
+
$(a) && $(o) && !("mediaId" in a || "kind" in a) ? tt(a, o, s, r) : r.push(nt(s, a, o));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function nt(e, t, n) {
|
|
57
|
+
return {
|
|
58
|
+
kind: "field",
|
|
59
|
+
section: "details",
|
|
60
|
+
path: e,
|
|
61
|
+
label: e.map(vt).join(" · "),
|
|
62
|
+
before: t,
|
|
63
|
+
after: n,
|
|
64
|
+
operation: t === void 0 ? "added" : n === void 0 ? "removed" : "edited"
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function rt(e) {
|
|
68
|
+
return $(e.attrs) && m(a)(e.attrs.id) ? e.attrs.id : void 0;
|
|
69
|
+
}
|
|
70
|
+
function it(e, t) {
|
|
71
|
+
let n = rt(e), r = rt(t);
|
|
72
|
+
return !n || !r || n === r;
|
|
73
|
+
}
|
|
74
|
+
function at(e) {
|
|
75
|
+
let t = /* @__PURE__ */ new Map();
|
|
76
|
+
for (let n of e) {
|
|
77
|
+
let e = rt(n);
|
|
78
|
+
e && t.set(e, (t.get(e) ?? 0) + 1);
|
|
79
|
+
}
|
|
80
|
+
let n = /* @__PURE__ */ new Map();
|
|
81
|
+
return e.forEach((e, r) => {
|
|
82
|
+
let i = rt(e);
|
|
83
|
+
i && t.get(i) === 1 && n.set(i, r);
|
|
84
|
+
}), n;
|
|
85
|
+
}
|
|
86
|
+
function ot(e, t, n, r) {
|
|
87
|
+
let i = st(e, t), o = ct(e, t, i), s = new Set(i.values());
|
|
88
|
+
t.forEach((t, s) => {
|
|
89
|
+
let c = i.get(s), l = c === void 0 ? void 0 : e[c], u = c !== void 0 && !o.has(s) && !!rt(t);
|
|
90
|
+
if (l && ht(l, t) && !u) return;
|
|
91
|
+
let d = [...n.map(vt), _t(t)].join(" · ");
|
|
92
|
+
if (l && !u && t.type === "cmsBlock" && yt(ft(l), ft(t)) && dt(l, t)) {
|
|
93
|
+
let e = gt(l), i = gt(t), o = new Set([...e, ...i].map((e) => $(e.attrs) && m(a)(e.attrs.name) ? e.attrs.name : ""));
|
|
94
|
+
for (let a of o) {
|
|
95
|
+
let o = e.find((e) => $(e.attrs) && e.attrs.name === a), s = i.find((e) => $(e.attrs) && e.attrs.name === a);
|
|
96
|
+
ot(o ? gt(o) : [], s ? gt(s) : [], [
|
|
97
|
+
...n,
|
|
98
|
+
ut(t),
|
|
99
|
+
a
|
|
100
|
+
], r);
|
|
101
|
+
}
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
let f = {
|
|
105
|
+
kind: "body",
|
|
106
|
+
section: "content",
|
|
107
|
+
path: n,
|
|
108
|
+
label: d,
|
|
109
|
+
operation: l ? u ? "moved" : "edited" : "added",
|
|
110
|
+
before: l,
|
|
111
|
+
after: t
|
|
112
|
+
};
|
|
113
|
+
r.push(u ? {
|
|
114
|
+
...f,
|
|
115
|
+
from: c + 1,
|
|
116
|
+
to: s + 1,
|
|
117
|
+
contentChanged: !ht(l, t)
|
|
118
|
+
} : f);
|
|
119
|
+
}), e.forEach((e, t) => {
|
|
120
|
+
s.has(t) || r.push({
|
|
121
|
+
kind: "body",
|
|
122
|
+
section: "content",
|
|
123
|
+
path: n,
|
|
124
|
+
label: [...n.map(vt), _t(e)].join(" · "),
|
|
125
|
+
operation: "removed",
|
|
126
|
+
before: e
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function st(e, t) {
|
|
131
|
+
let n = at(e), r = at(t), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
|
|
132
|
+
for (let [e, t] of n) {
|
|
133
|
+
let n = r.get(e);
|
|
134
|
+
n !== void 0 && (i.set(n, t), a.add(t));
|
|
135
|
+
}
|
|
136
|
+
let o = e.map(mt), s = t.map(mt), c = [];
|
|
137
|
+
t.forEach((n, r) => {
|
|
138
|
+
o[r] === s[r] && it(e[r], t[r]) && c.push([r, r]);
|
|
139
|
+
});
|
|
140
|
+
let l = e.length <= 300 && t.length <= 300 ? lt(e.length, t.length, (n, r) => o[n] === s[r] && it(e[n], t[r])) : c;
|
|
141
|
+
for (let [e, t] of l) !a.has(e) && !i.has(t) && (i.set(t, e), a.add(e));
|
|
142
|
+
let u = 0, d = 0, f = [e.length, t.length];
|
|
143
|
+
for (let [n, r] of [...l, f]) {
|
|
144
|
+
let o = e.map((e, t) => t).slice(u, n).filter((e) => !a.has(e)), s = t.map((e, t) => t).slice(d, r).filter((e) => !i.has(e));
|
|
145
|
+
for (let n = 0; n < Math.min(o.length, s.length); n++) {
|
|
146
|
+
let r = o[n], c = s[n];
|
|
147
|
+
it(e[r], t[c]) && (e[r].type === t[c].type || o.length === 1 && s.length === 1) && (i.set(c, r), a.add(r));
|
|
148
|
+
}
|
|
149
|
+
u = n + 1, d = r + 1;
|
|
150
|
+
}
|
|
151
|
+
return i;
|
|
152
|
+
}
|
|
153
|
+
function ct(e, t, n) {
|
|
154
|
+
let r = [...n].sort(([e], [t]) => e - t), i = /* @__PURE__ */ new Set(), a = [];
|
|
155
|
+
for (let n = 0; n < r.length; n++) {
|
|
156
|
+
let [i, o] = r[n], s = {
|
|
157
|
+
indices: [],
|
|
158
|
+
weight: 0
|
|
159
|
+
};
|
|
160
|
+
for (let e = 0; e < n; e++) r[e][1] < o && a[e].weight > s.weight && (s = a[e]);
|
|
161
|
+
a.push({
|
|
162
|
+
indices: [...s.indices, i],
|
|
163
|
+
weight: s.weight + r.length + 1 + +!!ht(e[o], t[i])
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
let o = a.reduce((e, t) => t.weight > e.weight ? t : e, {
|
|
167
|
+
indices: [],
|
|
168
|
+
weight: 0
|
|
169
|
+
});
|
|
170
|
+
for (let e of o.indices) i.add(e);
|
|
171
|
+
return i;
|
|
172
|
+
}
|
|
173
|
+
function lt(e, t, n) {
|
|
174
|
+
let r = Array.from({ length: e + 1 }, () => Array(t + 1).fill(0));
|
|
175
|
+
for (let i = e - 1; i >= 0; i--) for (let e = t - 1; e >= 0; e--) r[i][e] = n(i, e) ? r[i + 1][e + 1] + 1 : Math.max(r[i + 1][e], r[i][e + 1]);
|
|
176
|
+
let i = [], a = 0, o = 0;
|
|
177
|
+
for (; a < e && o < t;) n(a, o) ? i.push([a++, o++]) : r[a + 1][o] >= r[a][o + 1] ? a++ : o++;
|
|
178
|
+
return i;
|
|
179
|
+
}
|
|
180
|
+
function ut(e) {
|
|
181
|
+
return $(e.attrs) && m(a)(e.attrs.name) ? e.attrs.name : "Content block";
|
|
182
|
+
}
|
|
183
|
+
function dt(e, t) {
|
|
184
|
+
let n = gt(e), r = gt(t);
|
|
185
|
+
return n.length === r.length && n.every((e, t) => yt(ft(e), ft(r[t])));
|
|
186
|
+
}
|
|
187
|
+
function ft(e) {
|
|
188
|
+
return $(e.attrs) ? Object.fromEntries(Object.entries(e.attrs).filter(([e, t]) => e !== "id" && t !== null)) : {};
|
|
189
|
+
}
|
|
190
|
+
function pt(e) {
|
|
191
|
+
let t = ft(e);
|
|
192
|
+
return Object.fromEntries(Object.entries(e).flatMap(([e, n]) => e === "attrs" ? Object.keys(t).length ? [[e, t]] : [] : e === "content" && Array.isArray(n) ? [[e, n.map((e) => $(e) ? pt(e) : e)]] : [[e, n]]));
|
|
193
|
+
}
|
|
194
|
+
function mt(e) {
|
|
195
|
+
return c(pt(e));
|
|
196
|
+
}
|
|
197
|
+
function ht(e, t) {
|
|
198
|
+
return !!e && !!t && mt(e) === mt(t);
|
|
199
|
+
}
|
|
200
|
+
function gt(e) {
|
|
201
|
+
return Array.isArray(e.content) ? e.content.filter($) : [];
|
|
202
|
+
}
|
|
203
|
+
function _t(e) {
|
|
204
|
+
return e.type === "cmsBlock" && $(e.attrs) ? vt(m(a)(e.attrs.name) ? e.attrs.name : "Content block") : m(a)(e.type) ? Object.entries({
|
|
205
|
+
bulletList: "Bulleted list",
|
|
206
|
+
orderedList: "Numbered list",
|
|
207
|
+
codeBlock: "Code",
|
|
208
|
+
horizontalRule: "Divider",
|
|
209
|
+
blockquote: "Quote"
|
|
210
|
+
}).find(([t]) => t === e.type)?.[1] ?? vt(e.type) : "Content block";
|
|
211
|
+
}
|
|
212
|
+
function vt(e) {
|
|
213
|
+
return e.replace(/^:/u, "").replace(/[-_]/gu, " ").replace(/([a-z])([A-Z])/gu, "$1 $2").replace(/^./u, (e) => e.toUpperCase());
|
|
214
|
+
}
|
|
215
|
+
function $(e) {
|
|
216
|
+
return m(r)(e);
|
|
217
|
+
}
|
|
218
|
+
function yt(e, t) {
|
|
219
|
+
return e === void 0 || t === void 0 ? e === t : c(e) === c(t);
|
|
220
|
+
}
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/documents/history/revisionTextHighlights.ts
|
|
223
|
+
function bt(e, t) {
|
|
224
|
+
if (e === t) return [];
|
|
225
|
+
let n = [...e.matchAll(/\s+|[^\s]+/gu)], r = [...t.matchAll(/\s+|[^\s]+/gu)].map((e) => e[0]);
|
|
226
|
+
if (n.length > 500 || r.length > 500) {
|
|
227
|
+
let n = 0, r = e.length, i = t.length;
|
|
228
|
+
for (; n < r && n < i && e[n] === t[n];) n++;
|
|
229
|
+
for (; r > n && i > n && e[r - 1] === t[i - 1];) r--, i--;
|
|
230
|
+
return r > n ? [[n, r]] : [];
|
|
231
|
+
}
|
|
232
|
+
let i = Array.from({ length: n.length + 1 }, () => Array(r.length + 1).fill(0));
|
|
233
|
+
for (let e = n.length - 1; e >= 0; e--) for (let t = r.length - 1; t >= 0; t--) i[e][t] = n[e][0] === r[t] ? i[e + 1][t + 1] + 1 : Math.max(i[e + 1][t], i[e][t + 1]);
|
|
234
|
+
let a = /* @__PURE__ */ new Set(), o = 0, s = 0;
|
|
235
|
+
for (; o < n.length && s < r.length;) n[o][0] === r[s] ? (a.add(o++), s++) : i[o + 1][s] >= i[o][s + 1] ? o++ : s++;
|
|
236
|
+
return n.flatMap((e, t) => a.has(t) || !e[0].trim() ? [] : [[e.index, e.index + e[0].length]]);
|
|
237
|
+
}
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/documents/history/revisionComparisonEditor.ts
|
|
240
|
+
function xt(e, t, n) {
|
|
241
|
+
let r = t && t !== n ? e.source.translations?.[t] : void 0;
|
|
242
|
+
return {
|
|
243
|
+
content: r ?? e.source,
|
|
244
|
+
fallback: !!t && t !== n && !r,
|
|
245
|
+
locale: r ? t : n
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function St(e, t) {
|
|
249
|
+
function n(e) {
|
|
250
|
+
return Array.isArray(e) ? e.map((e) => n(e) ?? null) : m(r)(e) ? Object.fromEntries(Object.entries(e).filter(([e]) => e !== ":id").sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => [e, n(t) ?? null])) : e;
|
|
251
|
+
}
|
|
252
|
+
return JSON.stringify(n(e)) === JSON.stringify(n(t));
|
|
253
|
+
}
|
|
254
|
+
function Ct(e, t, n, i, o = Be, s = {
|
|
255
|
+
lang: "en",
|
|
256
|
+
dir: "ltr"
|
|
257
|
+
}) {
|
|
258
|
+
let c = i === "before" ? t : n, l = i === "after" ? t : n, u = c && l ? et({
|
|
259
|
+
format: 1,
|
|
260
|
+
fields: c.fields,
|
|
261
|
+
body: c.body
|
|
262
|
+
}, {
|
|
263
|
+
format: 1,
|
|
264
|
+
fields: l.fields,
|
|
265
|
+
body: l.body
|
|
266
|
+
}) : [], d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), p = [];
|
|
267
|
+
function h(e) {
|
|
268
|
+
return Array.isArray(e.content) ? e.content.filter(m(r)) : [];
|
|
269
|
+
}
|
|
270
|
+
function g(e, t, n) {
|
|
271
|
+
d.set(e, n);
|
|
272
|
+
let r = h(e);
|
|
273
|
+
t.forEach((e, i, a) => {
|
|
274
|
+
let o = r[a];
|
|
275
|
+
o && g(o, e, n + i + (t.type.name === "doc" ? 0 : 1));
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
g(t.body, e, 0);
|
|
279
|
+
let _ = /* @__PURE__ */ new Map();
|
|
280
|
+
function v(e) {
|
|
281
|
+
let t = m(r)(e.attrs) ? e.attrs.id : void 0;
|
|
282
|
+
m(a)(t) && _.set(t, e), h(e).forEach(v);
|
|
283
|
+
}
|
|
284
|
+
n && v(n.body);
|
|
285
|
+
for (let [e, t] of d) {
|
|
286
|
+
let n = m(r)(e.attrs) ? e.attrs.id : void 0;
|
|
287
|
+
m(a)(n) && _.has(n) && f.set(t, { counterpart: _.get(n) });
|
|
288
|
+
}
|
|
289
|
+
for (let t of u) {
|
|
290
|
+
if (t.kind !== "body") continue;
|
|
291
|
+
let n = i === "before" ? t.before : t.after, a = i === "before" ? t.after : t.before;
|
|
292
|
+
if (!m(r)(n)) continue;
|
|
293
|
+
let c = d.get(n);
|
|
294
|
+
if (c === void 0) continue;
|
|
295
|
+
let l = e.nodeAt(c);
|
|
296
|
+
if (!l) continue;
|
|
297
|
+
f.set(c, {
|
|
298
|
+
change: t,
|
|
299
|
+
counterpart: m(r)(a) ? a : void 0
|
|
300
|
+
});
|
|
301
|
+
let u = Tt(a), h = bt(l.textContent, u), g = 0;
|
|
302
|
+
l.descendants((e, t) => {
|
|
303
|
+
if (!e.isText) return;
|
|
304
|
+
let n = g + e.nodeSize;
|
|
305
|
+
for (let [e, r] of h) {
|
|
306
|
+
let a = Math.max(e, g), o = Math.min(r, n);
|
|
307
|
+
a < o && p.push(Te.inline(c + 1 + t + a - g, c + 1 + t + o - g, {
|
|
308
|
+
class: wt(i),
|
|
309
|
+
"data-history-diff": i === "before" ? "removed" : "added"
|
|
310
|
+
}, { revisionText: !0 }));
|
|
311
|
+
}
|
|
312
|
+
g = n;
|
|
313
|
+
});
|
|
314
|
+
let _ = t.operation === "added" || t.operation === "removed", v = !!a && l.textContent === u && t.operation !== "moved", y = t.operation === "moved" ? o(t.contentChanged ? "documents.history.movedUpdatedPosition" : "documents.history.movedPosition", {
|
|
315
|
+
from: t.from ?? "",
|
|
316
|
+
to: t.to ?? ""
|
|
317
|
+
}) : _ ? t.operation === "added" ? o("documents.history.added") : o("documents.history.removed") : v && n.type !== "cmsBlock" && n.type !== "image" && n.type !== "video" ? o("documents.history.formattingUpdated") : void 0;
|
|
318
|
+
(_ || v) && p.push(Te.node(c, c + l.nodeSize, {
|
|
319
|
+
class: _ ? i === "before" ? "bg-error/5" : "bg-success/5" : "bg-warning/5",
|
|
320
|
+
"data-history-node-change": _ ? t.operation : "updated"
|
|
321
|
+
})), y && p.push(Te.widget(c + l.nodeSize, () => {
|
|
322
|
+
let e = globalThis.document.createElement("span");
|
|
323
|
+
return e.className = "mb-3 block text-xs text-muted", e.textContent = y, e.contentEditable = "false", e.lang = s.lang, e.dir = s.dir, e;
|
|
324
|
+
}));
|
|
325
|
+
}
|
|
326
|
+
return {
|
|
327
|
+
nodes: f,
|
|
328
|
+
decorations: Ae.create(e, p)
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
function wt(e) {
|
|
332
|
+
return e === "before" ? "bg-error/10 text-error line-through decoration-error/50" : "bg-success/10 text-success underline decoration-success/40 underline-offset-4";
|
|
333
|
+
}
|
|
334
|
+
function Tt(e) {
|
|
335
|
+
return m(r)(e) ? m(a)(e.text) ? e.text : Array.isArray(e.content) ? e.content.map(Tt).join("") : "" : "";
|
|
336
|
+
}
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region src/documents/history/useRevisionReview.ts
|
|
339
|
+
function Et(e, t) {
|
|
340
|
+
let { t: n, date: r } = h(), i = O(), a = w().requests, o = Re(), s = z(() => i.user.role === "viewer"), c = z(() => i.items.find((t) => t.id === e.documentId)), l = z(() => c.value?.title ?? n("documents.history.document")), u = z(() => i.configuration.collections.find((e) => e.collection === c.value?.collection)?.label ?? c.value?.collection ?? n("documents.history.collection")), d = z(() => i.configuration.locales?.defaultLocale), f = Q(d.value), p = z(() => [.../* @__PURE__ */ new Set([
|
|
341
|
+
d.value,
|
|
342
|
+
...i.configuration.locales?.supported.map((e) => e.code) ?? [],
|
|
343
|
+
...Object.keys(x.value?.source.translations ?? {}),
|
|
344
|
+
...Object.keys(b.value?.source.translations ?? {})
|
|
345
|
+
])]), m = Q({ revisions: [] }), g = Q(), _ = Q(), v = We(() => g.value ? Ge.revisionSnapshot(e.documentId, g.value, e.documentVersion) : void 0, void 0), y = We(() => _.value ? Ge.revisionSnapshot(e.documentId, _.value, e.documentVersion) : void 0, void 0), b = z(() => v.loading.value || v.error.value ? null : v.data.value ?? null), x = z(() => y.loading.value || y.error.value ? null : y.data.value ?? null), T = Q(!0), D = v.loading, ee = y.loading, k = Q(!1), j = Q(!1), M = Q(), P = Q(), F = z(() => {
|
|
346
|
+
let e = P.value, t = ne.value;
|
|
347
|
+
return e ? t ? n("documents.history.publishReplacement", {
|
|
348
|
+
liveNumber: t.number,
|
|
349
|
+
number: e.number,
|
|
350
|
+
title: l.value
|
|
351
|
+
}) : n("documents.history.publishFirst", {
|
|
352
|
+
number: e.number,
|
|
353
|
+
title: l.value
|
|
354
|
+
}) : "";
|
|
355
|
+
}), I = Ze(), te = I.message, L = z(() => te.value || v.error.value || y.error.value), B = 0, V = !1, H = z(() => j.value || !!P.value), U = z(() => m.value.revisions.find((e) => e.revisionId === g.value)), W = z(() => m.value.revisions.find((e) => e.revisionId === _.value)), G = z(() => U.value?.isPublished ?? !1), ne = z(() => m.value.revisions.find((e) => e.isPublished)), re = z(() => [[{
|
|
356
|
+
label: n("documents.history.openEditor"),
|
|
357
|
+
icon: "i-lucide-pencil",
|
|
358
|
+
onSelect: () => t.close()
|
|
359
|
+
}, {
|
|
360
|
+
label: n("documents.history.allVersionHistory"),
|
|
361
|
+
icon: "i-lucide-history",
|
|
362
|
+
to: { name: "versions" }
|
|
363
|
+
}]]);
|
|
364
|
+
function K(t) {
|
|
365
|
+
let r = t.revisionId === e.latestRevisionId ? t.isPublished ? "documents.history.latestLiveVersion" : "documents.history.latestVersion" : t.isPublished ? "documents.history.liveVersion" : "documents.history.version";
|
|
366
|
+
return n(r, { number: t.number });
|
|
367
|
+
}
|
|
368
|
+
let ie = z(() => m.value.revisions.map((e) => ({
|
|
369
|
+
value: e.revisionId,
|
|
370
|
+
label: K(e),
|
|
371
|
+
description: `${r(e.createdAt, {
|
|
372
|
+
dateStyle: "medium",
|
|
373
|
+
timeStyle: "short"
|
|
374
|
+
})} · ${e.authorName ?? n("documents.history.unknownAuthor")}`
|
|
375
|
+
}))), q = z(() => ie.value.filter((e) => e.value !== g.value)), ae = z(() => {
|
|
376
|
+
let e = b.value;
|
|
377
|
+
if (!e) return;
|
|
378
|
+
let t = i.configuration.locales?.supported.some((e) => e.code === f.value), n = f.value && f.value !== d.value && e.source.translations?.[f.value];
|
|
379
|
+
return t || n ? f.value : void 0;
|
|
380
|
+
}), J = z(() => b.value ? A(S, e.documentId, b.value.revisionId, ae.value) : void 0), oe = z(() => [ie.value.map((e) => ({
|
|
381
|
+
label: e.label,
|
|
382
|
+
description: e.description,
|
|
383
|
+
icon: e.value === g.value ? "i-lucide-check" : void 0,
|
|
384
|
+
disabled: H.value,
|
|
385
|
+
onSelect: () => Z(e.value)
|
|
386
|
+
})), ...m.value.nextBefore ? [[{
|
|
387
|
+
label: n("documents.history.loadOlderVersions"),
|
|
388
|
+
disabled: k.value,
|
|
389
|
+
onSelect: () => void X(m.value.nextBefore)
|
|
390
|
+
}]] : []]), Y = z(() => [{
|
|
391
|
+
name: "baseline",
|
|
392
|
+
label: n("documents.history.baselineSavedContent"),
|
|
393
|
+
side: "before",
|
|
394
|
+
revision: x.value,
|
|
395
|
+
counterpart: b.value ?? void 0,
|
|
396
|
+
summary: W.value,
|
|
397
|
+
loading: ee.value
|
|
398
|
+
}, {
|
|
399
|
+
name: "reviewed",
|
|
400
|
+
label: n("documents.history.reviewedSavedContent"),
|
|
401
|
+
side: "after",
|
|
402
|
+
revision: b.value,
|
|
403
|
+
counterpart: x.value ?? void 0,
|
|
404
|
+
summary: U.value,
|
|
405
|
+
loading: D.value
|
|
406
|
+
}].map((e) => ({
|
|
407
|
+
...e,
|
|
408
|
+
fallback: e.revision ? xt(e.revision, f.value, d.value).fallback : !1
|
|
409
|
+
})));
|
|
410
|
+
ze(async () => !H.value), ce(() => void se()), N(() => {
|
|
411
|
+
V = !0, B++;
|
|
412
|
+
}), R(() => [e.latestRevisionId, e.documentVersion], async () => {
|
|
413
|
+
await X(), !V && g.value && Z(g.value);
|
|
414
|
+
});
|
|
415
|
+
async function X(t) {
|
|
416
|
+
if (t !== void 0 && k.value) return;
|
|
417
|
+
let r = ++B;
|
|
418
|
+
t === void 0 ? T.value = !0 : k.value = !0;
|
|
419
|
+
try {
|
|
420
|
+
let n = await a.documents.revisions({
|
|
421
|
+
params: { documentId: e.documentId },
|
|
422
|
+
query: { before: t }
|
|
423
|
+
});
|
|
424
|
+
if (t === void 0) for (; n.nextBefore && [g.value, _.value].some((e) => e && !n.revisions.some((t) => t.revisionId === e));) {
|
|
425
|
+
if (r !== B) return;
|
|
426
|
+
let t = await a.documents.revisions({
|
|
427
|
+
params: { documentId: e.documentId },
|
|
428
|
+
query: { before: n.nextBefore }
|
|
429
|
+
});
|
|
430
|
+
n = {
|
|
431
|
+
revisions: [...n.revisions, ...t.revisions],
|
|
432
|
+
nextBefore: t.nextBefore
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
if (r !== B) return;
|
|
436
|
+
m.value = t === void 0 ? n : {
|
|
437
|
+
revisions: [...m.value.revisions, ...n.revisions.filter((e) => !m.value.revisions.some((t) => t.revisionId === e.revisionId))],
|
|
438
|
+
nextBefore: n.nextBefore
|
|
439
|
+
};
|
|
440
|
+
} catch (e) {
|
|
441
|
+
r === B && I.set(() => E(e, n, n("documents.history.couldNotLoadRevisionHistory")));
|
|
442
|
+
} finally {
|
|
443
|
+
r === B && (T.value = !1, k.value = !1);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
async function se() {
|
|
447
|
+
if (I.clear(), await X(), V || H.value) return;
|
|
448
|
+
let e = m.value.revisions[0];
|
|
449
|
+
e && (Z(e.revisionId), le(m.value.revisions[1]?.revisionId ?? e.revisionId), await Promise.allSettled([v.refresh(), y.refresh()]));
|
|
450
|
+
}
|
|
451
|
+
function Z(e) {
|
|
452
|
+
if (H.value) return;
|
|
453
|
+
let t = g.value;
|
|
454
|
+
if (g.value = e, _.value === e) {
|
|
455
|
+
let n = m.value.revisions.find((n) => n.revisionId === t && n.revisionId !== e) ?? m.value.revisions.find((t) => t.revisionId !== e);
|
|
456
|
+
n ? le(n.revisionId) : _.value = void 0;
|
|
457
|
+
}
|
|
458
|
+
M.value = void 0, I.clear();
|
|
459
|
+
}
|
|
460
|
+
function le(e) {
|
|
461
|
+
let t = m.value.revisions.find((t) => t.revisionId === e)?.revisionId;
|
|
462
|
+
t && t !== g.value && !H.value && (_.value = t);
|
|
463
|
+
}
|
|
464
|
+
function ue() {
|
|
465
|
+
!b.value || s.value || H.value || G.value || (P.value = b.value);
|
|
466
|
+
}
|
|
467
|
+
async function de(e) {
|
|
468
|
+
let r = P.value?.number ?? "";
|
|
469
|
+
await X(), !V && (P.value = void 0, o.add({ title: n(e ? "documents.history.publicationOfVersionNumberScheduled" : "documents.history.versionNumberIsNowLive", { number: r }) }), t.conflict());
|
|
470
|
+
}
|
|
471
|
+
async function fe() {
|
|
472
|
+
let r = M.value;
|
|
473
|
+
if (!(!r || s.value || j.value)) {
|
|
474
|
+
j.value = !0, I.clear();
|
|
475
|
+
try {
|
|
476
|
+
if (await a.documents.restore({
|
|
477
|
+
params: { documentId: e.documentId },
|
|
478
|
+
payload: {
|
|
479
|
+
expectedDocumentVersion: e.documentVersion,
|
|
480
|
+
sourceRevisionId: r.revisionId
|
|
481
|
+
}
|
|
482
|
+
}), V) return;
|
|
483
|
+
M.value = void 0, o.add({ title: n("documents.history.versionNumberOpenedAsWorkingEdits", { number: r.number }) }), t.close();
|
|
484
|
+
} catch (e) {
|
|
485
|
+
if (V) return;
|
|
486
|
+
M.value = void 0, e instanceof C && e.status === 409 ? (I.set(() => n("documents.history.aNewerSaveIsAvailableReviewIt")), t.conflict()) : I.set(() => E(e, n, n("documents.history.couldNotRestoreThisVersion")));
|
|
487
|
+
} finally {
|
|
488
|
+
V || (j.value = !1);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return {
|
|
493
|
+
studio: i,
|
|
494
|
+
readonly: s,
|
|
495
|
+
item: c,
|
|
496
|
+
pageTitle: l,
|
|
497
|
+
collectionLabel: u,
|
|
498
|
+
defaultLocale: d,
|
|
499
|
+
locale: f,
|
|
500
|
+
locales: p,
|
|
501
|
+
page: m,
|
|
502
|
+
selected: b,
|
|
503
|
+
selectedId: g,
|
|
504
|
+
baselineId: _,
|
|
505
|
+
loading: T,
|
|
506
|
+
loadingSelection: D,
|
|
507
|
+
loadingMore: k,
|
|
508
|
+
restoring: j,
|
|
509
|
+
restoreTarget: M,
|
|
510
|
+
publishTarget: P,
|
|
511
|
+
publicationDescription: F,
|
|
512
|
+
error: L,
|
|
513
|
+
busy: H,
|
|
514
|
+
selectedSummary: U,
|
|
515
|
+
baselineSummary: W,
|
|
516
|
+
isLive: G,
|
|
517
|
+
documentItems: re,
|
|
518
|
+
versionLabel: K,
|
|
519
|
+
baselineItems: q,
|
|
520
|
+
previewLocale: ae,
|
|
521
|
+
previewLocation: J,
|
|
522
|
+
rightItems: oe,
|
|
523
|
+
sides: Y,
|
|
524
|
+
reload: se,
|
|
525
|
+
load: X,
|
|
526
|
+
selectBaseline: le,
|
|
527
|
+
requestPublish: ue,
|
|
528
|
+
published: de,
|
|
529
|
+
restore: fe
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
//#endregion
|
|
533
|
+
//#region src/documents/history/RevisionValues.vue?vue&type=script&setup=true&lang.ts
|
|
534
|
+
var Dt = {
|
|
535
|
+
key: 0,
|
|
536
|
+
class: "space-y-3"
|
|
537
|
+
}, Ot = {
|
|
538
|
+
key: 0,
|
|
539
|
+
class: "grid h-full place-items-center gap-2 p-4 text-sm text-muted"
|
|
540
|
+
}, kt = ["src", "alt"], At = {
|
|
541
|
+
key: 0,
|
|
542
|
+
class: "grid gap-2 text-sm"
|
|
543
|
+
}, jt = { class: "flex flex-wrap gap-x-2" }, Mt = { class: "text-muted" }, Nt = {
|
|
544
|
+
key: 0,
|
|
545
|
+
class: "text-muted"
|
|
546
|
+
}, Pt = { class: "flex gap-2" }, Ft = { class: "text-muted" }, It = {
|
|
547
|
+
key: 0,
|
|
548
|
+
class: "flex gap-2"
|
|
549
|
+
}, Lt = { class: "text-muted" }, Rt = {
|
|
550
|
+
key: 1,
|
|
551
|
+
class: "flex gap-2"
|
|
552
|
+
}, zt = { class: "text-muted" }, Bt = {
|
|
553
|
+
key: 1,
|
|
554
|
+
class: "space-y-2"
|
|
555
|
+
}, Vt = {
|
|
556
|
+
key: 0,
|
|
557
|
+
class: "rounded-md bg-muted/40 p-4 text-sm text-muted"
|
|
558
|
+
}, Ht = ["src"], Ut = { class: "text-sm text-muted" }, Wt = {
|
|
559
|
+
key: 2,
|
|
560
|
+
class: "space-y-1"
|
|
561
|
+
}, Gt = { class: "text-sm text-highlighted" }, Kt = {
|
|
562
|
+
key: 0,
|
|
563
|
+
class: "wrap-break-word text-xs text-muted"
|
|
564
|
+
}, qt = {
|
|
565
|
+
key: 3,
|
|
566
|
+
class: "wrap-break-word text-sm text-highlighted"
|
|
567
|
+
}, Jt = {
|
|
568
|
+
key: 4,
|
|
569
|
+
class: "space-y-3"
|
|
570
|
+
}, Yt = {
|
|
571
|
+
key: 0,
|
|
572
|
+
class: "mb-2 text-xs text-muted"
|
|
573
|
+
}, Xt = {
|
|
574
|
+
key: 5,
|
|
575
|
+
class: "text-sm text-muted"
|
|
576
|
+
}, Zt = {
|
|
577
|
+
key: 6,
|
|
578
|
+
class: "space-y-4"
|
|
579
|
+
}, Qt = { class: "text-xs font-medium text-muted" }, $t = {
|
|
580
|
+
key: 7,
|
|
581
|
+
class: "text-sm text-muted"
|
|
582
|
+
}, en = {
|
|
583
|
+
key: 8,
|
|
584
|
+
class: "inline-flex items-center gap-2 text-sm text-highlighted"
|
|
585
|
+
}, tn = /* @__PURE__ */ V({
|
|
586
|
+
name: "RevisionValues",
|
|
587
|
+
__name: "RevisionValues",
|
|
588
|
+
props: {
|
|
589
|
+
value: {},
|
|
590
|
+
definition: {},
|
|
591
|
+
definitions: {},
|
|
592
|
+
pages: {}
|
|
593
|
+
},
|
|
594
|
+
setup(e) {
|
|
595
|
+
let { t: n, date: c, number: f } = h(), p = Ne(), g = e, v = Q(!1), y = z(() => m(x)(g.value) ? g.value : void 0), b = z(() => m(s)(g.value) ? g.value : void 0), S = z(() => m(r)(g.value) ? g.value : void 0), C = z(() => {
|
|
596
|
+
if (y.value) return o.make(y.value.mediaId);
|
|
597
|
+
if (b.value?.mediaKind === "image") return o.make(b.value.mediaId);
|
|
598
|
+
if (S.value && S.value.kind === void 0 && m(o)(S.value.mediaId)) return S.value.mediaId;
|
|
599
|
+
}), w = z(() => m(D)(g.value) ? g.value : void 0), T = z(() => {
|
|
600
|
+
let e = w.value?.kind === "document" ? w.value.documentId : g.definition?.kind === "document" && m(a)(g.value) ? g.value : void 0;
|
|
601
|
+
return e ? g.pages?.find((t) => t.id === e) : void 0;
|
|
602
|
+
}), E = z(() => g.definition?.kind === "object" || g.definition?.kind === "list" ? g.definition.fields : g.definitions), ee = z(() => S.value ? [.../* @__PURE__ */ new Set([...E.value?.map((e) => e.name) ?? [], ...Object.keys(S.value)])].flatMap((e) => {
|
|
603
|
+
if (e.startsWith(":") || e === "id" && E.value && !E.value.some((t) => t.name === e)) return [];
|
|
604
|
+
let t = E.value?.find((t) => t.name === e);
|
|
605
|
+
return [{
|
|
606
|
+
key: e,
|
|
607
|
+
label: t?.label ?? k(e),
|
|
608
|
+
value: S.value?.[e],
|
|
609
|
+
definition: t
|
|
610
|
+
}];
|
|
611
|
+
}) : []), O = z(() => {
|
|
612
|
+
let e = g.value;
|
|
613
|
+
if (e == null) return n("documents.history.notSet");
|
|
614
|
+
if (e === "") return n("documents.history.empty");
|
|
615
|
+
if (m(u)(e)) return n(e ? "documents.history.yes" : "documents.history.no");
|
|
616
|
+
if (m(d)(e)) return f(e);
|
|
617
|
+
if (!m(a)(e)) return "";
|
|
618
|
+
if (g.definition?.kind === "select" || g.definition?.kind === "multi-select") return g.definition.options.find((t) => t.value === e)?.label ?? e;
|
|
619
|
+
if (g.definition?.kind === "date" && /^\d{4}-\d{2}-\d{2}$/u.test(e)) {
|
|
620
|
+
let t = /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
621
|
+
if (!Number.isNaN(t.getTime())) return c(t);
|
|
622
|
+
}
|
|
623
|
+
return e;
|
|
624
|
+
});
|
|
625
|
+
R(() => [C.value, b.value?.mediaId], () => {
|
|
626
|
+
v.value = !1;
|
|
627
|
+
});
|
|
628
|
+
function k(e) {
|
|
629
|
+
return e.replace(/[-_]/gu, " ").replace(/([a-z])([A-Z])/gu, "$1 $2").replace(/^./u, (e) => e.toUpperCase());
|
|
630
|
+
}
|
|
631
|
+
return (r, a) => {
|
|
632
|
+
let s = B("RevisionValues", !0), c = t;
|
|
633
|
+
return C.value ? (J(), U("div", Dt, [Y("div", { class: Z(["overflow-hidden rounded-md bg-muted/40", y.value?.frame === "square" ? "aspect-square max-w-64" : "aspect-video max-w-xl"]) }, [v.value ? (J(), U("div", Ot, [Y("span", null, q(L(n)("documents.history.imageUnavailable")), 1)])) : (J(), U("img", P({ key: 1 }, L(p), {
|
|
634
|
+
src: L(l)(C.value),
|
|
635
|
+
alt: y.value?.alt ?? (L(i).is(L(i).String)(S.value?.alt) ? S.value.alt : ""),
|
|
636
|
+
style: y.value ? L(_)(y.value) : void 0,
|
|
637
|
+
loading: "lazy",
|
|
638
|
+
class: "h-full w-full object-contain",
|
|
639
|
+
onError: a[0] ||= (e) => v.value = !0
|
|
640
|
+
}), null, 16, kt))], 2), y.value || L(i).is(L(i).String)(S.value?.alt) ? (J(), U("dl", At, [Y("div", jt, [
|
|
641
|
+
Y("dt", Mt, q(L(n)("documents.history.description")), 1),
|
|
642
|
+
Y("dd", P(L(p), { class: "wrap-break-word text-highlighted" }), q(y.value?.alt ?? S.value?.alt ?? L(n)("documents.history.notSet")), 17),
|
|
643
|
+
y.value?.alt === "" ? (J(), U("dd", Nt, q(L(n)("documents.history.decorativeImage")), 1)) : H("", !0)
|
|
644
|
+
]), y.value ? (J(), U(X, { key: 0 }, [
|
|
645
|
+
Y("div", Pt, [Y("dt", Ft, q(L(n)("documents.history.frame")), 1), Y("dd", null, q(y.value.frame === "square" ? L(n)("documents.history.square") : L(n)("documents.history.wide")), 1)]),
|
|
646
|
+
y.value.zoom && y.value.zoom !== 1 ? (J(), U("div", It, [Y("dt", Lt, q(L(n)("documents.history.zoom")), 1), Y("dd", null, q(y.value.zoom) + "×", 1)])) : H("", !0),
|
|
647
|
+
y.value.focalX !== void 0 || y.value.focalY !== void 0 ? (J(), U("div", Rt, [Y("dt", zt, q(L(n)("documents.history.focalPoint")), 1), Y("dd", null, q(L(n)("documents.history.focalPosition", {
|
|
648
|
+
x: y.value.focalX ?? 50,
|
|
649
|
+
y: y.value.focalY ?? 50
|
|
650
|
+
})), 1)])) : H("", !0)
|
|
651
|
+
], 64)) : H("", !0)])) : H("", !0)])) : b.value?.mediaKind === "video" ? (J(), U("div", Bt, [v.value ? (J(), U("p", Vt, q(L(n)("documents.history.videoUnavailable")), 1)) : (J(), U("video", {
|
|
652
|
+
key: 1,
|
|
653
|
+
src: L(l)(L(o).make(b.value.mediaId)),
|
|
654
|
+
controls: "",
|
|
655
|
+
preload: "metadata",
|
|
656
|
+
class: "max-h-64 w-full rounded-md bg-muted/40",
|
|
657
|
+
onError: a[1] ||= (e) => v.value = !0
|
|
658
|
+
}, null, 40, Ht)), Y("p", Ut, q(L(n)("documents.history.video")), 1)])) : w.value?.kind === "document" || e.definition?.kind === "document" && e.value ? (J(), U("div", Wt, [Y("p", Gt, q(T.value?.title ?? L(n)("documents.history.unavailablePage")), 1), T.value || w.value?.kind === "document" ? (J(), U("p", Kt, q(T.value?.path ?? (w.value?.kind === "document" ? w.value.path : "")), 1)) : H("", !0)])) : w.value?.kind === "url" ? (J(), U("p", qt, q(w.value.href || L(n)("documents.history.emptyLink")), 1)) : Array.isArray(e.value) && e.value.length ? (J(), U("ol", Jt, [(J(!0), U(X, null, W(e.value, (t, r) => (J(), U("li", {
|
|
659
|
+
key: r,
|
|
660
|
+
class: Z(E.value ? "border-l border-default pl-3" : "")
|
|
661
|
+
}, [E.value ? (J(), U("p", Yt, q(L(n)("documents.history.itemNumber", { number: r + 1 })), 1)) : H("", !0), K(s, {
|
|
662
|
+
value: t,
|
|
663
|
+
definition: e.definition?.kind === "multi-select" ? e.definition : void 0,
|
|
664
|
+
definitions: E.value,
|
|
665
|
+
pages: e.pages
|
|
666
|
+
}, null, 8, [
|
|
667
|
+
"value",
|
|
668
|
+
"definition",
|
|
669
|
+
"definitions",
|
|
670
|
+
"pages"
|
|
671
|
+
])], 2))), 128))])) : Array.isArray(e.value) ? (J(), U("p", Xt, q(L(n)("documents.history.noItems")), 1)) : ee.value.length ? (J(), U("dl", Zt, [(J(!0), U(X, null, W(ee.value, (t) => (J(), U("div", {
|
|
672
|
+
key: t.key,
|
|
673
|
+
class: "space-y-1.5"
|
|
674
|
+
}, [Y("dt", Qt, q(t.label), 1), Y("dd", null, [K(s, {
|
|
675
|
+
value: t.value,
|
|
676
|
+
definition: t.definition,
|
|
677
|
+
pages: e.pages
|
|
678
|
+
}, null, 8, [
|
|
679
|
+
"value",
|
|
680
|
+
"definition",
|
|
681
|
+
"pages"
|
|
682
|
+
])])]))), 128))])) : S.value ? (J(), U("p", $t, q(L(n)("documents.history.noDetails")), 1)) : e.definition?.kind === "icon" && L(i).is(L(i).String)(e.value) && e.value ? (J(), U("span", en, [K(c, {
|
|
683
|
+
name: e.value,
|
|
684
|
+
class: "size-5"
|
|
685
|
+
}, null, 8, ["name"]), te(" " + q(e.value.replace(/^i-lucide-/u, "").replace(/-/gu, " ").replace(/^./u, (e) => e.toUpperCase())), 1)])) : (J(), U("p", P({ key: 9 }, typeof e.value == "string" && e.value ? L(p) : {}, { class: ["whitespace-pre-wrap wrap-break-word text-sm leading-6", e.value === void 0 || e.value === null || e.value === "" ? "text-muted" : "text-highlighted"] }), q(O.value), 17));
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
}), nn = {
|
|
689
|
+
key: 0,
|
|
690
|
+
class: "space-y-3"
|
|
691
|
+
}, rn = { class: "text-xs font-medium text-muted" }, an = {
|
|
692
|
+
key: 1,
|
|
693
|
+
class: "space-y-3"
|
|
694
|
+
}, on = ["data-history-diff"], sn = ["data-history-value-change"], cn = /* @__PURE__ */ V({
|
|
695
|
+
name: "RevisionComparedValues",
|
|
696
|
+
__name: "RevisionComparedValues",
|
|
697
|
+
props: {
|
|
698
|
+
value: {},
|
|
699
|
+
counterpart: {},
|
|
700
|
+
compared: { type: Boolean },
|
|
701
|
+
side: {},
|
|
702
|
+
definition: {},
|
|
703
|
+
definitions: {},
|
|
704
|
+
pages: {}
|
|
705
|
+
},
|
|
706
|
+
setup(e) {
|
|
707
|
+
let t = Ne(), n = e, i = z(() => n.compared && !St(n.value, n.counterpart)), o = z(() => m(x)(n.value) || m(s)(n.value) || m(D)(n.value)), c = z(() => n.definition?.kind === "object" || n.definition?.kind === "list" ? n.definition.fields : n.definitions), l = z(() => m(r)(n.value) ? n.value : void 0), u = z(() => m(r)(n.counterpart) ? n.counterpart : void 0), d = z(() => l.value && !o.value ? [.../* @__PURE__ */ new Set([...Object.keys(l.value), ...Object.keys(u.value ?? {})])].flatMap((e) => {
|
|
708
|
+
let t = c.value?.find((t) => t.name === e);
|
|
709
|
+
return e.startsWith(":") || e === "id" && !t ? [] : [{
|
|
710
|
+
key: e,
|
|
711
|
+
label: t?.label ?? h(e),
|
|
712
|
+
definition: t
|
|
713
|
+
}];
|
|
714
|
+
}) : []), f = z(() => {
|
|
715
|
+
let e = n.value;
|
|
716
|
+
if (!m(a)(e) || n.definition && n.definition.kind !== "text") return null;
|
|
717
|
+
let t = e, r = i.value ? bt(e, m(a)(n.counterpart) ? n.counterpart : "") : [], o = [], s = 0;
|
|
718
|
+
for (let [e, n] of r) e > s && o.push({
|
|
719
|
+
text: t.slice(s, e),
|
|
720
|
+
changed: !1
|
|
721
|
+
}), o.push({
|
|
722
|
+
text: t.slice(e, n),
|
|
723
|
+
changed: !0
|
|
724
|
+
}), s = n;
|
|
725
|
+
return s < t.length && o.push({
|
|
726
|
+
text: t.slice(s),
|
|
727
|
+
changed: !1
|
|
728
|
+
}), o.length ? o : null;
|
|
729
|
+
});
|
|
730
|
+
function p(e, t) {
|
|
731
|
+
if (Array.isArray(n.counterpart)) {
|
|
732
|
+
if (m(r)(e) && m(a)(e.id ?? e[":id"])) {
|
|
733
|
+
let t = e.id ?? e[":id"];
|
|
734
|
+
return n.counterpart.find((e) => m(r)(e) && (e.id ?? e[":id"]) === t);
|
|
735
|
+
}
|
|
736
|
+
return n.counterpart[t];
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
function h(e) {
|
|
740
|
+
return e.replace(/[-_]/gu, " ").replace(/([a-z])([A-Z])/gu, "$1 $2").replace(/^./u, (e) => e.toUpperCase());
|
|
741
|
+
}
|
|
742
|
+
return (n, r) => {
|
|
743
|
+
let a = B("RevisionComparedValues", !0);
|
|
744
|
+
return d.value.length ? (J(), U("dl", nn, [(J(!0), U(X, null, W(d.value, (t) => (J(), U("div", {
|
|
745
|
+
key: t.key,
|
|
746
|
+
class: "space-y-1"
|
|
747
|
+
}, [Y("dt", rn, q(t.label), 1), Y("dd", null, [K(a, {
|
|
748
|
+
value: l.value?.[t.key],
|
|
749
|
+
counterpart: u.value?.[t.key],
|
|
750
|
+
definition: t.definition,
|
|
751
|
+
compared: e.compared,
|
|
752
|
+
side: e.side,
|
|
753
|
+
pages: e.pages
|
|
754
|
+
}, null, 8, [
|
|
755
|
+
"value",
|
|
756
|
+
"counterpart",
|
|
757
|
+
"definition",
|
|
758
|
+
"compared",
|
|
759
|
+
"side",
|
|
760
|
+
"pages"
|
|
761
|
+
])])]))), 128))])) : Array.isArray(e.value) && e.value.length ? (J(), U("ol", an, [(J(!0), U(X, null, W(e.value, (t, n) => (J(), U("li", {
|
|
762
|
+
key: n,
|
|
763
|
+
class: "border-s border-default ps-3"
|
|
764
|
+
}, [K(a, {
|
|
765
|
+
value: t,
|
|
766
|
+
counterpart: p(t, n),
|
|
767
|
+
definitions: c.value,
|
|
768
|
+
definition: e.definition?.kind === "multi-select" ? e.definition : void 0,
|
|
769
|
+
compared: e.compared,
|
|
770
|
+
side: e.side,
|
|
771
|
+
pages: e.pages
|
|
772
|
+
}, null, 8, [
|
|
773
|
+
"value",
|
|
774
|
+
"counterpart",
|
|
775
|
+
"definitions",
|
|
776
|
+
"definition",
|
|
777
|
+
"compared",
|
|
778
|
+
"side",
|
|
779
|
+
"pages"
|
|
780
|
+
])]))), 128))])) : f.value ? (J(), U("p", P({ key: 2 }, L(t), { class: "whitespace-pre-wrap wrap-break-word text-sm leading-6 text-highlighted" }), [(J(!0), U(X, null, W(f.value, (t, n) => (J(), U("span", {
|
|
781
|
+
key: n,
|
|
782
|
+
class: Z(t.changed ? L(wt)(e.side) : void 0),
|
|
783
|
+
"data-history-diff": t.changed ? e.side === "before" ? "removed" : "added" : void 0
|
|
784
|
+
}, q(t.text), 11, on))), 128))], 16)) : (J(), U("div", {
|
|
785
|
+
key: 3,
|
|
786
|
+
class: Z(i.value ? e.side === "before" ? "rounded bg-error/5 px-2 py-1" : "rounded bg-success/5 px-2 py-1" : void 0),
|
|
787
|
+
"data-history-value-change": i.value ? e.side === "before" ? "removed" : "added" : void 0
|
|
788
|
+
}, [K(tn, {
|
|
789
|
+
value: e.value,
|
|
790
|
+
definition: e.definition,
|
|
791
|
+
definitions: c.value,
|
|
792
|
+
pages: e.pages
|
|
793
|
+
}, null, 8, [
|
|
794
|
+
"value",
|
|
795
|
+
"definition",
|
|
796
|
+
"definitions",
|
|
797
|
+
"pages"
|
|
798
|
+
])], 10, sn));
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
}), ln = {
|
|
802
|
+
contenteditable: "false",
|
|
803
|
+
class: "flex min-h-9 items-center gap-1 rounded-lg"
|
|
804
|
+
}, un = { class: "inline-flex min-w-0 items-center gap-1.5 text-xs text-muted" }, dn = { class: "wrap-break-word" }, fn = { class: "mt-1 min-h-6 border-s border-default py-2 ps-4 pe-1" }, pn = {
|
|
805
|
+
key: 0,
|
|
806
|
+
contenteditable: "false",
|
|
807
|
+
class: "mb-3 text-xs text-muted"
|
|
808
|
+
}, mn = {
|
|
809
|
+
key: 1,
|
|
810
|
+
contenteditable: "false",
|
|
811
|
+
class: "pt-3 pb-2"
|
|
812
|
+
}, hn = /* @__PURE__ */ V({
|
|
813
|
+
__name: "RevisionBlockNodeView",
|
|
814
|
+
props: {
|
|
815
|
+
decorations: {},
|
|
816
|
+
selected: { type: Boolean },
|
|
817
|
+
updateAttributes: { type: Function },
|
|
818
|
+
deleteNode: { type: Function },
|
|
819
|
+
node: {},
|
|
820
|
+
view: {},
|
|
821
|
+
getPos: {},
|
|
822
|
+
innerDecorations: {},
|
|
823
|
+
editor: {},
|
|
824
|
+
extension: {},
|
|
825
|
+
HTMLAttributes: {}
|
|
826
|
+
},
|
|
827
|
+
setup(i) {
|
|
828
|
+
let { t: a, locale: o, direction: s } = h(), c = Ne(), l = i, u = l.extension.options, d = Q(!1), f = z(() => u.blocks().find((e) => e.name === l.node.attrs.name)), g = z(() => m(r)(l.node.attrs.props) ? l.node.attrs.props : {}), _ = z(() => {
|
|
829
|
+
let e = l.getPos();
|
|
830
|
+
return p(e) ? u.comparison(e) : void 0;
|
|
831
|
+
}), v = z(() => {
|
|
832
|
+
let e = _.value?.counterpart?.attrs;
|
|
833
|
+
return m(r)(e) && m(r)(e.props) ? e.props : void 0;
|
|
834
|
+
}), y = z(() => f.value?.label ?? l.node.attrs.name ?? a("documents.history.unavailableBlock"));
|
|
835
|
+
return (r, l) => {
|
|
836
|
+
let p = n, m = t;
|
|
837
|
+
return J(), F(L(ve), {
|
|
838
|
+
lang: L(o),
|
|
839
|
+
dir: L(s),
|
|
840
|
+
as: "section",
|
|
841
|
+
class: "@container my-1! rounded-lg",
|
|
842
|
+
"data-cms-block": i.node.attrs.name,
|
|
843
|
+
"data-cms-id": i.node.attrs.id
|
|
844
|
+
}, {
|
|
845
|
+
default: G(() => [Y("div", ln, [K(p, {
|
|
846
|
+
color: "neutral",
|
|
847
|
+
variant: "ghost",
|
|
848
|
+
size: "xs",
|
|
849
|
+
square: "",
|
|
850
|
+
icon: d.value ? "i-lucide-chevron-right" : "i-lucide-chevron-down",
|
|
851
|
+
class: "shrink-0 text-muted",
|
|
852
|
+
"aria-label": `${d.value ? L(a)("documents.history.expand") : L(a)("documents.history.collapse")} ${y.value}`,
|
|
853
|
+
"aria-expanded": !d.value,
|
|
854
|
+
onClick: l[0] ||= (e) => d.value = !d.value
|
|
855
|
+
}, null, 8, [
|
|
856
|
+
"icon",
|
|
857
|
+
"aria-label",
|
|
858
|
+
"aria-expanded"
|
|
859
|
+
]), Y("span", un, [K(m, {
|
|
860
|
+
name: f.value?.icon ?? "i-lucide-box",
|
|
861
|
+
class: "size-3.5 shrink-0"
|
|
862
|
+
}, null, 8, ["name"]), Y("span", dn, q(y.value), 1)])]), I(Y("div", fn, [
|
|
863
|
+
f.value ? H("", !0) : (J(), U("p", pn, q(L(a)("documents.history.thisBlockIsUnavailableItsSavedSettings")), 1)),
|
|
864
|
+
K(L(ge), P(L(c), { class: "min-h-6" }), null, 16),
|
|
865
|
+
Object.keys(g.value).length || v.value ? (J(), U("div", mn, [K(cn, {
|
|
866
|
+
value: g.value,
|
|
867
|
+
counterpart: v.value,
|
|
868
|
+
definitions: f.value?.fields,
|
|
869
|
+
compared: L(u).compared(),
|
|
870
|
+
side: L(u).side(),
|
|
871
|
+
pages: L(u).pages()
|
|
872
|
+
}, null, 8, [
|
|
873
|
+
"value",
|
|
874
|
+
"counterpart",
|
|
875
|
+
"definitions",
|
|
876
|
+
"compared",
|
|
877
|
+
"side",
|
|
878
|
+
"pages"
|
|
879
|
+
])])) : H("", !0)
|
|
880
|
+
], 512), [[e, !d.value]])]),
|
|
881
|
+
_: 1
|
|
882
|
+
}, 8, [
|
|
883
|
+
"lang",
|
|
884
|
+
"dir",
|
|
885
|
+
"data-cms-block",
|
|
886
|
+
"data-cms-id"
|
|
887
|
+
]);
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
}), gn = {
|
|
891
|
+
key: 0,
|
|
892
|
+
contenteditable: "false",
|
|
893
|
+
class: "mb-2 text-xs font-medium text-muted"
|
|
894
|
+
}, _n = /* @__PURE__ */ V({
|
|
895
|
+
__name: "RevisionSlotNodeView",
|
|
896
|
+
props: {
|
|
897
|
+
decorations: {},
|
|
898
|
+
selected: { type: Boolean },
|
|
899
|
+
updateAttributes: { type: Function },
|
|
900
|
+
deleteNode: { type: Function },
|
|
901
|
+
node: {},
|
|
902
|
+
view: {},
|
|
903
|
+
getPos: {},
|
|
904
|
+
innerDecorations: {},
|
|
905
|
+
editor: {},
|
|
906
|
+
extension: {},
|
|
907
|
+
HTMLAttributes: {}
|
|
908
|
+
},
|
|
909
|
+
setup(e) {
|
|
910
|
+
let { t, locale: n, direction: r } = h(), i = Ne(), a = e, o = a.extension.options, s = z(() => {
|
|
911
|
+
let e = a.getPos();
|
|
912
|
+
if (!p(e)) return;
|
|
913
|
+
let t = a.editor.state.doc.resolve(e).parent;
|
|
914
|
+
return o.blocks().find((e) => e.name === t.attrs.name);
|
|
915
|
+
}), c = z(() => s.value?.slots.find((e) => e.name === a.node.attrs.name));
|
|
916
|
+
return (a, o) => (J(), F(L(ve), {
|
|
917
|
+
lang: L(n),
|
|
918
|
+
dir: L(r),
|
|
919
|
+
class: "mb-3 last:mb-0",
|
|
920
|
+
"data-cms-slot": e.node.attrs.name
|
|
921
|
+
}, {
|
|
922
|
+
default: G(() => [e.node.attrs.name === "default" ? H("", !0) : (J(), U("p", gn, q(c.value?.label ?? e.node.attrs.name ?? L(t)("documents.history.unavailableContentRegion")), 1)), K(L(ge), P(L(i), { class: "min-h-6" }), null, 16)]),
|
|
923
|
+
_: 1
|
|
924
|
+
}, 8, [
|
|
925
|
+
"lang",
|
|
926
|
+
"dir",
|
|
927
|
+
"data-cms-slot"
|
|
928
|
+
]));
|
|
929
|
+
}
|
|
930
|
+
}), vn = {
|
|
931
|
+
key: 0,
|
|
932
|
+
class: "grid min-h-40 place-items-center rounded-lg bg-muted/40 p-6 text-sm text-muted",
|
|
933
|
+
role: "status"
|
|
934
|
+
}, yn = ["src", "alt"], bn = [
|
|
935
|
+
"src",
|
|
936
|
+
"poster",
|
|
937
|
+
"title"
|
|
938
|
+
], xn = /* @__PURE__ */ V({
|
|
939
|
+
__name: "RevisionMediaNodeView",
|
|
940
|
+
props: {
|
|
941
|
+
decorations: {},
|
|
942
|
+
selected: { type: Boolean },
|
|
943
|
+
updateAttributes: { type: Function },
|
|
944
|
+
deleteNode: { type: Function },
|
|
945
|
+
node: {},
|
|
946
|
+
view: {},
|
|
947
|
+
getPos: {},
|
|
948
|
+
innerDecorations: {},
|
|
949
|
+
editor: {},
|
|
950
|
+
extension: {},
|
|
951
|
+
HTMLAttributes: {}
|
|
952
|
+
},
|
|
953
|
+
setup(e) {
|
|
954
|
+
let { t, locale: n, direction: i } = h(), a = Ne(), s = e, c = s.extension.options, u = Q(!1), d = z(() => m(o)(s.node.attrs.mediaId) ? s.node.attrs.mediaId : void 0), f = z(() => m(o)(s.node.attrs.posterMediaId) ? s.node.attrs.posterMediaId : void 0), b = z(() => s.node.attrs.layout === "natural" ? void 0 : _({
|
|
955
|
+
focalX: m(y)(s.node.attrs.focalX) ? s.node.attrs.focalX : void 0,
|
|
956
|
+
focalY: m(y)(s.node.attrs.focalY) ? s.node.attrs.focalY : void 0,
|
|
957
|
+
zoom: m(v)(s.node.attrs.zoom) ? s.node.attrs.zoom : void 0
|
|
958
|
+
})), x = z(() => {
|
|
959
|
+
let e = s.getPos();
|
|
960
|
+
return p(e) ? c.comparison(e) : void 0;
|
|
961
|
+
}), S = z(() => T(g(r)(s.node.attrs))), C = z(() => {
|
|
962
|
+
let e = x.value?.counterpart;
|
|
963
|
+
return e ? T(g(r)(s.editor.schema.nodeFromJSON(e).attrs)) : void 0;
|
|
964
|
+
}), w = z(() => [
|
|
965
|
+
{
|
|
966
|
+
name: "alt",
|
|
967
|
+
label: t("documents.history.alternativeText"),
|
|
968
|
+
kind: "text",
|
|
969
|
+
required: !1
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
name: "title",
|
|
973
|
+
label: t("documents.history.title"),
|
|
974
|
+
kind: "text",
|
|
975
|
+
required: !1
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
name: "layout",
|
|
979
|
+
label: t("documents.history.width"),
|
|
980
|
+
kind: "select",
|
|
981
|
+
required: !1,
|
|
982
|
+
options: [
|
|
983
|
+
{
|
|
984
|
+
value: "natural",
|
|
985
|
+
label: t("documents.history.naturalSize")
|
|
986
|
+
},
|
|
987
|
+
{
|
|
988
|
+
value: "content",
|
|
989
|
+
label: t("documents.history.contentWidth")
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
value: "full",
|
|
993
|
+
label: t("documents.history.fullWidth")
|
|
994
|
+
}
|
|
995
|
+
]
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
name: "focalX",
|
|
999
|
+
label: t("documents.history.focalPointFromLeft"),
|
|
1000
|
+
kind: "number",
|
|
1001
|
+
required: !1
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
name: "focalY",
|
|
1005
|
+
label: t("documents.history.focalPointFromTop"),
|
|
1006
|
+
kind: "number",
|
|
1007
|
+
required: !1
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
name: "zoom",
|
|
1011
|
+
label: t("documents.history.zoom"),
|
|
1012
|
+
kind: "number",
|
|
1013
|
+
required: !1
|
|
1014
|
+
},
|
|
1015
|
+
{
|
|
1016
|
+
name: "posterMediaId",
|
|
1017
|
+
label: t("documents.history.videoPoster"),
|
|
1018
|
+
kind: "text",
|
|
1019
|
+
required: !1
|
|
1020
|
+
}
|
|
1021
|
+
]);
|
|
1022
|
+
function T(e) {
|
|
1023
|
+
return Object.fromEntries(Object.entries(e).filter(([e, t]) => e !== "id" && e !== "mediaId" && t !== null));
|
|
1024
|
+
}
|
|
1025
|
+
return R(d, () => {
|
|
1026
|
+
u.value = !1;
|
|
1027
|
+
}), (r, o) => (J(), F(L(ve), {
|
|
1028
|
+
lang: L(n),
|
|
1029
|
+
dir: L(i),
|
|
1030
|
+
class: "my-4 space-y-3",
|
|
1031
|
+
contenteditable: "false",
|
|
1032
|
+
"data-cms-media-id": d.value
|
|
1033
|
+
}, {
|
|
1034
|
+
default: G(() => [!d.value || u.value ? (J(), U("div", vn, q(e.node.type.name === "image" ? L(t)("documents.history.imageUnavailable") : L(t)("documents.history.videoUnavailable")), 1)) : e.node.type.name === "image" ? (J(), U("div", {
|
|
1035
|
+
key: 1,
|
|
1036
|
+
class: Z(["relative overflow-hidden rounded-lg bg-muted/20", e.node.attrs.layout === "natural" ? "" : "aspect-video"])
|
|
1037
|
+
}, [Y("img", P(L(a), {
|
|
1038
|
+
src: L(ee)(d.value, {
|
|
1039
|
+
width: 1200,
|
|
1040
|
+
format: "webp",
|
|
1041
|
+
quality: 80
|
|
1042
|
+
}),
|
|
1043
|
+
alt: e.node.attrs.alt,
|
|
1044
|
+
style: b.value,
|
|
1045
|
+
loading: "lazy",
|
|
1046
|
+
class: e.node.attrs.layout === "natural" ? "h-auto max-h-80 max-w-full object-contain" : "absolute inset-0 size-full object-cover",
|
|
1047
|
+
onError: o[0] ||= (e) => u.value = !0
|
|
1048
|
+
}), null, 16, yn)], 2)) : (J(), U("video", P({ key: 2 }, L(a), {
|
|
1049
|
+
src: L(l)(d.value),
|
|
1050
|
+
poster: f.value ? L(l)(f.value) : void 0,
|
|
1051
|
+
title: e.node.attrs.title,
|
|
1052
|
+
controls: "",
|
|
1053
|
+
preload: "metadata",
|
|
1054
|
+
class: "max-h-80 w-full rounded-lg bg-muted/20",
|
|
1055
|
+
onError: o[1] ||= (e) => u.value = !0
|
|
1056
|
+
}), null, 16, bn)), K(cn, {
|
|
1057
|
+
value: S.value,
|
|
1058
|
+
counterpart: C.value,
|
|
1059
|
+
definitions: w.value,
|
|
1060
|
+
compared: L(c).compared(),
|
|
1061
|
+
side: L(c).side(),
|
|
1062
|
+
pages: L(c).pages()
|
|
1063
|
+
}, null, 8, [
|
|
1064
|
+
"value",
|
|
1065
|
+
"counterpart",
|
|
1066
|
+
"definitions",
|
|
1067
|
+
"compared",
|
|
1068
|
+
"side",
|
|
1069
|
+
"pages"
|
|
1070
|
+
])]),
|
|
1071
|
+
_: 1
|
|
1072
|
+
}, 8, [
|
|
1073
|
+
"lang",
|
|
1074
|
+
"dir",
|
|
1075
|
+
"data-cms-media-id"
|
|
1076
|
+
]));
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
1079
|
+
//#endregion
|
|
1080
|
+
//#region src/documents/history/revisionEditorKit.ts
|
|
1081
|
+
function Sn(e) {
|
|
1082
|
+
return [
|
|
1083
|
+
Pe.configure({
|
|
1084
|
+
undoRedo: !1,
|
|
1085
|
+
link: {
|
|
1086
|
+
openOnClick: !1,
|
|
1087
|
+
isAllowedUri: (e) => b(e)
|
|
1088
|
+
},
|
|
1089
|
+
dropcursor: !1,
|
|
1090
|
+
trailingNode: !1,
|
|
1091
|
+
underline: !1
|
|
1092
|
+
}),
|
|
1093
|
+
be.extend({
|
|
1094
|
+
addOptions: () => e,
|
|
1095
|
+
addNodeView: () => Cn(hn)
|
|
1096
|
+
}),
|
|
1097
|
+
je.extend({
|
|
1098
|
+
addOptions: () => e,
|
|
1099
|
+
addNodeView: () => Cn(_n)
|
|
1100
|
+
}),
|
|
1101
|
+
Ee.extend({
|
|
1102
|
+
addOptions: () => e,
|
|
1103
|
+
addNodeView: () => Cn(xn)
|
|
1104
|
+
}),
|
|
1105
|
+
Se.extend({
|
|
1106
|
+
addOptions: () => e,
|
|
1107
|
+
addNodeView: () => Cn(xn)
|
|
1108
|
+
}),
|
|
1109
|
+
Ce
|
|
1110
|
+
];
|
|
1111
|
+
}
|
|
1112
|
+
function Cn(e) {
|
|
1113
|
+
return me(e);
|
|
1114
|
+
}
|
|
1115
|
+
//#endregion
|
|
1116
|
+
//#region src/documents/history/RevisionFragment.vue?vue&type=script&setup=true&lang.ts
|
|
1117
|
+
var wn = {
|
|
1118
|
+
key: 0,
|
|
1119
|
+
class: "space-y-4"
|
|
1120
|
+
}, Tn = {
|
|
1121
|
+
key: 0,
|
|
1122
|
+
class: "min-w-0 flex-1 truncate"
|
|
1123
|
+
}, En = {
|
|
1124
|
+
key: 0,
|
|
1125
|
+
class: "text-xs text-muted"
|
|
1126
|
+
}, Dn = { class: "text-xs font-medium text-muted" }, On = {
|
|
1127
|
+
key: 2,
|
|
1128
|
+
class: "text-sm text-muted"
|
|
1129
|
+
}, kn = {
|
|
1130
|
+
key: 2,
|
|
1131
|
+
class: "space-y-4"
|
|
1132
|
+
}, An = {
|
|
1133
|
+
key: 0,
|
|
1134
|
+
class: "grid min-h-40 place-items-center rounded-lg bg-muted/40 p-6 text-sm text-muted",
|
|
1135
|
+
role: "status"
|
|
1136
|
+
}, jn = ["src", "alt"], Mn = ["src", "poster"], Nn = {
|
|
1137
|
+
key: 3,
|
|
1138
|
+
class: "space-y-3"
|
|
1139
|
+
}, Pn = { class: "text-sm text-muted" }, Fn = {
|
|
1140
|
+
key: 4,
|
|
1141
|
+
class: "space-y-3"
|
|
1142
|
+
}, In = {
|
|
1143
|
+
key: 5,
|
|
1144
|
+
class: "text-sm text-muted"
|
|
1145
|
+
}, Ln = /* @__PURE__ */ V({
|
|
1146
|
+
__name: "RevisionFragment",
|
|
1147
|
+
props: {
|
|
1148
|
+
nodes: {},
|
|
1149
|
+
blocks: {},
|
|
1150
|
+
pages: {},
|
|
1151
|
+
counterpart: {},
|
|
1152
|
+
side: {},
|
|
1153
|
+
reading: { type: Boolean }
|
|
1154
|
+
},
|
|
1155
|
+
setup(e) {
|
|
1156
|
+
let { t: n } = h(), s = Ne(), c = e, u = z(() => c.nodes.filter((e) => e.type !== "paragraph" || M(e).length > 0)), d = Q(null), f = Q(!1), p = Q(!1), g = z(() => c.nodes.length === 1 && (c.nodes[0]?.type === "image" || c.nodes[0]?.type === "video") ? c.nodes[0] : void 0), b = z(() => m(r)(g.value?.attrs) ? g.value.attrs : {}), x = z(() => m(o)(b.value.mediaId) ? b.value.mediaId : void 0), S = z(() => m(o)(b.value.posterMediaId) ? b.value.posterMediaId : void 0), C = z(() => b.value.layout === "natural" ? void 0 : _({
|
|
1157
|
+
focalX: m(y)(b.value.focalX) ? b.value.focalX : void 0,
|
|
1158
|
+
focalY: m(y)(b.value.focalY) ? b.value.focalY : void 0,
|
|
1159
|
+
zoom: m(v)(b.value.zoom) ? b.value.zoom : void 0
|
|
1160
|
+
})), w = z(() => [
|
|
1161
|
+
{
|
|
1162
|
+
name: "alt",
|
|
1163
|
+
label: n("documents.history.alternativeText"),
|
|
1164
|
+
kind: "text",
|
|
1165
|
+
required: !1
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
name: "title",
|
|
1169
|
+
label: n("documents.history.title"),
|
|
1170
|
+
kind: "text",
|
|
1171
|
+
required: !1
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
name: "layout",
|
|
1175
|
+
label: n("documents.history.width"),
|
|
1176
|
+
kind: "select",
|
|
1177
|
+
required: !1,
|
|
1178
|
+
options: [
|
|
1179
|
+
{
|
|
1180
|
+
value: "natural",
|
|
1181
|
+
label: n("documents.history.naturalSize")
|
|
1182
|
+
},
|
|
1183
|
+
{
|
|
1184
|
+
value: "content",
|
|
1185
|
+
label: n("documents.history.contentWidth")
|
|
1186
|
+
},
|
|
1187
|
+
{
|
|
1188
|
+
value: "full",
|
|
1189
|
+
label: n("documents.history.fullWidth")
|
|
1190
|
+
}
|
|
1191
|
+
]
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
name: "focalX",
|
|
1195
|
+
label: n("documents.history.focalPointFromLeft"),
|
|
1196
|
+
kind: "number",
|
|
1197
|
+
required: !1
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
name: "focalY",
|
|
1201
|
+
label: n("documents.history.focalPointFromTop"),
|
|
1202
|
+
kind: "number",
|
|
1203
|
+
required: !1
|
|
1204
|
+
},
|
|
1205
|
+
{
|
|
1206
|
+
name: "zoom",
|
|
1207
|
+
label: n("documents.history.zoom"),
|
|
1208
|
+
kind: "number",
|
|
1209
|
+
required: !1
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
name: "posterMediaId",
|
|
1213
|
+
label: n("documents.history.videoPoster"),
|
|
1214
|
+
kind: "text",
|
|
1215
|
+
required: !1
|
|
1216
|
+
}
|
|
1217
|
+
]), T = z(() => w.value.filter((e) => j.value && Object.hasOwn(j.value, e.name))), E = z(() => c.nodes.length === 1 && c.nodes[0]?.type === "cmsBlock" ? c.nodes[0] : null), D = z(() => m(r)(E.value?.attrs) ? E.value.attrs : {}), O = z(() => c.blocks.find((e) => e.name === D.value.name)), k = z(() => M(E.value)), A = z(() => {
|
|
1218
|
+
function e(t) {
|
|
1219
|
+
return m(a)(t.text) ? t.text : M(t).map(e).join(" ");
|
|
1220
|
+
}
|
|
1221
|
+
return k.value.map(e).find((e) => e.trim())?.trim() || O.value?.label || n("documents.history.unavailableBlock");
|
|
1222
|
+
}), j = z(() => {
|
|
1223
|
+
let e = c.nodes[0];
|
|
1224
|
+
if (!(c.nodes.length !== 1 || e?.type !== "image" && e?.type !== "video" || !m(r)(e.attrs))) return Object.fromEntries(Object.entries(e.attrs).flatMap(([e, t]) => e === "id" || e === "mediaId" ? [] : [[e, e === "posterMediaId" && m(o)(t) ? {
|
|
1225
|
+
mediaId: t,
|
|
1226
|
+
alt: n("documents.history.videoPoster")
|
|
1227
|
+
} : t]]));
|
|
1228
|
+
});
|
|
1229
|
+
R(() => [
|
|
1230
|
+
c.nodes,
|
|
1231
|
+
c.counterpart,
|
|
1232
|
+
c.side,
|
|
1233
|
+
E.value
|
|
1234
|
+
], () => {
|
|
1235
|
+
if (d.value?.destroy(), d.value = null, f.value = !1, p.value = !1, !(g.value || E.value || c.nodes.length !== 1)) try {
|
|
1236
|
+
let e = De({
|
|
1237
|
+
type: "doc",
|
|
1238
|
+
content: c.nodes
|
|
1239
|
+
}).toJSON(), t = c.counterpart ? De({
|
|
1240
|
+
type: "doc",
|
|
1241
|
+
content: c.counterpart
|
|
1242
|
+
}) : null, n = Oe.create({
|
|
1243
|
+
name: "revisionHighlights",
|
|
1244
|
+
addProseMirrorPlugins: () => [new xe({ props: { decorations(e) {
|
|
1245
|
+
if (!t) return Ae.empty;
|
|
1246
|
+
let n = bt(e.doc.textContent, t.textContent), r = [], i = 0;
|
|
1247
|
+
return e.doc.descendants((e, t) => {
|
|
1248
|
+
if (!e.isText) return;
|
|
1249
|
+
let a = i + e.nodeSize;
|
|
1250
|
+
for (let [e, o] of n) {
|
|
1251
|
+
let n = Math.max(e, i), s = Math.min(o, a);
|
|
1252
|
+
n < s && r.push(Te.inline(t + n - i, t + s - i, { class: c.side === "before" ? "bg-error/10 text-error line-through decoration-error/60" : "bg-success/10 text-success" }));
|
|
1253
|
+
}
|
|
1254
|
+
i = a;
|
|
1255
|
+
}), Ae.create(e.doc, r);
|
|
1256
|
+
} } })]
|
|
1257
|
+
});
|
|
1258
|
+
d.value = new _e({
|
|
1259
|
+
editable: !1,
|
|
1260
|
+
content: e,
|
|
1261
|
+
extensions: [...ke(() => c.blocks, () => void 0), n],
|
|
1262
|
+
editorProps: { attributes: {
|
|
1263
|
+
lang: s.value.lang,
|
|
1264
|
+
dir: s.value.dir,
|
|
1265
|
+
class: "outline-none text-sm leading-7 break-words [&_p]:my-2 [&_h1]:my-3 [&_h1]:text-2xl [&_h1]:font-semibold [&_h2]:my-3 [&_h2]:text-xl [&_h2]:font-semibold [&_h3]:my-2 [&_h3]:text-lg [&_h3]:font-medium [&_ul]:list-disc [&_ul]:ps-5 [&_ol]:list-decimal [&_ol]:ps-5 [&_blockquote]:border-s-2 [&_blockquote]:border-default [&_blockquote]:ps-4 [&_pre]:overflow-auto [&_pre]:rounded [&_pre]:bg-muted [&_pre]:p-3 [&_a]:text-primary [&_a]:underline"
|
|
1266
|
+
} }
|
|
1267
|
+
});
|
|
1268
|
+
} catch {
|
|
1269
|
+
f.value = !0;
|
|
1270
|
+
}
|
|
1271
|
+
}, { immediate: !0 }), se(() => d.value?.destroy());
|
|
1272
|
+
function M(e) {
|
|
1273
|
+
return Array.isArray(e?.content) ? e.content.filter(m(r)) : [];
|
|
1274
|
+
}
|
|
1275
|
+
function N(e) {
|
|
1276
|
+
return m(r)(e.attrs) && m(a)(e.attrs.name) ? e.attrs.name : "";
|
|
1277
|
+
}
|
|
1278
|
+
function I(e) {
|
|
1279
|
+
let t = c.counterpart?.[0];
|
|
1280
|
+
return t ? M(M(t).find((t) => N(t) === N(e))) : void 0;
|
|
1281
|
+
}
|
|
1282
|
+
return (r, a) => {
|
|
1283
|
+
let o = B("RevisionFragment", !0), c = t;
|
|
1284
|
+
return e.nodes.length > 1 ? (J(), U("div", wn, [(J(!0), U(X, null, W(e.reading ? u.value : e.nodes, (t, n) => (J(), F(o, {
|
|
1285
|
+
key: n,
|
|
1286
|
+
nodes: [t],
|
|
1287
|
+
blocks: e.blocks,
|
|
1288
|
+
pages: e.pages,
|
|
1289
|
+
side: e.side,
|
|
1290
|
+
reading: e.reading,
|
|
1291
|
+
counterpart: e.counterpart?.[n] ? [e.counterpart[n]] : void 0
|
|
1292
|
+
}, null, 8, [
|
|
1293
|
+
"nodes",
|
|
1294
|
+
"blocks",
|
|
1295
|
+
"pages",
|
|
1296
|
+
"side",
|
|
1297
|
+
"reading",
|
|
1298
|
+
"counterpart"
|
|
1299
|
+
]))), 128))])) : E.value ? (J(), F(ue(e.reading ? "details" : "div"), {
|
|
1300
|
+
key: 1,
|
|
1301
|
+
class: Z(e.reading ? "group rounded-lg border border-default p-4" : "space-y-4")
|
|
1302
|
+
}, {
|
|
1303
|
+
default: G(() => [(J(), F(ue(e.reading ? "summary" : "div"), { class: Z(["flex items-center gap-2 text-sm font-medium text-highlighted", e.reading ? "cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-primary" : ""]) }, {
|
|
1304
|
+
default: G(() => [
|
|
1305
|
+
K(c, {
|
|
1306
|
+
name: O.value?.icon ?? "i-lucide-box",
|
|
1307
|
+
class: "size-4 shrink-0 text-muted"
|
|
1308
|
+
}, null, 8, ["name"]),
|
|
1309
|
+
e.reading ? (J(), U("span", Tn, q(A.value), 1)) : H("", !0),
|
|
1310
|
+
Y("span", { class: Z(e.reading ? "shrink-0 text-xs font-normal text-muted" : "") }, q(O.value?.label ?? D.value.name ?? L(n)("documents.history.unavailableBlock")), 3),
|
|
1311
|
+
e.reading ? (J(), F(c, {
|
|
1312
|
+
key: 1,
|
|
1313
|
+
name: "i-lucide-chevron-down",
|
|
1314
|
+
class: "size-4 shrink-0 text-muted group-open:rotate-180"
|
|
1315
|
+
})) : H("", !0)
|
|
1316
|
+
]),
|
|
1317
|
+
_: 1
|
|
1318
|
+
}, 8, ["class"])), Y("div", { class: Z(e.reading ? "space-y-4 border-t border-default mt-4 pt-4" : "space-y-4") }, [
|
|
1319
|
+
O.value ? H("", !0) : (J(), U("p", En, q(L(n)("documents.history.thisBlockIsUnavailableItsSavedSettings")), 1)),
|
|
1320
|
+
L(i).is(L(i).JsonObject)(D.value.props) && Object.keys(D.value.props).length ? (J(), F(tn, {
|
|
1321
|
+
key: 1,
|
|
1322
|
+
value: D.value.props,
|
|
1323
|
+
definitions: O.value?.fields,
|
|
1324
|
+
pages: e.pages
|
|
1325
|
+
}, null, 8, [
|
|
1326
|
+
"value",
|
|
1327
|
+
"definitions",
|
|
1328
|
+
"pages"
|
|
1329
|
+
])) : H("", !0),
|
|
1330
|
+
(J(!0), U(X, null, W(k.value, (t, n) => (J(), U("div", {
|
|
1331
|
+
key: n,
|
|
1332
|
+
class: "space-y-2"
|
|
1333
|
+
}, [Y("p", Dn, q(O.value?.slots.find((e) => e.name === N(t))?.label ?? N(t)), 1), K(o, {
|
|
1334
|
+
nodes: M(t),
|
|
1335
|
+
blocks: e.blocks,
|
|
1336
|
+
pages: e.pages,
|
|
1337
|
+
counterpart: I(t),
|
|
1338
|
+
side: e.side,
|
|
1339
|
+
reading: e.reading
|
|
1340
|
+
}, null, 8, [
|
|
1341
|
+
"nodes",
|
|
1342
|
+
"blocks",
|
|
1343
|
+
"pages",
|
|
1344
|
+
"counterpart",
|
|
1345
|
+
"side",
|
|
1346
|
+
"reading"
|
|
1347
|
+
])]))), 128)),
|
|
1348
|
+
!k.value.length && !Object.keys(D.value.props ?? {}).length ? (J(), U("p", On, q(L(n)("documents.history.emptyBlock")), 1)) : H("", !0)
|
|
1349
|
+
], 2)]),
|
|
1350
|
+
_: 1
|
|
1351
|
+
}, 8, ["class"])) : g.value ? (J(), U("div", kn, [!x.value || p.value ? (J(), U("div", An, q(g.value.type === "image" ? L(n)("documents.history.imageUnavailable") : L(n)("documents.history.videoUnavailable")), 1)) : g.value.type === "image" ? (J(), U("div", {
|
|
1352
|
+
key: 1,
|
|
1353
|
+
class: Z(["relative overflow-hidden rounded-lg bg-muted/20", b.value.layout === "natural" ? "" : "aspect-video"])
|
|
1354
|
+
}, [Y("img", P(L(s), {
|
|
1355
|
+
src: L(ee)(x.value, {
|
|
1356
|
+
width: 1200,
|
|
1357
|
+
format: "webp",
|
|
1358
|
+
quality: 80
|
|
1359
|
+
}),
|
|
1360
|
+
alt: L(i).is(L(i).String)(b.value.alt) ? b.value.alt : "",
|
|
1361
|
+
style: C.value,
|
|
1362
|
+
class: b.value.layout === "natural" ? "h-auto max-h-80 max-w-full object-contain" : "absolute inset-0 size-full object-cover",
|
|
1363
|
+
onError: a[0] ||= (e) => p.value = !0
|
|
1364
|
+
}), null, 16, jn)], 2)) : (J(), U("video", {
|
|
1365
|
+
key: 2,
|
|
1366
|
+
src: L(l)(x.value),
|
|
1367
|
+
poster: S.value ? L(l)(S.value) : void 0,
|
|
1368
|
+
controls: "",
|
|
1369
|
+
preload: "metadata",
|
|
1370
|
+
class: "max-h-80 w-full rounded-lg bg-muted/20",
|
|
1371
|
+
onError: a[1] ||= (e) => p.value = !0
|
|
1372
|
+
}, null, 40, Mn)), j.value ? (J(), F(tn, {
|
|
1373
|
+
key: 3,
|
|
1374
|
+
value: j.value,
|
|
1375
|
+
definitions: T.value,
|
|
1376
|
+
pages: e.pages
|
|
1377
|
+
}, null, 8, [
|
|
1378
|
+
"value",
|
|
1379
|
+
"definitions",
|
|
1380
|
+
"pages"
|
|
1381
|
+
])) : H("", !0)])) : f.value ? (J(), U("div", Nn, [Y("p", Pn, q(L(n)("documents.history.thisContentCannotBeRenderedItsSaved")), 1), K(tn, {
|
|
1382
|
+
value: e.nodes,
|
|
1383
|
+
pages: e.pages
|
|
1384
|
+
}, null, 8, ["value", "pages"])])) : d.value ? (J(), U("div", Fn, [K(L(he), { editor: d.value }, null, 8, ["editor"])])) : (J(), U("p", In, q(L(n)("documents.history.noContent")), 1));
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1387
|
+
}), Rn = ["data-history-pane"], zn = {
|
|
1388
|
+
key: 2,
|
|
1389
|
+
class: "space-y-3"
|
|
1390
|
+
}, Bn = { class: "text-xs text-muted" }, Vn = {
|
|
1391
|
+
key: 3,
|
|
1392
|
+
class: "text-sm text-muted"
|
|
1393
|
+
}, Hn = /* @__PURE__ */ V({
|
|
1394
|
+
__name: "RevisionComparisonEditor",
|
|
1395
|
+
props: {
|
|
1396
|
+
snapshot: {},
|
|
1397
|
+
counterpart: {},
|
|
1398
|
+
side: {},
|
|
1399
|
+
locale: {},
|
|
1400
|
+
defaultLocale: {},
|
|
1401
|
+
locales: {},
|
|
1402
|
+
blocks: {},
|
|
1403
|
+
fieldDefinitions: {},
|
|
1404
|
+
pages: {}
|
|
1405
|
+
},
|
|
1406
|
+
setup(e, { expose: t }) {
|
|
1407
|
+
let { t: n, locale: r, direction: a } = h(), o = k(), s = e, c = z(() => xt(s.snapshot, s.locale, s.defaultLocale)), l = z(() => c.value.locale ? f(c.value.locale, s.locales) : void 0), u = z(() => ({
|
|
1408
|
+
lang: l.value?.code ?? "",
|
|
1409
|
+
dir: l.value?.dir ?? "auto"
|
|
1410
|
+
}));
|
|
1411
|
+
ye(l);
|
|
1412
|
+
let d = z(() => s.counterpart ? xt(s.counterpart, s.locale, s.defaultLocale).content : void 0), p = z(() => c.value.content.fields.title), m = z(() => Object.fromEntries(Object.entries(c.value.content.fields).filter(([e]) => e !== "title"))), g = z(() => d.value ? Object.fromEntries(Object.entries(d.value.fields).filter(([e]) => e !== "title")) : void 0), _ = Q(null), v = Q(0), y = Q(!1), b;
|
|
1413
|
+
function x() {
|
|
1414
|
+
return {
|
|
1415
|
+
lang: l.value?.code ?? "",
|
|
1416
|
+
dir: l.value?.dir ?? "auto",
|
|
1417
|
+
role: "document",
|
|
1418
|
+
"aria-label": n("documents.history.savedVersionNumberContent", { number: s.snapshot.number }),
|
|
1419
|
+
class: "outline-none text-sm leading-7 break-words [&_p]:my-2 [&_h1]:my-3 [&_h1]:text-2xl [&_h1]:font-semibold [&_h2]:my-3 [&_h2]:text-xl [&_h2]:font-semibold [&_h3]:my-2 [&_h3]:text-lg [&_h3]:font-medium [&_ul]:list-disc [&_ul]:ps-5 [&_ol]:list-decimal [&_ol]:ps-5 [&_blockquote]:border-s-2 [&_blockquote]:border-default [&_blockquote]:ps-4 [&_pre]:overflow-auto [&_pre]:rounded [&_pre]:bg-muted [&_pre]:p-3 [&_a]:text-primary [&_a]:underline"
|
|
1420
|
+
};
|
|
1421
|
+
}
|
|
1422
|
+
return R(() => [
|
|
1423
|
+
c.value.content,
|
|
1424
|
+
d.value,
|
|
1425
|
+
s.side,
|
|
1426
|
+
s.blocks,
|
|
1427
|
+
s.pages
|
|
1428
|
+
], () => {
|
|
1429
|
+
let e = _.value;
|
|
1430
|
+
ie(() => e?.destroy()), _.value = null, v.value++, y.value = !1;
|
|
1431
|
+
let t = c.value.content;
|
|
1432
|
+
if (t.body.content.length) try {
|
|
1433
|
+
let e = De(t.body).toJSON();
|
|
1434
|
+
b = void 0;
|
|
1435
|
+
let i = Oe.create({
|
|
1436
|
+
name: "revisionComparisonHighlights",
|
|
1437
|
+
addProseMirrorPlugins: () => [new xe({ props: { decorations: () => b?.decorations } })]
|
|
1438
|
+
}), o = new _e({
|
|
1439
|
+
editable: !1,
|
|
1440
|
+
content: e,
|
|
1441
|
+
extensions: [...Sn({
|
|
1442
|
+
blocks: () => s.blocks,
|
|
1443
|
+
pages: () => s.pages,
|
|
1444
|
+
comparison: (e) => b?.nodes.get(e),
|
|
1445
|
+
compared: () => !!s.counterpart,
|
|
1446
|
+
side: () => s.side
|
|
1447
|
+
}), i],
|
|
1448
|
+
editorProps: { attributes: x() }
|
|
1449
|
+
});
|
|
1450
|
+
b = Ct(o.state.doc, t, d.value, s.side, n, {
|
|
1451
|
+
lang: r.value,
|
|
1452
|
+
dir: a.value
|
|
1453
|
+
}), o.view.dispatch(o.state.tr), _.value = o;
|
|
1454
|
+
} catch {
|
|
1455
|
+
y.value = !0;
|
|
1456
|
+
}
|
|
1457
|
+
}, { immediate: !0 }), R([
|
|
1458
|
+
r,
|
|
1459
|
+
a,
|
|
1460
|
+
l
|
|
1461
|
+
], () => {
|
|
1462
|
+
let e = _.value;
|
|
1463
|
+
e && !e.isDestroyed && (e.setOptions({ editorProps: {
|
|
1464
|
+
...e.options.editorProps,
|
|
1465
|
+
attributes: x()
|
|
1466
|
+
} }), b = Ct(e.state.doc, c.value.content, d.value, s.side, n, {
|
|
1467
|
+
lang: r.value,
|
|
1468
|
+
dir: a.value
|
|
1469
|
+
}), e.view.dispatch(e.state.tr.setMeta("cmsUiLanguage", r.value)));
|
|
1470
|
+
}), se(() => {
|
|
1471
|
+
let e = _.value;
|
|
1472
|
+
ie(() => e?.destroy());
|
|
1473
|
+
}), t({
|
|
1474
|
+
editor: _,
|
|
1475
|
+
fallback: z(() => c.value.fallback)
|
|
1476
|
+
}), (t, r) => (J(), U("div", {
|
|
1477
|
+
class: "mx-auto w-full max-w-3xl space-y-6",
|
|
1478
|
+
"data-history-pane": e.side
|
|
1479
|
+
}, [
|
|
1480
|
+
Y("div", P(u.value, { class: "text-[30px] leading-tight font-semibold tracking-tight text-highlighted [&_p]:text-[30px] [&_p]:leading-tight [&_p]:font-semibold [&_p]:tracking-tight" }), [K(cn, {
|
|
1481
|
+
value: L(i).is(L(i).String)(p.value) && p.value ? p.value : L(o).document.untitled,
|
|
1482
|
+
counterpart: d.value?.fields.title,
|
|
1483
|
+
compared: !!e.counterpart,
|
|
1484
|
+
side: e.side
|
|
1485
|
+
}, null, 8, [
|
|
1486
|
+
"value",
|
|
1487
|
+
"counterpart",
|
|
1488
|
+
"compared",
|
|
1489
|
+
"side"
|
|
1490
|
+
])], 16),
|
|
1491
|
+
Object.keys(m.value).length || g.value && Object.keys(g.value).length ? (J(), F(cn, {
|
|
1492
|
+
key: 0,
|
|
1493
|
+
value: m.value,
|
|
1494
|
+
counterpart: g.value,
|
|
1495
|
+
definitions: e.fieldDefinitions,
|
|
1496
|
+
compared: !!e.counterpart,
|
|
1497
|
+
side: e.side,
|
|
1498
|
+
pages: e.pages
|
|
1499
|
+
}, null, 8, [
|
|
1500
|
+
"value",
|
|
1501
|
+
"counterpart",
|
|
1502
|
+
"definitions",
|
|
1503
|
+
"compared",
|
|
1504
|
+
"side",
|
|
1505
|
+
"pages"
|
|
1506
|
+
])) : H("", !0),
|
|
1507
|
+
_.value ? (J(), F(L(he), {
|
|
1508
|
+
key: v.value,
|
|
1509
|
+
editor: _.value
|
|
1510
|
+
}, null, 8, ["editor"])) : y.value ? (J(), U("div", zn, [Y("p", Bn, q(L(n)("documents.history.someSavedContentIsUnavailableInThe")), 1), K(Ln, {
|
|
1511
|
+
nodes: c.value.content.body.content,
|
|
1512
|
+
counterpart: d.value?.body.content,
|
|
1513
|
+
side: e.side,
|
|
1514
|
+
blocks: e.blocks,
|
|
1515
|
+
pages: e.pages
|
|
1516
|
+
}, null, 8, [
|
|
1517
|
+
"nodes",
|
|
1518
|
+
"counterpart",
|
|
1519
|
+
"side",
|
|
1520
|
+
"blocks",
|
|
1521
|
+
"pages"
|
|
1522
|
+
])])) : (J(), U("p", Vn, q(L(n)("documents.history.noContent")), 1))
|
|
1523
|
+
], 8, Rn));
|
|
1524
|
+
}
|
|
1525
|
+
}), Un = { class: "space-y-4" }, Wn = { class: "space-y-3" }, Gn = { class: "text-xs text-muted" }, Kn = {
|
|
1526
|
+
key: 0,
|
|
1527
|
+
class: "space-y-2"
|
|
1528
|
+
}, qn = ["id"], Jn = {
|
|
1529
|
+
key: 2,
|
|
1530
|
+
class: "text-sm text-muted",
|
|
1531
|
+
role: "status"
|
|
1532
|
+
}, Yn = {
|
|
1533
|
+
key: 3,
|
|
1534
|
+
class: "max-h-64 overflow-y-auto"
|
|
1535
|
+
}, Xn = { class: "min-w-0 text-xs text-muted" }, Zn = { class: "mt-1" }, Qn = {
|
|
1536
|
+
key: 0,
|
|
1537
|
+
class: "text-sm text-muted"
|
|
1538
|
+
}, $n = /* @__PURE__ */ V({
|
|
1539
|
+
__name: "RevisionLinkControls",
|
|
1540
|
+
props: {
|
|
1541
|
+
revision: {},
|
|
1542
|
+
locale: {}
|
|
1543
|
+
},
|
|
1544
|
+
setup(e) {
|
|
1545
|
+
let { t, date: r } = h(), i = k(), a = w().requests, o = e, s = z(() => [
|
|
1546
|
+
{
|
|
1547
|
+
label: t("documents.history.15Minutes"),
|
|
1548
|
+
value: 15
|
|
1549
|
+
},
|
|
1550
|
+
{
|
|
1551
|
+
label: t("documents.history.1Hour"),
|
|
1552
|
+
value: 60
|
|
1553
|
+
},
|
|
1554
|
+
{
|
|
1555
|
+
label: t("documents.history.4Hours"),
|
|
1556
|
+
value: 240
|
|
1557
|
+
},
|
|
1558
|
+
{
|
|
1559
|
+
label: t("documents.history.24Hours"),
|
|
1560
|
+
value: 1440
|
|
1561
|
+
}
|
|
1562
|
+
]), c = Q(60), l = Q(!1), u = Q(), d = Q([]), f = Q(!1), p = Q(!1), m = Q(!1), g = Q(), _ = oe("linkInput"), v = le(), y = Ze(), b = y.message, x = !1, S = 0, C = z(() => u.value ? new URL(T(u.value.previewPath, u.value.token, o.locale), location.origin).href : ""), D = z(() => d.value.find((e) => e.id === u.value?.link.id)), { copied: ee, error: O, copy: A, select: j } = $e(() => l.value ? C.value : "", () => _.value?.inputRef);
|
|
1563
|
+
se(() => {
|
|
1564
|
+
x = !0, S++;
|
|
1565
|
+
}), R(l, (e) => {
|
|
1566
|
+
e && P();
|
|
1567
|
+
}), Fe("links", P, () => l.value || u.value !== void 0);
|
|
1568
|
+
function M(e) {
|
|
1569
|
+
return !e.revokedAt && Date.parse(e.expiresAt) > Date.now();
|
|
1570
|
+
}
|
|
1571
|
+
function N(e) {
|
|
1572
|
+
return r(e, {
|
|
1573
|
+
dateStyle: "medium",
|
|
1574
|
+
timeStyle: "short"
|
|
1575
|
+
});
|
|
1576
|
+
}
|
|
1577
|
+
async function P() {
|
|
1578
|
+
let e = ++S;
|
|
1579
|
+
p.value = !0;
|
|
1580
|
+
try {
|
|
1581
|
+
let t = await a.links.list({ params: { documentId: o.revision.identity.documentId } });
|
|
1582
|
+
!x && e === S && (d.value = t.filter((e) => e.revisionId === o.revision.revisionId));
|
|
1583
|
+
} catch (n) {
|
|
1584
|
+
!x && e === S && y.set(() => E(n, t, t("documents.history.couldNotLoadTemporaryLinks")));
|
|
1585
|
+
} finally {
|
|
1586
|
+
!x && e === S && (p.value = !1);
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
async function I() {
|
|
1590
|
+
if (!f.value) {
|
|
1591
|
+
f.value = !0, y.clear();
|
|
1592
|
+
try {
|
|
1593
|
+
let e = await a.links.create({
|
|
1594
|
+
params: { documentId: o.revision.identity.documentId },
|
|
1595
|
+
payload: {
|
|
1596
|
+
revisionId: o.revision.revisionId,
|
|
1597
|
+
expiresAt: new Date(Date.now() + c.value * 6e4).toISOString()
|
|
1598
|
+
}
|
|
1599
|
+
});
|
|
1600
|
+
if (x) return;
|
|
1601
|
+
u.value = e, S++, p.value = !1, d.value = [e.link, ...d.value];
|
|
1602
|
+
} catch (e) {
|
|
1603
|
+
x || y.set(() => E(e, t, t("documents.history.couldNotCreateATemporaryLink")));
|
|
1604
|
+
} finally {
|
|
1605
|
+
x || (f.value = !1);
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
async function te() {
|
|
1610
|
+
let e = g.value;
|
|
1611
|
+
if (e && !m.value) {
|
|
1612
|
+
m.value = !0, y.clear();
|
|
1613
|
+
try {
|
|
1614
|
+
if (await a.links.revoke({ params: { id: e.id } }), x) return;
|
|
1615
|
+
u.value?.link.id === e.id && (u.value = void 0), g.value = void 0, await P();
|
|
1616
|
+
} catch (e) {
|
|
1617
|
+
x || y.set(() => E(e, t, t("documents.history.couldNotRevokeThisLink")));
|
|
1618
|
+
} finally {
|
|
1619
|
+
x || (m.value = !1);
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
return (r, a) => {
|
|
1624
|
+
let o = n, u = de, h = Ie, y = fe, x = Ve, S = Ue;
|
|
1625
|
+
return J(), U(X, null, [K(S, {
|
|
1626
|
+
open: l.value,
|
|
1627
|
+
"onUpdate:open": a[1] ||= (e) => l.value = e,
|
|
1628
|
+
title: L(t)("documents.history.shareVersionNumber", { number: e.revision.number }),
|
|
1629
|
+
description: L(t)("documents.history.anyoneWithALinkCanViewVersion", { number: e.revision.number })
|
|
1630
|
+
}, {
|
|
1631
|
+
body: G(() => [Y("div", Un, [
|
|
1632
|
+
Y("div", Wn, [
|
|
1633
|
+
K(h, { label: L(t)("documents.history.linkExpiresAfter") }, {
|
|
1634
|
+
default: G(() => [K(u, {
|
|
1635
|
+
modelValue: c.value,
|
|
1636
|
+
"onUpdate:modelValue": a[0] ||= (e) => c.value = e,
|
|
1637
|
+
items: s.value,
|
|
1638
|
+
disabled: f.value,
|
|
1639
|
+
class: "w-full"
|
|
1640
|
+
}, null, 8, [
|
|
1641
|
+
"modelValue",
|
|
1642
|
+
"items",
|
|
1643
|
+
"disabled"
|
|
1644
|
+
])]),
|
|
1645
|
+
_: 1
|
|
1646
|
+
}, 8, ["label"]),
|
|
1647
|
+
K(o, {
|
|
1648
|
+
label: L(t)("documents.history.createLink"),
|
|
1649
|
+
loading: f.value,
|
|
1650
|
+
onClick: I
|
|
1651
|
+
}, null, 8, ["label", "loading"]),
|
|
1652
|
+
Y("p", Gn, q(L(t)("documents.history.appliesToNewLinksExistingLinksKeep")), 1)
|
|
1653
|
+
]),
|
|
1654
|
+
D.value && M(D.value) ? (J(), U("div", Kn, [
|
|
1655
|
+
K(y, {
|
|
1656
|
+
ref_key: "linkInput",
|
|
1657
|
+
ref: _,
|
|
1658
|
+
"model-value": C.value,
|
|
1659
|
+
readonly: "",
|
|
1660
|
+
"aria-label": L(t)("documents.history.temporaryVersionLink"),
|
|
1661
|
+
"aria-describedby": L(O) ? L(v) : void 0,
|
|
1662
|
+
class: "w-full",
|
|
1663
|
+
onFocus: L(j)
|
|
1664
|
+
}, null, 8, [
|
|
1665
|
+
"model-value",
|
|
1666
|
+
"aria-label",
|
|
1667
|
+
"aria-describedby",
|
|
1668
|
+
"onFocus"
|
|
1669
|
+
]),
|
|
1670
|
+
L(O) ? (J(), U("p", {
|
|
1671
|
+
key: 0,
|
|
1672
|
+
id: L(v),
|
|
1673
|
+
role: "status",
|
|
1674
|
+
class: "text-sm leading-6 text-muted"
|
|
1675
|
+
}, q(L(O)), 9, qn)) : H("", !0),
|
|
1676
|
+
K(o, {
|
|
1677
|
+
label: L(ee) ? L(t)("documents.history.copied") : L(t)("documents.history.copyLink"),
|
|
1678
|
+
icon: "i-lucide-copy",
|
|
1679
|
+
variant: "outline",
|
|
1680
|
+
onClick: L(A)
|
|
1681
|
+
}, null, 8, ["label", "onClick"])
|
|
1682
|
+
])) : H("", !0),
|
|
1683
|
+
L(b) ? (J(), F(x, {
|
|
1684
|
+
key: 1,
|
|
1685
|
+
color: "error",
|
|
1686
|
+
variant: "subtle",
|
|
1687
|
+
description: L(b),
|
|
1688
|
+
role: "alert"
|
|
1689
|
+
}, null, 8, ["description"])) : H("", !0),
|
|
1690
|
+
p.value ? (J(), U("p", Jn, q(L(t)("documents.history.loadingLinks")), 1)) : (J(), U("div", Yn, [(J(!0), U(X, null, W(d.value, (e) => (J(), U("div", {
|
|
1691
|
+
key: e.id,
|
|
1692
|
+
class: "flex items-center justify-between gap-3 border-t border-default py-3"
|
|
1693
|
+
}, [Y("div", Xn, [Y("p", null, q(L(t)("documents.history.created")) + " " + q(N(e.createdAt)), 1), Y("p", Zn, q(e.revokedAt ? L(t)("documents.history.revoked") : M(e) ? L(t)("documents.history.expiresDate", { date: N(e.expiresAt) }) : L(t)("documents.history.expired")), 1)]), M(e) ? (J(), F(o, {
|
|
1694
|
+
key: 0,
|
|
1695
|
+
label: L(t)("documents.history.revoke"),
|
|
1696
|
+
variant: "ghost",
|
|
1697
|
+
size: "sm",
|
|
1698
|
+
onClick: (t) => g.value = e
|
|
1699
|
+
}, null, 8, ["label", "onClick"])) : H("", !0)]))), 128)), d.value.length ? H("", !0) : (J(), U("p", Qn, q(L(t)("documents.history.noTemporaryLinksYet")), 1))]))
|
|
1700
|
+
])]),
|
|
1701
|
+
default: G(() => [K(o, {
|
|
1702
|
+
label: L(t)("documents.history.share"),
|
|
1703
|
+
icon: "i-lucide-link",
|
|
1704
|
+
variant: "ghost",
|
|
1705
|
+
size: "sm",
|
|
1706
|
+
"aria-label": L(t)("documents.history.shareTemporaryVersionLink")
|
|
1707
|
+
}, null, 8, ["label", "aria-label"])]),
|
|
1708
|
+
_: 1
|
|
1709
|
+
}, 8, [
|
|
1710
|
+
"open",
|
|
1711
|
+
"title",
|
|
1712
|
+
"description"
|
|
1713
|
+
]), K(S, {
|
|
1714
|
+
open: !!g.value,
|
|
1715
|
+
title: L(t)("documents.history.revokeThisLink"),
|
|
1716
|
+
description: L(t)("documents.history.anyoneUsingThisLinkWillLoseAccess"),
|
|
1717
|
+
dismissible: !m.value,
|
|
1718
|
+
close: !m.value,
|
|
1719
|
+
"onUpdate:open": a[3] ||= (e) => !e && (g.value = void 0)
|
|
1720
|
+
}, re({
|
|
1721
|
+
footer: G(() => [K(o, {
|
|
1722
|
+
label: L(i).actions.cancel,
|
|
1723
|
+
variant: "outline",
|
|
1724
|
+
disabled: m.value,
|
|
1725
|
+
onClick: a[2] ||= (e) => g.value = void 0
|
|
1726
|
+
}, null, 8, ["label", "disabled"]), K(o, {
|
|
1727
|
+
label: L(t)("documents.history.revokeLink"),
|
|
1728
|
+
color: "error",
|
|
1729
|
+
variant: "soft",
|
|
1730
|
+
loading: m.value,
|
|
1731
|
+
onClick: te
|
|
1732
|
+
}, null, 8, ["label", "loading"])]),
|
|
1733
|
+
_: 2
|
|
1734
|
+
}, [L(b) ? {
|
|
1735
|
+
name: "body",
|
|
1736
|
+
fn: G(() => [K(x, {
|
|
1737
|
+
color: "error",
|
|
1738
|
+
variant: "subtle",
|
|
1739
|
+
description: L(b),
|
|
1740
|
+
role: "alert"
|
|
1741
|
+
}, null, 8, ["description"])]),
|
|
1742
|
+
key: "0"
|
|
1743
|
+
} : void 0]), 1032, [
|
|
1744
|
+
"open",
|
|
1745
|
+
"title",
|
|
1746
|
+
"description",
|
|
1747
|
+
"dismissible",
|
|
1748
|
+
"close"
|
|
1749
|
+
])], 64);
|
|
1750
|
+
};
|
|
1751
|
+
}
|
|
1752
|
+
}), er = { class: "flex h-full min-h-0 min-w-0 flex-col overflow-hidden" }, tr = {
|
|
1753
|
+
key: 1,
|
|
1754
|
+
class: "text-xs text-muted"
|
|
1755
|
+
}, nr = { class: "sr-only" }, rr = { class: "min-h-0 min-w-0 flex-1 overflow-auto overscroll-contain" }, ir = { class: "flex min-h-full min-w-160 flex-col" }, ar = { class: "sticky top-0 z-10 grid grid-cols-2 border-b border-default bg-default" }, or = { class: "flex min-w-0 flex-col gap-1" }, sr = { class: "flex min-w-0 items-center gap-2" }, cr = { class: "shrink-0 text-xs font-medium text-muted" }, lr = {
|
|
1756
|
+
key: 0,
|
|
1757
|
+
class: "text-xs text-muted"
|
|
1758
|
+
}, ur = { key: 0 }, dr = { key: 1 }, fr = ["aria-label"], pr = { class: "grid flex-1 grid-cols-2" }, mr = ["aria-label"], hr = {
|
|
1759
|
+
key: 2,
|
|
1760
|
+
class: "text-sm text-muted"
|
|
1761
|
+
}, gr = /* @__PURE__ */ V({
|
|
1762
|
+
__name: "RevisionHistory",
|
|
1763
|
+
props: {
|
|
1764
|
+
documentId: {},
|
|
1765
|
+
latestRevisionId: {},
|
|
1766
|
+
documentVersion: {},
|
|
1767
|
+
fieldDefinitions: {},
|
|
1768
|
+
hasPendingChanges: { type: Boolean }
|
|
1769
|
+
},
|
|
1770
|
+
emits: ["close", "conflict"],
|
|
1771
|
+
setup(e, { emit: t }) {
|
|
1772
|
+
let { t: r, date: i } = h(), a = k(), o = e, s = t, { studio: c, readonly: l, item: u, pageTitle: d, collectionLabel: p, defaultLocale: m, locale: g, locales: _, page: v, selected: y, selectedId: b, baselineId: x, loading: S, loadingSelection: C, loadingMore: w, restoring: T, restoreTarget: E, publishTarget: D, publicationDescription: ee, error: O, busy: A, selectedSummary: j, baselineSummary: M, isLive: N, documentItems: P, versionLabel: I, baselineItems: R, previewLocale: z, previewLocation: B, rightItems: V, sides: ne, reload: ie, load: ae, selectBaseline: se, requestPublish: Z, published: Q, restore: ce } = Et(o, {
|
|
1773
|
+
close: () => s("close"),
|
|
1774
|
+
conflict: () => s("conflict")
|
|
1775
|
+
});
|
|
1776
|
+
function le(e) {
|
|
1777
|
+
return e ? f(e, c.configuration.locales ?? void 0).label : r("documents.history.defaultLanguage");
|
|
1778
|
+
}
|
|
1779
|
+
let ue = oe("actionBar");
|
|
1780
|
+
function fe(e) {
|
|
1781
|
+
e.preventDefault();
|
|
1782
|
+
let t = ue.value?.[0]?.querySelector("button");
|
|
1783
|
+
t?.disabled ? ue.value?.[0]?.closest("[aria-label]")?.querySelector("a")?.focus() : t?.focus();
|
|
1784
|
+
}
|
|
1785
|
+
return (t, o) => {
|
|
1786
|
+
let s = n, f = pe, h = we, k = Ve, oe = de, me = Le, he = Xe, ge = Ue;
|
|
1787
|
+
return J(), U(X, null, [
|
|
1788
|
+
Y("div", er, [
|
|
1789
|
+
K(h, {
|
|
1790
|
+
as: "header",
|
|
1791
|
+
toggle: !1,
|
|
1792
|
+
ui: {
|
|
1793
|
+
root: "h-auto min-h-14 shrink-0 flex-wrap gap-2 bg-default py-1",
|
|
1794
|
+
left: "min-w-0 flex-1 basis-full gap-2 md:basis-64"
|
|
1795
|
+
}
|
|
1796
|
+
}, {
|
|
1797
|
+
left: G(() => [
|
|
1798
|
+
K(s, {
|
|
1799
|
+
label: L(p),
|
|
1800
|
+
to: {
|
|
1801
|
+
name: "versions",
|
|
1802
|
+
query: { collection: L(u)?.collection }
|
|
1803
|
+
},
|
|
1804
|
+
variant: "ghost",
|
|
1805
|
+
size: "sm"
|
|
1806
|
+
}, null, 8, ["label", "to"]),
|
|
1807
|
+
o[6] ||= Y("span", {
|
|
1808
|
+
class: "text-dimmed",
|
|
1809
|
+
"aria-hidden": "true"
|
|
1810
|
+
}, "/", -1),
|
|
1811
|
+
K(f, {
|
|
1812
|
+
items: L(P),
|
|
1813
|
+
content: { align: "start" }
|
|
1814
|
+
}, {
|
|
1815
|
+
default: G(() => [K(s, {
|
|
1816
|
+
label: L(d),
|
|
1817
|
+
title: L(d),
|
|
1818
|
+
"aria-label": L(r)("documents.history.documentMenuPagetitle", { pageTitle: L(d) }),
|
|
1819
|
+
"trailing-icon": "i-lucide-chevron-down",
|
|
1820
|
+
variant: "ghost",
|
|
1821
|
+
size: "sm",
|
|
1822
|
+
class: "min-w-0",
|
|
1823
|
+
ui: {
|
|
1824
|
+
label: "truncate",
|
|
1825
|
+
trailingIcon: "size-3.5 shrink-0"
|
|
1826
|
+
},
|
|
1827
|
+
disabled: L(A)
|
|
1828
|
+
}, null, 8, [
|
|
1829
|
+
"label",
|
|
1830
|
+
"title",
|
|
1831
|
+
"aria-label",
|
|
1832
|
+
"disabled"
|
|
1833
|
+
])]),
|
|
1834
|
+
_: 1
|
|
1835
|
+
}, 8, ["items"]),
|
|
1836
|
+
L(_).length > 1 ? (J(), F(Me, {
|
|
1837
|
+
key: 0,
|
|
1838
|
+
"selected-locale": L(g),
|
|
1839
|
+
configuration: L(c).configuration.locales ?? void 0,
|
|
1840
|
+
"translation-locales": Object.keys(L(y)?.source.translations ?? {}),
|
|
1841
|
+
"retained-locales": L(_).filter((e) => e !== void 0),
|
|
1842
|
+
"can-write": !1,
|
|
1843
|
+
busy: L(A),
|
|
1844
|
+
onSelectLocale: o[0] ||= (e) => g.value = e
|
|
1845
|
+
}, null, 8, [
|
|
1846
|
+
"selected-locale",
|
|
1847
|
+
"configuration",
|
|
1848
|
+
"translation-locales",
|
|
1849
|
+
"retained-locales",
|
|
1850
|
+
"busy"
|
|
1851
|
+
])) : (J(), U("span", tr, q(L(c).configuration.locales ? le(L(g)) : L(r)("documents.history.defaultLanguage")), 1)),
|
|
1852
|
+
Y("h1", nr, q(L(d)) + " " + q(L(r)("documents.history.versionHistory")), 1)
|
|
1853
|
+
]),
|
|
1854
|
+
_: 1
|
|
1855
|
+
}),
|
|
1856
|
+
L(O) ? (J(), F(k, {
|
|
1857
|
+
key: 0,
|
|
1858
|
+
color: "error",
|
|
1859
|
+
title: L(r)("documents.history.versionHistoryNeedsAttention"),
|
|
1860
|
+
description: L(O),
|
|
1861
|
+
role: "alert",
|
|
1862
|
+
class: "m-3",
|
|
1863
|
+
actions: [{
|
|
1864
|
+
label: L(a).actions.retry,
|
|
1865
|
+
onClick: L(ie)
|
|
1866
|
+
}]
|
|
1867
|
+
}, null, 8, [
|
|
1868
|
+
"title",
|
|
1869
|
+
"description",
|
|
1870
|
+
"actions"
|
|
1871
|
+
])) : H("", !0),
|
|
1872
|
+
Y("div", rr, [Y("div", ir, [
|
|
1873
|
+
Y("header", ar, [(J(!0), U(X, null, W(L(ne), (t) => (J(), U("div", {
|
|
1874
|
+
key: t.name,
|
|
1875
|
+
class: "flex min-w-0 flex-wrap items-start gap-x-3 gap-y-2 border-default px-6 py-2 first:border-e"
|
|
1876
|
+
}, [Y("div", or, [Y("div", sr, [Y("p", cr, q(t.name === "baseline" ? L(r)("documents.history.compareFrom") : L(r)("documents.history.reviewVersion")), 1), t.name === "baseline" ? (J(), F(oe, {
|
|
1877
|
+
key: 0,
|
|
1878
|
+
"model-value": L(x),
|
|
1879
|
+
items: L(R),
|
|
1880
|
+
"aria-label": L(r)("documents.history.compareFrom"),
|
|
1881
|
+
variant: "ghost",
|
|
1882
|
+
class: "w-fit max-w-full shrink-0",
|
|
1883
|
+
disabled: L(A) || L(S),
|
|
1884
|
+
ui: { content: "min-w-80" },
|
|
1885
|
+
"onUpdate:modelValue": L(se)
|
|
1886
|
+
}, {
|
|
1887
|
+
default: G(() => [Y("span", null, q(L(M) ? L(I)(L(M)) : L(r)("documents.history.baselineVersion")), 1)]),
|
|
1888
|
+
_: 1
|
|
1889
|
+
}, 8, [
|
|
1890
|
+
"model-value",
|
|
1891
|
+
"items",
|
|
1892
|
+
"aria-label",
|
|
1893
|
+
"disabled",
|
|
1894
|
+
"onUpdate:modelValue"
|
|
1895
|
+
])) : (J(), F(f, {
|
|
1896
|
+
key: 1,
|
|
1897
|
+
items: L(V),
|
|
1898
|
+
content: { align: "start" }
|
|
1899
|
+
}, {
|
|
1900
|
+
default: G(() => [K(s, {
|
|
1901
|
+
label: L(j) ? L(r)("documents.history.versionNumber", { number: L(j).number }) : L(r)("documents.history.savedVersions"),
|
|
1902
|
+
"trailing-icon": "i-lucide-chevron-down",
|
|
1903
|
+
"aria-label": L(r)("documents.history.chooseSavedVersion"),
|
|
1904
|
+
variant: "ghost",
|
|
1905
|
+
disabled: L(A) || L(S)
|
|
1906
|
+
}, null, 8, [
|
|
1907
|
+
"label",
|
|
1908
|
+
"aria-label",
|
|
1909
|
+
"disabled"
|
|
1910
|
+
])]),
|
|
1911
|
+
_: 1
|
|
1912
|
+
}, 8, ["items"]))]), t.summary ? (J(), U("p", lr, [
|
|
1913
|
+
t.name !== "baseline" && L(j) ? (J(), U("span", ur, q(L(N) ? L(a).publication.published : L(b) === e.latestRevisionId ? L(r)("documents.history.latestSaved") : L(r)("documents.history.olderVersion")) + " · ", 1)) : H("", !0),
|
|
1914
|
+
te(" " + q(L(i)(t.summary.createdAt, {
|
|
1915
|
+
dateStyle: "medium",
|
|
1916
|
+
timeStyle: "short"
|
|
1917
|
+
})) + " · " + q(t.summary.authorName ?? L(r)("documents.history.unknownAuthor")), 1),
|
|
1918
|
+
t.fallback ? (J(), U("span", dr, " · " + q(le(L(m))) + " " + q(L(r)("documents.history.fallback")), 1)) : H("", !0)
|
|
1919
|
+
])) : H("", !0)]), t.name === "baseline" ? H("", !0) : (J(), U("div", {
|
|
1920
|
+
key: 0,
|
|
1921
|
+
class: "ms-auto flex shrink-0 items-center gap-1",
|
|
1922
|
+
"aria-label": L(r)("documents.history.reviewedVersionActions")
|
|
1923
|
+
}, [
|
|
1924
|
+
K(s, {
|
|
1925
|
+
label: L(r)("documents.history.preview"),
|
|
1926
|
+
icon: "i-lucide-arrow-up-right",
|
|
1927
|
+
variant: "ghost",
|
|
1928
|
+
size: "sm",
|
|
1929
|
+
to: L(B),
|
|
1930
|
+
external: "",
|
|
1931
|
+
target: "_blank",
|
|
1932
|
+
rel: "noopener noreferrer",
|
|
1933
|
+
disabled: !L(y) || L(C)
|
|
1934
|
+
}, null, 8, [
|
|
1935
|
+
"label",
|
|
1936
|
+
"to",
|
|
1937
|
+
"disabled"
|
|
1938
|
+
]),
|
|
1939
|
+
L(y) && !L(C) && !L(l) ? (J(), F($n, {
|
|
1940
|
+
key: L(y).revisionId,
|
|
1941
|
+
revision: L(y),
|
|
1942
|
+
locale: L(z)
|
|
1943
|
+
}, null, 8, ["revision", "locale"])) : H("", !0),
|
|
1944
|
+
L(l) ? H("", !0) : (J(), F(me, {
|
|
1945
|
+
key: 1,
|
|
1946
|
+
text: L(r)("documents.history.openThisVersionInTheEditorAs")
|
|
1947
|
+
}, {
|
|
1948
|
+
default: G(() => [K(s, {
|
|
1949
|
+
label: L(r)("documents.history.restore"),
|
|
1950
|
+
variant: "outline",
|
|
1951
|
+
size: "sm",
|
|
1952
|
+
disabled: !L(y) || L(A) || L(C),
|
|
1953
|
+
onClick: o[1] ||= (e) => E.value = L(y) ?? void 0
|
|
1954
|
+
}, null, 8, ["label", "disabled"])]),
|
|
1955
|
+
_: 1
|
|
1956
|
+
}, 8, ["text"])),
|
|
1957
|
+
L(l) ? H("", !0) : (J(), U("div", {
|
|
1958
|
+
key: 2,
|
|
1959
|
+
ref_for: !0,
|
|
1960
|
+
ref_key: "actionBar",
|
|
1961
|
+
ref: ue
|
|
1962
|
+
}, [K(me, { text: L(N) ? L(r)("documents.history.thisVersionIsAlreadyLive") : L(r)("documents.history.makeThisVersionLive") }, {
|
|
1963
|
+
default: G(() => [K(s, {
|
|
1964
|
+
label: L(a).publication.publish,
|
|
1965
|
+
size: "sm",
|
|
1966
|
+
disabled: !L(y) || L(C) || L(A) || L(N),
|
|
1967
|
+
onClick: L(Z)
|
|
1968
|
+
}, null, 8, [
|
|
1969
|
+
"label",
|
|
1970
|
+
"disabled",
|
|
1971
|
+
"onClick"
|
|
1972
|
+
])]),
|
|
1973
|
+
_: 1
|
|
1974
|
+
}, 8, ["text"])], 512))
|
|
1975
|
+
], 8, fr))]))), 128))]),
|
|
1976
|
+
Y("div", pr, [(J(!0), U(X, null, W(L(ne), (t) => (J(), U("section", {
|
|
1977
|
+
key: t.name,
|
|
1978
|
+
"aria-label": t.label,
|
|
1979
|
+
class: "min-w-0 border-default px-6 py-4 first:border-e"
|
|
1980
|
+
}, [L(S) || t.loading ? (J(), F(he, {
|
|
1981
|
+
key: 0,
|
|
1982
|
+
class: "h-72"
|
|
1983
|
+
})) : t.revision ? (J(), F(Hn, {
|
|
1984
|
+
key: 1,
|
|
1985
|
+
snapshot: t.revision,
|
|
1986
|
+
counterpart: t.counterpart,
|
|
1987
|
+
side: t.side,
|
|
1988
|
+
locale: L(g),
|
|
1989
|
+
"default-locale": L(m),
|
|
1990
|
+
locales: L(c).configuration.locales ?? void 0,
|
|
1991
|
+
blocks: L(c).configuration.blocks,
|
|
1992
|
+
pages: L(c).items,
|
|
1993
|
+
"field-definitions": e.fieldDefinitions
|
|
1994
|
+
}, null, 8, [
|
|
1995
|
+
"snapshot",
|
|
1996
|
+
"counterpart",
|
|
1997
|
+
"side",
|
|
1998
|
+
"locale",
|
|
1999
|
+
"default-locale",
|
|
2000
|
+
"locales",
|
|
2001
|
+
"blocks",
|
|
2002
|
+
"pages",
|
|
2003
|
+
"field-definitions"
|
|
2004
|
+
])) : t.revision ? H("", !0) : (J(), U("p", hr, q(L(r)("documents.history.noSavedContentAvailable")), 1))], 8, mr))), 128))]),
|
|
2005
|
+
L(v).nextBefore ? (J(), F(s, {
|
|
2006
|
+
key: 0,
|
|
2007
|
+
label: L(r)("documents.history.loadOlderVersions"),
|
|
2008
|
+
variant: "ghost",
|
|
2009
|
+
loading: L(w),
|
|
2010
|
+
class: "self-center my-3",
|
|
2011
|
+
onClick: o[2] ||= (e) => L(ae)(L(v).nextBefore)
|
|
2012
|
+
}, null, 8, ["label", "loading"])) : H("", !0)
|
|
2013
|
+
])])
|
|
2014
|
+
]),
|
|
2015
|
+
L(D) ? (J(), F(Qe, {
|
|
2016
|
+
key: 0,
|
|
2017
|
+
selection: [{
|
|
2018
|
+
documentId: e.documentId,
|
|
2019
|
+
revisionId: L(D).revisionId,
|
|
2020
|
+
action: "publish"
|
|
2021
|
+
}],
|
|
2022
|
+
"confirmation-title": L(r)("documents.history.publishVersionNumber", { number: L(D).number }),
|
|
2023
|
+
"confirmation-description": L(ee),
|
|
2024
|
+
"confirm-label": L(r)("documents.history.publishVersionNumber2", { number: L(D).number }),
|
|
2025
|
+
"return-focus": fe,
|
|
2026
|
+
onClose: o[3] ||= (e) => D.value = void 0,
|
|
2027
|
+
onCompleted: L(Q)
|
|
2028
|
+
}, null, 8, [
|
|
2029
|
+
"selection",
|
|
2030
|
+
"confirmation-title",
|
|
2031
|
+
"confirmation-description",
|
|
2032
|
+
"confirm-label",
|
|
2033
|
+
"onCompleted"
|
|
2034
|
+
])) : H("", !0),
|
|
2035
|
+
K(ge, {
|
|
2036
|
+
open: !!L(E),
|
|
2037
|
+
title: L(r)("documents.history.restoreVersionNumberToEditor", { number: L(E)?.number ?? "" }),
|
|
2038
|
+
description: L(r)("documents.history.replaceWorkingContentIncludingAllTranslationsWith"),
|
|
2039
|
+
dismissible: !L(T),
|
|
2040
|
+
close: !L(T),
|
|
2041
|
+
"onUpdate:open": o[5] ||= (e) => !e && !L(T) && (E.value = void 0)
|
|
2042
|
+
}, re({
|
|
2043
|
+
footer: G(() => [K(s, {
|
|
2044
|
+
variant: "outline",
|
|
2045
|
+
label: L(a).actions.cancel,
|
|
2046
|
+
disabled: L(T),
|
|
2047
|
+
onClick: o[4] ||= (e) => E.value = void 0
|
|
2048
|
+
}, null, 8, ["label", "disabled"]), K(s, {
|
|
2049
|
+
label: L(r)("documents.history.restoreToEditor"),
|
|
2050
|
+
loading: L(T),
|
|
2051
|
+
onClick: L(ce)
|
|
2052
|
+
}, null, 8, [
|
|
2053
|
+
"label",
|
|
2054
|
+
"loading",
|
|
2055
|
+
"onClick"
|
|
2056
|
+
])]),
|
|
2057
|
+
_: 2
|
|
2058
|
+
}, [e.hasPendingChanges ? {
|
|
2059
|
+
name: "body",
|
|
2060
|
+
fn: G(() => [K(k, {
|
|
2061
|
+
color: "warning",
|
|
2062
|
+
variant: "subtle",
|
|
2063
|
+
icon: "i-lucide-triangle-alert",
|
|
2064
|
+
title: L(r)("documents.history.currentEditorChangesWillBeReplaced"),
|
|
2065
|
+
description: L(r)("documents.history.unsavedContentEditsWillBeDiscardedCurrent")
|
|
2066
|
+
}, null, 8, ["title", "description"])]),
|
|
2067
|
+
key: "0"
|
|
2068
|
+
} : void 0]), 1032, [
|
|
2069
|
+
"open",
|
|
2070
|
+
"title",
|
|
2071
|
+
"description",
|
|
2072
|
+
"dismissible",
|
|
2073
|
+
"close"
|
|
2074
|
+
])
|
|
2075
|
+
], 64);
|
|
2076
|
+
};
|
|
2077
|
+
}
|
|
2078
|
+
}), _r = { class: "min-w-0 overflow-hidden rounded-lg border border-default [&_table]:min-w-[56rem]" }, vr = { class: "flex min-h-12 items-center justify-end border-b border-default px-5" }, yr = { class: "inline-flex items-center gap-2 text-xs text-muted" }, br = [
|
|
2079
|
+
"title",
|
|
2080
|
+
"aria-label",
|
|
2081
|
+
"onClick"
|
|
2082
|
+
], xr = { class: "truncate" }, Sr = ["title"], Cr = ["title"], wr = ["datetime", "title"], Tr = ["title"], Er = /* @__PURE__ */ V({
|
|
2083
|
+
__name: "RevisionHistoryList",
|
|
2084
|
+
props: /*@__PURE__*/ ne({
|
|
2085
|
+
items: {},
|
|
2086
|
+
collections: {},
|
|
2087
|
+
locales: {}
|
|
2088
|
+
}, {
|
|
2089
|
+
search: { default: "" },
|
|
2090
|
+
searchModifiers: {},
|
|
2091
|
+
collection: { default: "" },
|
|
2092
|
+
collectionModifiers: {}
|
|
2093
|
+
}),
|
|
2094
|
+
emits: /*@__PURE__*/ ne(["select"], ["update:search", "update:collection"]),
|
|
2095
|
+
setup(e, { emit: r }) {
|
|
2096
|
+
let { t: i, date: a } = h(), o = k(), s = e, c = r, l = ae(e, "search"), u = ae(e, "collection"), d = oe("searchInput"), p = z(() => new Map(s.collections.map((e) => [e.collection, e.label]))), m = z(() => [{
|
|
2097
|
+
label: i("documents.history.allCollections"),
|
|
2098
|
+
value: "all"
|
|
2099
|
+
}, ...s.collections.map((e) => ({
|
|
2100
|
+
label: e.label,
|
|
2101
|
+
value: e.collection
|
|
2102
|
+
}))]), g = z(() => s.items.filter((e) => e.revisionNumber > 1)), _ = z(() => g.value.filter((e) => !u.value || e.collection === u.value));
|
|
2103
|
+
function v(e) {
|
|
2104
|
+
return [s.locales ? f(s.locales.defaultLocale, s.locales).label : i("documents.history.default"), ...e.translationLocales.map((e) => f(e, s.locales).label)].join(", ");
|
|
2105
|
+
}
|
|
2106
|
+
let y = z(() => {
|
|
2107
|
+
let e = l.value.trim().toLocaleLowerCase();
|
|
2108
|
+
return _.value.filter((t) => `${t.title} ${t.path} ${p.value.get(t.collection) ?? t.collection} ${v(t)}`.toLocaleLowerCase().includes(e)).toSorted((e, t) => t.savedAt.localeCompare(e.savedAt));
|
|
2109
|
+
}), b = z(() => l.value.trim() ? i("documents.inventory.documentsShown", {
|
|
2110
|
+
count: y.value.length,
|
|
2111
|
+
total: _.value.length
|
|
2112
|
+
}) : i("documents.inventory.documentCount", { count: _.value.length })), x = z(() => [
|
|
2113
|
+
{
|
|
2114
|
+
accessorKey: "title",
|
|
2115
|
+
header: i("documents.history.columnDocument")
|
|
2116
|
+
},
|
|
2117
|
+
{
|
|
2118
|
+
accessorKey: "collection",
|
|
2119
|
+
header: i("documents.history.columnCollection")
|
|
2120
|
+
},
|
|
2121
|
+
{
|
|
2122
|
+
accessorKey: "translationLocales",
|
|
2123
|
+
header: i("documents.history.columnLanguages")
|
|
2124
|
+
},
|
|
2125
|
+
{
|
|
2126
|
+
accessorKey: "savedAt",
|
|
2127
|
+
header: i("documents.history.columnSavedAt")
|
|
2128
|
+
},
|
|
2129
|
+
{
|
|
2130
|
+
accessorKey: "savedByName",
|
|
2131
|
+
header: i("documents.history.columnSavedBy")
|
|
2132
|
+
}
|
|
2133
|
+
]);
|
|
2134
|
+
function S() {
|
|
2135
|
+
l.value = "", d.value?.inputRef?.focus();
|
|
2136
|
+
}
|
|
2137
|
+
return (e, r) => {
|
|
2138
|
+
let s = n, f = fe, h = de, g = t, _ = Je;
|
|
2139
|
+
return J(), F(Ke, {
|
|
2140
|
+
title: p.value.get(u.value) ?? L(o).document.history,
|
|
2141
|
+
summary: b.value
|
|
2142
|
+
}, {
|
|
2143
|
+
default: G(() => [K(Ye, null, {
|
|
2144
|
+
default: G(() => [
|
|
2145
|
+
K(f, {
|
|
2146
|
+
ref_key: "searchInput",
|
|
2147
|
+
ref: d,
|
|
2148
|
+
modelValue: l.value,
|
|
2149
|
+
"onUpdate:modelValue": r[0] ||= (e) => l.value = e,
|
|
2150
|
+
icon: "i-lucide-search",
|
|
2151
|
+
placeholder: L(i)("documents.history.searchDocuments"),
|
|
2152
|
+
"aria-label": L(i)("documents.history.searchVersionHistoryDocuments"),
|
|
2153
|
+
class: "w-full min-w-0 @min-[40rem]:w-80",
|
|
2154
|
+
ui: { trailing: "pe-1" }
|
|
2155
|
+
}, re({ _: 2 }, [l.value ? {
|
|
2156
|
+
name: "trailing",
|
|
2157
|
+
fn: G(() => [K(s, {
|
|
2158
|
+
icon: "i-lucide-x",
|
|
2159
|
+
"aria-label": L(i)("documents.history.clearHistorySearch"),
|
|
2160
|
+
size: "xs",
|
|
2161
|
+
variant: "ghost",
|
|
2162
|
+
onClick: S
|
|
2163
|
+
}, null, 8, ["aria-label"])]),
|
|
2164
|
+
key: "0"
|
|
2165
|
+
} : void 0]), 1032, [
|
|
2166
|
+
"modelValue",
|
|
2167
|
+
"placeholder",
|
|
2168
|
+
"aria-label"
|
|
2169
|
+
]),
|
|
2170
|
+
K(h, {
|
|
2171
|
+
"model-value": u.value || "all",
|
|
2172
|
+
items: m.value,
|
|
2173
|
+
"aria-label": L(i)("documents.history.filterHistoryByCollection"),
|
|
2174
|
+
class: "w-full @min-[40rem]:w-48",
|
|
2175
|
+
"onUpdate:modelValue": r[1] ||= (e) => u.value = e === "all" ? "" : String(e)
|
|
2176
|
+
}, null, 8, [
|
|
2177
|
+
"model-value",
|
|
2178
|
+
"items",
|
|
2179
|
+
"aria-label"
|
|
2180
|
+
]),
|
|
2181
|
+
l.value ? (J(), F(s, {
|
|
2182
|
+
key: 0,
|
|
2183
|
+
label: L(i)("documents.history.clearSearch"),
|
|
2184
|
+
variant: "link",
|
|
2185
|
+
size: "sm",
|
|
2186
|
+
onClick: S
|
|
2187
|
+
}, null, 8, ["label"])) : H("", !0)
|
|
2188
|
+
]),
|
|
2189
|
+
_: 1
|
|
2190
|
+
}), Y("div", _r, [Y("div", vr, [Y("span", yr, [K(g, {
|
|
2191
|
+
name: "i-lucide-arrow-down-wide-narrow",
|
|
2192
|
+
class: "size-4"
|
|
2193
|
+
}), te(q(L(i)("documents.history.recentlySaved")), 1)])]), K(qe, {
|
|
2194
|
+
data: y.value,
|
|
2195
|
+
columns: x.value,
|
|
2196
|
+
"get-row-id": (e) => e.id,
|
|
2197
|
+
ui: {
|
|
2198
|
+
root: "min-w-0 overflow-x-auto",
|
|
2199
|
+
thead: "block",
|
|
2200
|
+
tr: "grid min-w-[56rem] grid-cols-[minmax(0,1fr)_7rem_8rem_12rem_9rem] items-center",
|
|
2201
|
+
th: "min-w-0 px-4 py-3",
|
|
2202
|
+
td: "min-w-0 px-4 py-1 text-sm"
|
|
2203
|
+
}
|
|
2204
|
+
}, {
|
|
2205
|
+
"title-cell": G(({ row: e }) => [Y("button", {
|
|
2206
|
+
type: "button",
|
|
2207
|
+
title: `${e.original.title} · ${e.original.path}`,
|
|
2208
|
+
"aria-label": L(i)("documents.history.reviewSavedVersionsOfTitle", { title: e.original.title }),
|
|
2209
|
+
class: "flex min-h-11 w-full min-w-0 items-center text-left font-medium text-highlighted hover:underline focus-visible:rounded focus-visible:outline-2 focus-visible:outline-primary",
|
|
2210
|
+
onClick: (t) => c("select", e.original.id)
|
|
2211
|
+
}, [Y("span", xr, q(e.original.title), 1)], 8, br)]),
|
|
2212
|
+
"collection-cell": G(({ row: e }) => [Y("span", {
|
|
2213
|
+
class: "block truncate text-muted",
|
|
2214
|
+
title: p.value.get(e.original.collection) ?? e.original.collection
|
|
2215
|
+
}, q(p.value.get(e.original.collection) ?? e.original.collection), 9, Sr)]),
|
|
2216
|
+
"translationLocales-cell": G(({ row: e }) => [Y("span", {
|
|
2217
|
+
class: "block truncate text-muted",
|
|
2218
|
+
title: v(e.original)
|
|
2219
|
+
}, q(v(e.original)), 9, Cr)]),
|
|
2220
|
+
"savedAt-cell": G(({ row: e }) => [Y("time", {
|
|
2221
|
+
datetime: e.original.savedAt,
|
|
2222
|
+
title: L(a)(e.original.savedAt, {
|
|
2223
|
+
dateStyle: "medium",
|
|
2224
|
+
timeStyle: "short"
|
|
2225
|
+
}),
|
|
2226
|
+
class: "block truncate text-muted"
|
|
2227
|
+
}, q(L(a)(e.original.savedAt, {
|
|
2228
|
+
dateStyle: "medium",
|
|
2229
|
+
timeStyle: "short"
|
|
2230
|
+
})), 9, wr)]),
|
|
2231
|
+
"savedByName-cell": G(({ row: e }) => [Y("span", {
|
|
2232
|
+
class: "block truncate text-muted",
|
|
2233
|
+
title: e.original.savedByName ?? L(i)("documents.history.unknownAuthor")
|
|
2234
|
+
}, q(e.original.savedByName ?? L(i)("documents.history.unknownAuthor")), 9, Tr)]),
|
|
2235
|
+
empty: G(() => [K(_, {
|
|
2236
|
+
title: l.value ? L(i)("documents.history.noMatchingDocuments") : L(i)("documents.history.noEarlierVersionsYet"),
|
|
2237
|
+
description: l.value ? L(i)("documents.history.tryAnotherDocumentTitleAddressOrLanguage") : L(i)("documents.history.documentsAppearHereAfterSavingChangesAt"),
|
|
2238
|
+
icon: "i-lucide-history",
|
|
2239
|
+
variant: "naked",
|
|
2240
|
+
class: "py-14"
|
|
2241
|
+
}, re({ _: 2 }, [l.value ? {
|
|
2242
|
+
name: "actions",
|
|
2243
|
+
fn: G(() => [K(s, {
|
|
2244
|
+
label: L(i)("documents.history.clearSearch"),
|
|
2245
|
+
variant: "outline",
|
|
2246
|
+
onClick: S
|
|
2247
|
+
}, null, 8, ["label"])]),
|
|
2248
|
+
key: "0"
|
|
2249
|
+
} : void 0]), 1032, ["title", "description"])]),
|
|
2250
|
+
_: 1
|
|
2251
|
+
}, 8, [
|
|
2252
|
+
"data",
|
|
2253
|
+
"columns",
|
|
2254
|
+
"get-row-id"
|
|
2255
|
+
])])]),
|
|
2256
|
+
_: 1
|
|
2257
|
+
}, 8, ["title", "summary"]);
|
|
2258
|
+
};
|
|
2259
|
+
}
|
|
2260
|
+
}), Dr = {
|
|
2261
|
+
key: 2,
|
|
2262
|
+
class: "flex min-h-0 min-w-0 flex-1 flex-col"
|
|
2263
|
+
}, Or = { class: "truncate text-sm font-medium" }, kr = /* @__PURE__ */ V({
|
|
2264
|
+
__name: "VersionsPage",
|
|
2265
|
+
setup(e) {
|
|
2266
|
+
let { t } = h(), n = k(), r = He(), { selectedId: i, selectedItem: o } = r, s = O(), c = j(), l = M(), u = z({
|
|
2267
|
+
get: () => m(a)(l.query.collection) ? l.query.collection : "",
|
|
2268
|
+
set: (e) => {
|
|
2269
|
+
c.replace({
|
|
2270
|
+
name: "versions",
|
|
2271
|
+
query: e ? { collection: e } : {}
|
|
2272
|
+
});
|
|
2273
|
+
}
|
|
2274
|
+
}), d = Q("");
|
|
2275
|
+
function f(e) {
|
|
2276
|
+
c.push({
|
|
2277
|
+
name: "versions",
|
|
2278
|
+
params: { documentId: e },
|
|
2279
|
+
query: l.query
|
|
2280
|
+
});
|
|
2281
|
+
}
|
|
2282
|
+
let p = We(() => i.value ? Ge.editor(i.value) : void 0, void 0), g = z(() => p.data.value?.revision), _ = z(() => p.data.value?.hasWorkingChanges ?? !1), v = p.error, y = p.refresh, b = z(() => s.configuration.collections.find((e) => e.collection === o.value?.collection));
|
|
2283
|
+
return (e, a) => {
|
|
2284
|
+
let o = we, c = Ve, l = Xe;
|
|
2285
|
+
return L(i) && g.value ? (J(), F(gr, {
|
|
2286
|
+
key: L(i),
|
|
2287
|
+
"document-id": L(i),
|
|
2288
|
+
"latest-revision-id": g.value.revisionId,
|
|
2289
|
+
"document-version": g.value.documentVersion,
|
|
2290
|
+
"field-definitions": b.value?.fields,
|
|
2291
|
+
"has-pending-changes": _.value,
|
|
2292
|
+
onClose: a[0] ||= (e) => L(r).select(L(i)),
|
|
2293
|
+
onConflict: L(y)
|
|
2294
|
+
}, null, 8, [
|
|
2295
|
+
"document-id",
|
|
2296
|
+
"latest-revision-id",
|
|
2297
|
+
"document-version",
|
|
2298
|
+
"field-definitions",
|
|
2299
|
+
"has-pending-changes",
|
|
2300
|
+
"onConflict"
|
|
2301
|
+
])) : L(i) ? (J(), U("div", Dr, [K(o, {
|
|
2302
|
+
toggle: !1,
|
|
2303
|
+
class: "lg:hidden"
|
|
2304
|
+
}, {
|
|
2305
|
+
left: G(() => [Y("span", Or, q(L(n).document.history), 1)]),
|
|
2306
|
+
_: 1
|
|
2307
|
+
}), K(Ke, {
|
|
2308
|
+
title: L(n).document.history,
|
|
2309
|
+
description: L(t)("versions-page.review-this-documents-saved-versions")
|
|
2310
|
+
}, {
|
|
2311
|
+
default: G(() => [L(v) ? (J(), F(c, {
|
|
2312
|
+
key: 0,
|
|
2313
|
+
description: L(v),
|
|
2314
|
+
color: "error",
|
|
2315
|
+
role: "alert",
|
|
2316
|
+
actions: [{
|
|
2317
|
+
label: L(n).actions.retry,
|
|
2318
|
+
color: "error",
|
|
2319
|
+
variant: "soft",
|
|
2320
|
+
onClick: L(y)
|
|
2321
|
+
}]
|
|
2322
|
+
}, null, 8, ["description", "actions"])) : (J(), F(l, {
|
|
2323
|
+
key: 1,
|
|
2324
|
+
class: "h-20",
|
|
2325
|
+
"aria-label": L(t)("versions-page.loading-version-history")
|
|
2326
|
+
}, null, 8, ["aria-label"]))]),
|
|
2327
|
+
_: 1
|
|
2328
|
+
}, 8, ["title", "description"])])) : (J(), F(Er, {
|
|
2329
|
+
key: 1,
|
|
2330
|
+
search: d.value,
|
|
2331
|
+
"onUpdate:search": a[1] ||= (e) => d.value = e,
|
|
2332
|
+
collection: u.value,
|
|
2333
|
+
"onUpdate:collection": a[2] ||= (e) => u.value = e,
|
|
2334
|
+
items: L(s).items,
|
|
2335
|
+
collections: L(s).configuration.collections,
|
|
2336
|
+
locales: L(s).configuration.locales ?? void 0,
|
|
2337
|
+
onSelect: f
|
|
2338
|
+
}, null, 8, [
|
|
2339
|
+
"search",
|
|
2340
|
+
"collection",
|
|
2341
|
+
"items",
|
|
2342
|
+
"collections",
|
|
2343
|
+
"locales"
|
|
2344
|
+
]));
|
|
2345
|
+
};
|
|
2346
|
+
}
|
|
2347
|
+
});
|
|
2348
|
+
//#endregion
|
|
2349
|
+
export { kr as default };
|