@blinkk/root-cms 3.0.2 → 3.0.4
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/dist/app.js +5 -5
- package/dist/{chunk-2BSW7SIH.js → chunk-N4K6ICFR.js} +4 -4
- package/dist/{chunk-BGTUWIV6.js → chunk-PNLLZXVY.js} +4 -4
- package/dist/{chunk-3HARN4U6.js → chunk-RLZFZT42.js} +176 -83
- package/dist/{chunk-C245C557.js → chunk-RXWDB3K4.js} +3 -3
- package/dist/{chunk-XLX37FRL.js → chunk-TEKMLYXS.js} +3 -4
- package/dist/cli/cli.d.ts +12 -0
- package/dist/cli/docs.d.ts +49 -0
- package/dist/cli/export.d.ts +11 -0
- package/dist/cli/generate-types.d.ts +6 -0
- package/dist/cli/import.d.ts +13 -0
- package/dist/cli/init-firebase.d.ts +7 -0
- package/dist/cli/utils.d.ts +27 -0
- package/dist/cli.js +10 -10
- package/dist/client.js +1 -1
- package/dist/core/ai-tools.d.ts +156 -0
- package/dist/core/ai.d.ts +330 -0
- package/dist/core/api.d.ts +21 -0
- package/dist/core/app.d.ts +16 -0
- package/dist/core/checks-translations.d.ts +13 -0
- package/dist/core/checks.d.ts +48 -0
- package/dist/core/client.d.ts +715 -0
- package/dist/core/core.d.ts +5 -0
- package/dist/core/cron.d.ts +19 -0
- package/dist/core/csv.d.ts +5 -0
- package/dist/core/functions.d.ts +9 -0
- package/dist/core/plugin.d.ts +357 -0
- package/dist/{project.d.ts → core/project.d.ts} +8 -12
- package/dist/core/richtext.d.ts +101 -0
- package/dist/{core.d.ts → core/route.d.ts} +13 -66
- package/dist/core/runtime.d.ts +46 -0
- package/dist/{schema-Db_xODoi.d.ts → core/schema.d.ts} +47 -100
- package/dist/core/search-extract.d.ts +70 -0
- package/dist/core/search-index.d.ts +182 -0
- package/dist/core/search-query.d.ts +68 -0
- package/dist/core/security.d.ts +6 -0
- package/dist/core/server-version.d.ts +5 -0
- package/dist/core/services-notifications.d.ts +57 -0
- package/dist/core/services.d.ts +44 -0
- package/dist/core/sse.d.ts +10 -0
- package/dist/core/translations-manager.d.ts +187 -0
- package/dist/core/translations.d.ts +83 -0
- package/dist/core/url-safety.d.ts +19 -0
- package/dist/core/validation.d.ts +30 -0
- package/dist/core/values.d.ts +9 -0
- package/dist/core/versions.d.ts +48 -0
- package/dist/core.js +1 -1
- package/dist/edit-M4PN4SGX.js +7 -0
- package/dist/functions.js +4 -4
- package/dist/{generate-types-SPV7I3A5.js → generate-types-JWIG4QVI.js} +1 -1
- package/dist/plugin.js +128 -133
- package/dist/shared/marshal.d.ts +68 -0
- package/dist/shared/objects.d.ts +9 -0
- package/dist/shared/richtext.d.ts +74 -0
- package/dist/shared/safe-json.d.ts +11 -0
- package/dist/shared/sanitize.d.ts +12 -0
- package/dist/shared/slug.d.ts +19 -0
- package/dist/shared/sse.d.ts +16 -0
- package/dist/shared/strings.d.ts +23 -0
- package/dist/ui/AIPage-YI3RFK5F.js +1 -0
- package/dist/ui/AssetsPage-4JNAOFYF.js +1 -0
- package/dist/ui/CollectionPage-JWHH5G55.js +1 -0
- package/dist/ui/ComparePage-YZE3EMU4.js +1 -0
- package/dist/ui/DataPage-VRCQSZZG.js +1 -0
- package/dist/ui/DataSourcePage-WMSPBZ3W.js +1 -0
- package/dist/ui/DocTranslationsPage-RY2LOZBX.js +1 -0
- package/dist/ui/DocumentPage-EEGTJMIW.js +1 -0
- package/dist/ui/EditDataSourcePage-LLCX6K4J.js +1 -0
- package/dist/ui/EditReleasePage-WQYXXMZQ.js +1 -0
- package/dist/ui/ImageEditorDialog-4H665KK2.js +81 -0
- package/dist/ui/ImageEditorDialog-4H665KK2.js.LEGAL.txt +17 -0
- package/dist/ui/LogsPage-IP2DKEYR.js +1 -0
- package/dist/ui/NewDataSourcePage-RDYJC4DH.js +1 -0
- package/dist/ui/NewReleasePage-DGMFU2JN.js +1 -0
- package/dist/ui/NotFoundPage-WDZ2K7EF.js +1 -0
- package/dist/ui/ProjectPage-HYJOQUWR.js +1 -0
- package/dist/ui/ReleasePage-2KSF23TK.js +1 -0
- package/dist/ui/ReleasesPage-NZIBBXU4.js +1 -0
- package/dist/ui/SettingsPage-36XFWV62.js +1 -0
- package/dist/ui/SidebarToolsPage-5C6YBWJ7.js +1 -0
- package/dist/ui/TaskPage-SPIFPGPP.js +1 -0
- package/dist/ui/TasksPage-ZOXRPBQV.js +1 -0
- package/dist/ui/TranslationsArbPage-UHANA7JD.js +2 -0
- package/dist/ui/TranslationsEditPage-PQY6W5YG.js +1 -0
- package/dist/ui/TranslationsPage-V2PQFCN5.js +162 -0
- package/dist/ui/ai-tools-5E5ELLZX.js +1 -0
- package/dist/ui/chunk-3IYZCUPI.js +1 -0
- package/dist/ui/chunk-4KE2SZKH.js +1 -0
- package/dist/ui/chunk-4W73RW5I.js +1 -0
- package/dist/ui/chunk-54DVDYU6.js +1 -0
- package/dist/ui/chunk-5MV6XVGA.js +1 -0
- package/dist/ui/chunk-62UWGWON.js +1 -0
- package/dist/ui/chunk-767BAQ53.js +1 -0
- package/dist/ui/chunk-AFWBSIPL.js +1 -0
- package/dist/ui/chunk-AL3TN2KI.js +1 -0
- package/dist/ui/chunk-BZIRGB4W.js +1 -0
- package/dist/ui/chunk-C5NH23G4.js +3 -0
- package/dist/ui/chunk-CGCKJFL4.js +1 -0
- package/dist/ui/chunk-DEGMKEHP.js +1 -0
- package/dist/ui/chunk-DTMZLUNY.js +15 -0
- package/dist/ui/chunk-DTMZLUNY.js.LEGAL.txt +237 -0
- package/dist/ui/chunk-DUJYIOLE.js +5 -0
- package/dist/ui/chunk-E2RCCK2T.js +1 -0
- package/dist/ui/chunk-EGEB6N4J.js +22 -0
- package/dist/ui/chunk-EGEB6N4J.js.LEGAL.txt +1059 -0
- package/dist/ui/chunk-FBJURT7Z.js +1 -0
- package/dist/ui/chunk-GXSAEPU3.js +1 -0
- package/dist/ui/chunk-HHMG665Z.js +1 -0
- package/dist/ui/chunk-HKINZLMW.js +84 -0
- package/dist/ui/chunk-HLMBCVRX.js +1 -0
- package/dist/ui/chunk-HRGYNHZ3.js +1 -0
- package/dist/ui/chunk-I6ICVKEC.js +1 -0
- package/dist/ui/chunk-JDW4UORS.js +1 -0
- package/dist/ui/chunk-JHBAMPGB.js +1 -0
- package/dist/ui/chunk-JT5L6GPZ.js +141 -0
- package/dist/ui/chunk-JT5L6GPZ.js.LEGAL.txt +106 -0
- package/dist/ui/chunk-JYFLU7DM.js +19 -0
- package/dist/ui/chunk-JZFTZ4X4.js +87 -0
- package/dist/ui/chunk-JZFTZ4X4.js.LEGAL.txt +9 -0
- package/dist/ui/chunk-KFAZBEPV.js +1 -0
- package/dist/ui/chunk-KKEWCXVV.js +1 -0
- package/dist/ui/chunk-KUCVLANF.js +1 -0
- package/dist/ui/chunk-KYDOSLTO.js +1 -0
- package/dist/ui/chunk-L4RHGQUG.js +1 -0
- package/dist/ui/chunk-MDUBCXU2.js +1 -0
- package/dist/ui/chunk-NXQVLOTK.js +1 -0
- package/dist/ui/chunk-NZHF733K.js +7 -0
- package/dist/ui/chunk-NZHF733K.js.LEGAL.txt +146 -0
- package/dist/ui/chunk-ONTGW2VA.js +1 -0
- package/dist/ui/chunk-ORXEMIQC.js +1 -0
- package/dist/ui/chunk-P3NETZZP.js +1 -0
- package/dist/ui/chunk-PHBMVORG.js +1 -0
- package/dist/ui/chunk-PJA7YP4A.js +1 -0
- package/dist/ui/chunk-PVAE643M.js +1 -0
- package/dist/ui/chunk-PWKJDYE2.js +1 -0
- package/dist/ui/chunk-RSVO46S3.js +1 -0
- package/dist/ui/chunk-SKEP5WYH.js +10 -0
- package/dist/ui/chunk-SKEP5WYH.js.LEGAL.txt +176 -0
- package/dist/ui/chunk-SQRKKWRG.js +3 -0
- package/dist/ui/chunk-TJBVMFNQ.js +1 -0
- package/dist/ui/chunk-V7S4IAGB.js +1 -0
- package/dist/ui/chunk-VMT7JFAM.js +1 -0
- package/dist/ui/chunk-W3BJ2EZX.js +1 -0
- package/dist/ui/chunk-W3HIZQ4Z.js +1 -0
- package/dist/ui/chunk-X2WHBGTP.js +1 -0
- package/dist/ui/chunk-XOQ3KDSR.js +3 -0
- package/dist/ui/chunk-YDO2EDVY.js +1 -0
- package/dist/ui/chunk-YFA6U2CV.js +1 -0
- package/dist/ui/gcs-L33FIRZU.js +1 -0
- package/dist/ui/prerender-Q4YSDCPB.js +1 -0
- package/dist/ui/signin.js +1 -1
- package/dist/ui/ui.css +1 -1
- package/dist/ui/ui.js +1 -630
- package/dist/ui/ui.js.LEGAL.txt +19 -732
- package/package.json +20 -20
- package/dist/client-1puwLgNx.d.ts +0 -1552
- package/dist/client.d.ts +0 -5
- package/dist/edit-MT4B37QK.js +0 -7
- package/dist/functions.d.ts +0 -13
- package/dist/plugin.d.ts +0 -5
- package/dist/richtext.d.ts +0 -104
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as h,f as d,g as W}from"./chunk-AL3TN2KI.js";import{$ as w,Ac as P,Dc as U,Eb as T,Ga as B,Ha as t,Nb as I,S as k,Sb as H,Y as L,Za as j,a as C,ba as S,c as g,cc as O,gb as N,j as x,nc as R,pb as M,ra as b,vc as z,wc as Z}from"./chunk-NZHF733K.js";import{d as m}from"./chunk-KUCVLANF.js";x();function F(e){g(()=>{let o=window.__ROOT_CTX?.rootConfig,a=o?.projectName||"Root CMS",s=o?.minimalBranding?a:`${a} \u2013 Root CMS`;document.title=e?`${e} \u2013 ${s}`:s},[e])}var f={name:"@blinkk/root-cms",version:"3.0.4",author:"s@blinkk.com",license:"MIT",engines:{node:">=22.0.0"},repository:{type:"git",url:"git+https://github.com/blinkk/rootjs.git",directory:"packages/root-cms"},files:["dist/**/*"],bin:{"root-cms":"./bin/root-cms.js"},type:"module",module:"./dist/core.js",types:"./dist/core/core.d.ts",exports:{".":{types:"./dist/core/core.d.ts",import:"./dist/core.js"},"./client":{types:"./dist/core/client.d.ts",import:"./dist/client.js"},"./core":{types:"./dist/core/core.d.ts",import:"./dist/core.js"},"./functions":{types:"./dist/core/functions.d.ts",import:"./dist/functions.js"},"./plugin":{types:"./dist/core/plugin.d.ts",import:"./dist/plugin.js"},"./project":{types:"./dist/core/project.d.ts",import:"./dist/project.js"},"./richtext":{types:"./dist/core/richtext.d.ts",import:"./dist/richtext.js"}},scripts:{build:'rm -rf dist && concurrently -n "core,signin,ui" npm:build:core npm:build:signin npm:build:ui',"build:core":"node ../../scripts/build-esbuild.mjs ./esbuild.config.json","build:ui":"pnpm build:ui:bundle && pnpm build:ui:clean","build:ui:bundle":"esbuild ui/ui.tsx --bundle --minify --alias:react=@preact/compat --alias:react-dom=@preact/compat --tsconfig=ui/tsconfig.json --outdir=dist/ui --legal-comments=external --splitting --format=esm","build:ui:clean":"rm -f dist/ui/*-*.css","build:signin":"esbuild signin/signin.tsx --bundle --minify --tsconfig=signin/tsconfig.json --outdir=dist/ui --legal-comments=external",dev:'rm -rf dist && concurrently -k -n "core,ui" npm:dev:core npm:dev:signin npm:dev:ui',"dev:core":"pnpm build:core --watch","dev:signin":"pnpm build:signin --watch","dev:ui":"pnpm build:ui:bundle --watch",test:"pnpm build && firebase emulators:exec 'vitest run --exclude=**/*.visual.test.tsx'","test:visual":"vitest run --config=vitest.config.visual.ts","test:watch":"pnpm build && firebase emulators:exec 'vitest'"},dependencies:{"@ag-grid-community/client-side-row-model":"32.3.9","@ag-grid-community/core":"32.3.9","@ag-grid-community/react":"32.3.9","@ag-grid-community/styles":"32.3.9","@ai-sdk/anthropic":"3.0.74","@ai-sdk/google":"3.0.67","@ai-sdk/openai":"3.0.60","@ai-sdk/openai-compatible":"2.0.46","@ai-sdk/react":"3.0.177",ai:"6.0.175",zod:"4.4.3","@google-cloud/firestore":"7.11.3","@hello-pangea/dnd":"18.0.1","@types/cli-progress":"3.11.6","body-parser":"1.20.2","cli-progress":"3.12.0",commander:"11.0.0","csv-parse":"5.5.2","csv-stringify":"6.4.4","date-fns":"4.1.0","date-fns-tz":"3.2.0",diff:"8.0.2","dts-dom":"3.7.0","@mantine/spotlight":"4.2.12","fnv-plus":"1.3.1",jsonwebtoken:"9.0.2",kleur:"4.1.5",minisearch:"7.2.0","sanitize-html":"2.13.1",sirv:"2.0.3","tiny-glob":"0.2.9"},"//":"NOTE(stevenle): due to compat issues with mantine and preact, mantine is pinned to v4.2.12",devDependencies:{"@babel/core":"7.17.9","@blinkk/root":"workspace:*","@editorjs/editorjs":"2.30.8","@editorjs/header":"2.8.8","@editorjs/image":"2.10.2","@editorjs/list":"2.0.6","@editorjs/nested-list":"1.4.3","@editorjs/raw":"2.5.1","@editorjs/table":"2.4.4","@editorjs/underline":"1.2.1","@emotion/react":"11.10.5","@firebase/app-compat":"0.5.2","@firebase/app-types":"0.9.3","@firebase/rules-unit-testing":"5.0.0","@lexical/code":"0.33.1","@lexical/html":"0.33.1","@lexical/link":"0.33.1","@lexical/list":"0.33.1","@lexical/markdown":"0.33.1","@lexical/react":"0.33.1","@lexical/rich-text":"0.33.1","@lexical/selection":"0.33.1","@lexical/table":"0.33.1","@lexical/utils":"0.33.1","@mantine/core":"4.2.12","@mantine/hooks":"4.2.12","@mantine/modals":"4.2.12","@mantine/notifications":"4.2.12","@preact/compat":"18.3.1","@tabler/icons-preact":"3.35.0","@testing-library/preact":"3.2.4","@testing-library/user-event":"14.6.1","@types/body-parser":"1.19.3","@types/fnv-plus":"1.3.2","@types/gapi":"0.0.47","@types/gapi.client.drive-v3":"0.0.4","@types/gapi.client.sheets-v4":"0.0.4","@types/google.accounts":"0.0.14","@types/jsonwebtoken":"9.0.1","@types/node":"24.3.1","@types/sanitize-html":"2.13.0","@vitest/browser":"4.1.6","@vitest/browser-playwright":"4.1.6",concurrently:"7.6.0",esbuild:"0.28.0",firebase:"12.2.1","firebase-admin":"13.5.0","firebase-functions":"6.4.0","firebase-tools":"14.15.2","highlight.js":"11.6.0",jsdom:"27.2.0","json-diff-kit":"1.0.29",lexical:"0.33.1",marked:"9.1.1","mdast-util-from-markdown":"2.0.1","mdast-util-gfm":"3.0.0","micromark-extension-gfm":"3.0.0",playwright:"1.56.1",preact:"10.27.1","preact-iso":"2.11.1","preact-render-to-string":"6.6.7",react:"npm:@preact/compat@18.3.1","react-dom":"npm:@preact/compat@18.3.1","react-easy-crop":"5.5.6","react-json-view-compare":"2.0.2",typescript:"6.0.3",vite:"8.0.13",vitest:"4.1.6",yjs:"13.6.27"},peerDependencies:{"@blinkk/root":"3.0.4","firebase-admin":">=11","firebase-functions":">=4"},peerDependenciesMeta:{"firebase-functions":{optional:!0}}};function V(){return t("svg",{width:"100",height:"23",viewBox:"0 0 100 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("g",{"clip-path":"url(#clip0_1_318)",children:[t("path",{d:"M7.82998 5.01802C3.12925 5.6479 0.833937 18.1194 2.62578 19.6731C5.64773 22.2934 16.6441 14.1722 15.6786 9.46913C15.3009 6.61371 11.2717 4.28377 7.82998 5.01802Z",fill:"black"}),t("path",{d:"M13.9782 0.720147C12.6553 0.896474 12.0093 4.38767 12.5136 4.8226C13.364 5.55611 16.4587 3.28271 16.187 1.96616C16.0807 1.16683 14.9468 0.514607 13.9782 0.720147Z",fill:"black"}),t("path",{d:"M92.7383 17.6275C90.9681 17.6275 89.3816 17.0263 88.3796 16.0744C87.9955 15.7237 87.8953 15.3396 88.246 14.9555L88.8305 14.2541C89.1645 13.87 89.5486 13.7865 89.9327 14.1205C90.6007 14.6883 91.7029 15.1726 92.5713 15.1726C93.5232 15.1726 94.1244 14.8219 94.1244 14.2875C94.1244 13.5193 93.2059 13.4358 91.9868 13.0684C90.417 12.6008 88.5132 11.7324 88.5132 9.64493C88.5132 7.70773 90.25 6.37173 92.7383 6.37173C94.2413 6.37173 95.5272 6.87273 96.4123 7.57413C96.8131 7.90813 96.9467 8.27553 96.596 8.67633L96.0282 9.37773C95.7109 9.76183 95.3435 9.82863 94.926 9.51133C94.3916 9.09383 93.6568 8.69303 92.7884 8.69303C92.0202 8.69303 91.5192 9.01033 91.5192 9.51133C91.5192 10.1292 92.3041 10.4131 93.1224 10.6636C94.9761 11.2314 97.1304 11.8326 97.1304 14.2708C97.1304 16.4585 95.1264 17.6275 92.7383 17.6275Z",fill:"black"}),t("path",{d:"M87.0008 16.6756C87.0843 17.1766 86.8171 17.4271 86.2994 17.4271H85.097C84.596 17.4271 84.3789 17.1766 84.3121 16.6756L83.7443 11.9161L81.757 16.7424C81.5399 17.2434 81.1892 17.5106 80.6882 17.5106H80.5212C80.0202 17.5106 79.6695 17.2434 79.4524 16.7424L77.4651 11.8994L76.8973 16.6756C76.8472 17.1766 76.6301 17.4271 76.1291 17.4271H74.7263C74.2086 17.4271 73.9414 17.1766 74.0082 16.6756L75.4945 7.24013C75.5613 6.75583 75.8786 6.48863 76.3796 6.48863H76.5466C77.0476 6.48863 77.3315 6.75583 77.5486 7.24013L80.6047 13.8032L83.4938 7.24013C83.7109 6.75583 84.0115 6.48863 84.4958 6.48863H84.6795C85.1638 6.48863 85.4811 6.75583 85.5646 7.24013L87.0008 16.6756Z",fill:"black"}),t("path",{d:"M68.6496 17.6275C65.3096 17.6275 62.7211 15.2227 62.7211 11.9996C62.7211 8.77653 65.3096 6.37173 68.683 6.37173C70.3029 6.37173 71.7558 6.97293 72.7745 7.99163C73.1419 8.34233 73.1419 8.77653 72.7745 9.09383L71.9228 9.81193C71.5554 10.1292 71.2047 10.1125 70.8206 9.79523C70.2361 9.31093 69.5013 9.01033 68.683 9.01033C67.013 9.01033 65.7104 10.2628 65.7104 11.9996C65.7104 13.7364 67.013 14.9889 68.683 14.9889C69.5013 14.9889 70.2528 14.6883 70.8206 14.204C71.2047 13.8867 71.5554 13.87 71.9228 14.1873L72.7745 14.9054C73.1419 15.2227 73.1419 15.6569 72.7745 16.0076C71.7558 17.0263 70.3029 17.6275 68.6496 17.6275Z",fill:"black"}),t("path",{d:"M58.575 16.2915C58.7587 16.6923 58.4581 16.8927 58.241 17.0597C57.7233 17.4271 56.9384 17.6442 56.1201 17.6442C54.4501 17.6442 52.8469 16.6923 52.8469 14.4044V11.0978H52.1121C51.6111 11.0978 51.3439 10.8139 51.3439 10.3296V9.76183C51.3439 9.26083 51.6111 8.99363 52.1121 8.99363H52.8469V7.05643C52.8469 6.57213 53.1308 6.38843 53.6151 6.28823L54.9511 6.05443C55.4521 5.95423 55.7193 6.30493 55.7193 6.80593V8.99363H57.3726C57.8569 8.99363 58.1408 9.26083 58.1408 9.76183V10.3296C58.1408 10.8139 57.8569 11.0978 57.3726 11.0978H55.7193V14.1038C55.7193 14.9221 56.1368 15.1893 56.6545 15.1893C56.905 15.1893 57.1555 15.0724 57.3392 14.9555C57.7567 14.6883 57.9571 14.8887 58.1074 15.206L58.575 16.2915Z",fill:"black"}),t("path",{d:"M46.2592 17.6442C43.5538 17.6442 41.5999 15.7738 41.5999 13.2521C41.5999 10.7304 43.5538 8.86003 46.2592 8.86003C48.9646 8.86003 50.9185 10.7304 50.9185 13.2521C50.9185 15.7738 48.9646 17.6442 46.2592 17.6442ZM46.2592 15.1726C47.3113 15.1726 48.0628 14.3543 48.0628 13.2521C48.0628 12.1499 47.3113 11.3316 46.2592 11.3316C45.2071 11.3316 44.4389 12.1499 44.4389 13.2521C44.4389 14.3543 45.2071 15.1726 46.2592 15.1726Z",fill:"black"}),t("path",{d:"M36.052 17.6442C33.3466 17.6442 31.3927 15.7738 31.3927 13.2521C31.3927 10.7304 33.3466 8.86003 36.052 8.86003C38.7574 8.86003 40.7113 10.7304 40.7113 13.2521C40.7113 15.7738 38.7574 17.6442 36.052 17.6442ZM36.052 15.1726C37.1041 15.1726 37.8556 14.3543 37.8556 13.2521C37.8556 12.1499 37.1041 11.3316 36.052 11.3316C34.9999 11.3316 34.2317 12.1499 34.2317 13.2521C34.2317 14.3543 34.9999 15.1726 36.052 15.1726Z",fill:"black"}),t("path",{d:"M28.7099 13.0851L30.6805 16.6422C30.9644 17.1599 30.6638 17.4271 30.1628 17.4271H28.4594C27.9417 17.4271 27.8081 17.1766 27.5242 16.6589L25.7707 13.4859H24.6351V16.6422C24.6351 17.1432 24.3512 17.4271 23.8502 17.4271H22.4808C21.9798 17.4271 21.6959 17.1432 21.6959 16.6422V7.35703C21.6959 6.85603 21.9798 6.57213 22.4808 6.57213H26.5222C29.3111 6.57213 30.8141 7.92483 30.8141 10.1125C30.8141 11.5654 29.9791 12.5841 28.7099 13.0851ZM24.6351 8.96023V11.5153H26.4721C27.2236 11.5153 27.8248 11.0644 27.8248 10.2628C27.8248 9.44453 27.2236 8.96023 26.4721 8.96023H24.6351Z",fill:"black"})]}),t("defs",{children:t("clipPath",{id:"clip0_1_318",children:t("rect",{width:"99",height:"22",fill:"white",transform:"translate(0.0175781 0.177246)"})})})]})}x();function D(e){let[o,a]=C(!1);g(()=>{let c=navigator.userAgentData?.platform??navigator.platform;a(/mac/i.test(c||""))},[]);let s=()=>{W()};return t("button",{type:"button",className:d("SearchBar",e.className),onClick:s,"aria-label":"Open search",children:[t(P,{className:"SearchBar__icon",size:16,stroke:1.5}),t("span",{className:"SearchBar__placeholder",children:"Search"}),t("span",{className:"SearchBar__shortcut","aria-hidden":"true",children:o?"\u2318 + K":"Ctrl + K"})]})}var r="1.5";function i(e){return t("div",{className:"Layout",children:[t(i.Top,{}),t(i.Side,{}),t(i.Main,{...e,children:e.children}),t(i.Bottom,{})]})}function G(e){let a=e.split("?")[0].replace(/\/+$/g,"").split("/").filter(Boolean);return a.length===4&&a[0]==="cms"&&a[1]==="content"}i.Top=()=>{let e=window.__ROOT_CTX.rootConfig,o=e.projectName||e.projectId,a=e.minimalBranding,{url:s}=h(),c=!G(s);return t("div",{className:"Layout__top",children:[a?t(m,{children:[t("a",{className:"Layout__top__logo",href:"/cms",children:o}),t("a",{className:"Layout__top__version",href:"https://github.com/blinkk/rootjs/blob/main/packages/root-cms/CHANGELOG.md",target:"_blank",rel:"noreferrer noopener",children:["v",f.version]})]}):t(m,{children:[t("a",{className:"Layout__top__logo",href:"/cms",children:t(V,{})}),t("a",{className:"Layout__top__version",href:"https://github.com/blinkk/rootjs/blob/main/packages/root-cms/CHANGELOG.md",target:"_blank",rel:"noreferrer noopener",children:["v",f.version]}),t("div",{className:"Layout__top__project",children:o})]}),c&&t("div",{className:"Layout__top__search",children:t(D,{})})]})};i.Side=()=>{let{url:e}=h(),o=e.replace(/\/*$/g,""),a=window.firebase.user,s=window.__ROOT_CTX.sidebar?.tools,c=new Set(window.__ROOT_CTX.sidebar?.hiddenBuiltInTools||[]),n=u=>c.has(u),y=window.__ROOT_CTX.experiments||{},$=async()=>{await window.firebase.auth.signOut(),window.location.href="/cms/login"};return t("div",{className:"Layout__side",children:[t("div",{className:"Layout__side__buttons",children:[!n("home")&&t(i.SideButton,{label:"Home",url:"/cms",active:o==="/cms",children:t(I,{stroke:r})}),!n("content")&&t(i.SideButton,{label:"Content",url:"/cms/content",active:o.startsWith("/cms/content"),children:t(T,{stroke:r})}),y.taskManager&&t(i.SideButton,{label:"Tasks",url:"/cms/tasks",active:o.startsWith("/cms/tasks"),children:t(N,{stroke:r})}),!n("releases")&&t(i.SideButton,{label:"Releases",url:"/cms/releases",active:o.startsWith("/cms/releases"),children:t(Z,{stroke:r})}),!n("data")&&t(i.SideButton,{label:"Data",url:"/cms/data",active:o.startsWith("/cms/data"),children:t(M,{stroke:r})}),!n("assets")&&t(i.SideButton,{label:"Assets",url:"/cms/assets",active:o.startsWith("/cms/assets"),children:t(R,{stroke:r})}),!n("translations")&&t(i.SideButton,{label:"Translations",url:"/cms/translations",active:o.startsWith("/cms/translations"),children:t(H,{stroke:r})}),(y.ai||window.__ROOT_CTX.ai)&&!n("ai")&&t(i.SideButton,{label:"Root AI",url:"/cms/ai",active:o.startsWith("/cms/ai"),children:t(z,{stroke:r})}),s&&t(m,{children:[t("div",{className:"Layout__side__divider"}),Object.entries(s).map(([u,l])=>{let A=l.cmsUrl?.startsWith("/cms/")?l.cmsUrl:void 0,p=l.externalUrl,v=p??A??`/cms/tools/${u}`,_=p?void 0:v.replace(/\/*$/g,""),E=!p&&!!_&&(o===_||o.startsWith(`${_}/`));return t(i.SideButton,{className:"Layout__side__tool",label:l.label||"",url:v,active:E,external:!!p,children:l.icon?t("img",{className:"Layout__side__tool__icon",src:l.icon,alt:l.label||""}):t(j,{stroke:r})},u)}),t("div",{className:"Layout__side__divider"})]}),!n("settings")&&t(i.SideButton,{label:"Settings",url:"/cms/settings",active:o.startsWith("/cms/settings"),children:t(U,{stroke:r})})]}),t("div",{className:"Layout__side__user",children:t(b,{shadow:"md",position:"right",control:t(k,{children:t(S,{src:a.photoURL,alt:a.email,size:30,radius:"xl"})}),children:[t(b.Label,{children:t(L,{size:"xs",color:"dimmed",truncate:!0,children:["Signed in as ",a.email]})}),t(w,{}),t(b.Item,{color:"red",icon:t(O,{style:{width:14,height:14}}),onClick:$,children:"Sign out"})]})})]})};i.SideButton=e=>t(B,{className:d("Layout__side__button",e.className),label:e.label,position:"right",withArrow:!0,children:t("a",{className:d(e.active&&"active"),href:e.url,target:e.external?"_blank":void 0,rel:e.external?"noreferrer noopener":void 0,children:e.children})});i.Main=e=>t("div",{className:"Layout__main",children:e.children});i.Bottom=()=>t("div",{className:"Layout__bottom"});export{F as a,i as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as Xe}from"./chunk-NXQVLOTK.js";import{f as He}from"./chunk-3IYZCUPI.js";import{a as Le,b as $e,d as Ve,i as Se}from"./chunk-RSVO46S3.js";import{a as Ke,b as eo}from"./chunk-ONTGW2VA.js";import{a as Je}from"./chunk-L4RHGQUG.js";import{a as N,c as H}from"./chunk-HRGYNHZ3.js";import{a as _e,b as ge,c as ae}from"./chunk-JDW4UORS.js";import{d as ye,h as ve,i as xe,j as Ce,k as Ie,l as le,m as ke,n as Ae,o as we,p as De,q as Te,r as Re,s as Pe,v as de,w as Ne,x as ze}from"./chunk-AFWBSIPL.js";import{b as be,e as Me}from"./chunk-XOQ3KDSR.js";import{b as U}from"./chunk-62UWGWON.js";import{a as _,b as F}from"./chunk-I6ICVKEC.js";import{a as M}from"./chunk-HLMBCVRX.js";import{e as he}from"./chunk-ORXEMIQC.js";import{d as fe}from"./chunk-AL3TN2KI.js";import{Ea as pe,Ha as e,Ia as Ee,La as Ue,Ma as Be,Mb as je,Oa as Oe,Pc as Ge,Ra as Fe,V as J,W as Q,a as c,aa as ue,ac as Y,bc as ee,c as j,e as ce,ea as b,fa as ie,gc as Qe,ic as Ye,j as X,jb as qe,mb as K,ra as P,ub as We,va as me,wc as Ze,ya as ne}from"./chunk-NZHF733K.js";import{d as S}from"./chunk-KUCVLANF.js";X();var oo="AddToReleaseModal";function so(s){let t=N(),u=H();return{open:()=>{t.openContextModal(oo,{...u,title:"Add docs to a release",innerProps:s,size:"600px"})}}}function mo(s){let{innerProps:t,context:u,id:l}=s,d=N(),[o,y]=c(""),[p,v]=c(!1),[m,k]=c(!1),[g,A]=c([]),[a,D]=c(""),[x,T]=c(Se()),[w,f]=c("");j(()=>{async function n(){v(!0),await U(async()=>{let E=(await $e()).filter(R=>!R.publishedAt&&!R.archivedAt);A(E)}),v(!1)}n()},[]);async function I(){o==="new"?await L():o==="existing"&&await $()}async function L(){if(!x){_({title:"Missing ID",message:"Please enter a release ID.",color:"red",autoClose:5e3});return}if(!_e(x)){_({title:"Invalid ID",message:"Release ID must use alphanumeric characters and dashes only.",color:"red",autoClose:5e3});return}k(!0),await U(async()=>{let n={docIds:t.docIds};w&&(n.description=w),await Le(x,n),_({title:`Release created: ${x}`,message:e("span",{children:["Created release with ",t.docIds.length," doc(s)."," ",e("a",{href:`/cms/releases/${x}`,children:"View release"})]}),autoClose:1e4}),d.closeAll()}),k(!1)}async function $(){if(!a){_({title:"No release selected",message:"Please select a release.",color:"red",autoClose:5e3});return}k(!0),await U(async()=>{let C=g.find(z=>z.id===a)?.docIds||[],E=Array.from(new Set([...C,...t.docIds])).sort();await Ve(a,{docIds:E});let R=E.length-C.length;_({title:`Docs added to release: ${a}`,message:e("span",{children:["Added ",R," new doc(s) to release."," ",e("a",{href:`/cms/releases/${a}`,children:"View release"})]}),autoClose:1e4}),d.closeAll()}),k(!1)}let r=!0;return(o==="new"&&x||o==="existing"&&a)&&(r=!1),e("div",{className:"AddToReleaseModal",children:e("div",{className:"AddToReleaseModal__content",children:[e("div",{className:"AddToReleaseModal__docs",children:[e("div",{className:"AddToReleaseModal__docs__label",children:["Docs to add (",t.docIds.length,")"]}),e("div",{className:"AddToReleaseModal__docs__list",children:t.docIds.map(n=>e(He,{docId:n,variant:"compact",statusBadges:!0},n))})]}),e("div",{className:"AddToReleaseModal__mode",children:[e("label",{className:`AddToReleaseModal__mode__option${o==="new"?" AddToReleaseModal__mode__option--selected":o?" AddToReleaseModal__mode__option--unselected":""}`,children:[e("div",{className:"AddToReleaseModal__mode__option__input",children:[e("input",{type:"radio",name:"release-mode",value:"new",checked:o==="new",onChange:()=>y("new")})," ","New release"]}),e("div",{className:"AddToReleaseModal__mode__option__help",children:"Create a new release with these docs."})]}),e("label",{className:`AddToReleaseModal__mode__option${o==="existing"?" AddToReleaseModal__mode__option--selected":o?" AddToReleaseModal__mode__option--unselected":""}`,children:[e("div",{className:"AddToReleaseModal__mode__option__input",children:[e("input",{type:"radio",name:"release-mode",value:"existing",checked:o==="existing",onChange:()=>y("existing")})," ","Existing release"]}),e("div",{className:"AddToReleaseModal__mode__option__help",children:"Add to an existing release."})]})]}),o==="new"&&e("div",{className:"AddToReleaseModal__form",children:[e("div",{className:"AddToReleaseModal__form__field",children:[e("label",{children:"Release ID"}),e("input",{type:"text",placeholder:"e.g. my-release",value:x,onInput:n=>{T(n.target.value)}})]}),e("div",{className:"AddToReleaseModal__form__field",children:[e("label",{children:"Description (optional)"}),e("textarea",{rows:2,placeholder:"Describe this release",value:w,onInput:n=>{f(n.target.value)}})]})]}),o==="existing"&&e("div",{className:"AddToReleaseModal__releases",children:p?e("div",{className:"AddToReleaseModal__releases__empty",children:e(J,{color:"gray",size:"sm"})}):g.length===0?e("div",{className:"AddToReleaseModal__releases__empty",children:"No unpublished releases found. Create a new one instead."}):g.map(n=>e("div",{className:`AddToReleaseModal__release${a===n.id?" AddToReleaseModal__release--selected":""}`,onClick:()=>D(n.id),children:[e("input",{type:"radio",name:"existing-release",checked:a===n.id,onChange:()=>D(n.id)}),e("div",{className:"AddToReleaseModal__release__info",children:[e("div",{className:"AddToReleaseModal__release__info__id",children:n.id}),n.description&&e("div",{className:"AddToReleaseModal__release__info__description",children:n.description})]}),e("div",{className:"AddToReleaseModal__release__docCount",children:[n.docIds?.length||0," doc(s)"]})]},n.id))}),e("div",{className:"AddToReleaseModal__buttons",children:[e(b,{variant:"outline",onClick:()=>u.closeModal(l),type:"button",size:"xs",color:"dark",children:"Cancel"}),e(b,{variant:"filled",size:"xs",color:"dark",disabled:r,loading:m,onClick:I,children:o==="new"?"Create release":"Add to release"})]})]})})}mo.id=oo;X();var to="CopyDocModal";function oe(s){let t=N(),u=H();return{open:l=>{t.openContextModal(to,{...u,innerProps:{...s,...l}})}}}function po(s){let{innerProps:t,context:u,id:l}=s,{route:d}=fe(),[o,y]=c(""),[p,v]=c(""),[m,k]=c(""),[g,A]=c(""),[a,D]=c(!1),[x,T]=c(!1),[w,f]=c({}),I=t.fromDocId,L=I.split("/")[0],$=t.fromLabel||I;j(()=>{be({tags:[I]}).then(f)},[I]);function r(C,E){let R=ae(C),z=window.__ROOT_CTX.collections[E]?.slugRegex;return R?ge(R,z):""}async function n(C){if(C.preventDefault(),T(!0),A(""),!L){A("Please select a collection."),T(!1);return}if(r(p,o)){T(!1);return}let R=ae(p),z=`${o}/${R}`;try{t.fields?await Pe(z,{fields:t.fields,overwrite:a}):await Re(I,z,{overwrite:a});let O=Object.keys(w);if(O.length>0){let i=O.map(h=>({hash:h,tags:[z]}));await Me(i,{mode:"union"})}u.closeModal(l);let q=`/cms/content/${o}/${R}`;_({title:"Copied!",message:e("div",{children:[e("div",{children:`Successfully copied ${$} to ${z}.`}),e(b,{className:"CopyDocModal__notificationButton",component:"a",href:q,size:"xs",compact:!0,variant:"default",children:"Open doc"})]}),autoClose:1e4}),t.onSuccess&&t.onSuccess(z)}catch(O){let q=String(O);A(q),q.includes("already exists")&&D(!0),T(!1);return}T(!1),d(`/cms/content/${o}/${R}`)}return e("div",{className:"CopyDocModal",children:e("form",{onSubmit:C=>n(C),children:[e("div",{className:"CopyDocModal__from",children:[e(M,{className:"CopyDocModal__from__label",size:"body",weight:"bold",children:"From:"}),e(M,{className:"CopyDocModal__from__value",size:"body-sm",children:e("code",{children:$})})]}),e("div",{className:"CopyDocModal__to",children:[e(M,{className:"CopyDocModal__to__label",size:"body",weight:"bold",children:"To:"}),e(Xe,{className:"CopyDocModal__slug",collectionId:L,onChange:C=>{y(C.collectionId),v(C.slug),k(r(C.slug,C.collectionId)),A(""),D(!1)}})]}),g&&e("div",{className:"CopyDocModal__error",children:g}),e("div",{className:"CopyDocModal__buttons",children:[e(b,{variant:"outline",onClick:()=>u.closeModal(l),type:"button",size:"xs",color:"dark",children:"Cancel"}),e(b,{variant:"filled",type:"submit",size:"xs",color:"dark",loading:x,disabled:!!m||!!g&&!a,children:a?"Overwrite?":"Submit"})]})]})})}po.id=to;X();function B(s){return e("div",{className:"DocIdBadge",children:e("code",{"data-testid":"doc-id",children:s.docId})})}var io="LockPublishingModal";function no(s){let t=N(),u=H();return{open:l=>{let d={...s,...l},o;d.unlock?o=`Unlock publishing for ${s.docId}`:d.existingLock?o=`Edit publishing lock for ${s.docId}`:o=`Lock publishing for ${s.docId}`,t.openContextModal(io,{...u,title:o,innerProps:{...s,...l},size:"600px"})}}}function fo(s){let t=l=>l<10?"0"+l:l,u=new Date(s);return`${u.getFullYear()}-${t(u.getMonth()+1)}-${t(u.getDate())}T${t(u.getHours())}:${t(u.getMinutes())}`}function Z(s){let{innerProps:t}=s;return t.unlock?e(Z.Unlock,{...s}):e(Z.Lock,{...s})}Z.Lock=s=>{let{innerProps:t,context:u,id:l}=s,d=!!t.existingLock,[o,y]=c(t.existingLock?.reason||""),[p,v]=c(t.existingLock?.until||0),[m,k]=c(!1),[g,A]=c(!1),a=N();function D(f){return f?Math.floor(new Date(f).getTime()):0}async function x(f){f.preventDefault(),k(!0),await U(async()=>{await Ie(t.docId,{reason:o,until:p}),_({title:d?"Updated!":"Locked!",message:d?`Publishing lock updated for ${t.docId}.`:`Publishing is locked for ${t.docId}.`,autoClose:1e4}),a.closeModal(l),t.onChange&&t.onChange("locked")}),k(!1)}async function T(){A(!0),await U(async()=>{await le(t.docId),_({title:"Unlocked!",message:`Publishing is unlocked for ${t.docId}.`,autoClose:1e4}),a.closeModal(l),t.onChange&&t.onChange("unlocked")}),A(!1)}return e("div",{className:"LockPublishingModal LockPublishingModal--lock",children:[e(M,{className:"LockPublishingModal__body",size:"body-sm",children:d?"Publishing is currently locked. Update the publishing lock details below, or remove the lock to re\u2011enable publishing.":"Are you sure you want to lock publishing? Content editors will not be able to publish until publishing is unlocked."}),e("form",{className:"LockPublishingModal__form",onSubmit:f=>x(f),children:[e("div",{className:"LockPublishingModal__form__section",children:e(me,{name:"reason",label:"Reason",description:"Specify a short reason so other content editors know why publishing is locked.",size:"xs",radius:0,value:o,onChange:f=>{y(f.currentTarget.value)}})}),e("div",{className:"LockPublishingModal__form__section",children:e(ue,{label:"Lock until",description:"Optional. Publishing is unlocked at the specified time. If not provided, publishing will be locked indefinitely.",size:"xs",children:e("div",{className:"DocEditor__DateTimeField",children:[e("input",{name:"until",type:"datetime-local",min:he(),defaultValue:p?fo(p):"",onChange:f=>{let L=f.target.value;v(D(L))}}),e("div",{className:"DocEditor__DateTimeField__timezone",children:["timezone: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]})})}),e("div",{className:"LockPublishingModal__buttons",children:[d&&e(b,{variant:"filled",size:"xs",color:"red",type:"button",leftIcon:e(Y,{size:14}),loading:g,disabled:m,onClick:()=>T(),className:"LockPublishingModal__buttons__unlock",children:"Unlock"}),e(b,{variant:"outline",onClick:()=>u.closeModal(l),type:"button",size:"xs",color:"dark",children:"Cancel"}),e(b,{variant:"filled",size:"xs",color:"dark",leftIcon:e(ee,{size:14}),disabled:!o||g,type:"submit",loading:m,children:d?"Save":"Lock"})]})]})]})};Z.Unlock=s=>{let{innerProps:t,context:u,id:l}=s,[d,o]=c(!1),y=N();async function p(){o(!0),await U(async()=>{await le(t.docId),_({title:"Unlocked!",message:`Publishing is unlocked for ${t.docId}.`,autoClose:1e4}),y.closeModal(l),t.onChange&&t.onChange("unlocked")})}return e("div",{className:"LockPublishingModal LockPublishingModal--unlock",children:[e(M,{className:"LockPublishingModal__body",children:"Are you sure you want to unlock publishing for the following doc? This will re-enable content editors to publish the doc."}),e(B,{docId:t.docId}),e("div",{className:"LockPublishingModal__buttons",children:[e(b,{variant:"outline",onClick:()=>u.closeModal(l),type:"button",size:"xs",color:"dark",children:"Cancel"}),e(b,{variant:"filled",size:"xs",color:"dark",leftIcon:e(Y,{size:14}),loading:d,onClick:()=>p(),children:"Unlock"})]})]})};Z.id=io;X();var ro="VersionHistoryModal",ao=50;function co(s){let t=N(),u=H();return{open:()=>{t.openContextModal(ro,{...u,title:`Version history: ${s.docId}`,innerProps:s,overflow:"inside",size:"min(calc(100% - 32px), 720px)"})}}}function _o(s){let{innerProps:t,context:u,id:l}=s,d=t.docId,[o,y]=c(!0),[p,v]=c(!1),[m,k]=c([]),[g,A]=c(!1),[a,D]=c([]),[x,T]=c(!1),[w,f]=c(null),I=ce(null),L=oe({fromDocId:d}),$=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});async function r(){y(!0);let[i,h]=await Promise.all([de(d,{limit:ao}),ze(d,"draft")]);I.current=i.lastDoc,A(i.hasMore);let V={_versionId:"draft",sys:{modifiedAt:h?.sys?.modifiedAt||{toDate:()=>new Date},modifiedBy:h?.sys?.modifiedBy||"Unknown"}};k([V,...i.versions]),D(["draft"]),y(!1)}async function n(){if(!g||p)return;v(!0);let i=await de(d,{limit:ao,cursor:I.current});I.current=i.lastDoc,A(i.hasMore),k(h=>[...h,...i.versions]),v(!1)}async function C(i){await Ne(d,i),_({title:"Saved!",message:`Restored ${d} to ${$.format(i.sys.modifiedAt.toDate())}.`,autoClose:5e3}),t.onRestore&&t.onRestore({version:i})}function E(i){let h=`${d}@${i._versionId}`,V=i.sys?.modifiedAt?.toDate();if(V){let W=go(V);h=`${d}@${W}`}L.open({fields:i.fields||{},fromLabel:h,onSuccess:()=>{u.closeModal(l)}})}function R(i){a.includes(i)?D(a.filter(h=>h!==i)):a.length<2&&D([...a,i])}function z(){if(a.length!==2)return"#";let i=m.find(te=>te._versionId===a[0]),h=m.find(te=>te._versionId===a[1]);if(!i||!h)return"#";let V=m.indexOf(i),W=m.indexOf(h),re=V>W?i:h,G=V>W?h:i,se=lo(d,re._versionId),uo=lo(d,G._versionId);return`/cms/compare?left=${se}&right=${uo}`}j(()=>{r()},[]);let O=m.filter(i=>i._versionId==="draft"||!x?!0:i.tags?.includes("published")),q=m.some(i=>i.tags?.includes("published"));return o?e(J,{}):e("div",{className:"VersionHistoryModal",children:[e("div",{className:"VersionHistoryModal__actions",children:[e(b,{component:a.length===2?"a":"button",variant:"filled",size:"xs",disabled:a.length!==2,href:a.length===2?z():void 0,target:a.length===2?"_blank":void 0,rightIcon:e(Fe,{size:16}),children:"Compare"}),q&&e(ie,{size:"xs",label:"Published versions only",checked:x,onChange:i=>T(i.currentTarget.checked)})]}),O.length===0?e(M,{className:"VersionHistoryModal__versionsEmpty",size:"body",children:[e("p",{children:"No versions found."}),e("p",{className:"VersionHistoryModal__versionsEmpty__developer",children:"For developers: Configure the Root CMS cron job to populate versions."})]}):e(S,{children:[e(pe,{className:"VersionHistoryModal__versions",children:[e("thead",{children:e("tr",{children:[e("th",{children:e("span",{className:"VersionHistoryModal__versions__selectLabel",children:"Select"})}),e("th",{children:"modified at"}),e("th",{children:"modified by"}),e("th",{children:"actions"})]})}),e("tbody",{children:O.map(i=>{let h=i._versionId==="draft",V=a.includes(i._versionId),W=!V&&a.length>=2;return e("tr",{children:[e("td",{children:e(ie,{size:"xs",checked:V,disabled:W,onChange:()=>R(i._versionId),className:"VersionHistoryModal__versions__checkbox"})}),e("td",{children:e("div",{className:"VersionHistoryModal__versions__modifiedAt",children:[e(M,{size:"body-sm",className:"VersionHistoryModal__versions__modifiedAt__text",children:h?e("span",{title:"Current Draft",children:[$.format(i.sys.modifiedAt.toDate())," ","(Latest)"]}):e(S,{children:[$.format(i.sys.modifiedAt.toDate()),i.tags?.includes("published")&&e("span",{className:"VersionHistoryModal__publishedLabel",children:"(Published)"})]})}),i.publishMessage&&e(ne,{withCloseButton:!0,opened:w===`${i._versionId}-message`,onClose:()=>f(null),position:"right",withArrow:!0,shadow:"md",width:320,classNames:{body:"VersionHistoryModal__popover__body",arrow:"VersionHistoryModal__popover__arrow",close:"VersionHistoryModal__popover__close"},target:e(Q,{size:"xs",variant:"light",className:"VersionHistoryModal__messageIcon",onClick:()=>f(w===`${i._versionId}-message`?null:`${i._versionId}-message`),children:e(Qe,{size:18})}),children:e("div",{className:"VersionHistoryModal__message",children:i.publishMessage})}),(()=>{let G=i.tags?.find(se=>se.startsWith("release:"))?.replace("release:","");return G&&e(ne,{withCloseButton:!0,opened:w===`${i._versionId}-release`,onClose:()=>f(null),position:"right",withArrow:!0,shadow:"md",width:320,target:e(Q,{size:"xs",variant:"light",className:"VersionHistoryModal__messageIcon",onClick:()=>f(w===`${i._versionId}-release`?null:`${i._versionId}-release`),children:e(Ze,{size:18})}),children:e("div",{className:"VersionHistoryModal__message",children:[e("strong",{children:"Release:"})," ",G]})})})()]})}),e("td",{children:e(M,{size:"body-sm",children:i.sys.modifiedBy})}),e("td",{children:e("div",{className:"VersionHistoryModal__versions__buttons",children:!h&&e(S,{children:[e(b,{variant:"default",size:"xs",compact:!0,onClick:()=>C(i),children:"restore"}),e(b,{variant:"default",size:"xs",compact:!0,onClick:()=>E(i),leftIcon:e(K,{size:12}),children:"copy to doc"})]})})})]},i._versionId)})})]}),g&&e("div",{className:"VersionHistoryModal__loadMore",children:e(b,{variant:"subtle",size:"xs",loading:p,onClick:n,children:"Load more versions"})})]})]})}function lo(s,t){return encodeURIComponent(`${s}@${t}`).replaceAll("%2F","/").replaceAll("%40","@")}function go(s){let t=s.getFullYear(),u=String(s.getMonth()+1).padStart(2,"0"),l=String(s.getDate()).padStart(2,"0"),d=String(s.getHours()).padStart(2,"0"),o=String(s.getMinutes()).padStart(2,"0");return`${t}-${u}-${l}T${d}:${o}`}_o.id=ro;function Js(s){let{roles:t}=Je(),u=window.firebase.user.email||"",l=eo(t,u),d=Ke(t,u),o=s.docId,y=s.data||{},p=y.sys||{},v=we(y),m=N(),k=oe({fromDocId:o,onSuccess:r=>{s.onAction&&s.onAction({action:"copy",newDocId:r})}}),g=H(),A=co({docId:o}),a=no({docId:o}),D=so({docIds:[o]}),x=()=>{let r=`revert-draft-${o}`,n=m.openConfirmModal({...g,title:`Discard draft edits for ${o}`,children:e(S,{children:[e(M,{size:"body-sm",weight:"semi-bold",className:"DocActionsMenu__confirmText",children:"Are you sure you want to discard draft changes for the following doc? The doc data will revert to the published version. There is no undo."}),e(B,{docId:o})]}),labels:{confirm:"Discard draft edits",cancel:"Cancel"},cancelProps:{size:"xs"},confirmProps:{color:"red",size:"xs"},onCancel:()=>console.log("Cancel"),closeOnConfirm:!1,onConfirm:async()=>{_({id:r,title:"Discarding draft edits",message:`Discarding draft edits of ${o}...`,loading:!0,autoClose:!1}),await xe(o),F({id:r,title:"Discarded draft edits",message:`Successfully reverted ${o} back to its published version`,loading:!1,autoClose:5e3}),m.closeModal(n),s.onAction&&s.onAction({action:"revert-draft"})}})},T=()=>{let r=`unpublish-doc-${o}`,n=m.openConfirmModal({...g,title:`Unpublish ${o}`,children:e(S,{children:[e(M,{size:"body-sm",weight:"semi-bold",className:"DocActionsMenu__confirmText",children:"Are you sure you want to unpublish the following doc? There is no undo."}),e(B,{docId:o})]}),labels:{confirm:"Unpublish",cancel:"Cancel"},cancelProps:{size:"xs"},confirmProps:{color:"red",size:"xs"},onCancel:()=>console.log("Cancel"),closeOnConfirm:!1,onConfirm:async()=>{_({id:r,title:"Unpublishing doc",message:`Requesting unpublish of ${o}...`,loading:!0,autoClose:!1}),await ve(o),F({id:r,title:"Unpublished!",message:`Successfully unpublished ${o}!`,loading:!1,autoClose:5e3}),m.closeModal(n),s.onAction&&s.onAction({action:"unpublish"})}})},w=r=>{s.onAction&&s.onAction({action:r})},f=()=>{let r=`unschedule-doc-${o}`,n=m.openConfirmModal({...g,title:`Unschedule ${o}`,children:e(S,{children:[e(M,{size:"body-sm",weight:"semi-bold",className:"DocActionsMenu__confirmText",children:"Are you sure you want to unschedule the following doc?"}),e(B,{docId:o})]}),labels:{confirm:"Unschedule",cancel:"Cancel"},cancelProps:{size:"xs"},confirmProps:{color:"red",size:"xs"},onCancel:()=>console.log("Cancel"),closeOnConfirm:!1,onConfirm:async()=>{_({id:r,title:"Unschedule doc",message:`Requesting unschedule of ${o}...`,loading:!0,autoClose:!1}),await Ce(o),F({id:r,title:"Unscheduled!",message:`Successfully unscheduled ${o}!`,loading:!1,autoClose:5e3}),m.closeModal(n),s.onAction&&s.onAction({action:"unschedule"})}})},I=()=>{let r=`archive-doc-${o}`,n=m.openConfirmModal({...g,title:`Archive ${o}`,children:e(S,{children:[e(M,{size:"body-sm",weight:"semi-bold",className:"DocActionsMenu__confirmText",children:"Are you sure you want to archive the following doc? Archived docs are hidden from the collection list by default but can be restored later."}),e(B,{docId:o})]}),labels:{confirm:"Archive",cancel:"Cancel"},cancelProps:{size:"xs"},confirmProps:{color:"red",size:"xs"},onCancel:()=>console.log("Cancel"),closeOnConfirm:!1,onConfirm:async()=>{_({id:r,title:"Archiving doc",message:`Requesting archive of ${o}...`,loading:!0,autoClose:!1}),await ke(o),F({id:r,title:"Archived!",message:`Successfully archived ${o}!`,loading:!1,autoClose:5e3}),m.closeModal(n),s.onAction&&s.onAction({action:"archive"})}})},L=async()=>{let r=`unarchive-doc-${o}`;_({id:r,title:"Unarchiving doc",message:`Requesting unarchive of ${o}...`,loading:!0,autoClose:!1}),await Ae(o),F({id:r,title:"Unarchived!",message:`Successfully unarchived ${o}!`,loading:!1,autoClose:5e3}),s.onAction&&s.onAction({action:"unarchive"})},$=()=>{let r=`delete-doc-${o}`,n=m.openConfirmModal({...g,title:"Delete doc",children:e(S,{children:[e(M,{size:"body-sm",weight:"semi-bold",className:"DocActionsMenu__confirmText",children:"Are you sure you want to delete the following doc? There is no undo."}),e(B,{docId:o})]}),labels:{confirm:"Delete",cancel:"Cancel"},cancelProps:{size:"xs"},confirmProps:{color:"red",size:"xs"},onCancel:()=>console.log("Cancel"),closeOnConfirm:!1,onConfirm:async()=>{_({id:r,title:"Deleting doc",message:`Requesting deletion of ${o}...`,loading:!0,autoClose:!1}),await ye(o),F({id:r,title:"Deleted!",message:`Successfully deleted ${o}!`,loading:!1,autoClose:5e3}),m.closeModal(n),s.onDelete&&s.onDelete(),s.onAction&&s.onAction({action:"delete"})}})};return e(P,{className:"CollectionPage__collection__docsList__doc__controls__menu",position:"bottom",control:e(Q,{className:"DocEditor__ArrayField__item__header__controls__dots",children:e(We,{size:16})}),children:[!v&&e(P.Item,{icon:e(Ye,{size:20}),onClick:()=>D.open(),disabled:!d,children:"Add to release"}),e(P.Item,{icon:e(je,{size:20}),onClick:()=>A.open(),children:"Version history"}),e(P.Item,{icon:e(K,{size:20}),onClick:()=>k.open(),disabled:!l,children:"Copy"}),!v&&p.modifiedAt&&p.publishedAt&&p.modifiedAt>p.publishedAt&&e(P.Item,{icon:e(Oe,{size:20}),onClick:()=>x(),disabled:!l,children:"Discard draft edits"}),!v&&p.firstPublishedAt&&e(P.Item,{icon:e(qe,{size:20}),onClick:()=>T(),disabled:!d,children:"Unpublish"}),!v&&p.scheduledAt&&e(P.Item,{icon:e(Ee,{size:20}),onClick:()=>f(),disabled:!d,children:"Unschedule"}),!v&&(Te(y)?e(P.Item,{icon:e(Y,{size:20}),onClick:()=>a.open({unlock:!0,onChange:w}),disabled:!l,children:"Unlock publishing"}):e(P.Item,{icon:e(ee,{size:20}),onClick:()=>a.open({unlock:!1,onChange:w}),disabled:!l||De(y),children:"Lock publishing"})),v?e(P.Item,{icon:e(Ue,{size:20}),onClick:()=>L(),disabled:!l,children:"Unarchive"}):!p.publishedAt&&e(P.Item,{icon:e(Be,{size:20}),onClick:()=>I(),disabled:!l,children:"Archive"}),e(P.Item,{icon:e(Ge,{size:20}),onClick:()=>$(),disabled:!l,children:"Delete"})]})}export{so as a,mo as b,po as c,B as d,no as e,Z as f,_o as g,Js as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as C}from"./chunk-54DVDYU6.js";import{e as F}from"./chunk-W3HIZQ4Z.js";import{c,e as y,p as w,q as U,r as m}from"./chunk-EGEB6N4J.js";import{Ha as d,a as f,c as g,ea as v,h as S,i as p,j as b,xb as k}from"./chunk-NZHF733K.js";import{j as a,k as h}from"./chunk-KUCVLANF.js";h();b();var z=[{name:"Google Drive Folder",key:"googleDriveFolder",placeholder:"https://drive.google.com/drive/folders/...",description:`Where Google Sheets created by Root CMS's localization process are stored. If unspecified, they will be created in your "My Drive".`,ui:e=>d(v,{disabled:!e,variant:"default",size:"xs",compact:!0,rightIcon:d(k,{size:14}),onClick:()=>{e&&window.open(e,F(e))},children:"Open"})}],D=a(null);function X(e){let{db:r,user:s}=C(),o=window.__ROOT_CTX.rootConfig.projectId,[P,u]=f({});g(()=>{let n=c(r,"Projects",o),i=m(n,t=>{if(t.exists()){let l=t.data()||{};u(l.settings||{})}else u({})},t=>{console.error("Failed to subscribe to site settings:",t)});return()=>i()},[r,o,s.uid]);let x=S(async(n,i)=>{let t=c(r,"Projects",o);try{await U(t,new y("settings",n),i)}catch(l){console.error("Failed to set setting",n,l)}},[r,o,s.uid]);return d(D.Provider,{value:{settings:P,setSettings:x},children:e.children})}function B(){let e=p(D);if(!e)throw new Error("useSiteSettings must be used within a <SiteSettingsProvider>");return e}h();b();var I=a(null);function H(e){let{db:r,user:s}=C(),o=window.__ROOT_CTX.rootConfig.projectId,[P,u]=f({});g(()=>{let n=c(r,"Projects",o,"Users",s.uid),i=m(n,t=>{t.exists()?u(t.data()):u({})},t=>{console.error("Failed to subscribe to user preferences:",t)});return()=>i()},[r,o,s.uid]);let x=S(async(n,i)=>{let t=c(r,"Projects",o,"Users",s.uid);try{await w(t,{[n]:i},{merge:!0})}catch(l){console.error("Failed to set user preference",n,l)}},[r,o,s.uid]);return d(I.Provider,{value:{preferences:P,setPreference:x},children:e.children})}function K(){let e=p(I);if(!e)throw new Error("useUserPreferences must be used within a <UserPreferencesProvider>");return e}export{z as a,X as b,B as c,H as d,K as e};
|