oolib 2.73.1 → 2.74.0

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.
@@ -1,190 +1,135 @@
1
- export namespace emptyStatesConfig {
2
- namespace communityListing {
3
- const layout: string;
4
- const img: string;
5
- const imgSize: number;
6
- const title: string;
7
- const subTitle: string;
8
- }
9
- namespace contentListing {
10
- const layout_1: string;
11
- export { layout_1 as layout };
12
- const img_1: string;
13
- export { img_1 as img };
14
- const imgSize_1: number;
15
- export { imgSize_1 as imgSize };
16
- const title_1: string;
17
- export { title_1 as title };
18
- const subTitle_1: string;
19
- export { subTitle_1 as subTitle };
20
- }
21
- namespace profileListing {
22
- const layout_2: string;
23
- export { layout_2 as layout };
24
- const img_2: string;
25
- export { img_2 as img };
26
- const imgSize_2: number;
27
- export { imgSize_2 as imgSize };
28
- const title_2: string;
29
- export { title_2 as title };
30
- const subTitle_2: string;
31
- export { subTitle_2 as subTitle };
32
- }
33
- namespace notificationEmpty {
34
- const layout_3: string;
35
- export { layout_3 as layout };
36
- const img_3: string;
37
- export { img_3 as img };
38
- const imgSize_3: number;
39
- export { imgSize_3 as imgSize };
40
- export const opacity: number;
41
- const title_3: string;
42
- export { title_3 as title };
43
- const subTitle_3: string;
44
- export { subTitle_3 as subTitle };
45
- }
46
- namespace dashboardListing {
47
- const layout_4: string;
48
- export { layout_4 as layout };
49
- const img_4: string;
50
- export { img_4 as img };
51
- const imgSize_4: number;
52
- export { imgSize_4 as imgSize };
53
- const title_4: string;
54
- export { title_4 as title };
55
- const subTitle_4: string;
56
- export { subTitle_4 as subTitle };
57
- }
58
- namespace successFullyPublish {
59
- const layout_5: string;
60
- export { layout_5 as layout };
61
- const img_5: string;
62
- export { img_5 as img };
63
- const imgSize_5: number;
64
- export { imgSize_5 as imgSize };
65
- const opacity_1: number;
66
- export { opacity_1 as opacity };
67
- const title_5: string;
68
- export { title_5 as title };
69
- const subTitle_5: string;
70
- export { subTitle_5 as subTitle };
71
- }
72
- namespace draftsListing {
73
- const layout_6: string;
74
- export { layout_6 as layout };
75
- const img_6: string;
76
- export { img_6 as img };
77
- const imgSize_6: number;
78
- export { imgSize_6 as imgSize };
79
- const title_6: string;
80
- export { title_6 as title };
81
- const subTitle_6: string;
82
- export { subTitle_6 as subTitle };
83
- export namespace action {
84
- const btnText: string;
85
- }
86
- }
87
- namespace publishedListing {
88
- const layout_7: string;
89
- export { layout_7 as layout };
90
- const img_7: string;
91
- export { img_7 as img };
92
- const imgSize_7: number;
93
- export { imgSize_7 as imgSize };
94
- const title_7: string;
95
- export { title_7 as title };
96
- const subTitle_7: string;
97
- export { subTitle_7 as subTitle };
98
- export namespace action_1 {
99
- const btnText_1: string;
100
- export { btnText_1 as btnText };
101
- }
102
- export { action_1 as action };
103
- }
104
- namespace inModerationListing {
105
- const layout_8: string;
106
- export { layout_8 as layout };
107
- const img_8: string;
108
- export { img_8 as img };
109
- const imgSize_8: number;
110
- export { imgSize_8 as imgSize };
111
- const title_8: string;
112
- export { title_8 as title };
113
- const subTitle_8: string;
114
- export { subTitle_8 as subTitle };
115
- export namespace action_2 {
116
- const btnText_2: string;
117
- export { btnText_2 as btnText };
118
- }
119
- export { action_2 as action };
120
- }
121
- namespace underMyModeration {
122
- const layout_9: string;
123
- export { layout_9 as layout };
124
- const img_9: string;
125
- export { img_9 as img };
126
- const imgSize_9: number;
127
- export { imgSize_9 as imgSize };
128
- const title_9: string;
129
- export { title_9 as title };
130
- const subTitle_9: string;
131
- export { subTitle_9 as subTitle };
132
- }
133
- namespace underOthersModeration {
134
- const layout_10: string;
135
- export { layout_10 as layout };
136
- const img_10: string;
137
- export { img_10 as img };
138
- const imgSize_10: number;
139
- export { imgSize_10 as imgSize };
140
- const title_10: string;
141
- export { title_10 as title };
142
- const subTitle_10: string;
143
- export { subTitle_10 as subTitle };
144
- }
145
- namespace awaitingMod {
146
- const layout_11: string;
147
- export { layout_11 as layout };
148
- const img_11: string;
149
- export { img_11 as img };
150
- const imgSize_11: number;
151
- export { imgSize_11 as imgSize };
152
- const title_11: string;
153
- export { title_11 as title };
154
- const subTitle_11: string;
155
- export { subTitle_11 as subTitle };
156
- }
157
- namespace searchListing {
158
- const layout_12: string;
159
- export { layout_12 as layout };
160
- const img_12: string;
161
- export { img_12 as img };
162
- const title_12: string;
163
- export { title_12 as title };
164
- const subTitle_12: string;
165
- export { subTitle_12 as subTitle };
166
- export namespace additionalAction {
167
- const text: string;
168
- }
169
- }
170
- namespace searchDashBoardListing {
171
- const layout_13: string;
172
- export { layout_13 as layout };
173
- const img_13: string;
174
- export { img_13 as img };
175
- const title_13: string;
176
- export { title_13 as title };
177
- const subTitle_13: string;
178
- export { subTitle_13 as subTitle };
179
- }
180
- namespace learningModule {
181
- const layout_14: string;
182
- export { layout_14 as layout };
183
- const img_14: string;
184
- export { img_14 as img };
185
- const title_14: string;
186
- export { title_14 as title };
187
- const subTitle_14: string;
188
- export { subTitle_14 as subTitle };
189
- }
190
- }
1
+ export function emptyStatesConfig({ contentTypeTitle, tags }?: {
2
+ contentTypeTitle?: string;
3
+ tags?: any[];
4
+ }): {
5
+ multipleCollectionsListing: {
6
+ layout: string;
7
+ img: string;
8
+ imgSize: number;
9
+ title: string;
10
+ subTitle: string;
11
+ };
12
+ singlePublishingListing: {
13
+ layout: string;
14
+ img: string;
15
+ imgSize: number;
16
+ title: string;
17
+ subTitle: string;
18
+ };
19
+ multiplePublishingListing: {
20
+ layout: string;
21
+ img: string;
22
+ imgSize: number;
23
+ title: string;
24
+ subTitle: string;
25
+ };
26
+ singleCollectionsListing: {
27
+ layout: string;
28
+ img: string;
29
+ imgSize: number;
30
+ title: string;
31
+ subTitle: string;
32
+ };
33
+ profileListing: {
34
+ layout: string;
35
+ img: string;
36
+ imgSize: number;
37
+ title: string;
38
+ subTitle: string;
39
+ };
40
+ notificationEmpty: {
41
+ layout: string;
42
+ img: string;
43
+ imgSize: number;
44
+ opacity: number;
45
+ title: string;
46
+ subTitle: string;
47
+ };
48
+ dashboardListing: {
49
+ layout: string;
50
+ img: string;
51
+ imgSize: number;
52
+ title: string;
53
+ subTitle: string;
54
+ };
55
+ successFullyPublish: {
56
+ layout: string;
57
+ img: string;
58
+ imgSize: number;
59
+ opacity: number;
60
+ title: string;
61
+ subTitle: string;
62
+ };
63
+ draftsListing: {
64
+ layout: string;
65
+ img: string;
66
+ imgSize: number;
67
+ title: string;
68
+ subTitle: string;
69
+ action: {
70
+ btnText: string;
71
+ };
72
+ };
73
+ publishedListing: {
74
+ layout: string;
75
+ img: string;
76
+ imgSize: number;
77
+ title: string;
78
+ subTitle: string;
79
+ action: {
80
+ btnText: string;
81
+ };
82
+ };
83
+ inModerationListing: {
84
+ layout: string;
85
+ img: string;
86
+ imgSize: number;
87
+ title: string;
88
+ subTitle: string;
89
+ action: {
90
+ btnText: string;
91
+ };
92
+ };
93
+ underMyModeration: {
94
+ layout: string;
95
+ img: string;
96
+ imgSize: number;
97
+ title: string;
98
+ subTitle: string;
99
+ };
100
+ underOthersModeration: {
101
+ layout: string;
102
+ img: string;
103
+ imgSize: number;
104
+ title: string;
105
+ subTitle: string;
106
+ };
107
+ awaitingMod: {
108
+ layout: string;
109
+ img: string;
110
+ imgSize: number;
111
+ title: string;
112
+ subTitle: string;
113
+ };
114
+ searchListing: {
115
+ layout: string;
116
+ img: string;
117
+ title: string;
118
+ subTitle: string;
119
+ additionalAction: {
120
+ text: string;
121
+ };
122
+ };
123
+ searchDashBoardListing: {
124
+ layout: string;
125
+ img: string;
126
+ title: string;
127
+ subTitle: string;
128
+ };
129
+ learningModule: {
130
+ layout: string;
131
+ img: string;
132
+ title: string;
133
+ subTitle: string;
134
+ };
135
+ };
@@ -1,125 +1,144 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.emptyStatesConfig = void 0;
4
- exports.emptyStatesConfig = {
5
- communityListing: {
6
- layout: "center",
7
- img: "contentListing",
8
- imgSize: 80,
9
- title: "No Community Added",
10
- subTitle: "Once you publish any community on the platform, it shows up here. You can edit published community in future, when required. "
11
- },
12
- contentListing: {
13
- layout: "center",
14
- img: "contentListing",
15
- imgSize: 80,
16
- title: "No Content Added",
17
- subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required. "
18
- },
19
- profileListing: {
20
- layout: "center",
21
- img: "contentListing",
22
- imgSize: 80,
23
- title: "No Profile Added",
24
- subTitle: "Once you publish any profile on the platform, it shows up here. You can edit profile content in future, when required. "
25
- },
26
- notificationEmpty: {
27
- layout: "center",
28
- img: "mailBoxImg",
29
- imgSize: 80,
30
- opacity: 0.6,
31
- title: "No Notifications Yet",
32
- subTitle: "All updates,notifications and alerts will be displayed here "
33
- },
34
- dashboardListing: {
35
- layout: "center",
36
- img: "dashboardListing",
37
- imgSize: 80,
38
- title: "No Data Added",
39
- subTitle: "Currently, no data is available. Start exploring insights once data is populated "
40
- },
41
- successFullyPublish: {
42
- layout: "center",
43
- img: "congratulationsImg",
44
- imgSize: 150,
45
- opacity: 1,
46
- title: "Content Published Successfully",
47
- subTitle: " "
48
- },
49
- draftsListing: {
50
- layout: "left",
51
- img: "draftsListing",
52
- imgSize: 80,
53
- title: "No Drafts Found",
54
- subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
55
- action: {
56
- // route: "/choose-template",
57
- btnText: "Start Writing",
4
+ var emptyStatesConfig = function (_a) {
5
+ var _b = _a === void 0 ? {} : _a, _c = _b.contentTypeTitle, contentTypeTitle = _c === void 0 ? "default" : _c, _d = _b.tags, tags = _d === void 0 ? [] : _d;
6
+ var commaSeparatedTags = tags.map(function (item) { return item.toLowerCase(); }).join(',');
7
+ return {
8
+ multipleCollectionsListing: {
9
+ layout: "center",
10
+ img: "contentListing",
11
+ imgSize: 80,
12
+ title: "No tags added",
13
+ subTitle: "Publishing under ".concat(commaSeparatedTags, " shows all tagged content here, You can edit published content in future, when required.")
14
+ },
15
+ singlePublishingListing: {
16
+ layout: "center",
17
+ img: "contentListing",
18
+ imgSize: 80,
19
+ title: "No ".concat(contentTypeTitle.toLowerCase(), " Added"),
20
+ subTitle: "Publishing under ".concat(contentTypeTitle.toLowerCase(), " shows your content here, You can edit published content in future, when required.")
21
+ },
22
+ multiplePublishingListing: {
23
+ layout: "center",
24
+ img: "contentListing",
25
+ imgSize: 80,
26
+ title: "No Content Added",
27
+ subTitle: "Once you publish content on the platform, it shows up here. You can edit published content in future, when required. "
28
+ },
29
+ singleCollectionsListing: {
30
+ layout: "center",
31
+ img: "contentListing",
32
+ imgSize: 80,
33
+ title: "No ".concat(contentTypeTitle.toLowerCase(), " Added"),
34
+ subTitle: "Publishing under ".concat(contentTypeTitle.toLowerCase(), " shows your content here, You can edit published content in future, when required.")
35
+ },
36
+ profileListing: {
37
+ layout: "center",
38
+ img: "contentListing",
39
+ imgSize: 80,
40
+ title: "No Profile Added",
41
+ subTitle: "Once you publish any profile on the platform, it shows up here. You can edit profile content in future, when required. "
42
+ },
43
+ notificationEmpty: {
44
+ layout: "center",
45
+ img: "mailBoxImg",
46
+ imgSize: 80,
47
+ opacity: 0.6,
48
+ title: "No Notifications Yet",
49
+ subTitle: "All updates,notifications and alerts will be displayed here "
50
+ },
51
+ dashboardListing: {
52
+ layout: "center",
53
+ img: "dashboardListing",
54
+ imgSize: 80,
55
+ title: "No Data Added",
56
+ subTitle: "Currently, no data is available. Start exploring insights once data is populated "
57
+ },
58
+ successFullyPublish: {
59
+ layout: "center",
60
+ img: "congratulationsImg",
61
+ imgSize: 150,
62
+ opacity: 1,
63
+ title: "Content Published Successfully",
64
+ subTitle: " "
65
+ },
66
+ draftsListing: {
67
+ layout: "left",
68
+ img: "draftsListing",
69
+ imgSize: 80,
70
+ title: "No Drafts Found",
71
+ subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
72
+ action: {
73
+ // route: "/choose-template",
74
+ btnText: "Start Writing",
75
+ }
76
+ },
77
+ publishedListing: {
78
+ layout: "left",
79
+ img: "publishedListing",
80
+ imgSize: 80,
81
+ title: "No published content found",
82
+ subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
83
+ action: {
84
+ // route: "/choose-template",
85
+ btnText: "Start Writing",
86
+ }
87
+ },
88
+ inModerationListing: {
89
+ layout: "left",
90
+ img: "moderationListing",
91
+ imgSize: 80,
92
+ title: "No content sent for moderation",
93
+ subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
94
+ action: {
95
+ // route: "/choose-template",
96
+ btnText: "Start Writing",
97
+ }
98
+ },
99
+ underMyModeration: {
100
+ layout: "left",
101
+ img: "moderationListing",
102
+ imgSize: 80,
103
+ title: "No published content under my moderation",
104
+ subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required."
105
+ },
106
+ underOthersModeration: {
107
+ layout: "left",
108
+ img: "moderationListing",
109
+ imgSize: 80,
110
+ title: "No published content under others moderation",
111
+ subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required."
112
+ },
113
+ awaitingMod: {
114
+ layout: "left",
115
+ img: "moderationListing",
116
+ imgSize: 80,
117
+ title: "No published content under awaiting moderation",
118
+ subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required."
119
+ },
120
+ searchListing: {
121
+ layout: "center",
122
+ img: "searchListing",
123
+ title: "Cant find any content for",
124
+ subTitle: "Sorry we couldn’t find any matches for this. Please make sure the words are spelled correctly",
125
+ additionalAction: {
126
+ // onClick: action,
127
+ text: 'Clear Search'
128
+ }
129
+ },
130
+ searchDashBoardListing: {
131
+ layout: "center",
132
+ img: "searchDashBoardListing",
133
+ title: "No search results found",
134
+ subTitle: "Sorry we couldn’t find any matches for this. Please make sure the words are spelled correctly "
135
+ },
136
+ learningModule: {
137
+ layout: "center",
138
+ img: "learningModule",
139
+ title: "No lesson added",
140
+ subTitle: "Looks like no lesson module has been assigned to you. Reach out to your Change leader and discuss what modules you'd like to study. "
58
141
  }
59
- },
60
- publishedListing: {
61
- layout: "left",
62
- img: "publishedListing",
63
- imgSize: 80,
64
- title: "No published content found",
65
- subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
66
- action: {
67
- // route: "/choose-template",
68
- btnText: "Start Writing",
69
- }
70
- },
71
- inModerationListing: {
72
- layout: "left",
73
- img: "moderationListing",
74
- imgSize: 80,
75
- title: "No content sent for moderation",
76
- subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
77
- action: {
78
- // route: "/choose-template",
79
- btnText: "Start Writing",
80
- }
81
- },
82
- underMyModeration: {
83
- layout: "left",
84
- img: "moderationListing",
85
- imgSize: 80,
86
- title: "No published content under my moderation",
87
- subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required."
88
- },
89
- underOthersModeration: {
90
- layout: "left",
91
- img: "moderationListing",
92
- imgSize: 80,
93
- title: "No published content under others moderation",
94
- subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required."
95
- },
96
- awaitingMod: {
97
- layout: "left",
98
- img: "moderationListing",
99
- imgSize: 80,
100
- title: "No published content under awaiting moderation",
101
- subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required."
102
- },
103
- searchListing: {
104
- layout: "center",
105
- img: "searchListing",
106
- title: "Cant find any content for",
107
- subTitle: "Sorry we couldn’t find any matches for this. Please make sure the words are spelled correctly",
108
- additionalAction: {
109
- // onClick: action,
110
- text: 'Clear Search'
111
- }
112
- },
113
- searchDashBoardListing: {
114
- layout: "center",
115
- img: "searchDashBoardListing",
116
- title: "No search results found",
117
- subTitle: "Sorry we couldn’t find any matches for this. Please make sure the words are spelled correctly "
118
- },
119
- learningModule: {
120
- layout: "center",
121
- img: "learningModule",
122
- title: "No lesson added",
123
- subTitle: "Looks like no lesson module has been assigned to you. Reach out to your Change leader and discuss what modules you'd like to study. "
124
- }
142
+ };
125
143
  };
144
+ exports.emptyStatesConfig = emptyStatesConfig;
@@ -1,9 +1,11 @@
1
- export function EmptyStates({ preset, actionOnClick, additionalActionOnClick, titleStyle, subTitleStyle, title: titleProp }: {
1
+ export function EmptyStates({ preset, actionOnClick, additionalActionOnClick, titleStyle, subTitleStyle, title: titleProp, contentTypeTitle, tags }: {
2
2
  preset: any;
3
3
  actionOnClick: any;
4
4
  additionalActionOnClick: any;
5
5
  titleStyle: any;
6
6
  subTitleStyle: any;
7
7
  title: any;
8
+ contentTypeTitle: any;
9
+ tags: any;
8
10
  }): React.JSX.Element;
9
11
  import React from "react";
@@ -31,8 +31,8 @@ var dashboardListing_svg_1 = __importDefault(require("../../assets/images/dashbo
31
31
  var styled_components_1 = __importDefault(require("styled-components"));
32
32
  var StyledContainer = (0, styled_components_1.default)(Container_1.Container)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n display: ", ";\n justify-content: \"center\";\n text-align: ", ";\n\n ", " {\n padding: ", ";\n }\n"], ["\n padding: ", ";\n display: ", ";\n justify-content: \"center\";\n text-align: ", ";\n\n ", " {\n padding: ", ";\n }\n"])), function (props) { return (props.layout === "center" ? "2rem 0rem" : "4rem 0"); }, function (props) { return props.layout === "center" && "flex"; }, function (props) { return props.layout === "center" && "center"; }, (0, mixins_1.mediaQuery)("sm"), function (props) { return (props.layout === "center" ? "4rem 0" : "6rem 0"); });
33
33
  var EmptyStates = function (_a) {
34
- var preset = _a.preset, actionOnClick = _a.actionOnClick, additionalActionOnClick = _a.additionalActionOnClick, titleStyle = _a.titleStyle, subTitleStyle = _a.subTitleStyle, titleProp = _a.title;
35
- var _b = config_1.emptyStatesConfig[preset], img = _b.img, imgSize = _b.imgSize, titleConfig = _b.title, subTitle = _b.subTitle, action = _b.action, additionalAction = _b.additionalAction, layout = _b.layout, opacity = _b.opacity;
34
+ var preset = _a.preset, actionOnClick = _a.actionOnClick, additionalActionOnClick = _a.additionalActionOnClick, titleStyle = _a.titleStyle, subTitleStyle = _a.subTitleStyle, titleProp = _a.title, contentTypeTitle = _a.contentTypeTitle, tags = _a.tags;
35
+ var _b = (0, config_1.emptyStatesConfig)({ contentTypeTitle: contentTypeTitle, tags: tags })[preset], img = _b.img, imgSize = _b.imgSize, titleConfig = _b.title, subTitle = _b.subTitle, action = _b.action, additionalAction = _b.additionalAction, layout = _b.layout, opacity = _b.opacity;
36
36
  var title = titleProp || titleConfig; //if a title prop is provided, it overrides title from config
37
37
  var imgConfig = {
38
38
  publishedListing: publishedListing_svg_1.default,
@@ -0,0 +1,8 @@
1
+ export function Embed({ isBlock, readOnly, value, isValidURL, onChange }: {
2
+ isBlock: any;
3
+ readOnly: any;
4
+ value: any;
5
+ isValidURL: any;
6
+ onChange: any;
7
+ }): React.JSX.Element;
8
+ import React from "react";
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Embed = void 0;
27
+ var react_1 = __importStar(require("react"));
28
+ var styled_1 = require("../styled");
29
+ var mixins_1 = require("../../../themes/mixins");
30
+ // import DisplayCoachmark from '../utils/DisplayCoachmark'
31
+ var embadableUrl_1 = require("../utils/embadableUrl");
32
+ var _EXPORTS_1 = require("../../../utils/_EXPORTS");
33
+ var styled_components_1 = require("styled-components");
34
+ var Embed = function (_a) {
35
+ var isBlock = _a.isBlock, readOnly = _a.readOnly, value = _a.value, isValidURL = _a.isValidURL, onChange = _a.onChange;
36
+ var theme = (0, styled_components_1.useTheme)();
37
+ var user = ((theme === null || theme === void 0 ? void 0 : theme.useGetQueryData('userData')) || {}).user;
38
+ var screenWidth = (0, _EXPORTS_1.useScreenWidth)();
39
+ var embedRef = (0, react_1.useRef)(null);
40
+ return (react_1.default.createElement(styled_1.StyledEmbedPrview, { readOnly: readOnly },
41
+ react_1.default.createElement(styled_1.StyledEmbedWrapper, null,
42
+ react_1.default.createElement(styled_1.StyledEmbed // styled iFrame element
43
+ , { src: (0, embadableUrl_1.embadableURL)(value, isValidURL), ref: isBlock && embedRef, width: "100%", height: "100%", allowFullScreen: true, mozallowfullscreen: true, webkitallowfullscreen: true, style: { border: 0 } }))));
44
+ };
45
+ exports.Embed = Embed;
@@ -0,0 +1,14 @@
1
+ export default IFrame;
2
+ declare function IFrame({ label, sublabel, value, placeholder, onChange, readOnly, isRequired, errorMsgs, isInRTE, invert, }: {
3
+ label: any;
4
+ sublabel: any;
5
+ value: any;
6
+ placeholder: any;
7
+ onChange: any;
8
+ readOnly: any;
9
+ isRequired: any;
10
+ errorMsgs: any;
11
+ isInRTE: any;
12
+ invert: any;
13
+ }): React.JSX.Element;
14
+ import React from "react";
@@ -0,0 +1,66 @@
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ var __importDefault = (this && this.__importDefault) || function (mod) {
37
+ return (mod && mod.__esModule) ? mod : { "default": mod };
38
+ };
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ var react_1 = __importStar(require("react"));
41
+ var react_player_1 = __importDefault(require("react-player"));
42
+ var themes_1 = require("../../themes");
43
+ var TextInputs_1 = require("../TextInputs");
44
+ var Typo_1 = require("../Typo");
45
+ var Embed_1 = require("./comps/Embed");
46
+ function IFrame(_a) {
47
+ var label = _a.label, sublabel = _a.sublabel, value = _a.value, placeholder = _a.placeholder, onChange = _a.onChange, readOnly = _a.readOnly, isRequired = _a.isRequired, errorMsgs = _a.errorMsgs, isInRTE = _a.isInRTE, invert = _a.invert;
48
+ var _b = (0, react_1.useState)(true), isValidURL = _b[0], setIsValidURL = _b[1];
49
+ var createEmbedPreview = function () {
50
+ switch (true) {
51
+ case !value:
52
+ return (react_1.default.createElement(Typo_1.SANS_0, { bold: true, invert: true }, "paste a value above to view preview of Google Slide"));
53
+ case react_player_1.default.canPlay(value): // We don't want to show video if it is valid video url
54
+ return (react_1.default.createElement(Typo_1.SANS_0, { color: themes_1.colors.red }, "Video Links are not allowed"));
55
+ default:
56
+ return react_1.default.createElement(Embed_1.Embed, __assign({}, __assign(__assign({}, readOnly), { value: value, isValidURL: isValidURL, onChange: onChange })));
57
+ }
58
+ };
59
+ return (react_1.default.createElement(react_1.Fragment, null, readOnly ?
60
+ react_1.default.createElement(Embed_1.Embed, __assign({}, __assign(__assign({}, readOnly), { value: value, isValidURL: isValidURL, onChange: onChange }), { isBlock: true }))
61
+ :
62
+ react_1.default.createElement(react_1.default.Fragment, null,
63
+ react_1.default.createElement(TextInputs_1.URLInput, { placeholder: placeholder || 'Enter a valid embedable url', onChange: function (k, v) { return onChange(k, v); }, value: value, isRequired: isRequired, label: label, S: true, invert: invert, readOnly: readOnly, sublabel: sublabel, passValidationErrorToFormValidation: function (type) { return type === "error" ? setIsValidURL(false) : setIsValidURL(true); }, icon: "LinkSimple", clearBtn: !isInRTE && { text: "Clear", onClick: function () { return onChange(undefined); }, invert: invert } }),
64
+ createEmbedPreview())));
65
+ }
66
+ exports.default = IFrame;
@@ -0,0 +1,4 @@
1
+ export const StyledEmbedPrview: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export const StyledEmbedWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export const StyledEmbed: import("styled-components").StyledComponent<"iframe", any, {}, never>;
4
+ export const StyledPunchViewerContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,21 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
7
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.StyledPunchViewerContainer = exports.StyledEmbed = exports.StyledEmbedWrapper = exports.StyledEmbedPrview = void 0;
11
+ var styled_components_1 = __importDefault(require("styled-components"));
12
+ var themes_1 = require("../../themes");
13
+ var white = themes_1.colors.white;
14
+ exports.StyledEmbedPrview = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n /* padding-top: 2rem; */\n padding-top: ", "\n"], ["\n display: flex;\n /* padding-top: 2rem; */\n padding-top: ", "\n"])), function (_a) {
15
+ var readOnly = _a.readOnly;
16
+ return !readOnly && "2rem";
17
+ });
18
+ exports.StyledEmbedWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n padding-top: 62%;\n height: 0;\n width: 100%;\n"], ["\n position: relative;\n padding-top: 62%;\n height: 0;\n width: 100%;\n"])));
19
+ exports.StyledEmbed = styled_components_1.default.iframe(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"])));
20
+ exports.StyledPunchViewerContainer = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n"], ["\n background-color: ", ";\n"])), white);
21
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -0,0 +1 @@
1
+ export function embadableURL(value: any, isValidURL: any): any;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.embadableURL = void 0;
4
+ var filters_1 = require("./filters");
5
+ var injectHttps_1 = require("../../../utils/injectHttps");
6
+ var embadableURL = function (value, isValidURL) {
7
+ switch (true) {
8
+ case value === null || value === void 0 ? void 0 : value.includes('docs.google.com'):
9
+ return (0, filters_1.filterPPTURL)(value);
10
+ case value === null || value === void 0 ? void 0 : value.includes('<iframe'):
11
+ return (0, filters_1.filterIFrameURL)(value);
12
+ default:
13
+ return isValidURL && (0, injectHttps_1.injectHttps)(value);
14
+ }
15
+ };
16
+ exports.embadableURL = embadableURL;
@@ -0,0 +1,2 @@
1
+ export function filterPPTURL(address: any): any;
2
+ export function filterIFrameURL(address: any): string;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filterIFrameURL = exports.filterPPTURL = void 0;
4
+ function filterPPTURL(address) {
5
+ if (address) {
6
+ if (address.search('google') > -1) {
7
+ var url = /\/edit/.test(address) ? (address.split('/edit')[0]) : address;
8
+ if (!url.includes('embed')) {
9
+ return url + '/embed?start=false&loop=false&delayms=3000';
10
+ }
11
+ return url;
12
+ }
13
+ }
14
+ }
15
+ exports.filterPPTURL = filterPPTURL;
16
+ function filterIFrameURL(address) {
17
+ var tempElement = document.createElement('div');
18
+ tempElement.innerHTML = address;
19
+ var srcValue = tempElement.querySelector('iframe').getAttribute('src');
20
+ return srcValue;
21
+ }
22
+ exports.filterIFrameURL = filterIFrameURL;
package/dist/index.d.ts CHANGED
@@ -58,6 +58,7 @@ export { ImageInput } from "./components/ImageInput";
58
58
  export { ProfileImageInput } from "./components/ImageInput/derivedComps/ProfileImageInput";
59
59
  export { default as VideoInput } from "./components/VideoInput";
60
60
  export { default as AudioInput } from "./components/AudioInput";
61
+ export { default as IFrame } from "./components/IFrame";
61
62
  export { SimpleTable } from "./components/SimpleTable";
62
63
  export { LoaderCircle, ProgressBar, LoaderCircle as Loader, LoaderOverlay } from "./components/LoadersAndProgress";
63
64
  export { BannerAlert, BannerInfo } from "./components/Banners";
package/dist/index.js CHANGED
@@ -17,8 +17,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.BannerContext = exports.BannerInfo = exports.BannerAlert = exports.AudioInput = exports.VideoInput = exports.ProfileImageInput = exports.ImageInput = exports.MetaBlock = exports.HintsProvider = exports.genTagComp = exports.generateOptions = exports.OptionsSingle = exports.DropdownMulti = exports.DropdownSingle = exports.parseCardConfig = exports.ListProfile = exports.CardProfile = exports.CardEmbed = exports.ListContent = exports.CardContent = exports.DateTimeRangePicker = exports.DateTimePicker = exports.TimeRangePicker = exports.TimePicker = exports.DateRangePicker = exports.DatePicker = exports.TextLoader = exports.BarChart = exports.PageScrollIndicator = exports.HomeCover = exports.EmptyStates = exports.ModalSmall = exports.ModalLarge = exports.ModalConfirm = exports.SkeletonLoader = exports.Divider = exports.PercentCompletedPie = exports.Accordion = exports.ActionMenu = exports.Tooltip = exports.OKELink = exports.UserRoleBadge = exports.Section = exports.LoaderOverlay = exports.Loader = exports.ProgressBar = exports.LoaderCircle = exports.icons = exports.colors = exports.GlobalStyles = void 0;
21
- exports.SimpleTable = exports.BannerProvider = exports.useBannerContext = void 0;
20
+ exports.BannerInfo = exports.BannerAlert = exports.IFrame = exports.AudioInput = exports.VideoInput = exports.ProfileImageInput = exports.ImageInput = exports.MetaBlock = exports.HintsProvider = exports.genTagComp = exports.generateOptions = exports.OptionsSingle = exports.DropdownMulti = exports.DropdownSingle = exports.parseCardConfig = exports.ListProfile = exports.CardProfile = exports.CardEmbed = exports.ListContent = exports.CardContent = exports.DateTimeRangePicker = exports.DateTimePicker = exports.TimeRangePicker = exports.TimePicker = exports.DateRangePicker = exports.DatePicker = exports.TextLoader = exports.BarChart = exports.PageScrollIndicator = exports.HomeCover = exports.EmptyStates = exports.ModalSmall = exports.ModalLarge = exports.ModalConfirm = exports.SkeletonLoader = exports.Divider = exports.PercentCompletedPie = exports.Accordion = exports.ActionMenu = exports.Tooltip = exports.OKELink = exports.UserRoleBadge = exports.Section = exports.LoaderOverlay = exports.Loader = exports.ProgressBar = exports.LoaderCircle = exports.icons = exports.colors = exports.GlobalStyles = void 0;
21
+ exports.SimpleTable = exports.BannerProvider = exports.useBannerContext = exports.BannerContext = void 0;
22
22
  //css and styling related ( styled-components )
23
23
  var globalStyles_1 = require("./globalStyles");
24
24
  Object.defineProperty(exports, "GlobalStyles", { enumerable: true, get: function () { return globalStyles_1.GlobalStyles; } });
@@ -143,6 +143,8 @@ var VideoInput_1 = require("./components/VideoInput");
143
143
  Object.defineProperty(exports, "VideoInput", { enumerable: true, get: function () { return __importDefault(VideoInput_1).default; } });
144
144
  var AudioInput_1 = require("./components/AudioInput");
145
145
  Object.defineProperty(exports, "AudioInput", { enumerable: true, get: function () { return __importDefault(AudioInput_1).default; } });
146
+ var IFrame_1 = require("./components/IFrame");
147
+ Object.defineProperty(exports, "IFrame", { enumerable: true, get: function () { return __importDefault(IFrame_1).default; } });
146
148
  //banners
147
149
  var Banners_1 = require("./components/Banners");
148
150
  Object.defineProperty(exports, "BannerAlert", { enumerable: true, get: function () { return Banners_1.BannerAlert; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.73.1",
3
+ "version": "2.74.0",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",