pds-dev-kit-web-test 0.2.52 → 0.2.54
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/sub/DynamicLayout/pagesPreviewMock.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +3 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +3 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGoogleFonts/getGoogleFonts.d.ts +4 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGoogleFonts/getGoogleFonts.js +25 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGoogleFonts/index.d.ts +2 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGoogleFonts/index.js +11 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/{components/ComponentBlock/componentBlocks/Text → hooks/useGoogleFonts}/useGoogleFonts.js +1 -1
- package/dist/src/sub/GoogleFontkit/headless/GoogleFontsList.js +20 -14
- package/dist/src/sub/GoogleFontkit/types.d.ts +1 -1
- package/dist/src/sub/GoogleFontkit/utils/callGoogleFontCSSAndApply.js +1 -1
- package/package.json +1 -1
- package/release-note.md +3 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/getGoogleFonts.d.ts +0 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/getGoogleFonts.js +0 -13
- /package/dist/src/sub/DynamicLayout/sections/CustomSection/{components/ComponentBlock/componentBlocks/Text → hooks/useGoogleFonts}/useGoogleFonts.d.ts +0 -0
|
@@ -270,7 +270,7 @@ exports.pages0803PreviewSections = [
|
|
|
270
270
|
'CB_STYLE_PROP_BTNTEXT_SPEC_SIZE:HOVER': 16,
|
|
271
271
|
'CB_STYLE_PROP_BTNTEXT_SPEC_SIZE:MOBILE': null,
|
|
272
272
|
'CB_STYLE_PROP_BTNTEXT_SPEC_SIZE:MOBILE:HOVER': null,
|
|
273
|
-
CB_STYLE_PROP_BTNTEXT_SPEC_TYPEFACE: '
|
|
273
|
+
CB_STYLE_PROP_BTNTEXT_SPEC_TYPEFACE: 'GOOGLE:Cherry Bomb One',
|
|
274
274
|
'CB_STYLE_PROP_BTNTEXT_SPEC_TYPEFACE:HOVER': 'PRETENDARD',
|
|
275
275
|
'CB_STYLE_PROP_BTNTEXT_SPEC_TYPEFACE:MOBILE': null,
|
|
276
276
|
'CB_STYLE_PROP_BTNTEXT_SPEC_TYPEFACE:MOBILE:HOVER': null,
|
|
@@ -30,6 +30,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
30
30
|
var react_1 = require("react");
|
|
31
31
|
var DynamicLayout_1 = require("../../../../../../../DynamicLayout");
|
|
32
32
|
var hooks_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/hooks");
|
|
33
|
+
var useGoogleFonts_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/hooks/useGoogleFonts");
|
|
33
34
|
var newUtils_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/newUtils");
|
|
34
35
|
var colorUtil_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/newUtils/colorUtil");
|
|
35
36
|
var util_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/util");
|
|
@@ -50,6 +51,8 @@ function Button(props) {
|
|
|
50
51
|
var _e = getBTNColorStyles(CB_STYLE_PROP_BTNCOLOR, device), btnColorStyle = _e.style, btnColorHoverStyle = _e.hoverStyle;
|
|
51
52
|
var _f = (0, util_1.parseProperties)(props, device), propsStyle = _f.style, propsHoverStyle = _f.hoverStyle, _g = _f.layout, paddingLeft = _g.paddingLeft, paddingRight = _g.paddingRight, paddingTop = _g.paddingTop, paddingBottom = _g.paddingBottom, layoutStyle = __rest(_g, ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"]), effect = _f.effect;
|
|
52
53
|
var isEditModeAndHidden = propsStyle.visibility === 'hidden' && mode === 'EDIT';
|
|
54
|
+
var googleFonts = (0, useGoogleFonts_1.getGoogleFontsFromBtnCB)(props.CB_STYLE_PROP_BTNTEXT, device === 'MOBILE');
|
|
55
|
+
(0, useGoogleFonts_1.useGoogleFonts)({ fonts: googleFonts });
|
|
53
56
|
if (mode === 'EDIT') {
|
|
54
57
|
propsStyle.visibility = 'visible';
|
|
55
58
|
}
|
|
@@ -19,14 +19,14 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
19
19
|
var react_1 = require("react");
|
|
20
20
|
var DynamicLayout_1 = require("../../../../../../../DynamicLayout");
|
|
21
21
|
var hooks_1 = require("../../../../hooks");
|
|
22
|
+
var getGoogleFonts_1 = require("../../../../hooks/useGoogleFonts/getGoogleFonts");
|
|
23
|
+
var useGoogleFonts_1 = __importDefault(require("../../../../hooks/useGoogleFonts/useGoogleFonts"));
|
|
22
24
|
var textUtil_1 = require("../../../../newUtils/textUtil");
|
|
23
25
|
var util_1 = require("../../../../util");
|
|
24
26
|
var S_CB_AnimationObserverBox_1 = require("../components/S_CB_AnimationObserverBox");
|
|
25
27
|
var S_CB_Box_1 = require("../components/S_CB_Box");
|
|
26
28
|
var S_HiddenCover_1 = require("../components/S_HiddenCover");
|
|
27
29
|
var useCLINK_1 = __importDefault(require("../hooks/useCLINK"));
|
|
28
|
-
var getGoogleFonts_1 = __importDefault(require("./getGoogleFonts"));
|
|
29
|
-
var useGoogleFonts_1 = __importDefault(require("./useGoogleFonts"));
|
|
30
30
|
function Text(props) {
|
|
31
31
|
var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
|
|
32
32
|
var _b = props.CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CLINK_SPEC_SRC = _b.CB_CONTENT_PROP_CLINK_SPEC_SRC, CB_CONTENT_PROP_CLINK_SPEC_TYPE = _b.CB_CONTENT_PROP_CLINK_SPEC_TYPE, CB_CONTENT_PROP_CLINK_SPEC_NEWTAB = _b.CB_CONTENT_PROP_CLINK_SPEC_NEWTAB, CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC = _b.CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM;
|
|
@@ -39,7 +39,7 @@ function Text(props) {
|
|
|
39
39
|
var _d = getTextStyles(props.CB_STYLE_PROP_TEXT, device), textStyle = _d.style, textHoverStyle = _d.hoverStyle;
|
|
40
40
|
var _e = (0, util_1.parseProperties)(props, device), propsStyle = _e.style, propsHoverStyle = _e.hoverStyle, layoutStyle = _e.layout, effect = _e.effect;
|
|
41
41
|
var isEditModeAndHidden = propsStyle.visibility === 'hidden' && mode === 'EDIT';
|
|
42
|
-
var googleFonts = (0, getGoogleFonts_1.
|
|
42
|
+
var googleFonts = (0, getGoogleFonts_1.getGoogleFontsFromTextCB)(props.CB_STYLE_PROP_TEXT, device === 'MOBILE');
|
|
43
43
|
(0, useGoogleFonts_1.default)({ fonts: googleFonts });
|
|
44
44
|
if (mode === 'EDIT') {
|
|
45
45
|
propsStyle.visibility = 'visible';
|
package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGoogleFonts/getGoogleFonts.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CB_BTNTEXT_STYLE_PROPS } from '../../components/ComponentBlock/componentBlocks/Button/btnTypes';
|
|
2
|
+
import type { CB_STYLE_PROP_TEXT_SPECS } from '../../components/ComponentBlock/componentBlocks/Text/types';
|
|
3
|
+
export declare function getGoogleFontsFromTextCB(props: CB_STYLE_PROP_TEXT_SPECS, isMobile: boolean): string[];
|
|
4
|
+
export declare function getGoogleFontsFromBtnCB(props: CB_BTNTEXT_STYLE_PROPS, isMobile: boolean): string[];
|
package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGoogleFonts/getGoogleFonts.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGoogleFontsFromBtnCB = exports.getGoogleFontsFromTextCB = void 0;
|
|
4
|
+
function getGoogleFontsFromTextCB(props, isMobile) {
|
|
5
|
+
var typeface = props.CB_STYLE_PROP_TEXT_SPEC_TYPEFACE;
|
|
6
|
+
var typefaceHover = props['CB_STYLE_PROP_TEXT_SPEC_TYPEFACE:HOVER'];
|
|
7
|
+
var typefaceMobile = props['CB_STYLE_PROP_TEXT_SPEC_TYPEFACE:MOBILE'];
|
|
8
|
+
var typefaceMobileHover = props['CB_STYLE_PROP_TEXT_SPEC_TYPEFACE:MOBILE:HOVER'];
|
|
9
|
+
if (isMobile) {
|
|
10
|
+
return [typefaceMobile, typefaceMobileHover].filter(function (each) { return each && each.startsWith('GOOGLE:'); });
|
|
11
|
+
}
|
|
12
|
+
return [typeface, typefaceHover].filter(function (each) { return each && each.startsWith('GOOGLE:'); });
|
|
13
|
+
}
|
|
14
|
+
exports.getGoogleFontsFromTextCB = getGoogleFontsFromTextCB;
|
|
15
|
+
function getGoogleFontsFromBtnCB(props, isMobile) {
|
|
16
|
+
var typeface = props.CB_STYLE_PROP_BTNTEXT_SPEC_TYPEFACE;
|
|
17
|
+
var typefaceHover = props['CB_STYLE_PROP_BTNTEXT_SPEC_TYPEFACE:HOVER'];
|
|
18
|
+
var typefaceMobile = props['CB_STYLE_PROP_BTNTEXT_SPEC_TYPEFACE:MOBILE'];
|
|
19
|
+
var typefaceMobileHover = props['CB_STYLE_PROP_BTNTEXT_SPEC_TYPEFACE:MOBILE:HOVER'];
|
|
20
|
+
if (isMobile) {
|
|
21
|
+
return [typefaceMobile, typefaceMobileHover].filter(function (each) { return each && each.startsWith('GOOGLE:'); });
|
|
22
|
+
}
|
|
23
|
+
return [typeface, typefaceHover].filter(function (each) { return each && each.startsWith('GOOGLE:'); });
|
|
24
|
+
}
|
|
25
|
+
exports.getGoogleFontsFromBtnCB = getGoogleFontsFromBtnCB;
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
exports.useGoogleFonts = exports.getGoogleFontsFromTextCB = exports.getGoogleFontsFromBtnCB = void 0;
|
|
7
|
+
var getGoogleFonts_1 = require("./getGoogleFonts");
|
|
8
|
+
Object.defineProperty(exports, "getGoogleFontsFromBtnCB", { enumerable: true, get: function () { return getGoogleFonts_1.getGoogleFontsFromBtnCB; } });
|
|
9
|
+
Object.defineProperty(exports, "getGoogleFontsFromTextCB", { enumerable: true, get: function () { return getGoogleFonts_1.getGoogleFontsFromTextCB; } });
|
|
10
|
+
var useGoogleFonts_1 = require("./useGoogleFonts");
|
|
11
|
+
Object.defineProperty(exports, "useGoogleFonts", { enumerable: true, get: function () { return __importDefault(useGoogleFonts_1).default; } });
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
var react_1 = require("react");
|
|
7
|
-
var callGoogleFontCSSAndApply_1 = __importDefault(require("
|
|
7
|
+
var callGoogleFontCSSAndApply_1 = __importDefault(require("../../../../../GoogleFontkit/utils/callGoogleFontCSSAndApply"));
|
|
8
8
|
function useGoogleFonts(_a) {
|
|
9
9
|
var fonts = _a.fonts;
|
|
10
10
|
(0, react_1.useEffect)(function () {
|
|
@@ -50,6 +50,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
50
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
51
|
};
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
/* eslint-disable no-console */
|
|
53
54
|
var react_1 = require("react");
|
|
54
55
|
var getGoogleWebFonts_1 = __importDefault(require("../api/getGoogleWebFonts"));
|
|
55
56
|
var getFontId_1 = __importDefault(require("../utils/getFontId"));
|
|
@@ -96,21 +97,26 @@ function GoogleFontsList(_a) {
|
|
|
96
97
|
(0, react_1.useEffect)(function () {
|
|
97
98
|
function getFilteredFontsAsync() {
|
|
98
99
|
return new Promise(function (resolve) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
var
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
console.log('filter start (1)');
|
|
101
|
+
setTimeout(function () {
|
|
102
|
+
var filteredFonts = fonts.filter(function (font) {
|
|
103
|
+
var categories = filterOptions.categories, searchQuery = filterOptions.searchQuery, subsets = filterOptions.subsets;
|
|
104
|
+
var isSelectedCategory = categories.includes(font.category);
|
|
105
|
+
var query = searchQuery.toLocaleLowerCase().trim();
|
|
106
|
+
var matchSearchQuery = font.family.toLocaleLowerCase().includes(query);
|
|
107
|
+
if (!matchSearchQuery) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
var hasSomeScript = subsets.length > 0 ? font.subsets.some(function (subset) { return subsets.includes(subset); }) : true;
|
|
111
|
+
if (isSelectedCategory && hasSomeScript) {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
105
114
|
return false;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return false;
|
|
112
|
-
});
|
|
113
|
-
resolve(filteredFonts);
|
|
115
|
+
});
|
|
116
|
+
resolve(filteredFonts);
|
|
117
|
+
console.log('filter resolved (3)');
|
|
118
|
+
}, 0);
|
|
119
|
+
console.log('after filter (2)');
|
|
114
120
|
});
|
|
115
121
|
}
|
|
116
122
|
setIsLoading(true);
|
|
@@ -36,7 +36,7 @@ export type FilterOptionHandlerArgType = {
|
|
|
36
36
|
name: 'subsets';
|
|
37
37
|
value: Subset[];
|
|
38
38
|
};
|
|
39
|
-
export type ChangeFilterOptionHandler = (arg: FilterOptionHandlerArgType) => void;
|
|
39
|
+
export type ChangeFilterOptionHandler = (arg: FilterOptionHandlerArgType, setLoading?: boolean) => void;
|
|
40
40
|
export type FilterOptionType = {
|
|
41
41
|
searchQuery: string;
|
|
42
42
|
categories: Category[];
|
|
@@ -57,7 +57,7 @@ function callGoogleFontCSSAndApply(fontFamily) {
|
|
|
57
57
|
}
|
|
58
58
|
(0, createStyleSheet_1.default)(fontId, false);
|
|
59
59
|
return [4 /*yield*/, (0, getGoogleFontCss_1.default)({
|
|
60
|
-
family: "".concat(fontFamily, ":wght@100;200;300;500;700;800;900"),
|
|
60
|
+
family: "".concat(fontFamily, ":wght@100;200;300;400;500;700;800;900"),
|
|
61
61
|
'font-display': 'swap'
|
|
62
62
|
})];
|
|
63
63
|
case 1:
|
package/package.json
CHANGED
package/release-note.md
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function getGoogleFonts(props, isMobile) {
|
|
4
|
-
var typeface = props.CB_STYLE_PROP_TEXT_SPEC_TYPEFACE;
|
|
5
|
-
var typefaceHover = props['CB_STYLE_PROP_TEXT_SPEC_TYPEFACE:HOVER'];
|
|
6
|
-
var typefaceMobile = props['CB_STYLE_PROP_TEXT_SPEC_TYPEFACE:MOBILE'];
|
|
7
|
-
var typefaceMobileHover = props['CB_STYLE_PROP_TEXT_SPEC_TYPEFACE:MOBILE:HOVER'];
|
|
8
|
-
if (isMobile) {
|
|
9
|
-
return [typefaceMobile, typefaceMobileHover].filter(function (each) { return each && each.startsWith('GOOGLE:'); });
|
|
10
|
-
}
|
|
11
|
-
return [typeface, typefaceHover].filter(function (each) { return each && each.startsWith('GOOGLE:'); });
|
|
12
|
-
}
|
|
13
|
-
exports.default = getGoogleFonts;
|