@daeryun/dr_components 0.9.95 → 0.9.97
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/components/page/LawInfoNew/LawInfoNew.jsx +2 -3
- package/dist/components/page/LawInfoNew/LawInfoNew.tsx +3 -7
- package/dist/components/page/SuccessNew/components/H3Contents.jsx +31 -24
- package/dist/components/page/SuccessNew/components/H3Contents.tsx +36 -32
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -81,7 +81,6 @@ const LawInfoNew = ({ data, tel }) => {
|
|
|
81
81
|
return 'https://schema.org/FAQPage';
|
|
82
82
|
};
|
|
83
83
|
const handleFaqItemScope = (isFaqActive, faqCount) => {
|
|
84
|
-
// isFaqActive가 true이거나 faqCount가 2 이상인 경우
|
|
85
84
|
if (isFaqActive || faqCount >= 2) {
|
|
86
85
|
return undefined;
|
|
87
86
|
}
|
|
@@ -90,7 +89,7 @@ const LawInfoNew = ({ data, tel }) => {
|
|
|
90
89
|
const convertFaqItemType = (template) => {
|
|
91
90
|
console.log('faqElementMaxCountInContents : ', faqElementMaxCountInContents);
|
|
92
91
|
if (faqElementMaxCountInContents >= 2) {
|
|
93
|
-
template.description = template.description.
|
|
92
|
+
template.description = template.description.replaceAll(/item(scope|type)\s*=\s*["'][^"']*["']/gi, '');
|
|
94
93
|
return template;
|
|
95
94
|
}
|
|
96
95
|
return template;
|
|
@@ -123,7 +122,7 @@ const LawInfoNew = ({ data, tel }) => {
|
|
|
123
122
|
</div>
|
|
124
123
|
</div>
|
|
125
124
|
|
|
126
|
-
<article itemScope={faqElementMaxCountInContents >=
|
|
125
|
+
<article itemScope={faqElementMaxCountInContents >= 1 ? true : undefined} itemType={faqElementMaxCountInContents >= 1
|
|
127
126
|
? 'https://schema.org/FAQPage'
|
|
128
127
|
: undefined}>
|
|
129
128
|
{/*목차*/}
|
|
@@ -111,7 +111,6 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
const handleFaqItemScope = (isFaqActive: boolean, faqCount: number): true | undefined => {
|
|
114
|
-
// isFaqActive가 true이거나 faqCount가 2 이상인 경우
|
|
115
114
|
if (isFaqActive || faqCount >= 2) {
|
|
116
115
|
return undefined;
|
|
117
116
|
}
|
|
@@ -122,10 +121,7 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
122
121
|
const convertFaqItemType = (template: ISeoTemplateTypes): ISeoTemplateTypes => {
|
|
123
122
|
console.log('faqElementMaxCountInContents : ', faqElementMaxCountInContents);
|
|
124
123
|
if ((faqElementMaxCountInContents as number) >= 2) {
|
|
125
|
-
template.description = template.description.
|
|
126
|
-
/itemtype\s*=\s*["']https:\/\/schema\.org\/FAQPage["']/gi,
|
|
127
|
-
''
|
|
128
|
-
);
|
|
124
|
+
template.description = template.description.replaceAll(/item(scope|type)\s*=\s*["'][^"']*["']/gi, '');
|
|
129
125
|
|
|
130
126
|
return template;
|
|
131
127
|
}
|
|
@@ -189,9 +185,9 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
189
185
|
</div>
|
|
190
186
|
|
|
191
187
|
<article
|
|
192
|
-
itemScope={(faqElementMaxCountInContents as number) >=
|
|
188
|
+
itemScope={(faqElementMaxCountInContents as number) >= 1 ? true : undefined}
|
|
193
189
|
itemType={
|
|
194
|
-
(faqElementMaxCountInContents as number) >=
|
|
190
|
+
(faqElementMaxCountInContents as number) >= 1
|
|
195
191
|
? 'https://schema.org/FAQPage'
|
|
196
192
|
: undefined
|
|
197
193
|
}
|
|
@@ -5,50 +5,57 @@ import FieldIcon from '../../../../asset/images/success_new/field_icon.webp';
|
|
|
5
5
|
const H3Contents = ({ h3Template, faqCount }) => {
|
|
6
6
|
const { active_faq } = h3Template;
|
|
7
7
|
const getItemScope = () => {
|
|
8
|
-
if (active_faq || faqCount >=
|
|
9
|
-
return
|
|
8
|
+
if (active_faq || faqCount >= 1) {
|
|
9
|
+
return undefined;
|
|
10
10
|
}
|
|
11
|
-
return
|
|
11
|
+
return true;
|
|
12
12
|
};
|
|
13
13
|
const getItemProp = (category) => {
|
|
14
|
-
if (active_faq || faqCount >=
|
|
14
|
+
if (active_faq || faqCount >= 1) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
15
18
|
switch (category) {
|
|
16
|
-
case
|
|
17
|
-
return
|
|
18
|
-
case
|
|
19
|
-
return
|
|
20
|
-
case
|
|
21
|
-
return
|
|
22
|
-
case
|
|
23
|
-
return
|
|
24
|
-
default:
|
|
19
|
+
case 'mainEntity':
|
|
20
|
+
return 'mainEntity';
|
|
21
|
+
case 'acceptedAnswer':
|
|
22
|
+
return 'acceptedAnswer';
|
|
23
|
+
case 'name':
|
|
24
|
+
return 'name';
|
|
25
|
+
case 'text':
|
|
26
|
+
return 'text';
|
|
27
|
+
default:
|
|
28
|
+
undefined;
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
|
-
return undefined;
|
|
28
31
|
};
|
|
29
32
|
const getItemType = (category) => {
|
|
30
|
-
if (active_faq || faqCount >=
|
|
33
|
+
if (active_faq || faqCount >= 1) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
31
37
|
switch (category) {
|
|
32
|
-
case
|
|
33
|
-
return
|
|
34
|
-
case
|
|
35
|
-
return
|
|
36
|
-
default:
|
|
38
|
+
case 'question':
|
|
39
|
+
return 'https://schema.org/Question';
|
|
40
|
+
case 'answer':
|
|
41
|
+
return 'https://schema.org/Answer';
|
|
42
|
+
default:
|
|
43
|
+
undefined;
|
|
37
44
|
}
|
|
38
45
|
}
|
|
39
46
|
return undefined;
|
|
40
47
|
};
|
|
41
48
|
return (<>
|
|
42
|
-
<div className={'px-[10px] sm:px-[18px]'} key={'h3영역' + h3Template.idx} itemScope={getItemScope()} itemProp={getItemProp(
|
|
49
|
+
<div className={'px-[10px] sm:px-[18px]'} key={'h3영역' + h3Template.idx} itemScope={getItemScope()} itemProp={getItemProp('mainEntity')} itemType={getItemType('question')}>
|
|
43
50
|
{/*h3*/}
|
|
44
|
-
<h3 className={'mb-[16px] flex items-center break-keep text-[18px] font-bold tracking-[-0.96px] text-[#285FA7] sm:mb-[18px] sm:text-[22px] lg:mb-[22.5px] lg:text-[24px]'} id={h3Template.idx.toString()} itemProp={getItemProp(
|
|
51
|
+
<h3 className={'mb-[16px] flex items-center break-keep text-[18px] font-bold tracking-[-0.96px] text-[#285FA7] sm:mb-[18px] sm:text-[22px] lg:mb-[22.5px] lg:text-[24px]'} id={h3Template.idx.toString()} itemProp={getItemProp('name')}>
|
|
45
52
|
{/*모든 seo 체크로 변경*/}
|
|
46
53
|
<Image src={FieldIcon} alt={'h3 img'} width={27} height={26} className={'mr-[8px] h-auto max-sm:w-[22px]'}/>
|
|
47
54
|
{h3Template.tag_title}
|
|
48
55
|
</h3>
|
|
49
56
|
{/*h3 설명글*/}
|
|
50
|
-
<div itemScope={getItemScope()} itemProp={getItemProp(
|
|
51
|
-
<div className={'mb-[44px] whitespace-break-spaces text-[16px] tracking-[-0.69px] sm:mx-[20px] sm:mx-[33px] sm:mb-[50px] sm:text-[17.25px] lg:mb-[78px]'} itemProp={getItemProp(
|
|
57
|
+
<div itemScope={getItemScope()} itemProp={getItemProp('acceptedAnswer')} itemType={getItemType('answer')}>
|
|
58
|
+
<div className={'mb-[44px] whitespace-break-spaces text-[16px] tracking-[-0.69px] sm:mx-[20px] sm:mx-[33px] sm:mb-[50px] sm:text-[17.25px] lg:mb-[78px]'} itemProp={getItemProp('text')} id={'ck-content'} dangerouslySetInnerHTML={{
|
|
52
59
|
__html: htmlUrlDecode(h3Template.description.replace('../../UploadFile', '/SE2/upload'))
|
|
53
60
|
}}></div>
|
|
54
61
|
</div>
|
|
@@ -4,45 +4,49 @@ import { ISeoTemplateTypes } from '../SuccessNewType';
|
|
|
4
4
|
import { htmlUrlDecode } from '../../../../lib';
|
|
5
5
|
import FieldIcon from '../../../../asset/images/success_new/field_icon.webp';
|
|
6
6
|
|
|
7
|
-
type ItemPropTypes =
|
|
8
|
-
type ItemTypes =
|
|
7
|
+
type ItemPropTypes = 'mainEntity' | 'acceptedAnswer' | 'name' | 'text';
|
|
8
|
+
type ItemTypes = 'question' | 'answer';
|
|
9
9
|
|
|
10
|
-
const H3Contents = ({ h3Template, faqCount }: { h3Template: ISeoTemplateTypes
|
|
10
|
+
const H3Contents = ({ h3Template, faqCount }: { h3Template: ISeoTemplateTypes; faqCount?: number }) => {
|
|
11
11
|
const { active_faq } = h3Template;
|
|
12
12
|
|
|
13
13
|
const getItemScope = (): boolean | undefined => {
|
|
14
|
-
if (active_faq || faqCount as number >=
|
|
15
|
-
return
|
|
14
|
+
if (active_faq || (faqCount as number) >= 1) {
|
|
15
|
+
return undefined;
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return true;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const getItemProp = (category: ItemPropTypes): string | undefined => {
|
|
21
|
-
if (active_faq || faqCount as number >=
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
case
|
|
26
|
-
return
|
|
27
|
-
case
|
|
28
|
-
return
|
|
29
|
-
case
|
|
30
|
-
return
|
|
31
|
-
|
|
21
|
+
if (active_faq || (faqCount as number) >= 1) {
|
|
22
|
+
return undefined;
|
|
23
|
+
} else {
|
|
24
|
+
switch (category) {
|
|
25
|
+
case 'mainEntity':
|
|
26
|
+
return 'mainEntity';
|
|
27
|
+
case 'acceptedAnswer':
|
|
28
|
+
return 'acceptedAnswer';
|
|
29
|
+
case 'name':
|
|
30
|
+
return 'name';
|
|
31
|
+
case 'text':
|
|
32
|
+
return 'text';
|
|
33
|
+
default:
|
|
34
|
+
undefined;
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
|
-
|
|
35
|
-
return undefined;
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
const getItemType = (category: ItemTypes): string | undefined => {
|
|
39
|
-
if (active_faq || faqCount as number >=
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
case
|
|
44
|
-
return
|
|
45
|
-
|
|
40
|
+
if (active_faq || (faqCount as number) >= 1) {
|
|
41
|
+
return undefined;
|
|
42
|
+
} else {
|
|
43
|
+
switch (category) {
|
|
44
|
+
case 'question':
|
|
45
|
+
return 'https://schema.org/Question';
|
|
46
|
+
case 'answer':
|
|
47
|
+
return 'https://schema.org/Answer';
|
|
48
|
+
default:
|
|
49
|
+
undefined;
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
|
|
@@ -55,8 +59,8 @@ const H3Contents = ({ h3Template, faqCount }: { h3Template: ISeoTemplateTypes, f
|
|
|
55
59
|
className={'px-[10px] sm:px-[18px]'}
|
|
56
60
|
key={'h3영역' + h3Template.idx}
|
|
57
61
|
itemScope={getItemScope()}
|
|
58
|
-
itemProp={getItemProp(
|
|
59
|
-
itemType={getItemType(
|
|
62
|
+
itemProp={getItemProp('mainEntity')}
|
|
63
|
+
itemType={getItemType('question')}
|
|
60
64
|
>
|
|
61
65
|
{/*h3*/}
|
|
62
66
|
<h3
|
|
@@ -64,7 +68,7 @@ const H3Contents = ({ h3Template, faqCount }: { h3Template: ISeoTemplateTypes, f
|
|
|
64
68
|
'mb-[16px] flex items-center break-keep text-[18px] font-bold tracking-[-0.96px] text-[#285FA7] sm:mb-[18px] sm:text-[22px] lg:mb-[22.5px] lg:text-[24px]'
|
|
65
69
|
}
|
|
66
70
|
id={h3Template.idx.toString()}
|
|
67
|
-
itemProp={getItemProp(
|
|
71
|
+
itemProp={getItemProp('name')}
|
|
68
72
|
>
|
|
69
73
|
{/*모든 seo 체크로 변경*/}
|
|
70
74
|
<Image
|
|
@@ -79,14 +83,14 @@ const H3Contents = ({ h3Template, faqCount }: { h3Template: ISeoTemplateTypes, f
|
|
|
79
83
|
{/*h3 설명글*/}
|
|
80
84
|
<div
|
|
81
85
|
itemScope={getItemScope()}
|
|
82
|
-
itemProp={getItemProp(
|
|
83
|
-
itemType={getItemType(
|
|
86
|
+
itemProp={getItemProp('acceptedAnswer')}
|
|
87
|
+
itemType={getItemType('answer')}
|
|
84
88
|
>
|
|
85
89
|
<div
|
|
86
90
|
className={
|
|
87
91
|
'mb-[44px] whitespace-break-spaces text-[16px] tracking-[-0.69px] sm:mx-[20px] sm:mx-[33px] sm:mb-[50px] sm:text-[17.25px] lg:mb-[78px]'
|
|
88
92
|
}
|
|
89
|
-
itemProp={getItemProp(
|
|
93
|
+
itemProp={getItemProp('text')}
|
|
90
94
|
id={'ck-content'}
|
|
91
95
|
dangerouslySetInnerHTML={{
|
|
92
96
|
__html: htmlUrlDecode(h3Template.description.replace('../../UploadFile', '/SE2/upload'))
|