pds-dev-kit-web-test 0.2.43 → 0.2.44

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.
@@ -46,7 +46,7 @@ function GoogleFontsListExample() {
46
46
  value: [category]
47
47
  });
48
48
  } }, category)] }));
49
- }) }))] }), isLoading && 'isLoading', filteredFonts.map(function (font) { return ((0, jsx_runtime_1.jsx)(GoogleFontItem_1.default, __assign({ font: font }, { children: function (_a) {
49
+ }) }))] }), isLoading && 'isLoading', filteredFonts.map(function (font) { return ((0, jsx_runtime_1.jsx)(GoogleFontItem_1.default, __assign({ font: font, fetchDefaultText: false }, { children: function (_a) {
50
50
  var isFontFamilyLoading = _a.isLoading, ref = _a.ref;
51
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
52
  } }), font.id)); })] }));
@@ -9,6 +9,7 @@ type HeadlessProps = {
9
9
  type Props = {
10
10
  font: Font;
11
11
  children: (args: HeadlessProps) => JSX.Element;
12
+ fetchDefaultText: boolean;
12
13
  };
13
- declare function GoogleFontItem({ font, children }: Props): JSX.Element;
14
+ declare function GoogleFontItem({ font, fetchDefaultText, children }: Props): JSX.Element;
14
15
  export default GoogleFontItem;
@@ -51,7 +51,7 @@ var isStyleSheetExists_1 = __importDefault(require("../utils/isStyleSheetExists"
51
51
  var parseFontVariants_1 = __importDefault(require("../utils/parseFontVariants"));
52
52
  var setStyleSheetType_1 = __importDefault(require("../utils/setStyleSheetType"));
53
53
  function GoogleFontItem(_a) {
54
- var font = _a.font, children = _a.children;
54
+ var font = _a.font, fetchDefaultText = _a.fetchDefaultText, children = _a.children;
55
55
  var _b = (0, react_1.useState)(false), isLoading = _b[0], setIsLoading = _b[1];
56
56
  var _c = (0, react_1.useState)(''), defaultText = _c[0], setDefaultText = _c[1];
57
57
  var ref = (0, react_1.useRef)(null);
@@ -105,6 +105,9 @@ function GoogleFontItem(_a) {
105
105
  }
106
106
  }, [font, isVisible]);
107
107
  (0, react_1.useEffect)(function () {
108
+ if (!fetchDefaultText) {
109
+ return;
110
+ }
108
111
  if (!font.family || !isVisible || defaultText) {
109
112
  return;
110
113
  }
@@ -123,7 +126,7 @@ function GoogleFontItem(_a) {
123
126
  });
124
127
  }
125
128
  getDefaultText();
126
- }, [font, isVisible, defaultText]);
129
+ }, [font, isVisible, defaultText, fetchDefaultText]);
127
130
  return children({ isLoading: isLoading, isVisible: isVisible, ref: ref, defaultText: defaultText });
128
131
  }
129
132
  exports.default = GoogleFontItem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "0.2.43",
3
+ "version": "0.2.44",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
package/release-note.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pds-dev-kit-web-test Release Notes
2
- ## [v0.2.43]
2
+ ## [v0.2.44]
3
3
  ## 기준 pds-dev-kit-web 버전 @2.2.10
4
4
  ### sub
5
5
  * GoogleFontKit
6
- * GoogleFontItem -> defaultText 기능 리턴 추가
6
+ * GoogleFontItem fetchDefaultText prop(boolean) 추가