pds-dev-kit-web-test 0.2.17 → 0.2.19

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.
@@ -28,20 +28,14 @@ var useCLINK_1 = __importDefault(require("../hooks/useCLINK"));
28
28
  function Button(props) {
29
29
  var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
30
30
  var CB_STYLE_PROP_BTNCOLOR = props.CB_STYLE_PROP_BTNCOLOR, _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_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW;
31
- var onClickBox = (0, useCLINK_1.default)({
31
+ var _c = (0, useCLINK_1.default)({
32
32
  src: CB_CONTENT_PROP_CLINK_SPEC_SRC,
33
33
  type: CB_CONTENT_PROP_CLINK_SPEC_TYPE,
34
34
  openNewTab: CB_CONTENT_PROP_CLINK_SPEC_NEWTAB
35
- });
36
- var handleOnClick = function () {
37
- if (mode === 'EDIT') {
38
- return;
39
- }
40
- onClickBox();
41
- };
42
- var _c = getBTNStyles(props.CB_STYLE_PROP_BTNTEXT, device), btnTextStyle = _c.style, btnTextHoverStyle = _c.hoverStyle;
43
- var _d = getBTNColorStyles(CB_STYLE_PROP_BTNCOLOR, device), btnColorStyle = _d.style, btnColorHoverStyle = _d.hoverStyle;
44
- var _e = (0, util_1.parseProperties)(props, device), propsStyle = _e.style, propsHoverStyle = _e.hoverStyle, layoutStyle = _e.layout, effect = _e.effect;
35
+ }), onClickCLINK = _c.onClickCLINK, CLINKCursor = _c.CLINKCursor;
36
+ var _d = getBTNStyles(props.CB_STYLE_PROP_BTNTEXT, device), btnTextStyle = _d.style, btnTextHoverStyle = _d.hoverStyle;
37
+ var _e = getBTNColorStyles(CB_STYLE_PROP_BTNCOLOR, device), btnColorStyle = _e.style, btnColorHoverStyle = _e.hoverStyle;
38
+ var _f = (0, util_1.parseProperties)(props, device), propsStyle = _f.style, propsHoverStyle = _f.hoverStyle, layoutStyle = _f.layout, effect = _f.effect;
45
39
  var isEditModeAndHidden = propsStyle.visibility === 'hidden' && mode === 'EDIT';
46
40
  if (mode === 'EDIT') {
47
41
  propsStyle.visibility = 'visible';
@@ -50,7 +44,7 @@ function Button(props) {
50
44
  var entry = (0, hooks_1.useIntersectionObserver)(cbRef, { threshold: 1, freezeOnceVisible: true });
51
45
  var isVisible = !!(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
52
46
  var effectCssProperties = isVisible ? effect : {};
53
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}, void 0), (0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, btnTextStyle), propsStyle), layoutStyle), effectCssProperties), btnColorStyle), hoverStyle: __assign(__assign(__assign({}, btnTextHoverStyle), propsHoverStyle), btnColorHoverStyle), cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, onClick: handleOnClick, ref: cbRef }, { children: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT }), void 0)] }, void 0));
47
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}, void 0), (0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign(__assign({}, btnTextStyle), propsStyle), layoutStyle), effectCssProperties), btnColorStyle), { cursor: CLINKCursor }), hoverStyle: __assign(__assign(__assign({}, btnTextHoverStyle), propsHoverStyle), btnColorHoverStyle), cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, onClick: onClickCLINK, ref: cbRef }, { children: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT }), void 0)] }, void 0));
54
48
  }
