@pushwoosh/smart-components-kit 1.0.90 → 1.1.1
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/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.d.ts +1 -2
- package/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.js +103 -88
- package/CampaignsConfigurationDrawer/components/Card/Card.d.ts +1 -2
- package/CampaignsConfigurationDrawer/components/Card/Card.js +19 -13
- package/DocsButton/DocsButton.d.ts +1 -2
- package/DocsButton/DocsButton.js +21 -18
- package/DynamicContentPicker/DynamicContentPicker.js +76 -63
- package/DynamicContentPicker/Line.js +24 -22
- package/DynamicContentPickerForm/DynamicContentCustomPickerForm.js +18 -17
- package/DynamicContentPickerForm/DynamicContentEventPickerForm.js +60 -57
- package/DynamicContentPickerForm/DynamicContentTagPickerForm.js +60 -57
- package/DynamicContentPickerForm/SimpleDynamicContentPickerFormSmart.js +72 -63
- package/DynamicContentPickerForm/VariedDynamicContentPickerFormSmart.js +86 -74
- package/EmailTemplatePreview/EmailTemplatePreview.js +8 -6
- package/ExportCSV/ExportCsvBanner/ExportCsvBanner.d.ts +1 -2
- package/ExportCSV/ExportCsvBanner/ExportCsvBanner.js +54 -49
- package/ExportCSV/useExportService/useExportService.js +1 -0
- package/LanguagesSelector/LanguagesModal.js +38 -24
- package/LanguagesSelector/LanguagesSelectForm.js +73 -62
- package/LanguagesSelector/LanguagesSelectFormLoader.js +8 -7
- package/LanguagesSelector/LanguagesSelector.js +92 -78
- package/MediaStore/CreateVariantDrawer.js +134 -85
- package/MediaStore/MediaStore.d.ts +6 -10
- package/MediaStore/MediaStore.js +201 -161
- package/MediaStore/MediaStorePaginated.d.ts +8 -0
- package/MediaStore/MediaStorePaginated.js +24 -0
- package/MediaStore/index.d.ts +3 -1
- package/MediaStore/index.js +2 -1
- package/MediaStore/types.d.ts +22 -0
- package/MediaStore/types.js +1 -0
- package/ModalCloningJourney/ModalCloningJourney.d.ts +1 -2
- package/ModalCloningJourney/ModalCloningJourney.js +113 -91
- package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.d.ts +1 -2
- package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.js +98 -78
- package/OpenActions/components/OpenActionsSummaryByPreset.d.ts +1 -2
- package/OpenActions/components/OpenActionsSummaryByPreset.js +2 -2
- package/PlatformsConfigurationDrawer/PlatformsConfigurationDrawer.js +21 -17
- package/PlatformsConfigurationDrawer/components/DesktopPage/DesktopPage.js +112 -75
- package/PlatformsConfigurationDrawer/components/MainPage/MainPage.js +155 -101
- package/PlatformsConfigurationDrawer/components/MobilePage/MobilePage.js +138 -91
- package/ResendModal/ResendModal.d.ts +1 -2
- package/ResendModal/ResendModal.js +92 -72
- package/RichMessageEditorSmart/NewDynamicContentForm.js +16 -12
- package/RichMessageEditorSmart/RichMessageEditorSmart.js +4 -4
- package/SystemParcel/SystemParcel.d.ts +3 -3
- package/SystemParcel/SystemParcel.js +3 -2
- package/Table/components/DataTable/DataTable.js +80 -61
- package/Table/components/DataTableGetContext/DataTableGetContext.d.ts +1 -2
- package/Table/components/DataTableGetContext/DataTableGetContext.js +5 -2
- package/Table/components/DataTableList/DataTableList.d.ts +1 -2
- package/Table/components/DataTableList/DataTableList.js +86 -68
- package/Table/components/DataTablePagination/DataTablePagination.js +6 -4
- package/Table/components/DataTableSearchInput/DataTableSearchInput.js +3 -2
- package/Table/components/DataTableSortableCell/DataTableSortableCell.js +6 -4
- package/Table/components/Loading/Loading.d.ts +1 -2
- package/Table/components/Loading/Loading.js +16 -14
- package/Table/components/TablePagination/TablePagination.js +31 -25
- package/_devel/index.js +36 -24
- package/_devel/lib/dynamic-content-picker.d.ts +1 -2
- package/_devel/lib/dynamic-content-picker.js +16 -10
- package/_devel/lib/index.d.ts +2 -2
- package/_devel/lib/index.js +38 -19
- package/_devel/test-place.d.ts +1 -2
- package/_devel/test-place.js +4 -2
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
2
3
|
import { Button, Drawer, DrawerBody, DrawerHeader, DrawerTitle, NativeInput, useToast } from '@pushwoosh/dumb-components';
|
|
3
4
|
import { Columns, Vertical } from '@pushwoosh/kit-helpers';
|
|
4
5
|
import { CloseIcon } from '@pushwoosh/kit-icons';
|
|
@@ -127,90 +128,138 @@ export const CreateVariantDrawer = ({
|
|
|
127
128
|
setIsCreating(false);
|
|
128
129
|
}
|
|
129
130
|
};
|
|
130
|
-
return
|
|
131
|
+
return _jsxs(Drawer, {
|
|
131
132
|
size: "medium",
|
|
132
133
|
isOpen: isOpen,
|
|
133
|
-
onClose: onClose
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
134
|
+
onClose: onClose,
|
|
135
|
+
children: [_jsx(DrawerHeader, {
|
|
136
|
+
children: _jsxs(DrawerTitle, {
|
|
137
|
+
children: [_jsx("span", {
|
|
138
|
+
children: lang({
|
|
139
|
+
message: 'SMART.MEDIA_STORE.CREATE_VARIANT.TITLE'
|
|
140
|
+
})
|
|
141
|
+
}), _jsx(Button, {
|
|
142
|
+
view: "ghost",
|
|
143
|
+
color: "secondary",
|
|
144
|
+
size: "compact",
|
|
145
|
+
icon: _jsx(CloseIcon, {
|
|
146
|
+
size: "small"
|
|
147
|
+
}),
|
|
148
|
+
"aria-label": lang({
|
|
149
|
+
message: 'SMART.MEDIA_STORE.CREATE_VARIANT.CLOSE'
|
|
150
|
+
}),
|
|
151
|
+
onClick: onClose
|
|
152
|
+
})]
|
|
153
|
+
})
|
|
154
|
+
}), _jsx(DrawerBody, {
|
|
155
|
+
children: original && _jsxs(Vertical, {
|
|
156
|
+
"$gap": 20,
|
|
157
|
+
children: [_jsxs("div", {
|
|
158
|
+
children: [_jsx(FieldLabel, {
|
|
159
|
+
children: lang({
|
|
160
|
+
message: 'SMART.MEDIA_STORE.CREATE_VARIANT.RATIO_LABEL'
|
|
161
|
+
})
|
|
162
|
+
}), _jsx(Chips, {
|
|
163
|
+
children: RATIOS.map(item => _jsx(Chip, {
|
|
164
|
+
type: "button",
|
|
165
|
+
"$active": item.value === ratio,
|
|
166
|
+
onClick: () => setRatio(item.value),
|
|
167
|
+
children: item.label
|
|
168
|
+
}, item.value))
|
|
169
|
+
})]
|
|
170
|
+
}), _jsxs("div", {
|
|
171
|
+
children: [_jsx(FieldLabel, {
|
|
172
|
+
children: lang({
|
|
173
|
+
message: 'SMART.MEDIA_STORE.CREATE_VARIANT.SIZE_LABEL'
|
|
174
|
+
})
|
|
175
|
+
}), _jsxs(Columns, {
|
|
176
|
+
"$sizes": "auto 1fr",
|
|
177
|
+
"$gap": 8,
|
|
178
|
+
"$alignItems": "center",
|
|
179
|
+
children: [_jsxs(Segment, {
|
|
180
|
+
children: [_jsx(SegmentItem, {
|
|
181
|
+
type: "button",
|
|
182
|
+
"$active": dimension === 'width',
|
|
183
|
+
onClick: () => setDimension('width'),
|
|
184
|
+
children: lang({
|
|
185
|
+
message: 'SMART.MEDIA_STORE.CREATE_VARIANT.WIDTH'
|
|
186
|
+
})
|
|
187
|
+
}), _jsx(SegmentItem, {
|
|
188
|
+
type: "button",
|
|
189
|
+
"$active": dimension === 'height',
|
|
190
|
+
onClick: () => setDimension('height'),
|
|
191
|
+
children: lang({
|
|
192
|
+
message: 'SMART.MEDIA_STORE.CREATE_VARIANT.HEIGHT'
|
|
193
|
+
})
|
|
194
|
+
})]
|
|
195
|
+
}), _jsx(NativeInput, {
|
|
196
|
+
type: "number",
|
|
197
|
+
min: 1,
|
|
198
|
+
value: size,
|
|
199
|
+
"$isErrored": !isSizeValid,
|
|
200
|
+
onChange: event => setSize(event.target.value)
|
|
201
|
+
})]
|
|
202
|
+
})]
|
|
203
|
+
}), _jsxs(Vertical, {
|
|
204
|
+
"$gap": 6,
|
|
205
|
+
children: [_jsx(PreviewStage, {
|
|
206
|
+
children: _jsx(PreviewFrame, {
|
|
207
|
+
"$ratio": selectedRatio.ar,
|
|
208
|
+
children: _jsx(PreviewImage, {
|
|
209
|
+
src: original.url,
|
|
210
|
+
alt: original.filename
|
|
211
|
+
})
|
|
212
|
+
})
|
|
213
|
+
}), isSizeValid && _jsxs(Text, {
|
|
214
|
+
children: [selectedRatio.label, ' · ', outputWidth, ' × ', outputHeight]
|
|
215
|
+
})]
|
|
216
|
+
}), isJpeg && _jsxs("div", {
|
|
217
|
+
children: [_jsx(FieldLabel, {
|
|
218
|
+
children: lang({
|
|
219
|
+
message: 'SMART.MEDIA_STORE.CREATE_VARIANT.QUALITY_LABEL'
|
|
220
|
+
})
|
|
221
|
+
}), _jsx(NativeInput, {
|
|
222
|
+
type: "number",
|
|
223
|
+
min: 1,
|
|
224
|
+
max: 100,
|
|
225
|
+
value: quality,
|
|
226
|
+
"$isErrored": !isQualityValid,
|
|
227
|
+
onChange: event => setQuality(event.target.value)
|
|
228
|
+
})]
|
|
229
|
+
}), ratioExists && _jsx(Text, {
|
|
230
|
+
children: lang({
|
|
231
|
+
message: 'SMART.MEDIA_STORE.CREATE_VARIANT.RATIO_EXISTS'
|
|
232
|
+
})
|
|
233
|
+
}), _jsx(Button, {
|
|
234
|
+
color: "primary",
|
|
235
|
+
size: "field",
|
|
236
|
+
isDisabled: !isSizeValid || !isQualityValid || ratioExists,
|
|
237
|
+
isLoading: isCreating,
|
|
238
|
+
onClick: () => void handleCreate(),
|
|
239
|
+
children: lang({
|
|
240
|
+
message: 'SMART.MEDIA_STORE.CREATE_VARIANT.CREATE_BUTTON'
|
|
241
|
+
})
|
|
242
|
+
}), _jsxs("div", {
|
|
243
|
+
children: [_jsx(FieldLabel, {
|
|
244
|
+
children: lang({
|
|
245
|
+
message: 'SMART.MEDIA_STORE.CREATE_VARIANT.EXISTING_LABEL'
|
|
246
|
+
})
|
|
247
|
+
}), existingVariants.length === 0 ? _jsx(Text, {
|
|
248
|
+
children: lang({
|
|
249
|
+
message: 'SMART.MEDIA_STORE.CREATE_VARIANT.NO_VARIANTS'
|
|
250
|
+
})
|
|
251
|
+
}) : _jsx(VariantStrip, {
|
|
252
|
+
children: existingVariants.map(variant => _jsxs(VariantThumb, {
|
|
253
|
+
children: [_jsx(TileImage, {
|
|
254
|
+
src: getThumbUrl(variant),
|
|
255
|
+
alt: variant.filename
|
|
256
|
+
}), _jsx(VariantThumbCaption, {
|
|
257
|
+
children: getRatioLabel(variant) || variant.filename
|
|
258
|
+
})]
|
|
259
|
+
}, variant.uuid))
|
|
260
|
+
})]
|
|
261
|
+
})]
|
|
262
|
+
})
|
|
263
|
+
})]
|
|
264
|
+
});
|
|
216
265
|
};
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
perPage?: number;
|
|
9
|
-
/** Called with the chosen file URL (original or variant). */
|
|
10
|
-
onSelect: (url: string) => void;
|
|
11
|
-
};
|
|
2
|
+
import type { MediaStoreProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Controlled media gallery: the parent owns the current page (and page size)
|
|
5
|
+
* and is notified of navigation via `onPageChange`. For a self-contained
|
|
6
|
+
* variant that keeps the page in internal state, use `MediaStorePaginated`.
|
|
7
|
+
*/
|
|
12
8
|
export declare const MediaStore: FC<MediaStoreProps>;
|