@wazobiatech/wazui 0.0.11 → 0.0.13
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/.env.sample +18 -18
- package/.env.test +5 -0
- package/CONVERSION_COMPLETE.md +87 -0
- package/ENVIRONMENT.md +230 -0
- package/NEXTJS_GUIDE.md +186 -0
- package/QUICK_START_ENV.md +0 -0
- package/USAGE_EXAMPLES.tsx +76 -0
- package/package.json +2 -3
- package/src/config/env.ts +8 -8
- package/src/config/next.ts +79 -0
- package/src/decorators/ApolloDecorator.tsx +1 -1
- package/src/decorators/DolosApolloDecorator.tsx +1 -1
- package/src/env.ts +48 -93
- package/src/hooks/useMercuryProjectToken.ts +3 -3
- package/src/hooks/useProjectToken.ts +2 -2
- package/src/index.ts +17 -1
- package/src/mocks/env.ts +9 -9
- package/src/providers/EnvironmentProvider/WazUIEnvironmentProvider.tsx +50 -0
- package/src/providers/EnvironmentProvider/context.ts +5 -0
- package/src/providers/EnvironmentProvider/index.ts +5 -0
- package/src/providers/EnvironmentProvider/useWazUIEnvironment.ts +20 -0
- package/src/providers/EnvironmentProvider/utils.ts +122 -0
- package/src/utils/apolloClient.ts +6 -6
- package/src/utils/images.ts +14 -7
- package/storybook-static/assets/ApolloDecorator-DdFdPk9I.js +1 -0
- package/storybook-static/assets/BlogCategoryContent-j1uDZXn7.js +97 -0
- package/storybook-static/assets/BlogCategoryContent.stories-qYKLjb6F.js +9 -0
- package/storybook-static/assets/BlogPostContentComponent-C2AFWOqJ.js +956 -0
- package/storybook-static/assets/BlogPostContentComponent.stories-ZsTapbYf.js +18 -0
- package/storybook-static/assets/BlogPostsComponent.stories-CcjjSusf.js +11 -0
- package/storybook-static/assets/BlogTagContent-BnwuQUSW.js +92 -0
- package/storybook-static/assets/BlogTagContent.stories-BdzlB1N5.js +9 -0
- package/storybook-static/assets/CategoriesComponent.stories-C4qc6J3o.js +7 -0
- package/storybook-static/assets/ClearCacheHistory.stories-BFGJ9Cpr.js +6 -0
- package/storybook-static/assets/Color-YHDXOIA2-uT_23_Qt.js +1 -0
- package/storybook-static/assets/DocsRenderer-CFRXHY34-PYIpRFNk.js +575 -0
- package/storybook-static/assets/DolosApolloDecorator-DEvkQjrM.js +1 -0
- package/storybook-static/assets/FeatureJungle-Light-CFEx0Apr.woff +0 -0
- package/storybook-static/assets/PictureBlot-Ce0f3E3l.js +2 -0
- package/storybook-static/assets/PurgeCache-6QorPr5P.js +5 -0
- package/storybook-static/assets/PurgeCache.stories-9MRRLCNG.js +13 -0
- package/storybook-static/assets/ReactQueryDecorator-CrsXrNQd.js +1 -0
- package/storybook-static/assets/RecipeCategories.stories--J_t5Kqe.js +7 -0
- package/storybook-static/assets/RecipeCategoryContent-PlykHail.js +139 -0
- package/storybook-static/assets/RecipeCategoryContent.stories-kGW7yk1Q.js +9 -0
- package/storybook-static/assets/RecipeContentComponent.stories-BQ8Uxx67.js +18 -0
- package/storybook-static/assets/RecipeTags.stories-C1FTvpsL.js +7 -0
- package/storybook-static/assets/RecipeTagsContent-DS00_2mK.js +18 -0
- package/storybook-static/assets/RecipeTagsContent.stories-BiMSQhz1.js +5 -0
- package/storybook-static/assets/RecipesComponent.stories-CHZ8K6cH.js +9 -0
- package/storybook-static/assets/RedirectContent-CmGN0ktq.js +96 -0
- package/storybook-static/assets/RedirectContent.stories-9_qkEHzb.js +5 -0
- package/storybook-static/assets/RedirectsComponent.stories-CTycXldt.js +8 -0
- package/storybook-static/assets/TagsComponent.stories-DSohzxP0.js +7 -0
- package/storybook-static/assets/TimeAgo-BMs3lst-.js +5 -0
- package/storybook-static/assets/UniversalJungle-420-mm6ugnAQ.woff +0 -0
- package/storybook-static/assets/WazUIBlogComponent.stories-CCXKbbai.js +86 -0
- package/storybook-static/assets/WazUIBlogDashboard-CtU7uRTr.js +162 -0
- package/storybook-static/assets/WazUIBlogDashboard.stories-CqTZ4exx.js +38 -0
- package/storybook-static/assets/WazUIButton.stories-CDWIbKyS.js +59 -0
- package/storybook-static/assets/WazUIDataTable-DnneDnRd.js +22 -0
- package/storybook-static/assets/WazUIPostActions-BZQom1Yt.js +16 -0
- package/storybook-static/assets/WazUiBreadCrumb-BPc3tEqC.js +1 -0
- package/storybook-static/assets/WazUiBreadCrumb.stories-_gNokkDn.js +7 -0
- package/storybook-static/assets/WazUiButton-e06gz3US.js +27 -0
- package/storybook-static/assets/WazUiCreateBlogContent-DxC86Nwl.js +327 -0
- package/storybook-static/assets/WazUiCreateBlogContent.stories-Bzq3YtfW.js +94 -0
- package/storybook-static/assets/WazUiCreateContentPopup.stories-D_9OExPO.js +41 -0
- package/storybook-static/assets/WazUiDataTable.stories-D1Aj3wPk.js +23 -0
- package/storybook-static/assets/WazUiGqlMediaLibrary.stories-Cug9TM1_.js +105 -0
- package/storybook-static/assets/WazUiGqlMediaLibraryPopup.stories-CuwWYcJs.js +53 -0
- package/storybook-static/assets/WazUiInputBox-C2jVcTq2.js +734 -0
- package/storybook-static/assets/WazUiInputBox.stories-Bs1Vb_Rd.js +270 -0
- package/storybook-static/assets/WazUiNavigationBlocker-BrhA3ONc.js +1 -0
- package/storybook-static/assets/WazUiNavigationBlocker.stories-CgqwQbJ9.js +6 -0
- package/storybook-static/assets/WazUiPostCard-bQlmiDOB.js +99 -0
- package/storybook-static/assets/WazUiPostCard.stories-Dir2IwY1.js +9 -0
- package/storybook-static/assets/WazUiWysiwygInput.stories-BDO7EAIa.js +170 -0
- package/storybook-static/assets/WazuiActionModal-Cgw_QqFv.js +11 -0
- package/storybook-static/assets/WazuiActionModal.stories-CFCFlfLU.js +5 -0
- package/storybook-static/assets/WazuiCreateContentPopup-CXVvIFOU.js +130 -0
- package/storybook-static/assets/WazuiImage-BwRWaPkA.js +58 -0
- package/storybook-static/assets/WazuiImage.stories-CxpLgpmg.js +48 -0
- package/storybook-static/assets/button-BxNLA_J_.js +1 -0
- package/storybook-static/assets/calendar-CorT5FcI.js +6 -0
- package/storybook-static/assets/chunk-XP5HYGXS-BpfKkqn7.js +1 -0
- package/storybook-static/assets/emerald-GdtolcHR.svg +9 -0
- package/storybook-static/assets/entry-preview-Chux9cpU.js +2 -0
- package/storybook-static/assets/entry-preview-docs-DviPOtIv.js +46 -0
- package/storybook-static/assets/env-B_s3Ell7.js +1 -0
- package/storybook-static/assets/gold-CtN6pOVZ.svg +9 -0
- package/storybook-static/assets/groups-GzRK9wBi.js +6 -0
- package/storybook-static/assets/hooks-D-wca2rG.js +1 -0
- package/storybook-static/assets/iconBase-B7i_G6Rg.js +1 -0
- package/storybook-static/assets/iframe-DarAeeHv.js +211 -0
- package/storybook-static/assets/index-BAoN7Cmi.js +240 -0
- package/storybook-static/assets/index-BJvHeDRT.js +1 -0
- package/storybook-static/assets/index-BR89vyis.js +6 -0
- package/storybook-static/assets/index-BWnBDfn-.js +9 -0
- package/storybook-static/assets/index-Bqat3xNk.js +1 -0
- package/storybook-static/assets/index-CBYaBgW8.js +9 -0
- package/storybook-static/assets/index-CZ4jztst.js +30 -0
- package/storybook-static/assets/index-CeH2RAp8.js +22 -0
- package/storybook-static/assets/index-DarTc5kA.js +1 -0
- package/storybook-static/assets/index-DgH-xKnr.js +11 -0
- package/storybook-static/assets/index-DrFu-skq.js +6 -0
- package/storybook-static/assets/instagram-DKTomRJ8.svg +9 -0
- package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +9 -0
- package/storybook-static/assets/no-data-image-Bhn_PKhS.svg +41 -0
- package/storybook-static/assets/no-image-icon-CjrDvlv3.svg +84 -0
- package/storybook-static/assets/pexels-DrnxyPAE.svg +9 -0
- package/storybook-static/assets/popover-BB1qMQFg.js +76 -0
- package/storybook-static/assets/preview-B8lJiyuQ.js +34 -0
- package/storybook-static/assets/preview-BBWR9nbA.js +1 -0
- package/storybook-static/assets/preview-BWzBA1C2.js +396 -0
- package/storybook-static/assets/preview-BaoH-L4j.js +1 -0
- package/storybook-static/assets/preview-C-LZrIW4.js +2 -0
- package/storybook-static/assets/preview-CVgpLj3b.js +1 -0
- package/storybook-static/assets/preview-CvbIS5ZJ.js +1 -0
- package/storybook-static/assets/preview-DGUiP6tS.js +7 -0
- package/storybook-static/assets/preview-DMG083aW.js +240 -0
- package/storybook-static/assets/preview-DoyfkCKF.css +1 -0
- package/storybook-static/assets/preview-TWlugwTp.js +3 -0
- package/storybook-static/assets/provider-Bst_TvlW.js +1 -0
- package/storybook-static/assets/queries-9Km_qMSB.js +125 -0
- package/storybook-static/assets/queries-Bdq7cXa5.js +231 -0
- package/storybook-static/assets/queries-ClywsDTl.js +103 -0
- package/storybook-static/assets/quill-Dex9Y0nc.js +49 -0
- package/storybook-static/assets/react-18-DbMmlWnz.js +25 -0
- package/storybook-static/assets/sapphire-BO-7mqXy.svg +9 -0
- package/storybook-static/assets/test-utils-DxU8HTJE.js +9 -0
- package/storybook-static/assets/upload-image-BZPKKzIo.svg +43 -0
- package/storybook-static/assets/useMercuryProjectToken-BgbQUYG9.js +49 -0
- package/storybook-static/assets/users-ClnJTo4A.js +1 -0
- package/storybook-static/assets/utils-3HBFSLrk.js +2 -0
- package/storybook-static/assets/v4-CtRu48qb.js +1 -0
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/iframe.html +669 -0
- package/storybook-static/index.html +185 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +331 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +51 -0
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +12 -0
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +405 -0
- package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +245 -0
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/onboarding-9/manager-bundle.js +127 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storybook-experimental-addon-test-11/manager-bundle.js +223 -0
- package/storybook-static/sb-addons/themes-12/manager-bundle.js +3 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +1051 -0
- package/storybook-static/sb-manager/globals-runtime.js +41591 -0
- package/storybook-static/sb-manager/globals.js +48 -0
- package/storybook-static/sb-manager/runtime.js +12048 -0
- package/vite.config.ts +1 -0
|
@@ -0,0 +1,956 @@
|
|
|
1
|
+
import{j as s}from"./jsx-runtime-D_zvdyIk.js";import{r as u}from"./index-CBYaBgW8.js";import{W as Ze,e as ve,a as Ut,b as Mt}from"./WazUiCreateBlogContent-DxC86Nwl.js";import{g as I}from"./index-CeH2RAp8.js";import{e as Bt,r as Ot}from"./ReactQueryDecorator-CrsXrNQd.js";import{c as A,a as ue,l as Ee,s as Xe,r as Qe,u as Kt}from"./utils-3HBFSLrk.js";import{B as we}from"./button-BxNLA_J_.js";import"./WazUiButton-e06gz3US.js";import{a as ae,B as H,F as q,r as he,T as ee,t as $e,w as Ye,b as Gt,x as et,h as tt,y as at,z as Vt,A as zt,E as Ht,H as Wt}from"./WazUiInputBox-C2jVcTq2.js";import{W as rt,b as ye,a as Ne,c as qe,R as Jt}from"./WazUiPostCard-bQlmiDOB.js";import{A as Re,S as Zt}from"./WazUIPostActions-BZQom1Yt.js";import{Q as Xt}from"./provider-Bst_TvlW.js";import{d as Se,P as Qt,c as Yt,e as it,f as ea,g as ta,h as aa}from"./index-BR89vyis.js";import{a as pe,b as ra}from"./index-Bqat3xNk.js";import{T as J}from"./TimeAgo-BMs3lst-.js";import{D as ia,G as na,R as sa}from"./RecipeCategoryContent-PlykHail.js";import{B as oa}from"./BlogCategoryContent-j1uDZXn7.js";import{B as la}from"./BlogTagContent-BnwuQUSW.js";import{c as nt,B as ne,e as ua,g as ca,i as da,j as pa,S as st}from"./popover-BB1qMQFg.js";import{R as ma,v as ga,L as fa}from"./index-CZ4jztst.js";import{W as Ie}from"./WazuiImage-BwRWaPkA.js";import{R as ha}from"./RedirectContent-CmGN0ktq.js";import{e as je,z as M}from"./env-B_s3Ell7.js";import"./PurgeCache-6QorPr5P.js";import{R as ya}from"./RecipeTagsContent-DS00_2mK.js";import"./WazUIBlogDashboard-CtU7uRTr.js";import"./queries-Bdq7cXa5.js";import{c as _a,d as xa,G as ba,b as va,e as wa}from"./queries-9Km_qMSB.js";/**
|
|
2
|
+
* @license lucide-react v0.507.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Ca=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],ot=nt("star",Ca);/**
|
|
7
|
+
* @license lucide-react v0.507.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Ta=[["rect",{width:"10",height:"14",x:"3",y:"8",rx:"2",key:"1vrsiq"}],["path",{d:"M5 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2.4",key:"1j4zmg"}],["path",{d:"M8 18h.01",key:"lrp35t"}]],lt=nt("tablet-smartphone",Ta),$a=I(`
|
|
12
|
+
query MyQuery(
|
|
13
|
+
$first: Int!
|
|
14
|
+
$blog_uuid: String
|
|
15
|
+
$page: Int
|
|
16
|
+
$search: String
|
|
17
|
+
$parents_only: Boolean
|
|
18
|
+
) {
|
|
19
|
+
categories(
|
|
20
|
+
first: $first
|
|
21
|
+
page: $page
|
|
22
|
+
filter: {
|
|
23
|
+
blog_uuid: { eq: $blog_uuid }
|
|
24
|
+
name: { contains: $search }
|
|
25
|
+
parents_only: $parents_only
|
|
26
|
+
}
|
|
27
|
+
sort: { field: CREATED_AT, order: DESC }
|
|
28
|
+
) {
|
|
29
|
+
data {
|
|
30
|
+
uuid
|
|
31
|
+
name
|
|
32
|
+
slug
|
|
33
|
+
subCategories {
|
|
34
|
+
name
|
|
35
|
+
uuid
|
|
36
|
+
slug
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
paginatorInfo {
|
|
40
|
+
count
|
|
41
|
+
currentPage
|
|
42
|
+
firstItem
|
|
43
|
+
hasMorePages
|
|
44
|
+
lastItem
|
|
45
|
+
lastPage
|
|
46
|
+
perPage
|
|
47
|
+
total
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
`),ut=I(`
|
|
53
|
+
query MyQuery(
|
|
54
|
+
$first: Int!
|
|
55
|
+
$blog_uuid: String
|
|
56
|
+
$page: Int
|
|
57
|
+
$search: String
|
|
58
|
+
) {
|
|
59
|
+
tags(
|
|
60
|
+
first: $first
|
|
61
|
+
page: $page
|
|
62
|
+
filter: {
|
|
63
|
+
blog_uuid: { eq: $blog_uuid }
|
|
64
|
+
name: { contains: $search }
|
|
65
|
+
}
|
|
66
|
+
sort: { field: UPDATED_AT, order: DESC }
|
|
67
|
+
) {
|
|
68
|
+
data {
|
|
69
|
+
uuid
|
|
70
|
+
name
|
|
71
|
+
}
|
|
72
|
+
paginatorInfo {
|
|
73
|
+
count
|
|
74
|
+
currentPage
|
|
75
|
+
firstItem
|
|
76
|
+
hasMorePages
|
|
77
|
+
lastItem
|
|
78
|
+
lastPage
|
|
79
|
+
perPage
|
|
80
|
+
total
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
`),Sa=I(`
|
|
86
|
+
query MyQuery(
|
|
87
|
+
$uuid: ID!
|
|
88
|
+
$blog_uuid: ID!
|
|
89
|
+
) {
|
|
90
|
+
post(input: {
|
|
91
|
+
blog_uuid: $blog_uuid
|
|
92
|
+
uuid: $uuid
|
|
93
|
+
}) {
|
|
94
|
+
author_uuid
|
|
95
|
+
content
|
|
96
|
+
created_at
|
|
97
|
+
excerpt
|
|
98
|
+
featured_image
|
|
99
|
+
published_at
|
|
100
|
+
slug
|
|
101
|
+
status
|
|
102
|
+
title
|
|
103
|
+
updated_at
|
|
104
|
+
uuid
|
|
105
|
+
visibility
|
|
106
|
+
metadata
|
|
107
|
+
category {
|
|
108
|
+
uuid
|
|
109
|
+
name
|
|
110
|
+
slug
|
|
111
|
+
subCategories {
|
|
112
|
+
id
|
|
113
|
+
name
|
|
114
|
+
uuid
|
|
115
|
+
slug
|
|
116
|
+
}
|
|
117
|
+
parent {
|
|
118
|
+
id
|
|
119
|
+
uuid
|
|
120
|
+
name
|
|
121
|
+
slug
|
|
122
|
+
subCategories {
|
|
123
|
+
id
|
|
124
|
+
uuid
|
|
125
|
+
name
|
|
126
|
+
created_at
|
|
127
|
+
updated_at
|
|
128
|
+
slug
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
tags {
|
|
133
|
+
uuid
|
|
134
|
+
name
|
|
135
|
+
}
|
|
136
|
+
related_posts {
|
|
137
|
+
id
|
|
138
|
+
uuid
|
|
139
|
+
featured_image
|
|
140
|
+
slug
|
|
141
|
+
title
|
|
142
|
+
}
|
|
143
|
+
postConfig {
|
|
144
|
+
has_related_posts
|
|
145
|
+
is_feature_article
|
|
146
|
+
is_comments_enabled
|
|
147
|
+
is_in_sitemap
|
|
148
|
+
permalink
|
|
149
|
+
schema
|
|
150
|
+
social_preview_config
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
`),Pa=I(`
|
|
156
|
+
mutation CreatePost(
|
|
157
|
+
$author_uuid: ID
|
|
158
|
+
$blog_uuid: ID
|
|
159
|
+
$uuid: ID
|
|
160
|
+
$category_uuids: [ID]
|
|
161
|
+
$content: String
|
|
162
|
+
$excerpt: String
|
|
163
|
+
$featured_image: JSON
|
|
164
|
+
$metadata: JSON
|
|
165
|
+
$social_preview_config: String
|
|
166
|
+
$related_posts: [RelatedPostsConfigInput]
|
|
167
|
+
$is_featured_article:Boolean
|
|
168
|
+
$published_at: DateTime
|
|
169
|
+
$status:Boolean
|
|
170
|
+
$tags: [String]
|
|
171
|
+
$title: String
|
|
172
|
+
$slug: String
|
|
173
|
+
$version: String
|
|
174
|
+
$visibility: Boolean
|
|
175
|
+
) {
|
|
176
|
+
createPost(
|
|
177
|
+
input: {
|
|
178
|
+
author_uuid: $author_uuid,
|
|
179
|
+
blog_uuid: $blog_uuid,
|
|
180
|
+
category_uuids: $category_uuids,
|
|
181
|
+
content: $content,
|
|
182
|
+
excerpt: $excerpt,
|
|
183
|
+
featured_image: $featured_image,
|
|
184
|
+
metadata: $metadata,
|
|
185
|
+
published_at: $published_at,
|
|
186
|
+
status: $status,
|
|
187
|
+
tags: $tags,
|
|
188
|
+
title: $title,
|
|
189
|
+
slug: $slug,
|
|
190
|
+
uuid: $uuid,
|
|
191
|
+
version: $version
|
|
192
|
+
visibility: $visibility
|
|
193
|
+
related_posts: $related_posts
|
|
194
|
+
config: {
|
|
195
|
+
social_preview_config: $social_preview_config,
|
|
196
|
+
is_feature_article: $is_featured_article
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
) {
|
|
200
|
+
author_uuid
|
|
201
|
+
uuid
|
|
202
|
+
title
|
|
203
|
+
slug
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
`),ka=I(`
|
|
207
|
+
mutation UpdatePost(
|
|
208
|
+
$author_uuid: ID
|
|
209
|
+
$uuid: ID!
|
|
210
|
+
$category_uuids: [ID]
|
|
211
|
+
$content: String
|
|
212
|
+
$excerpt: String
|
|
213
|
+
$featured_image: JSON
|
|
214
|
+
$metadata: JSON
|
|
215
|
+
$social_preview_config: String
|
|
216
|
+
$is_featured_article:Boolean
|
|
217
|
+
$related_posts: [RelatedPostsConfigInput]
|
|
218
|
+
$status:Boolean
|
|
219
|
+
$tags: [String]
|
|
220
|
+
$title: String
|
|
221
|
+
$slug: String
|
|
222
|
+
$version: String
|
|
223
|
+
$visibility:Boolean
|
|
224
|
+
) {
|
|
225
|
+
updatePost(
|
|
226
|
+
input: {
|
|
227
|
+
author_uuid: $author_uuid,
|
|
228
|
+
category_uuids: $category_uuids,
|
|
229
|
+
content: $content,
|
|
230
|
+
excerpt: $excerpt,
|
|
231
|
+
featured_image: $featured_image,
|
|
232
|
+
metadata: $metadata,
|
|
233
|
+
related_posts: $related_posts,
|
|
234
|
+
status: $status,
|
|
235
|
+
tags: $tags,
|
|
236
|
+
title: $title,
|
|
237
|
+
slug: $slug,
|
|
238
|
+
uuid: $uuid,
|
|
239
|
+
version: $version
|
|
240
|
+
visibility: $visibility
|
|
241
|
+
config: {
|
|
242
|
+
social_preview_config: $social_preview_config,
|
|
243
|
+
is_feature_article: $is_featured_article
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
) {
|
|
247
|
+
author_uuid
|
|
248
|
+
uuid
|
|
249
|
+
title
|
|
250
|
+
slug
|
|
251
|
+
categories {
|
|
252
|
+
name
|
|
253
|
+
uuid
|
|
254
|
+
}
|
|
255
|
+
tags {
|
|
256
|
+
name
|
|
257
|
+
uuid
|
|
258
|
+
}
|
|
259
|
+
visibility
|
|
260
|
+
updated_at
|
|
261
|
+
status
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
`);I`
|
|
265
|
+
query GqlGetAllUsers($first: Int!, $page: Int) {
|
|
266
|
+
users(first: $first, page: $page) {
|
|
267
|
+
data {
|
|
268
|
+
uuid
|
|
269
|
+
name
|
|
270
|
+
}
|
|
271
|
+
paginatorInfo {
|
|
272
|
+
count
|
|
273
|
+
currentPage
|
|
274
|
+
firstItem
|
|
275
|
+
hasMorePages
|
|
276
|
+
lastItem
|
|
277
|
+
lastPage
|
|
278
|
+
perPage
|
|
279
|
+
total
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
`;const ct=I`
|
|
284
|
+
query GetTwitterEmbed($url: String!) {
|
|
285
|
+
getTwitterEmbed(url: $url) {
|
|
286
|
+
data
|
|
287
|
+
message
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
`,Ea={theme:"system",setTheme:()=>null};u.createContext(Ea);new Xt;const dt=I(`
|
|
291
|
+
query GqlPosts(
|
|
292
|
+
$first: Int!
|
|
293
|
+
$page: Int
|
|
294
|
+
$filter: PostFilterInput
|
|
295
|
+
$search: String
|
|
296
|
+
$sort: [PostSortInput!]
|
|
297
|
+
) {
|
|
298
|
+
posts(
|
|
299
|
+
first: $first
|
|
300
|
+
page: $page
|
|
301
|
+
filter: $filter
|
|
302
|
+
search: $search
|
|
303
|
+
sort: $sort
|
|
304
|
+
) {
|
|
305
|
+
data {
|
|
306
|
+
title
|
|
307
|
+
slug
|
|
308
|
+
excerpt
|
|
309
|
+
featured_image
|
|
310
|
+
updated_at
|
|
311
|
+
tags {
|
|
312
|
+
name
|
|
313
|
+
}
|
|
314
|
+
categories {
|
|
315
|
+
id
|
|
316
|
+
name
|
|
317
|
+
}
|
|
318
|
+
author_uuid
|
|
319
|
+
id
|
|
320
|
+
uuid
|
|
321
|
+
status
|
|
322
|
+
language_attr
|
|
323
|
+
metadata
|
|
324
|
+
}
|
|
325
|
+
paginatorInfo {
|
|
326
|
+
hasMorePages
|
|
327
|
+
firstItem
|
|
328
|
+
currentPage
|
|
329
|
+
count
|
|
330
|
+
lastPage
|
|
331
|
+
perPage
|
|
332
|
+
total
|
|
333
|
+
lastItem
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
`),Na=I(`
|
|
338
|
+
mutation DeletePost(
|
|
339
|
+
$uuid: ID!
|
|
340
|
+
) {
|
|
341
|
+
deletePost(
|
|
342
|
+
uuid: $uuid
|
|
343
|
+
) {
|
|
344
|
+
uuid
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
`),Fe=I(`
|
|
348
|
+
query GetStatistics(
|
|
349
|
+
$urls: [String!]!
|
|
350
|
+
$page: Int
|
|
351
|
+
$perPage: Int
|
|
352
|
+
) {
|
|
353
|
+
statistics(
|
|
354
|
+
urls: $urls
|
|
355
|
+
page: $page
|
|
356
|
+
perPage: $perPage
|
|
357
|
+
) {
|
|
358
|
+
data {
|
|
359
|
+
pageId
|
|
360
|
+
pageUrl
|
|
361
|
+
totalEvents
|
|
362
|
+
totalPageViews
|
|
363
|
+
uniqueUsers
|
|
364
|
+
averageSessionDuration
|
|
365
|
+
lastActivity
|
|
366
|
+
}
|
|
367
|
+
paginatorInfo {
|
|
368
|
+
total
|
|
369
|
+
count
|
|
370
|
+
currentPage
|
|
371
|
+
hasMorePages
|
|
372
|
+
perPage
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
`),qa=({postBaseUrl:e="",baseUrl:t="",blog_uuid:a="",authors:r=[],refresh_token:i,mercuryToken:n="",className:o="",apolloUri:l})=>{const c=It({postBaseUrl:e,authors:r}),m=jt({authors:r,blog_uuid:a});return s.jsx(ae,{columns:c,rootClassName:A("h-full flex-1",o),gridCardHeight:360,defaultState:{view:"grid"},queryConfig:{fetch:{query:dt,variables:{blog_uuid:a,refresh_token:i},dataKey:"posts"},delete:{query:Na,variables:{blog_uuid:a,refresh_token:i},dataKey:"posts",mutationInvalidateKey:"posts"},engagementConfig:{query:Fe,variables:{mercuryToken:n},dataKey:"metrics",cacheKey:"engagement"}},postBaseURL:e,filterFields:m,gridCard:rt,statusFilters:Ft,baseUrl:t,postType:"Articles",postTypeSng:"Article",authors:r,apolloUri:l})};qa.__docgenInfo={description:"",methods:[],displayName:"BlogPostsComponent",props:{postBaseUrl:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},baseUrl:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},blog_uuid:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},refresh_token:{required:!1,tsType:{name:"string"},description:""},authors:{required:!1,tsType:{name:"Array",elements:[{name:"signature",type:"object",raw:"{ uuid: string; name: string; [key: string]: string | null }",signature:{properties:[{key:"uuid",value:{name:"string",required:!0}},{key:"name",value:{name:"string",required:!0}},{key:{name:"string"},value:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}],required:!0}}]}}],raw:"{ uuid: string; name: string; [key: string]: string | null }[]"},description:"",defaultValue:{value:"[]",computed:!1}},mercuryToken:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},className:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},apolloUri:{required:!1,tsType:{name:"string"},description:""}}};const Ra=[{accessorKey:"name",header:"Name",meta:{width:"grow"},cell:({row:e})=>{const t=e.original;return s.jsx("div",{className:"min-w-50 flex flex-col justify-center",children:s.jsx("div",{className:"p-2 rounded-full text-sm w-fit bg-[#EEF4FF] text-[#3538CD] ",children:t.name})})}},{accessorKey:"sub_categories",header:"Sub Categories",meta:{width:"grow"},cell:({row:e})=>{const t=e.original;return s.jsx("div",{className:"min-w-50",children:s.jsx(ye,{tags:t.subCategories})})}},{accessorKey:"description",header:"Description",meta:{width:"grow"},cell:({row:e})=>{const t=e.original;return s.jsx("span",{className:"capitalize text-sm text-[#596970]",children:t.description||"no description"})}},{accessorKey:"post_count",header:"Number of Posts",meta:{width:"grow"},cell:({row:e})=>{const t=e.original;return s.jsxs("div",{className:"flex items-center grow gap-2 min-w-50",children:[s.jsx(Re,{className:"h-4 w-4"}),t.post_count]})}},{accessorKey:"updated_at",header:"Last Modified",meta:{width:"grow"},cell:({row:e})=>{const t=e.original,a=new J("en-US");return s.jsx("span",{className:"",children:a.format(new Date(t.updated_at))})}}],Ia=[{value:H.ALL,label:"All Categories"}],ja=[{id:"name",label:"Name",type:q.TEXT,icon:s.jsx(Se,{className:"text-[#298BFC] text-xl"})},{id:"description",label:"Description",type:q.TEXT,icon:s.jsx(pe,{className:"text-[#C01574] text-xl"})},{id:"updated_at",label:"Last Modified",type:q.DATE,icon:s.jsx(he,{className:"text-primary text-xl"})}],Fa=({blog_uuid:e,baseUrl:t,className:a})=>{const r=typeof window<"u"?(()=>{const p=new URLSearchParams(window.location.search).get("uuid");if(p)return p;const h=window.location.pathname.split("/"),x=h[h.length-1];return x&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(x)?x:null})():null,[i,n]=u.useState(!1),[o,l]=u.useState(null);u.useEffect(()=>{r&&n(!0)},[r]);const c=u.useCallback(()=>{l(null),n(!0)},[]),m=u.useCallback(g=>{l(g),n(!0)},[]);return s.jsxs(s.Fragment,{children:[s.jsx(ae,{baseUrl:t,columns:Ra,rootClassName:A("flex-1",a),queryConfig:{fetch:{query:na,variables:{blog_uuid:e},dataKey:"categories"},delete:{query:ia,variables:{blog_uuid:e},dataKey:"categories"}},toggleView:!1,filterFields:ja,statusFilters:Ia,postType:"Categories",postTypeSng:"Category",rowClassName:"h-[60px]",tableRowHeight:60,onCreateClick:c,onEditClick:m}),s.jsx(oa,{open:i,onOpenChange:g=>n(g),blog_uuid:e,uuid:r,baseUrl:t,initialData:o||{}})]})};Fa.__docgenInfo={description:"",methods:[],displayName:"CategoriesComponent",props:{blog_uuid:{required:!0,tsType:{name:"string"},description:""},baseUrl:{required:!0,tsType:{name:"string"},description:""},className:{required:!1,tsType:{name:"string"},description:""}}};const Da=[{accessorKey:"name",header:"Name",cell:({row:e})=>{const t=e.original;return s.jsx("div",{className:"p-2 rounded-full text-sm w-fit bg-[#EEF4FF] text-[#3538CD] ",children:t.name})}},{accessorKey:"display_name",header:"Display Name",cell:({row:e})=>{const t=e.original;return s.jsx("span",{className:"capitalize text-sm text-[#596970]",children:t.display_name})}},{accessorKey:"namespace",header:"Namespace",cell:({row:e})=>{const t=e.original;return s.jsx("span",{className:"text-sm text-[#596970]",children:t.namespace||"default"})}},{accessorKey:"description",header:"Description",meta:{width:"grow"},cell:({row:e})=>{const t=e.original;return s.jsx("div",{className:"w-full min-w-50 max-w-100 ",children:s.jsx("span",{className:"capitalize text-sm text-[#596970]",children:t.description||"no description"})})}},{accessorKey:"updated_at",header:"Last Modified",meta:{width:"grow"},cell:({row:e})=>{const t=e.original,a=new J("en-US");return s.jsx("span",{className:"text-[#596970]",children:a.format(new Date(t.updated_at))})}}],La=[{value:H.ALL,label:"All Categories"}],Aa=[{id:"name",label:"Name",type:q.TEXT,icon:s.jsx(Se,{className:"text-[#298BFC] text-xl"})},{id:"display_name",label:"Display Name",type:q.TEXT,icon:s.jsx(Se,{className:"text-[#298BFC] text-xl"})},{id:"slug",label:"Slug",type:q.TEXT,icon:s.jsx(pe,{className:"text-[#C01574] text-xl"})},{id:"namespace",label:"Namespace",type:q.TEXT,icon:s.jsx(pe,{className:"text-[#C01574] text-xl"})},{id:"description",label:"Description",type:q.TEXT,icon:s.jsx(pe,{className:"text-[#C01574] text-xl"})},{id:"updated_at",label:"Last Modified",type:q.DATE,icon:s.jsx(he,{className:"text-primary text-xl"})}],Ua=I(`
|
|
377
|
+
query MyQuery(
|
|
378
|
+
$first: Int!
|
|
379
|
+
$page: Int
|
|
380
|
+
$filter: TagFilterInput!
|
|
381
|
+
) {
|
|
382
|
+
tags(
|
|
383
|
+
filter: $filter
|
|
384
|
+
first: $first
|
|
385
|
+
page: $page
|
|
386
|
+
sort: { field: UPDATED_AT, order: DESC }
|
|
387
|
+
) {
|
|
388
|
+
data {
|
|
389
|
+
created_at
|
|
390
|
+
updated_at
|
|
391
|
+
id
|
|
392
|
+
name
|
|
393
|
+
description
|
|
394
|
+
namespace
|
|
395
|
+
display_name
|
|
396
|
+
slug
|
|
397
|
+
uuid
|
|
398
|
+
}
|
|
399
|
+
paginatorInfo {
|
|
400
|
+
count
|
|
401
|
+
currentPage
|
|
402
|
+
firstItem
|
|
403
|
+
hasMorePages
|
|
404
|
+
lastItem
|
|
405
|
+
lastPage
|
|
406
|
+
perPage
|
|
407
|
+
total
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
`),Ma=I(`
|
|
413
|
+
mutation DeleteTag(
|
|
414
|
+
$uuid: ID!
|
|
415
|
+
|
|
416
|
+
) {
|
|
417
|
+
deleteTag(uuid: $uuid) {
|
|
418
|
+
id
|
|
419
|
+
uuid
|
|
420
|
+
name
|
|
421
|
+
slug
|
|
422
|
+
display_name
|
|
423
|
+
namespace
|
|
424
|
+
created_at
|
|
425
|
+
updated_at
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
`);/**
|
|
430
|
+
* react-router v7.10.1
|
|
431
|
+
*
|
|
432
|
+
* Copyright (c) Remix Software Inc.
|
|
433
|
+
*
|
|
434
|
+
* This source code is licensed under the MIT license found in the
|
|
435
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
436
|
+
*
|
|
437
|
+
* @license MIT
|
|
438
|
+
*/function B(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function W(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Pe({pathname:e="/",search:t="",hash:a=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function De(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function pt(e,t,a="/"){return Ba(e,t,a,!1)}function Ba(e,t,a,r){let i=typeof t=="string"?De(t):t,n=te(i.pathname||"/",a);if(n==null)return null;let o=mt(e);Oa(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let m=Ya(n);l=Xa(o[c],m,r)}return l}function mt(e,t=[],a=[],r="",i=!1){let n=(o,l,c=i,m)=>{let g={relativePath:m===void 0?o.path||"":m,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&c)return;B(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let p=Y([r,g.relativePath]),h=a.concat(g);o.children&&o.children.length>0&&(B(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),mt(o.children,t,h,p,c)),!(o.path==null&&!o.index)&&t.push({path:p,score:Ja(p,o.index),routesMeta:h})};return e.forEach((o,l)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))n(o,l);else for(let m of gt(o.path))n(o,l,!0,m)}),t}function gt(e){let t=e.split("/");if(t.length===0)return[];let[a,...r]=t,i=a.endsWith("?"),n=a.replace(/\?$/,"");if(r.length===0)return i?[n,""]:[n];let o=gt(r.join("/")),l=[];return l.push(...o.map(c=>c===""?n:[n,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Oa(e){e.sort((t,a)=>t.score!==a.score?a.score-t.score:Za(t.routesMeta.map(r=>r.childrenIndex),a.routesMeta.map(r=>r.childrenIndex)))}var Ka=/^:[\w-]+$/,Ga=3,Va=2,za=1,Ha=10,Wa=-2,ze=e=>e==="*";function Ja(e,t){let a=e.split("/"),r=a.length;return a.some(ze)&&(r+=Wa),t&&(r+=Va),a.filter(i=>!ze(i)).reduce((i,n)=>i+(Ka.test(n)?Ga:n===""?za:Ha),r)}function Za(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Xa(e,t,a=!1){let{routesMeta:r}=e,i={},n="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],m=l===r.length-1,g=n==="/"?t:t.slice(n.length)||"/",p=fe({path:c.relativePath,caseSensitive:c.caseSensitive,end:m},g),h=c.route;if(!p&&m&&a&&!r[r.length-1].route.index&&(p=fe({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},g)),!p)return null;Object.assign(i,p.params),o.push({params:i,pathname:Y([n,p.pathname]),pathnameBase:ir(Y([n,p.pathnameBase])),route:h}),p.pathnameBase!=="/"&&(n=Y([n,p.pathnameBase]))}return o}function fe(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,r]=Qa(e.path,e.caseSensitive,e.end),i=t.match(a);if(!i)return null;let n=i[0],o=n.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((m,{paramName:g,isOptional:p},h)=>{if(g==="*"){let v=l[h]||"";o=n.slice(0,n.length-v.length).replace(/(.)\/+$/,"$1")}const x=l[h];return p&&!x?m[g]=void 0:m[g]=(x||"").replace(/%2F/g,"/"),m},{}),pathname:n,pathnameBase:o,pattern:e}}function Qa(e,t=!1,a=!0){W(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Ya(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return W(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function te(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,r=e.charAt(a);return r&&r!=="/"?null:e.slice(a)||"/"}var er=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tr=e=>er.test(e);function ar(e,t="/"){let{pathname:a,search:r="",hash:i=""}=typeof e=="string"?De(e):e,n;if(a)if(tr(a))n=a;else{if(a.includes("//")){let o=a;a=a.replace(/\/\/+/g,"/"),W(!1,`Pathnames cannot have embedded double slashes - normalizing ${o} -> ${a}`)}a.startsWith("/")?n=He(a.substring(1),"/"):n=He(a,t)}else n=t;return{pathname:n,search:nr(r),hash:sr(i)}}function He(e,t){let a=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?a.length>1&&a.pop():i!=="."&&a.push(i)}),a.length>1?a.join("/"):"/"}function Ce(e,t,a,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function rr(e){return e.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function ft(e){let t=rr(e);return t.map((a,r)=>r===t.length-1?a.pathname:a.pathnameBase)}function ht(e,t,a,r=!1){let i;typeof e=="string"?i=De(e):(i={...e},B(!i.pathname||!i.pathname.includes("?"),Ce("?","pathname","search",i)),B(!i.pathname||!i.pathname.includes("#"),Ce("#","pathname","hash",i)),B(!i.search||!i.search.includes("#"),Ce("#","search","hash",i)));let n=e===""||i.pathname==="",o=n?"/":i.pathname,l;if(o==null)l=a;else{let p=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),p-=1;i.pathname=h.join("/")}l=p>=0?t[p]:"/"}let c=ar(i,l),m=o&&o!=="/"&&o.endsWith("/"),g=(n||o===".")&&a.endsWith("/");return!c.pathname.endsWith("/")&&(m||g)&&(c.pathname+="/"),c}var Y=e=>e.join("/").replace(/\/\/+/g,"/"),ir=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),nr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,sr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function or(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function lr(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var yt=["POST","PUT","PATCH","DELETE"];new Set(yt);var ur=["GET",...yt];new Set(ur);var se=u.createContext(null);se.displayName="DataRouter";var _e=u.createContext(null);_e.displayName="DataRouterState";u.createContext(!1);var _t=u.createContext({isTransitioning:!1});_t.displayName="ViewTransition";var cr=u.createContext(new Map);cr.displayName="Fetchers";var dr=u.createContext(null);dr.displayName="Await";var Z=u.createContext(null);Z.displayName="Navigation";var Le=u.createContext(null);Le.displayName="Location";var X=u.createContext({outlet:null,matches:[],isDataRoute:!1});X.displayName="Route";var Ae=u.createContext(null);Ae.displayName="RouteError";function pr(e,{relative:t}={}){B(xe(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:r}=u.useContext(Z),{hash:i,pathname:n,search:o}=ce(e,{relative:t}),l=n;return a!=="/"&&(l=n==="/"?a:Y([a,n])),r.createHref({pathname:l,search:o,hash:i})}function xe(){return u.useContext(Le)!=null}function re(){return B(xe(),"useLocation() may be used only in the context of a <Router> component."),u.useContext(Le).location}var xt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function bt(e){u.useContext(Z).static||u.useLayoutEffect(e)}function mr(){let{isDataRoute:e}=u.useContext(X);return e?Pr():gr()}function gr(){B(xe(),"useNavigate() may be used only in the context of a <Router> component.");let e=u.useContext(se),{basename:t,navigator:a}=u.useContext(Z),{matches:r}=u.useContext(X),{pathname:i}=re(),n=JSON.stringify(ft(r)),o=u.useRef(!1);return bt(()=>{o.current=!0}),u.useCallback((c,m={})=>{if(W(o.current,xt),!o.current)return;if(typeof c=="number"){a.go(c);return}let g=ht(c,JSON.parse(n),i,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Y([t,g.pathname])),(m.replace?a.replace:a.push)(g,m.state,m)},[t,a,n,i,e])}u.createContext(null);function fr(){let{matches:e}=u.useContext(X),t=e[e.length-1];return t?t.params:{}}function ce(e,{relative:t}={}){let{matches:a}=u.useContext(X),{pathname:r}=re(),i=JSON.stringify(ft(a));return u.useMemo(()=>ht(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function hr(e,t,a,r,i){B(xe(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=u.useContext(Z),{matches:o}=u.useContext(X),l=o[o.length-1],c=l?l.params:{},m=l?l.pathname:"/",g=l?l.pathnameBase:"/",p=l&&l.route;{let _=p&&p.path||"";vt(m,!p||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
439
|
+
|
|
440
|
+
Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let h=re(),x;x=h;let v=x.pathname||"/",w=v;if(g!=="/"){let _=g.replace(/^\//,"").split("/");w="/"+v.replace(/^\//,"").split("/").slice(_.length).join("/")}let C=pt(e,{pathname:w});return W(p||C!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),W(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),vr(C&&C.map(_=>Object.assign({},_,{params:Object.assign({},c,_.params),pathname:Y([g,n.encodeLocation?n.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?g:Y([g,n.encodeLocation?n.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),o,a,r,i)}function yr(){let e=Sr(),t=or(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},n={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=u.createElement(u.Fragment,null,u.createElement("p",null,"💿 Hey developer 👋"),u.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",u.createElement("code",{style:n},"ErrorBoundary")," or"," ",u.createElement("code",{style:n},"errorElement")," prop on your route.")),u.createElement(u.Fragment,null,u.createElement("h2",null,"Unexpected Application Error!"),u.createElement("h3",{style:{fontStyle:"italic"}},t),a?u.createElement("pre",{style:i},a):null,o)}var _r=u.createElement(yr,null),xr=class extends u.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?u.createElement(X.Provider,{value:this.props.routeContext},u.createElement(Ae.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function br({routeContext:e,match:t,children:a}){let r=u.useContext(se);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),u.createElement(X.Provider,{value:e},a)}function vr(e,t=[],a=null,r=null,i=null){if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let n=e,o=a==null?void 0:a.errors;if(o!=null){let g=n.findIndex(p=>p.route.id&&(o==null?void 0:o[p.route.id])!==void 0);B(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,g+1))}let l=!1,c=-1;if(a)for(let g=0;g<n.length;g++){let p=n[g];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=g),p.route.id){let{loaderData:h,errors:x}=a,v=p.route.loader&&!h.hasOwnProperty(p.route.id)&&(!x||x[p.route.id]===void 0);if(p.route.lazy||v){l=!0,c>=0?n=n.slice(0,c+1):n=[n[0]];break}}}let m=a&&r?(g,p)=>{var h,x;r(g,{location:a.location,params:((x=(h=a.matches)==null?void 0:h[0])==null?void 0:x.params)??{},unstable_pattern:lr(a.matches),errorInfo:p})}:void 0;return n.reduceRight((g,p,h)=>{let x,v=!1,w=null,C=null;a&&(x=o&&p.route.id?o[p.route.id]:void 0,w=p.route.errorElement||_r,l&&(c<0&&h===0?(vt("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,C=null):c===h&&(v=!0,C=p.route.hydrateFallbackElement||null)));let T=t.concat(n.slice(0,h+1)),_=()=>{let k;return x?k=w:v?k=C:p.route.Component?k=u.createElement(p.route.Component,null):p.route.element?k=p.route.element:k=g,u.createElement(br,{match:p,routeContext:{outlet:g,matches:T,isDataRoute:a!=null},children:k})};return a&&(p.route.ErrorBoundary||p.route.errorElement||h===0)?u.createElement(xr,{location:a.location,revalidation:a.revalidation,component:w,error:x,children:_(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:m}):_()},null)}function Ue(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wr(e){let t=u.useContext(se);return B(t,Ue(e)),t}function Cr(e){let t=u.useContext(_e);return B(t,Ue(e)),t}function Tr(e){let t=u.useContext(X);return B(t,Ue(e)),t}function Me(e){let t=Tr(e),a=t.matches[t.matches.length-1];return B(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function $r(){return Me("useRouteId")}function Sr(){var r;let e=u.useContext(Ae),t=Cr("useRouteError"),a=Me("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[a]}function Pr(){let{router:e}=wr("useNavigate"),t=Me("useNavigate"),a=u.useRef(!1);return bt(()=>{a.current=!0}),u.useCallback(async(i,n={})=>{W(a.current,xt),a.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...n}))},[e,t])}var We={};function vt(e,t,a){!t&&!We[e]&&(We[e]=!0,W(!1,a))}u.memo(kr);function kr({routes:e,future:t,state:a,unstable_onError:r}){return hr(e,void 0,a,r,t)}var me="get",ge="application/x-www-form-urlencoded";function be(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Er(e){return be(e)&&e.tagName.toLowerCase()==="button"}function Nr(e){return be(e)&&e.tagName.toLowerCase()==="form"}function qr(e){return be(e)&&e.tagName.toLowerCase()==="input"}function Rr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ir(e,t){return e.button===0&&(!t||t==="_self")&&!Rr(e)}var de=null;function jr(){if(de===null)try{new FormData(document.createElement("form"),0),de=!1}catch{de=!0}return de}var Fr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Te(e){return e!=null&&!Fr.has(e)?(W(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ge}"`),null):e}function Dr(e,t){let a,r,i,n,o;if(Nr(e)){let l=e.getAttribute("action");r=l?te(l,t):null,a=e.getAttribute("method")||me,i=Te(e.getAttribute("enctype"))||ge,n=new FormData(e)}else if(Er(e)||qr(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(r=c?te(c,t):null,a=e.getAttribute("formmethod")||l.getAttribute("method")||me,i=Te(e.getAttribute("formenctype"))||Te(l.getAttribute("enctype"))||ge,n=new FormData(l,e),!jr()){let{name:m,type:g,value:p}=e;if(g==="image"){let h=m?`${m}.`:"";n.append(`${h}x`,"0"),n.append(`${h}y`,"0")}else m&&n.append(m,p)}}else{if(be(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=me,r=null,i=ge,o=e}return n&&i==="text/plain"&&(o=n,n=void 0),{action:r,method:a.toLowerCase(),encType:i,formData:n,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Be(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Lr(e,t,a){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${a}`:t&&te(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${a}`,r}async function Ar(e,t){if(e.id in t)return t[e.id];try{let a=await import(e.module);return t[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ur(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Mr(e,t,a){let r=await Promise.all(e.map(async i=>{let n=t.routes[i.route.id];if(n){let o=await Ar(n,a);return o.links?o.links():[]}return[]}));return Gr(r.flat(1).filter(Ur).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Je(e,t,a,r,i,n){let o=(c,m)=>a[m]?c.route.id!==a[m].route.id:!0,l=(c,m)=>{var g;return a[m].pathname!==c.pathname||((g=a[m].route.path)==null?void 0:g.endsWith("*"))&&a[m].params["*"]!==c.params["*"]};return n==="assets"?t.filter((c,m)=>o(c,m)||l(c,m)):n==="data"?t.filter((c,m)=>{var p;let g=r.routes[c.route.id];if(!g||!g.hasLoader)return!1;if(o(c,m)||l(c,m))return!0;if(c.route.shouldRevalidate){let h=c.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((p=a[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function Br(e,t,{includeHydrateFallback:a}={}){return Or(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let n=[i.module];return i.clientActionModule&&(n=n.concat(i.clientActionModule)),i.clientLoaderModule&&(n=n.concat(i.clientLoaderModule)),a&&i.hydrateFallbackModule&&(n=n.concat(i.hydrateFallbackModule)),i.imports&&(n=n.concat(i.imports)),n}).flat(1))}function Or(e){return[...new Set(e)]}function Kr(e){let t={},a=Object.keys(e).sort();for(let r of a)t[r]=e[r];return t}function Gr(e,t){let a=new Set;return new Set(t),e.reduce((r,i)=>{let n=JSON.stringify(Kr(i));return a.has(n)||(a.add(n),r.push({key:n,link:i})),r},[])}function wt(){let e=u.useContext(se);return Be(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Vr(){let e=u.useContext(_e);return Be(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Oe=u.createContext(void 0);Oe.displayName="FrameworkContext";function Ct(){let e=u.useContext(Oe);return Be(e,"You must render this element inside a <HydratedRouter> element"),e}function zr(e,t){let a=u.useContext(Oe),[r,i]=u.useState(!1),[n,o]=u.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:m,onMouseLeave:g,onTouchStart:p}=t,h=u.useRef(null);u.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let w=T=>{T.forEach(_=>{o(_.isIntersecting)})},C=new IntersectionObserver(w,{threshold:.5});return h.current&&C.observe(h.current),()=>{C.disconnect()}}},[e]),u.useEffect(()=>{if(r){let w=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(w)}}},[r]);let x=()=>{i(!0)},v=()=>{i(!1),o(!1)};return a?e!=="intent"?[n,h,{}]:[n,h,{onFocus:oe(l,x),onBlur:oe(c,v),onMouseEnter:oe(m,x),onMouseLeave:oe(g,v),onTouchStart:oe(p,x)}]:[!1,h,{}]}function oe(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function Hr({page:e,...t}){let{router:a}=wt(),r=u.useMemo(()=>pt(a.routes,e,a.basename),[a.routes,e,a.basename]);return r?u.createElement(Jr,{page:e,matches:r,...t}):null}function Wr(e){let{manifest:t,routeModules:a}=Ct(),[r,i]=u.useState([]);return u.useEffect(()=>{let n=!1;return Mr(e,t,a).then(o=>{n||i(o)}),()=>{n=!0}},[e,t,a]),r}function Jr({page:e,matches:t,...a}){let r=re(),{manifest:i,routeModules:n}=Ct(),{basename:o}=wt(),{loaderData:l,matches:c}=Vr(),m=u.useMemo(()=>Je(e,t,c,i,r,"data"),[e,t,c,i,r]),g=u.useMemo(()=>Je(e,t,c,i,r,"assets"),[e,t,c,i,r]),p=u.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let v=new Set,w=!1;if(t.forEach(T=>{var k;let _=i.routes[T.route.id];!_||!_.hasLoader||(!m.some(O=>O.route.id===T.route.id)&&T.route.id in l&&((k=n[T.route.id])!=null&&k.shouldRevalidate)||_.hasClientLoader?w=!0:v.add(T.route.id))}),v.size===0)return[];let C=Lr(e,o,"data");return w&&v.size>0&&C.searchParams.set("_routes",t.filter(T=>v.has(T.route.id)).map(T=>T.route.id).join(",")),[C.pathname+C.search]},[o,l,r,i,m,t,e,n]),h=u.useMemo(()=>Br(g,i),[g,i]),x=Wr(g);return u.createElement(u.Fragment,null,p.map(v=>u.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...a})),h.map(v=>u.createElement("link",{key:v,rel:"modulepreload",href:v,...a})),x.map(({key:v,link:w})=>u.createElement("link",{key:v,nonce:a.nonce,...w})))}function Zr(...e){return t=>{e.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}var Tt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Tt&&(window.__reactRouterVersion="7.10.1")}catch{}var $t=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,St=u.forwardRef(function({onClick:t,discover:a="render",prefetch:r="none",relative:i,reloadDocument:n,replace:o,state:l,target:c,to:m,preventScrollReset:g,viewTransition:p,...h},x){let{basename:v,unstable_useTransitions:w}=u.useContext(Z),C=typeof m=="string"&&$t.test(m),T,_=!1;if(typeof m=="string"&&C&&(T=m,Tt))try{let L=new URL(window.location.href),d=m.startsWith("//")?new URL(L.protocol+m):new URL(m),y=te(d.pathname,v);d.origin===L.origin&&y!=null?m=y+d.search+d.hash:_=!0}catch{W(!1,`<Link to="${m}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let k=pr(m,{relative:i}),[O,G,f]=zr(r,h),P=ei(m,{replace:o,state:l,target:c,preventScrollReset:g,relative:i,viewTransition:p,unstable_useTransitions:w});function R(L){t&&t(L),L.defaultPrevented||P(L)}let K=u.createElement("a",{...h,...f,href:T||k,onClick:_||n?t:R,ref:Zr(x,G),target:c,"data-discover":!C&&a==="render"?"true":void 0});return O&&!C?u.createElement(u.Fragment,null,K,u.createElement(Hr,{page:k})):K});St.displayName="Link";var Xr=u.forwardRef(function({"aria-current":t="page",caseSensitive:a=!1,className:r="",end:i=!1,style:n,to:o,viewTransition:l,children:c,...m},g){let p=ce(o,{relative:m.relative}),h=re(),x=u.useContext(_e),{navigator:v,basename:w}=u.useContext(Z),C=x!=null&&ni(p)&&l===!0,T=v.encodeLocation?v.encodeLocation(p).pathname:p.pathname,_=h.pathname,k=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;a||(_=_.toLowerCase(),k=k?k.toLowerCase():null,T=T.toLowerCase()),k&&w&&(k=te(k,w)||k);const O=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let G=_===T||!i&&_.startsWith(T)&&_.charAt(O)==="/",f=k!=null&&(k===T||!i&&k.startsWith(T)&&k.charAt(T.length)==="/"),P={isActive:G,isPending:f,isTransitioning:C},R=G?t:void 0,K;typeof r=="function"?K=r(P):K=[r,G?"active":null,f?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let L=typeof n=="function"?n(P):n;return u.createElement(St,{...m,"aria-current":R,className:K,ref:g,style:L,to:o,viewTransition:l},typeof c=="function"?c(P):c)});Xr.displayName="NavLink";var Qr=u.forwardRef(({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:r,replace:i,state:n,method:o=me,action:l,onSubmit:c,relative:m,preventScrollReset:g,viewTransition:p,...h},x)=>{let{unstable_useTransitions:v}=u.useContext(Z),w=ri(),C=ii(l,{relative:m}),T=o.toLowerCase()==="get"?"get":"post",_=typeof l=="string"&&$t.test(l),k=O=>{if(c&&c(O),O.defaultPrevented)return;O.preventDefault();let G=O.nativeEvent.submitter,f=(G==null?void 0:G.getAttribute("formmethod"))||o,P=()=>w(G||O.currentTarget,{fetcherKey:t,method:f,navigate:a,replace:i,state:n,relative:m,preventScrollReset:g,viewTransition:p});v&&a!==!1?u.startTransition(()=>P()):P()};return u.createElement("form",{ref:x,method:T,action:C,onSubmit:r?c:k,...h,"data-discover":!_&&e==="render"?"true":void 0})});Qr.displayName="Form";function Yr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Pt(e){let t=u.useContext(se);return B(t,Yr(e)),t}function ei(e,{target:t,replace:a,state:r,preventScrollReset:i,relative:n,viewTransition:o,unstable_useTransitions:l}={}){let c=mr(),m=re(),g=ce(e,{relative:n});return u.useCallback(p=>{if(Ir(p,t)){p.preventDefault();let h=a!==void 0?a:Pe(m)===Pe(g),x=()=>c(e,{replace:h,state:r,preventScrollReset:i,relative:n,viewTransition:o});l?u.startTransition(()=>x()):x()}},[m,c,g,a,r,t,e,i,n,o,l])}var ti=0,ai=()=>`__${String(++ti)}__`;function ri(){let{router:e}=Pt("useSubmit"),{basename:t}=u.useContext(Z),a=$r(),r=e.fetch,i=e.navigate;return u.useCallback(async(n,o={})=>{let{action:l,method:c,encType:m,formData:g,body:p}=Dr(n,t);if(o.navigate===!1){let h=o.fetcherKey||ai();await r(h,a,o.action||l,{preventScrollReset:o.preventScrollReset,formData:g,body:p,formMethod:o.method||c,formEncType:o.encType||m,flushSync:o.flushSync})}else await i(o.action||l,{preventScrollReset:o.preventScrollReset,formData:g,body:p,formMethod:o.method||c,formEncType:o.encType||m,replace:o.replace,state:o.state,fromRouteId:a,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,t,a])}function ii(e,{relative:t}={}){let{basename:a}=u.useContext(Z),r=u.useContext(X);B(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),n={...ce(e||".",{relative:t})},o=re();if(e==null){n.search=o.search;let l=new URLSearchParams(n.search),c=l.getAll("index");if(c.some(g=>g==="")){l.delete("index"),c.filter(p=>p).forEach(p=>l.append("index",p));let g=l.toString();n.search=g?`?${g}`:""}}return(!e||e===".")&&i.route.index&&(n.search=n.search?n.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(n.pathname=n.pathname==="/"?a:Y([a,n.pathname])),Pe(n)}function ni(e,{relative:t}={}){let a=u.useContext(_t);B(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Pt("useViewTransitionState"),i=ce(e,{relative:t});if(!a.isTransitioning)return!1;let n=te(a.currentLocation.pathname,r)||a.currentLocation.pathname,o=te(a.nextLocation.pathname,r)||a.nextLocation.pathname;return fe(i.pathname,o)!=null||fe(i.pathname,n)!=null}const si=({baseUrl:e,blog_uuid:t,className:a})=>{const{uuid:r}=fr(),[i,n]=u.useState(null),[o,l]=u.useState(!1);return u.useEffect(()=>{r&&l(!0)},[r]),s.jsxs(s.Fragment,{children:[s.jsx(ae,{baseUrl:e,columns:Da,rootClassName:A("flex-1",a),queryConfig:{fetch:{query:Ua,variables:{blog_uuid:t},dataKey:"tags"},delete:{query:Ma,variables:{blog_uuid:t},dataKey:"tags"}},toggleView:!1,filterFields:Aa,statusFilters:La,postType:"Tags",postTypeSng:"Tag",rowClassName:"h-[60px]",tableRowHeight:60,onCreateClick:()=>{n(null),l(!0)},onEditClick:c=>{n(c),l(!0)}}),s.jsx(la,{open:o,onOpenChange:c=>l(c),blog_uuid:t,uuid:r||(i==null?void 0:i.uuid),baseUrl:e,initialData:i||{}})]})};si.__docgenInfo={description:"",methods:[],displayName:"TagsComponent",props:{blog_uuid:{required:!0,tsType:{name:"string"},description:""},baseUrl:{required:!0,tsType:{name:"string"},description:""},className:{required:!1,tsType:{name:"string"},description:""}}};function kt({postBaseUrl:e,authors:t}){return[{accessorKey:"post",header:"Post",meta:{width:"grow"},cell:({row:a})=>{const r=a.original;let i;try{i=JSON.parse(r.cover_image)}catch(o){console.log(o)}const n=t==null?void 0:t.find(o=>(o==null?void 0:o.uuid)==r.author_uuid);return s.jsxs("div",{className:"gap-2 h-13 flex flex-row items-center justify-between w-full min-w-110 flex-1 pr-15 grow",children:[s.jsx(Ie,{url:i==null?void 0:i.src,transformations:{width:80,height:64},classname:"w-[5rem] h-full rounded-sm overflow-hidden"}),s.jsxs("div",{className:A(" relative flex flex-col justify-between w-0 gap-y-1 flex-1 h-full ",{"pr-15":!r.status}),children:[s.jsx("a",{className:"hover:underline cursor-pointer text-sm line-clamp-2",href:e+r.slug,target:"_blank",rel:"noopener noreferrer",children:ue(r.title)}),s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx("div",{className:"flex items-center justify-center w-4 h-4 font-semi-bold rounded-full bg-secondary",children:s.jsx("p",{className:"text-[8px] text-black",children:Ee(n==null?void 0:n.name)})}),s.jsx("p",{className:" text-muted-foreground text-xs",children:n==null?void 0:n.name}),s.jsx(ne,{variant:"outline",className:A("text-xs absolute top-0 right-0 bg-muted text-muted-foreground",{hidden:r==null?void 0:r.status}),children:"Draft"})]})]})]})}},{accessorKey:"categories",header:"Categories",cell:({row:a})=>{const r=a.original;return s.jsx("div",{className:"min-w-10 md:min-w-30",children:s.jsx(Ne,{categories:r.categories})})}},{accessorKey:"tags",header:"Tags",cell:({row:a})=>{const r=a.original;return s.jsx("div",{className:"min-w-10 md:min-w-30",children:s.jsx(ye,{tags:r.tags})})}},{accessorKey:"statistics",header:"Statistics",cell:({row:a})=>{const r=a.original;return s.jsx("div",{className:"min-w-10 md:min-w-30",children:s.jsx(qe,{statistics:r.statistics,className:"text-base p-0",isGrid:!1})})}},{accessorKey:"updated_at",header:"Last Modified",cell:({row:a})=>{const r=a.original,i=new J("en-US");return s.jsx("div",{className:"min-w-10 md:min-w-30",children:i.format(new Date(r.updated_at))})}}]}const Et=[{id:"title",label:"Title",type:q.TEXT,icon:s.jsx(Zt,{color:"blue"})},{id:"excerpt",label:"Excerpt",type:q.TEXT,icon:s.jsx(ee,{color:"red"})},{id:"status",label:"Status",type:q.TEXT,icon:s.jsx(ee,{color:"red"}),selectProps:{options:[{value:"0",label:"Draft"},{value:"1",label:"Published"}]}},{id:"created_at",label:"Created Date",type:q.DATE,icon:s.jsx(ee,{color:"red"})},{id:"updated_at",label:"Updated Date",type:q.DATE,icon:s.jsx(ee,{color:"red"})},{id:"published_at",label:"Published Date",type:q.DATE,icon:s.jsx(ee,{color:"red"})}],Nt=[{value:H.ALL,label:"All Recipes"},{value:H.PUBLISHED,label:"Published"},{value:H.DRAFT,label:"In Draft"}],ke=I`
|
|
441
|
+
query GqlGetRecipesBySiteUuid($first: Int, $site_uuid: ID, $page: Int, $search: String) {
|
|
442
|
+
getRecipesBySiteUuid(
|
|
443
|
+
input: {
|
|
444
|
+
site_uuid: $site_uuid
|
|
445
|
+
perPage: $first
|
|
446
|
+
page: $page
|
|
447
|
+
search: $search
|
|
448
|
+
include_drafts: true
|
|
449
|
+
sort: { column: "updated_at", order: DESC }
|
|
450
|
+
}
|
|
451
|
+
) {
|
|
452
|
+
data {
|
|
453
|
+
id
|
|
454
|
+
uuid
|
|
455
|
+
title
|
|
456
|
+
description
|
|
457
|
+
excerpt
|
|
458
|
+
slug
|
|
459
|
+
permalink
|
|
460
|
+
status
|
|
461
|
+
ingredient_lists
|
|
462
|
+
method
|
|
463
|
+
cover_image
|
|
464
|
+
serves
|
|
465
|
+
cooking_time
|
|
466
|
+
cooking_time_extra
|
|
467
|
+
author_uuid
|
|
468
|
+
published_at
|
|
469
|
+
video_link
|
|
470
|
+
site_uuid
|
|
471
|
+
measurement
|
|
472
|
+
created_at
|
|
473
|
+
updated_at
|
|
474
|
+
tags {
|
|
475
|
+
uuid
|
|
476
|
+
name
|
|
477
|
+
site_uuid
|
|
478
|
+
}
|
|
479
|
+
categories {
|
|
480
|
+
uuid
|
|
481
|
+
name
|
|
482
|
+
slug
|
|
483
|
+
site_uuid
|
|
484
|
+
description
|
|
485
|
+
}
|
|
486
|
+
category {
|
|
487
|
+
uuid
|
|
488
|
+
name
|
|
489
|
+
slug
|
|
490
|
+
site_uuid
|
|
491
|
+
description
|
|
492
|
+
}
|
|
493
|
+
config {
|
|
494
|
+
is_in_sitemap
|
|
495
|
+
is_feature_recipe
|
|
496
|
+
schema
|
|
497
|
+
social_preview_config
|
|
498
|
+
has_related_recipes
|
|
499
|
+
related_recipes_config
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
paginatorInfo {
|
|
503
|
+
currentPage
|
|
504
|
+
lastPage
|
|
505
|
+
count
|
|
506
|
+
lastPage
|
|
507
|
+
perPage
|
|
508
|
+
hasMorePages
|
|
509
|
+
currentPage
|
|
510
|
+
total
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
`;function Ke({data:e,className:t,onDeleteClick:a,postBaseURL:r="",blogBaseUrl:i="",isSelect:n,selected:o,onSelect:l,onEditClick:c}){var g;let m={};try{m=JSON.parse(e==null?void 0:e.cover_image)}catch(p){console.log(p)}return s.jsxs(ua,{className:A("max-w-[450px] flex flex-col justify-between overflow-hidden rounded-md focus:border-accent focus:border focus:bg-[#BEFEF72B] hover:border-accent hover:border hover:bg-[#BEFEF72B] ",t),"data-testid":"recipe-card:"+e.uuid,onDoubleClick:()=>c==null?void 0:c(e),children:[s.jsxs("div",{className:"grow flex flex-col",children:[s.jsxs(ca,{className:"p-0 relative h-[178px]",children:[s.jsx(ne,{variant:"outline",className:A("text-xs absolute z-10 top-2 left-2 bg-muted text-muted-foreground",{hidden:e.status}),children:"Draft"}),s.jsx(we,{variant:"ghost",size:"icon",className:A("rounded-md shadow-[0px_4.29px_12.86px_0px_#00000012] bg-background w-7 h-7 absolute top-2 right-2 z-10",{hidden:!n},{"bg-primary":o}),onClick:()=>l==null?void 0:l(e),children:s.jsx("div",{className:"w-4 h-4 border-2 border-foreground rounded-full flex items-center justify-center",children:o&&s.jsx("div",{className:"w-2 h-2 bg-foreground rounded-full"})})}),s.jsxs("div",{className:A("flex items-center gap-1 absolute top-2 right-2 z-10",{hidden:n}),children:[s.jsx("a",{className:"leading-0",href:`${i}/${e.uuid}`,onClick:p=>p.preventDefault(),children:s.jsx(we,{variant:"ghost",size:"icon",className:"rounded-md shadow-[0px_4.29px_12.86px_0px_#00000012] bg-background w-7 h-7",onClick:()=>c==null?void 0:c(e),children:s.jsx(Qt,{size:"small",className:"text-accent-foreground"})})}),s.jsx(we,{variant:"ghost",size:"icon",className:"rounded-md shadow-[0px_4.29px_12.86px_0px_#00000012] bg-background w-7 h-7",onClick:()=>a==null?void 0:a(e),children:s.jsx(Yt,{size:"small",className:"text-destructive"})})]}),s.jsx(Ie,{url:m==null?void 0:m.src,transformations:{height:178}}),s.jsx("div",{className:"absolute bottom-0 left-0 px-2 rounded-tr-[0.75rem] bg-white opacity-90",children:s.jsx(qe,{statistics:e.statistics,className:"h-7 p-2 text-[#101828]",isGrid:!0})})]}),s.jsxs(da,{className:"p-2 flex flex-col gap-1 grow justify-between align-top flex-1",children:[s.jsx("a",{className:"text-base hover:underline cursor-pointer line-clamp-3 leading-tight",href:r+e.slug,target:"_blank",rel:"noopener noreferrer",children:ue(e.title)}),s.jsx("p",{className:"text-sm line-clamp-4 my-auto leading-tight flex-1",children:ue(e.excerpt)})]})]}),s.jsxs(pa,{className:"flex flex-row items-baseline-last justify-between p-2 ",children:[s.jsxs("div",{className:"flex flex-row gap-2 items-start justify-between text-muted-foreground",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("p",{className:"text-[10px]",children:"Categories"}),s.jsx(Ne,{categories:e.categories,maxDisplay:1})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("p",{className:"text-[10px]",children:"Tags"}),s.jsx(ye,{tags:e.tags,maxDisplay:1,badgeVariant:"outline"})]})]}),s.jsxs("div",{className:"flex gap-2 items-center justify-between text-muted-foreground",children:[s.jsx("div",{className:"flex items-center justify-center w-4.5 h-4.5 font-semi-bold rounded-full bg-secondary",children:s.jsx("p",{className:"text-[8px] text-black",children:Ee(((g=e.author)==null?void 0:g.name)||"")})}),s.jsx(Jt,{date:new Date(e.updated_at),locale:"en-US",className:"text-xs"})]})]})]})}Ke.__docgenInfo={description:"",methods:[],displayName:"WazUiRecipeCard",props:{data:{required:!0,tsType:{name:"any"},description:""},className:{required:!1,tsType:{name:"string"},description:""},postBaseURL:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},blogBaseUrl:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},onDeleteClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(data: Post) => void",signature:{arguments:[{type:{name:"signature",type:"object",raw:`{
|
|
515
|
+
id?: string;
|
|
516
|
+
uuid: string;
|
|
517
|
+
category_name?: string;
|
|
518
|
+
created_at?: string;
|
|
519
|
+
updated_at?: string;
|
|
520
|
+
excerpt: string;
|
|
521
|
+
author_uuid: string;
|
|
522
|
+
featured_image: string;
|
|
523
|
+
content: string;
|
|
524
|
+
categories: Category[];
|
|
525
|
+
tags: Tag[];
|
|
526
|
+
language_attr: string;
|
|
527
|
+
slug: string;
|
|
528
|
+
title: string;
|
|
529
|
+
metadata: string;
|
|
530
|
+
postConfig?: PostConfig;
|
|
531
|
+
status: number;
|
|
532
|
+
statistics: {
|
|
533
|
+
isLoading: boolean; shares: number; totalPageViews: number
|
|
534
|
+
};
|
|
535
|
+
author?: { uuid: string; name: string };
|
|
536
|
+
}`,signature:{properties:[{key:"id",value:{name:"string",required:!1}},{key:"uuid",value:{name:"string",required:!0}},{key:"category_name",value:{name:"string",required:!1}},{key:"created_at",value:{name:"string",required:!1}},{key:"updated_at",value:{name:"string",required:!1}},{key:"excerpt",value:{name:"string",required:!0}},{key:"author_uuid",value:{name:"string",required:!0}},{key:"featured_image",value:{name:"string",required:!0}},{key:"content",value:{name:"string",required:!0}},{key:"categories",value:{name:"Array",elements:[{name:"Category"}],raw:"Category[]",required:!0}},{key:"tags",value:{name:"Array",elements:[{name:"Tag"}],raw:"Tag[]",required:!0}},{key:"language_attr",value:{name:"string",required:!0}},{key:"slug",value:{name:"string",required:!0}},{key:"title",value:{name:"string",required:!0}},{key:"metadata",value:{name:"string",required:!0}},{key:"postConfig",value:{name:"PostConfig",required:!1}},{key:"status",value:{name:"number",required:!0}},{key:"statistics",value:{name:"signature",type:"object",raw:`{
|
|
537
|
+
isLoading: boolean; shares: number; totalPageViews: number
|
|
538
|
+
}`,signature:{properties:[{key:"isLoading",value:{name:"boolean",required:!0}},{key:"shares",value:{name:"number",required:!0}},{key:"totalPageViews",value:{name:"number",required:!0}}]},required:!0}},{key:"author",value:{name:"signature",type:"object",raw:"{ uuid: string; name: string }",signature:{properties:[{key:"uuid",value:{name:"string",required:!0}},{key:"name",value:{name:"string",required:!0}}]},required:!1}}]}},name:"data"}],return:{name:"void"}}},description:""},onEditClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(data: Post) => void",signature:{arguments:[{type:{name:"signature",type:"object",raw:`{
|
|
539
|
+
id?: string;
|
|
540
|
+
uuid: string;
|
|
541
|
+
category_name?: string;
|
|
542
|
+
created_at?: string;
|
|
543
|
+
updated_at?: string;
|
|
544
|
+
excerpt: string;
|
|
545
|
+
author_uuid: string;
|
|
546
|
+
featured_image: string;
|
|
547
|
+
content: string;
|
|
548
|
+
categories: Category[];
|
|
549
|
+
tags: Tag[];
|
|
550
|
+
language_attr: string;
|
|
551
|
+
slug: string;
|
|
552
|
+
title: string;
|
|
553
|
+
metadata: string;
|
|
554
|
+
postConfig?: PostConfig;
|
|
555
|
+
status: number;
|
|
556
|
+
statistics: {
|
|
557
|
+
isLoading: boolean; shares: number; totalPageViews: number
|
|
558
|
+
};
|
|
559
|
+
author?: { uuid: string; name: string };
|
|
560
|
+
}`,signature:{properties:[{key:"id",value:{name:"string",required:!1}},{key:"uuid",value:{name:"string",required:!0}},{key:"category_name",value:{name:"string",required:!1}},{key:"created_at",value:{name:"string",required:!1}},{key:"updated_at",value:{name:"string",required:!1}},{key:"excerpt",value:{name:"string",required:!0}},{key:"author_uuid",value:{name:"string",required:!0}},{key:"featured_image",value:{name:"string",required:!0}},{key:"content",value:{name:"string",required:!0}},{key:"categories",value:{name:"Array",elements:[{name:"Category"}],raw:"Category[]",required:!0}},{key:"tags",value:{name:"Array",elements:[{name:"Tag"}],raw:"Tag[]",required:!0}},{key:"language_attr",value:{name:"string",required:!0}},{key:"slug",value:{name:"string",required:!0}},{key:"title",value:{name:"string",required:!0}},{key:"metadata",value:{name:"string",required:!0}},{key:"postConfig",value:{name:"PostConfig",required:!1}},{key:"status",value:{name:"number",required:!0}},{key:"statistics",value:{name:"signature",type:"object",raw:`{
|
|
561
|
+
isLoading: boolean; shares: number; totalPageViews: number
|
|
562
|
+
}`,signature:{properties:[{key:"isLoading",value:{name:"boolean",required:!0}},{key:"shares",value:{name:"number",required:!0}},{key:"totalPageViews",value:{name:"number",required:!0}}]},required:!0}},{key:"author",value:{name:"signature",type:"object",raw:"{ uuid: string; name: string }",signature:{properties:[{key:"uuid",value:{name:"string",required:!0}},{key:"name",value:{name:"string",required:!0}}]},required:!1}}]}},name:"data"}],return:{name:"void"}}},description:""},isSelect:{required:!1,tsType:{name:"boolean"},description:""},selected:{required:!1,tsType:{name:"boolean"},description:""},onSelect:{required:!1,tsType:{name:"signature",type:"function",raw:"(data: Post) => void",signature:{arguments:[{type:{name:"signature",type:"object",raw:`{
|
|
563
|
+
id?: string;
|
|
564
|
+
uuid: string;
|
|
565
|
+
category_name?: string;
|
|
566
|
+
created_at?: string;
|
|
567
|
+
updated_at?: string;
|
|
568
|
+
excerpt: string;
|
|
569
|
+
author_uuid: string;
|
|
570
|
+
featured_image: string;
|
|
571
|
+
content: string;
|
|
572
|
+
categories: Category[];
|
|
573
|
+
tags: Tag[];
|
|
574
|
+
language_attr: string;
|
|
575
|
+
slug: string;
|
|
576
|
+
title: string;
|
|
577
|
+
metadata: string;
|
|
578
|
+
postConfig?: PostConfig;
|
|
579
|
+
status: number;
|
|
580
|
+
statistics: {
|
|
581
|
+
isLoading: boolean; shares: number; totalPageViews: number
|
|
582
|
+
};
|
|
583
|
+
author?: { uuid: string; name: string };
|
|
584
|
+
}`,signature:{properties:[{key:"id",value:{name:"string",required:!1}},{key:"uuid",value:{name:"string",required:!0}},{key:"category_name",value:{name:"string",required:!1}},{key:"created_at",value:{name:"string",required:!1}},{key:"updated_at",value:{name:"string",required:!1}},{key:"excerpt",value:{name:"string",required:!0}},{key:"author_uuid",value:{name:"string",required:!0}},{key:"featured_image",value:{name:"string",required:!0}},{key:"content",value:{name:"string",required:!0}},{key:"categories",value:{name:"Array",elements:[{name:"Category"}],raw:"Category[]",required:!0}},{key:"tags",value:{name:"Array",elements:[{name:"Tag"}],raw:"Tag[]",required:!0}},{key:"language_attr",value:{name:"string",required:!0}},{key:"slug",value:{name:"string",required:!0}},{key:"title",value:{name:"string",required:!0}},{key:"metadata",value:{name:"string",required:!0}},{key:"postConfig",value:{name:"PostConfig",required:!1}},{key:"status",value:{name:"number",required:!0}},{key:"statistics",value:{name:"signature",type:"object",raw:`{
|
|
585
|
+
isLoading: boolean; shares: number; totalPageViews: number
|
|
586
|
+
}`,signature:{properties:[{key:"isLoading",value:{name:"boolean",required:!0}},{key:"shares",value:{name:"number",required:!0}},{key:"totalPageViews",value:{name:"number",required:!0}}]},required:!0}},{key:"author",value:{name:"signature",type:"object",raw:"{ uuid: string; name: string }",signature:{properties:[{key:"uuid",value:{name:"string",required:!0}},{key:"name",value:{name:"string",required:!0}}]},required:!1}}]}},name:"data"}],return:{name:"void"}}},description:""}}};const oi=({postBaseUrl:e="",baseUrl:t="",site_uuid:a="",refresh_token:r,authors:i=[],mercuryToken:n="",className:o=""})=>{const l=kt({postBaseUrl:e,authors:i});return s.jsx(ae,{postType:"Recipes",postTypeSng:"Recipe",rootClassName:A("h-full flex-1",o),columns:l,baseUrl:t,defaultState:{view:"grid"},queryConfig:{fetch:{query:ke,variables:{site_uuid:a,refresh_token:r,include_drafts:!0},dataKey:"getRecipesBySiteUuid"},delete:{query:ke,variables:{site_uuid:a,refresh_token:r,include_drafts:!0},dataKey:"getRecipesBySiteUuid"},engagementConfig:{query:Fe,variables:{mercuryToken:n},dataKey:"metrics",cacheKey:"engagement"}},postBaseURL:e,filterFields:Et,gridCard:Ke,statusFilters:Nt,tableRowHeight:70,authors:i})};oi.__docgenInfo={description:"",methods:[],displayName:"RecipesComponent",props:{postBaseUrl:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},baseUrl:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},site_uuid:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},refresh_token:{required:!1,tsType:{name:"string"},description:""},authors:{required:!1,tsType:{name:"Array",elements:[{name:"signature",type:"object",raw:"{ uuid: string; name: string; [key: string]: string | null }",signature:{properties:[{key:"uuid",value:{name:"string",required:!0}},{key:"name",value:{name:"string",required:!0}},{key:{name:"string"},value:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}],required:!0}}]}}],raw:"{ uuid: string; name: string; [key: string]: string | null }[]"},description:"",defaultValue:{value:"[]",computed:!1}},className:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},mercuryToken:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}}}};function li({postBaseUrl:e}){return[{accessorKey:"source",header:"Original URL",meta:{width:"grow"},cell:({row:t})=>{const a=t.original,r=`${e}/${a==null?void 0:a.source}`;return s.jsx("div",{className:"min-h-[60px] flex items-center",children:s.jsx("a",{className:"text-sm hover:underline cursor-pointer min-w-30 flex-1 line-clamp-3 block",href:r,target:"_blank",rel:"noopener noreferrer",children:r})})}},{accessorKey:"target",header:"Redirecting To",meta:{width:"grow"},cell:({row:t})=>{const a=t.original,r=`${e}/${a==null?void 0:a.target}`;return s.jsx("a",{className:"text-sm hover:underline cursor-pointer min-w-30 flex-1 line-clamp-3 block",href:r,target:"_blank",rel:"noopener noreferrer",children:r})}},{accessorKey:"type",header:"Type",cell:({row:t})=>{const a=t.original;return s.jsx("div",{className:A("min-w-30",{"opacity-40":a.status==0}),children:s.jsx(ne,{variant:"outline",children:a.type})})}},{accessorKey:"user",header:"User",cell:({row:t})=>{var r;const a=t.original;return s.jsx("div",{className:A("min-w-50",{"opacity-40":a.status==0}),children:s.jsx("p",{className:"text-base",children:(r=a.user)==null?void 0:r.name})})}},{accessorKey:"updated_at",header:"Last Modified",cell:({row:t})=>{const a=t.original,r=new J("en-US");return s.jsx("div",{className:A("text-base min-w-30",{"opacity-40":a.status==0}),children:r.format(new Date(a.updated_at))})}}]}const ui=[{id:"source",label:"Original URL",type:q.TEXT,icon:s.jsx($e,{className:"text-[#298BFC] text-xl"})},{id:"target",label:"Redirecting To",type:q.TEXT,icon:s.jsx($e,{className:"text-primary text-xl"})},{id:"user",label:"User",type:q.TEXT,icon:s.jsx(Ye,{className:"text-[#298BFC] text-xl"})},{id:"updated_at",label:"Last Modified",type:q.DATE,icon:s.jsx(he,{className:"text-primary text-xl"})}],ci=[{value:H.ALL,label:"All Redirects"}],qt=I`
|
|
587
|
+
query getRedirects($first: Int, $page: Int) {
|
|
588
|
+
redirects(first: $first, page: $page) {
|
|
589
|
+
data {
|
|
590
|
+
id
|
|
591
|
+
site
|
|
592
|
+
target
|
|
593
|
+
source
|
|
594
|
+
type
|
|
595
|
+
site
|
|
596
|
+
updated_at
|
|
597
|
+
user {
|
|
598
|
+
name
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
paginatorInfo {
|
|
602
|
+
count
|
|
603
|
+
total
|
|
604
|
+
currentPage
|
|
605
|
+
hasMorePages
|
|
606
|
+
perPage
|
|
607
|
+
lastPage
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
`,Rt=I`
|
|
612
|
+
mutation deleteRedirect($uuid: ID!) {
|
|
613
|
+
deleteRedirect(id: $uuid) {
|
|
614
|
+
id
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
`,di=({postBaseUrl:e,site_uuid:t,baseUrl:a})=>{const r=li({postBaseUrl:e}),i=typeof window<"u"?(()=>{const g=new URLSearchParams(window.location.search).get("uuid");if(g)return g;const p=window.location.pathname.split("/"),h=p[p.length-1];return h&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(h)?h:null})():null,[n,o]=u.useState(!1),[l,c]=u.useState(null);return u.useEffect(()=>{i&&o(!0)},[i]),s.jsxs(s.Fragment,{children:[s.jsx(ae,{postType:"Redirects",postTypeSng:"Redirect",baseUrl:a,columns:r,queryConfig:{fetch:{query:qt,variables:{site:t,include_drafts:!0},dataKey:"redirects"},delete:{query:Rt,variables:{site_uuid:t,include_drafts:!0},dataKey:"redirects"}},toggleView:!1,filterFields:ui,statusFilters:ci,tableRowHeight:90,onCreateClick:()=>{c(null),o(!0)},onEditClick:m=>{c(m),o(!0)},rowClassName:"min-h-[60px]"}),s.jsx(ha,{open:n,onOpenChange:m=>o(m),blog_uuid:t,uuid:i,baseUrl:a,postBaseUrl:e,initialData:l||{}})]})};di.__docgenInfo={description:"",methods:[],displayName:"RedirectsComponent",props:{postBaseUrl:{required:!0,tsType:{name:"string"},description:""},baseUrl:{required:!0,tsType:{name:"string"},description:""},site_uuid:{required:!0,tsType:{name:"string"},description:""},refresh_token:{required:!1,tsType:{name:"string"},description:""}}};function pi({post_base_url:e}){return[{accessorKey:"source",header:"URL",meta:{width:"grow"},cell:({row:t})=>{const a=t.original,r=`${e}/${a==null?void 0:a.source}`;return s.jsx("a",{className:"text-sm hover:underline cursor-pointer line-clamp-3 block",href:r,target:"_blank",rel:"noopener noreferrer",children:r})}},{accessorKey:"user",header:"Cleared By",cell:({row:t})=>{var r;const a=t.original;return s.jsx("div",{className:A("min-w-50",{"opacity-40":a.status==0}),children:s.jsx("p",{className:"text-sm ",children:(r=a.user)==null?void 0:r.name})})}},{accessorKey:"updated_at",header:"Last Modified",cell:({row:t})=>{const a=t.original,r=new J("en-US");return s.jsx("div",{className:A("text-sm min-w-20",{"opacity-40":a.status==0}),children:r.format(new Date(a.updated_at))})}},{accessorKey:"type",header:"Status",cell:({row:t})=>{const a=t.original;return s.jsx("div",{className:A("min-w-30",{"opacity-40":a.status==0}),children:a.type=="Permanent"?s.jsx(ne,{variant:"outline",className:"border-[#229954] text-[#229954]",children:"Successful"}):s.jsx(ne,{variant:"outline",className:"border-destructive text-destructive",children:"Failed"})})}}]}const mi=[{id:"created_at",label:"Created Date",type:q.DATE,icon:s.jsx(ee,{color:"red"})},{id:"updated_at",label:"Updated Date",type:q.DATE,icon:s.jsx(ee,{color:"red"})},{id:"published_at",label:"Published Date",type:q.DATE,icon:s.jsx(ee,{color:"red"})}];H.ALL;const gi=({post_base_url:e,site_uuid:t})=>{const a=pi({post_base_url:e});return s.jsx(ae,{postType:"Cache History",postTypeSng:"Redirect",showCTA:!1,columns:a,queryConfig:{fetch:{query:qt,variables:{site:t,include_drafts:!0},dataKey:"redirects"},delete:{query:Rt,variables:{site_uuid:t,include_drafts:!0},dataKey:"redirects"}},toggleView:!1,filterFields:mi,tableRowHeight:90,rootClassName:"h-full"})};gi.__docgenInfo={description:"",methods:[],displayName:"ClearCacheHistory",props:{post_base_url:{required:!0,tsType:{name:"string"},description:""},site_uuid:{required:!0,tsType:{name:"string"},description:""}}};const fi=I`
|
|
618
|
+
query GetRecipesByCategoryUuid($category_uuid: ID!, $perPage: Int!, $page: Int!) {
|
|
619
|
+
getRecipesByCategoryUuid(
|
|
620
|
+
input: { category_uuid: $category_uuid, perPage: $perPage, page: $page }
|
|
621
|
+
) {
|
|
622
|
+
data {
|
|
623
|
+
uuid
|
|
624
|
+
title
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
`;I(`
|
|
629
|
+
query MyQuery(
|
|
630
|
+
$first: Int!
|
|
631
|
+
$blog_uuid: ID
|
|
632
|
+
$page: Int
|
|
633
|
+
$search: String
|
|
634
|
+
) {
|
|
635
|
+
getCategoriesBySiteUuid(
|
|
636
|
+
input: {
|
|
637
|
+
site_uuid: $blog_uuid
|
|
638
|
+
perPage: $first
|
|
639
|
+
page: $page
|
|
640
|
+
search: $search
|
|
641
|
+
sort: { column: "created_at", order: DESC }
|
|
642
|
+
}
|
|
643
|
+
) {
|
|
644
|
+
data {
|
|
645
|
+
uuid
|
|
646
|
+
name
|
|
647
|
+
}
|
|
648
|
+
paginatorInfo {
|
|
649
|
+
count
|
|
650
|
+
currentPage
|
|
651
|
+
firstItem
|
|
652
|
+
hasMorePages
|
|
653
|
+
lastItem
|
|
654
|
+
lastPage
|
|
655
|
+
perPage
|
|
656
|
+
total
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
`);const hi=I(`
|
|
662
|
+
query MyQuery(
|
|
663
|
+
$first: Int!
|
|
664
|
+
$blog_uuid: ID
|
|
665
|
+
$page: Int
|
|
666
|
+
$search: String
|
|
667
|
+
) {
|
|
668
|
+
getTagsBySiteUuid(
|
|
669
|
+
input: {
|
|
670
|
+
site_uuid: $blog_uuid
|
|
671
|
+
perPage: $first
|
|
672
|
+
page: $page
|
|
673
|
+
search: $search
|
|
674
|
+
sort: { column: "created_at", order: DESC }
|
|
675
|
+
}
|
|
676
|
+
) {
|
|
677
|
+
data {
|
|
678
|
+
uuid
|
|
679
|
+
name
|
|
680
|
+
}
|
|
681
|
+
paginatorInfo {
|
|
682
|
+
count
|
|
683
|
+
currentPage
|
|
684
|
+
firstItem
|
|
685
|
+
hasMorePages
|
|
686
|
+
lastItem
|
|
687
|
+
lastPage
|
|
688
|
+
perPage
|
|
689
|
+
total
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
`),yi=I(`
|
|
694
|
+
query GetRecipe( $uuid: ID!) {
|
|
695
|
+
getRecipeByUuid(uuid: $uuid) {
|
|
696
|
+
author_uuid
|
|
697
|
+
categories {
|
|
698
|
+
uuid
|
|
699
|
+
name
|
|
700
|
+
}
|
|
701
|
+
config {
|
|
702
|
+
has_related_recipes
|
|
703
|
+
is_comments_enabled
|
|
704
|
+
is_feature_recipe
|
|
705
|
+
is_in_sitemap
|
|
706
|
+
related_recipes_config
|
|
707
|
+
schema
|
|
708
|
+
social_preview_config
|
|
709
|
+
}
|
|
710
|
+
cooking_time
|
|
711
|
+
cooking_time_extra
|
|
712
|
+
cover_image
|
|
713
|
+
created_at
|
|
714
|
+
description
|
|
715
|
+
excerpt
|
|
716
|
+
id
|
|
717
|
+
ingredient_lists
|
|
718
|
+
measurement
|
|
719
|
+
method
|
|
720
|
+
permalink
|
|
721
|
+
published_at
|
|
722
|
+
serves
|
|
723
|
+
site_uuid
|
|
724
|
+
slug
|
|
725
|
+
status
|
|
726
|
+
tags {
|
|
727
|
+
uuid
|
|
728
|
+
name
|
|
729
|
+
}
|
|
730
|
+
title
|
|
731
|
+
updated_at
|
|
732
|
+
uuid
|
|
733
|
+
video_link
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
`),_i=I(`
|
|
738
|
+
mutation CreateRecipe(
|
|
739
|
+
$author_uuid: ID
|
|
740
|
+
$blog_uuid: ID!
|
|
741
|
+
$category_uuids: [ID]
|
|
742
|
+
$excerpt: String
|
|
743
|
+
$description: String
|
|
744
|
+
$cooking_time: String
|
|
745
|
+
$cooking_time_extra: String
|
|
746
|
+
$cover_image: String
|
|
747
|
+
$ingredient_lists: String
|
|
748
|
+
$measurement: String
|
|
749
|
+
$method: String
|
|
750
|
+
$serves: String
|
|
751
|
+
$slug: String!
|
|
752
|
+
$status:Boolean!
|
|
753
|
+
$tags: [String]
|
|
754
|
+
$title: String!
|
|
755
|
+
$video_link: String
|
|
756
|
+
$config: ConfigInput
|
|
757
|
+
) {
|
|
758
|
+
createRecipe(
|
|
759
|
+
createRecipeInput: {
|
|
760
|
+
site_uuid: $blog_uuid,
|
|
761
|
+
author_uuid: $author_uuid,
|
|
762
|
+
category_uuids: $category_uuids,
|
|
763
|
+
cooking_time: $cooking_time,
|
|
764
|
+
cooking_time_extra: $cooking_time_extra,
|
|
765
|
+
cover_image: $cover_image,
|
|
766
|
+
description: $description,
|
|
767
|
+
excerpt: $excerpt,
|
|
768
|
+
ingredient_lists: $ingredient_lists,
|
|
769
|
+
measurement: $measurement,
|
|
770
|
+
method: $method,
|
|
771
|
+
serves: $serves,
|
|
772
|
+
permalink: $slug,
|
|
773
|
+
slug: $slug,
|
|
774
|
+
status: $status,
|
|
775
|
+
tags: $tags,
|
|
776
|
+
title: $title,
|
|
777
|
+
video_link: $video_link,
|
|
778
|
+
config: $config
|
|
779
|
+
}
|
|
780
|
+
) {
|
|
781
|
+
slug
|
|
782
|
+
title
|
|
783
|
+
uuid
|
|
784
|
+
status
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
`),xi=I(`
|
|
788
|
+
mutation UpdateRecipe(
|
|
789
|
+
$author_uuid: ID
|
|
790
|
+
$uuid: ID!
|
|
791
|
+
$category_uuids: [ID]
|
|
792
|
+
$excerpt: String
|
|
793
|
+
$description: String
|
|
794
|
+
$cooking_time: String
|
|
795
|
+
$cooking_time_extra: String
|
|
796
|
+
$cover_image: String
|
|
797
|
+
$ingredient_lists: String
|
|
798
|
+
$measurement: String
|
|
799
|
+
$method: String
|
|
800
|
+
$serves: String
|
|
801
|
+
$slug: String
|
|
802
|
+
$status:Boolean
|
|
803
|
+
$tags: [String]
|
|
804
|
+
$title: String
|
|
805
|
+
$video_link: String
|
|
806
|
+
$config: ConfigInput
|
|
807
|
+
) {
|
|
808
|
+
updateRecipe(
|
|
809
|
+
updateRecipeInput: {
|
|
810
|
+
uuid: $uuid,
|
|
811
|
+
author_uuid: $author_uuid,
|
|
812
|
+
category_uuids: $category_uuids,
|
|
813
|
+
cooking_time: $cooking_time,
|
|
814
|
+
cooking_time_extra: $cooking_time_extra,
|
|
815
|
+
cover_image: $cover_image,
|
|
816
|
+
description: $description,
|
|
817
|
+
excerpt: $excerpt,
|
|
818
|
+
ingredient_lists: $ingredient_lists,
|
|
819
|
+
measurement: $measurement,
|
|
820
|
+
method: $method,
|
|
821
|
+
serves: $serves,
|
|
822
|
+
slug: $slug,
|
|
823
|
+
permalink: $slug,
|
|
824
|
+
status: $status,
|
|
825
|
+
tags: $tags,
|
|
826
|
+
title: $title,
|
|
827
|
+
video_link: $video_link,
|
|
828
|
+
config: $config
|
|
829
|
+
}
|
|
830
|
+
) {
|
|
831
|
+
slug
|
|
832
|
+
title
|
|
833
|
+
uuid
|
|
834
|
+
status
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
`);I`
|
|
838
|
+
query GqlGetAllUsers($first: Int!, $page: Int) {
|
|
839
|
+
users(first: $first, page: $page) {
|
|
840
|
+
data {
|
|
841
|
+
uuid
|
|
842
|
+
name
|
|
843
|
+
}
|
|
844
|
+
paginatorInfo {
|
|
845
|
+
count
|
|
846
|
+
currentPage
|
|
847
|
+
firstItem
|
|
848
|
+
hasMorePages
|
|
849
|
+
lastItem
|
|
850
|
+
lastPage
|
|
851
|
+
perPage
|
|
852
|
+
total
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
`;const bi=[{uuid:"43073642-4d62-451c-a24b-fd33d1e8e215",name:"Dinner Recipes",slug:"/dinner-recipes",description:null,created_at:"2023-11-27T15:46:33.071Z",updated_at:"2023-11-27T15:46:33.071Z",post_count:0,subCategories:[]},{uuid:"3eb8db7f-cdfe-47a1-b54a-480c376a8d54",name:"Dessert",slug:"/dessert",description:null,created_at:"2023-11-27T15:46:31.405Z",updated_at:"2023-11-27T15:46:31.405Z",post_count:0,subCategories:[]},{uuid:"f201b1d9-1892-46b0-b8af-dc3668d58139",name:"Snacks",slug:"/snacks",description:null,created_at:"2023-11-27T15:46:31.454Z",updated_at:"2023-11-27T15:46:31.454Z",post_count:0,subCategories:[]},{uuid:"c7fb27bf-c222-4eac-b48a-9c87c13cf564",name:"Vegetarian",slug:"/vegetarian",description:null,created_at:"2023-11-27T15:46:35.952Z",updated_at:"2023-11-27T15:46:35.952Z",post_count:0,subCategories:[]},{uuid:"d5a1dcc1-7928-4ad9-909a-a727fa5dad9f",name:"Twisted Green",slug:"/twisted-green",description:null,created_at:"2024-11-25T18:56:22.660Z",updated_at:"2024-11-25T20:31:31.022Z",post_count:0,subCategories:[]},{uuid:"49c5e97c-041a-4032-9c03-b8493fdcd96d",name:"Cocktails",slug:"/cocktails",description:null,created_at:"2023-11-27T15:46:34.526Z",updated_at:"2023-11-27T15:46:34.526Z",post_count:0,subCategories:[]},{uuid:"0c0cff8d-d270-4ef6-8387-1dc7f2b18f58",name:"Pasta",slug:"/pasta",description:null,created_at:"2023-11-27T15:46:33.107Z",updated_at:"2023-11-27T15:46:33.107Z",post_count:0,subCategories:[]},{uuid:"24360b30-f18d-46d1-bb3c-bd64c7e14f44",name:"Chicken",slug:"/chicken",description:null,created_at:"2023-11-27T15:46:37.431Z",updated_at:"2023-11-27T15:46:37.431Z",post_count:0,subCategories:[]},{uuid:"6d020281-7f0a-4009-b4b7-f02b69555a31",name:"Breakfast",slug:"/breakfast",description:null,created_at:"2023-11-27T15:46:31.485Z",updated_at:"2023-11-27T15:46:31.485Z",post_count:0,subCategories:[]},{uuid:"0ac8a51a-dd04-4455-bd68-da18fc32449b",name:"Sandwiches",slug:"/sandwiches",description:null,created_at:"2023-11-27T15:46:40.035Z",updated_at:"2023-11-27T15:46:40.035Z",post_count:0,subCategories:[]},{uuid:"2d498c66-3fc0-4adf-a7c0-04f4cfdae238",name:"Spicy",slug:"/spicy",description:null,created_at:"2023-11-27T15:46:56.021Z",updated_at:"2023-11-27T15:46:56.021Z",post_count:0,subCategories:[]}],vi=()=>{const e=Gt();return u.useCallback(async(a,r,i)=>{var n,o;try{if(!r||r.length===0)return;const l=r[0],p=(((o=(n=(await e.query({query:fi,variables:{category_uuid:l,perPage:4,page:1},fetchPolicy:"network-only"})).data)==null?void 0:n.getRecipesByCategoryUuid)==null?void 0:o.data)||[]).filter(h=>h.uuid!==a).slice(0,3).map(h=>({uuid:h.uuid,value:h.uuid,title:h.title,label:h.title}));p.length>0?i.setValue("related_recipes",p):i.setValue("related_recipes",[])}catch(l){console.error("Error fetching auto-related recipes:",l),i.setValue("related_recipes",[])}},[e])},wi=({site_uuid:e,authors:t,recipe_base_url:a})=>({columns:kt({postBaseUrl:a,authors:t}),queryConfig:{fetch:{query:ke,variables:{site_uuid:e,refreshToken:!1},dataKey:"getRecipesBySiteUuid",cacheKey:"getRecipesBySiteUuid"}},defaultState:{view:"grid"},isSelect:!0,filterFields:Et,gridCard:Ke,statusFilters:Nt,postType:"Related Recipes",authors:t,apolloUri:je.VITE_RECIPES_ENDPOINT}),Ci=({blog_uuid:e,authors:t,recipe_base_url:a,image_library_uuid:r,images_url:i,isAutoRelatedEnabled:n=!1})=>{const o=Lt(r,i);o.apolloUri=je.VITE_DOLOS_URL;const l=wi({site_uuid:e,authors:t,recipe_base_url:a}),c=[{name:"cover_image",label:"Cover Image",type:"image",apolloUri:i,imageGalleryConfig:{...o,cropperAspectRatio:"3:2"}},{name:"slug",label:"Permalink",type:"link",linkProps:{className:"underline",prefix:a+"/"}},{name:"author",label:"Author",type:"select",selectProps:{options:t.map(h=>({label:h.name,value:h.uuid})),dataKey:"users-authors",placeholder:"Select Author",searchPlaceholder:"Search Author"}},{name:"auto_related_recipes",label:"Auto-add related recipes",type:"switch",containerClassname:"mt-4",description:"Automatically add 3 recipes from the same category when publishing",labelProps:{className:"text-[#101828]"}}],m={name:"related_recipes",label:"Add Related Recipe",type:"blogposts",blogPostsConfig:n?{...l,isSelect:!1,columns:[]}:l,containerClassname:n?"opacity-50 pointer-events-none":""},g=u.useMemo(()=>[{id:"details",title:"Details",icon:s.jsx(et,{}),sections:[{id:"cover_image",formItems:[...c,m]}]},{id:"seo",title:"SEO",icon:s.jsx(st,{}),sections:[{id:"none",title:"Metadata",description:"Inherited from Article Detail",formItems:[{name:"seo:image",label:"Post Cover Image",type:"image",linkedField:"cover_image",apolloUri:i,imageGalleryConfig:{...o,cropperAspectRatio:"16:9"}},{name:"seo:title",label:"SEO Title",linkedField:"title",type:"textarea",maxLetterCount:70,textareaProps:{placeholder:"Type here"}},{name:"seo:url",label:"SEO URL",type:"link",linkProps:{className:"underline",prefix:a+"/"},linkedField:"slug"},{name:"seo:description",label:"Description",type:"textarea",maxLetterCount:160,linkedField:"description",textareaProps:{placeholder:"Type here"}}]}]},{id:"categories",title:"Taxonomy",icon:s.jsx(lt,{}),sections:[{id:"categories",title:"Taxonomy",description:"Organize your article using tags and categories",formItems:[{name:"categories",label:"Categories",type:"optionslist",selectProps:{options:bi.map(h=>({label:h.name,value:h.uuid,other:h.slug})),dataKey:"recipe-categories",multiple:!0,placeholder:"Type or select Categories",searchPlaceholder:"Type or select Categories"}},{name:"tags",label:"Tags",type:"optionslist",selectProps:{queryConfig:{query:hi,variables:{blog_uuid:e,refreshToken:!1},dataKey:"getTagsBySiteUuid"},optionsMapper:h=>({label:h.name,value:h.uuid}),multiple:!0,createNewOption:!0,placeholder:"Type or select Tags",searchPlaceholder:"Type or select Tags"}}]}]},{id:"socials",title:"Socials",icon:s.jsx(ot,{}),description:"Used by social networks to display text and an image when this post is shared",sections:[{id:"facebook",icon:s.jsx(it,{}),title:"Facebook Preview",description:"Inherited from Article Detail",formItems:[{name:"og:image",label:"Facebook Cover Image",type:"image",linkedField:"cover_image",apolloUri:i,imageGalleryConfig:{...o,cropperAspectRatio:"16:9"}},{name:"og:title",label:"Post Title",type:"textarea",linkedField:"title",textareaProps:{placeholder:"Type here"}},{name:"og:description",label:"Description",type:"textarea",linkedField:"description",textareaProps:{placeholder:"Type here"}}]},{id:"twitter",icon:s.jsx(tt,{}),title:"Twitter Preview",description:"Inherited from Article Detail",formItems:[{name:"twitter:image",label:"Twitter Cover Image",type:"image",apolloUri:i,linkedField:"cover_image",imageGalleryConfig:{...o,cropperAspectRatio:"16:9"}},{name:"twitter:title",label:"Post Title",type:"textarea",linkedField:"title",textareaProps:{placeholder:"Type here"}},{name:"twitter:description",label:"Description",type:"textarea",linkedField:"description",textareaProps:{placeholder:"Type here"}}]}]},{id:"sharing",title:"Sharing",icon:s.jsx(at,{}),sections:[{id:"configuration",title:"Configuration",className:"gap-0 pt-0",formItems:[{name:"is_dark_post",type:"switch",label:"Dark Article",containerClassname:"mt-4",className:"border-b-0 rounded-none",labelProps:{className:"text-[#101828]"}},{name:"is_feature_article",label:"Featured Article",type:"switch",className:"border-b-0 rounded-none",labelProps:{className:"text-[#101828]"}},{name:"meta_remove_from_snap_rss",label:"Remove Snapchat RSS Feed",type:"switch",className:"border-b-0 rounded-none",labelProps:{className:"text-[#101828]"}}]}]}],[l,e,o,i,a,n]),p=u.useMemo(()=>{const h={query:ct,apoloUri:"https://devapi.junglecreations.com/graphql",dataKey:"getTwitterEmbed"};return{id:"main",sections:[{id:"description",title:"Descripion",className:"p-0 flex-1",icon:s.jsx(Vt,{className:"w-7 h-7"}),formItems:[{name:"excerpt",label:"Excerpt",type:"textarea",textareaProps:{rows:3}},{name:"description",label:"Full Description",type:"wysiwyg",containerClassname:"h-70",wysiwygProps:{imageGalleryConfig:o,blogPostsConfig:l,twitterEmbedConfig:h}}]},{id:"video",title:"Video Link",className:"p-0 flex-1",icon:s.jsx(ea,{className:"w-7 h-7"}),formItems:[{name:"video_link",label:"Video URL",type:"input",inputProps:{placeholder:"Enter the URL of the recipe video"}},{name:"video_link",type:"video",label:"Generated Video",containerClassname:"flex-1"}]},{id:"ingredient_lists",title:"Ingredients",dynamicType:"Ingredient",className:"p-0 flex-1",icon:s.jsx(ta,{className:"w-7 h-7"}),isDynamic:!0,minItems:1,template:{list_heading:"",ingredients:[]},formItems:[{name:"list_heading",label:"List Heading",type:"input",className:"rounded overflow-hidden",inputProps:{placeholder:"List heading here"}},{name:"ingredients",label:"Ingredients",type:"inputgroup",className:"rounded overflow-hidden",inputGroupProps:{type:"ingredient",isMultiple:!0,className:"rounded overflow-hidden ",freeTextUnits:!0,unitsPlaceholder:"Enter unit (e.g. g, tbsp, cup)",units:[{label:"Gram(g)",value:"g"},{label:"Tablespoon(tbsp)",value:"tbsp"},{label:"Teaspoon(tsp)",value:"tsp"},{label:"Milliliter(ml)",value:"ml"},{label:"Slices",value:"slices"},{label:"Can",value:"can"},{label:"Kilogram(kg)",value:"kg"},{label:"Gal(gal)",value:"gal"},{label:"Fliud Ounce(Fl Oz)",value:"fl Oz"}]}}]},{id:"methods",icon:s.jsx(zt,{className:"w-7 h-7"}),title:"Methods",isDynamic:!0,dynamicType:"steps",minItems:1,template:{instruction:""},formItems:[{name:"instruction",label:"Instruction",type:"textarea",textareaProps:{placeholder:"Enter Detailed Step Information",rows:4}}]},{id:"prep",icon:s.jsx(Ht,{className:"w-7 h-9"}),title:"Prep Information",className:"flex-row flex-wrap items-end justify-start max-h-fit border p-4 gap-x-4 text-primary-foreground",formItems:[{name:"cooking_time",label:"Cook Time",type:"inputgroup",containerClassname:"h-fit w-20 flex-1",description:"Set Timing",descriptionClassName:"text-current",inputGroupProps:{type:"Cook Time",placeholder:"Enter the time it takes to cook the meal",units:[{label:"Minute(s)",value:"Minute(s)"},{label:"Hour(s)",value:"Hour(s)"},{label:"Second(s)",value:"Second(s)"},{label:"Custom",value:"Custom"}],showValue:!1,isMultiple:!1}},{name:"cooking_time_extra",label:"Prep Time",type:"inputgroup",containerClassname:"h-fit w-20 flex-1",inputGroupProps:{type:"Prep Time",placeholder:"Enter the time it takes to prep ingredients",units:[{label:"Minute(s)",value:"Minute(s)"},{label:"Hour(s)",value:"Hour(s)"},{label:"Second(s)",value:"Second(s)"},{label:"Custom",value:"Custom"}],showValue:!1,isMultiple:!1}},{name:"serves",label:"Specify the exact number of people",type:"optionslist",containerClassname:"mt-4",description:"Set Serving size",className:"mt-2",selectProps:{options:[{label:"1",value:"1"},{label:"2",value:"2"},{label:"3",value:"3"},{label:"4-6",value:"4-6"},{label:"6-8",value:"6-8"},{label:"8-10",value:"8-10"}],multiple:!1,createNewOption:!0,placeholder:"Type or select serving size",searchPlaceholder:"Type or select serving size"}}]}]}},[l,o]);return{groups:g,mainForm:p}};class le{static fromRecord(t){const a={};return t.title&&typeof t.title=="string"&&(a.title=t.title.trim()),t.description&&typeof t.description=="string"&&(a.description=t.description.trim()),t.open_graph&&typeof t.open_graph=="object"&&(a.open_graph=this.extractOpenGraphData(t.open_graph)),t.twitter_cards&&typeof t.twitter_cards=="object"&&(a.twitter_cards=this.extractTwitterCardsData(t.twitter_cards)),t.seo_cards&&typeof t.seo_cards=="object"&&(a.seo_cards=this.extractSEOCardsData(t.seo_cards)),a}static extractOpenGraphData(t){const a={},r=["og:title","og:image","og:description"];for(const i of r)t[i]&&typeof t[i]=="string"&&(a[i]=t[i].trim());return a}static extractTwitterCardsData(t){const a={},r=["twitter:title","twitter:description","twitter:image"];for(const i of r)t[i]&&typeof t[i]=="string"&&(a[i]=t[i].trim());return a}static extractSEOCardsData(t){const a={},r=["seo:title","seo:description","seo:image","seo:url"];for(const i of r)t[i]&&typeof t[i]=="string"&&(a[i]=t[i].trim());return a}static toRecord(t){return JSON.parse(JSON.stringify(t))}}const Ti=({recipe_uuid:e,recipe_base_url:t,base_url:a,blog_uuid:r,images_url:i,image_library_uuid:n,authors:o=[],user_config:l,className:c=""})=>{t=t.includes("/recipes")?t.replace("/recipes",""):t;const[m,g]=u.useState(!1),[p,h]=u.useState(!1),x=vi(),v=o==null?void 0:o.find(f=>(f==null?void 0:f.uuid)==(l==null?void 0:l.uuid)),w=f=>{var D;const P={},R={},K={},{articleSlug:L}=Qe(f.slug);try{P.cover_image=JSON.parse(f.cover_image||"{}"),P.cover_image.url=P.cover_image.src;const{quantity:b,unit:N}=f.cooking_time?ve(f.cooking_time):{quantity:"",unit:"Custom"},{quantity:E,unit:F}=f.cooking_time_extra?ve(f.cooking_time_extra):{quantity:"",unit:"Custom"};P.cooking_time=[{id:"cooking_time",value:"",quantity:b,unit:N}],P.cooking_time_extra=[{id:"cooking_time_extra",value:"",quantity:E,unit:F}],P.serves=f.serves?[{label:f.serves,value:f.serves}]:[]}catch(b){console.log(b),typeof f.cover_image=="string"&&(P.cover_image=f.cover_image)}try{JSON.parse(f.ingredient_lists||"[]").forEach((N,E)=>{R[`ingredient_lists_${E}_list_heading`]=N.list_heading,R[`ingredient_lists_${E}_ingredients`]=N.list.map((F,V)=>{const{quantity:S="1",unit:j=""}=ve(F.amount);return{value:F.ingredient,quantity:S,unit:j,id:Date.now()+`${V}`}})})}catch(b){console.log(b)}try{const b=new Document,N=b.createElement("div");N.innerHTML=f.method,b.appendChild(N);const E=N.getElementsByTagName("li");for(let F=0;F<E.length;F++)K[`methods_${F}_instruction`]=(D=E[F])==null?void 0:D.innerHTML}catch(b){console.log(b)}const d=o==null?void 0:o.find(b=>(b==null?void 0:b.uuid)==f.author_uuid),y={};if(f.config)if(f.config.related_recipes_config)try{const b=f.config.related_recipes_config;if(typeof b=="string"){const N=JSON.parse(b);Array.isArray(N)&&N.length>0&&N[0]==="AUTO"?(y.auto_related_recipes=!0,y.related_recipes=f._relatedRecipesData||[],h(!0)):(y.auto_related_recipes=!1,y.related_recipes=f._relatedRecipesData||[],h(!1))}else y.auto_related_recipes=!1,y.related_recipes=f._relatedRecipesData||[],h(!1)}catch(b){console.log("Error parsing related_recipes_config:",b),y.auto_related_recipes=!1,y.related_recipes=[],h(!1)}else y.auto_related_recipes=!1,y.related_recipes=[],h(!1);else y.auto_related_recipes=!1,y.related_recipes=[],h(!1);return f.slug&&g(!0),{...f,title:ue(f.title),author:{label:d==null?void 0:d.name,value:d==null?void 0:d.uuid},slug:L,categories:f.categories.map(b=>({value:b.uuid,label:b.name})),tags:f.tags.map(b=>({value:b.uuid,label:b.name})),...P,...R,...K,...y}},C=f=>{var b,N,E,F,V;const P=(b=f.cooking_time)==null?void 0:b[0],R=(N=f.cooking_time_extra)==null?void 0:N[0],K=["list_heading","ingredients"],L=[],d=[];Object.entries(f).forEach(([S,j])=>{K.map(z=>{if(S.includes(z)){const U=Ut(S);let $=j;if(U.group_id&&U.fieldname){U.fieldname=="ingredients"&&(j=j||[],$=j.map(ie=>({ingredient:ie.value,amount:`${ie.quantity} ${ie.unit}`})),U.fieldname="list");const Q=U.index;L[Q]?L[Q][U.fieldname]=$:L.push({[U.fieldname]:$})}}}),S.includes("instruction")&&d.push(j)});const y=new Document,D=y.createElement("ol");return d.forEach(S=>{console.log(S);const j=y.createElement("li");j.innerHTML=S,D.appendChild(j)}),y.appendChild(D),{...f,permalink:`/${f.slug}`,author_uuid:(E=f==null?void 0:f.author)==null?void 0:E.value,blog_uuid:r,category_uuids:(F=f==null?void 0:f.categories)==null?void 0:F.map(S=>S.value),tags:(V=f==null?void 0:f.tags)==null?void 0:V.map(S=>S.label),slug:`/${f.slug}`,content:f.content,excerpt:f.excerpt,cover_image:JSON.stringify(f.cover_image),status:f.status,title:f.title,uuid:f.uuid,ingredient_lists:JSON.stringify(L),method:D.outerHTML,cooking_time:(P==null?void 0:P.unit)==="Custom"?`${P.quantity||""} // ${P.unit}`:!(P!=null&&P.quantity)||P.quantity.trim()===""?null:`${P.quantity} // ${P.unit||""}`,cooking_time_extra:(R==null?void 0:R.unit)==="Custom"?`${R.quantity||""} // ${R.unit}`:!(R!=null&&R.quantity)||R.quantity.trim()===""?null:`${R.quantity} // ${R.unit||""}`,serves:(()=>{var S;return Array.isArray(f.serves)&&f.serves.length>0&&((S=f.serves[0])!=null&&S.value)?String(f.serves[0].value):String(f.serves||"")})(),config:(()=>{let S="{}";try{const j=le.toRecord(le.fromRecord({title:f.title,description:f.description||f.excerpt,open_graph:{"og:title":f["og:title"]||f.title,"og:image":JSON.stringify(f["og:image"]||f.cover_image),"og:description":f["og:description"]||f.excerpt},twitter_cards:{"twitter:title":f["twitter:title"]||f.title,"twitter:image":JSON.stringify(f["twitter:image"]||f.cover_image),"twitter:description":f["twitter:description"]||f.excerpt},seo_cards:{"seo:url":f["seo:url"]||f.slug,"seo:title":f["seo:title"]||f.title,"seo:image":JSON.stringify(f["seo:image"]||f.cover_image),"seo:description":f["seo:description"]||f.excerpt}}));S=JSON.stringify(j)}catch(j){console.log(j)}return{is_in_sitemap:f.is_in_sitemap,social_preview_config:S,has_related_recipes:!!f.auto_related_recipes||Array.isArray(f.related_recipes)&&f.related_recipes.length>0,related_recipes_config:(()=>{if(Array.isArray(f.related_recipes)&&f.related_recipes.length>0){const j=!!f.auto_related_recipes,z=f.related_recipes.map($=>$.uuid||String($.value)),U=j?["AUTO",...z]:z;return JSON.stringify(U)}return null})()}})()}},T=u.useCallback((f,P,R)=>{var d,y,D;if(!R)return;if(P==="auto_related_recipes"){const b=!!R[P];if(h(b),b){f.setValue("related_recipes",[]);const N=f.getValues(),E=N.uuid,F=((d=N.categories)==null?void 0:d.map(V=>V.value))||[];F.length>0&&x(E,F,f)}else f.setValue("related_recipes",[])}const K=(y=R.title||"")==null?void 0:y.toString().trim().toLowerCase().replaceAll(" ","-"),L=`${Xe(K)}`.toLowerCase();["title","categories","tags"].includes(P)&&!m&&f.setValue("slug",L),P=="slug"&&((D=R.slug)==null?void 0:D.toString())!=L&&g(!0)},[m,x]),{groups:_,mainForm:k}=Ci({blog_uuid:r,image_library_uuid:n,images_url:i,recipe_base_url:`${t}/recipes`,authors:o,isAutoRelatedEnabled:p}),O=/^[a-zA-Z0-9\-_~#[\]()]+$/,G=M.object({title:M.string({message:""}).min(2,"Title should be min of 2 characters"),excerpt:M.string({message:""}).min(2,"Min 2"),description:M.string({message:""}).min(2,"Min 2"),author:M.object({value:M.string({message:""}).min(1,"value is required")},{message:""}),slug:M.string({message:""}).min(1,"This field is required").regex(O,"Invalid slug format. Use letters, numbers, hyphens only")});return s.jsx(Ze,{post_uuid:e,groups:_,mainForm:k,className:c,type:"Recipe",initialState:{formValues:{author:{value:v==null?void 0:v.uuid,label:v==null?void 0:v.name}}},validators:G,postQueryConfig:{fetch:{query:yi,variables:{blog_uuid:r},dataKey:"getRecipeByUuid",cacheKey:"getRecipeByUuid"},update:{query:xi,dataKey:"updateRecipe",mutationInvalidateKey:"getRecipesBySiteUuid"},create:{query:_i,dataKey:"createRecipe",mutationInvalidateKey:"getRecipesBySiteUuid"}},submitFieldsMapper:C,formFieldsMapper:w,postBaseUrl:t,baseUrl:a,onChange:T,autoSave:!0,user_config:l})};Ti.__docgenInfo={description:"",methods:[],displayName:"RecipeContentComponent",props:{recipe_uuid:{required:!0,tsType:{name:"string"},description:""},blog_uuid:{required:!0,tsType:{name:"string"},description:""},image_library_uuid:{required:!0,tsType:{name:"string"},description:""},recipe_base_url:{required:!0,tsType:{name:"string"},description:""},base_url:{required:!0,tsType:{name:"string"},description:""},images_url:{required:!0,tsType:{name:"string"},description:""},authors:{required:!1,tsType:{name:"Array",elements:[{name:"signature",type:"object",raw:"{ uuid: string; name: string; [key: string]: string | null }",signature:{properties:[{key:"uuid",value:{name:"string",required:!0}},{key:"name",value:{name:"string",required:!0}},{key:{name:"string"},value:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}],required:!0}}]}}],raw:"{ uuid: string; name: string; [key: string]: string | null }[]"},description:"",defaultValue:{value:"[]",computed:!1}},className:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},user_config:{required:!1,tsType:{name:"signature",type:"object",raw:`{
|
|
857
|
+
uuid: string;
|
|
858
|
+
name: string;
|
|
859
|
+
email: string;
|
|
860
|
+
}`,signature:{properties:[{key:"uuid",value:{name:"string",required:!0}},{key:"name",value:{name:"string",required:!0}},{key:"email",value:{name:"string",required:!0}}]}},description:""}}};const $i=[{accessorKey:"name",header:"Name",meta:{width:"grow"},cell:({row:e})=>{const t=e.original;return s.jsx("div",{className:"p-2 rounded-full text-sm w-fit bg-[#EEF4FF] text-[#3538CD] ",children:t.name})}},{accessorKey:"description",header:"Description",meta:{width:"grow"},cell:({row:e})=>{const t=e.original;return s.jsx("span",{className:"capitalize text-sm text-[#596970]",children:t.description||"no description"})}},{accessorKey:"post_count",header:"Number of Posts",meta:{width:"grow"},cell:({row:e})=>{const t=e.original;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Re,{className:"h-4 w-4"}),t.post_count]})}},{accessorKey:"updated_at",header:"Last Modified",meta:{width:"grow"},cell:({row:e})=>{const t=e.original,a=new J("en-US");return s.jsx("span",{className:"",children:a.format(new Date(t.updated_at))})}}],Si=[{value:H.ALL,label:"All Categories"}],Pi=[],ki=I(`
|
|
861
|
+
query MyQuery(
|
|
862
|
+
$first: Int!
|
|
863
|
+
$blog_uuid: ID
|
|
864
|
+
$page: Int
|
|
865
|
+
$search: String
|
|
866
|
+
) {
|
|
867
|
+
getTagsBySiteUuid(
|
|
868
|
+
input: {
|
|
869
|
+
site_uuid: $blog_uuid
|
|
870
|
+
perPage: $first
|
|
871
|
+
page: $page
|
|
872
|
+
search: $search
|
|
873
|
+
sort: { column: "created_at", order: DESC }
|
|
874
|
+
}
|
|
875
|
+
) {
|
|
876
|
+
data {
|
|
877
|
+
created_at
|
|
878
|
+
updated_at
|
|
879
|
+
id
|
|
880
|
+
name
|
|
881
|
+
uuid
|
|
882
|
+
}
|
|
883
|
+
paginatorInfo {
|
|
884
|
+
count
|
|
885
|
+
currentPage
|
|
886
|
+
firstItem
|
|
887
|
+
hasMorePages
|
|
888
|
+
lastItem
|
|
889
|
+
lastPage
|
|
890
|
+
perPage
|
|
891
|
+
total
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
`),Ei=I(`
|
|
897
|
+
mutation RemoveTag(
|
|
898
|
+
$uuid: ID!
|
|
899
|
+
) {
|
|
900
|
+
removeTag(
|
|
901
|
+
uuid: $uuid
|
|
902
|
+
) {
|
|
903
|
+
uuid
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
`),Ni=({baseUrl:e,blog_uuid:t,className:a})=>{const r=typeof window<"u"?(()=>{const m=new URLSearchParams(window.location.search).get("uuid");if(m)return m;const g=window.location.pathname.split("/"),p=g[g.length-1];return p&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(p)?p:null})():null,[i,n]=u.useState(null),[o,l]=u.useState(!1);return u.useEffect(()=>{r&&l(!0)},[r]),s.jsxs(s.Fragment,{children:[s.jsx(ae,{baseUrl:e,columns:$i,rootClassName:A("flex-1",a),queryConfig:{fetch:{query:ki,variables:{site_uuid:t},dataKey:"getTagsBySiteUuid"},delete:{query:Ei,variables:{site_uuid:t},dataKey:"removeTag"}},toggleView:!1,filterFields:Pi,statusFilters:Si,postType:"Tags",postTypeSng:"Tag",rowClassName:"h-[60px]",tableRowHeight:60,onCreateClick:()=>{n(null),l(!0)},onEditClick:c=>{n(c),l(!0)}}),s.jsx(ya,{open:o,onOpenChange:c=>l(c),blog_uuid:t,uuid:r||(i==null?void 0:i.uuid),baseUrl:e,initialData:i||{}})]})};Ni.__docgenInfo={description:"",methods:[],displayName:"RecipeTags",props:{blog_uuid:{required:!0,tsType:{name:"string"},description:""},baseUrl:{required:!0,tsType:{name:"string"},description:""},className:{required:!1,tsType:{name:"string"},description:""}}};const qi=[{accessorKey:"name",header:"Name",meta:{width:"grow"},cell:({row:e})=>{const t=e.original;return s.jsx("div",{className:"min-w-50 flex flex-col justify-center",children:s.jsx("div",{className:"p-2 rounded-full text-sm w-fit bg-[#EEF4FF] text-[#3538CD] ",children:t.name})})}},{accessorKey:"description",header:"Description",meta:{width:"grow"},cell:({row:e})=>{const t=e.original;return s.jsx("span",{className:"capitalize text-sm text-[#596970]",children:t.description||"no description"})}},{accessorKey:"post_count",header:"Number of Posts",meta:{width:"grow"},cell:({row:e})=>{const t=e.original;return s.jsxs("div",{className:"flex items-center grow gap-2 min-w-50",children:[s.jsx(Re,{className:"h-4 w-4"}),t.post_count]})}},{accessorKey:"updated_at",header:"Last Modified",meta:{width:"grow"},cell:({row:e})=>{const t=e.original,a=new J("en-US");return s.jsx("span",{className:"",children:a.format(new Date(t.updated_at))})}}],Ri=[{value:H.ALL,label:"All Categories"}],Ii=[],ji=I(`
|
|
907
|
+
query MyQuery(
|
|
908
|
+
$first: Int!
|
|
909
|
+
$blog_uuid: ID
|
|
910
|
+
$page: Int
|
|
911
|
+
$search: String
|
|
912
|
+
) {
|
|
913
|
+
getCategoriesBySiteUuid(
|
|
914
|
+
input: {
|
|
915
|
+
site_uuid: $blog_uuid
|
|
916
|
+
perPage: $first
|
|
917
|
+
page: $page
|
|
918
|
+
search: $search
|
|
919
|
+
sort: { column: "created_at", order: DESC }
|
|
920
|
+
}
|
|
921
|
+
) {
|
|
922
|
+
data {
|
|
923
|
+
uuid
|
|
924
|
+
name
|
|
925
|
+
slug
|
|
926
|
+
updated_at
|
|
927
|
+
description
|
|
928
|
+
}
|
|
929
|
+
paginatorInfo {
|
|
930
|
+
count
|
|
931
|
+
currentPage
|
|
932
|
+
firstItem
|
|
933
|
+
hasMorePages
|
|
934
|
+
lastItem
|
|
935
|
+
lastPage
|
|
936
|
+
perPage
|
|
937
|
+
total
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
`),Fi=I(`
|
|
943
|
+
mutation DeleteCategory(
|
|
944
|
+
$uuid: ID!
|
|
945
|
+
) {
|
|
946
|
+
deleteCategory(
|
|
947
|
+
uuid: $uuid
|
|
948
|
+
) {
|
|
949
|
+
uuid
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
`),Di=({blog_uuid:e,baseUrl:t,className:a})=>{const r=typeof window<"u"?(()=>{const m=new URLSearchParams(window.location.search).get("uuid");if(m)return m;const g=window.location.pathname.split("/"),p=g[g.length-1];return p&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(p)?p:null})():null,[i,n]=u.useState(!1),[o,l]=u.useState(null);return s.jsxs(s.Fragment,{children:[s.jsx(ae,{baseUrl:t,columns:qi,rootClassName:A("flex-1",a),queryConfig:{fetch:{query:ji,variables:{blog_uuid:e},dataKey:"getCategoriesBySiteUuid"},delete:{query:Fi,variables:{blog_uuid:e},dataKey:"getCategoriesBySiteUuid"}},toggleView:!1,filterFields:Ii,statusFilters:Ri,postType:"Categories",postTypeSng:"Category",rowClassName:"h-[60px]",tableRowHeight:60,onCreateClick:()=>{l(null),n(!0)},onEditClick:c=>{l(c),n(!0)}}),s.jsx(sa,{open:i,onOpenChange:c=>n(c),blog_uuid:e,uuid:r,baseUrl:t,initialData:o||{}})]})};Di.__docgenInfo={description:"",methods:[],displayName:"RecipeCategories",props:{blog_uuid:{required:!0,tsType:{name:"string"},description:""},baseUrl:{required:!0,tsType:{name:"string"},description:""},className:{required:!1,tsType:{name:"string"},description:""}}};J.addDefaultLocale(Bt);J.addLocale(Ot);function Li({post:e}){return s.jsx("div",{className:"min-w-10 md:min-w-20",children:s.jsx(qe,{statistics:e.statistics,className:"p-0 text-base",isGrid:!1})})}function It({postBaseUrl:e,authors:t}){return[{accessorKey:"post",header:"Post",meta:{width:"grow"},cell:({row:a})=>{const r=a.original,i=JSON.parse(r.featured_image),n=t==null?void 0:t.find(o=>(o==null?void 0:o.uuid)==r.author_uuid);return s.jsxs("div",{className:"flex flex-row items-center justify-between flex-1 w-full h-16 gap-4 min-w-110 pr-15 ",children:[s.jsx(Ie,{url:i==null?void 0:i.src,transformations:{width:80,height:64},classname:"w-[5rem] h-full rounded-sm overflow-hidden"}),s.jsxs("div",{className:A(" relative flex flex-col justify-between w-0 gap-y-1 flex-1 h-full ",{"pr-15":!r.status}),children:[s.jsx("a",{className:"cursor-pointer hover:underline group-hover:underline line-clamp-2",href:e+r.slug,target:"_blank",rel:"noopener noreferrer",children:ue(r.title)}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center justify-center w-[20px] h-[20px] rounded-full bg-secondary",children:s.jsx("p",{className:"text-[7.43px] text-black uppercase",children:Ee(n==null?void 0:n.name)})}),s.jsx("p",{className:"text-xs capitalize text-muted-foreground",children:n==null?void 0:n.name})]}),s.jsx(ne,{variant:"outline",className:A("text-xs absolute top-0 right-0 bg-muted text-muted-foreground",{hidden:r.status}),children:"Draft"})]})]})}},{accessorKey:"categories",header:"Categories",cell:({row:a})=>{const r=a.original;return s.jsx("div",{className:"min-w-10 md:min-w-20",children:s.jsx(Ne,{categories:r.categories})})}},{accessorKey:"tags",header:"Tags",cell:({row:a})=>{const r=a.original;return s.jsx("div",{className:"min-w-10 md:min-w-20",children:s.jsx(ye,{tags:r.tags})})}},{accessorKey:"statistics",header:"Statistics",cell:({row:a})=>{const r=a.original;return s.jsx(Li,{post:r})}},{accessorKey:"updated_at",header:"Last Modified",cell:({row:a})=>{const r=a.original,i=new J("en-US");return s.jsx("div",{className:"min-w-10 md:min-w-20",children:i.format(new Date(r.updated_at||""))})}}]}function jt({authors:e,blog_uuid:t}){return[{id:"title",label:"Title",type:q.TEXT,icon:s.jsx(ra,{className:"text-xl text-primary"}),selectProps:{placeholder:"Enter multiple titles"},operators:["contains","notContains"]},{id:"slug",label:"Slug",type:q.TEXT,icon:s.jsx($e,{className:"text-[#298BFC] text-xl"}),selectProps:{placeholder:"Enter multiple slugs"},operators:["contains","notContains"]},{id:"author_uuid",label:"Author",type:q.SELECT,icon:s.jsx(Ye,{className:"text-xl text-primary"}),selectProps:{options:(e||[]).map(a=>({label:a.name,value:a.uuid})),createNewOption:!1,placeholder:"Type to search authors"}},{id:"category_name",label:"Category",type:q.SELECT,icon:s.jsx(Wt,{className:"text-[#6941C6] text-xl"}),selectProps:{queryConfig:{query:$a,variables:{blog_uuid:t},dataKey:"categories",cacheKey:"article-categories"},optionsMapper:a=>({label:a.name,value:a.uuid}),createNewOption:!1,placeholder:"Type to search categories"},optionFilterField:"label"},{id:"tag_name",label:"Tags",type:q.SELECT,icon:s.jsx(aa,{className:"text-[#C01574] text-xl"}),selectProps:{queryConfig:{query:ut,variables:{blog_uuid:t},dataKey:"tags",cacheKey:"article-tags"},optionsMapper:a=>({label:a.name,value:a.uuid}),createNewOption:!1,placeholder:"Type to search tags"},optionFilterField:"label"},{id:"status",label:"Status",type:q.SELECT,icon:s.jsx(Mt,{className:"text-[#298BFC] text-xl"}),selectProps:{options:[{value:0,label:"Draft"},{value:1,label:"Published"}],createNewOption:!1},operators:["eq","neq"]},{id:"updated_at",label:"Last Modified",type:q.DATE,icon:s.jsx(he,{className:"text-xl text-primary"})}]}const Ft=[{value:H.ALL,label:"All Blogs"},{value:H.PUBLISHED,label:"Published"},{value:H.DRAFT,label:"In Draft"}],Dt=({data:e,className:t,onDeleteClick:a,postBaseURL:r,blogBaseUrl:i,isSelect:n,selected:o,onSelect:l,onEditClick:c})=>{const m={...e,excerpt:e.excerpt||"",featured_image:e.featured_image||"{}",content:e.content||"",categories:e.categories||[],tags:e.tags||[],status:e.status||0,title:e.title||"",author_uuid:e.author_uuid||"",language_attr:e.language_attr||"",metadata:e.metadata||"{}",statistics:e.statistics||{isLoading:!1,shares:0,totalPageViews:0}};return s.jsx(rt,{data:m,className:t,onDeleteClick:a,postBaseURL:r,blogBaseUrl:i,isSelect:n,selected:o,onSelect:l,onEditClick:c})};Dt.__docgenInfo={description:"",methods:[],displayName:"PostCardAdapter",props:{data:{required:!0,tsType:{name:"TData"},description:""},className:{required:!1,tsType:{name:"string"},description:""},postBaseURL:{required:!1,tsType:{name:"string"},description:""},blogBaseUrl:{required:!1,tsType:{name:"string"},description:""},onDeleteClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(data: TData) => void",signature:{arguments:[{type:{name:"TData"},name:"data"}],return:{name:"void"}}},description:""},onEditClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(data: TData) => void",signature:{arguments:[{type:{name:"TData"},name:"data"}],return:{name:"void"}}},description:""},isSelect:{required:!1,tsType:{name:"boolean"},description:""},selected:{required:!1,tsType:{name:"boolean"},description:""},onSelect:{required:!1,tsType:{name:"signature",type:"function",raw:"(data?: TData) => void",signature:{arguments:[{type:{name:"TData"},name:"data"}],return:{name:"void"}}},description:""}}};const Ai=[{uuid:"7ab9f015-f683-4f86-83de-9a5d1dd68332",name:"Lifestyle",slug:"/lifestyle",description:null,created_at:"2024-02-15 11:12:22",updated_at:"2024-02-15 11:12:22",post_count:7598,subCategories:[{uuid:"e4ecec05-bdbb-441b-9a62-c38b1f41e579",name:"Relationships",slug:"/lifestyle/relationships",description:null,post_count:1698,created_at:"2024-02-15 11:04:38",updated_at:"2024-03-25 23:09:20"},{uuid:"39fba685-44bb-4e88-aea4-fc1e7288dc6e",name:"Travel",slug:"/lifestyle/travel",description:null,post_count:315,created_at:"2024-02-15 11:12:26",updated_at:"2024-03-25 23:09:20"},{uuid:"1dc8fea6-06b7-4d8d-a3ae-bd649e7d04e5",name:"Health",slug:"/lifestyle/health",description:null,post_count:1576,created_at:"2024-02-15 11:53:21",updated_at:"2024-03-25 23:09:20"},{uuid:"d5a97814-d3ec-4e1a-b1c0-a35bbfe7bdae",name:"LGBTQ",slug:"/lifestyle/lgbtq",description:null,post_count:266,created_at:"2024-02-15 11:53:58",updated_at:"2024-03-25 23:09:20"}]},{uuid:"35907a08-194a-40bd-9163-2b44c570aec8",name:"News",slug:"/news",description:null,created_at:"2024-02-15 11:53:57",updated_at:"2024-02-15 11:53:57",post_count:14516,subCategories:[{uuid:"5d569642-139e-4710-988b-876aa061345a",name:"US",slug:"/news/us",description:null,post_count:7137,created_at:"2024-02-15 11:05:33",updated_at:"2024-03-25 23:11:39"},{uuid:"0296d330-4f84-47fd-a22f-bf29e738e696",name:"UK",slug:"/news/uk",description:null,post_count:1566,created_at:"2024-02-15 11:12:17",updated_at:"2024-03-25 23:11:39"},{uuid:"321b70ba-8cbc-4f7b-9578-c03c9f39f050",name:"Weird",slug:"/news/weird",description:null,post_count:962,created_at:"2024-02-15 11:53:48",updated_at:"2024-03-25 23:11:39"},{uuid:"c55927cd-926f-4389-bc0f-ced587a7cc92",name:"World",slug:"/news/world",description:null,post_count:2576,created_at:"2024-02-15 11:54:39",updated_at:"2024-03-25 23:11:39"},{uuid:"12724c52-bd77-4cea-9fa0-3aa70a00118d",name:"Entertainment News",slug:"/news/entertainment-news",description:null,post_count:2003,created_at:"2024-02-15 12:37:01",updated_at:"2024-03-25 23:11:39"}]},{uuid:"f3774bc3-b08d-41ed-8e82-1a64aeef3d1e",name:"Entertainment",slug:"/entertainment",description:null,created_at:"2024-02-15 11:54:38",updated_at:"2024-02-15 11:54:38",post_count:18771,subCategories:[{uuid:"bc1a5f06-7ba0-4a6c-8e25-04fe21f59432",name:"Music",slug:"/entertainment/music",description:null,post_count:496,created_at:"2024-02-15 11:06:17",updated_at:"2024-03-25 23:02:43"},{uuid:"48035bf3-fa3f-47f9-8537-939fb71cffe9",name:"Sport",slug:"/entertainment/sport",description:null,post_count:946,created_at:"2024-02-15 11:12:19",updated_at:"2024-03-25 23:02:43"},{uuid:"b8e3d048-0bf9-454d-8f25-2254e4091d38",name:"Celebrity",slug:"/entertainment/celebrity",description:null,post_count:13804,created_at:"2024-02-15 11:53:20",updated_at:"2024-03-25 23:02:43"},{uuid:"905f826a-6f09-4628-ba38-80ed1ab861b4",name:"Film & TV",slug:"/entertainment/film-tv",description:null,post_count:3125,created_at:"2024-02-15 11:53:26",updated_at:"2024-03-25 23:02:43"}]},{uuid:"5233c506-d80b-4671-a397-bfbfc160f62b",name:"Science & Tech",slug:"/sci-tech",description:null,created_at:"2024-02-15 11:57:54",updated_at:"2024-02-15 11:57:54",post_count:508,subCategories:[{uuid:"a98a42e5-de9f-461d-b888-1657e89cec74",name:"Innovation",slug:"/sci-tech/innovation",description:null,post_count:119,created_at:"2024-02-15 11:55:32",updated_at:"2024-03-25 23:19:06"},{uuid:"049539b7-1b78-44e5-b157-632ace910af5",name:"Space",slug:"/sci-tech/space",description:null,post_count:187,created_at:"2024-02-15 11:56:07",updated_at:"2024-03-25 23:19:06"},{uuid:"dd435c46-9b8f-4e5c-b0b5-0554d2a9c330",name:"Design",slug:"/sci-tech/design",description:null,post_count:91,created_at:"2024-02-15 11:56:56",updated_at:"2024-03-25 23:19:06"}]},{uuid:"fbca86ab-ffa8-4136-a04f-9b9aa92a8822",name:"Animals",slug:"/animals",description:null,created_at:"2024-02-15 12:21:21",updated_at:"2024-02-15 12:21:21",post_count:1222,subCategories:[{uuid:"86543163-04ca-49b3-9890-0bfb7f9a17ef",name:"Stories",slug:"/animals/stories",description:null,post_count:782,created_at:"2024-02-15 11:54:29",updated_at:"2024-03-25 22:58:52"},{uuid:"e2f4942d-16a2-4b80-8331-31a725e8d86f",name:"Uplifting",slug:"/animals/uplifting",description:null,post_count:184,created_at:"2024-02-15 12:19:56",updated_at:"2024-03-25 22:58:52"},{uuid:"c8b7f419-54da-4f44-ab9b-fadc853d697b",name:"Funny",slug:"/animals/funny",description:null,post_count:163,created_at:"2024-02-15 12:22:39",updated_at:"2024-03-25 22:58:52"}]}],Ui=({blog_uuid:e,authors:t,post_base_url:a,athensKeys:r={appId:"",appSecret:"",serviceId:""},mercuryToken:i})=>{const n=It({postBaseUrl:a,authors:t}),o=jt({authors:t,blog_uuid:e});return{columns:n,queryConfig:{fetch:{query:dt,variables:{blog_uuid:e,refreshToken:!1},dataKey:"posts",cacheKey:"posts"},engagementConfig:{query:Fe,variables:{appId:r.appId,appSecret:r.appSecret,mercuryToken:i,serviceId:r.serviceId},dataKey:"metrics",cacheKey:"engagement"}},postBaseURL:a,defaultState:{view:"grid"},filterFields:o,gridCard:Dt,statusFilters:Ft,postType:"Related Posts",authors:t,apolloUri:je.VITE_MUSE_ENDPOINT}},Lt=(e,t)=>({apolloUri:t,query:{query:wa,dataKey:"getImagesByLibraryUuid",variables:{library_uuid:e,count:20}},unsplash:{query:va,variables:{},dataKey:"getUnsplashImages"},pexels:{query:ba,variables:{},dataKey:"getPexelsImages"},upload:{query:xa,dataKey:"getImagesByLibraryUuid",variables:{}},remove:{query:_a,dataKey:"getImagesByLibraryUuid",mutationInvalidateKey:"getImagesByLibraryUuid"}}),Mi=({blog_uuid:e,post_base_url:t,image_library_uuid:a,images_url:r,authors:i=[],mercuryToken:n="",category_slug:o="",category_id:l="",setCategoryId:c,setCategorySlug:m})=>{const g=Lt(a,r),p=Ui({blog_uuid:e,authors:i,post_base_url:t,mercuryToken:n}),h=o?`${o.startsWith("/")?o:"/"+o}`:"",x=u.useMemo(()=>[{id:"details",title:"Details",icon:s.jsx(et,{}),sections:[{id:"featured_image",formItems:[{name:"featured_image",label:"Featured Image",type:"image",apolloUri:r,imageGalleryConfig:{...g,cropperAspectRatio:"16:9"}},{name:"slug",label:"Permalink",type:"link",linkProps:{className:"underline lowercase",prefix:`${t}${h.replace(/\/$/,"")}/`}},{name:"author",label:"Author",type:"select",selectProps:{options:i.map(w=>({label:w.name,value:w.uuid})),dataKey:"users-authors",placeholder:"Select Author",searchPlaceholder:"Search Author"}},{name:"excerpt",label:"Excerpt",type:"textarea",maxLetterCount:160,textareaProps:{placeholder:"Type here"}},{name:"related_posts",label:"Add Related Posts",type:"blogposts",blogPostsConfig:p}]}]},{id:"seo",title:"SEO",icon:s.jsx(st,{}),sections:[{id:"none",title:"Metadata",description:"Inherited from Article Detail",formItems:[{name:"seo:image",label:"Post Cover Image",type:"image",linkedField:"featured_image",apolloUri:r,imageGalleryConfig:{...g,cropperAspectRatio:"16:9"}},{name:"seo:title",label:"SEO Title",linkedField:"title",maxLetterCount:75,type:"textarea",textareaProps:{placeholder:"Type here"}},{name:"seo:description",label:"Description",type:"textarea",maxLetterCount:160,linkedField:"excerpt",textareaProps:{placeholder:"Type here"}}]}]},{id:"taxonomy",title:"Taxonomy",icon:s.jsx(lt,{}),sections:[{id:"taxonomy",title:"Taxonomy",description:"Organize your article using tags and categories",formItems:[{name:"category",label:"Category",type:"select",selectProps:{options:Ai.map(w=>{var C,T;return{label:w.name,value:w.uuid,other:w.slug,subs:(T=(C=w.subCategories)==null?void 0:C.map)==null?void 0:T.call(C,_=>({label:_.name,value:_.uuid,other:_.slug}))}}),dataKey:"vt-categories",placeholder:"Type to search categories",searchPlaceholder:"Search Categories"}},{name:"category",label:"",type:"custom",contentRender:w=>{var T;const C=w;if((T=C==null?void 0:C.subs)!=null&&T.length)return s.jsxs(ma,{defaultValue:l,className:"flex flex-col flex-wrap gap-2 my-5",children:["Select a sub category (optional)",s.jsx("div",{className:"flex flex-wrap gap-2",children:C.subs.map(_=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ga,{value:_.value.toString(),id:_.value.toString(),checked:_.value==l,onClick:()=>{const k=_.value==l?C:_;c(k.value),m(k.other)}}),s.jsx(fa,{htmlFor:_.value.toString(),children:_.label})]}))})]})}},{name:"tags",label:"Tags",type:"optionslist",selectProps:{queryConfig:{query:ut,variables:{blog_uuid:e,refreshToken:!1},dataKey:"tags",cacheKey:"article-tags"},optionsMapper:w=>({label:w.name,value:w.uuid}),multiple:!0,placeholder:"Type or select Tags",searchPlaceholder:"Type or select Tags",createNewOption:!0}}]}]},{id:"socials",title:"Socials",icon:s.jsx(ot,{}),sections:[{id:"facebook",icon:s.jsx(it,{}),title:"Facebook Preview",description:"Inherited from Article Detail",formItems:[{name:"og:image",label:"Facebook Cover Image",type:"image",linkedField:"featured_image",apolloUri:r,imageGalleryConfig:{...g,cropperAspectRatio:"16:9"}},{name:"og:title",label:"Post Title",type:"textarea",linkedField:"title",maxLetterCount:75,textareaProps:{placeholder:"Type here"}},{name:"og:description",label:"Description",type:"textarea",linkedField:"excerpt",maxLetterCount:160,textareaProps:{placeholder:"Type here"}}]},{id:"twitter",icon:s.jsx(tt,{}),title:"Twitter Preview",description:"Inherited from Article Detail",formItems:[{name:"twitter:image",label:"Twitter Cover Image",type:"image",apolloUri:r,linkedField:"featured_image",imageGalleryConfig:{...g,cropperAspectRatio:"16:9"}},{name:"twitter:title",label:"Post Title",type:"textarea",linkedField:"title",maxLetterCount:75,textareaProps:{placeholder:"Type here"}},{name:"twitter:description",label:"Description",type:"textarea",linkedField:"excerpt",maxLetterCount:160,textareaProps:{placeholder:"Type here"}}]}]},{id:"sharing",title:"Sharing",icon:s.jsx(at,{}),sections:[{id:"configuration",title:"Configuration",className:"gap-0 pt-0",formItems:[{name:"is_dark_post",type:"switch",label:"Dark Article",containerClassname:"mt-4",className:"border-b-0 rounded-none",labelProps:{className:"text-[#101828]"}},{name:"is_feature_article",label:"Featured Article",type:"switch",className:"border-b-0 rounded-none",labelProps:{className:"text-[#101828]"}},{name:"meta_remove_from_snap_rss",label:"Remove Snapchat RSS Feed",type:"switch",className:"border-b-0 rounded-none",labelProps:{className:"text-[#101828]"}}]}]}],[r,g,t,i,p,e,l,c,m,h]),v=u.useMemo(()=>({id:"main",sections:[{id:"main",className:"p-0 flex-1",formItems:[{name:"content",label:"Body",type:"wysiwyg",containerClassname:"flex-1 ",className:"h-sm",apolloUri:r,wysiwygProps:{imageGalleryConfig:g,blogPostsConfig:p,twitterEmbedConfig:{query:ct,apoloUri:"https://devapi.junglecreations.com/graphql",dataKey:"getTwitterEmbed"}}}]}]}),[p,g,r]);return{groups:x,mainForm:v}},Bi=({post_uuid:e,post_base_url:t,base_url:a,blog_uuid:r,images_url:i,image_library_uuid:n,authors:o=[],user_config:l,mercuryToken:c="",className:m=""})=>{const[g,p]=u.useState(!1),[h,x]=u.useState(!1),v=o==null?void 0:o.find(d=>(d==null?void 0:d.uuid)==(l==null?void 0:l.uuid)),[w,C]=u.useState(""),[T,_]=u.useState(""),k=(d,y)=>{if(!/^\/[a-z0-9-]+(?:\/[a-z0-9-]+)+\/[a-z0-9-]+$/i.test(d))return!1;const N=(y.startsWith("/")?y:`/${y}`).replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${N}/`,"i").test(d)},O=d=>{var j,z,U;let y={},D={};const b=o==null?void 0:o.find($=>($==null?void 0:$.uuid)==d.author_uuid),N={},E={},{categorySlug:F,articleSlug:V}=Qe(d.slug);C(F||""),_((j=d.category)==null?void 0:j.uuid);try{const $=JSON.parse((d==null?void 0:d.metadata)||"{}");y=$.utmGenerator,E.meta_remove_from_snap_rss=($==null?void 0:$.remove_from_snap_rss)||!1,E.meta_websiteUrl=y==null?void 0:y.websiteUrl,E.meta_campaignSource=y==null?void 0:y.campaignSource,E.meta_campaignMedium=y==null?void 0:y.campaignMedium,E.meta_campaignName=y==null?void 0:y.campaignName,E.meta_campaignId=y==null?void 0:y.campaignId,E.meta_campaignContent=y==null?void 0:y.campaignContent}catch($){console.log($)}try{D=JSON.parse((d==null?void 0:d.featured_image)||"{}")}catch($){console.log($)}try{const $=d.postConfig,Q=le.fromRecord(JSON.parse(($==null?void 0:$.social_preview_config)||"{}"));N.is_feature_article=$.is_feature_article,[Q.open_graph,Q.twitter_cards,Q.seo_cards].forEach(ie=>{ie&&Object.entries(ie).map(([Ge,Ve])=>{try{N[Ge]=JSON.parse(Ve)}catch(At){console.log(At),N[Ge]=Ve}})})}catch($){console.log($)}d.slug&&p(!0),d.excerpt&&x(!0);const S=(z=d.category)!=null&&z.parent?(U=d.category)==null?void 0:U.parent:d.category;return{...d,author:{label:b==null?void 0:b.name,value:b==null?void 0:b.uuid},slug:V,featured_image:D,category:{value:S==null?void 0:S.uuid,label:S==null?void 0:S.name,other:S==null?void 0:S.slug,subs:((S==null?void 0:S.subCategories)||[]).map($=>({value:$.uuid,label:$.name,other:$.slug}))},tags:d==null?void 0:d.tags.map($=>({value:$.uuid,label:$.name})),...E,...N}},G=d=>{var V,S,j,z,U;let y,D="{}";const b=d.related_posts||[],N=[];b!=null&&b.length&&b.forEach(($,Q)=>$.uuid&&N.push({uuid:$.uuid,position:Q}));try{y=le.toRecord(le.fromRecord({title:d.title,description:d.description,open_graph:{"og:title":d["og:title"]||d.title,"og:image":JSON.stringify(d["og:image"]||d.featured_image),"og:description":d["og:description"]||d.excerpt},twitter_cards:{"twitter:title":d["twitter:title"]||d.title,"twitter:image":JSON.stringify(d["twitter:image"]||d.featured_image),"twitter:description":d["twitter:description"]||d.excerpt},seo_cards:{"seo:url":d["seo:url"]||d.slug,"seo:title":d["seo:title"]||d.title,"seo:image":JSON.stringify(d["seo:image"]||d.featured_image),"seo:description":d["seo:description"]||d.excerpt}})),D=JSON.stringify(y)}catch($){console.log($)}let E=`${w.startsWith("/")?w:"/"+w}`,F=`${E}/${d.slug}`.toLowerCase();if(d.status==!0&&(k(F,E)||(E=`${(((V=d.category)==null?void 0:V.other)||"").startsWith("/")?(S=d.category)==null?void 0:S.other:"/"+((j=d.category)==null?void 0:j.other)}`,F=`${E}/${d.slug}`),!k(F,E)))throw new Error("Invalid article permalink select category to prefill category section on the permalink");return{author_uuid:(z=d==null?void 0:d.author)==null?void 0:z.value,blog_uuid:r,category_uuids:T?[T]:[],tags:(U=d==null?void 0:d.tags)==null?void 0:U.map($=>$.label),content:d.content,excerpt:d.excerpt,featured_image:JSON.stringify(d.featured_image),metadata:JSON.stringify({remove_from_snap_rss:d==null?void 0:d.meta_remove_from_snap_rss,utmGenerator:{websiteUrl:d==null?void 0:d.meta_websiteUrl,campaignSource:d==null?void 0:d.meta_campaignSource,campaignMedium:d==null?void 0:d.meta_campaignMedium,campaignName:d==null?void 0:d.meta_campaignName,campaignId:d==null?void 0:d.meta_campaignId,campaignContent:d==null?void 0:d.meta_campaignContent}}),published_at:"",status:d.status,title:d.title,uuid:d.uuid,slug:`${w.startsWith("/")?w:"/"+w}/${d.slug}`.toLowerCase(),is_featured_article:d.is_feature_article,related_posts:N,social_preview_config:D}},{groups:f,mainForm:P}=Mi({blog_uuid:r,image_library_uuid:n,images_url:i,post_base_url:t,authors:o,category_slug:w,category_id:T,setCategoryId:_,setCategorySlug:C,mercuryToken:c}),R=/^[a-zA-Z0-9\-_~#[\]()]+$/,K=M.object({title:M.string({message:""}).min(2,"Title should be min of 2 characters"),excerpt:M.string({message:""}).min(2,"Min 2"),content:M.string({message:""}).min(1,"this field is required"),slug:M.string({message:""}).min(1,"This field is required").regex(R,"Invalid slug format. Use letters, numbers, hyphens only"),featured_image:M.object({url:M.string({message:"Featured image URL is required"}).min(1,"Featured image URL is required")},{message:"Featured image is required"}),category:M.object({value:M.string({message:"Category is required"}).min(1,"Category is required")},{message:"Category is required"}),author:M.object({value:M.string({message:"Author is required"}).min(1,"Author is required")},{message:"Author is required"})}),L=u.useCallback((d,y,D)=>{var S,j,z,U;if(!D)return;const b=D.category,N=D.title||"",E=(S=D.content||"")==null?void 0:S.toString(),F=`${Xe(N,{strictMode:!0})}`.toLowerCase(),V=Kt(E,{maxLength:160}).trim();["title","categories","tags"].includes(y)&&!g&&d.setValue("slug",F),y=="category"&&(C((j=(b==null?void 0:b.other)||(b==null?void 0:b.label)||"")==null?void 0:j.toString().toLowerCase().replaceAll(" ","-")),_(b.value)),y=="content"&&!h&&d.setValue("excerpt",V),y=="excerpt"&&((z=D.excerpt)==null?void 0:z.toString())!=V&&x(!0),y=="slug"&&((U=D.slug)==null?void 0:U.toString())!=F&&p(!0)},[g,h]);return s.jsx(Ze,{post_uuid:e,className:m,groups:f,mainForm:P,type:"Article",initialState:{formValues:{author:{value:v==null?void 0:v.uuid,label:v==null?void 0:v.name}}},validators:K,requiredDraftFields:["title","author"],postQueryConfig:{fetch:{query:Sa,variables:{blog_uuid:r},dataKey:"post",cacheKey:"post"},update:{query:ka,dataKey:"updatePost",mutationInvalidateKey:"posts"},create:{query:Pa,dataKey:"createPost",mutationInvalidateKey:"posts"}},submitFieldsMapper:G,formFieldsMapper:O,postBaseUrl:t,baseUrl:a,onChange:L,autoSave:!0,user_config:l})};Bi.__docgenInfo={description:"",methods:[],displayName:"BlogPostContentComponent",props:{post_uuid:{required:!0,tsType:{name:"string"},description:""},blog_uuid:{required:!0,tsType:{name:"string"},description:""},image_library_uuid:{required:!0,tsType:{name:"string"},description:""},post_base_url:{required:!0,tsType:{name:"string"},description:""},base_url:{required:!0,tsType:{name:"string"},description:""},images_url:{required:!0,tsType:{name:"string"},description:""},authors:{required:!1,tsType:{name:"Array",elements:[{name:"signature",type:"object",raw:"{ uuid: string; name: string; [key: string]: string | null }",signature:{properties:[{key:"uuid",value:{name:"string",required:!0}},{key:"name",value:{name:"string",required:!0}},{key:{name:"string"},value:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}],required:!0}}]}}],raw:"{ uuid: string; name: string; [key: string]: string | null }[]"},description:"",defaultValue:{value:"[]",computed:!1}},user_config:{required:!1,tsType:{name:"signature",type:"object",raw:`{
|
|
953
|
+
uuid: string;
|
|
954
|
+
name: string;
|
|
955
|
+
email: string;
|
|
956
|
+
}`,signature:{properties:[{key:"uuid",value:{name:"string",required:!0}},{key:"name",value:{name:"string",required:!0}},{key:"email",value:{name:"string",required:!0}}]}},description:""},className:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},mercuryToken:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}}}};export{Bi as B,Fa as C,Di as R,si as T,qa as a,gi as b,Ti as c,Ni as d,oi as e,di as f};
|