55
49
  function getBTNStyles(props, device) {
56
50
  var availableSpecCodes = [
@@ -46,40 +46,35 @@ var util_1 = require("../../../../util");
46
46
  var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
47
47
  var useCLINK_1 = __importDefault(require("../hooks/useCLINK"));
48
48
  function Image(props) {
49
- var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
50
- var CB_CONTENT_PROP_IMAGE = props.CB_CONTENT_PROP_IMAGE, _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_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW;
51
- var onClickBox = (0, useCLINK_1.default)({
49
+ var device = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext).device;
50
+ var CB_CONTENT_PROP_IMAGE = props.CB_CONTENT_PROP_IMAGE, _a = props.CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CLINK_SPEC_SRC = _a.CB_CONTENT_PROP_CLINK_SPEC_SRC, CB_CONTENT_PROP_CLINK_SPEC_TYPE = _a.CB_CONTENT_PROP_CLINK_SPEC_TYPE, CB_CONTENT_PROP_CLINK_SPEC_NEWTAB = _a.CB_CONTENT_PROP_CLINK_SPEC_NEWTAB, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW;
51
+ var _b = (0, useCLINK_1.default)({
52
52
  src: CB_CONTENT_PROP_CLINK_SPEC_SRC,
53
53
  type: CB_CONTENT_PROP_CLINK_SPEC_TYPE,
54
54
  openNewTab: CB_CONTENT_PROP_CLINK_SPEC_NEWTAB
55
- });
55
+ }), onClickCLINK = _b.onClickCLINK, CLINKCursor = _b.CLINKCursor;
56
56
  var _c = (0, util_1.parseProperties)(props, device), style = _c.style, hoverStyle = _c.hoverStyle, layout = _c.layout, effect = _c.effect;
57
57
  var cbRef = (0, react_1.useRef)(null);
58
58
  var entry = (0, hooks_1.useIntersectionObserver)(cbRef, { threshold: 1, freezeOnceVisible: true });
59
59
  var isVisible = !!(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
60
60
  var effectCssProperties = isVisible ? effect : {};
61
- var handleOnClick = function () {
62
- if (mode === 'EDIT')
63
- return;
64
- onClickBox();
65
- };
66
- return ((0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign({}, layout), effectCssProperties), hoverStyle: hoverStyle, cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, ref: cbRef, onClick: handleOnClick }, { children: (0, jsx_runtime_1.jsx)(S_Image, __assign({ src: CB_CONTENT_PROP_IMAGE.CB_CONTENT_PROP_IMAGE_SPEC_SELECTOR, normalStyle: style, hoverStyle: hoverStyle }, { children: (0, jsx_runtime_1.jsx)("img", { src: CB_CONTENT_PROP_IMAGE.CB_CONTENT_PROP_IMAGE_SPEC_SELECTOR, style: { visibility: 'hidden', width: '100%', height: '100%' } }, void 0) }), void 0) }), void 0));
61
+ return ((0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign({}, layout), effectCssProperties), { cursor: CLINKCursor }), hoverStyle: hoverStyle, cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, ref: cbRef, onClick: onClickCLINK }, { children: (0, jsx_runtime_1.jsx)(S_Image, __assign({ src: CB_CONTENT_PROP_IMAGE.CB_CONTENT_PROP_IMAGE_SPEC_SELECTOR, normalStyle: style, hoverStyle: hoverStyle }, { children: (0, jsx_runtime_1.jsx)("img", { src: CB_CONTENT_PROP_IMAGE.CB_CONTENT_PROP_IMAGE_SPEC_SELECTOR, style: { visibility: 'hidden', width: '100%', height: '100%' } }, void 0) }), void 0) }), void 0));
67
62
  }
68
- var S_Image = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-image: ", ";\n background-repeat: no-repeat;\n\n ", ";\n\n &:hover {\n ", ";\n }\n\n & img {\n ", ";\n }\n\n &:hover img {\n ", ";\n }\n"], ["\n background-image: ", ";\n background-repeat: no-repeat;\n\n ", ";\n\n &:hover {\n ", ";\n }\n\n & img {\n ", ";\n }\n\n &:hover img {\n ", ";\n }\n"])), function (_a) {
63
+ var S_Image = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-image: ", ";\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n\n ", ";\n\n &:hover {\n ", ";\n }\n\n & img {\n ", ";\n }\n\n &:hover img {\n ", ";\n }\n"], ["\n background-image: ", ";\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n\n ", ";\n\n &:hover {\n ", ";\n }\n\n & img {\n ", ";\n }\n\n &:hover img {\n ", ";\n }\n"])), function (_a) {
69
64
  var src = _a.src;
70
65
  return "url(" + src + ")";
