@crystaldesign/content-item 24.7.0-beta.25
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/build/esm/index.js +290 -0
- package/build/types/content-item/src/Components/ContentItems/index.d.ts +9 -0
- package/build/types/content-item/src/Components/ContentItems/index.d.ts.map +1 -0
- package/build/types/content-item/src/Components/Gallery/index.d.ts +11 -0
- package/build/types/content-item/src/Components/Gallery/index.d.ts.map +1 -0
- package/build/types/content-item/src/Components/Image/index.d.ts +7 -0
- package/build/types/content-item/src/Components/Image/index.d.ts.map +1 -0
- package/build/types/content-item/src/Components/RichText/index.d.ts +7 -0
- package/build/types/content-item/src/Components/RichText/index.d.ts.map +1 -0
- package/build/types/content-item/src/Components/Title/index.d.ts +7 -0
- package/build/types/content-item/src/Components/Title/index.d.ts.map +1 -0
- package/build/types/content-item/src/Components/URL/index.d.ts +7 -0
- package/build/types/content-item/src/Components/URL/index.d.ts.map +1 -0
- package/build/types/content-item/src/Components/Video/index.d.ts +7 -0
- package/build/types/content-item/src/Components/Video/index.d.ts.map +1 -0
- package/build/types/content-item/src/Components/Wrapper/index.d.ts +7 -0
- package/build/types/content-item/src/Components/Wrapper/index.d.ts.map +1 -0
- package/build/types/content-item/src/Components/index.d.ts +7 -0
- package/build/types/content-item/src/Components/index.d.ts.map +1 -0
- package/build/types/content-item/src/index.d.ts +18 -0
- package/build/types/content-item/src/index.d.ts.map +1 -0
- package/build/types/content-item/src/stories/basicItem.stories.d.ts +7 -0
- package/build/types/content-item/src/stories/basicItem.stories.d.ts.map +1 -0
- package/build/types/content-item/src/types.d.ts +41 -0
- package/build/types/content-item/src/types.d.ts.map +1 -0
- package/package.json +38 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
|
+
import 'swiper/css';
|
|
6
|
+
import 'swiper/css/thumbs';
|
|
7
|
+
import 'swiper/css/free-mode';
|
|
8
|
+
import 'swiper/css/navigation';
|
|
9
|
+
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
10
|
+
import { FreeMode, Navigation, Thumbs } from 'swiper';
|
|
11
|
+
|
|
12
|
+
(function() {
|
|
13
|
+
const env = {"STAGE":"production"};
|
|
14
|
+
try {
|
|
15
|
+
if (process) {
|
|
16
|
+
process.env = Object.assign({}, process.env);
|
|
17
|
+
Object.assign(process.env, env);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
} catch (e) {} // avoid ReferenceError: process is not defined
|
|
21
|
+
globalThis.process = { env:env };
|
|
22
|
+
})();
|
|
23
|
+
|
|
24
|
+
function styleInject(css, ref) {
|
|
25
|
+
if ( ref === void 0 ) ref = {};
|
|
26
|
+
var insertAt = ref.insertAt;
|
|
27
|
+
|
|
28
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
29
|
+
|
|
30
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
31
|
+
var style = document.createElement('style');
|
|
32
|
+
style.type = 'text/css';
|
|
33
|
+
|
|
34
|
+
if (insertAt === 'top') {
|
|
35
|
+
if (head.firstChild) {
|
|
36
|
+
head.insertBefore(style, head.firstChild);
|
|
37
|
+
} else {
|
|
38
|
+
head.appendChild(style);
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
head.appendChild(style);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (style.styleSheet) {
|
|
45
|
+
style.styleSheet.cssText = css;
|
|
46
|
+
} else {
|
|
47
|
+
style.appendChild(document.createTextNode(css));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var urlText = "url-text-yHwAC";
|
|
52
|
+
var css_248z$3 = ".url-text-yHwAC {\n margin-top: 12px;\n margin-bottom: 12px;\n text-align: right;\n position: relative;\n display: block;\n width: 100%;\n}\n";
|
|
53
|
+
styleInject(css_248z$3);
|
|
54
|
+
|
|
55
|
+
var URL$1 = function URL(_ref) {
|
|
56
|
+
var _ref$item = _ref.item,
|
|
57
|
+
url = _ref$item.url;
|
|
58
|
+
_ref$item.icon;
|
|
59
|
+
var text = _ref$item.text;
|
|
60
|
+
if (!url) return /*#__PURE__*/jsx(Fragment, {});
|
|
61
|
+
return /*#__PURE__*/jsx("a", {
|
|
62
|
+
className: urlText,
|
|
63
|
+
href: url,
|
|
64
|
+
target: "_blank",
|
|
65
|
+
rel: "noopener",
|
|
66
|
+
children: text !== null && text !== void 0 ? text : 'URL'
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
71
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
72
|
+
var Image = function Image(_ref) {
|
|
73
|
+
var _ref$item = _ref.item,
|
|
74
|
+
url = _ref$item.url,
|
|
75
|
+
_ref$item$cover = _ref$item.cover,
|
|
76
|
+
cover = _ref$item$cover === void 0 ? true : _ref$item$cover,
|
|
77
|
+
style = _ref$item.style,
|
|
78
|
+
altText = _ref$item.altText;
|
|
79
|
+
var styles = {};
|
|
80
|
+
if (!url) return /*#__PURE__*/jsx(Fragment, {});
|
|
81
|
+
var urlObj = new URL(url);
|
|
82
|
+
if (!cover) {
|
|
83
|
+
styles.maxWidth = '100%';
|
|
84
|
+
styles.maxHeight = '100%';
|
|
85
|
+
} else {
|
|
86
|
+
styles.objectFit = 'cover';
|
|
87
|
+
styles.minWidth = '100%';
|
|
88
|
+
styles.minHeight = '100%';
|
|
89
|
+
}
|
|
90
|
+
return /*#__PURE__*/jsx("img", {
|
|
91
|
+
alt: altText,
|
|
92
|
+
style: _objectSpread$2(_objectSpread$2({}, styles), style),
|
|
93
|
+
src: urlObj.toString()
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
var videoClass = "videoClass-jg-N2";
|
|
98
|
+
var css_248z$2 = ".videoClass-jg-N2 {\n width: 100%;\n}\n";
|
|
99
|
+
styleInject(css_248z$2);
|
|
100
|
+
|
|
101
|
+
var Video = function Video(_ref) {
|
|
102
|
+
var _ref$item = _ref.item,
|
|
103
|
+
url = _ref$item.url,
|
|
104
|
+
thumb = _ref$item.thumb;
|
|
105
|
+
if (!url) return /*#__PURE__*/jsx(Fragment, {});
|
|
106
|
+
return /*#__PURE__*/jsx("video", {
|
|
107
|
+
className: videoClass,
|
|
108
|
+
"aria-disabled": thumb,
|
|
109
|
+
disablePictureInPicture: thumb,
|
|
110
|
+
controls: !thumb,
|
|
111
|
+
autoPlay: !thumb,
|
|
112
|
+
children: /*#__PURE__*/jsx("source", {
|
|
113
|
+
src: url + (thumb ? '#t=2' : ''),
|
|
114
|
+
type: url.includes('.mp4') ? 'video/mp4' : 'video/webm'
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
var title = "title-0S918";
|
|
120
|
+
var css_248z$1 = ".title-0S918 {\n font-size: 18px;\n font-weight: 500;\n}\n";
|
|
121
|
+
styleInject(css_248z$1);
|
|
122
|
+
|
|
123
|
+
var Title = function Title(_ref) {
|
|
124
|
+
var _ref$item = _ref.item,
|
|
125
|
+
text = _ref$item.text,
|
|
126
|
+
style = _ref$item.style;
|
|
127
|
+
if (!text) return /*#__PURE__*/jsx(Fragment, {});
|
|
128
|
+
return /*#__PURE__*/jsx("h4", {
|
|
129
|
+
className: title,
|
|
130
|
+
style: style,
|
|
131
|
+
children: text
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
var mySwiper2 = "mySwiper2-mfrK1";
|
|
136
|
+
var mySwiper = "mySwiper-urn8y";
|
|
137
|
+
var css_248z = "#DivaContentItem .swiper {\n width: 100%;\n height: 100%;\n}\n#DivaContentItem .swiper-slide {\n text-align: center;\n font-size: 18px;\n background: #fff;\n\n /* Center slide text vertically */\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n#DivaContentItem .swiper {\n width: 100%;\n height: 300px;\n margin-left: auto;\n margin-right: auto;\n}\n#DivaContentItem .swiper-slide {\n background-size: cover;\n background-position: center;\n}\n#DivaContentItem .mySwiper2-mfrK1 {\n height: 80%;\n width: 100%;\n}\n#DivaContentItem .mySwiper-urn8y {\n height: 20%;\n box-sizing: border-box;\n padding: 10px 0;\n}\n#DivaContentItem .mySwiper-urn8y .swiper-slide {\n width: 25%;\n height: 100%;\n opacity: 0.4;\n}\n#DivaContentItem .mySwiper-urn8y .swiper-slide-thumb-active {\n opacity: 1;\n}\n";
|
|
138
|
+
styleInject(css_248z);
|
|
139
|
+
|
|
140
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
141
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
142
|
+
var Gallery = function Gallery(_ref) {
|
|
143
|
+
var _ref$item = _ref.item,
|
|
144
|
+
content = _ref$item.content,
|
|
145
|
+
wrappingStyle = _ref$item.wrappingStyle;
|
|
146
|
+
var _useState = useState(null),
|
|
147
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
148
|
+
thumbsSwiper = _useState2[0],
|
|
149
|
+
setThumbsSwiper = _useState2[1];
|
|
150
|
+
if (content.length == 0) return /*#__PURE__*/jsx(Fragment, {});
|
|
151
|
+
if (content.length == 1) return /*#__PURE__*/jsx(ContentItem, {
|
|
152
|
+
item: _objectSpread$1({}, content[0])
|
|
153
|
+
});
|
|
154
|
+
return /*#__PURE__*/jsxs("div", {
|
|
155
|
+
style: _objectSpread$1({}, wrappingStyle),
|
|
156
|
+
children: [/*#__PURE__*/jsx(Swiper, {
|
|
157
|
+
style: {
|
|
158
|
+
'--swiper-navigation-color': '#fff',
|
|
159
|
+
'--swiper-pagination-color': '#fff'
|
|
160
|
+
},
|
|
161
|
+
spaceBetween: 10,
|
|
162
|
+
navigation: true,
|
|
163
|
+
loop: true,
|
|
164
|
+
thumbs: {
|
|
165
|
+
swiper: thumbsSwiper
|
|
166
|
+
},
|
|
167
|
+
modules: [FreeMode, Navigation, Thumbs],
|
|
168
|
+
className: mySwiper2,
|
|
169
|
+
children: content.map(function (item, i) {
|
|
170
|
+
return /*#__PURE__*/jsx(SwiperSlide, {
|
|
171
|
+
children: /*#__PURE__*/jsx(ContentItem, {
|
|
172
|
+
item: item
|
|
173
|
+
})
|
|
174
|
+
}, i);
|
|
175
|
+
})
|
|
176
|
+
}), /*#__PURE__*/jsx(Swiper, {
|
|
177
|
+
onSwiper: setThumbsSwiper,
|
|
178
|
+
spaceBetween: 10,
|
|
179
|
+
slidesPerView: 4,
|
|
180
|
+
freeMode: true,
|
|
181
|
+
watchSlidesProgress: true,
|
|
182
|
+
modules: [FreeMode, Navigation, Thumbs],
|
|
183
|
+
className: mySwiper,
|
|
184
|
+
children: content.map(function (item, i) {
|
|
185
|
+
return /*#__PURE__*/jsx(SwiperSlide, {
|
|
186
|
+
children: /*#__PURE__*/jsx(ContentItem, {
|
|
187
|
+
item: _objectSpread$1(_objectSpread$1({}, item), item.type == 'Video' ? {
|
|
188
|
+
thumb: true
|
|
189
|
+
} : {})
|
|
190
|
+
})
|
|
191
|
+
}, i);
|
|
192
|
+
})
|
|
193
|
+
})]
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
var RichText = function RichText(_ref) {
|
|
198
|
+
var _ref$item = _ref.item,
|
|
199
|
+
text = _ref$item.text,
|
|
200
|
+
style = _ref$item.style;
|
|
201
|
+
return /*#__PURE__*/jsx("div", {
|
|
202
|
+
style: style,
|
|
203
|
+
dangerouslySetInnerHTML: {
|
|
204
|
+
__html: text
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
var Wrapper = function Wrapper(_ref) {
|
|
210
|
+
var _ref$item = _ref.item,
|
|
211
|
+
style = _ref$item.style,
|
|
212
|
+
content = _ref$item.content;
|
|
213
|
+
return /*#__PURE__*/jsx("div", {
|
|
214
|
+
style: style,
|
|
215
|
+
children: content.map(function (item, i) {
|
|
216
|
+
return /*#__PURE__*/jsx(ContentItem, {
|
|
217
|
+
item: item
|
|
218
|
+
}, i);
|
|
219
|
+
})
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
var ContentItem = function ContentItem(_ref) {
|
|
224
|
+
var item = _ref.item;
|
|
225
|
+
switch (item.type) {
|
|
226
|
+
case 'Gallery':
|
|
227
|
+
return /*#__PURE__*/jsx(Gallery, {
|
|
228
|
+
item: item
|
|
229
|
+
});
|
|
230
|
+
case 'Image':
|
|
231
|
+
return /*#__PURE__*/jsx(Image, {
|
|
232
|
+
item: item
|
|
233
|
+
});
|
|
234
|
+
case 'RichText':
|
|
235
|
+
return /*#__PURE__*/jsx(RichText, {
|
|
236
|
+
item: item
|
|
237
|
+
});
|
|
238
|
+
case 'Title':
|
|
239
|
+
return /*#__PURE__*/jsx(Title, {
|
|
240
|
+
item: item
|
|
241
|
+
});
|
|
242
|
+
case 'URL':
|
|
243
|
+
return /*#__PURE__*/jsx(URL$1, {
|
|
244
|
+
item: item
|
|
245
|
+
});
|
|
246
|
+
case 'Video':
|
|
247
|
+
return /*#__PURE__*/jsx(Video, {
|
|
248
|
+
item: item
|
|
249
|
+
});
|
|
250
|
+
case 'Wrapper':
|
|
251
|
+
return /*#__PURE__*/jsx(Wrapper, {
|
|
252
|
+
item: item
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
throw new Error('unkonwn type: ' + item.type);
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
var ContentItems = function ContentItems(_ref) {
|
|
259
|
+
var contentItems = _ref.contentItems,
|
|
260
|
+
wrapperStyle = _ref.wrapperStyle;
|
|
261
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
262
|
+
children: /*#__PURE__*/jsx("div", {
|
|
263
|
+
style: wrapperStyle,
|
|
264
|
+
id: 'DivaContentItem',
|
|
265
|
+
children: contentItems.map(function (item, i) {
|
|
266
|
+
return /*#__PURE__*/jsx(ContentItem, {
|
|
267
|
+
item: item
|
|
268
|
+
}, i);
|
|
269
|
+
})
|
|
270
|
+
})
|
|
271
|
+
});
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
275
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
276
|
+
var Main = function Main(_ref) {
|
|
277
|
+
var settings = _ref.settings;
|
|
278
|
+
_ref.parameters;
|
|
279
|
+
_ref.internal;
|
|
280
|
+
return /*#__PURE__*/jsx(ContentItems, _objectSpread({}, settings));
|
|
281
|
+
};
|
|
282
|
+
var ContentItemComponent = function ContentItemComponent(props) {
|
|
283
|
+
return /*#__PURE__*/jsx(Main, _objectSpread({}, props));
|
|
284
|
+
};
|
|
285
|
+
var ContentBox = {
|
|
286
|
+
name: 'CONTENTBOX',
|
|
287
|
+
renderFunction: Main
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
export { ContentItemComponent, ContentBox as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ContentItemType } from '../../types';
|
|
3
|
+
type Props = {
|
|
4
|
+
contentItems: ContentItemType[];
|
|
5
|
+
wrapperStyle?: React.CSSProperties;
|
|
6
|
+
};
|
|
7
|
+
declare const ContentItems: ({ contentItems, wrapperStyle }: Props) => JSX.Element;
|
|
8
|
+
export default ContentItems;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Components/ContentItems/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,KAAK,KAAK,GAAG;IAAE,YAAY,EAAE,eAAe,EAAE,CAAC;IAAC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAAE,CAAC;AAErF,QAAA,MAAM,YAAY,mCAAoC,KAAK,gBAU1D,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import 'swiper/css';
|
|
2
|
+
import 'swiper/css/thumbs';
|
|
3
|
+
import 'swiper/css/free-mode';
|
|
4
|
+
import 'swiper/css/navigation';
|
|
5
|
+
import { GalleryType } from '../../types';
|
|
6
|
+
type Props = {
|
|
7
|
+
item: GalleryType;
|
|
8
|
+
};
|
|
9
|
+
declare const Gallery: ({ item: { content, wrappingStyle } }: Props) => JSX.Element;
|
|
10
|
+
export default Gallery;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Components/Gallery/index.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AACpB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1C,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAC;AAEnC,QAAA,MAAM,OAAO,yCAA0C,KAAK,gBA8C3D,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Components/Image/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAEjC,QAAA,MAAM,KAAK,6CAAqD,KAAK,gBAepE,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Components/RichText/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC;AAEpC,QAAA,MAAM,QAAQ,8BAA+B,KAAK,gBAEjD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Components/Title/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAEjC,QAAA,MAAM,KAAK,8BAA+B,KAAK,gBAO9C,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Components/URL/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAE/B,QAAA,MAAM,GAAG,kCAAmC,KAAK,gBAOhD,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Components/Video/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAEjC,QAAA,MAAM,KAAK,6BAA8B,KAAK,gBAQ7C,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Components/Wrapper/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAC;AAEnC,QAAA,MAAM,OAAO,iCAAkC,KAAK,gBAQnD,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Components/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAS3C,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF,QAAA,MAAM,WAAW,aAAc,KAAK,gBAkBnC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export * from './types';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { ContentItemType } from './types';
|
|
6
|
+
import { ComponentDefinition } from '@crystaldesign/diva-core';
|
|
7
|
+
interface Props {
|
|
8
|
+
settings: Configuration;
|
|
9
|
+
}
|
|
10
|
+
interface Configuration {
|
|
11
|
+
contentItems: ContentItemType[];
|
|
12
|
+
wrapperStyle?: React.CSSProperties;
|
|
13
|
+
}
|
|
14
|
+
export declare const ContentItemComponent: React.FC<Props>;
|
|
15
|
+
declare const ContentBox: ComponentDefinition<Configuration>;
|
|
16
|
+
export default ContentBox;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
18
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAkB,MAAM,0BAA0B,CAAC;AAE/E,UAAU,KAAK;IACb,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,UAAU,aAAa;IACrB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACpC;AAMD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAEhD,CAAC;AAEF,QAAA,MAAM,UAAU,EAAE,mBAAmB,CAAC,aAAa,CAGlD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Component from '../Components/ContentItems/index';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: Meta<typeof Component>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Component>;
|
|
6
|
+
export declare const PriPlannermary: Story;
|
|
7
|
+
//# sourceMappingURL=basicItem.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basicItem.stories.d.ts","sourceRoot":"","sources":["../../../../../src/stories/basicItem.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kCAAkC,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAWhC,CAAC;AACF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AAExC,eAAO,MAAM,cAAc,EAAE,KAqB5B,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ContentItemType = TitleType | RichTextType | ImageType | GalleryType | VideoType | URLType | WrapperType;
|
|
3
|
+
export interface TitleType {
|
|
4
|
+
type: 'Title';
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
text: string;
|
|
7
|
+
}
|
|
8
|
+
export interface WrapperType {
|
|
9
|
+
type: 'Wrapper';
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
content: ContentItemType[];
|
|
12
|
+
}
|
|
13
|
+
export interface RichTextType {
|
|
14
|
+
type: 'RichText';
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
text: string;
|
|
17
|
+
}
|
|
18
|
+
export interface GalleryType {
|
|
19
|
+
type: 'Gallery';
|
|
20
|
+
content: (ImageType | VideoType)[];
|
|
21
|
+
wrappingStyle?: React.CSSProperties;
|
|
22
|
+
}
|
|
23
|
+
export interface ImageType {
|
|
24
|
+
type: 'Image';
|
|
25
|
+
url: string;
|
|
26
|
+
altText?: string;
|
|
27
|
+
cover?: boolean;
|
|
28
|
+
style?: React.CSSProperties;
|
|
29
|
+
}
|
|
30
|
+
export interface VideoType {
|
|
31
|
+
type: 'Video';
|
|
32
|
+
url: string;
|
|
33
|
+
thumb?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface URLType {
|
|
36
|
+
type: 'URL';
|
|
37
|
+
url: string;
|
|
38
|
+
text?: string;
|
|
39
|
+
icon?: 'pdf';
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;AAErH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AACD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC,EAAE,CAAC;IACnC,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACrC;AACD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AACD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,KAAK,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC;CACd"}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@crystaldesign/content-item",
|
|
3
|
+
"version": "24.7.0-beta.25",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"storybook": "storybook dev -p 6006",
|
|
7
|
+
"build-storybook": "storybook build"
|
|
8
|
+
},
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"@storybook/addon-essentials": "7.0.2",
|
|
11
|
+
"@storybook/addon-interactions": "7.0.2",
|
|
12
|
+
"@storybook/addon-links": "7.0.2",
|
|
13
|
+
"@storybook/addon-styling-webpack": "^1.0.0",
|
|
14
|
+
"@storybook/blocks": "7.0.2",
|
|
15
|
+
"@storybook/react": "7.0.2",
|
|
16
|
+
"@storybook/react-webpack5": "7.0.2",
|
|
17
|
+
"@storybook/testing-library": "0.0.14-next.2",
|
|
18
|
+
"@testing-library/jest-dom": "^5.15.0",
|
|
19
|
+
"@testing-library/react": "^12.1.2",
|
|
20
|
+
"@types/classnames": "^2.2.11",
|
|
21
|
+
"@types/swiper": "5.4.3",
|
|
22
|
+
"classnames": "^2.2.6",
|
|
23
|
+
"react": "17.0.2",
|
|
24
|
+
"react-dom": "17.0.2",
|
|
25
|
+
"storybook": "^7.0.2"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"swiper": "^8.3.2"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@crystaldesign/diva-core": "23.0.0-authmig.53",
|
|
32
|
+
"react": "17.0.2",
|
|
33
|
+
"react-dom": "17.0.2"
|
|
34
|
+
},
|
|
35
|
+
"module": "build/esm/index.js",
|
|
36
|
+
"types": "./build/types/content-item/src/index.d.ts",
|
|
37
|
+
"gitHead": "61c99d5fd3150ad262d16a70eef37cf606ba404d"
|
|
38
|
+
}
|