pds-dev-kit-web-test 0.2.1 → 0.2.3
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/README.md +12 -1
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Image/Image.d.ts +8 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Image/Image.js +46 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Image/index.d.ts +2 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Image/index.js +8 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/RichText/RichText.d.ts +2 -3
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/RichText/RichText.js +3 -3
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/RichText/index.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Text/Text.d.ts +13 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Text/Text.js +63 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Text/index.d.ts +2 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Text/index.js +8 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/TwitterTimeline/TwitterTimeline.d.ts +3 -11
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/TwitterTimeline/TwitterTimeline.js +18 -18
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/TwitterTimeline/TwitterTimelineRerender.d.ts +14 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/TwitterTimeline/TwitterTimelineRerender.js +41 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Wrapper/Wrapper.d.ts +35 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Wrapper/Wrapper.js +141 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Wrapper/constants.d.ts +2 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Wrapper/constants.js +33 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Wrapper/index.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Wrapper/index.js +8 -0
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/index.d.ts +3 -2
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/index.js +3 -1
- package/dist/src/sub/DynamicLayout/components/EditModeSectionMatcher/EditModeSectionMatcher.js +3 -3
- package/dist/src/sub/DynamicLayout/components/Section/Section.d.ts +6 -3
- package/dist/src/sub/DynamicLayout/components/Section/Section.js +40 -8
- package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackgroundMedia.d.ts +9 -0
- package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackgroundMedia.js +68 -0
- package/dist/src/sub/DynamicLayout/components/SectionMatcher/SectionMatcher.js +4 -4
- package/dist/src/sub/DynamicLayout/components/index.d.ts +0 -1
- package/dist/src/sub/DynamicLayout/components/index.js +1 -6
- package/dist/src/sub/DynamicLayout/mock_customSection.d.ts +2 -0
- package/dist/src/sub/DynamicLayout/mock_customSection.js +838 -0
- package/dist/src/sub/DynamicLayout/mock_samplePage.js +5 -210
- package/dist/src/sub/DynamicLayout/nakedMocks.json +783 -0
- package/dist/src/sub/DynamicLayout/sectionActionTypes.d.ts +17 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.d.ts +2 -9
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +85 -51
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlock.d.ts +7 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlock.js +55 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.d.ts +3 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.js +70 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.d.ts +5 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +73 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/btnTypes.d.ts +68 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/btnTypes.js +2 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Divider.d.ts +5 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Divider.js +66 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image.d.ts +16 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image.js +102 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/RichText.d.ts +5 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/RichText.js +62 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/index.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/index.js +8 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/types.d.ts +44 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/types.js +2 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text.d.ts +32 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text.js +58 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Twitter.d.ts +10 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Twitter.js +41 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/Youtube.d.ts +5 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/Youtube.js +69 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/index.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/index.js +8 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/parseYoutubeContentProp.d.ts +7 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/parseYoutubeContentProp.js +33 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/types.d.ts +48 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/types.js +2 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_Box.d.ts +2 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/{BlockMatcher/blocks/Button.js → components/ComponentBlock/componentBlocks/components/S_CB_Box.js} +6 -11
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_HiddenCover.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_HiddenCover.js +13 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/hooks/useCLINK.d.ts +8 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/hooks/useCLINK.js +24 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +20 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.js +2 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/utils/CLINKhandler.d.ts +0 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/utils/CLINKhandler.js +18 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/index.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/index.js +8 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/index.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/index.js +5 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/index.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/index.js +5 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useIntersectionObserver.d.ts +6 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useIntersectionObserver.js +26 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/index.d.ts +0 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/colorUtil.d.ts +31 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/colorUtil.js +66 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/index.d.ts +2 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/index.js +10 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/replaceUndefinedValues.d.ts +2 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/replaceUndefinedValues.js +46 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.d.ts +18 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.js +79 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/types.d.ts +50 -81
- package/dist/src/sub/DynamicLayout/sections/CustomSection/types.js +11 -12
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/contentPropParsers/index.d.ts +3 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/contentPropParsers/index.js +16 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/contentPropParsers/parseContentVisibility.d.ts +12 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/contentPropParsers/parseContentVisibility.js +18 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/contentPropParsers/types.d.ts +5 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/contentPropParsers/types.js +7 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/constants.d.ts +4 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/constants.js +46 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/index.d.ts +3 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/index.js +16 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/parseEffectPropEntAnim.d.ts +19 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/parseEffectPropEntAnim.js +51 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/types.d.ts +5 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/types.js +7 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/index.d.ts +6 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/index.js +18 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/index.d.ts +3 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/index.js +19 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseLayoutPropArrange.d.ts +24 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseLayoutPropArrange.js +80 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseLayoutPropPadding.d.ts +21 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseLayoutPropPadding.js +32 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/types.d.ts +7 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/types.js +8 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseJsonProperties.d.ts +3 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseJsonProperties.js +61 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.d.ts +20 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.js +46 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseProperties.d.ts +5 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseProperties.js +54 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/index.d.ts +3 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/index.js +41 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgColor.d.ts +43 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgColor.js +58 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgImage.d.ts +19 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgImage.js +118 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgOverlay.d.ts +43 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgOverlay.js +64 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBorder.d.ts +38 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBorder.js +73 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropDivider.d.ts +26 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropDivider.js +65 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropImage.d.ts +19 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropImage.js +118 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropOpacity.d.ts +15 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropOpacity.js +41 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropShadow.d.ts +39 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropShadow.js +46 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropTextSpec.d.ts +39 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropTextSpec.js +80 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/types.d.ts +22 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/types.js +16 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +134 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.js +2 -0
- package/dist/src/sub/DynamicLayout/sections/index.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/sections/index.js +3 -1
- package/dist/src/sub/DynamicLayout/types.d.ts +70 -4
- package/package.json +2 -3
- package/release-note.md +2 -2
- package/dist/src/sub/DynamicLayout/components/Box.d.ts +0 -13
- package/dist/src/sub/DynamicLayout/components/Box.js +0 -73
- package/dist/src/sub/DynamicLayout/custonSectionSampleData.d.ts +0 -218
- package/dist/src/sub/DynamicLayout/custonSectionSampleData.js +0 -198
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/BlockMatcher.d.ts +0 -11
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/BlockMatcher.js +0 -71
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Accordion.d.ts +0 -12
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Accordion.js +0 -46
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionBody.d.ts +0 -8
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionBody.js +0 -74
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionCore.d.ts +0 -13
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionCore.js +0 -25
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionHeader.d.ts +0 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionHeader.js +0 -49
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionItem.d.ts +0 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionItem.js +0 -19
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/index.d.ts +0 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/index.js +0 -14
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Button.d.ts +0 -8
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Divider.d.ts +0 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Divider.js +0 -29
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Image.d.ts +0 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Image.js +0 -18
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Instagram.d.ts +0 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Instagram.js +0 -19
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/RichText.d.ts +0 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/RichText.js +0 -9
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Text.d.ts +0 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Text.js +0 -29
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Twitter.d.ts +0 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Twitter.js +0 -30
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Youtube.d.ts +0 -9
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Youtube.js +0 -38
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/index.d.ts +0 -9
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/index.js +0 -24
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/index.d.ts +0 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/index.js +0 -8
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
export declare const customsectionMock: ({
|
|
2
|
-
type: string;
|
|
3
|
-
gridItemData: {
|
|
4
|
-
x: number;
|
|
5
|
-
y: number;
|
|
6
|
-
w: number;
|
|
7
|
-
h: number;
|
|
8
|
-
i: string;
|
|
9
|
-
};
|
|
10
|
-
content: {
|
|
11
|
-
data: {
|
|
12
|
-
type: string;
|
|
13
|
-
value: {
|
|
14
|
-
text: string;
|
|
15
|
-
size?: undefined;
|
|
16
|
-
src?: undefined;
|
|
17
|
-
alt?: undefined;
|
|
18
|
-
accountId?: undefined;
|
|
19
|
-
startAt?: undefined;
|
|
20
|
-
endAt?: undefined;
|
|
21
|
-
accordionItems?: undefined;
|
|
22
|
-
openedItemId?: undefined;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
style: {
|
|
27
|
-
backgroundColor: string;
|
|
28
|
-
};
|
|
29
|
-
hoverStyle: {
|
|
30
|
-
backgroundColor: string;
|
|
31
|
-
color: string;
|
|
32
|
-
opacity: number;
|
|
33
|
-
};
|
|
34
|
-
layout: {};
|
|
35
|
-
} | {
|
|
36
|
-
type: string;
|
|
37
|
-
gridItemData: {
|
|
38
|
-
x: number;
|
|
39
|
-
y: number;
|
|
40
|
-
w: number;
|
|
41
|
-
h: number;
|
|
42
|
-
i: string;
|
|
43
|
-
};
|
|
44
|
-
content: {
|
|
45
|
-
data: {
|
|
46
|
-
type: string;
|
|
47
|
-
value: {
|
|
48
|
-
text: string;
|
|
49
|
-
size?: undefined;
|
|
50
|
-
src?: undefined;
|
|
51
|
-
alt?: undefined;
|
|
52
|
-
accountId?: undefined;
|
|
53
|
-
startAt?: undefined;
|
|
54
|
-
endAt?: undefined;
|
|
55
|
-
accordionItems?: undefined;
|
|
56
|
-
openedItemId?: undefined;
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
style: {
|
|
61
|
-
backgroundColor: string;
|
|
62
|
-
};
|
|
63
|
-
layout: {};
|
|
64
|
-
hoverStyle?: undefined;
|
|
65
|
-
} | {
|
|
66
|
-
type: string;
|
|
67
|
-
gridItemData: {
|
|
68
|
-
x: number;
|
|
69
|
-
y: number;
|
|
70
|
-
w: number;
|
|
71
|
-
h: number;
|
|
72
|
-
i: string;
|
|
73
|
-
};
|
|
74
|
-
content: {
|
|
75
|
-
data: {
|
|
76
|
-
type: string;
|
|
77
|
-
value: {
|
|
78
|
-
size: number;
|
|
79
|
-
text?: undefined;
|
|
80
|
-
src?: undefined;
|
|
81
|
-
alt?: undefined;
|
|
82
|
-
accountId?: undefined;
|
|
83
|
-
startAt?: undefined;
|
|
84
|
-
endAt?: undefined;
|
|
85
|
-
accordionItems?: undefined;
|
|
86
|
-
openedItemId?: undefined;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
style: {
|
|
91
|
-
backgroundColor: string;
|
|
92
|
-
};
|
|
93
|
-
layout: {};
|
|
94
|
-
hoverStyle?: undefined;
|
|
95
|
-
} | {
|
|
96
|
-
type: string;
|
|
97
|
-
gridItemData: {
|
|
98
|
-
x: number;
|
|
99
|
-
y: number;
|
|
100
|
-
w: number;
|
|
101
|
-
h: number;
|
|
102
|
-
i: string;
|
|
103
|
-
};
|
|
104
|
-
content: {
|
|
105
|
-
data: {
|
|
106
|
-
type: string;
|
|
107
|
-
value: {
|
|
108
|
-
src: string;
|
|
109
|
-
alt: string;
|
|
110
|
-
text?: undefined;
|
|
111
|
-
size?: undefined;
|
|
112
|
-
accountId?: undefined;
|
|
113
|
-
startAt?: undefined;
|
|
114
|
-
endAt?: undefined;
|
|
115
|
-
accordionItems?: undefined;
|
|
116
|
-
openedItemId?: undefined;
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
style: {
|
|
121
|
-
backgroundColor: string;
|
|
122
|
-
};
|
|
123
|
-
layout: {};
|
|
124
|
-
hoverStyle?: undefined;
|
|
125
|
-
} | {
|
|
126
|
-
type: string;
|
|
127
|
-
gridItemData: {
|
|
128
|
-
x: number;
|
|
129
|
-
y: number;
|
|
130
|
-
w: number;
|
|
131
|
-
h: number;
|
|
132
|
-
i: string;
|
|
133
|
-
};
|
|
134
|
-
content: {
|
|
135
|
-
data: {
|
|
136
|
-
type: string;
|
|
137
|
-
value: {
|
|
138
|
-
accountId: string;
|
|
139
|
-
text?: undefined;
|
|
140
|
-
size?: undefined;
|
|
141
|
-
src?: undefined;
|
|
142
|
-
alt?: undefined;
|
|
143
|
-
startAt?: undefined;
|
|
144
|
-
endAt?: undefined;
|
|
145
|
-
accordionItems?: undefined;
|
|
146
|
-
openedItemId?: undefined;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
style: {
|
|
151
|
-
backgroundColor: string;
|
|
152
|
-
};
|
|
153
|
-
layout: {};
|
|
154
|
-
hoverStyle?: undefined;
|
|
155
|
-
} | {
|
|
156
|
-
type: string;
|
|
157
|
-
gridItemData: {
|
|
158
|
-
x: number;
|
|
159
|
-
y: number;
|
|
160
|
-
w: number;
|
|
161
|
-
h: number;
|
|
162
|
-
i: string;
|
|
163
|
-
};
|
|
164
|
-
content: {
|
|
165
|
-
data: {
|
|
166
|
-
type: string;
|
|
167
|
-
value: {
|
|
168
|
-
src: string;
|
|
169
|
-
startAt: number;
|
|
170
|
-
endAt: number;
|
|
171
|
-
text?: undefined;
|
|
172
|
-
size?: undefined;
|
|
173
|
-
alt?: undefined;
|
|
174
|
-
accountId?: undefined;
|
|
175
|
-
accordionItems?: undefined;
|
|
176
|
-
openedItemId?: undefined;
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
};
|
|
180
|
-
style: {
|
|
181
|
-
backgroundColor: string;
|
|
182
|
-
};
|
|
183
|
-
layout: {};
|
|
184
|
-
hoverStyle?: undefined;
|
|
185
|
-
} | {
|
|
186
|
-
type: string;
|
|
187
|
-
gridItemData: {
|
|
188
|
-
x: number;
|
|
189
|
-
y: number;
|
|
190
|
-
w: number;
|
|
191
|
-
h: number;
|
|
192
|
-
i: string;
|
|
193
|
-
};
|
|
194
|
-
content: {
|
|
195
|
-
data: {
|
|
196
|
-
type: string;
|
|
197
|
-
value: {
|
|
198
|
-
accordionItems: {
|
|
199
|
-
title: string;
|
|
200
|
-
description: string;
|
|
201
|
-
}[];
|
|
202
|
-
openedItemId: string;
|
|
203
|
-
text?: undefined;
|
|
204
|
-
size?: undefined;
|
|
205
|
-
src?: undefined;
|
|
206
|
-
alt?: undefined;
|
|
207
|
-
accountId?: undefined;
|
|
208
|
-
startAt?: undefined;
|
|
209
|
-
endAt?: undefined;
|
|
210
|
-
};
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
style: {
|
|
214
|
-
backgroundColor: string;
|
|
215
|
-
};
|
|
216
|
-
layout: {};
|
|
217
|
-
hoverStyle?: undefined;
|
|
218
|
-
})[];
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.customsectionMock = void 0;
|
|
4
|
-
exports.customsectionMock = [
|
|
5
|
-
{
|
|
6
|
-
type: 'BUTTON',
|
|
7
|
-
gridItemData: {
|
|
8
|
-
x: 2,
|
|
9
|
-
y: 2,
|
|
10
|
-
w: 2,
|
|
11
|
-
h: 2,
|
|
12
|
-
i: '1'
|
|
13
|
-
},
|
|
14
|
-
content: {
|
|
15
|
-
data: {
|
|
16
|
-
type: 'BUTTON',
|
|
17
|
-
value: {
|
|
18
|
-
text: 'im button'
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
style: {
|
|
23
|
-
backgroundColor: 'red'
|
|
24
|
-
},
|
|
25
|
-
hoverStyle: {
|
|
26
|
-
backgroundColor: 'blue',
|
|
27
|
-
color: 'white',
|
|
28
|
-
opacity: 0.5
|
|
29
|
-
},
|
|
30
|
-
layout: {}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
type: 'TEXT',
|
|
34
|
-
gridItemData: {
|
|
35
|
-
x: 3,
|
|
36
|
-
y: 3,
|
|
37
|
-
w: 2,
|
|
38
|
-
h: 2,
|
|
39
|
-
i: '2'
|
|
40
|
-
},
|
|
41
|
-
content: {
|
|
42
|
-
data: {
|
|
43
|
-
type: 'TEXT',
|
|
44
|
-
value: {
|
|
45
|
-
text: 'im Text'
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
style: {
|
|
50
|
-
backgroundColor: 'red'
|
|
51
|
-
},
|
|
52
|
-
layout: {}
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
type: 'DIVIDER',
|
|
56
|
-
gridItemData: {
|
|
57
|
-
x: 8,
|
|
58
|
-
y: 0,
|
|
59
|
-
w: 2,
|
|
60
|
-
h: 4,
|
|
61
|
-
i: '3'
|
|
62
|
-
},
|
|
63
|
-
content: {
|
|
64
|
-
data: {
|
|
65
|
-
type: 'DIVIDER',
|
|
66
|
-
value: {
|
|
67
|
-
size: 10
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
style: {
|
|
72
|
-
backgroundColor: 'red'
|
|
73
|
-
},
|
|
74
|
-
layout: {}
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
type: 'IMAGE',
|
|
78
|
-
gridItemData: {
|
|
79
|
-
x: 0,
|
|
80
|
-
y: 4,
|
|
81
|
-
w: 4,
|
|
82
|
-
h: 4,
|
|
83
|
-
i: '4'
|
|
84
|
-
},
|
|
85
|
-
content: {
|
|
86
|
-
data: {
|
|
87
|
-
type: 'IMAGE',
|
|
88
|
-
value: {
|
|
89
|
-
src: 'https://static.publ.site/channel_default_channel_icon.png',
|
|
90
|
-
alt: 'text'
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
style: {
|
|
95
|
-
backgroundColor: 'red'
|
|
96
|
-
},
|
|
97
|
-
layout: {}
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
type: 'TWITTER',
|
|
101
|
-
gridItemData: {
|
|
102
|
-
x: 8,
|
|
103
|
-
y: 1,
|
|
104
|
-
w: 5,
|
|
105
|
-
h: 7,
|
|
106
|
-
i: '5'
|
|
107
|
-
},
|
|
108
|
-
content: {
|
|
109
|
-
data: {
|
|
110
|
-
type: 'TWITTER',
|
|
111
|
-
value: {
|
|
112
|
-
accountId: 'elonmusk'
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
style: {
|
|
117
|
-
backgroundColor: 'red'
|
|
118
|
-
},
|
|
119
|
-
layout: {}
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
type: 'YOUTUBE',
|
|
123
|
-
gridItemData: {
|
|
124
|
-
x: 12,
|
|
125
|
-
y: 4,
|
|
126
|
-
w: 6,
|
|
127
|
-
h: 6,
|
|
128
|
-
i: '6'
|
|
129
|
-
},
|
|
130
|
-
content: {
|
|
131
|
-
data: {
|
|
132
|
-
type: 'YOUTUBE',
|
|
133
|
-
value: {
|
|
134
|
-
src: 'https://youtu.be/5ch94AaPZRQ',
|
|
135
|
-
startAt: 60,
|
|
136
|
-
endAt: 120
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
style: {
|
|
141
|
-
backgroundColor: 'red'
|
|
142
|
-
},
|
|
143
|
-
layout: {}
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
type: 'RICH_TEXT',
|
|
147
|
-
gridItemData: {
|
|
148
|
-
x: 0,
|
|
149
|
-
y: 0,
|
|
150
|
-
w: 6,
|
|
151
|
-
h: 10,
|
|
152
|
-
i: '7'
|
|
153
|
-
},
|
|
154
|
-
content: {
|
|
155
|
-
data: {
|
|
156
|
-
type: 'RICH_TEXT',
|
|
157
|
-
value: {
|
|
158
|
-
text: '<h1>text</h1><h2>text</h2><p><span style="color: rgb(224, 62, 45);">text</span></p><p><span style="color: rgb(132, 63, 161);">text</span></p><p><span style="color: rgb(230, 126, 35);">text</span></p><p><span style="color: rgb(22, 145, 121);">text</span></p><p><em>text</em></p><p><span style="text-decoration: underline;">text</span></p><p><s>text</s></p><p style="text-align: center;">text</p><p style="text-align: right;">text</p><ol><li style="text-align: left;">text</li><li style="text-align: left;">text</li></ol><p> </p><ul><li>text</li><li>text</li></ul><blockquote><p>text</p></blockquote><p><span style="color: rgb(126, 140, 141);"><a href="https://google.com">https://google.com</a></span></p><p><span style="color: rgb(126, 140, 141);"><img title="b4bffd4008803a321411fc7ada27be05.jpeg" src="https://publ-upload-dev.s3.ap-northeast-2.amazonaws.com/45414c0e-496b-43d0-99f7-e8cefe177e81.jpeg" alt="image" width="700" height="394"></span></p><p><span style="color: rgb(126, 140, 141);"><iframe src="https://www.youtube.com/embed/WHD7uNXFspk" width="560" height="314" allowfullscreen="allowfullscreen"></iframe></span></p>'
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
style: {
|
|
163
|
-
backgroundColor: 'yellow'
|
|
164
|
-
},
|
|
165
|
-
layout: {}
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
type: 'ACCORDION',
|
|
169
|
-
gridItemData: {
|
|
170
|
-
x: 5,
|
|
171
|
-
y: 5,
|
|
172
|
-
w: 6,
|
|
173
|
-
h: 10,
|
|
174
|
-
i: '8'
|
|
175
|
-
},
|
|
176
|
-
content: {
|
|
177
|
-
data: {
|
|
178
|
-
type: 'ACCORDION',
|
|
179
|
-
value: {
|
|
180
|
-
accordionItems: [
|
|
181
|
-
{ title: 'title1', description: 'description1' },
|
|
182
|
-
{ title: 'title2', description: 'description2' },
|
|
183
|
-
{ title: 'title3', description: 'description3' }
|
|
184
|
-
],
|
|
185
|
-
openedItemId: '0'
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
style: {
|
|
190
|
-
backgroundColor: 'white'
|
|
191
|
-
// display: 'flex',
|
|
192
|
-
// flexDirection: 'column',
|
|
193
|
-
// justifyContent: 'center',
|
|
194
|
-
// alignItems: 'center'
|
|
195
|
-
},
|
|
196
|
-
layout: {}
|
|
197
|
-
}
|
|
198
|
-
];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { BlockNames, ContentType, LayoutType, StyleType } from '../types';
|
|
3
|
-
declare type BlockMatcherProps = {
|
|
4
|
-
type: BlockNames;
|
|
5
|
-
content: ContentType;
|
|
6
|
-
style: StyleType;
|
|
7
|
-
layout: LayoutType;
|
|
8
|
-
hoverStyle?: StyleType;
|
|
9
|
-
};
|
|
10
|
-
declare function BlockMatcher({ type, content, style, layout, hoverStyle }: BlockMatcherProps): JSX.Element;
|
|
11
|
-
export default BlockMatcher;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
var blocks_1 = require("./blocks");
|
|
8
|
-
var Button_1 = __importDefault(require("./blocks/Button"));
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
-
function BlockMatcher(_a) {
|
|
11
|
-
var type = _a.type, content = _a.content, style = _a.style, layout = _a.layout, hoverStyle = _a.hoverStyle;
|
|
12
|
-
var value = content.data.value;
|
|
13
|
-
switch (type) {
|
|
14
|
-
case 'TEXT':
|
|
15
|
-
if ('text' in value) {
|
|
16
|
-
return (0, jsx_runtime_1.jsx)(blocks_1.Text, { style: style, text: value.text }, void 0);
|
|
17
|
-
}
|
|
18
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
|
|
19
|
-
case 'BUTTON':
|
|
20
|
-
if ('text' in value) {
|
|
21
|
-
return (0, jsx_runtime_1.jsx)(Button_1.default, { text: value.text, style: style, hoverStyle: hoverStyle }, void 0);
|
|
22
|
-
}
|
|
23
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
|
|
24
|
-
case 'IMAGE': {
|
|
25
|
-
if ('src' in value) {
|
|
26
|
-
return (0, jsx_runtime_1.jsx)(blocks_1.Image, { style: style, src: value.src }, void 0);
|
|
27
|
-
}
|
|
28
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
|
|
29
|
-
}
|
|
30
|
-
case 'RICH_TEXT': {
|
|
31
|
-
if ('text' in value) {
|
|
32
|
-
return (0, jsx_runtime_1.jsx)(blocks_1.RichText, { style: style, text: value.text }, void 0);
|
|
33
|
-
}
|
|
34
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
|
|
35
|
-
}
|
|
36
|
-
case 'INSTAGRAM': {
|
|
37
|
-
if ('accountId' in value) {
|
|
38
|
-
return (0, jsx_runtime_1.jsx)(blocks_1.Instagram, { style: style, accountId: value.accountId }, void 0);
|
|
39
|
-
}
|
|
40
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
|
|
41
|
-
}
|
|
42
|
-
case 'TWITTER': {
|
|
43
|
-
if ('accountId' in value) {
|
|
44
|
-
return (0, jsx_runtime_1.jsx)(blocks_1.Twitter, { style: style, accountId: value.accountId }, void 0);
|
|
45
|
-
}
|
|
46
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
|
|
47
|
-
}
|
|
48
|
-
case 'YOUTUBE': {
|
|
49
|
-
if ('startAt' in value) {
|
|
50
|
-
return ((0, jsx_runtime_1.jsx)(blocks_1.Youtube, { url: value.src, startAt: value.startAt, endAt: value.endAt, style: style }, void 0));
|
|
51
|
-
}
|
|
52
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
|
|
53
|
-
}
|
|
54
|
-
case 'DIVIDER': {
|
|
55
|
-
if ('size' in value) {
|
|
56
|
-
return (0, jsx_runtime_1.jsx)(blocks_1.Divider, { size: value.size, style: style }, void 0);
|
|
57
|
-
}
|
|
58
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
|
|
59
|
-
}
|
|
60
|
-
case 'ACCORDION': {
|
|
61
|
-
if ('accordionItems' in value && 'openedItemId' in value) {
|
|
62
|
-
return ((0, jsx_runtime_1.jsx)(blocks_1.Accordion, { accordionItems: value.accordionItems, openedItemId: value.openedItemId, style: style }, void 0));
|
|
63
|
-
}
|
|
64
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
|
|
65
|
-
}
|
|
66
|
-
// eslint-disable-next-line no-fallthrough
|
|
67
|
-
default:
|
|
68
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
exports.default = BlockMatcher;
|
package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Accordion.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
export declare type AccordionItem = {
|
|
3
|
-
title: string;
|
|
4
|
-
description: string;
|
|
5
|
-
};
|
|
6
|
-
export declare type AccordionProps = {
|
|
7
|
-
accordionItems: AccordionItem[];
|
|
8
|
-
openedItemId?: string;
|
|
9
|
-
style: React.CSSProperties;
|
|
10
|
-
};
|
|
11
|
-
declare function Accordion({ accordionItems, openedItemId, style }: AccordionProps): JSX.Element;
|
|
12
|
-
export default Accordion;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
22
|
-
var react_1 = require("react");
|
|
23
|
-
var index_1 = require("../../../../../../desktop/index");
|
|
24
|
-
var components_1 = require("../../../../../../hybrid/components");
|
|
25
|
-
var components_2 = require("../../../../../DynamicLayout/components");
|
|
26
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
27
|
-
var AccordionCore_1 = require("./AccordionCore");
|
|
28
|
-
function Accordion(_a) {
|
|
29
|
-
var accordionItems = _a.accordionItems, openedItemId = _a.openedItemId, style = _a.style;
|
|
30
|
-
var _b = (0, react_1.useState)(''), openedId = _b[0], setOpen = _b[1];
|
|
31
|
-
(0, react_1.useLayoutEffect)(function () {
|
|
32
|
-
setOpen(openedItemId !== null && openedItemId !== void 0 ? openedItemId : '');
|
|
33
|
-
}, [openedItemId]);
|
|
34
|
-
var toggleAccordion = function (id) {
|
|
35
|
-
if (openedId === id) {
|
|
36
|
-
setOpen('');
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
setOpen(id);
|
|
40
|
-
};
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(S_AccordionBox, __assign({ style: style }, { children: (0, jsx_runtime_1.jsx)(AccordionCore_1.AccordionCore, __assign({ openedId: openedId, toggle: toggleAccordion }, { children: accordionItems.map(function (each, index) { return ((0, jsx_runtime_1.jsxs)(AccordionCore_1.AccordionItem, __assign({ style: { backgroundColor: style.backgroundColor } }, { children: [(0, jsx_runtime_1.jsx)(AccordionCore_1.AccordionHeader, { targetId: index.toString(), text: each.title }, void 0), (0, jsx_runtime_1.jsxs)(AccordionCore_1.AccordionBody, __assign({ targetId: index.toString() }, { children: [(0, jsx_runtime_1.jsxs)(components_2.Box, __assign({ direction: "horizontal" }, { children: [(0, jsx_runtime_1.jsx)(components_1.Spacing, { size: "spacing_e", spacingType: "width" }, void 0), (0, jsx_runtime_1.jsx)(index_1.D_TextLabel, { text: each.description, styleTheme: "caption1Regular", colorTheme: "sysTextSecondary" }, void 0)] }), void 0), (0, jsx_runtime_1.jsx)(components_1.Spacing, { size: "spacing_e" }, void 0)] }), void 0), (0, jsx_runtime_1.jsx)(S_Divider, {}, void 0)] }), index.toString())); }) }), void 0) }), void 0));
|
|
42
|
-
}
|
|
43
|
-
var S_Divider = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: #dfdfdf;\n height: 1px;\n width: 100%;\n"], ["\n background-color: #dfdfdf;\n height: 1px;\n width: 100%;\n"])));
|
|
44
|
-
var S_AccordionBox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 100%;\n\n * {\n color: black;\n }\n"], ["\n height: 100%;\n\n * {\n color: black;\n }\n"])));
|
|
45
|
-
exports.default = Accordion;
|
|
46
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AccordionItemIdType } from './AccordionCore';
|
|
3
|
-
declare type Props = {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
targetId: AccordionItemIdType;
|
|
6
|
-
};
|
|
7
|
-
declare function AccordionBody({ children, targetId }: Props): JSX.Element;
|
|
8
|
-
export default AccordionBody;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
var react_1 = require("react");
|
|
39
|
-
var styled_components_1 = __importStar(require("styled-components"));
|
|
40
|
-
var AccordionCore_1 = require("./AccordionCore");
|
|
41
|
-
function AccordionBody(_a) {
|
|
42
|
-
var children = _a.children, targetId = _a.targetId;
|
|
43
|
-
var _b = (0, react_1.useState)('SHOW'), state = _b[0], setState = _b[1];
|
|
44
|
-
var _c = (0, react_1.useState)(0), height = _c[0], setHeight = _c[1];
|
|
45
|
-
var openedId = (0, react_1.useContext)(AccordionCore_1.AccordionContext).openedId;
|
|
46
|
-
var childrenRef = (0, react_1.useRef)(null);
|
|
47
|
-
(0, react_1.useEffect)(function () {
|
|
48
|
-
if (!childrenRef.current) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
var off = childrenRef.current.offsetHeight;
|
|
52
|
-
setHeight(off);
|
|
53
|
-
}, [children]);
|
|
54
|
-
(0, react_1.useLayoutEffect)(function () {
|
|
55
|
-
if (openedId !== targetId) {
|
|
56
|
-
setState('COLLAPSE');
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
setState('SHOW');
|
|
60
|
-
}, [openedId]);
|
|
61
|
-
return ((0, jsx_runtime_1.jsx)(S_AccordionBody, __assign({ state: state, height: height }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ ref: childrenRef }, { children: children }), void 0) }), void 0));
|
|
62
|
-
}
|
|
63
|
-
var S_AccordionBody = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: ", ";\n overflow: hidden;\n\n ", ";\n\n ", ";\n\n transition: height 0.35s ease;\n"], ["\n height: ", ";\n overflow: hidden;\n\n ", ";\n\n ", ";\n\n transition: height 0.35s ease;\n"])), function (_a) {
|
|
64
|
-
var height = _a.height;
|
|
65
|
-
return height + "px";
|
|
66
|
-
}, function (_a) {
|
|
67
|
-
var state = _a.state, height = _a.height;
|
|
68
|
-
return state === 'SHOW' && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: ", " + 'px';\n "], ["\n height: ", " + 'px';\n "])), height);
|
|
69
|
-
}, function (_a) {
|
|
70
|
-
var state = _a.state;
|
|
71
|
-
return state === 'COLLAPSE' && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 0;\n "], ["\n height: 0;\n "])));
|
|
72
|
-
});
|
|
73
|
-
exports.default = AccordionBody;
|
|
74
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare type AccordionItemIdType = string | number;
|
|
3
|
-
declare type Props = {
|
|
4
|
-
openedId: AccordionItemIdType;
|
|
5
|
-
toggle: (id: AccordionItemIdType) => void;
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
};
|
|
8
|
-
export declare const AccordionContext: React.Context<{
|
|
9
|
-
openedId: AccordionItemIdType;
|
|
10
|
-
toggle: (id: AccordionItemIdType) => void;
|
|
11
|
-
}>;
|
|
12
|
-
declare function AccordionCore({ openedId, children, toggle }: Props): JSX.Element;
|
|
13
|
-
export default AccordionCore;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.AccordionContext = void 0;
|
|
15
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
-
var react_1 = require("react");
|
|
17
|
-
exports.AccordionContext = (0, react_1.createContext)({
|
|
18
|
-
openedId: '',
|
|
19
|
-
toggle: function () { return null; }
|
|
20
|
-
});
|
|
21
|
-
function AccordionCore(_a) {
|
|
22
|
-
var openedId = _a.openedId, children = _a.children, toggle = _a.toggle;
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(exports.AccordionContext.Provider, __assign({ value: { openedId: openedId, toggle: toggle } }, { children: children }), void 0));
|
|
24
|
-
}
|
|
25
|
-
exports.default = AccordionCore;
|