pds-dev-kit-web-test 0.2.36 → 0.2.38

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.
Files changed (94) hide show
  1. package/README.md +2 -2
  2. package/dist/src/common/assets/icons/fill/LogoGoogle.d.ts +4 -0
  3. package/dist/src/common/assets/icons/fill/LogoGoogle.js +30 -0
  4. package/dist/src/common/assets/icons/fill/TypefaceSystem.d.ts +4 -0
  5. package/dist/src/common/assets/icons/fill/TypefaceSystem.js +30 -0
  6. package/dist/src/common/assets/icons/fill/index.d.ts +2 -0
  7. package/dist/src/common/assets/icons/fill/index.js +4 -0
  8. package/dist/src/common/assets/icons/line/LogoGoogle.d.ts +4 -0
  9. package/dist/src/common/assets/icons/line/LogoGoogle.js +30 -0
  10. package/dist/src/common/assets/icons/line/TypefaceSystem.d.ts +4 -0
  11. package/dist/src/common/assets/icons/line/TypefaceSystem.js +30 -0
  12. package/dist/src/common/assets/icons/line/index.d.ts +2 -0
  13. package/dist/src/common/assets/icons/line/index.js +4 -0
  14. package/dist/src/common/styles/colorSet/PaletteColor_Dark.json +2 -1
  15. package/dist/src/common/styles/colorSet/PaletteColor_light.json +2 -1
  16. package/dist/src/common/styles/colorSet/UIColor.json +3 -1
  17. package/dist/src/common/styles/colorSet/index.d.ts +349 -345
  18. package/dist/src/common/styles/colorSet/index.js +3 -3
  19. package/dist/src/common/styles/colorSet/ui-type.d.ts +2 -0
  20. package/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.js +4 -1
  21. package/dist/src/desktop/components/BasicChatListItem/BasicChatListItem.d.ts +4 -2
  22. package/dist/src/desktop/components/BasicChatListItem/BasicChatListItem.js +46 -15
  23. package/dist/src/desktop/components/BasicChatListItem/Popup.d.ts +1 -0
  24. package/dist/src/desktop/components/ChatBubbleListItem/ChatBubbleListItem.d.ts +3 -1
  25. package/dist/src/desktop/components/ChatBubbleListItem/ChatBubbleListItem.js +19 -3
  26. package/dist/src/desktop/components/ChatBubbleListItem/Popup.d.ts +1 -0
  27. package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.js +4 -1
  28. package/dist/src/mobile/components/BasicChatListItem/BasicChatListItem.d.ts +4 -2
  29. package/dist/src/mobile/components/BasicChatListItem/BasicChatListItem.js +59 -10
  30. package/dist/src/mobile/components/BasicChatListItem/Popup.d.ts +1 -0
  31. package/dist/src/mobile/components/ChatBubbleListItem/ChatBubbleListItem.d.ts +3 -1
  32. package/dist/src/mobile/components/ChatBubbleListItem/ChatBubbleListItem.js +21 -3
  33. package/dist/src/mobile/components/ChatBubbleListItem/Popup.d.ts +1 -0
  34. package/dist/src/mobile/components/ChatList/Body.js +1 -1
  35. package/dist/src/mobile/components/MobileHeaderBar/MobileHeaderBar.d.ts +3 -1
  36. package/dist/src/mobile/components/MobileHeaderBar/MobileHeaderBar.js +13 -11
  37. package/dist/src/mobile/components/MobileHeaderBar/utils.d.ts +12 -0
  38. package/dist/src/mobile/components/MobileHeaderBar/utils.js +22 -0
  39. package/dist/src/sub/DynamicLayout/DynamicLayout.d.ts +1 -1
  40. package/dist/src/sub/DynamicLayout/DynamicLayout.js +2 -3
  41. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/RichText/RichText.js +1 -1
  42. package/dist/src/sub/DynamicLayout/components/desktop/Item/Item.js +1 -1
  43. package/dist/src/sub/DynamicLayout/components/mobile/Item/Item.js +1 -1
  44. package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +12 -23
  45. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.js +1 -1
  46. package/dist/src/sub/DynamicLayout/types.d.ts +0 -4
  47. package/dist/src/sub/GoogleFontkit/GoogleFontApplyExample.d.ts +3 -0
  48. package/dist/src/sub/GoogleFontkit/GoogleFontApplyExample.js +93 -0
  49. package/dist/src/sub/GoogleFontkit/GoogleFontsListExample.d.ts +3 -0
  50. package/dist/src/sub/GoogleFontkit/GoogleFontsListExample.js +57 -0
  51. package/dist/src/sub/GoogleFontkit/api/getGoogleFontCss.d.ts +10 -0
  52. package/dist/src/sub/GoogleFontkit/api/getGoogleFontCss.js +53 -0
  53. package/dist/src/sub/GoogleFontkit/api/getGoogleFontDefaultText.d.ts +2 -0
  54. package/dist/src/sub/GoogleFontkit/api/getGoogleFontDefaultText.js +55 -0
  55. package/dist/src/sub/GoogleFontkit/api/getGoogleWebFonts.d.ts +10 -0
  56. package/dist/src/sub/GoogleFontkit/api/getGoogleWebFonts.js +53 -0
  57. package/dist/src/sub/GoogleFontkit/constants.d.ts +7 -0
  58. package/dist/src/sub/GoogleFontkit/constants.js +42 -0
  59. package/dist/src/sub/GoogleFontkit/headless/GoogleFontItem.d.ts +13 -0
  60. package/dist/src/sub/GoogleFontkit/headless/GoogleFontItem.js +107 -0
  61. package/dist/src/sub/GoogleFontkit/headless/GoogleFontsList.d.ts +17 -0
  62. package/dist/src/sub/GoogleFontkit/headless/GoogleFontsList.js +145 -0
  63. package/dist/src/sub/GoogleFontkit/hooks/useDebounce.d.ts +1 -0
  64. package/dist/src/sub/GoogleFontkit/hooks/useDebounce.js +14 -0
  65. package/dist/src/sub/GoogleFontkit/hooks/useIntersectionObserver.d.ts +6 -0
  66. package/dist/src/sub/GoogleFontkit/hooks/useIntersectionObserver.js +29 -0
  67. package/dist/src/sub/GoogleFontkit/index.d.ts +2 -0
  68. package/dist/src/sub/GoogleFontkit/index.js +10 -0
  69. package/dist/src/sub/GoogleFontkit/types.d.ts +44 -0
  70. package/dist/src/sub/GoogleFontkit/types.js +14 -0
  71. package/dist/src/sub/GoogleFontkit/utils/applyActiveFont.d.ts +5 -0
  72. package/dist/src/sub/GoogleFontkit/utils/applyActiveFont.js +15 -0
  73. package/dist/src/sub/GoogleFontkit/utils/callGoogleFontCSSAndApply.d.ts +2 -0
  74. package/dist/src/sub/GoogleFontkit/utils/callGoogleFontCSSAndApply.js +83 -0
  75. package/dist/src/sub/GoogleFontkit/utils/createStyleSheet.d.ts +4 -0
  76. package/dist/src/sub/GoogleFontkit/utils/createStyleSheet.js +13 -0
  77. package/dist/src/sub/GoogleFontkit/utils/extractFontStyles.d.ts +1 -0
  78. package/dist/src/sub/GoogleFontkit/utils/extractFontStyles.js +26 -0
  79. package/dist/src/sub/GoogleFontkit/utils/fillStyleSheet.d.ts +4 -0
  80. package/dist/src/sub/GoogleFontkit/utils/fillStyleSheet.js +17 -0
  81. package/dist/src/sub/GoogleFontkit/utils/getActiveFontStylesheet.d.ts +4 -0
  82. package/dist/src/sub/GoogleFontkit/utils/getActiveFontStylesheet.js +16 -0
  83. package/dist/src/sub/GoogleFontkit/utils/getFontId.d.ts +4 -0
  84. package/dist/src/sub/GoogleFontkit/utils/getFontId.js +9 -0
  85. package/dist/src/sub/GoogleFontkit/utils/getMatches.d.ts +1 -0
  86. package/dist/src/sub/GoogleFontkit/utils/getMatches.js +14 -0
  87. package/dist/src/sub/GoogleFontkit/utils/isStyleSheetExists.d.ts +4 -0
  88. package/dist/src/sub/GoogleFontkit/utils/isStyleSheetExists.js +15 -0
  89. package/dist/src/sub/GoogleFontkit/utils/parseFontVariants.d.ts +4 -0
  90. package/dist/src/sub/GoogleFontkit/utils/parseFontVariants.js +18 -0
  91. package/dist/src/sub/GoogleFontkit/utils/setStyleSheetType.d.ts +4 -0
  92. package/dist/src/sub/GoogleFontkit/utils/setStyleSheetType.js +18 -0
  93. package/package.json +1 -1
  94. package/release-note.md +3 -7
