pds-dev-kit-web-test 2.3.5 → 2.3.7
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/src/common/hooks/useAbsolutePositioner.js +2 -2
- package/dist/src/common/hooks/useTooltip.d.ts +2 -2
- package/dist/src/common/hooks/useTooltip.js +2 -2
- package/dist/src/common/utils/SystemUIPositionGenerator/clickTypeSystemUICssGenerator.d.ts +1 -1
- package/dist/src/common/utils/SystemUIPositionGenerator/hoverTypeSystemUICssGenerator.d.ts +1 -1
- package/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.js +2 -2
- package/dist/src/desktop/components/AdminList/BulkActionBar.d.ts +1 -1
- package/dist/src/desktop/components/AdminListHeader/HeaderBar.d.ts +1 -1
- package/dist/src/desktop/components/BasicButtonGroup/BasicButtonGroup.d.ts +1 -1
- package/dist/src/desktop/components/BasicButtonGroup/BasicButtonGroup.js +3 -3
- package/dist/src/desktop/components/BasicListItem/Contents.d.ts +1 -1
- package/dist/src/desktop/components/BasicListItem/Contents.js +1 -1
- package/dist/src/desktop/components/BasicListItem/LeftBox/Badge.js +1 -1
- package/dist/src/desktop/components/BasicListItem/LeftBox/Checkbox.js +1 -1
- package/dist/src/desktop/components/BasicListItem/LeftBox/Icon.js +1 -1
- package/dist/src/desktop/components/BasicListItem/LeftBox/Image.js +1 -1
- package/dist/src/desktop/components/BasicListItem/LeftBox/Radio.js +1 -1
- package/dist/src/desktop/components/BasicListItem/RightBox/Description.d.ts +1 -1
- package/dist/src/desktop/components/BasicListItem/RightBox/Description.js +1 -1
- package/dist/src/desktop/components/BasicListItem/RightBox/Switch.js +1 -1
- package/dist/src/desktop/components/ContextMenuItem/ContextMenuItem.d.ts +1 -1
- package/dist/src/desktop/components/ContextMenuItem/ContextMenuItem.js +1 -1
- package/dist/src/desktop/components/DesktopTabBar/DesktopTabBar.js +2 -2
- package/dist/src/desktop/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/src/desktop/components/Dropdown/Dropdown.js +1 -1
- package/dist/src/desktop/components/IconButton/IconButton.d.ts +1 -1
- package/dist/src/desktop/components/IconButton/IconButton.js +2 -2
- package/dist/src/desktop/components/SegmentedButtonGroup/SegmentedButtonGroup.d.ts +1 -1
- package/dist/src/desktop/components/SegmentedButtonGroup/SegmentedButtonGroup.js +3 -3
- package/dist/src/desktop/components/Slider/Slider.d.ts +1 -1
- package/dist/src/desktop/components/Slider/Slider.js +1 -1
- package/dist/src/desktop/components/TextLabel/TextLabel.d.ts +1 -1
- package/dist/src/desktop/components/TextLabel/TextLabel.js +2 -2
- package/dist/src/desktop/components/UploadIconButton/UploadIconButton.d.ts +1 -1
- package/dist/src/desktop/components/UploadIconButton/UploadIconButton.js +2 -2
- package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.js +2 -2
- package/dist/src/mobile/components/BasicButtonGroup/BasicButtonGroup.d.ts +1 -1
- package/dist/src/mobile/components/BasicButtonGroup/BasicButtonGroup.js +1 -1
- package/dist/src/mobile/components/BasicListItem/Contents.d.ts +1 -1
- package/dist/src/mobile/components/BasicListItem/Contents.js +1 -1
- package/dist/src/mobile/components/BasicListItem/LeftBox/Badge.js +1 -1
- package/dist/src/mobile/components/BasicListItem/LeftBox/Checkbox.js +1 -1
- package/dist/src/mobile/components/BasicListItem/LeftBox/Icon.js +1 -1
- package/dist/src/mobile/components/BasicListItem/LeftBox/Image.js +1 -1
- package/dist/src/mobile/components/BasicListItem/LeftBox/Radio.js +1 -1
- package/dist/src/mobile/components/BasicListItem/RightBox/Description.d.ts +1 -1
- package/dist/src/mobile/components/BasicListItem/RightBox/Description.js +1 -1
- package/dist/src/mobile/components/BasicListItem/RightBox/Switch.js +1 -1
- package/dist/src/mobile/components/ContextMenuItem/ContextMenuItem.d.ts +1 -1
- package/dist/src/mobile/components/ContextMenuItem/ContextMenuItem.js +1 -1
- package/dist/src/mobile/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/src/mobile/components/Dropdown/Dropdown.js +1 -1
- package/dist/src/mobile/components/MobileHeaderBar/utils.d.ts +1 -1
- package/dist/src/mobile/components/SegmentedButtonGroup/SegmentedButtonGroup.d.ts +1 -1
- package/dist/src/mobile/components/SegmentedButtonGroup/SegmentedButtonGroup.js +1 -1
- package/dist/src/mobile/components/Slider/Slider.d.ts +1 -1
- package/dist/src/mobile/components/Slider/Slider.js +1 -1
- package/dist/src/sub/AdminList/AdminList/AdminList.d.ts +1 -1
- package/dist/src/sub/AdminList/AdminList/AdminList.js +2 -2
- package/dist/src/sub/AdminList/AdminList/HeaderRow.d.ts +1 -1
- package/dist/src/sub/AdminList/AdminList/HeaderRow.js +2 -2
- package/dist/src/sub/AdminList/AdminListHeader/AdminListHeader.d.ts +1 -1
- package/dist/src/sub/AdminList/AdminListHeader/AdminListHeader.js +2 -2
- package/dist/src/sub/AdminList/AdminListHeader/HeaderBar.d.ts +1 -1
- package/dist/src/sub/AdminList/AdminListHeader/HeaderBar.js +2 -2
- package/dist/src/sub/AdminList/AdminListItem/AdminListItem.d.ts +1 -1
- package/dist/src/sub/AdminList/AdminListItem/AdminListItem.js +3 -3
- package/dist/src/sub/AdminList/BulkActionBar/BulkActionBar.d.ts +1 -1
- package/dist/src/sub/AdminList/BulkActionBar/BulkActionBar.js +2 -2
- package/dist/src/sub/AdminList/ToolBar/ChipList.d.ts +1 -1
- package/dist/src/sub/AdminList/ToolBar/ChipList.js +1 -1
- package/dist/src/sub/AdminList/ToolBar/SearchField.js +4 -4
- package/dist/src/sub/AdminList/ToolBar/ToolBar.d.ts +1 -1
- package/dist/src/sub/AdminList/ToolBar/ToolBar.js +3 -3
- package/dist/src/sub/DynamicLayout/components/EditModeSectionMatcher/EditModeSectionMatcher.js +1 -1
- package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackground.js +2 -2
- package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackgroundMedia.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackgroundMedia.js +1 -1
- package/dist/src/sub/DynamicLayout/components/Section/util/parseSectionBackgroundMediaData.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/components/Section/util/parseSectionBackgroundMediaData.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +3 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +6 -6
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Divider/Divider.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/Embed.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/IframeDenied.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/types.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/Image.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/types.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/RichText.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/RichText.js +5 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/types.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/types.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Twitter/Twitter.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Twitter/types.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/Youtube.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/Youtube.js +4 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/parseYoutubeContentProp.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/types.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_BoxWithShadow.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_BoxWithShadow.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/hooks/useCLINK.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGoogleFonts/useGoogleFonts.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/useGroupDrag.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/useGroupDrag.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseJsonProperties.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/FullscreenIframeSection/templates/TemplateA/desktop/D_TemplateA.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/FullscreenIframeSection/templates/TemplateA/mobile/M_TemplateA.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/MembershipSection.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/MembershipSection.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/TemplateA.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/D_TemplateA.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/EmptyMembershipSheet.js +4 -4
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/MembershipBenefitInfo.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/MembershipBenefitInfo.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/MembershipPlanSheet.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/MembershipPlanSheet.js +5 -5
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/MembershipSheet.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/MembershipSheet.js +4 -4
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/NarrowMembershipListView.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/NarrowMembershipListView.js +3 -3
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/SectionContents.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/UnavailableMembershipPlanSheet.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/UnavailableMembershipPlanSheet.js +4 -4
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/WideMembershipListView.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/WideMembershipListView.js +3 -3
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/mobile/M_TemplateA.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/mobile/components/EmptyMembershipSheet.js +4 -4
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/mobile/components/MembershipBenefitInfo.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/mobile/components/MembershipBenefitInfo.js +3 -3
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/mobile/components/MembershipContents.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/mobile/components/MembershipSectionSheet.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/mobile/components/MembershipSectionSheet.js +5 -5
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/mobile/components/SectionContents.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/TemplateB.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/desktop/D_TemplateB.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/desktop/components/EmptyMembershipSheet.js +4 -4
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/desktop/components/MembershipBenefitInfo.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/desktop/components/MembershipBenefitInfo.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/desktop/components/MembershipCard.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/desktop/components/MembershipCard.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/desktop/components/MembershipPlanSheet.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/desktop/components/MembershipPlanSheet.js +5 -5
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/desktop/components/MembershipSheet.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/desktop/components/MembershipSheet.js +6 -6
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/desktop/components/SectionContents.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/desktop/components/UnavailableMembershipPlanSheet.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/desktop/components/UnavailableMembershipPlanSheet.js +4 -4
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/mobile/M_TemplateB.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/mobile/components/EmptyMembershipSheet.js +4 -4
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/mobile/components/MembershipBenefitInfo.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/mobile/components/MembershipBenefitInfo.js +3 -3
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/mobile/components/MembershipContents.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/mobile/components/MembershipSectionSheet.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/mobile/components/MembershipSectionSheet.js +5 -5
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/mobile/components/SectionContents.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/MembershipSection.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/MembershipSection.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/templates/TemplateA/TemplateA.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/templates/TemplateA/desktop/D_TemplateA.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/templates/TemplateA/desktop/components/SectionContents.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/templates/TemplateA/mobile/M_TemplateA.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/templates/TemplateA/mobile/components/SectionContents.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/templates/TemplateB/TemplateB.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/templates/TemplateB/desktop/D_TemplateB.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/templates/TemplateB/desktop/components/SectionContents.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/templates/TemplateB/mobile/M_TemplateB.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/templates/TemplateB/mobile/components/SectionContents.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/components/desktop/MembershipSectionItem.d.ts +3 -3
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/components/desktop/MembershipSectionItem.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/components/mobile/MembershipSectionItem.d.ts +3 -3
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/components/mobile/MembershipSectionItem.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/constants.d.ts +1 -1
- package/dist/src/sub/SandollFontKit/api/getSandollFonts.d.ts +14 -0
- package/dist/src/sub/SandollFontKit/api/getSandollFonts.js +77 -0
- package/dist/src/sub/SandollFontKit/api/types.d.ts +49 -0
- package/dist/src/sub/SandollFontKit/api/types.js +2 -0
- package/dist/src/sub/SandollFontKit/constants.js +9 -9
- package/dist/src/sub/SandollFontKit/headless/SandollFontItem.js +1 -1
- package/dist/src/sub/SandollFontKit/headless/SandollFontsList.d.ts +10 -9
- package/dist/src/sub/SandollFontKit/headless/SandollFontsList.js +17 -88
- package/dist/src/sub/SandollFontKit/hooks/useQueryParamsReducer.d.ts +30 -0
- package/dist/src/sub/SandollFontKit/hooks/useQueryParamsReducer.js +69 -0
- package/dist/src/sub/SandollFontKit/index.d.ts +1 -0
- package/dist/src/sub/SandollFontKit/index.js +3 -1
- package/dist/src/sub/SandollFontKit/types.d.ts +5 -13
- package/dist/src/sub/SandollFontKit/utils/createSandollFontLink.d.ts +2 -0
- package/dist/src/sub/SandollFontKit/utils/createSandollFontLink.js +24 -0
- package/package.json +1 -1
package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/MembershipSection.js
CHANGED
@@ -30,7 +30,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
30
|
};
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
32
32
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
33
|
-
var components_1 = require("
|
33
|
+
var components_1 = require("@sub/DynamicLayout/components");
|
34
34
|
var styled_components_1 = __importDefault(require("styled-components"));
|
35
35
|
var templates_1 = require("./templates");
|
36
36
|
function NormalTypeMembershipSection(_a) {
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
4
4
|
var react_1 = require("react");
|
5
|
-
var dynamicLayoutContext_1 = require("
|
5
|
+
var dynamicLayoutContext_1 = require("@sub/DynamicLayout/dynamicLayoutContext");
|
6
6
|
var desktop_1 = require("./desktop");
|
7
7
|
var mobile_1 = require("./mobile");
|
8
8
|
function TemplateA() {
|
@@ -9,7 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
10
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
11
11
|
var react_1 = require("react");
|
12
|
-
var dynamicLayoutContext_1 = require("
|
12
|
+
var dynamicLayoutContext_1 = require("@sub/DynamicLayout/dynamicLayoutContext");
|
13
13
|
var styled_components_1 = __importDefault(require("styled-components"));
|
14
14
|
var SectionContents_1 = __importDefault(require("./components/SectionContents"));
|
15
15
|
function TemplateA() {
|
@@ -20,8 +20,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
21
21
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
22
22
|
var react_1 = require("react");
|
23
|
-
var Section_1 = require("
|
24
|
-
var components_1 = require("
|
23
|
+
var Section_1 = require("@sub/DynamicLayout/components/Section");
|
24
|
+
var components_1 = require("@sub/DynamicLayout/sections/MembershipSection/components");
|
25
25
|
var styled_components_1 = __importDefault(require("styled-components"));
|
26
26
|
function SectionContents() {
|
27
27
|
var section = (0, react_1.useContext)(Section_1.sectionContext);
|
@@ -9,7 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
10
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
11
11
|
var react_1 = require("react");
|
12
|
-
var dynamicLayoutContext_1 = require("
|
12
|
+
var dynamicLayoutContext_1 = require("@sub/DynamicLayout/dynamicLayoutContext");
|
13
13
|
var styled_components_1 = __importDefault(require("styled-components"));
|
14
14
|
var SectionContents_1 = __importDefault(require("./components/SectionContents"));
|
15
15
|
function TemplateA() {
|
@@ -20,8 +20,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
21
21
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
22
22
|
var react_1 = require("react");
|
23
|
-
var Section_1 = require("
|
24
|
-
var components_1 = require("
|
23
|
+
var Section_1 = require("@sub/DynamicLayout/components/Section");
|
24
|
+
var components_1 = require("@sub/DynamicLayout/sections/MembershipSection/components");
|
25
25
|
var styled_components_1 = __importDefault(require("styled-components"));
|
26
26
|
function SectionContents() {
|
27
27
|
var section = (0, react_1.useContext)(Section_1.sectionContext);
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
4
4
|
var react_1 = require("react");
|
5
|
-
var dynamicLayoutContext_1 = require("
|
5
|
+
var dynamicLayoutContext_1 = require("@sub/DynamicLayout/dynamicLayoutContext");
|
6
6
|
var desktop_1 = require("./desktop");
|
7
7
|
var mobile_1 = require("./mobile");
|
8
8
|
function TemplateB() {
|
@@ -9,7 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
10
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
11
11
|
var react_1 = require("react");
|
12
|
-
var dynamicLayoutContext_1 = require("
|
12
|
+
var dynamicLayoutContext_1 = require("@sub/DynamicLayout/dynamicLayoutContext");
|
13
13
|
var styled_components_1 = __importDefault(require("styled-components"));
|
14
14
|
var SectionContents_1 = __importDefault(require("./components/SectionContents"));
|
15
15
|
function TemplateB() {
|
@@ -20,8 +20,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
21
21
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
22
22
|
var react_1 = require("react");
|
23
|
-
var Section_1 = require("
|
24
|
-
var components_1 = require("
|
23
|
+
var Section_1 = require("@sub/DynamicLayout/components/Section");
|
24
|
+
var components_1 = require("@sub/DynamicLayout/sections/MembershipSection/components");
|
25
25
|
var styled_components_1 = __importDefault(require("styled-components"));
|
26
26
|
function SectionContents() {
|
27
27
|
var section = (0, react_1.useContext)(Section_1.sectionContext);
|
@@ -9,7 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
10
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
11
11
|
var react_1 = require("react");
|
12
|
-
var dynamicLayoutContext_1 = require("
|
12
|
+
var dynamicLayoutContext_1 = require("@sub/DynamicLayout/dynamicLayoutContext");
|
13
13
|
var styled_components_1 = __importDefault(require("styled-components"));
|
14
14
|
var SectionContents_1 = __importDefault(require("./components/SectionContents"));
|
15
15
|
function TemplateB() {
|
@@ -20,8 +20,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
21
21
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
22
22
|
var react_1 = require("react");
|
23
|
-
var Section_1 = require("
|
24
|
-
var components_1 = require("
|
23
|
+
var Section_1 = require("@sub/DynamicLayout/components/Section");
|
24
|
+
var components_1 = require("@sub/DynamicLayout/sections/MembershipSection/components");
|
25
25
|
var styled_components_1 = __importDefault(require("styled-components"));
|
26
26
|
function SectionContents() {
|
27
27
|
var section = (0, react_1.useContext)(Section_1.sectionContext);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type { FillIconNameKeys, LineIconNameKeys } from '
|
3
|
-
import type { TextLabelProps } from '
|
4
|
-
import type { IItemButton, IItemDescription, IItemTitle, IMembershipCardTemplate } from '
|
2
|
+
import type { FillIconNameKeys, LineIconNameKeys } from '@sub/DynamicLayout/components/pdsOriginal/common';
|
3
|
+
import type { TextLabelProps } from '@sub/DynamicLayout/components/pdsOriginal/desktop/TextLabel/TextLabel';
|
4
|
+
import type { IItemButton, IItemDescription, IItemTitle, IMembershipCardTemplate } from '@sub/DynamicLayout/types';
|
5
5
|
declare function MembershipSectionItem(): JSX.Element;
|
6
6
|
declare namespace MembershipSectionItem {
|
7
7
|
var Title: ({ text, color, lineHeight, ...textLabelProps }: IItemTitle & TextLabelProps & {
|
@@ -51,8 +51,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
51
51
|
Object.defineProperty(exports, "__esModule", { value: true });
|
52
52
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
53
53
|
var react_1 = require("react");
|
54
|
-
var pdsOriginal_1 = require("
|
55
|
-
var dynamicLayoutContext_1 = require("
|
54
|
+
var pdsOriginal_1 = require("@sub/DynamicLayout/components/pdsOriginal");
|
55
|
+
var dynamicLayoutContext_1 = require("@sub/DynamicLayout/dynamicLayoutContext");
|
56
56
|
var styled_components_1 = __importStar(require("styled-components"));
|
57
57
|
var constants_1 = require("../../constants");
|
58
58
|
function MembershipSectionItem() {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type { FillIconNameKeys, LineIconNameKeys } from '
|
3
|
-
import type { TextLabelProps } from '
|
4
|
-
import type { IItemButton, IItemDescription, IItemTitle, IMembershipCardTemplate } from '
|
2
|
+
import type { FillIconNameKeys, LineIconNameKeys } from '@sub/DynamicLayout/components/pdsOriginal/common';
|
3
|
+
import type { TextLabelProps } from '@sub/DynamicLayout/components/pdsOriginal/desktop/TextLabel/TextLabel';
|
4
|
+
import type { IItemButton, IItemDescription, IItemTitle, IMembershipCardTemplate } from '@sub/DynamicLayout/types';
|
5
5
|
declare function MembershipSectionItem(): JSX.Element;
|
6
6
|
declare namespace MembershipSectionItem {
|
7
7
|
var Title: ({ text, color, lineHeight, ...textLabelProps }: IItemTitle & TextLabelProps & {
|
@@ -51,8 +51,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
51
51
|
Object.defineProperty(exports, "__esModule", { value: true });
|
52
52
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
53
53
|
var react_1 = require("react");
|
54
|
-
var pdsOriginal_1 = require("
|
55
|
-
var dynamicLayoutContext_1 = require("
|
54
|
+
var pdsOriginal_1 = require("@sub/DynamicLayout/components/pdsOriginal");
|
55
|
+
var dynamicLayoutContext_1 = require("@sub/DynamicLayout/dynamicLayoutContext");
|
56
56
|
var styled_components_1 = __importStar(require("styled-components"));
|
57
57
|
var constants_1 = require("../../constants");
|
58
58
|
function MembershipSectionItem() {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { TypeOfMembershipSectionToneColor } from './type';
|
2
|
-
import type { SubscriptionProductType, TypeOfItemToneType, TypeOfProgrammedItemActionButtonTextType } from '
|
2
|
+
import type { SubscriptionProductType, TypeOfItemToneType, TypeOfProgrammedItemActionButtonTextType } from '@sub/DynamicLayout/types';
|
3
3
|
export declare const MEMBERSHIP_SECTION_PREVIEW_WIDTH = 375;
|
4
4
|
export declare const COMMON_OVERLAY_IMAGE_SRC = "https://static.publ.site/membership_card_deco.png";
|
5
5
|
export declare const MEMBERSHIP_SECTION_TONE_COLOR: {
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { FontResponse, PublHeaders, SandollFontsQueryParams } from './types';
|
2
|
+
export declare const DEFAULT_PAGINATION: {
|
3
|
+
page: number;
|
4
|
+
limit: number;
|
5
|
+
};
|
6
|
+
export declare const DEFAULT_FILTER: {
|
7
|
+
sort: string;
|
8
|
+
order: string;
|
9
|
+
};
|
10
|
+
export declare const DEFAULT_SEARCHQUERY: {
|
11
|
+
usecase: string;
|
12
|
+
searchTerm: string;
|
13
|
+
};
|
14
|
+
export declare function fetchSandollFonts(baseURL: string, searchParams: SandollFontsQueryParams, publHeaders: PublHeaders): Promise<FontResponse>;
|
@@ -0,0 +1,77 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
15
|
+
function step(op) {
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
20
|
+
switch (op[0]) {
|
21
|
+
case 0: case 1: t = op; break;
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
25
|
+
default:
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
30
|
+
if (t[2]) _.ops.pop();
|
31
|
+
_.trys.pop(); continue;
|
32
|
+
}
|
33
|
+
op = body.call(thisArg, _);
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
36
|
+
}
|
37
|
+
};
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
39
|
+
exports.fetchSandollFonts = exports.DEFAULT_SEARCHQUERY = exports.DEFAULT_FILTER = exports.DEFAULT_PAGINATION = void 0;
|
40
|
+
exports.DEFAULT_PAGINATION = { page: 1, limit: 100 };
|
41
|
+
exports.DEFAULT_FILTER = { sort: 'trending', order: 'ASC' };
|
42
|
+
exports.DEFAULT_SEARCHQUERY = { usecase: 'EDITOR', searchTerm: '' };
|
43
|
+
function fetchSandollFonts(baseURL, searchParams, publHeaders) {
|
44
|
+
return __awaiter(this, void 0, void 0, function () {
|
45
|
+
var url, searchQuery, pagination, filter, response;
|
46
|
+
return __generator(this, function (_a) {
|
47
|
+
switch (_a.label) {
|
48
|
+
case 0:
|
49
|
+
url = new URL('/seller/api/v2/channel-management/font-manager/sandoll/available-fonts', baseURL);
|
50
|
+
searchQuery = searchParams.searchQuery, pagination = searchParams.pagination, filter = searchParams.filter;
|
51
|
+
// Set query parameters
|
52
|
+
url.searchParams.append('usecase', searchQuery.usecase || 'EDITOR');
|
53
|
+
if (searchQuery.searchTerm) {
|
54
|
+
url.searchParams.append('searchTerm', searchQuery.searchTerm);
|
55
|
+
}
|
56
|
+
url.searchParams.append('page', pagination.page.toString());
|
57
|
+
url.searchParams.append('limit', pagination.limit.toString());
|
58
|
+
url.searchParams.append('sort', filter.sort);
|
59
|
+
url.searchParams.append('order', filter.order);
|
60
|
+
return [4 /*yield*/, fetch(url.toString(), {
|
61
|
+
method: 'GET',
|
62
|
+
headers: {
|
63
|
+
Authorization: "Bearer ".concat(publHeaders.channelToken),
|
64
|
+
'x-publ-channel-id': "".concat(publHeaders.channelId)
|
65
|
+
}
|
66
|
+
})];
|
67
|
+
case 1:
|
68
|
+
response = _a.sent();
|
69
|
+
if (!response.ok) {
|
70
|
+
throw new Error('Network response was not ok');
|
71
|
+
}
|
72
|
+
return [2 /*return*/, response.json()];
|
73
|
+
}
|
74
|
+
});
|
75
|
+
});
|
76
|
+
}
|
77
|
+
exports.fetchSandollFonts = fetchSandollFonts;
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import type { SANDOLL_CategoryType } from '../types';
|
2
|
+
export type Pagination = {
|
3
|
+
page: number;
|
4
|
+
limit: number;
|
5
|
+
};
|
6
|
+
export type Filter = {
|
7
|
+
sort: 'trending' | 'popularity' | 'date' | 'alpha';
|
8
|
+
order: 'ASC' | 'DESC';
|
9
|
+
};
|
10
|
+
export type SearchQuery = {
|
11
|
+
usecase?: 'EDITOR';
|
12
|
+
searchTerm?: string;
|
13
|
+
};
|
14
|
+
export type SandollFont = {
|
15
|
+
id: string;
|
16
|
+
distinctId: string;
|
17
|
+
fontEnumValue: string;
|
18
|
+
provider: string;
|
19
|
+
fontName: string;
|
20
|
+
fontFamilyName: string;
|
21
|
+
supportedWeights: number[];
|
22
|
+
providerFontId: string;
|
23
|
+
providerFontName: string;
|
24
|
+
providerFontFamilyId: string;
|
25
|
+
providerFontFamilyName: string;
|
26
|
+
providerCssInfoDict: CSSInfoDict;
|
27
|
+
};
|
28
|
+
export type CSSInfoDict = {
|
29
|
+
fontFamily: string;
|
30
|
+
fontWeight: number;
|
31
|
+
};
|
32
|
+
export type SupportedOptionMap = {};
|
33
|
+
export type FontResponse = {
|
34
|
+
data: {
|
35
|
+
availableFonts: SandollFont[];
|
36
|
+
supportedOptions: SupportedOptionMap;
|
37
|
+
pagination: Pagination;
|
38
|
+
};
|
39
|
+
};
|
40
|
+
export type SandollFontsQueryParams = {
|
41
|
+
pagination: Pagination;
|
42
|
+
searchQuery: SearchQuery;
|
43
|
+
filter: Filter;
|
44
|
+
categories: SANDOLL_CategoryType[];
|
45
|
+
};
|
46
|
+
export type PublHeaders = {
|
47
|
+
channelToken: string;
|
48
|
+
channelId: string;
|
49
|
+
};
|
@@ -12,7 +12,7 @@ exports.SANDOLL_SORT_OPTION_KEY_MAP = {
|
|
12
12
|
};
|
13
13
|
exports.SANDOLL_CATEGORIES = [
|
14
14
|
'serif',
|
15
|
-
'
|
15
|
+
'sans-serif',
|
16
16
|
'slab',
|
17
17
|
'blackLetter',
|
18
18
|
'deco',
|
@@ -22,12 +22,12 @@ exports.SANDOLL_CATEGORIES = [
|
|
22
22
|
];
|
23
23
|
// NOTE: remove as
|
24
24
|
exports.SANDOLL_CATEGORY_ICONS = {
|
25
|
-
serif: '
|
26
|
-
'
|
27
|
-
slab: '
|
28
|
-
round: '
|
29
|
-
script: '
|
30
|
-
deco: '
|
31
|
-
symbol: '
|
32
|
-
blackLetter: '
|
25
|
+
serif: 'ic_typeface_serif_20',
|
26
|
+
'sans-serif': 'ic_typeface_sans_serif_20',
|
27
|
+
slab: 'ic_typeface_slab_20',
|
28
|
+
round: 'ic_typeface_round_20',
|
29
|
+
script: 'ic_typeface_script_20',
|
30
|
+
deco: 'ic_typeface_deco_20',
|
31
|
+
symbol: 'ic_typeface_symbol_20',
|
32
|
+
blackLetter: 'ic_typeface_blackletter_20'
|
33
33
|
};
|
@@ -40,7 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
40
40
|
};
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
42
42
|
var react_1 = require("react");
|
43
|
-
var GoogleFontkit_1 = require("
|
43
|
+
var GoogleFontkit_1 = require("@sub/GoogleFontkit");
|
44
44
|
var delay_1 = __importDefault(require("../utils/delay"));
|
45
45
|
function SandollFontItem(_a) {
|
46
46
|
var font = _a.font, children = _a.children;
|
@@ -1,17 +1,18 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import
|
2
|
+
import { QueryParamDispatchFunction } from '../hooks/useQueryParamsReducer';
|
3
|
+
import type { PublHeaders, SandollFontsQueryParams } from '../api/types';
|
4
|
+
import type { SANDOLL_Font } from '../types';
|
3
5
|
type HeadlessProps = {
|
4
6
|
isLoading: boolean;
|
5
7
|
fonts: SANDOLL_Font[];
|
6
|
-
|
7
|
-
|
8
|
-
changeSort: (option: SANDOLL_SortOptionType) => void;
|
9
|
-
changeFilterOption: SANDOLL_ChangeFilterOptionHandler;
|
8
|
+
queryParams: SandollFontsQueryParams;
|
9
|
+
queryParamDispatch: QueryParamDispatchFunction;
|
10
10
|
};
|
11
11
|
type Props = {
|
12
|
-
|
13
|
-
|
12
|
+
baseURL: string;
|
13
|
+
defaultQueryParams?: SandollFontsQueryParams;
|
14
|
+
publHeaders: PublHeaders;
|
14
15
|
children: (args: HeadlessProps) => JSX.Element;
|
15
16
|
};
|
16
|
-
declare function
|
17
|
-
export default
|
17
|
+
declare function SandollFontsList({ baseURL, defaultQueryParams, publHeaders, children }: Props): JSX.Element;
|
18
|
+
export default SandollFontsList;
|
@@ -1,15 +1,4 @@
|
|
1
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
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
14
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
15
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -46,100 +35,40 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
47
36
|
}
|
48
37
|
};
|
49
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
50
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
51
|
-
};
|
52
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
53
39
|
var react_1 = require("react");
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
var
|
58
|
-
|
59
|
-
var
|
60
|
-
var
|
61
|
-
var _c = (0, react_1.useState)([]), fonts = _c[0], setFonts = _c[1];
|
62
|
-
var _d = (0, react_1.useState)({
|
63
|
-
searchQuery: '',
|
64
|
-
categories: DEFAULT_CATEGORIES
|
65
|
-
}), filterOptions = _d[0], setFilterOptions = _d[1];
|
40
|
+
var getSandollFonts_1 = require("../api/getSandollFonts");
|
41
|
+
var useQueryParamsReducer_1 = require("../hooks/useQueryParamsReducer");
|
42
|
+
function SandollFontsList(_a) {
|
43
|
+
var baseURL = _a.baseURL, _b = _a.defaultQueryParams, defaultQueryParams = _b === void 0 ? useQueryParamsReducer_1.DEFAULT_QUERY_PARAMS : _b, publHeaders = _a.publHeaders, children = _a.children;
|
44
|
+
var _c = (0, useQueryParamsReducer_1.useQueryParamsReducer)(defaultQueryParams), queryParams = _c[0], queryParamDispatch = _c[1];
|
45
|
+
var _d = (0, react_1.useState)(false), isLoading = _d[0], setIsLoading = _d[1];
|
46
|
+
var _e = (0, react_1.useState)([]), fonts = _e[0], setFonts = _e[1];
|
66
47
|
(0, react_1.useEffect)(function () {
|
67
|
-
function
|
48
|
+
function fetchFontsList() {
|
68
49
|
return __awaiter(this, void 0, void 0, function () {
|
69
|
-
var
|
50
|
+
var res;
|
70
51
|
return __generator(this, function (_a) {
|
71
52
|
switch (_a.label) {
|
72
53
|
case 0:
|
73
54
|
setIsLoading(true);
|
74
|
-
return [4 /*yield*/, (0,
|
55
|
+
return [4 /*yield*/, (0, getSandollFonts_1.fetchSandollFonts)(baseURL, queryParams, publHeaders)];
|
75
56
|
case 1:
|
76
|
-
_a.sent();
|
77
|
-
|
78
|
-
{ id: '1', family: 'sandoll-test-1', category: 'san-serif' },
|
79
|
-
{ id: '2', family: 'sandoll-test-2', category: 'deco' },
|
80
|
-
{ id: '3', family: 'sandoll-test-3', category: 'round' }
|
81
|
-
];
|
82
|
-
// const { items } = await getGoogleWebFonts({
|
83
|
-
// key: apiKey,
|
84
|
-
// sort
|
85
|
-
// });
|
86
|
-
setFonts(items);
|
57
|
+
res = _a.sent();
|
58
|
+
setFonts(res.data.availableFonts);
|
87
59
|
setIsLoading(false);
|
88
60
|
return [2 /*return*/];
|
89
61
|
}
|
90
62
|
});
|
91
63
|
});
|
92
64
|
}
|
93
|
-
|
94
|
-
}, [
|
95
|
-
function changeSort(sortOption) {
|
96
|
-
return __awaiter(this, void 0, void 0, function () {
|
97
|
-
var items;
|
98
|
-
return __generator(this, function (_a) {
|
99
|
-
switch (_a.label) {
|
100
|
-
case 0:
|
101
|
-
setIsLoading(true);
|
102
|
-
return [4 /*yield*/, (0, delay_1.default)(2000)];
|
103
|
-
case 1:
|
104
|
-
_a.sent();
|
105
|
-
items = [
|
106
|
-
{ id: '4', family: 'sandoll-test-4', category: 'san-serif' },
|
107
|
-
{ id: '5', family: 'sandoll-test-5', category: 'deco' },
|
108
|
-
{ id: '6', family: 'sandoll-test-6', category: 'round' }
|
109
|
-
];
|
110
|
-
setFonts(items);
|
111
|
-
return [2 /*return*/];
|
112
|
-
}
|
113
|
-
});
|
114
|
-
});
|
115
|
-
}
|
116
|
-
function changeFilterOption(arg) {
|
117
|
-
var name = arg.name, value = arg.value;
|
118
|
-
setFilterOptions(function (prev) {
|
119
|
-
var _a;
|
120
|
-
return (__assign(__assign({}, prev), (_a = {}, _a[name] = value, _a)));
|
121
|
-
});
|
122
|
-
}
|
123
|
-
var filteredFonts = fonts.filter(function (font) {
|
124
|
-
var categories = filterOptions.categories, searchQuery = filterOptions.searchQuery;
|
125
|
-
var isSelectedCategory = categories.includes(font.category);
|
126
|
-
var query = searchQuery.toLocaleLowerCase().trim();
|
127
|
-
var matchSearchQuery = font.family.toLocaleLowerCase().includes(query);
|
128
|
-
if (!matchSearchQuery) {
|
129
|
-
return false;
|
130
|
-
}
|
131
|
-
if (isSelectedCategory) {
|
132
|
-
return true;
|
133
|
-
}
|
134
|
-
return false;
|
135
|
-
});
|
65
|
+
fetchFontsList();
|
66
|
+
}, [baseURL, queryParams, publHeaders]);
|
136
67
|
return children({
|
137
68
|
isLoading: isLoading,
|
138
69
|
fonts: fonts,
|
139
|
-
|
140
|
-
|
141
|
-
changeSort: changeSort,
|
142
|
-
changeFilterOption: changeFilterOption
|
70
|
+
queryParams: queryParams,
|
71
|
+
queryParamDispatch: queryParamDispatch
|
143
72
|
});
|
144
73
|
}
|
145
|
-
exports.default =
|
74
|
+
exports.default = SandollFontsList;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { Dispatch } from 'react';
|
2
|
+
import type { SandollFontsQueryParams } from '../api/types';
|
3
|
+
import type { SANDOLL_CategoryType } from '../types';
|
4
|
+
type Filter = {
|
5
|
+
sort: 'trending' | 'popularity' | 'date' | 'alpha';
|
6
|
+
order: 'ASC' | 'DESC';
|
7
|
+
};
|
8
|
+
type Action = {
|
9
|
+
type: 'SET_PAGE';
|
10
|
+
payload: number;
|
11
|
+
} | {
|
12
|
+
type: 'SET_LIMIT';
|
13
|
+
payload: number;
|
14
|
+
} | {
|
15
|
+
type: 'SET_SEARCH_TERM';
|
16
|
+
payload: string;
|
17
|
+
} | {
|
18
|
+
type: 'SET_SORT';
|
19
|
+
payload: Filter['sort'];
|
20
|
+
} | {
|
21
|
+
type: 'SET_ORDER';
|
22
|
+
payload: Filter['order'];
|
23
|
+
} | {
|
24
|
+
type: 'TOGGLE_CATEGORIES';
|
25
|
+
payload: SANDOLL_CategoryType;
|
26
|
+
};
|
27
|
+
export type QueryParamDispatchFunction = Dispatch<Action>;
|
28
|
+
export declare const DEFAULT_QUERY_PARAMS: SandollFontsQueryParams;
|
29
|
+
export declare function useQueryParamsReducer(initialQueryParams: SandollFontsQueryParams): [SandollFontsQueryParams, Dispatch<Action>];
|
30
|
+
export {};
|
@@ -0,0 +1,69 @@
|
|
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
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
15
|
+
if (ar || !(i in from)) {
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
17
|
+
ar[i] = from[i];
|
18
|
+
}
|
19
|
+
}
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
21
|
+
};
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
23
|
+
exports.useQueryParamsReducer = exports.DEFAULT_QUERY_PARAMS = void 0;
|
24
|
+
var react_1 = require("react");
|
25
|
+
// Initial state
|
26
|
+
exports.DEFAULT_QUERY_PARAMS = {
|
27
|
+
pagination: {
|
28
|
+
page: 1,
|
29
|
+
limit: 100
|
30
|
+
},
|
31
|
+
searchQuery: {
|
32
|
+
usecase: 'EDITOR',
|
33
|
+
searchTerm: ''
|
34
|
+
},
|
35
|
+
filter: {
|
36
|
+
sort: 'date',
|
37
|
+
order: 'ASC'
|
38
|
+
},
|
39
|
+
categories: ['sans-serif']
|
40
|
+
};
|
41
|
+
// Reducer function
|
42
|
+
function queryParamsReducer(state, action) {
|
43
|
+
switch (action.type) {
|
44
|
+
case 'SET_PAGE':
|
45
|
+
return __assign(__assign({}, state), { pagination: __assign(__assign({}, state.pagination), { page: action.payload }) });
|
46
|
+
case 'SET_LIMIT':
|
47
|
+
return __assign(__assign({}, state), { pagination: __assign(__assign({}, state.pagination), { limit: action.payload }) });
|
48
|
+
case 'SET_SEARCH_TERM':
|
49
|
+
return __assign(__assign({}, state), { searchQuery: __assign(__assign({}, state.searchQuery), { searchTerm: action.payload }) });
|
50
|
+
case 'SET_SORT':
|
51
|
+
return __assign(__assign({}, state), { filter: __assign(__assign({}, state.filter), { sort: action.payload }) });
|
52
|
+
case 'SET_ORDER':
|
53
|
+
return __assign(__assign({}, state), { filter: __assign(__assign({}, state.filter), { order: action.payload }) });
|
54
|
+
case 'TOGGLE_CATEGORIES': {
|
55
|
+
var category_1 = action.payload;
|
56
|
+
var categories = state.categories.includes(category_1)
|
57
|
+
? state.categories.filter(function (c) { return c !== category_1; })
|
58
|
+
: __spreadArray(__spreadArray([], state.categories, true), [category_1], false);
|
59
|
+
return __assign(__assign({}, state), { categories: categories });
|
60
|
+
}
|
61
|
+
default:
|
62
|
+
return state;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
// Usage of useReducer with the defined reducer and initial state
|
66
|
+
function useQueryParamsReducer(initialQueryParams) {
|
67
|
+
return (0, react_1.useReducer)(queryParamsReducer, initialQueryParams);
|
68
|
+
}
|
69
|
+
exports.useQueryParamsReducer = useQueryParamsReducer;
|