@daeryun/dr_components 1.3.49 → 1.3.50
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.
|
@@ -34,12 +34,11 @@ const Blog = ({ data, tel }: IBlogPageTypes) => {
|
|
|
34
34
|
youtubeLinkList,
|
|
35
35
|
initialData,
|
|
36
36
|
nextPost,
|
|
37
|
-
prevPost
|
|
38
|
-
faqElementMaxCountInContents
|
|
37
|
+
prevPost
|
|
39
38
|
} = data;
|
|
40
39
|
const { width } = useBrowser(true);
|
|
41
|
-
const [isFaqActive, setIsFaqActive] = useState<boolean>(false);
|
|
42
40
|
const printRef = useRef<HTMLDivElement>(null);
|
|
41
|
+
const [faqElementMaxCountInContents, setFaqElementMaxCountInContents] = useState<number>(0);
|
|
43
42
|
|
|
44
43
|
const h1Title: string = template
|
|
45
44
|
.map(temp => temp.tag === 'h1' && temp.tag_title)
|
|
@@ -63,24 +62,18 @@ const Blog = ({ data, tel }: IBlogPageTypes) => {
|
|
|
63
62
|
}
|
|
64
63
|
};
|
|
65
64
|
|
|
66
|
-
const handleFaqItemType = (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (isFaqActive && (faqElementMaxCountInContents as number) >= 2) {
|
|
65
|
+
const handleFaqItemType = (): string | undefined => {
|
|
66
|
+
// 작성자 FAQPage가 1개일 때만 루트 FAQPage를 제거한다.
|
|
67
|
+
if (faqElementMaxCountInContents === 1) {
|
|
72
68
|
return undefined;
|
|
73
69
|
}
|
|
74
70
|
|
|
75
71
|
return 'https://schema.org/FAQPage';
|
|
76
72
|
};
|
|
77
73
|
|
|
78
|
-
const handleFaqItemScope = (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (isFaqActive && (faqElementMaxCountInContents as number) >= 2) {
|
|
74
|
+
const handleFaqItemScope = (): true | undefined => {
|
|
75
|
+
// 작성자 FAQPage가 1개일 때만 루트 FAQPage를 제거한다.
|
|
76
|
+
if (faqElementMaxCountInContents === 1) {
|
|
84
77
|
return undefined;
|
|
85
78
|
}
|
|
86
79
|
|
|
@@ -88,39 +81,52 @@ const Blog = ({ data, tel }: IBlogPageTypes) => {
|
|
|
88
81
|
};
|
|
89
82
|
|
|
90
83
|
const convertFaqItemType = (template: ISeoTemplateTypes): ISeoTemplateTypes => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
// 작성자 FAQPage가 2개 이상이면 내부 FAQPage를 지우고 루트 FAQPage 1개만 유지한다.
|
|
85
|
+
if (faqElementMaxCountInContents) {
|
|
86
|
+
if (faqElementMaxCountInContents >= 2) {
|
|
87
|
+
const convertedDescription = template.description
|
|
88
|
+
.replaceAll('<div itemscope="" itemtype="https://schema.org/FAQPage">', '<div>')
|
|
89
|
+
.replaceAll('<div itemscope="" itemtype="https://schema.org/FAQPage">', '<div>');
|
|
97
90
|
|
|
98
|
-
|
|
91
|
+
return {
|
|
92
|
+
...template,
|
|
93
|
+
description: convertedDescription
|
|
94
|
+
};
|
|
95
|
+
}
|
|
99
96
|
}
|
|
100
97
|
|
|
101
|
-
return template;
|
|
98
|
+
return { ...template };
|
|
102
99
|
};
|
|
103
100
|
|
|
101
|
+
// template, h2List 순회
|
|
104
102
|
useEffect(() => {
|
|
105
103
|
if (template) {
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
template.forEach(data => {
|
|
105
|
+
if (data.description) {
|
|
106
|
+
data.faqCount =
|
|
107
|
+
data.description.split('FAQPage').length >= 2 ? data.description.split('FAQPage').length : 0;
|
|
108
|
+
setFaqElementMaxCountInContents(Math.max(...template.map(data => data.faqCount as number)));
|
|
109
|
+
} else {
|
|
110
|
+
data.faqCount = 0;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
108
114
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (data
|
|
112
|
-
|
|
115
|
+
if (h2List) {
|
|
116
|
+
h2List.forEach(data => {
|
|
117
|
+
if (data.description && template) {
|
|
118
|
+
data.faqCount =
|
|
119
|
+
data.description.split('FAQPage').length >= 2 ? data.description.split('FAQPage').length : 0;
|
|
120
|
+
setFaqElementMaxCountInContents(Math.max(...template.map(data => data.faqCount as number)));
|
|
121
|
+
} else {
|
|
122
|
+
data.faqCount = 0;
|
|
113
123
|
}
|
|
114
|
-
}
|
|
124
|
+
});
|
|
115
125
|
}
|
|
116
|
-
}, [template]);
|
|
126
|
+
}, [template, h2List]);
|
|
117
127
|
|
|
118
128
|
return (
|
|
119
|
-
<div
|
|
120
|
-
itemScope={handleFaqItemScope(isFaqActive, faqElementMaxCountInContents as number)}
|
|
121
|
-
itemType={handleFaqItemType(isFaqActive, faqElementMaxCountInContents as number)}
|
|
122
|
-
ref={printRef}
|
|
123
|
-
>
|
|
129
|
+
<div itemScope={handleFaqItemScope()} itemType={handleFaqItemType()} ref={printRef}>
|
|
124
130
|
<div id={'sub_contents'}>
|
|
125
131
|
<div className="relative m-auto mb-[60px] w-[90%] max-w-screen-2xl max-xs:mb-[30px]">
|
|
126
132
|
<div
|
|
@@ -195,7 +201,7 @@ const Blog = ({ data, tel }: IBlogPageTypes) => {
|
|
|
195
201
|
{/*h3*/}
|
|
196
202
|
{template
|
|
197
203
|
.filter(t => t.parent === h2Template.idx)
|
|
198
|
-
.map(
|
|
204
|
+
.map(h3Template => {
|
|
199
205
|
const refer_is_use = h3Template.reference_is_use;
|
|
200
206
|
const refer_length = referenceLinkList.length;
|
|
201
207
|
const refer_content_length = referenceLinkList.filter(
|
|
@@ -212,6 +218,7 @@ const Blog = ({ data, tel }: IBlogPageTypes) => {
|
|
|
212
218
|
<Fragment key={'h3Contents_section_' + h3Template.idx}>
|
|
213
219
|
<H3Contents
|
|
214
220
|
h3Template={convertFaqItemType(h3Template)}
|
|
221
|
+
key={'h3영역' + h3Template.idx}
|
|
215
222
|
faqCount={h3Template?.faqCount}
|
|
216
223
|
/>
|
|
217
224
|
{(refer_is_use &&
|
package/dist/styles/globals.css
CHANGED
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/*
|
|
110
|
-
! tailwindcss v3.4.
|
|
110
|
+
! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com
|
|
111
111
|
*/
|
|
112
112
|
|
|
113
113
|
/*
|
|
@@ -9394,20 +9394,16 @@ html {
|
|
|
9394
9394
|
|
|
9395
9395
|
.backdrop-blur-\[4px\] {
|
|
9396
9396
|
--tw-backdrop-blur: blur(4px);
|
|
9397
|
-
-webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
|
|
9398
9397
|
backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
|
|
9399
9398
|
}
|
|
9400
9399
|
|
|
9401
9400
|
.backdrop-blur-sm {
|
|
9402
9401
|
--tw-backdrop-blur: blur(4px);
|
|
9403
|
-
-webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
|
|
9404
9402
|
backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
|
|
9405
9403
|
}
|
|
9406
9404
|
|
|
9407
9405
|
.transition {
|
|
9408
|
-
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
|
|
9409
9406
|
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
|
|
9410
|
-
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
|
|
9411
9407
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
9412
9408
|
transition-duration: 150ms;
|
|
9413
9409
|
}
|