@@ -23,8 +23,10 @@ var styled_components_1 = __importDefault(require("styled-components"));
23
23
  var hybrid_1 = require("../../../hybrid");
24
24
  var IconButton_1 = require("../IconButton");
25
25
  var TextLabel_1 = require("../TextLabel");
26
+ var utils_1 = require("./utils");
26
27
  function MobileHeaderBar(_a) {
27
- var _b = _a.titleType, titleType = _b === void 0 ? 'text' : _b, titleText = _a.titleText, captionText = _a.captionText, _c = _a.leftBtnMode, leftBtnMode = _c === void 0 ? 'back' : _c, _d = _a.displayType, displayType = _d === void 0 ? 'none' : _d, iBtn1IconName = _a.iBtn1IconName, _e = _a.iBtn1IconFillType, iBtn1IconFillType = _e === void 0 ? 'line' : _e, _f = _a.iBtn1IconColorKey, iBtn1IconColorKey = _f === void 0 ? 'ui_cpnt_button_icon_enabled' : _f, iBtn2IconName = _a.iBtn2IconName, _g = _a.iBtn2IconFillType, iBtn2IconFillType = _g === void 0 ? 'line' : _g, _h = _a.iBtn2IconColorKey, iBtn2IconColorKey = _h === void 0 ? 'ui_cpnt_button_icon_enabled' : _h, _j = _a.dividerMode, dividerMode = _j === void 0 ? 'none' : _j, imageSrc = _a.imageSrc, _k = _a.iBtn1State, iBtn1State = _k === void 0 ? 'normal' : _k, _l = _a.iBtn1Type, iBtn1Type = _l === void 0 ? 'button' : _l, _m = _a.iBtn2State, iBtn2State = _m === void 0 ? 'normal' : _m, _o = _a.iBtn2Type, iBtn2Type = _o === void 0 ? 'button' : _o, onClickLeftBtn = _a.onClickLeftBtn, onClickIBtn1 = _a.onClickIBtn1, onClickIBtn2 = _a.onClickIBtn2;
28
+ var _b = _a.titleType, titleType = _b === void 0 ? 'text' : _b, titleText = _a.titleText, captionText = _a.captionText, _c = _a.leftBtnMode, leftBtnMode = _c === void 0 ? 'back' : _c, _d = _a.displayType, displayType = _d === void 0 ? 'none' : _d, iBtn1IconName = _a.iBtn1IconName, _e = _a.iBtn1IconFillType, iBtn1IconFillType = _e === void 0 ? 'line' : _e, iBtn1IconColorKey = _a.iBtn1IconColorKey, iBtn2IconName = _a.iBtn2IconName, _f = _a.iBtn2IconFillType, iBtn2IconFillType = _f === void 0 ? 'line' : _f, iBtn2IconColorKey = _a.iBtn2IconColorKey, _g = _a.dividerMode, dividerMode = _g === void 0 ? 'none' : _g, imageSrc = _a.imageSrc, _h = _a.iBtn1State, iBtn1State = _h === void 0 ? 'normal' : _h, _j = _a.iBtn1Type, iBtn1Type = _j === void 0 ? 'button' : _j, _k = _a.iBtn2State, iBtn2State = _k === void 0 ? 'normal' : _k, _l = _a.iBtn2Type, iBtn2Type = _l === void 0 ? 'button' : _l, _m = _a.colorTheme, colorTheme = _m === void 0 ? 'none' : _m, onClickLeftBtn = _a.onClickLeftBtn, onClickIBtn1 = _a.onClickIBtn1, onClickIBtn2 = _a.onClickIBtn2;
29
+ var _o = (0, utils_1.getOptionalColorTheme)(colorTheme), titleColor = _o.titleColor, captionColor = _o.captionColor, iconButtonIconColor = _o.iconButtonIconColor, baseColor = _o.baseColor, dividerColor = _o.dividerColor;
28
30
  var handleClickLeftBtn = function (e) {
29
31
  if (onClickLeftBtn) {
30
32
  onClickLeftBtn(e);
@@ -57,18 +59,18 @@ function MobileHeaderBar(_a) {
57
59
  if (!iconName) {
58
60
  return (0, jsx_runtime_1.jsx)("div", {});
59
61
  }
60
- return ((0, jsx_runtime_1.jsx)(S_LeftButtonBox, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { iconName: iconName, fillType: "fill", iconFillType: "line", baseSize: "large", iconSize: 24, shapeType: "rectangle", onClick: handleClickLeftBtn, iconColorKey: "ui_cpnt_button_icon_enabled", baseColorKey: "ui_cpnt_button_fill_base_transparent" }) }));
62
+ return ((0, jsx_runtime_1.jsx)(S_LeftButtonBox, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { iconName: iconName, fillType: "fill", iconFillType: "line", baseSize: "large", iconSize: 24, shapeType: "rectangle", onClick: handleClickLeftBtn, iconColorKey: iconButtonIconColor, baseColorKey: "ui_cpnt_button_fill_base_transparent" }) }));
61
63
  };