71
66
  }, function (_a) {
72
67
  var normalStyle = _a.normalStyle;
73
68
  var isContain = normalStyle.backgroundSize === 'contain';
74
- return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), __assign(__assign({}, normalStyle), { backgroundPosition: isContain ? 'unset' : normalStyle.backgroundPosition, height: isContain ? 'auto' : '100%', width: isContain ? 'auto' : '100%' }));
69
+ return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), __assign(__assign({}, normalStyle), { backgroundPosition: isContain ? 'center' : normalStyle.backgroundPosition }));
75
70
  }, function (_a) {
76
71
  var hoverStyle = _a.hoverStyle, normalStyle = _a.normalStyle;
77
72
  var isContain = hoverStyle.backgroundSize
78
73
  ? hoverStyle.backgroundSize === 'contain'
79
74
  : normalStyle.backgroundSize === 'contain';
80
75
  return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), __assign(__assign({}, hoverStyle), { backgroundPosition: isContain
81
- ? 'unset'
82
- : hoverStyle.backgroundPosition || normalStyle.backgroundPosition, height: isContain ? 'auto' : '100%', width: isContain ? 'auto' : '100%' }));
76
+ ? 'center'
77
+ : hoverStyle.backgroundPosition || normalStyle.backgroundPosition }));
83
78
  }, function (_a) {
84
79
  var normalStyle = _a.normalStyle;
85
80
  var isContain = normalStyle.backgroundSize === 'contain';
@@ -27,13 +27,13 @@ var useCLINK_1 = __importDefault(require("../hooks/useCLINK"));
27
27
  function Text(props) {
28
28
  var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
29
29
  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;
30
- var onClickBox = (0, useCLINK_1.default)({
30
+ var _c = (0, useCLINK_1.default)({
31
31
  src: CB_CONTENT_PROP_CLINK_SPEC_SRC,
32
32
  type: CB_CONTENT_PROP_CLINK_SPEC_TYPE,
33
33
  openNewTab: CB_CONTENT_PROP_CLINK_SPEC_NEWTAB
34
- });
35
- var _c = getTextStyles(props.CB_STYLE_PROP_TEXT, device), textStyle = _c.style, textHoverStyle = _c.hoverStyle;
36
- var _d = (0, util_1.parseProperties)(props, device), propsStyle = _d.style, propsHoverStyle = _d.hoverStyle, layoutStyle = _d.layout, effect = _d.effect;
34
+ }), CLINKCursor = _c.CLINKCursor, onClickCLINK = _c.onClickCLINK;
35
+ var _d = getTextStyles(props.CB_STYLE_PROP_TEXT, device), textStyle = _d.style, textHoverStyle = _d.hoverStyle;
36
+ var _e = (0, util_1.parseProperties)(props, device), propsStyle = _e.style, propsHoverStyle = _e.hoverStyle, layoutStyle = _e.layout, effect = _e.effect;
37
37
  var isEditModeAndHidden = propsStyle.visibility === 'hidden' && mode === 'EDIT';
38
38
  if (mode === 'EDIT') {
39
39
  propsStyle.visibility = 'visible';
@@ -41,11 +41,8 @@ function Text(props) {
41
41
  var cbRef = (0, react_1.useRef)(null);
42
42
  var entry = (0, hooks_1.useIntersectionObserver)(cbRef, { threshold: 1, freezeOnceVisible: true });
43
43
  var isVisible = !!(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
44
- var isOnClickUsable = CB_CONTENT_PROP_CLINK_SPEC_TYPE !== 'DISABLED' &&
45
- mode !== 'EDIT' &&
46
- CB_CONTENT_PROP_CLINK_SPEC_SRC.length > 0;
47
44
  var effectCssProperties = isVisible ? effect : {};
48
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}, void 0), (0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, textStyle), propsStyle), layoutStyle), effectCssProperties), { display: 'flex', whiteSpace: 'pre' }), hoverStyle: __assign(__assign(__assign({}, textHoverStyle), propsHoverStyle), { display: 'flex', whiteSpace: 'pre' }), onClick: isOnClickUsable ? onClickBox : undefined, ref: cbRef }, { children: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT }), void 0)] }, void 0));
45
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}, void 0), (0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, textStyle), propsStyle), layoutStyle), effectCssProperties), { whiteSpace: 'pre', wordBreak: 'keep-all', cursor: CLINKCursor }), hoverStyle: __assign(__assign(__assign({}, textHoverStyle), propsHoverStyle), { whiteSpace: 'pre', wordBreak: 'keep-all' }), onClick: onClickCLINK, ref: cbRef }, { children: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT }), void 0)] }, void 0));
49
46
  }
