oolib 2.110.0 → 2.111.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.
- package/dist/UIContent/index.d.ts +17 -17
- package/dist/components/Accordion/index.d.ts +56 -13
- package/dist/components/Accordion/index.js +23 -31
- package/dist/components/Accordion/styled.d.ts +7 -7
- package/dist/components/Accordion/styled.js +7 -8
- package/dist/components/ActionMenu/index.js +2 -9
- package/dist/components/AudioInput/comps/AudioAction.d.ts +1 -1
- package/dist/components/AudioInput/comps/AudioPlayer.d.ts +1 -1
- package/dist/components/AudioInput/index.js +1 -1
- package/dist/components/Breadcrumbs/index.styled.d.ts +1 -1
- package/dist/components/Buttons/index.d.ts +32 -42
- package/dist/components/Buttons/index.js +3 -3
- package/dist/components/Coachmark/comps/MovingCoachmark/index.d.ts +3 -0
- package/dist/components/Coachmark/comps/MovingCoachmark/index.js +68 -0
- package/dist/components/Coachmark/comps/MovingCoachmark/styled.d.ts +2 -0
- package/dist/components/Coachmark/comps/MovingCoachmark/styled.js +45 -0
- package/dist/components/Coachmark/comps/MovingCoachmark/utils/index.d.ts +1 -0
- package/dist/components/Coachmark/comps/MovingCoachmark/utils/index.js +57 -0
- package/dist/components/Coachmark/config.d.ts +31 -0
- package/dist/components/Coachmark/config.js +61 -0
- package/dist/components/Coachmark/index.d.ts +4 -0
- package/dist/components/Coachmark/index.js +74 -0
- package/dist/components/Coachmark/styled.d.ts +1 -0
- package/dist/components/Coachmark/styled.js +37 -0
- package/dist/components/Coachmark/utils/index.d.ts +13 -0
- package/dist/components/Coachmark/utils/index.js +70 -0
- package/dist/components/DateRangePicker/index.d.ts +1 -1
- package/dist/components/DateTimePicker/index.styled.d.ts +0 -0
- package/dist/components/DateTimePicker/index.styled.js +0 -0
- package/dist/components/Dropdowns/DropdownMulti/index.js +4 -28
- package/dist/components/Dropdowns/DropdownSingle/index.js +4 -28
- package/dist/components/Dropdowns/comps/OptionsMulti/index.js +3 -30
- package/dist/components/Dropdowns/comps/OptionsShell/index.js +1 -11
- package/dist/components/Dropdowns/comps/OptionsSingle/index.js +2 -34
- package/dist/components/Dropdowns/comps/SelectDropdown/index.js +1 -12
- package/dist/components/Dropdowns/comps/VirtualizedWrapper/index.d.ts +1 -1
- package/dist/components/Dropdowns/utils/isDynamicOtherOption.d.ts +0 -0
- package/dist/components/Dropdowns/utils/isDynamicOtherOption.js +0 -0
- package/dist/components/EmptyStates/index.js +1 -12
- package/dist/components/FileUploadWrapper/comps/FileUploadShell.d.ts +1 -1
- package/dist/components/FileUploadWrapper/index.d.ts +1 -1
- package/dist/components/FileUploadWrapper/index.js +1 -12
- package/dist/components/IFrameInput/comps/Embed.d.ts +1 -1
- package/dist/components/IFrameInput/index.js +2 -2
- package/dist/components/IFrameInput/utils/DisplayCoachmark.d.ts +7 -0
- package/dist/components/IFrameInput/utils/DisplayCoachmark.js +83 -0
- package/dist/components/ImageInput/comps/GallerySlider/index.js +1 -16
- package/dist/components/ImageInput/comps/ImageEditor/comps/ConfirmDeleteModal/index.d.ts +1 -1
- package/dist/components/ImageInput/comps/ImageEditor/index.js +9 -65
- package/dist/components/ImageInput/comps/Placeholder/index.js +1 -17
- package/dist/components/ImageInput/comps/Placeholder/styled.d.ts +3 -0
- package/dist/components/ImageInput/comps/Placeholder/styled.js +39 -0
- package/dist/components/ImageInput/comps/SingleImageInput/index.js +1 -32
- package/dist/components/ImageInput/derivedComps/ImageDisplayInMask/index.js +1 -1
- package/dist/components/ImageInput/index.js +4 -26
- package/dist/components/InlineAlert/index.d.ts +25 -8
- package/dist/components/InlineAlert/index.js +16 -1
- package/dist/components/LegendRadioCheckList/LegendButton/index.d.ts +10 -0
- package/dist/components/LegendRadioCheckList/LegendButton/index.js +18 -0
- package/dist/components/LegendRadioCheckList/LegendButton/styled.d.ts +3 -0
- package/dist/components/LegendRadioCheckList/LegendButton/styled.js +22 -0
- package/dist/components/LegendRadioCheckList/LegendCheckboxList/index.d.ts +8 -0
- package/dist/components/LegendRadioCheckList/LegendCheckboxList/index.js +49 -0
- package/dist/components/LegendRadioCheckList/LegendCheckboxList/styled.d.ts +0 -0
- package/dist/components/LegendRadioCheckList/LegendCheckboxList/styled.js +0 -0
- package/dist/components/LegendRadioCheckList/LegendRadioList/index.d.ts +8 -0
- package/dist/components/LegendRadioCheckList/LegendRadioList/index.js +34 -0
- package/dist/components/LegendRadioCheckList/LegendRadioList/styled.d.ts +1 -0
- package/dist/components/LegendRadioCheckList/LegendRadioList/styled.js +13 -0
- package/dist/components/Lexical/Plugins/TableCellResizer/index.js +1 -26
- package/dist/components/LoadersAndProgress/LoaderCircle/index.js +2 -2
- package/dist/components/LoadersAndProgress/SkeletonLoader/index.d.ts +1 -1
- package/dist/components/Margins/index.d.ts +1 -1
- package/dist/components/Modals/Modal/styled.d.ts +2 -2
- package/dist/components/Modals/ModalConfirm/styled.d.ts +2 -2
- package/dist/components/OKELink/comps/AvatarDisplay/index.d.ts +8 -0
- package/dist/components/OKELink/comps/AvatarDisplay/index.js +19 -0
- package/dist/components/OKELink/comps/AvatarDisplay/styled.d.ts +2 -0
- package/dist/components/OKELink/comps/AvatarDisplay/styled.js +48 -0
- package/dist/components/OKELink/index.d.ts +1 -1
- package/dist/components/OKELink/index.js +2 -5
- package/dist/components/OKELink/utils/index.d.ts +6 -0
- package/dist/components/OKELink/utils/index.js +20 -0
- package/dist/components/PDFInput/comps/PDFActions.d.ts +1 -1
- package/dist/components/PDFInput/index.js +1 -1
- package/dist/components/Paddings/index.d.ts +1 -1
- package/dist/components/PercentCompletedPie/index.d.ts +19 -5
- package/dist/components/PercentCompletedPie/index.js +15 -5
- package/dist/components/PercentCompletedPie/styled.d.ts +17 -5
- package/dist/components/PercentCompletedPie/styled.js +26 -6
- package/dist/components/Playground/index.d.ts +4 -0
- package/dist/components/Playground/index.js +17 -0
- package/dist/components/Playground/styled.d.ts +1 -0
- package/dist/components/Playground/styled.js +14 -0
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/index.d.ts +1 -1
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/index.js +1 -12
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.d.ts +1 -1
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.js +3 -20
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/index.js +11 -7
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.js +4 -25
- package/dist/components/RadioAndCheckbox/comps/RadioList/index.js +6 -6
- package/dist/components/ResourceInput/comp/ResourceDisplayBlock.d.ts +1 -1
- package/dist/components/ResourceInput/index.d.ts +1 -1
- package/dist/components/SimpleTable/index.js +5 -22
- package/dist/components/SimpleTable/utils/convertColHeaderConfigToRowData.js +1 -1
- package/dist/components/SimpleTable/utils/convertRowHeaderConfigToCellData.js +1 -1
- package/dist/components/SimpleTable/utils/prepInitValueFromConfigIfNoValue.js +2 -2
- package/dist/components/Switches/index.js +5 -11
- package/dist/components/Tags/index.d.ts +1 -1
- package/dist/components/Tags/index.styled.d.ts +1 -1
- package/dist/components/TimePicker/styled.d.ts +1 -1
- package/dist/components/TimeRangePicker/index.styled.d.ts +0 -0
- package/dist/components/TimeRangePicker/index.styled.js +0 -0
- package/dist/components/Tooltip/index.d.ts +2 -3
- package/dist/components/Typo/index.js +1 -1
- package/dist/components/VideoInput/comps/VideoActionMenu.d.ts +1 -1
- package/dist/components/VideoInput/index.d.ts +1 -1
- package/dist/components/VideoInput/index.js +2 -21
- package/dist/components/Wrappers/WrapperCardGrid.d.ts +2 -0
- package/dist/components/Wrappers/WrapperCardGrid.js +19 -0
- package/dist/components/Wrappers/index.d.ts +1 -1
- package/dist/components/Wrappers/index.js +1 -1
- package/dist/components/cards/ListProfile/styled.d.ts +7 -0
- package/dist/components/cards/ListProfile/styled.js +23 -0
- package/dist/components/cards/utils/parseCardConfig.js +1 -1
- package/dist/d3Modules/index.d.ts +1 -0
- package/dist/d3Modules/index.js +1 -1
- package/dist/icons/custom/index.d.ts +1 -0
- package/dist/icons/custom/index.js +6 -1
- package/dist/icons/index.d.ts +112 -110
- package/dist/icons/index.js +2 -1
- package/dist/stories/Accordion.stories.d.ts +78 -0
- package/dist/stories/Accordion.stories.js +93 -0
- package/dist/stories/ActionMenu.stories.d.ts +166 -0
- package/dist/stories/ActionMenu.stories.js +140 -0
- package/dist/stories/AudioInput.stories.d.ts +20 -0
- package/dist/stories/AudioInput.stories.js +67 -0
- package/dist/stories/Banner.stories.d.ts +97 -0
- package/dist/stories/Banner.stories.js +126 -0
- package/dist/stories/BarChart.stories.d.ts +13 -0
- package/dist/stories/BarChart.stories.js +61 -0
- package/dist/stories/BlockLabel.stories.d.ts +71 -0
- package/dist/stories/BlockLabel.stories.js +106 -0
- package/dist/stories/Breadcrumbs.stories.d.ts +13 -0
- package/dist/stories/Breadcrumbs.stories.js +34 -0
- package/dist/stories/Button.stories.d.ts +209 -0
- package/dist/stories/Button.stories.js +164 -0
- package/dist/stories/Checkbox.stories.d.ts +248 -0
- package/dist/stories/Checkbox.stories.js +249 -0
- package/dist/stories/Colors.stories.d.ts +6 -0
- package/dist/stories/Colors.stories.js +66 -0
- package/dist/stories/DatePicker.stories.d.ts +239 -0
- package/dist/stories/DatePicker.stories.js +267 -0
- package/dist/stories/Divider.stories.d.ts +8 -0
- package/dist/stories/Divider.stories.js +28 -0
- package/dist/stories/Dropdowns.stories.d.ts +114 -0
- package/dist/stories/Dropdowns.stories.js +280 -0
- package/dist/stories/EmptyStates.stories.d.ts +63 -0
- package/dist/stories/EmptyStates.stories.js +69 -0
- package/dist/stories/HomeCover.stories.d.ts +55 -0
- package/dist/stories/HomeCover.stories.js +68 -0
- package/dist/stories/IFrameInput.stories.d.ts +32 -0
- package/dist/stories/IFrameInput.stories.js +51 -0
- package/dist/stories/ImageInput/ImageInput.stories.d.ts +263 -0
- package/dist/stories/ImageInput/ImageInput.stories.js +167 -0
- package/dist/stories/ImageInput/imageInputArgTypes.d.ts +121 -0
- package/dist/stories/ImageInput/imageInputArgTypes.js +78 -0
- package/dist/stories/ImageInput/imageInputParseArgTypes.d.ts +17 -0
- package/dist/stories/ImageInput/imageInputParseArgTypes.js +31 -0
- package/dist/stories/InlineAlert.stories.d.ts +62 -0
- package/dist/stories/InlineAlert.stories.js +62 -0
- package/dist/stories/Layout.stories.d.ts +161 -0
- package/dist/stories/Layout.stories.js +183 -0
- package/dist/stories/LegendRadioList.stories.d.ts +15 -0
- package/dist/stories/LegendRadioList.stories.js +73 -0
- package/dist/stories/Loaders.stories.d.ts +77 -0
- package/dist/stories/Loaders.stories.js +74 -0
- package/dist/stories/Modal.stories.d.ts +135 -0
- package/dist/stories/Modal.stories.js +146 -0
- package/dist/stories/ModalConfirmAction.stories.d.ts +13 -0
- package/dist/stories/ModalConfirmAction.stories.js +47 -0
- package/dist/stories/OKELink.stories.d.ts +72 -0
- package/dist/stories/OKELink.stories.js +110 -0
- package/dist/stories/PDFInput.stories.d.ts +20 -0
- package/dist/stories/PDFInput.stories.js +45 -0
- package/dist/stories/PageScrollIndicator.stories.d.ts +15 -0
- package/dist/stories/PageScrollIndicator.stories.js +26 -0
- package/dist/stories/PercentCompletedPi.stories.d.ts +55 -0
- package/dist/stories/PercentCompletedPi.stories.js +49 -0
- package/dist/stories/Playground.stories.d.ts +22 -0
- package/dist/stories/Playground.stories.js +26 -0
- package/dist/stories/Progress.stories.d.ts +45 -0
- package/dist/stories/Progress.stories.js +50 -0
- package/dist/stories/RadioButton.stories.d.ts +260 -0
- package/dist/stories/RadioButton.stories.js +264 -0
- package/dist/stories/ResourceInput.stories.d.ts +9 -0
- package/dist/stories/ResourceInput.stories.js +53 -0
- package/dist/stories/SimpleTable.stories.d.ts +65 -0
- package/dist/stories/SimpleTable.stories.js +111 -0
- package/dist/stories/SkeletonLoader.stories.d.ts +81 -0
- package/dist/stories/SkeletonLoader.stories.js +82 -0
- package/dist/stories/Switches.stories.d.ts +106 -0
- package/dist/stories/Switches.stories.js +136 -0
- package/dist/stories/TabBar.stories.d.ts +73 -0
- package/dist/stories/TabBar.stories.js +103 -0
- package/dist/stories/TagClear.stories.d.ts +57 -0
- package/dist/stories/TagClear.stories.js +76 -0
- package/dist/stories/TagDisplay.stories.d.ts +73 -0
- package/dist/stories/TagDisplay.stories.js +154 -0
- package/dist/stories/TagLink.stories.d.ts +59 -0
- package/dist/stories/TagLink.stories.js +65 -0
- package/dist/stories/TagSelect.stories.d.ts +41 -0
- package/dist/stories/TagSelect.stories.js +54 -0
- package/dist/stories/TagsInput.stories.d.ts +90 -0
- package/dist/stories/TagsInput.stories.js +168 -0
- package/dist/stories/TextInputs.stories.d.ts +124 -0
- package/dist/stories/TextInputs.stories.js +178 -0
- package/dist/stories/Tooltip.stories.d.ts +41 -0
- package/dist/stories/Tooltip.stories.js +78 -0
- package/dist/stories/Typo.stories.d.ts +304 -0
- package/dist/stories/Typo.stories.js +357 -0
- package/dist/stories/UserRoleBadge.stories.d.ts +19 -0
- package/dist/stories/UserRoleBadge.stories.js +46 -0
- package/dist/stories/Utilities.stories.d.ts +5 -0
- package/dist/stories/Utilities.stories.js +110 -0
- package/dist/stories/VideoInput.stories.d.ts +46 -0
- package/dist/stories/VideoInput.stories.js +49 -0
- package/dist/stories/cards/CardContent.stories.d.ts +67 -0
- package/dist/stories/cards/CardContent.stories.js +47 -0
- package/dist/stories/cards/CardEmbed.stories.d.ts +65 -0
- package/dist/stories/cards/CardEmbed.stories.js +46 -0
- package/dist/stories/cards/CardProfile.stories.d.ts +46 -0
- package/dist/stories/cards/CardProfile.stories.js +48 -0
- package/dist/stories/cards/ListContent.stories.d.ts +81 -0
- package/dist/stories/cards/ListContent.stories.js +50 -0
- package/dist/stories/cards/ListProfile.stories.d.ts +41 -0
- package/dist/stories/cards/ListProfile.stories.js +46 -0
- package/dist/stories/cards/utils/cardArgTypes.d.ts +182 -0
- package/dist/stories/cards/utils/cardArgTypes.js +114 -0
- package/dist/stories/cards/utils/parseCardArgs.d.ts +46 -0
- package/dist/stories/cards/utils/parseCardArgs.js +57 -0
- package/dist/themes/colors.d.ts +51 -0
- package/dist/utils/comps/DisplayIcon/index.d.ts +1 -1
- package/dist/utils/getBlockLabelProps.js +1 -1
- package/dist/utils/getterSetterDeleter/getVal_caseExamples.d.ts +60 -0
- package/dist/utils/getterSetterDeleter/getVal_caseExamples.js +91 -0
- package/dist/utilsOolib/StorybookBannersWrapper.d.ts +2 -0
- package/dist/utilsOolib/StorybookBannersWrapper.js +16 -0
- package/dist/utilsOolib/excludeKeys.d.ts +8 -0
- package/dist/utilsOolib/excludeKeys.js +31 -0
- package/dist/utilsOolib/genRandomHash.d.ts +7 -0
- package/dist/utilsOolib/genRandomHash.js +19 -0
- package/dist/utilsOolib/index.d.ts +12 -5
- package/dist/utilsOolib/index.js +11 -3
- package/dist/utilsOolib/renderRTEPlaceholderForOolibPreview.d.ts +8 -1
- package/dist/utilsOolib/renderRTEPlaceholderForOolibPreview.js +1 -2
- package/package.json +4 -3
- /package/dist/components/Buttons/{index.styled.d.ts → styled.d.ts} +0 -0
- /package/dist/components/Buttons/{index.styled.js → styled.js} +0 -0
|
File without changes
|
|
File without changes
|
|
@@ -1,15 +1,4 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
@@ -27,6 +16,6 @@ var EmptyStates = function (_a) {
|
|
|
27
16
|
commaSeparatedTags: commaSeparatedTags,
|
|
28
17
|
title: titleProp
|
|
29
18
|
}), image = _c.image, title = _c.title, subtitle = _c.subtitle, link = _c.link, button = _c.button, align = _c.align;
|
|
30
|
-
return (react_1.default.createElement(EmptyStatesRenderer_1.EmptyStatesRenderer,
|
|
19
|
+
return (react_1.default.createElement(EmptyStatesRenderer_1.EmptyStatesRenderer, { image: image, align: align, title: title, subtitle: subtitle, link: link, button: button, onClick: onClick, preset: preset }));
|
|
31
20
|
};
|
|
32
21
|
exports.EmptyStates = EmptyStates;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
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
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -46,6 +35,6 @@ var FileUploadWrapper = function (_a) {
|
|
|
46
35
|
return (react_1.default.createElement(styled_1.StyledPlaceholderWrapper, { smallPlaceholderUI: smallPlaceholderUI, ref: styledPlaceholderWrapperRef, dragOverActive: dragOverActive, width: width, height: height }, isLoading ? (react_1.default.createElement(ProgressBar_1.ProgressBar, { progress: uploadProgress, text: uploadProgress && uploadProgress !== 100
|
|
47
36
|
? uploadProgress + "%"
|
|
48
37
|
: "Almost Done..." })) : (react_1.default.createElement(FileUploadShell_1.FileUploadShell, { isLoading: isLoading, enableFilesDrop: enableFilesDrop, multiple: multiple, setDragOverActive: setDragOverActive, handleUpload: handleUpload, onChange: onChange, value: value, id: id, mediaType: mediaType, enableClickUpload: enableClickUpload },
|
|
49
|
-
react_1.default.createElement(styled_1.StyledPlaceholder,
|
|
38
|
+
react_1.default.createElement(styled_1.StyledPlaceholder, { containerShape: containerShape, smallPlaceholderUI: smallPlaceholderUI, enableClickUpload: enableClickUpload }, children)))));
|
|
50
39
|
};
|
|
51
40
|
exports.FileUploadWrapper = FileUploadWrapper;
|
|
@@ -53,11 +53,11 @@ function IFrameInput(_a) {
|
|
|
53
53
|
case react_player_1.default.canPlay(value): // We don't want to show video if it is valid video url
|
|
54
54
|
return (react_1.default.createElement(Typo_1.SANS_0, { color: themes_1.colors.red }, "Video Links are not allowed"));
|
|
55
55
|
default:
|
|
56
|
-
return react_1.default.createElement(Embed_1.Embed, __assign({},
|
|
56
|
+
return react_1.default.createElement(Embed_1.Embed, __assign({}, readOnly, { value: value, isValidURL: isValidURL, onChange: onChange }));
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
return (react_1.default.createElement(react_1.Fragment, null, readOnly ?
|
|
60
|
-
react_1.default.createElement(Embed_1.Embed, __assign({},
|
|
60
|
+
react_1.default.createElement(Embed_1.Embed, __assign({}, readOnly, { value: value, isValidURL: isValidURL, onChange: onChange, isBlock: true }))
|
|
61
61
|
:
|
|
62
62
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
63
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 } }),
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
var react_1 = __importStar(require("react"));
|
|
30
|
+
var config_1 = __importDefault(require("../../Coachmark/config"));
|
|
31
|
+
var index_1 = require("../../Coachmark/index");
|
|
32
|
+
var mixins_1 = require("../../../themes/mixins");
|
|
33
|
+
var DisplayCoachmark = function (_a, ref) {
|
|
34
|
+
var user = _a.user, url = _a.url, setUrl = _a.setUrl;
|
|
35
|
+
var _b = (0, index_1.useCoachmark)({ coachmarks: config_1.default.H5PEmbed, compIdentifier: "H5PEmbed" }), activeMark = _b.activeMark, rank = _b.rank, removeCoachmark = _b.removeCoachmark, showNextMark = _b.showNextMark, useReliableRef = _b.useReliableRef;
|
|
36
|
+
var optimizeForResize = function (func, delay) {
|
|
37
|
+
if (delay === void 0) { delay = 500; }
|
|
38
|
+
var timerId;
|
|
39
|
+
return function () {
|
|
40
|
+
clearTimeout(timerId);
|
|
41
|
+
timerId = setTimeout(func, delay);
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
ref = useReliableRef([0, 1]);
|
|
45
|
+
var showNextMarkOnTilt = function () {
|
|
46
|
+
var _a = document.documentElement, clientWidth = _a.clientWidth, clientHeight = _a.clientHeight;
|
|
47
|
+
if (activeMark === undefined) { // we are done coaching, this func ic called bec of the too many resize events registered
|
|
48
|
+
window.removeEventListener('resize', showNextOptimized);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (clientWidth > clientHeight) { // user tilited then pressed done
|
|
52
|
+
showNextMark();
|
|
53
|
+
}
|
|
54
|
+
else { // temporarily remove the mark & show next mark on tilt (recursion)
|
|
55
|
+
showNextMark(false);
|
|
56
|
+
window.addEventListener('resize', showNextOptimized);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
var showNextOptimized = optimizeForResize(showNextMarkOnTilt);
|
|
60
|
+
/* a hack to to avoid google slides bug of
|
|
61
|
+
height not autoAdjusting upon phone screen rotation,
|
|
62
|
+
we adjus it for 1 time (the time we show users the pop up to tilit the screen)
|
|
63
|
+
however.. it's unrelated to the normal flow of coachmarks
|
|
64
|
+
*/
|
|
65
|
+
(0, react_1.useEffect)(function () {
|
|
66
|
+
if (window.innerWidth < (0, mixins_1.getBreakPoint)('md')) { // only use the hack for mobile users
|
|
67
|
+
var windowWidth_1 = window.innerWidth;
|
|
68
|
+
var adjustSlidesHeight = function () {
|
|
69
|
+
if (windowWidth_1 === window.innerWidth)
|
|
70
|
+
return; // if resize was called for height change not width change
|
|
71
|
+
windowWidth_1 = window.innerWidth;
|
|
72
|
+
setUrl('');
|
|
73
|
+
setTimeout(function () { return setUrl(url); }, 300);
|
|
74
|
+
window.removeEventListener('resize', adjustOptimized_1);
|
|
75
|
+
};
|
|
76
|
+
var adjustOptimized_1 = optimizeForResize(adjustSlidesHeight, 100);
|
|
77
|
+
window.addEventListener('resize', adjustOptimized_1);
|
|
78
|
+
return function () { return window.removeEventListener('resize', adjustOptimized_1); };
|
|
79
|
+
}
|
|
80
|
+
}, []);
|
|
81
|
+
return (react_1.default.createElement(index_1.Coachmark, { active: (user === null || user === void 0 ? void 0 : user.coachmarkChecklist.H5PEmbed) === false && url && url.includes("h5p"), rank: rank, observerThreshold: 0.3, currentMark: activeMark, handleNext: showNextMarkOnTilt, handleSkip: removeCoachmark }));
|
|
82
|
+
};
|
|
83
|
+
exports.default = (0, react_1.forwardRef)(DisplayCoachmark);
|
|
@@ -1,15 +1,4 @@
|
|
|
1
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
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -71,10 +60,6 @@ var GallerySlider = function () {
|
|
|
71
60
|
}).handleDragStart;
|
|
72
61
|
return (react_1.default.createElement(styled_1.StyledGallery, { invert: invert },
|
|
73
62
|
react_1.default.createElement(GalleryThumbnails_1.GalleryThumbnails, { setActiveIdx: setActiveIdx, activeIdx: activeIdx }),
|
|
74
|
-
(value === null || value === void 0 ? void 0 : value.length) > 0 ? (react_1.default.createElement(SliderShell_1.SliderShell, { value: __spreadArray(__spreadArray([], uploadingPlaceholders, true), value, true), activeIdx: activeIdx, setActiveIdx: setActiveIdx, render: function (v) { return (react_1.default.createElement(SingleImageInput_1.SingleImageInput,
|
|
75
|
-
value: v,
|
|
76
|
-
handleDragStart: handleDragStart,
|
|
77
|
-
// key: v?.publicUrl || idx, //cuz this is done inside the SliderShell
|
|
78
|
-
}))); } })) : (react_1.default.createElement(Placeholder_1.default, null))));
|
|
63
|
+
(value === null || value === void 0 ? void 0 : value.length) > 0 ? (react_1.default.createElement(SliderShell_1.SliderShell, { value: __spreadArray(__spreadArray([], uploadingPlaceholders, true), value, true), activeIdx: activeIdx, setActiveIdx: setActiveIdx, render: function (v) { return (react_1.default.createElement(SingleImageInput_1.SingleImageInput, { value: v, handleDragStart: handleDragStart })); } })) : (react_1.default.createElement(Placeholder_1.default, null))));
|
|
79
64
|
};
|
|
80
65
|
exports.default = GallerySlider;
|
|
@@ -127,77 +127,21 @@ function ImageEditor(_a) {
|
|
|
127
127
|
var genModalStyleEditor = function () { return (react_1.default.createElement(Modal_1.Modal, { title: "Edit Image", fitToContentHeight: screenWidth >= (0, mixins_1.getBreakPoint)('sm') ? true : false, desktopWidth: "500px" },
|
|
128
128
|
react_1.default.createElement(Paddings_1.PaddingTop40, null,
|
|
129
129
|
react_1.default.createElement(ImageEditor, __assign({}, props, { id: 'insideModal', underEditImageData: underEditImageData, setUnderEditImageData: setUnderEditImageData, isInPopUp: true }))))); };
|
|
130
|
-
var genToolbarStyledEditor = function () { return (react_1.default.createElement(EditToolbar_1.EditToolbar,
|
|
131
|
-
|
|
132
|
-
underEditImageData: underEditImageData,
|
|
133
|
-
imageData: imageData,
|
|
134
|
-
handleSingleImageDataChange: handleSingleImageDataChange,
|
|
135
|
-
setImageUnderEdit: setImageUnderEdit,
|
|
136
|
-
imageSpread: imageSpread,
|
|
137
|
-
publicUrl: publicUrl,
|
|
138
|
-
defaultImageSpread: defaultImageSpread,
|
|
139
|
-
omitEditorTools: omitEditorTools,
|
|
140
|
-
isInPopUp: isInPopUp
|
|
141
|
-
}))); };
|
|
130
|
+
var genToolbarStyledEditor = function () { return (react_1.default.createElement(EditToolbar_1.EditToolbar, { setUnderEditImageData: setUnderEditImageData, underEditImageData: underEditImageData, imageData: imageData, handleSingleImageDataChange: handleSingleImageDataChange, setImageUnderEdit: setImageUnderEdit, //comes from ImageInput context if used inside it
|
|
131
|
+
imageSpread: imageSpread, publicUrl: publicUrl, defaultImageSpread: defaultImageSpread, omitEditorTools: omitEditorTools, isInPopUp: isInPopUp })); };
|
|
142
132
|
return (react_1.default.createElement("div", { id: id && id + '_ImageEditor', style: {
|
|
143
133
|
position: "relative",
|
|
144
134
|
height: stretchToFullHeight ? "100%" : "auto",
|
|
145
|
-
} }, imageLazyLoading && !modalStyleEditorIsCurrentlyOpen() ? (react_1.default.createElement(AspectRatioShell_1.default,
|
|
146
|
-
key: "loaderShell",
|
|
147
|
-
aspectRatio: aspectRatio,
|
|
148
|
-
stretchToFullHeight: stretchToFullHeight,
|
|
149
|
-
containerShape: containerShape,
|
|
150
|
-
disableImageBorder: disableImageBorder,
|
|
151
|
-
}),
|
|
135
|
+
} }, imageLazyLoading && !modalStyleEditorIsCurrentlyOpen() ? (react_1.default.createElement(AspectRatioShell_1.default, { key: "loaderShell", aspectRatio: aspectRatio, stretchToFullHeight: stretchToFullHeight, containerShape: containerShape, disableImageBorder: disableImageBorder },
|
|
152
136
|
react_1.default.createElement(SkeletonLoader_1.SkeletonLoader, { style: { height: "100%" } }))) : (react_1.default.createElement(react_1.Fragment, null,
|
|
153
|
-
react_1.default.createElement(AspectRatioShell_1.default,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
key: "imageShell",
|
|
157
|
-
aspectRatio: aspectRatio,
|
|
158
|
-
stretchToFullHeight: stretchToFullHeight,
|
|
159
|
-
containerShape: containerShape,
|
|
160
|
-
disableImageBorder: disableImageBorder,
|
|
161
|
-
onShellPrepared: decideEditorStyle,
|
|
162
|
-
}),
|
|
163
|
-
showDeleteImageModal && (react_1.default.createElement(ConfirmDeleteModal_1.ConfirmDeleteModal, __assign({}, {
|
|
164
|
-
showDeleteImageModal: showDeleteImageModal,
|
|
165
|
-
setShowDeleteImageModal: setShowDeleteImageModal,
|
|
166
|
-
handleDeleteSingleImage: handleDeleteSingleImage,
|
|
167
|
-
}))),
|
|
137
|
+
react_1.default.createElement(AspectRatioShell_1.default, { id: id, invert: invert, key: "imageShell", //by adding key we are forcing this AspectRatioShell to rerender, so that decideEditorStyle() calculation happens
|
|
138
|
+
aspectRatio: aspectRatio, stretchToFullHeight: stretchToFullHeight, containerShape: containerShape, disableImageBorder: disableImageBorder, onShellPrepared: decideEditorStyle },
|
|
139
|
+
showDeleteImageModal && (react_1.default.createElement(ConfirmDeleteModal_1.ConfirmDeleteModal, { showDeleteImageModal: showDeleteImageModal, setShowDeleteImageModal: setShowDeleteImageModal, handleDeleteSingleImage: handleDeleteSingleImage })),
|
|
168
140
|
react_1.default.createElement(styled_1.StyledFullWidthImgWrapper, { ref: wrapperRef, invert: invert, disableImageBorder: disableImageBorder },
|
|
169
|
-
react_1.default.createElement(styled_1.StyledImg,
|
|
170
|
-
ref: renderedImageRef,
|
|
171
|
-
fullWidthOrFullHeightImg: fullWidthOrFullHeightImg,
|
|
172
|
-
src: reorientedImageTempUrl || publicUrl,
|
|
173
|
-
imageSpread: imageSpread,
|
|
174
|
-
cropX: cropX,
|
|
175
|
-
cropY: cropY,
|
|
176
|
-
}, { onTouchStart: handleDragStart && handleDragStart, onMouseDown: handleDragStart && handleDragStart })),
|
|
141
|
+
react_1.default.createElement(styled_1.StyledImg, { ref: renderedImageRef, fullWidthOrFullHeightImg: fullWidthOrFullHeightImg, src: reorientedImageTempUrl || publicUrl, imageSpread: imageSpread, cropX: cropX, cropY: cropY, onTouchStart: handleDragStart && handleDragStart, onMouseDown: handleDragStart && handleDragStart }),
|
|
177
142
|
underEditImageData !== undefined &&
|
|
178
|
-
!omitEditorTools.includes("reposition") && (react_1.default.createElement(ImageReposManager_1.ImageReposManager,
|
|
179
|
-
|
|
180
|
-
wrapperRef: wrapperRef,
|
|
181
|
-
renderedImageRef: renderedImageRef,
|
|
182
|
-
setUnderEditImageData: setUnderEditImageData,
|
|
183
|
-
}))))),
|
|
184
|
-
!readOnly && (react_1.default.createElement(styled_1.StyledImageEditToolbar, __assign({}, {
|
|
185
|
-
underEditImageData: underEditImageData,
|
|
186
|
-
containerShape: containerShape,
|
|
187
|
-
isInPopUp: isInPopUp,
|
|
188
|
-
}), underEditImageData === undefined ? (react_1.default.createElement(ImageActionsMenu_1.ImageActionsMenu, __assign({}, {
|
|
189
|
-
id: id,
|
|
190
|
-
invert: invert,
|
|
191
|
-
setUnderEditImageData: setUnderEditImageData,
|
|
192
|
-
setImageUnderEdit: setImageUnderEdit,
|
|
193
|
-
inputRef: inputRef,
|
|
194
|
-
setShowDeleteImageModal: setShowDeleteImageModal,
|
|
195
|
-
publicUrl: publicUrl,
|
|
196
|
-
imageData: imageData,
|
|
197
|
-
handleReplaceSingleImage: handleReplaceSingleImage,
|
|
198
|
-
handleUpload: handleUpload,
|
|
199
|
-
isInRTE: isInRTE
|
|
200
|
-
}))) : editorStyle === "toolbar" ? (genToolbarStyledEditor()) : (editorStyle === "modal" && genModalStyleEditor()))),
|
|
143
|
+
!omitEditorTools.includes("reposition") && (react_1.default.createElement(ImageReposManager_1.ImageReposManager, { fullWidthOrFullHeightImg: fullWidthOrFullHeightImg, wrapperRef: wrapperRef, renderedImageRef: renderedImageRef, setUnderEditImageData: setUnderEditImageData })))),
|
|
144
|
+
!readOnly && (react_1.default.createElement(styled_1.StyledImageEditToolbar, { underEditImageData: underEditImageData, containerShape: containerShape, isInPopUp: isInPopUp }, underEditImageData === undefined ? (react_1.default.createElement(ImageActionsMenu_1.ImageActionsMenu, { id: id, invert: invert, setUnderEditImageData: setUnderEditImageData, setImageUnderEdit: setImageUnderEdit, inputRef: inputRef, setShowDeleteImageModal: setShowDeleteImageModal, publicUrl: publicUrl, imageData: imageData, handleReplaceSingleImage: handleReplaceSingleImage, handleUpload: handleUpload, isInRTE: isInRTE })) : editorStyle === "toolbar" ? (genToolbarStyledEditor()) : (editorStyle === "modal" && genModalStyleEditor()))),
|
|
201
145
|
enableCaptions && (readOnly &&
|
|
202
146
|
!lexicalTextEditorHasValue(imageData.caption) &&
|
|
203
147
|
!richTextHasValue(imageData.caption) //backwards compat cuz its possible caption data might be in draftjs shape
|
|
@@ -1,15 +1,4 @@
|
|
|
1
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
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -76,12 +65,7 @@ var Placeholder = function (_a) {
|
|
|
76
65
|
// const [dragOverActive, setDragOverActive] = useState(false)
|
|
77
66
|
var _d = (0, ImageInputContext_1.useImageInputContext)(), handleUpload = _d.handleUpload, onChange = _d.onChange, value = _d.value, id = _d.id;
|
|
78
67
|
var inputRef = (0, react_1.useRef)(null);
|
|
79
|
-
return (react_1.default.createElement(AspectRatioShell_1.default,
|
|
80
|
-
aspectRatio: aspectRatio,
|
|
81
|
-
containerShape: containerShape,
|
|
82
|
-
stretchToFullHeight: stretchToFullHeight,
|
|
83
|
-
onShellPrepared: decideUIStyle,
|
|
84
|
-
}),
|
|
68
|
+
return (react_1.default.createElement(AspectRatioShell_1.default, { aspectRatio: aspectRatio, containerShape: containerShape, stretchToFullHeight: stretchToFullHeight, onShellPrepared: decideUIStyle },
|
|
85
69
|
react_1.default.createElement(FileUploadWrapper_1.FileUploadWrapper, { styledPlaceholderWrapperRef: styledPlaceholderWrapperRef, uploadProgress: uploadProgress, isLoading: isLoading, containerShape: containerShape, multiple: multiple, smallPlaceholderUI: smallPlaceholderUI, mediaType: 'image', handleUpload: handleUpload, onChange: onChange, value: value, id: id, inputRef: inputRef }, smallPlaceholderUI ? (react_1.default.createElement(react_1.Fragment, null,
|
|
86
70
|
react_1.default.createElement(ImageSquare, { size: 16, color: greyColor100 }),
|
|
87
71
|
react_1.default.createElement(Typo_1.SANS_0, { semibold: true }, dropzoneLabel),
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const StyledPlaceholderWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export const StyledPlaceholder: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export const SstyledPlaceholder: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,39 @@
|
|
|
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.SstyledPlaceholder = exports.StyledPlaceholder = exports.StyledPlaceholderWrapper = void 0;
|
|
11
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
+
var themes_1 = require("../../../../themes");
|
|
13
|
+
var utilsOolib_1 = require("../../../../utilsOolib");
|
|
14
|
+
var mixins_1 = require("../../../../themes/mixins");
|
|
15
|
+
var greyColor100 = themes_1.colors.greyColor100;
|
|
16
|
+
exports.StyledPlaceholderWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n padding: ", ";\n width: 100%;\n height: 100%;\n ", "\n"], ["\n background-color: ", ";\n padding: ", ";\n width: 100%;\n height: 100%;\n ", "\n"])), function (_a) {
|
|
17
|
+
var theme = _a.theme, dragOverActive = _a.dragOverActive;
|
|
18
|
+
return dragOverActive
|
|
19
|
+
? (0, utilsOolib_1.getPrimaryColor40)(theme === null || theme === void 0 ? void 0 : theme.colors)
|
|
20
|
+
: (0, utilsOolib_1.getPrimaryColor10)(theme === null || theme === void 0 ? void 0 : theme.colors);
|
|
21
|
+
}, function (_a) {
|
|
22
|
+
var smallPlaceholderUI = _a.smallPlaceholderUI;
|
|
23
|
+
return !smallPlaceholderUI && "1.2rem";
|
|
24
|
+
}, (0, mixins_1.transition)("background-color"));
|
|
25
|
+
exports.StyledPlaceholder = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-flow: column nowrap;\n height: 100%;\n width: 100%;\n /* gap: ", "; */\n gap: 0.5rem;\n align-items: center;\n justify-content: center;\n text-align: center;\n border-radius: ", ";\n border: 0.12rem dashed ", ";\n padding: ", ";\n cursor: pointer;\n"], ["\n display: flex;\n flex-flow: column nowrap;\n height: 100%;\n width: 100%;\n /* gap: ", "; */\n gap: 0.5rem;\n align-items: center;\n justify-content: center;\n text-align: center;\n border-radius: ", ";\n border: 0.12rem dashed ", ";\n padding: ", ";\n cursor: pointer;\n"])), function (_a) {
|
|
26
|
+
var smallPlaceholderUI = _a.smallPlaceholderUI;
|
|
27
|
+
return !smallPlaceholderUI && "0.5rem";
|
|
28
|
+
}, function (_a) {
|
|
29
|
+
var containerShape = _a.containerShape;
|
|
30
|
+
return containerShape === "circle" ? "50%" : "unset";
|
|
31
|
+
}, greyColor100, function (_a) {
|
|
32
|
+
var smallPlaceholderUI = _a.smallPlaceholderUI;
|
|
33
|
+
return !smallPlaceholderUI && "2rem";
|
|
34
|
+
});
|
|
35
|
+
exports.SstyledPlaceholder = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n flex-flow: column nowrap;\n height: 100%;\n width: 100%;\n gap: 0.3rem;\n align-items: center;\n justify-content: center;\n text-align: center;\n border-radius: ", ";\n border: 0.12rem dashed ", ";\n padding: 2rem;\n cursor: pointer;\n"], ["\n display: flex;\n flex-flow: column nowrap;\n height: 100%;\n width: 100%;\n gap: 0.3rem;\n align-items: center;\n justify-content: center;\n text-align: center;\n border-radius: ", ";\n border: 0.12rem dashed ", ";\n padding: 2rem;\n cursor: pointer;\n"])), function (_a) {
|
|
36
|
+
var containerShape = _a.containerShape;
|
|
37
|
+
return containerShape === "circle" ? "50%" : "unset";
|
|
38
|
+
}, greyColor100);
|
|
39
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
@@ -34,26 +23,6 @@ var SingleImageInput = function (_a) {
|
|
|
34
23
|
var _b = (0, ImageInputContext_1.useImageInputContext)(), id = _b.id, aspectRatio = _b.aspectRatio, onChange = _b.onChange, handleUpload = _b.handleUpload, publicUrlBeingReplaced = _b.publicUrlBeingReplaced, readOnly = _b.readOnly, enableCaptions = _b.enableCaptions, invert = _b.invert, containerShape = _b.containerShape, defaultImageSpread = _b.defaultImageSpread, handleSingleImageDataChange = _b.handleSingleImageDataChange, handleDeleteSingleImage = _b.handleDeleteSingleImage, handleReplaceSingleImage = _b.handleReplaceSingleImage, setImageUnderEdit = _b.setImageUnderEdit, stretchToFullHeight = _b.stretchToFullHeight, disableImageBorder = _b.disableImageBorder, omitEditorTools = _b.omitEditorTools, isInRTE = _b.isInRTE;
|
|
35
24
|
//this helps for the ImageSlider, since ImageSlider uses SingleImageInput as child
|
|
36
25
|
var isBeingReplaced = publicUrlBeingReplaced && publicUrlBeingReplaced === (value === null || value === void 0 ? void 0 : value.publicUrl);
|
|
37
|
-
return !value || !value.publicUrl || isBeingReplaced ? (react_1.default.createElement(Placeholder_1.default, null)) : (react_1.default.createElement(ImageEditor_1.ImageEditor,
|
|
38
|
-
id: id,
|
|
39
|
-
value: value,
|
|
40
|
-
aspectRatio: aspectRatio,
|
|
41
|
-
invert: invert,
|
|
42
|
-
containerShape: containerShape,
|
|
43
|
-
readOnly: readOnly,
|
|
44
|
-
onChange: onChange,
|
|
45
|
-
enableCaptions: enableCaptions,
|
|
46
|
-
defaultImageSpread: defaultImageSpread,
|
|
47
|
-
handleSingleImageDataChange: handleSingleImageDataChange,
|
|
48
|
-
handleDeleteSingleImage: handleDeleteSingleImage,
|
|
49
|
-
handleReplaceSingleImage: handleReplaceSingleImage,
|
|
50
|
-
handleUpload: handleUpload,
|
|
51
|
-
setImageUnderEdit: setImageUnderEdit,
|
|
52
|
-
stretchToFullHeight: stretchToFullHeight,
|
|
53
|
-
disableImageBorder: disableImageBorder,
|
|
54
|
-
omitEditorTools: omitEditorTools,
|
|
55
|
-
isInRTE: isInRTE,
|
|
56
|
-
handleDragStart: handleDragStart
|
|
57
|
-
})));
|
|
26
|
+
return !value || !value.publicUrl || isBeingReplaced ? (react_1.default.createElement(Placeholder_1.default, null)) : (react_1.default.createElement(ImageEditor_1.ImageEditor, { id: id, value: value, aspectRatio: aspectRatio, invert: invert, containerShape: containerShape, readOnly: readOnly, onChange: onChange, enableCaptions: enableCaptions, defaultImageSpread: defaultImageSpread, handleSingleImageDataChange: handleSingleImageDataChange, handleDeleteSingleImage: handleDeleteSingleImage, handleReplaceSingleImage: handleReplaceSingleImage, handleUpload: handleUpload, setImageUnderEdit: setImageUnderEdit, stretchToFullHeight: stretchToFullHeight, disableImageBorder: disableImageBorder, omitEditorTools: omitEditorTools, isInRTE: isInRTE, handleDragStart: handleDragStart }));
|
|
58
27
|
};
|
|
59
28
|
exports.SingleImageInput = SingleImageInput;
|
|
@@ -47,7 +47,7 @@ var ImageDisplayInMask = function (_a) {
|
|
|
47
47
|
imgHeight: parseInt(aspectRatio.split("/")[1]),
|
|
48
48
|
wrapperAspectRatio: maskAspectRatio,
|
|
49
49
|
});
|
|
50
|
-
return (react_1.default.createElement(styled_1.StyledAbsPosShellImageEditor,
|
|
50
|
+
return (react_1.default.createElement(styled_1.StyledAbsPosShellImageEditor, { rendererStretch: rendererStretch },
|
|
51
51
|
react_1.default.createElement(__1.ImageInput, __assign({}, imageInputProps, { aspectRatio: aspectRatio, stretchToFullHeight: rendererStretch === "fullHeight" && true, readOnly: true, enableCaptions: false }))));
|
|
52
52
|
};
|
|
53
53
|
exports.ImageDisplayInMask = ImageDisplayInMask;
|
|
@@ -32,37 +32,15 @@ var getBlockLabelProps_1 = require("../../utils/getBlockLabelProps");
|
|
|
32
32
|
*/
|
|
33
33
|
function ImageInput(_a) {
|
|
34
34
|
var id = _a.id, value = _a.value, onChange = _a.onChange, readOnly = _a.readOnly, multiple = _a.multiple, _b = _a.stretchToFullHeight, stretchToFullHeight = _b === void 0 ? false : _b, _c = _a.aspectRatio, aspectRatio = _c === void 0 ? '5/3' : _c, _d = _a.containerShape, containerShape = _d === void 0 ? 'rectangle' : _d, //alt = circle
|
|
35
|
-
invert = _a.invert, _e = _a.enableCaptions, enableCaptions = _e === void 0 ? true : _e, _f = _a.defaultImageSpread, defaultImageSpread = _f === void 0 ? '
|
|
35
|
+
invert = _a.invert, _e = _a.enableCaptions, enableCaptions = _e === void 0 ? true : _e, _f = _a.defaultImageSpread, defaultImageSpread = _f === void 0 ? 'contain' : _f, _g = _a.allowedFormats, allowedFormats = _g === void 0 ? ["jpg", "jpeg", "png"] : _g, _h = _a.folderName, folderName = _h === void 0 ? 'images' : _h, bucketEnv = _a.bucketEnv, formatConvertConfig = _a.formatConvertConfig, dropzoneLabel = _a.dropzoneLabel, dropzoneSublabel = _a.dropzoneSublabel, _j = _a.disableImageBorder, disableImageBorder = _j === void 0 ? false : _j, _k = _a.omitEditorTools, omitEditorTools = _k === void 0 ? [] : _k, //can include : 'cover_contain' | 'rotate' | 'reposition'
|
|
36
36
|
isRequired = _a.isRequired, files = _a.files, //used by RTEImageInput
|
|
37
37
|
isInRTE = _a.isInRTE;
|
|
38
38
|
var props = arguments[0];
|
|
39
39
|
var showOptionalLabelInDropzone = !props.label && !props.sublabel;
|
|
40
|
-
return (react_1.default.createElement(ImageInputContext_1.ImageInputContextProvider,
|
|
41
|
-
value: value,
|
|
42
|
-
onChange: onChange,
|
|
43
|
-
id: id,
|
|
44
|
-
allowedFormats: allowedFormats,
|
|
45
|
-
formatConvertConfig: formatConvertConfig,
|
|
46
|
-
folderName: folderName,
|
|
47
|
-
bucketEnv: bucketEnv,
|
|
48
|
-
multiple: multiple,
|
|
49
|
-
aspectRatio: aspectRatio,
|
|
50
|
-
readOnly: readOnly,
|
|
51
|
-
enableCaptions: enableCaptions,
|
|
52
|
-
defaultImageSpread: defaultImageSpread,
|
|
53
|
-
invert: invert,
|
|
54
|
-
containerShape: containerShape,
|
|
55
|
-
stretchToFullHeight: stretchToFullHeight,
|
|
56
|
-
disableImageBorder: disableImageBorder,
|
|
57
|
-
omitEditorTools: omitEditorTools,
|
|
58
|
-
dropzoneLabel: dropzoneLabel || (multiple ? "Add Images ( max 10 )" : "Add Image"),
|
|
40
|
+
return (react_1.default.createElement(ImageInputContext_1.ImageInputContextProvider, { value: value, onChange: onChange, id: id, allowedFormats: allowedFormats, formatConvertConfig: formatConvertConfig, folderName: folderName, bucketEnv: bucketEnv, multiple: multiple, aspectRatio: aspectRatio, readOnly: readOnly, enableCaptions: enableCaptions, defaultImageSpread: defaultImageSpread, invert: invert, containerShape: containerShape, stretchToFullHeight: stretchToFullHeight, disableImageBorder: disableImageBorder, omitEditorTools: omitEditorTools, dropzoneLabel: dropzoneLabel || (multiple ? "Add Images ( max 10 )" : "Add Image"),
|
|
59
41
|
dropzoneSublabel: dropzoneSublabel ||
|
|
60
|
-
"Supports: ".concat(allowedFormats.map(function (f) { return f.toUpperCase(); }).join(", ")),
|
|
61
|
-
|
|
62
|
-
isRequired: isRequired,
|
|
63
|
-
files: files,
|
|
64
|
-
isInRTE: isInRTE
|
|
65
|
-
}),
|
|
42
|
+
"Supports: ".concat(allowedFormats.map(function (f) { return f.toUpperCase(); }).join(", ")), showOptionalLabelInDropzone: showOptionalLabelInDropzone, // in cases like cover image scenario, we wanna show the 'optional' label in the dropzone area, rather than label area
|
|
43
|
+
isRequired: isRequired, files: files, isInRTE: isInRTE },
|
|
66
44
|
react_1.default.createElement("div", { style: { height: stretchToFullHeight ? "100%" : "auto", } },
|
|
67
45
|
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, getBlockLabelProps_1.getBlockLabelProps)(__assign(__assign({}, props), { hideOptionalLabel: showOptionalLabelInDropzone })))),
|
|
68
46
|
multiple ? (react_1.default.createElement(GallerySlider_1.default, null)) : isInRTE
|
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type AlertType = 'success' | 'danger' | 'neutral' | 'neutralInactive';
|
|
3
|
+
interface InlineAlertProps {
|
|
4
|
+
text: string;
|
|
5
|
+
link?: {
|
|
6
|
+
url: string;
|
|
7
|
+
text: string;
|
|
8
|
+
};
|
|
9
|
+
type?: AlertType;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
invert?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @component Renders a inline alert component with customizable text and style.
|
|
15
|
+
*
|
|
16
|
+
* - The props object containing the following properties:
|
|
17
|
+
* @prop {string} props.text: The text to be displayed in the inline alert.
|
|
18
|
+
* @prop {'success' | 'danger' | 'neutral' | 'neutralInactive'} props.type: The type of alert to be displayed. Defaults to "neutral".
|
|
19
|
+
* @prop {React.CSSProperties} props.style: Additional CSS styles to apply to the inline alert.
|
|
20
|
+
* @prop {boolean} props.invert: A boolean indicating whether to invert the colors of the inline alert. Defaults to false.
|
|
21
|
+
* @prop {object} props.link: An object containing the link properties: url and text. If provided, a link is rendered next to the text.
|
|
22
|
+
* @return {ReactElement} The rendered inline alert component.
|
|
23
|
+
*/
|
|
24
|
+
export declare const InlineAlert: React.FC<InlineAlertProps>;
|
|
25
|
+
export {};
|
|
@@ -19,6 +19,17 @@ var react_1 = __importDefault(require("react"));
|
|
|
19
19
|
var colors_1 = require("../../themes/colors");
|
|
20
20
|
var utilsOolib_1 = require("../../utilsOolib");
|
|
21
21
|
var red = colors_1.colors.red, invertRed = colors_1.colors.invertRed, white = colors_1.colors.white, green = colors_1.colors.green, invertGreen = colors_1.colors.invertGreen, greyColor15 = colors_1.colors.greyColor15, greyColor70 = colors_1.colors.greyColor70, greyColor100 = colors_1.colors.greyColor100;
|
|
22
|
+
/**
|
|
23
|
+
* @component Renders a inline alert component with customizable text and style.
|
|
24
|
+
*
|
|
25
|
+
* - The props object containing the following properties:
|
|
26
|
+
* @prop {string} props.text: The text to be displayed in the inline alert.
|
|
27
|
+
* @prop {'success' | 'danger' | 'neutral' | 'neutralInactive'} props.type: The type of alert to be displayed. Defaults to "neutral".
|
|
28
|
+
* @prop {React.CSSProperties} props.style: Additional CSS styles to apply to the inline alert.
|
|
29
|
+
* @prop {boolean} props.invert: A boolean indicating whether to invert the colors of the inline alert. Defaults to false.
|
|
30
|
+
* @prop {object} props.link: An object containing the link properties: url and text. If provided, a link is rendered next to the text.
|
|
31
|
+
* @return {ReactElement} The rendered inline alert component.
|
|
32
|
+
*/
|
|
22
33
|
var InlineAlert = function (_a) {
|
|
23
34
|
var text = _a.text, link = _a.link, _b = _a.type, type = _b === void 0 ? 'neutral' : _b, style = _a.style, invert = _a.invert;
|
|
24
35
|
var localize = (0, utilsOolib_1.useLocale)();
|
|
@@ -30,6 +41,10 @@ var InlineAlert = function (_a) {
|
|
|
30
41
|
};
|
|
31
42
|
return (react_1.default.createElement("h5", { style: __assign({ display: 'flex', alignItems: 'center', gap: '0.5rem' }, style) },
|
|
32
43
|
react_1.default.createElement("span", { className: 'SANS_2', style: { color: typeColor[type][invert ? 'invert' : 'normal'] } }, localize(text)),
|
|
33
|
-
link && (react_1.default.createElement("a", { className: 'SANS_2', style: {
|
|
44
|
+
link && (react_1.default.createElement("a", { className: 'SANS_2', style: {
|
|
45
|
+
paddingLeft: '1rem',
|
|
46
|
+
textDecoration: 'underline',
|
|
47
|
+
color: invert ? white : greyColor100,
|
|
48
|
+
}, href: link.url, target: "_blank", rel: "noopener noreferrer" }, localize(link.text)))));
|
|
34
49
|
};
|
|
35
50
|
exports.InlineAlert = InlineAlert;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function LegendButton({ option, isActive, onClick, onMouseOver, onMouseOut, onTouchStart, onTouchEnd, }: {
|
|
2
|
+
option: any;
|
|
3
|
+
isActive: any;
|
|
4
|
+
onClick: any;
|
|
5
|
+
onMouseOver: any;
|
|
6
|
+
onMouseOut: any;
|
|
7
|
+
onTouchStart: any;
|
|
8
|
+
onTouchEnd: any;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
import React from "react";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LegendButton = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var Typo_1 = require("../../Typo");
|
|
9
|
+
var styled_1 = require("./styled");
|
|
10
|
+
var LegendButton = function (_a) {
|
|
11
|
+
var option = _a.option, isActive = _a.isActive, onClick = _a.onClick, onMouseOver = _a.onMouseOver, onMouseOut = _a.onMouseOut, onTouchStart = _a.onTouchStart, onTouchEnd = _a.onTouchEnd;
|
|
12
|
+
return (react_1.default.createElement(styled_1.StyledLegendButton, { active: isActive, onClick: onClick, onMouseOver: onMouseOver, onMouseOut: onMouseOut, onTouchStart: onTouchStart, onTouchEnd: onTouchEnd },
|
|
13
|
+
react_1.default.createElement(styled_1.StyledButtonContents, null,
|
|
14
|
+
option.color && (react_1.default.createElement(styled_1.StyledButtonColorTag, { style: { backgroundColor: option.color } })),
|
|
15
|
+
react_1.default.createElement(Typo_1.SANS_2, { bold: !!option.desc }, option.display),
|
|
16
|
+
option.desc && react_1.default.createElement(Typo_1.SANS_2, null, option.desc))));
|
|
17
|
+
};
|
|
18
|
+
exports.LegendButton = LegendButton;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const StyledLegendButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
2
|
+
export const StyledButtonContents: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export const StyledButtonColorTag: import("styled-components").StyledComponent<"div", any, {}, never>;
|