62
64
  var title = function () {
63
65
  switch (titleType) {
64
66
  case 'text': {
65
67
  if (captionText) {
66
- return ((0, jsx_runtime_1.jsxs)(S_CaptionTextBox, { children: [(0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a", spacingType: "height" }), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: titleText, colorTheme: "sysTextPrimary", styleTheme: "body2Bold", singleLineMode: "use", textAlign: "center", wordBreak: "break_all", ellipsisMode: "use", lineLimit: 1 }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_b", spacingType: "height" }), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: captionText, colorTheme: "sysTextTertiary", styleTheme: "caption2Regular", singleLineMode: "use", textAlign: "center", wordBreak: "break_all", ellipsisMode: "use", lineLimit: 1 })] }));
68
+ return ((0, jsx_runtime_1.jsxs)(S_CaptionTextBox, { children: [(0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a", spacingType: "height" }), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: titleText, colorTheme: titleColor, styleTheme: "body2Bold", singleLineMode: "use", textAlign: "center", wordBreak: "break_all", ellipsisMode: "use", lineLimit: 1 }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_b", spacingType: "height" }), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: captionText, colorTheme: captionColor, styleTheme: "caption2Regular", singleLineMode: "use", textAlign: "center", wordBreak: "break_all", ellipsisMode: "use", lineLimit: 1 })] }));
67
69
  }
68
- return ((0, jsx_runtime_1.jsx)(S_TextTypeBox, { children: (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: titleText, colorTheme: "sysTextPrimary", styleTheme: "body2Bold", singleLineMode: "use", textAlign: "center", wordBreak: "break_all", ellipsisMode: "use", lineLimit: 1 }) }));
70
+ return ((0, jsx_runtime_1.jsx)(S_TextTypeBox, { children: (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: titleText, colorTheme: titleColor, styleTheme: "body2Bold", singleLineMode: "use", textAlign: "center", wordBreak: "break_all", ellipsisMode: "use", lineLimit: 1 }) }));
69
71
  }
70
72
  case 'profile': {
71
- return ((0, jsx_runtime_1.jsxs)(S_ProfileWrapper, { children: [(0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_b" }), (0, jsx_runtime_1.jsx)(hybrid_1.ImageView, { src: imageSrc, shapeType: "circular", width: 40, ratio: "1_1", scaleType: "cover", borderMode: "use" }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a" }), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: titleText, colorTheme: "sysTextPrimary", styleTheme: "caption1Regular", singleLineMode: "use", wordBreak: "break_all", ellipsisMode: "use", lineLimit: 1 }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_d" })] }));
73
+ return ((0, jsx_runtime_1.jsxs)(S_ProfileWrapper, { children: [(0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_b" }), (0, jsx_runtime_1.jsx)(hybrid_1.ImageView, { src: imageSrc, shapeType: "circular", width: 40, ratio: "1_1", scaleType: "cover", borderMode: "use" }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a" }), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: titleText, colorTheme: titleColor, styleTheme: "caption1Regular", singleLineMode: "use", wordBreak: "break_all", ellipsisMode: "use", lineLimit: 1 }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_d" })] }));
72
74
  }
73
75
  case 'image': {
74
76
  return ((0, jsx_runtime_1.jsx)(hybrid_1.ImageView, { src: imageSrc, shapeType: "rectangle", height: 32, scaleType: "contain", width: 160 }));
@@ -79,19 +81,19 @@ function MobileHeaderBar(_a) {
79
81
  if (displayType === 'none') {
80
82
  return (0, jsx_runtime_1.jsx)("div", {});
81
83
  }
82
- return ((0, jsx_runtime_1.jsxs)(S_IBtnBox, { children: [displayType === 'ibtn_amount2' && iBtn2IconName && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { iconSize: 24, baseSize: "large", iconName: iBtn2IconName, fillType: "fill", onClick: handleClickIBtn2, iconFillType: iBtn2IconFillType, iconColorKey: iBtn2IconColorKey, baseColorKey: "ui_cpnt_button_fill_base_transparent", type: iBtn2Type, state: iBtn2State })), (displayType === 'ibtn_amount1' || displayType === 'ibtn_amount2') && iBtn1IconName && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { iconSize: 24, baseSize: "large", iconName: iBtn1IconName, fillType: "fill", onClick: handleClickIBtn1, iconFillType: iBtn1IconFillType, iconColorKey: iBtn1IconColorKey, baseColorKey: "ui_cpnt_button_fill_base_transparent", type: iBtn1Type, state: iBtn1State }))] }));
84
+ return ((0, jsx_runtime_1.jsxs)(S_IBtnBox, { children: [displayType === 'ibtn_amount2' && iBtn2IconName && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { iconSize: 24, baseSize: "large", iconName: iBtn2IconName, fillType: "fill", onClick: handleClickIBtn2, iconFillType: iBtn2IconFillType, iconColorKey: iBtn2IconColorKey !== null && iBtn2IconColorKey !== void 0 ? iBtn2IconColorKey : iconButtonIconColor, baseColorKey: "ui_cpnt_button_fill_base_transparent", type: iBtn2Type, state: iBtn2State })), (displayType === 'ibtn_amount1' || displayType === 'ibtn_amount2') && iBtn1IconName && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { iconSize: 24, baseSize: "large", iconName: iBtn1IconName, fillType: "fill", onClick: handleClickIBtn1, iconFillType: iBtn1IconFillType, iconColorKey: iBtn1IconColorKey !== null && iBtn1IconColorKey !== void 0 ? iBtn1IconColorKey : iconButtonIconColor, baseColorKey: "ui_cpnt_button_fill_base_transparent", type: iBtn1Type, state: iBtn1State }))] }));
83
85
  };