50
47
  function getTextStyles(props, device) {
51
48
  var availableSpecCodes = [
@@ -4,5 +4,8 @@ declare type Props = {
4
4
  openNewTab: boolean;
5
5
  type: CB_CONTENT_PROP_CLINK['CB_CONTENT_PROP_CLINK_SPEC_TYPE'];
6
6
  };
7
- export default function useCLINK(props: Props): () => void;
7
+ export default function useCLINK(props: Props): {
8
+ CLINKCursor: string;
9
+ onClickCLINK: () => void;
10
+ };
8
11
  export {};
@@ -5,23 +5,21 @@ var dynamicLayoutContext_1 = require("../../../../../../../DynamicLayout/dynamic
5
5
  // NOTE: link기능은 탄력적일 필요가 없음.
6
6
  function useCLINK(props) {
7
7
  var src = props.src, openNewTab = props.openNewTab, type = props.type;
8
- var navigationHandler = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext).navigationHandler;
8
+ var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), navigationHandler = _a.navigationHandler, mode = _a.mode;
9
9
  var navType = type === 'INTERNAL' ? 'INTERNAL_LINK' : 'WEB_LINK';
10
+ var CLINKCursor = mode === 'EDIT' || type === 'DISABLED' ? 'auto' : 'pointer';
10
11
  function onClickCLINK() {
11
- if (!src || type === 'DISABLED') {
12
- return;
13
- }
14
- // NOTE: EDIT 모드에서는 작동 안해야함. cursor..?
15
- if (openNewTab) {
16
- window.open(src, '_blank', 'noopener');
12
+ if (!src || type === 'DISABLED' || mode === 'EDIT') {
17
13
  return;
18
14
  }
19
15
  if (typeof navigationHandler === 'function') {
20
- navigationHandler(navType, src);
16
+ navigationHandler(navType, src, { openNewTab: openNewTab });
21
17
  return;
22
18
  }
23
- // NOTE: error or do other action.
24
19
  }
25
- return onClickCLINK;
20
+ return {
21
+ CLINKCursor: CLINKCursor,
22
+ onClickCLINK: onClickCLINK
23
+ };
26
24
  }
27
25
  exports.default = useCLINK;
@@ -88,12 +88,12 @@ function parseStyleTextToCSSProp(_a) {
88
88
  if (cssPropertyKey === 'alignItems') {
89
89
  if (hoverValue === null || hoverValue === undefined) {
90
90
  return {
91
- style: __assign(__assign({}, acc.style), (_o = {}, _o[cssPropertyKey] = getVerticalPositionValue(String(value)), _o)),
91
+ style: __assign(__assign({}, acc.style), (_o = {}, _o[cssPropertyKey] = getVerticalPositionValue(String(value)), _o.display = 'flex', _o)),
92
92
  hoverStyle: __assign({}, acc.hoverStyle)
93
93
  };
94
94
  }
95
95
  return {
96
- style: __assign(__assign({}, acc.style), (_p = {}, _p[cssPropertyKey] = getVerticalPositionValue(String(value)), _p)),
96
+ style: __assign(__assign({}, acc.style), (_p = {}, _p[cssPropertyKey] = getVerticalPositionValue(String(value)), _p.display = 'flex', _p)),
97
97
  hoverStyle: __assign(__assign({}, acc.hoverStyle), (_q = {}, _q[cssPropertyKey] = getVerticalPositionValue(String(hoverValue)), _q))
98
98
  };
99
99
  }
@@ -175,11 +175,11 @@ function getFontName(value) {
175
175
  function getHorizontalPositionValue(value) {
176
176
  switch (value) {
177
177
  case 'LEFT':
178
- return { justifyContent: 'flex-start', textAlign: 'left' };
178
+ return { display: 'flex', justifyContent: 'flex-start', textAlign: 'left' };
179
179
  case 'RIGHT':
180
- return { justifyContent: 'flex-end', textAlign: 'right' };
180
+ return { display: 'flex', justifyContent: 'flex-end', textAlign: 'right' };
181
181
  case 'CENTER':
182
- return { justifyContent: 'center', textAlign: 'center' };
182
+ return { display: 'flex', justifyContent: 'center', textAlign: 'center' };
183
183
  default:
184
184
  return {};
185
185
  }
@@ -219,11 +219,14 @@ export declare type DynamicLayoutProps = {
219
219
  sections: ISection[];
220
220
  scrollDownTargetSectionId?: number;
221
221
  editingSectionId?: number;
222
- navigationHandler?: (linkType: 'WEB_LINK' | 'INTERNAL_LINK' | 'NONE', src: string) => void;
222
+ navigationHandler?: (linkType: 'WEB_LINK' | 'INTERNAL_LINK' | 'NONE', src: string, action?: NavHandlerAction) => void;
223
223
  onClickEditSection?: (section: ISection) => void;
224
224
  sectionActionHandler?: (action: TypeOfSectionAction) => void;
225
225
  programmedSectionComponents?: IProgrammedSectionComponents;
226
226
  };
227
+ export declare type NavHandlerAction = {
228
+ openNewTab: boolean;
229
+ };
227
230
  export declare type SubscriptionProductType = 'FREE_INFINITE' | 'FREE_FINITE' | 'ONCE_INFINITE' | 'ONCE_FINITE' | 'COUPON_FREE_INFINITE' | 'COUPON_FREE_FINITE' | 'COUPON_ONCE_INFINITE' | 'COUPON_ONCE_FINITE' | 'SUBSCRIPTION_30DAYS' | 'SUBSCRIPTION_90DAYS' | 'SUBSCRIPTION_180DAYS' | 'SUBSCRIPTION_365DAYS';
228
231
  declare type ExpiryPeriodInDaysType = 1 | 3 | 7 | 14 | 30;
229
232
  export declare type IMembershipCardTemplate = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",