@yext/visual-editor 1.4.10 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SectionLibraryVisualEditorProvider-67ng4X9e.js +108670 -0
- package/dist/SectionLibraryVisualEditorProvider.css +1 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/Address.tsx +251 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/HeadingText.tsx +147 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/HoursStatus.tsx +157 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/HoursTable.tsx +164 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/MapboxStaticMap.tsx +205 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/Phone.tsx +155 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/image/EmptyImageState.tsx +168 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/image/Image.tsx +275 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/image/styling.ts +66 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/index.ts +13 -0
- package/dist/cli/assets/directory-locator-source/components/sections/Breadcrumbs.tsx +298 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/Directory.test.tsx +872 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/Directory.tsx +260 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/DirectoryCard.tsx +507 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/DirectoryWrapper.tsx +491 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/directoryChildReference.test.tsx +226 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/directoryChildReference.tsx +98 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Filters.test.tsx +147 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Filters.tsx +691 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Locator.test.tsx +1551 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Locator.tsx +541 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorFields.test.ts +43 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorResultCard.tsx +1594 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorWrapper.tsx +1157 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Map.tsx +304 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/MapPinIcon.tsx +160 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Results.tsx +267 -0
- package/dist/cli/assets/directory-locator-source/sectionLibrarySupport.ts +245 -0
- package/dist/cli/yextve.js +16888 -0
- package/dist/index.d.ts +556 -6260
- package/dist/locales/page/cs/visual-editor.json +85 -0
- package/dist/locales/page/da/visual-editor.json +73 -0
- package/dist/locales/page/de/visual-editor.json +73 -0
- package/dist/locales/page/en/visual-editor.json +73 -0
- package/dist/locales/page/en-GB/visual-editor.json +73 -0
- package/dist/locales/page/es/visual-editor.json +79 -0
- package/dist/locales/page/et/visual-editor.json +73 -0
- package/dist/locales/page/fi/visual-editor.json +73 -0
- package/dist/locales/page/fr/visual-editor.json +79 -0
- package/dist/locales/page/hr/visual-editor.json +79 -0
- package/dist/locales/page/hu/visual-editor.json +73 -0
- package/dist/locales/page/it/visual-editor.json +79 -0
- package/dist/locales/page/ja/visual-editor.json +73 -0
- package/dist/locales/page/lt/visual-editor.json +85 -0
- package/dist/locales/page/lv/visual-editor.json +77 -0
- package/dist/locales/page/nb/visual-editor.json +73 -0
- package/dist/locales/page/nl/visual-editor.json +73 -0
- package/dist/locales/page/pl/visual-editor.json +85 -0
- package/dist/locales/page/pt/visual-editor.json +79 -0
- package/dist/locales/page/ro/visual-editor.json +79 -0
- package/dist/locales/page/sk/visual-editor.json +85 -0
- package/dist/locales/page/sv/visual-editor.json +73 -0
- package/dist/locales/page/tr/visual-editor.json +73 -0
- package/dist/locales/page/zh/visual-editor.json +73 -0
- package/dist/locales/page/zh-TW/visual-editor.json +73 -0
- package/dist/locales/platform/cs/visual-editor.json +531 -0
- package/dist/locales/platform/da/visual-editor.json +519 -0
- package/dist/locales/platform/de/visual-editor.json +519 -0
- package/dist/locales/platform/en/visual-editor.json +519 -0
- package/dist/locales/platform/en-GB/visual-editor.json +519 -0
- package/dist/locales/platform/es/visual-editor.json +525 -0
- package/dist/locales/platform/et/visual-editor.json +519 -0
- package/dist/locales/platform/fi/visual-editor.json +519 -0
- package/dist/locales/platform/fr/visual-editor.json +525 -0
- package/dist/locales/platform/hr/visual-editor.json +525 -0
- package/dist/locales/platform/hu/visual-editor.json +519 -0
- package/dist/locales/platform/it/visual-editor.json +525 -0
- package/dist/locales/platform/ja/visual-editor.json +519 -0
- package/dist/locales/platform/lt/visual-editor.json +531 -0
- package/dist/locales/platform/lv/visual-editor.json +523 -0
- package/dist/locales/platform/nb/visual-editor.json +519 -0
- package/dist/locales/platform/nl/visual-editor.json +519 -0
- package/dist/locales/platform/pl/visual-editor.json +531 -0
- package/dist/locales/platform/pt/visual-editor.json +525 -0
- package/dist/locales/platform/ro/visual-editor.json +525 -0
- package/dist/locales/platform/sk/visual-editor.json +531 -0
- package/dist/locales/platform/sv/visual-editor.json +519 -0
- package/dist/locales/platform/tr/visual-editor.json +519 -0
- package/dist/locales/platform/zh/visual-editor.json +519 -0
- package/dist/locales/platform/zh-TW/visual-editor.json +519 -0
- package/dist/locatorEntityTypes-s4dmT9l5.d.ts +1850 -0
- package/dist/plugin/internal/sectionLibraryValidation/builtInTranslationResources.d.ts +3 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/api/api.d.ts +7 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/api/libraryMetadata.d.ts +7 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/code/importRules.d.ts +13 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/code/validateCode.d.ts +10 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/code/xssRules.d.ts +7 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/structure/structure.d.ts +7 -0
- package/dist/plugin/internal/sectionLibraryValidation/types.d.ts +48 -0
- package/dist/plugin/internal/sectionLibraryValidation/validateSectionLibrary.d.ts +8 -0
- package/dist/plugin/internal/sectionLibraryValidation/validationError.d.ts +6 -0
- package/dist/plugin/plugin.js +2233 -5786
- package/dist/plugin/types/entityFields.d.ts +21 -0
- package/dist/plugin/types/images.d.ts +62 -0
- package/dist/plugin/types/sectionLibrary.d.ts +94 -0
- package/dist/plugin/types/types.d.ts +204 -0
- package/dist/plugin/types/videos.d.ts +24 -0
- package/dist/plugin/utils/i18n/locales.d.ts +5 -0
- package/dist/plugin/utils/i18n/translationResources.d.ts +41 -0
- package/dist/plugin/utils/normalizeLocale.d.ts +8 -0
- package/dist/plugin/utils/plainText.d.ts +6 -0
- package/dist/plugin/vite-plugin/index.d.ts +2 -0
- package/dist/plugin/vite-plugin/local-editor/artifacts.d.ts +18 -0
- package/dist/plugin/vite-plugin/local-editor/config.d.ts +11 -0
- package/dist/plugin/vite-plugin/local-editor/data.d.ts +10 -0
- package/dist/plugin/vite-plugin/local-editor/entityFields.d.ts +13 -0
- package/dist/plugin/vite-plugin/local-editor/fixtureData.d.ts +12 -0
- package/dist/plugin/vite-plugin/local-editor/generatedFiles.d.ts +34 -0
- package/dist/plugin/vite-plugin/local-editor/server.d.ts +18 -0
- package/dist/plugin/vite-plugin/local-editor/types.d.ts +109 -0
- package/dist/plugin/vite-plugin/local-editor/utils.d.ts +16 -0
- package/dist/plugin/vite-plugin/plugin.d.ts +8 -0
- package/dist/plugin/vite-plugin/section-library/migrationRegistry.d.ts +6 -0
- package/dist/plugin/vite-plugin/section-library/sectionFrontmatter.d.ts +3 -0
- package/dist/plugin/vite-plugin/section-library/sectionLibraryGenerator.d.ts +21 -0
- package/dist/plugin/vite-plugin/section-library/sharedComponentRegistry.d.ts +16 -0
- package/dist/section-library-support.js +158 -0
- package/dist/sectionLibrarySupport.d.ts +282 -0
- package/dist/style.css +1 -1
- package/dist/visual-editor-9bLkRo2X.js +702 -0
- package/dist/visual-editor-B5f3AZF6.js +706 -0
- package/dist/visual-editor-BGZbJkMp.js +694 -0
- package/dist/visual-editor-BPVqHHz5.js +706 -0
- package/dist/visual-editor-BPvDMSb8.js +706 -0
- package/dist/visual-editor-BTT9n9b6.js +718 -0
- package/dist/visual-editor-BXSlgf31.js +694 -0
- package/dist/visual-editor-BXYlpe7B.js +145 -0
- package/dist/visual-editor-Bez9GftS.js +694 -0
- package/dist/visual-editor-Bk5QJccl.js +718 -0
- package/dist/visual-editor-BqtG2m0y.js +694 -0
- package/dist/visual-editor-Bxy81Ezy.js +145 -0
- package/dist/visual-editor-C00efXqJ.js +706 -0
- package/dist/visual-editor-C0vq2BRM.js +145 -0
- package/dist/visual-editor-CCgmYV5S.js +169 -0
- package/dist/visual-editor-CERViyTJ.js +145 -0
- package/dist/visual-editor-CZdmgAn0.js +706 -0
- package/dist/visual-editor-CcOCcCUQ.js +694 -0
- package/dist/visual-editor-CjORnP1D.js +169 -0
- package/dist/visual-editor-CmomGJB8.js +157 -0
- package/dist/visual-editor-Cymg8ID2.js +169 -0
- package/dist/visual-editor-D2Hk1nhM.js +145 -0
- package/dist/visual-editor-D2_8u6ZI.js +694 -0
- package/dist/visual-editor-D4vaqoBN.js +694 -0
- package/dist/visual-editor-D6n8EP_O.js +694 -0
- package/dist/visual-editor-D8MRFn5x.js +157 -0
- package/dist/visual-editor-DKG_E7X4.js +694 -0
- package/dist/visual-editor-DOXtCqRv.js +145 -0
- package/dist/visual-editor-DQEd3xwY.js +145 -0
- package/dist/visual-editor-DQq0_rUn.js +706 -0
- package/dist/visual-editor-DRXezaoB.js +694 -0
- package/dist/visual-editor-DUngIOnE.js +157 -0
- package/dist/visual-editor-DbgFzBNV.js +718 -0
- package/dist/visual-editor-DeZVZYfd.js +169 -0
- package/dist/visual-editor-DfJMZpiP.js +145 -0
- package/dist/visual-editor-DgAsQK9D.js +145 -0
- package/dist/visual-editor-Dhi__-7_.js +145 -0
- package/dist/visual-editor-DiLdoISr.js +718 -0
- package/dist/visual-editor-DjdqpJU-.js +145 -0
- package/dist/visual-editor-DnTPMRV4.js +694 -0
- package/dist/visual-editor-DvuH3jyL.js +157 -0
- package/dist/visual-editor-E0hASBXn.js +694 -0
- package/dist/visual-editor-TfVDfO5_.js +145 -0
- package/dist/visual-editor-W1OHU94y.js +694 -0
- package/dist/visual-editor-W_ZDmMFn.js +145 -0
- package/dist/visual-editor-b7ALusk8.js +145 -0
- package/dist/visual-editor-bauJ9beX.js +694 -0
- package/dist/visual-editor-erGXf3kS.js +157 -0
- package/dist/visual-editor-xnDHZFuO.js +153 -0
- package/dist/visual-editor-yiWZqIH0.js +157 -0
- package/dist/visual-editor.css +1 -0
- package/dist/visual-editor.js +15059 -136530
- package/package.json +45 -24
- package/dist/editor.css +0 -1
- package/dist/visual-editor--AAsqhQc.js +0 -231
- package/dist/visual-editor-32on_5DY.js +0 -243
- package/dist/visual-editor-49W0_Daf.js +0 -1002
- package/dist/visual-editor-8Lal-QZf.js +0 -219
- package/dist/visual-editor-B02CmTCX.js +0 -1002
- package/dist/visual-editor-BB0a_4dr.js +0 -243
- package/dist/visual-editor-BQa0UK-c.js +0 -1002
- package/dist/visual-editor-BRG83zQG.js +0 -1010
- package/dist/visual-editor-BVBPuEsB.js +0 -219
- package/dist/visual-editor-BcCzbooi.js +0 -243
- package/dist/visual-editor-BiemHMaD.js +0 -1014
- package/dist/visual-editor-Bkj-BZ8U.js +0 -1002
- package/dist/visual-editor-Bm_9l-r1.js +0 -1014
- package/dist/visual-editor-BsyZIlAm.js +0 -1002
- package/dist/visual-editor-BuUXmEr4.js +0 -1002
- package/dist/visual-editor-BxUYaP8B.js +0 -219
- package/dist/visual-editor-By1sH42E.js +0 -219
- package/dist/visual-editor-By9M5eN4.js +0 -231
- package/dist/visual-editor-C-MDqVaH.js +0 -219
- package/dist/visual-editor-C37Hro7w.js +0 -1026
- package/dist/visual-editor-C9I9pWeQ.js +0 -1014
- package/dist/visual-editor-CQOcLK3A.js +0 -1002
- package/dist/visual-editor-CSIc6-rm.js +0 -219
- package/dist/visual-editor-CaTT6blQ.js +0 -227
- package/dist/visual-editor-Cw95D-E7.js +0 -1014
- package/dist/visual-editor-CwW9rVaZ.js +0 -1002
- package/dist/visual-editor-CzC6S5LB.js +0 -1014
- package/dist/visual-editor-DAuNRkq8.js +0 -1026
- package/dist/visual-editor-DE8qwWp0.js +0 -1002
- package/dist/visual-editor-DEmVxnyc.js +0 -1014
- package/dist/visual-editor-DFQml8X8.js +0 -219
- package/dist/visual-editor-DHbDTZwW.js +0 -231
- package/dist/visual-editor-DR14jsjF.js +0 -219
- package/dist/visual-editor-DiO1-u9c.js +0 -243
- package/dist/visual-editor-Dk9cgdJp.js +0 -231
- package/dist/visual-editor-DlohF7nV.js +0 -219
- package/dist/visual-editor-DrbkrTPj.js +0 -231
- package/dist/visual-editor-Dwy8xGNv.js +0 -1002
- package/dist/visual-editor-Dz0yJDfm.js +0 -1026
- package/dist/visual-editor-InSI7qrX.js +0 -1026
- package/dist/visual-editor-KBcW6ZCw.js +0 -1002
- package/dist/visual-editor-Kgxgyjx4.js +0 -231
- package/dist/visual-editor-S4ACDl-Z.js +0 -1002
- package/dist/visual-editor-VLIdGBGJ.js +0 -1002
- package/dist/visual-editor-d-hTp0p2.js +0 -219
- package/dist/visual-editor-hqdcvtls.js +0 -219
- package/dist/visual-editor-llBar-sw.js +0 -1002
- package/dist/visual-editor-pb5PwMmE.js +0 -219
- package/dist/visual-editor-wSWVK8SW.js +0 -219
- package/dist/visual-editor-z-YqfQf7.js +0 -219
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { useTemplateProps } from "../../../hooks/useDocument.tsx";
|
|
2
|
+
import {
|
|
3
|
+
backgroundColors,
|
|
4
|
+
ThemeColor,
|
|
5
|
+
} from "../../../utils/themeConfigOptions.ts";
|
|
6
|
+
import { PageSection } from "../../atoms/pageSection.tsx";
|
|
7
|
+
import { msg } from "../../../utils/i18n/platform.ts";
|
|
8
|
+
import { Background } from "../../atoms/background.tsx";
|
|
9
|
+
import { HeadingTextProps } from "../../contentBlocks/HeadingText.tsx";
|
|
10
|
+
import { BreadcrumbsSectionProps } from "../Breadcrumbs.tsx";
|
|
11
|
+
import { PuckComponent, setDeep, Slot } from "@puckeditor/core";
|
|
12
|
+
import { AnalyticsScopeProvider } from "@yext/pages-components";
|
|
13
|
+
import { DirectoryList } from "./DirectoryWrapper.tsx";
|
|
14
|
+
import { isDirectoryGrid } from "../../../utils/directory/utils.ts";
|
|
15
|
+
import {
|
|
16
|
+
toPuckFields,
|
|
17
|
+
YextComponentConfig,
|
|
18
|
+
YextFields,
|
|
19
|
+
} from "../../../fields/fields.ts";
|
|
20
|
+
|
|
21
|
+
export interface DirectoryStyles {
|
|
22
|
+
/**
|
|
23
|
+
* The background color for the directory page heading area.
|
|
24
|
+
* @defaultValue Background Color 1
|
|
25
|
+
*/
|
|
26
|
+
backgroundColor: ThemeColor;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The background color for the directory list area.
|
|
30
|
+
* @defaultValue Background Color 1
|
|
31
|
+
*/
|
|
32
|
+
listBackgroundColor: ThemeColor;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The color of links in the directory list layout.
|
|
36
|
+
*/
|
|
37
|
+
linkColor?: ThemeColor;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface DirectoryProps {
|
|
41
|
+
/**
|
|
42
|
+
* This object contains properties for customizing the component's appearance.
|
|
43
|
+
* @propCategory Style Props
|
|
44
|
+
*/
|
|
45
|
+
styles: DirectoryStyles;
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
slots: {
|
|
49
|
+
TitleSlot: Slot;
|
|
50
|
+
SiteNameSlot: Slot;
|
|
51
|
+
BreadcrumbsSlot: Slot;
|
|
52
|
+
DirectoryGrid: Slot;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** @internal */
|
|
56
|
+
analytics: {
|
|
57
|
+
scope?: string;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const directoryFields: YextFields<DirectoryProps> = {
|
|
62
|
+
styles: {
|
|
63
|
+
type: "object",
|
|
64
|
+
label: msg("fields.styles", "Styles"),
|
|
65
|
+
objectFields: {
|
|
66
|
+
backgroundColor: {
|
|
67
|
+
type: "basicSelector",
|
|
68
|
+
label: msg("fields.headingBackgroundColor", "Heading Background Color"),
|
|
69
|
+
options: "BACKGROUND_COLOR",
|
|
70
|
+
},
|
|
71
|
+
listBackgroundColor: {
|
|
72
|
+
type: "basicSelector",
|
|
73
|
+
label: msg(
|
|
74
|
+
"fields.directoryListBackgroundColor",
|
|
75
|
+
"Directory List Background Color"
|
|
76
|
+
),
|
|
77
|
+
options: "BACKGROUND_COLOR",
|
|
78
|
+
},
|
|
79
|
+
linkColor: {
|
|
80
|
+
type: "basicSelector",
|
|
81
|
+
label: msg("fields.linkColor", "Link Color"),
|
|
82
|
+
options: "SITE_COLOR",
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
slots: {
|
|
87
|
+
type: "object",
|
|
88
|
+
objectFields: {
|
|
89
|
+
TitleSlot: { type: "slot", allow: [] },
|
|
90
|
+
SiteNameSlot: { type: "slot", allow: [] },
|
|
91
|
+
BreadcrumbsSlot: { type: "slot", allow: [] },
|
|
92
|
+
DirectoryGrid: { type: "slot", allow: [] },
|
|
93
|
+
},
|
|
94
|
+
visible: false,
|
|
95
|
+
},
|
|
96
|
+
analytics: {
|
|
97
|
+
type: "object",
|
|
98
|
+
label: msg("fields.analytics", "Analytics"),
|
|
99
|
+
visible: false,
|
|
100
|
+
objectFields: {
|
|
101
|
+
scope: {
|
|
102
|
+
label: msg("fields.scope", "Scope"),
|
|
103
|
+
type: "text",
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const DirectoryComponent: PuckComponent<DirectoryProps> = ({
|
|
110
|
+
styles,
|
|
111
|
+
slots,
|
|
112
|
+
}) => {
|
|
113
|
+
const { document: streamDocument, relativePrefixToRoot } = useTemplateProps();
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<Background background={styles.backgroundColor}>
|
|
117
|
+
<slots.BreadcrumbsSlot style={{ height: "auto" }} />
|
|
118
|
+
<PageSection className="flex flex-col items-center gap-2">
|
|
119
|
+
<slots.SiteNameSlot style={{ height: "auto", width: "100%" }} />
|
|
120
|
+
<slots.TitleSlot style={{ height: "auto", width: "100%" }} />
|
|
121
|
+
</PageSection>
|
|
122
|
+
{streamDocument.dm_directoryChildren &&
|
|
123
|
+
isDirectoryGrid(streamDocument.dm_directoryChildren) && (
|
|
124
|
+
<slots.DirectoryGrid style={{ height: "auto" }} />
|
|
125
|
+
)}
|
|
126
|
+
{streamDocument.dm_directoryChildren &&
|
|
127
|
+
!isDirectoryGrid(streamDocument.dm_directoryChildren) && (
|
|
128
|
+
<DirectoryList
|
|
129
|
+
streamDocument={streamDocument}
|
|
130
|
+
directoryChildren={streamDocument.dm_directoryChildren}
|
|
131
|
+
relativePrefixToRoot={relativePrefixToRoot ?? ""}
|
|
132
|
+
linkColor={styles.linkColor}
|
|
133
|
+
backgroundColor={styles.listBackgroundColor}
|
|
134
|
+
/>
|
|
135
|
+
)}
|
|
136
|
+
</Background>
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The Directory Page component serves as a navigational hub,
|
|
142
|
+
* displaying a list of child entities within a hierarchical structure
|
|
143
|
+
* (e.g., a list of states in a country, or cities in a state).
|
|
144
|
+
* It includes breadcrumbs for easy navigation and renders each child item as a distinct card.
|
|
145
|
+
* Available on Directory templates.
|
|
146
|
+
*/
|
|
147
|
+
export const Directory: YextComponentConfig<DirectoryProps> = {
|
|
148
|
+
label: msg("components.directory", "Directory"),
|
|
149
|
+
fields: directoryFields,
|
|
150
|
+
resolveFields: (data, params) => {
|
|
151
|
+
if (
|
|
152
|
+
params.metadata.streamDocument?.dm_directoryChildren &&
|
|
153
|
+
isDirectoryGrid(params.metadata.streamDocument.dm_directoryChildren)
|
|
154
|
+
) {
|
|
155
|
+
const updatedFields = setDeep(
|
|
156
|
+
directoryFields,
|
|
157
|
+
"styles.objectFields.listBackgroundColor.visible",
|
|
158
|
+
false
|
|
159
|
+
);
|
|
160
|
+
return toPuckFields(
|
|
161
|
+
setDeep(updatedFields, "styles.objectFields.linkColor.visible", false)
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
return toPuckFields(directoryFields);
|
|
165
|
+
},
|
|
166
|
+
defaultProps: {
|
|
167
|
+
styles: {
|
|
168
|
+
backgroundColor: backgroundColors.background1.value,
|
|
169
|
+
listBackgroundColor: backgroundColors.background1.value,
|
|
170
|
+
},
|
|
171
|
+
slots: {
|
|
172
|
+
TitleSlot: [
|
|
173
|
+
{
|
|
174
|
+
type: "HeadingTextSlot",
|
|
175
|
+
props: {
|
|
176
|
+
data: {
|
|
177
|
+
text: {
|
|
178
|
+
constantValue: { defaultValue: "" },
|
|
179
|
+
constantValueEnabled: false,
|
|
180
|
+
field: "name",
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
styles: { level: 2, align: "center" },
|
|
184
|
+
} satisfies HeadingTextProps,
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
SiteNameSlot: [
|
|
188
|
+
{
|
|
189
|
+
type: "HeadingTextSlot",
|
|
190
|
+
props: {
|
|
191
|
+
data: {
|
|
192
|
+
text: {
|
|
193
|
+
constantValue: { defaultValue: "" },
|
|
194
|
+
constantValueEnabled: true,
|
|
195
|
+
field: "name",
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
styles: { level: 4, align: "center" },
|
|
199
|
+
} satisfies HeadingTextProps,
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
BreadcrumbsSlot: [
|
|
203
|
+
{
|
|
204
|
+
type: "BreadcrumbsSlot",
|
|
205
|
+
props: {
|
|
206
|
+
data: {
|
|
207
|
+
directoryRoot: { defaultValue: "Directory Root" },
|
|
208
|
+
currentPage: {
|
|
209
|
+
constantValue: { defaultValue: "[[name]]" },
|
|
210
|
+
field: "name",
|
|
211
|
+
constantValueEnabled: false,
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
styles: {
|
|
215
|
+
backgroundColor: backgroundColors.background1.value,
|
|
216
|
+
showCurrentPage: true,
|
|
217
|
+
},
|
|
218
|
+
analytics: {
|
|
219
|
+
scope: "directory",
|
|
220
|
+
},
|
|
221
|
+
liveVisibility: true,
|
|
222
|
+
} satisfies BreadcrumbsSectionProps,
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
DirectoryGrid: [
|
|
226
|
+
{
|
|
227
|
+
type: "DirectoryGrid",
|
|
228
|
+
props: {
|
|
229
|
+
data: {
|
|
230
|
+
field: "dm_directoryChildren",
|
|
231
|
+
constantValueEnabled: false,
|
|
232
|
+
constantValue: [],
|
|
233
|
+
mappings: {
|
|
234
|
+
cardTitle: {
|
|
235
|
+
field: "name",
|
|
236
|
+
constantValueEnabled: false,
|
|
237
|
+
constantValue: undefined,
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
styles: {
|
|
242
|
+
backgroundColor: backgroundColors.background1.value,
|
|
243
|
+
},
|
|
244
|
+
slots: {
|
|
245
|
+
CardSlot: [],
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
analytics: {
|
|
252
|
+
scope: "directory",
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
render: (props) => (
|
|
256
|
+
<AnalyticsScopeProvider name={props?.analytics?.scope ?? "directory"}>
|
|
257
|
+
<DirectoryComponent {...props} />
|
|
258
|
+
</AnalyticsScopeProvider>
|
|
259
|
+
),
|
|
260
|
+
};
|