84
- return ((0, jsx_runtime_1.jsxs)(S_MobileHeaderBar, __assign({ "x-pds-name": "MobileHeaderBar", "x-pds-element-type": "component", "x-pds-device-type": "mobile", hasBorder: dividerMode === 'solid', hasCaptionText: (captionText === null || captionText === void 0 ? void 0 : captionText.toString) ? true : false, expand: titleType === 'profile' }, { children: [(0, jsx_runtime_1.jsxs)(S_ButtonWrapper, { children: [(titleType === 'profile' || captionText) && (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a" }), leftIcon()] }), displayType === 'ibtn_amount2' && (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_g", spacingType: "width" }), (0, jsx_runtime_1.jsx)(S_Title, { children: title() }), (0, jsx_runtime_1.jsxs)(S_ButtonWrapper, { children: [(titleType === 'profile' || captionText) && (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a" }), iBtn()] })] })));
86
+ return ((0, jsx_runtime_1.jsxs)(S_MobileHeaderBar, __assign({ "x-pds-name": "MobileHeaderBar", "x-pds-element-type": "component", "x-pds-device-type": "mobile", hasBorder: dividerMode === 'solid', borderColor: dividerColor, hasCaptionText: (captionText === null || captionText === void 0 ? void 0 : captionText.toString) ? true : false, expand: titleType === 'profile', baseColor: baseColor }, { children: [(0, jsx_runtime_1.jsxs)(S_ButtonWrapper, { children: [(titleType === 'profile' || captionText) && (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a" }), leftIcon()] }), displayType === 'ibtn_amount2' && (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_g", spacingType: "width" }), (0, jsx_runtime_1.jsx)(S_Title, { children: title() }), (0, jsx_runtime_1.jsxs)(S_ButtonWrapper, { children: [(titleType === 'profile' || captionText) && (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a" }), iBtn()] })] })));
85
87
  }
86
88
  var S_MobileHeaderBar = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: ", ";\n background-color: ", ";\n border-bottom: ", ";\n box-sizing: border-box;\n display: flex;\n height: ", ";\n justify-content: space-between;\n padding: 0 ", ";\n"], ["\n align-items: ", ";\n background-color: ", ";\n border-bottom: ", ";\n box-sizing: border-box;\n display: flex;\n height: ", ";\n justify-content: space-between;\n padding: 0 ", ";\n"])), function (_a) {
87
89
  var expand = _a.expand, hasCaptionText = _a.hasCaptionText;
88
90
  return expand || hasCaptionText ? 'flex-start' : 'center';
89
91
  }, function (_a) {
90
- var theme = _a.theme;
91
- return theme.ui_cpnt_headerbar_base_area;
92
+ var theme = _a.theme, baseColor = _a.baseColor;
93
+ return theme[baseColor];
92
94
  }, function (_a) {
93
- var hasBorder = _a.hasBorder, theme = _a.theme;
94
- return hasBorder && "1px solid ".concat(theme.ui_cpnt_divider);
95
+ var hasBorder = _a.hasBorder, theme = _a.theme, borderColor = _a.borderColor;
96
+ return hasBorder && "1px solid ".concat(theme[borderColor]);
95
97
  }, function (_a) {
96
98
  var expand = _a.expand, hasCaptionText = _a.hasCaptionText;
97
99
  return (expand || hasCaptionText ? 'auto' : '56px');
@@ -0,0 +1,12 @@
1
+ import type { TextStyleProps } from '../TextLabel/TextLabel';
2
+ import type { ColorTheme } from './MobileHeaderBar';
3
+ import type { UiColors } from '../../../common/index';
4
+ type MobileHeaderbarColorThemeType = {
5
+ titleColor: TextStyleProps['colorTheme'];
6
+ captionColor: TextStyleProps['colorTheme'];
7
+ iconButtonIconColor: UiColors;
8
+ baseColor: UiColors;
9
+ dividerColor: UiColors;
10
+ };
11
+ export declare function getOptionalColorTheme(colorTheme: ColorTheme): MobileHeaderbarColorThemeType;
12
+ export {};
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOptionalColorTheme = void 0;
4
+ function getOptionalColorTheme(colorTheme) {
5
+ if (colorTheme === 'transparent_white') {
6
+ return {
7
+ titleColor: 'sysTextWhite',
8
+ captionColor: 'sysTextWhite',
9
+ iconButtonIconColor: 'ui_cpnt_headerbar_icon_02',
10
+ baseColor: 'ui_cpnt_headerbar_base_area_transparent',
11
+ dividerColor: 'ui_cpnt_divider_white_opacity00'
12
+ };
13
+ }
14
+ return {
15
+ titleColor: 'sysTextPrimary',
16
+ captionColor: 'sysTextTertiary',
17
+ iconButtonIconColor: 'ui_cpnt_button_icon_enabled',
18
+ baseColor: 'ui_cpnt_headerbar_base_area',
19
+ dividerColor: 'ui_cpnt_divider'
20
+ };
21
+ }
22
+ exports.getOptionalColorTheme = getOptionalColorTheme;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { DynamicLayoutProps } from './types';
3
- declare function DynamicLayout({ device, mode, isPreview, sections, scrollDownTargetSectionId, editingSectionId, navigationHandler, sectionActionHandler, onClickEditSection, programmedSectionComponents, customGridRows }: DynamicLayoutProps): JSX.Element;
3
+ declare function DynamicLayout({ device, mode, isPreview, sections, scrollDownTargetSectionId, editingSectionId, navigationHandler, sectionActionHandler, onClickEditSection, programmedSectionComponents }: DynamicLayoutProps): JSX.Element;
4
4
  export default DynamicLayout;
@@ -25,7 +25,7 @@ var EditModeSectionMatcher_1 = require("./components/EditModeSectionMatcher");
25
25
  var SectionMatcher_1 = require("./components/SectionMatcher");
26
26
  var dynamicLayoutContext_1 = require("./dynamicLayoutContext");
27
27
  function DynamicLayout(_a) {
28
- var device = _a.device, _b = _a.mode, mode = _b === void 0 ? 'NORMAL' : _b, isPreview = _a.isPreview, sections = _a.sections, scrollDownTargetSectionId = _a.scrollDownTargetSectionId, editingSectionId = _a.editingSectionId, navigationHandler = _a.navigationHandler, sectionActionHandler = _a.sectionActionHandler, onClickEditSection = _a.onClickEditSection, programmedSectionComponents = _a.programmedSectionComponents, customGridRows = _a.customGridRows;
28
+ var device = _a.device, _b = _a.mode, mode = _b === void 0 ? 'NORMAL' : _b, isPreview = _a.isPreview, sections = _a.sections, scrollDownTargetSectionId = _a.scrollDownTargetSectionId, editingSectionId = _a.editingSectionId, navigationHandler = _a.navigationHandler, sectionActionHandler = _a.sectionActionHandler, onClickEditSection = _a.onClickEditSection, programmedSectionComponents = _a.programmedSectionComponents;
29
29
  var filteredSortedSection = __spreadArray([], sections, true).filter(function (section) { return section.display; })
30
30
  .sort(function (a, b) { return a.order - b.order; });
31
31
  var iframeSection = filteredSortedSection.find(function (section) { return section.manifest.schema === 'EXP_IFRAME' && section.display; });
@@ -36,8 +36,7 @@ function DynamicLayout(_a) {
36
36
  navigationHandler: navigationHandler,
37
37
  sectionActionHandler: sectionActionHandler,
38
38
  editingSectionId: editingSectionId,
39
- programmedSectionComponents: programmedSectionComponents,
40
- customGridRows: customGridRows
39
+ programmedSectionComponents: programmedSectionComponents
41
40
  } }, { children: [mode === 'EDIT' && onClickEditSection && ((0, jsx_runtime_1.jsx)(EditModeSectionMatcher_1.EditModeSectionMatcher, { editingSectionId: editingSectionId, scrollDownTargetSectionId: scrollDownTargetSectionId, filteredSortedSection: filteredSortedSection, onClickEditSection: onClickEditSection })), mode !== 'EDIT' &&
42
41
  (iframeSection ? ((0, jsx_runtime_1.jsx)(SectionMatcher_1.SectionMatcher, __assign({}, iframeSection), iframeSection.id)) : (filteredSortedSection.map(function (section) { return (0, jsx_runtime_1.jsx)(SectionMatcher_1.SectionMatcher, __assign({}, section), section.id); })))] })));
43
42
  }
@@ -13,7 +13,7 @@ function RichText(_a) {
13
13
  var text = _a.text;
14
14
  return (0, jsx_runtime_1.jsx)(S_RichText, { dangerouslySetInnerHTML: { __html: text } });
15
15
  }
16
- var S_RichText = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n line-height: 1.5;\n text-align: left;\n white-space: pre-wrap;\n width: 100%;\n word-break: break-word;\n\n a {\n color: ", ";\n }\n\n img {\n width: 100%;\n }\n\n figure {\n margin: 0;\n max-width: 100%;\n\n img {\n width: 100%;\n }\n }\n\n blockquote {\n border-left: 4px solid ", ";\n margin: 4px;\n padding: 4px;\n\n p {\n font-style: oblique;\n margin: 0;\n }\n }\n\n iframe {\n border: none;\n }\n"], ["\n line-height: 1.5;\n text-align: left;\n white-space: pre-wrap;\n width: 100%;\n word-break: break-word;\n\n a {\n color: ", ";\n }\n\n img {\n width: 100%;\n }\n\n figure {\n margin: 0;\n max-width: 100%;\n\n img {\n width: 100%;\n }\n }\n\n blockquote {\n border-left: 4px solid ", ";\n margin: 4px;\n padding: 4px;\n\n p {\n font-style: oblique;\n margin: 0;\n }\n }\n\n iframe {\n border: none;\n }\n"])), function (_a) {
16
+ var S_RichText = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n line-height: 1.5;\n text-align: left;\n white-space: pre-wrap;\n width: 100%;\n word-break: break-word;\n\n & pre {\n white-space: pre-wrap;\n }\n\n div,\n p {\n overflow: hidden;\n }\n\n a {\n color: ", ";\n }\n\n img {\n max-width: 100%;\n height: auto;\n }\n\n figure {\n margin: 0;\n max-width: 100%;\n\n img {\n max-width: 100%;\n height: auto;\n }\n }\n\n blockquote {\n border-left: 4px solid ", ";\n margin: 4px;\n padding: 4px;\n\n p {\n font-style: oblique;\n margin: 0;\n }\n }\n\n iframe {\n border: none;\n }\n"], ["\n line-height: 1.5;\n text-align: left;\n white-space: pre-wrap;\n width: 100%;\n word-break: break-word;\n\n & pre {\n white-space: pre-wrap;\n }\n\n div,\n p {\n overflow: hidden;\n }\n\n a {\n color: ", ";\n }\n\n img {\n max-width: 100%;\n height: auto;\n }\n\n figure {\n margin: 0;\n max-width: 100%;\n\n img {\n max-width: 100%;\n height: auto;\n }\n }\n\n blockquote {\n border-left: 4px solid ", ";\n margin: 4px;\n padding: 4px;\n\n p {\n font-style: oblique;\n margin: 0;\n }\n }\n\n iframe {\n border: none;\n }\n"])), function (_a) {
17
17
  var theme = _a.theme;
18
18
  return theme.ui_papp_post_notice_link;
19
19
  }, function (_a) {
@@ -185,7 +185,7 @@ function HTMLReader(_a) {
185
185
  }, [data]);
186
186
  return ((0, jsx_runtime_1.jsx)(S_Content, { ref: contentRef, styleTheme: styleTheme, colorTheme: colorTheme, color: color, textAlign: textAlign, isPreview: isPreview !== null && isPreview !== void 0 ? isPreview : mode === 'PREVIEW' }));
187
187
  }
188
- var S_Content = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n line-height: 1.5;\n text-align: ", ";\n white-space: pre-wrap;\n width: 100%;\n word-break: break-word;\n\n ", "\n\n a {\n color: ", ";\n }\n\n img {\n width: 100%;\n }\n\n figure {\n margin: 0;\n max-width: 100%;\n\n img {\n width: 100%;\n }\n }\n\n blockquote {\n border-left: 4px solid ", ";\n margin: 4px;\n padding: 4px;\n\n p {\n font-style: oblique;\n margin: 0;\n }\n }\n\n ", ";\n\n ", ";\n\n ", "\n"], ["\n color: ", ";\n line-height: 1.5;\n text-align: ", ";\n white-space: pre-wrap;\n width: 100%;\n word-break: break-word;\n\n ", "\n\n a {\n color: ", ";\n }\n\n img {\n width: 100%;\n }\n\n figure {\n margin: 0;\n max-width: 100%;\n\n img {\n width: 100%;\n }\n }\n\n blockquote {\n border-left: 4px solid ", ";\n margin: 4px;\n padding: 4px;\n\n p {\n font-style: oblique;\n margin: 0;\n }\n }\n\n ", ";\n\n ", ";\n\n ", "\n"])), function (_a) {
188
+ var S_Content = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n line-height: 1.5;\n text-align: ", ";\n white-space: pre-wrap;\n width: 100%;\n word-break: break-word;\n\n ", "\n\n & pre {\n white-space: pre-wrap;\n }\n\n div,\n p {\n overflow: hidden;\n }\n\n a {\n color: ", ";\n }\n\n img {\n max-width: 100%;\n height: auto;\n }\n\n figure {\n margin: 0;\n max-width: 100%;\n\n img {\n max-width: 100%;\n height: auto;\n }\n }\n\n blockquote {\n border-left: 4px solid ", ";\n margin: 4px;\n padding: 4px;\n\n p {\n font-style: oblique;\n margin: 0;\n }\n }\n\n iframe {\n border: none;\n }\n\n ", ";\n\n ", ";\n\n ", "\n"], ["\n color: ", ";\n line-height: 1.5;\n text-align: ", ";\n white-space: pre-wrap;\n width: 100%;\n word-break: break-word;\n\n ", "\n\n & pre {\n white-space: pre-wrap;\n }\n\n div,\n p {\n overflow: hidden;\n }\n\n a {\n color: ", ";\n }\n\n img {\n max-width: 100%;\n height: auto;\n }\n\n figure {\n margin: 0;\n max-width: 100%;\n\n img {\n max-width: 100%;\n height: auto;\n }\n }\n\n blockquote {\n border-left: 4px solid ", ";\n margin: 4px;\n padding: 4px;\n\n p {\n font-style: oblique;\n margin: 0;\n }\n }\n\n iframe {\n border: none;\n }\n\n ", ";\n\n ", ";\n\n ", "\n"])), function (_a) {
189
189
  var theme = _a.theme;
190
190
  return theme.ui_temp_grey_01;
191
191
  }, function (_a) {
@@ -182,7 +182,7 @@ function HTMLReader(_a) {
182
182
  }, [data]);
183
183
  return ((0, jsx_runtime_1.jsx)(S_Content, { ref: contentRef, styleTheme: styleTheme, colorTheme: colorTheme, color: color, textAlign: textAlign, isPreview: isPreview !== null && isPreview !== void 0 ? isPreview : mode === 'PREVIEW' }));
184
184
  }
185
- var S_Content = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n line-height: 1.5;\n text-align: ", ";\n white-space: pre-wrap;\n width: 100%;\n word-break: break-word;\n\n ", "\n\n a {\n color: ", ";\n }\n\n img {\n width: 100%;\n }\n\n figure {\n margin: 0;\n max-width: 100%;\n\n img {\n width: 100%;\n }\n }\n\n blockquote {\n border-left: 4px solid ", ";\n margin: 4px;\n padding: 4px;\n\n p {\n font-style: oblique;\n margin: 0;\n }\n }\n\n ", ";\n\n ", ";\n\n ", "\n"], ["\n color: ", ";\n line-height: 1.5;\n text-align: ", ";\n white-space: pre-wrap;\n width: 100%;\n word-break: break-word;\n\n ", "\n\n a {\n color: ", ";\n }\n\n img {\n width: 100%;\n }\n\n figure {\n margin: 0;\n max-width: 100%;\n\n img {\n width: 100%;\n }\n }\n\n blockquote {\n border-left: 4px solid ", ";\n margin: 4px;\n padding: 4px;\n\n p {\n font-style: oblique;\n margin: 0;\n }\n }\n\n ", ";\n\n ", ";\n\n ", "\n"])), function (_a) {
185
+ var S_Content = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n line-height: 1.5;\n text-align: ", ";\n white-space: pre-wrap;\n width: 100%;\n word-break: break-word;\n\n ", "\n\n & pre {\n white-space: pre-wrap;\n }\n\n div,\n p {\n overflow: hidden;\n }\n\n a {\n color: ", ";\n }\n\n img {\n max-width: 100%;\n height: auto;\n }\n\n figure {\n margin: 0;\n max-width: 100%;\n\n img {\n max-width: 100%;\n height: auto;\n }\n }\n\n blockquote {\n border-left: 4px solid ", ";\n margin: 4px;\n padding: 4px;\n\n p {\n font-style: oblique;\n margin: 0;\n }\n }\n\n iframe {\n border: none;\n }\n\n ", ";\n\n ", ";\n\n ", "\n"], ["\n color: ", ";\n line-height: 1.5;\n text-align: ", ";\n white-space: pre-wrap;\n width: 100%;\n word-break: break-word;\n\n ", "\n\n & pre {\n white-space: pre-wrap;\n }\n\n div,\n p {\n overflow: hidden;\n }\n\n a {\n color: ", ";\n }\n\n img {\n max-width: 100%;\n height: auto;\n }\n\n figure {\n margin: 0;\n max-width: 100%;\n\n img {\n max-width: 100%;\n height: auto;\n }\n }\n\n blockquote {\n border-left: 4px solid ", ";\n margin: 4px;\n padding: 4px;\n\n p {\n font-style: oblique;\n margin: 0;\n }\n }\n\n iframe {\n border: none;\n }\n\n ", ";\n\n ", ";\n\n ", "\n"])), function (_a) {
186
186
  var theme = _a.theme;
187
187
  return theme.ui_temp_grey_01;
188
188
  }, function (_a) {
@@ -53,9 +53,13 @@ var ComponentBlockMatcher_1 = __importDefault(require("./components/ComponentBlo
53
53
  var util_1 = require("./util");
54
54
  var parseSectionPadding_1 = __importDefault(require("./util/layoutPropParsers/parseSectionPadding"));
55
55
  var Responsive = (0, publ_echo_1.WidthProvider)(publ_echo_1.ResponsiveGridEditor);
56
- var GRID_CELL_MIN = 8;
56
+ var GRID_CELL_MIN = 24;
57
+ var DESKTOP_GRID_COLS = 24;
58
+ var MOBILE_GRID_COLS = 8;
59
+ var GLE_MIN_WIDTH_DESKTOP_PX = "".concat(GRID_CELL_MIN * DESKTOP_GRID_COLS, "px");
60
+ var GLE_MIN_WIDTH_MOBILE_PX = "".concat(GRID_CELL_MIN * MOBILE_GRID_COLS, "px");
57
61
  function CustomSection(props) {
58
- var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, editingSectionId = _a.editingSectionId, mode = _a.mode, sectionActionHandler = _a.sectionActionHandler, customGridRows = _a.customGridRows;
62
+ var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, editingSectionId = _a.editingSectionId, mode = _a.mode, sectionActionHandler = _a.sectionActionHandler;
59
63
  var componentBlocks = props.componentBlocks, jsonProperties = props.jsonProperties;
60
64
  var _b = jsonProperties, CB_PLACEMENT_PROP_SECTION = _b.CB_PLACEMENT_PROP_SECTION, CB_LAYOUT_PROP_PADDING = _b.CB_LAYOUT_PROP_PADDING, CB_CONTENT_PROP_SECTION = _b.CB_CONTENT_PROP_SECTION;
61
65
  var _c = (0, react_1.useState)(null), selectedCB = _c[0], setSelectedCB = _c[1];
@@ -64,19 +68,6 @@ function CustomSection(props) {
64
68
  var _e = (0, react_1.useState)(16), baseFontSize = _e[0], setBaseFontSize = _e[1];
65
69
  var isMobile = device === 'MOBILE';
66
70
  var isEditMode = mode === 'EDIT';
67
- var gridData = (0, react_1.useMemo)(function () {
68
- var _a, _b;
69
- var desktopCols = (_a = customGridRows === null || customGridRows === void 0 ? void 0 : customGridRows.lg) !== null && _a !== void 0 ? _a : 24;
70
- var mobileCols = (_b = customGridRows === null || customGridRows === void 0 ? void 0 : customGridRows.sm) !== null && _b !== void 0 ? _b : 8;
71
- var gleMinWidthDesktop = "".concat(GRID_CELL_MIN * desktopCols, "px");
72
- var gleMinWidthMobile = "".concat(GRID_CELL_MIN * mobileCols, "px");
73
- return {
74
- desktopCols: desktopCols,
75
- mobileCols: mobileCols,
76
- gleMinWidthDesktop: gleMinWidthDesktop,
77
- gleMinWidthMobile: gleMinWidthMobile
78
- };
79
- }, [customGridRows]);
80
71
  var _f = (0, react_1.useState)(function () {
81
72
  var _a = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : []), lg = _a.lg, sm = _a.sm;
82
73
  return {
@@ -179,15 +170,13 @@ function CustomSection(props) {
179
170
  // NOTE: local환경에서 CB_CONTENT_PROP_SECTION이 없는 경우가 있음.
180
171
  !!(CB_CONTENT_PROP_SECTION === null || CB_CONTENT_PROP_SECTION === void 0 ? void 0 : CB_CONTENT_PROP_SECTION.CB_CONTENT_PROP_SECTION_SPEC_VARIABLEROOTFONTSIZE);
181
172
  if (device === 'MOBILE') {
182
- var cellWidth_1 = width / gridData.mobileCols;
183
- // setRowHeight(cellWidth * 0.56);
184
- setRowHeight(cellWidth_1);
173
+ var cellWidth_1 = width / MOBILE_GRID_COLS;
174
+ setRowHeight(cellWidth_1 * 0.56);
185
175
  baseFontSize !== 16 && setBaseFontSize(16);
186
176
  return;
187
177
  }
188
- var cellWidth = width / gridData.desktopCols;
189
- // setRowHeight(cellWidth * 0.56);
190
- setRowHeight(cellWidth);
178
+ var cellWidth = width / DESKTOP_GRID_COLS;
179
+ setRowHeight(cellWidth * 0.56);
191
180
  responsiveFontMode ? setBaseFontSize(cellWidth / 2.35) : setBaseFontSize(16);
192
181
  };
193
182
  var padding = (0, parseSectionPadding_1.default)(CB_LAYOUT_PROP_PADDING, device);
@@ -198,9 +187,9 @@ function CustomSection(props) {
198
187
  paddingBottom: padding.bottom,
199
188
  paddingRight: padding.right,
200
189
  paddingLeft: padding.left
201
- } }, { children: (0, jsx_runtime_1.jsx)(Responsive, __assign({ allowOverlap: true, layouts: { lg: layouts.lg, sm: layouts.sm }, resizeHandles: ['nw', 'e', 'n', 'ne', 's', 'se', 'sw', 'w'], breakpoints: breakpoints, breakpoint: breakpoint, cols: { lg: gridData.desktopCols, sm: gridData.mobileCols }, rowHeight: rowHeight, margin: [0, 0], containerPadding: [0, 0], style: {
190
+ } }, { children: (0, jsx_runtime_1.jsx)(Responsive, __assign({ allowOverlap: true, layouts: { lg: layouts.lg, sm: layouts.sm }, resizeHandles: ['nw', 'e', 'n', 'ne', 's', 'se', 'sw', 'w'], breakpoints: breakpoints, breakpoint: breakpoint, cols: { lg: 24, sm: 8 }, rowHeight: rowHeight, margin: [10, 10], style: {
202
191
  width: customSectionStyles.width,
203
- minWidth: isMobile ? gridData.gleMinWidthMobile : gridData.gleMinWidthDesktop,
192
+ minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
204
193
  fontSize: "".concat(baseFontSize, "px")
205
194
  }, onLayoutChange: onLayoutChange, onDragStop: onDragStop, onResizeStop: onResizeStop, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode }, { children: (componentBlocks === null || componentBlocks === void 0 ? void 0 : componentBlocks.length) ? (componentBlocks.map(function (each) { return ((0, jsx_runtime_1.jsx)("div", __assign({ className: selectedCB === each.id ? 'react-grid-item-selected' : '' }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ style: {
206
195
  width: '100%',
@@ -172,7 +172,7 @@ function getFontName(value) {
172
172
  case 'SYSSERIF':
173
173
  return 'serif';
174
174
  case 'PRETENDARD':
175
- return 'Pretendard-Regular, sans-serif';
175
+ return 'Pretendard JP, sans-serif';
176
176
  default:
177
177
  return '';
178
178
  }
@@ -224,10 +224,6 @@ export type DynamicLayoutProps = {
224
224
  sectionActionHandler?: (action: TypeOfSectionAction) => void;
225
225
  programmedSectionComponents?: IProgrammedSectionComponents;
226
226
  width?: number;
227
- customGridRows?: {
228
- lg: number;
229
- sm: number;
230
- };
231
227
  };
232
228
  export type NavHandlerAction = {
233
229
  openNewTab: boolean;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare function GoogleFontApplyExample(): JSX.Element;
3
+ export default GoogleFontApplyExample;
@@ -0,0 +1,93 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var jsx_runtime_1 = require("react/jsx-runtime");
18
+ var react_1 = require("react");
19
+ var getGoogleFontDefaultText_1 = __importDefault(require("./api/getGoogleFontDefaultText"));
20
+ var callGoogleFontCSSAndApply_1 = __importDefault(require("./utils/callGoogleFontCSSAndApply"));
21
+ var GOOGLE_FONT_API_KEY = 'AIzaSyDvOkXcd-jqqD1z1P-RmIBM9RzGpEXRwV0';
22
+ function TextCB(_a) {
23
+ var text = _a.text, font = _a.font;
24
+ var _b = (0, react_1.useState)(text), defaultText = _b[0], setDefaultText = _b[1];
25
+ (0, react_1.useEffect)(function () {
26
+ (0, callGoogleFontCSSAndApply_1.default)(GOOGLE_FONT_API_KEY, font);
27
+ (0, getGoogleFontDefaultText_1.default)(font).then(function (data) {
28
+ setDefaultText(data.sampleText.tester);
29
+ });
30
+ }, [font]);
31
+ return (0, jsx_runtime_1.jsx)("div", __assign({ style: { fontFamily: font } }, { children: defaultText }));
32
+ }
33
+ function GoogleFontApplyExample() {
34
+ var texts = [
35
+ {
36
+ font: 'Dokdo',
37
+ text: 'Whereas disregard and contempt for human rights have resulted'
38
+ },
39
+ {
40
+ font: 'Open Sans',
41
+ text: 'Whereas disregard and contempt for human rights have resulted'
42
+ },
43
+ {
44
+ font: 'Poppins',
45
+ text: 'Whereas disregard and contempt for human rights have resulted'
46
+ },
47
+ {
48
+ font: 'Dokdo',
49
+ text: 'Whereas disregard and contempt for human rights have resulted'
50
+ },
51
+ {
52
+ font: 'Lato',
53
+ text: 'Whereas disregard and contempt for human rights have resulted'
54
+ },
55
+ {
56
+ font: 'Dokdo',
57
+ text: 'Whereas disregard and contempt for human rights have resulted'
58
+ },
59
+ {
60
+ font: 'Dokdo',
61
+ text: 'Whereas disregard and contempt for human rights have resulted'
62
+ },
63
+ {
64
+ font: 'Caveat',
65
+ text: 'Whereas disregard and contempt for human rights have resulted'
66
+ },
67
+ {
68
+ font: 'Dokdo',
69
+ text: 'Whereas disregard and contempt for human rights have resulted'
70
+ },
71
+ {
72
+ font: 'Material Icons Sharp',
73
+ text: 'Whereas disregard and contempt for human rights have resulted'
74
+ },
75
+ {
76
+ font: 'Material Symbols Rounded',
77
+ text: 'Whereas disregard and contempt for human rights have resulted'
78
+ },
79
+ {
80
+ font: 'Orbitron',
81
+ text: 'Whereas disregard and contempt for human rights have resulted'
82
+ },
83
+ {
84
+ font: 'Noto Color Emoji',
85
+ text: 'a'
86
+ },
87
+ { font: 'Noto Sans KR', test: '노토산스 한국어' },
88
+ { font: 'Noto Sans JP', test: '노토산스 일본어' },
89
+ { font: 'Noto Sans NKo Unjoined', text: '노토산스 외국어' }
90
+ ];
91
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: texts.map(function (group) { return ((0, jsx_runtime_1.jsx)(TextCB, { text: group.text, font: group.font }, group.font)); }) }));
92
+ }
93
+ exports.default = GoogleFontApplyExample;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare function GoogleFontsListExample(): JSX.Element;
3
+ export default GoogleFontsListExample;
@@ -0,0 +1,57 @@
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 styled_components_1 = __importDefault(require("styled-components"));
23
+ var constants_1 = require("./constants");
24
+ var GoogleFontItem_1 = __importDefault(require("./headless/GoogleFontItem"));
25
+ var GoogleFontsList_1 = __importDefault(require("./headless/GoogleFontsList"));
26
+ var GOOGLE_FONT_API_KEY = '문의바람';
27
+ function GoogleFontsListExample() {
28
+ return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(GoogleFontsList_1.default, __assign({ apiKey: GOOGLE_FONT_API_KEY, sort: "trending" }, { children: function (_a) {
29
+ var isLoading = _a.isLoading, filteredFonts = _a.filteredFonts, filterOptions = _a.filterOptions, changeSort = _a.changeSort, changeFilterOption = _a.changeFilterOption;
30
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(SFilters, { children: [(0, jsx_runtime_1.jsx)("button", __assign({ type: "button", onClick: function () { return changeSort('date'); } }, { children: "change sort" })), (0, jsx_runtime_1.jsx)("input", { type: "text", onChange: function (e) {
31
+ return changeFilterOption({
32
+ name: 'searchQuery',
33
+ value: e.target.value
34
+ });
35
+ } }), (0, jsx_runtime_1.jsx)("div", __assign({ style: { backgroundColor: 'yellow' } }, { children: constants_1.SUBSETS.map(function (eachSubset) {
36
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { children: eachSubset }), (0, jsx_runtime_1.jsx)("input", { type: "checkbox", id: eachSubset, value: eachSubset, checked: filterOptions.subsets.includes(eachSubset), onClick: function () {
37
+ return changeFilterOption({
38
+ name: 'subsets',
39
+ value: [eachSubset]
40
+ });
41
+ } }, eachSubset)] }));
42
+ }) })), (0, jsx_runtime_1.jsx)("div", __assign({ style: { backgroundColor: 'red' } }, { children: constants_1.CATEGORIES.map(function (category) {
43
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { children: category }), (0, jsx_runtime_1.jsx)("input", { type: "checkbox", id: category, value: category, checked: filterOptions.categories.includes(category), onClick: function () {
44
+ return changeFilterOption({
45
+ name: 'categories',
46
+ value: [category]
47
+ });
48
+ } }, category)] }));
49
+ }) }))] }), isLoading && 'isLoading', filteredFonts.map(function (font) { return ((0, jsx_runtime_1.jsx)(GoogleFontItem_1.default, __assign({ font: font }, { children: function (_a) {
50
+ var isFontFamilyLoading = _a.isLoading, ref = _a.ref;
51
+ return ((0, jsx_runtime_1.jsxs)("div", __assign({ ref: ref }, { children: [isFontFamilyLoading && (0, jsx_runtime_1.jsx)("div", { children: "loading.." }), (0, jsx_runtime_1.jsx)("div", __assign({ style: { fontFamily: font.family } }, { children: font.family }))] })));
52
+ } }), font.id)); })] }));
53
+ } })) }));
54
+ }
55
+ var SFilters = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: 1px solid black;\n"], ["\n border: 1px solid black;\n"])));
56
+ exports.default = GoogleFontsListExample;
57
+ var templateObject_1;
@@ -0,0 +1,10 @@
1
+ type Props = {
2
+ family?: string;
3
+ subset?: string;
4
+ text?: string;
5
+ effect?: string;
6
+ 'font-display'?: string;
7
+ wght?: string;
8
+ };
9
+ declare function getGoogleFontCss(searchParamsObj: Props): Promise<string>;
10
+ export default getGoogleFontCss;
@@ -0,0 +1,53 @@
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
+ var GOOGLE_FONTS_CSS_BASE_URL = 'https://fonts.googleapis.com/css2';
40
+ function getGoogleFontCss(searchParamsObj) {
41
+ return __awaiter(this, void 0, void 0, function () {
42
+ var url;
43
+ return __generator(this, function (_a) {
44
+ url = new URL(GOOGLE_FONTS_CSS_BASE_URL);
45
+ Object.entries(searchParamsObj).forEach(function (param) {
46
+ var key = param[0], value = param[1];
47
+ url.searchParams.append(key, value);
48
+ });
49
+ return [2 /*return*/, fetch(url.href).then(function (res) { return res.text(); })];
50
+ });
51
+ });
52
+ }
53
+ exports.default = getGoogleFontCss;
@@ -0,0 +1,2 @@
1
+ declare function getGoogleFontDefaultText(family: string): Promise<any>;
2
+ export default getGoogleFontDefaultText;
@@ -0,0 +1,55 @@
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
+ var GOOGLE_SAMPLE_TEXT_BASE_URL = 'https://fonts.google.com/sampletext';
40
+ function getGoogleFontDefaultText(family) {
41
+ return __awaiter(this, void 0, void 0, function () {
42
+ var url;
43
+ return __generator(this, function (_a) {
44
+ url = new URL(GOOGLE_SAMPLE_TEXT_BASE_URL);
45
+ url.searchParams.append('family', family);
46
+ return [2 /*return*/, fetch(url.href).then(function (res) {
47
+ return res.text().then(function (text) {
48
+ var testTexts = JSON.parse(text.substring(5));
49
+ return testTexts;
50
+ });
51
+ })];
52
+ });
53
+ });
54
+ }
55
+ exports.default = getGoogleFontDefaultText;
@@ -0,0 +1,10 @@
1
+ type Props = {
2
+ key: string;
3
+ family?: string;
4
+ sort?: string;
5
+ subset?: string;
6
+ category?: string;
7
+ classification?: string;
8
+ };
9
+ declare function getGoogleWebFonts(searchParamsObj: Props): Promise<any>;
10
+ export default getGoogleWebFonts;