@orangelogic/design-system 2.101.0 → 2.103.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/library/chunks/{color-swatch-group.C6c53two.js → color-swatch-group.BVPz-gma.js} +1 -1
- package/library/chunks/{list-editor.DMjclCWz.js → list-editor.DqI-Aj2b.js} +181 -183
- package/library/chunks/{pagination.Bi-8gmcy.js → pagination.BJrZCqaj.js} +12 -17
- package/library/chunks/{table.Cm-ynClk.js → table.DQqei6Sh.js} +1 -1
- package/library/chunks/transformation.Dir8s_wm.js +151 -0
- package/library/components/asset-link-format.js +867 -672
- package/library/components/atoms.js +2 -2
- package/library/components/color-swatch-group.js +2 -2
- package/library/components/drawer.js +82 -71
- package/library/components/list-editor.js +2 -2
- package/library/components/molecules.js +1 -1
- package/library/components/organisms.js +1 -1
- package/library/components/pagination.js +1 -1
- package/library/components/table.js +2 -2
- package/library/components/tag.js +44 -31
- package/library/components/types.js +562 -565
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/drawer/drawer.d.ts +8 -0
- package/library/packages/atoms/src/components/tag/tag.d.ts +11 -1
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +8 -0
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-crop/asset-link-format-crop.d.ts +4 -0
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-quality/asset-link-format-quality.d.ts +4 -0
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-resize/asset-link-format-resize.d.ts +4 -0
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-rotation/asset-link-format-rotation.d.ts +4 -0
- package/library/packages/organisms/src/content-builder/styleController.d.ts +2 -1
- package/library/packages/types/src/asset-link-format.d.ts +2 -0
- package/library/packages/types/src/content-builder.d.ts +5 -1
- package/library/packages/types/src/tag.d.ts +1 -0
- package/library/packages/utils/src/transformation/transformation.d.ts +4 -1
- package/library/react-web-component.d.ts +15 -3
- package/library/utils.js +1 -1
- package/package.json +1 -1
- package/library/chunks/transformation.Cqz3hPaQ.js +0 -144
package/library/package.json
CHANGED
|
@@ -10,6 +10,7 @@ import { default as CxIconButton } from '../icon-button/icon-button';
|
|
|
10
10
|
* @slot (default) - The drawer's main content.
|
|
11
11
|
* @slot label - The drawer's label. Alternatively, you can use the `label` attribute.
|
|
12
12
|
* @slot header-actions - Optional actions to add to the header. Works best with `<cx-icon-button>`.
|
|
13
|
+
* @slot description - Optional description content rendered between the header and body.
|
|
13
14
|
* @slot footer - The drawer's footer, usually one or more buttons representing various options.
|
|
14
15
|
*
|
|
15
16
|
* @event cx-show - Emitted when the drawer opens.
|
|
@@ -31,6 +32,7 @@ import { default as CxIconButton } from '../icon-button/icon-button';
|
|
|
31
32
|
* @csspart title - The drawer's title.
|
|
32
33
|
* @csspart close-button - The close button, an `<cx-icon-button>`.
|
|
33
34
|
* @csspart close-button__base - The close button's exported `base` part.
|
|
35
|
+
* @csspart description - The drawer's description section, rendered between the header and body.
|
|
34
36
|
* @csspart body - The drawer's body.
|
|
35
37
|
* @csspart footer - The drawer's footer.
|
|
36
38
|
*
|
|
@@ -92,6 +94,12 @@ export default class CxDrawer extends CortexElement {
|
|
|
92
94
|
* its parent element, set this attribute and add `position: relative` to the parent.
|
|
93
95
|
*/
|
|
94
96
|
contained: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* When combined with `contained`, allows the drawer panel to overflow the parent's width boundary.
|
|
99
|
+
* Useful when the parent container has height but no explicit width — the drawer panel will still
|
|
100
|
+
* appear by overflowing visually outside the zero-width container.
|
|
101
|
+
*/
|
|
102
|
+
ignoreParentWidth: boolean;
|
|
95
103
|
/**
|
|
96
104
|
* Removes the header. This will also remove the default close button, so please ensure you provide an easy,
|
|
97
105
|
* accessible way for users to dismiss the drawer.
|
|
@@ -6,12 +6,16 @@ import { default as CxLineClamp } from '../line-clamp/line-clamp';
|
|
|
6
6
|
/**
|
|
7
7
|
* @summary Tags are used as labels to organize things or to indicate a selection.
|
|
8
8
|
*
|
|
9
|
-
* @slot (default) - The tag's content.
|
|
9
|
+
* @slot (default) - The tag's content. Clamped to `lines` lines (single line by default).
|
|
10
|
+
* @slot prefix - Content shown before the label, e.g. an avatar or icon. Not clamped.
|
|
11
|
+
* @slot suffix - Content shown after the label, e.g. a clickable icon, tooltip, or dropdown. Not clamped.
|
|
10
12
|
*
|
|
11
13
|
* @event cx-remove - Emitted when the remove button is activated.
|
|
12
14
|
*
|
|
13
15
|
* @csspart base - The component's base wrapper.
|
|
14
16
|
* @csspart content - The tag's content.
|
|
17
|
+
* @csspart prefix - The container that wraps the prefix slot.
|
|
18
|
+
* @csspart suffix - The container that wraps the suffix slot.
|
|
15
19
|
* @csspart remove-button - The tag's remove button, an `<cx-icon-button>`.
|
|
16
20
|
* @csspart remove-button__base - The remove button's exported `base` part.
|
|
17
21
|
*/
|
|
@@ -22,6 +26,7 @@ export default class CxTag extends CortexElement {
|
|
|
22
26
|
'cx-line-clamp': typeof CxLineClamp;
|
|
23
27
|
};
|
|
24
28
|
private readonly localize;
|
|
29
|
+
private readonly hasSlotController;
|
|
25
30
|
/** The tag's theme variant. */
|
|
26
31
|
variant: 'primary' | 'success' | 'neutral' | 'warning' | 'danger' | 'text';
|
|
27
32
|
/** The tag's size. */
|
|
@@ -30,6 +35,11 @@ export default class CxTag extends CortexElement {
|
|
|
30
35
|
pill: boolean;
|
|
31
36
|
/** Makes the tag removable and shows a remove button. */
|
|
32
37
|
removable: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The number of lines to clamp the label to before truncating with an ellipsis.
|
|
40
|
+
* Defaults to DEFAULT_LINE (single line). Increase to let the label wrap onto multiple lines.
|
|
41
|
+
*/
|
|
42
|
+
lines: number;
|
|
33
43
|
private handleRemoveClick;
|
|
34
44
|
render(): import('lit').TemplateResult<1>;
|
|
35
45
|
}
|
|
@@ -18,6 +18,12 @@ export type CxAssetLinkFormatChangeEvent = CustomEvent<string>;
|
|
|
18
18
|
* @summary The `cx-asset-link-format` component is used to format an asset link with various transformations such as cropping, resizing, rotating, and applying quality settings.
|
|
19
19
|
*
|
|
20
20
|
* @event `cx-asset-link-format-change` - Emitted when the asset link format is changed.
|
|
21
|
+
*
|
|
22
|
+
* @property {boolean} no-format - When true, hides the format proxy (format selection) panel.
|
|
23
|
+
* @property {boolean} no-metadata - When true, hides the metadata panel.
|
|
24
|
+
* @property {boolean} no-crop - When true, hides the crop panel.
|
|
25
|
+
* @property {boolean} no-resize - When true, hides the resize panel.
|
|
26
|
+
* @property {boolean} no-rotate - When true, hides the rotation panel.
|
|
21
27
|
*/
|
|
22
28
|
export default class CxAssetLinkFormat extends CortexElement {
|
|
23
29
|
static readonly styles: CSSResultGroup;
|
|
@@ -94,6 +100,7 @@ export default class CxAssetLinkFormat extends CortexElement {
|
|
|
94
100
|
selectedProxy: string;
|
|
95
101
|
useCustomExtension: boolean;
|
|
96
102
|
noMetadata: boolean;
|
|
103
|
+
noFormat: boolean;
|
|
97
104
|
noCrop: boolean;
|
|
98
105
|
noResize: boolean;
|
|
99
106
|
noRotate: boolean;
|
|
@@ -260,6 +267,7 @@ export default class CxAssetLinkFormat extends CortexElement {
|
|
|
260
267
|
};
|
|
261
268
|
setActiveSetting(activeSetting: string): void;
|
|
262
269
|
private freezeTransformations;
|
|
270
|
+
private upsertTransformation;
|
|
263
271
|
handleTransformationsChange(): Promise<void>;
|
|
264
272
|
private handleCropperElementChange;
|
|
265
273
|
private handleCropperSelectorChange;
|
|
@@ -106,6 +106,10 @@ export default class CxAssetLinkFormatCrop extends CortexElement {
|
|
|
106
106
|
* Whether the apply button is disabled.
|
|
107
107
|
*/
|
|
108
108
|
disabledApply: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* When true, shows the apply button. When false (default), changes take effect immediately (standalone mode).
|
|
111
|
+
*/
|
|
112
|
+
canApply: boolean;
|
|
109
113
|
/**
|
|
110
114
|
* The last applied crop settings for each unit.
|
|
111
115
|
* This is used to restore the last applied settings when the component is closed.
|
|
@@ -48,6 +48,10 @@ export default class CxAssetLinkFormatQuality extends CortexElement {
|
|
|
48
48
|
* @default false
|
|
49
49
|
*/
|
|
50
50
|
loading: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* When true, shows the apply button. When false (default), changes take effect immediately (standalone mode).
|
|
53
|
+
*/
|
|
54
|
+
canApply: boolean;
|
|
51
55
|
scopedValue: number;
|
|
52
56
|
/**
|
|
53
57
|
* A computed property that checks if the current quality value is invalid.
|
|
@@ -104,6 +104,10 @@ export default class CxAssetLinkFormatResize extends CortexElement {
|
|
|
104
104
|
* @default false
|
|
105
105
|
*/
|
|
106
106
|
loading: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* When true, shows the apply button. When false (default), changes take effect immediately (standalone mode).
|
|
109
|
+
*/
|
|
110
|
+
canApply: boolean;
|
|
107
111
|
/**
|
|
108
112
|
* Whether to keep the aspect ratio when changing width or height.
|
|
109
113
|
* This is used to automatically adjust the other dimension when one is changed.
|
|
@@ -56,6 +56,10 @@ export default class CxAssetLinkFormatRotation extends CortexElement {
|
|
|
56
56
|
* @default false
|
|
57
57
|
*/
|
|
58
58
|
loading: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* When true, shows the apply button. When false (default), changes take effect immediately (standalone mode).
|
|
61
|
+
*/
|
|
62
|
+
canApply: boolean;
|
|
59
63
|
handleOpenChange(): void;
|
|
60
64
|
private handleRotationChange;
|
|
61
65
|
private handleButtonClick;
|
|
@@ -136,7 +136,8 @@ export type PropertyConfig<T = Record<string, any>> = Omit<TraitProperties, 'opt
|
|
|
136
136
|
pickerConfigs?: {
|
|
137
137
|
accepts?: string[];
|
|
138
138
|
multiple?: boolean;
|
|
139
|
-
|
|
139
|
+
nameKey?: string;
|
|
140
|
+
representativeKey?: string;
|
|
140
141
|
};
|
|
141
142
|
placeholder?: string;
|
|
142
143
|
radioGroupConfigs?: {
|
|
@@ -191,8 +192,11 @@ export declare enum AssetType {
|
|
|
191
192
|
}
|
|
192
193
|
export type AssetTypeString = AssetType | `${AssetType} ${AssetTypeString}`;
|
|
193
194
|
export type Asset = {
|
|
195
|
+
extension?: string;
|
|
194
196
|
id: string;
|
|
195
197
|
name: string;
|
|
198
|
+
/** Representative (thumbnail/preview) URL fetched from the API. */
|
|
199
|
+
representative?: string;
|
|
196
200
|
src: string;
|
|
197
201
|
type: AssetType;
|
|
198
202
|
url?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_LINE = 1;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Asset, Parameter, Transformation } from '../../../types/src/asset-link-format';
|
|
2
2
|
|
|
3
|
-
export declare function buildTransformationString({ asset, baseUrl, extension, parameters, transformations, useSession, }: {
|
|
3
|
+
export declare function buildTransformationString({ asset, baseUrl, extension, options, parameters, transformations, useSession, }: {
|
|
4
4
|
asset?: Asset;
|
|
5
5
|
baseUrl?: string;
|
|
6
6
|
extension?: string;
|
|
7
|
+
options?: {
|
|
8
|
+
omitZeroXY?: boolean;
|
|
9
|
+
};
|
|
7
10
|
parameters?: Parameter[];
|
|
8
11
|
transformations?: Transformation[];
|
|
9
12
|
useSession?: string;
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
export type CxShareOptionListShareOptionListItem = { disabled: boolean; icon: string; id: string; name: string; tooltip: string; };
|
|
34
34
|
export type CxStepperWizardStepData = { color: string; description: string; icon: string; iconVariant: 'outlined' | 'filled' | 'fa'; id: string; name: string; readonly: boolean; state: 'Done' | 'Active' | 'None' | 'Disabled'; };
|
|
35
35
|
export type CxTimelineTimelineItem = { id: string; label: string; objectFit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'; recordId: string; thumbnail: string; };
|
|
36
|
-
export type CxTimelineTransformation = { key: 'Crop' | 'Metadata' | 'Proxy' | 'Quality' | 'Resize' | 'Rotate'; value: { disabledSize: boolean; height: number; keepMetadata: boolean; mode: string; quality: number; rotation: number; unit: '%' | 'px'; width: number; x: number; y: number; }; };
|
|
36
|
+
export type CxTimelineTransformation = { key: 'Crop' | 'Metadata' | 'Proxy' | 'Quality' | 'Resize' | 'Rotate'; value: { disabledSize: boolean; focusMode: string; height: number; isFocusModeAuto: boolean; keepMetadata: boolean; mode: string; quality: number; rotation: number; unit: '%' | 'px'; width: number; x: number; y: number; }; };
|
|
37
37
|
export type CxAssetLinkFormatAsset = { allowATSLink: boolean; docSubType: string; docType: 'Album' | 'Audio' | 'Image' | 'Multimedia' | 'Story' | 'Video' | 'Widget'; extension: string; height: string; id: string; identifier: string; imageUrl: string; name: string; originalUrl: string; scrubUrl: string; size: string; tags: string; width: string; };
|
|
38
38
|
export type CxAssetLinkFormatCropMode = { auto: boolean; disabledSize: boolean; label: string; value: string; };
|
|
39
39
|
export type CxAssetLinkFormatFocusMode = { auto: boolean; label: string; value: string; };
|
|
40
40
|
export type CxAssetLinkFormatProxy = { cdnName: string; extension: string; formatHeight: number; formatWidth: number; height: number; id: string; permanentLink: string; proxyLabel: string; proxyName: string; width: number; };
|
|
41
|
-
export type CxAssetLinkFormatTransformation = { key: 'Crop' | 'Metadata' | 'Proxy' | 'Quality' | 'Resize' | 'Rotate'; value: { disabledSize: boolean; height: number; keepMetadata: boolean; mode: string; quality: number; rotation: number; unit: '%' | 'px'; width: number; x: number; y: number; }; };
|
|
41
|
+
export type CxAssetLinkFormatTransformation = { key: 'Crop' | 'Metadata' | 'Proxy' | 'Quality' | 'Resize' | 'Rotate'; value: { disabledSize: boolean; focusMode: string; height: number; isFocusModeAuto: boolean; keepMetadata: boolean; mode: string; quality: number; rotation: number; unit: '%' | 'px'; width: number; x: number; y: number; }; };
|
|
42
42
|
export type CxBentoGridGalleryItem = { additions: string[]; alt: string; cardType: 'asset' | 'folder' | 'link' | 'page' | 'space'; className: string; details: string; filler: boolean; header: string; id: string; isClone: boolean; name: string; objectFit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'; openInNewTab: boolean; pageId: string; rawId: string; size: string; src: string; url: string; };
|
|
43
43
|
export type CxCarouselGalleryItem = { additions: string[]; alt: string; cardType: 'asset' | 'folder' | 'link' | 'page' | 'space'; className: string; details: string; filler: boolean; header: string; id: string; isClone: boolean; name: string; objectFit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'; openInNewTab: boolean; pageId: string; rawId: string; size: string; src: string; url: string; };
|
|
44
44
|
export type CxChatbotChatbotEvent = { event: string; excludedFromPurposes: string[]; label: string; };
|
|
45
45
|
export type CxColorSwatchGroupColorSwatchData = { cmyk: string; color: string; hex: string; id: string; name: string; palette: string; pms: string; rgb: string; };
|
|
46
46
|
export type CxGalleryGalleryRecord = { id: string; objectFit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'; rawId: string; src: string; };
|
|
47
|
-
export type CxGalleryTransformation = { key: 'Crop' | 'Metadata' | 'Proxy' | 'Quality' | 'Resize' | 'Rotate'; value: { disabledSize: boolean; height: number; keepMetadata: boolean; mode: string; quality: number; rotation: number; unit: '%' | 'px'; width: number; x: number; y: number; }; };
|
|
47
|
+
export type CxGalleryTransformation = { key: 'Crop' | 'Metadata' | 'Proxy' | 'Quality' | 'Resize' | 'Rotate'; value: { disabledSize: boolean; focusMode: string; height: number; isFocusModeAuto: boolean; keepMetadata: boolean; mode: string; quality: number; rotation: number; unit: '%' | 'px'; width: number; x: number; y: number; }; };
|
|
48
48
|
export type CxContentBuilderDevice = { canvasWidth: string; height: string; id: string; maxWidth: string; name: string; };
|
|
49
49
|
export type CxDashboardFilterDashboardFilterControl = { controlId: string; controlType: string; id: string; label: string; maxOptionsVisible: number; optionColumnMapping: CxDashboardFilterPartial; options: CxDashboardFilterDashboardFilterOption[] | dictionary[]; placeholder: string; type: string; };
|
|
50
50
|
export type CxDashboardFilterPartial = any;
|
|
@@ -1354,6 +1354,10 @@
|
|
|
1354
1354
|
* Makes the tag removable and shows a remove button.
|
|
1355
1355
|
*/
|
|
1356
1356
|
removable?: boolean;
|
|
1357
|
+
/**
|
|
1358
|
+
* The number of lines to clamp the label to before truncating with an ellipsis. Defaults to DEFAULT_LINE (single line). Increase to let the label wrap onto multiple lines.
|
|
1359
|
+
*/
|
|
1360
|
+
lines?: number;
|
|
1357
1361
|
/**
|
|
1358
1362
|
* Make localization attributes reactive eslint-disable-next-line lit/no-native-attributes
|
|
1359
1363
|
*/
|
|
@@ -2156,6 +2160,10 @@
|
|
|
2156
2160
|
* By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of its parent element, set this attribute and add `position: relative` to the parent.
|
|
2157
2161
|
*/
|
|
2158
2162
|
contained?: boolean;
|
|
2163
|
+
/**
|
|
2164
|
+
* When combined with `contained`, allows the drawer panel to overflow the parent's width boundary. Useful when the parent container has height but no explicit width — the drawer panel will still appear by overflowing visually outside the zero-width container.
|
|
2165
|
+
*/
|
|
2166
|
+
ignoreParentWidth?: boolean;
|
|
2159
2167
|
/**
|
|
2160
2168
|
* Removes the header. This will also remove the default close button, so please ensure you provide an easy, accessible way for users to dismiss the drawer.
|
|
2161
2169
|
*/
|
|
@@ -7055,6 +7063,10 @@
|
|
|
7055
7063
|
/**
|
|
7056
7064
|
*
|
|
7057
7065
|
*/
|
|
7066
|
+
noFormat?: boolean;
|
|
7067
|
+
/**
|
|
7068
|
+
*
|
|
7069
|
+
*/
|
|
7058
7070
|
noCrop?: boolean;
|
|
7059
7071
|
/**
|
|
7060
7072
|
*
|
package/library/utils.js
CHANGED
|
@@ -28,7 +28,7 @@ import { g as Ds, a as As } from "./chunks/responsive.Oz9HWjyQ.js";
|
|
|
28
28
|
import { c as ys, b as Ss, e as Ms, f as Ls, l as Is, g as vs, j as Rs, p as Vs, v as bs, r as ks, a as Fs, d as Os, s as Ns, k as Xs, o as Ps, m as _s, n as Bs, q as Hs, t as Us, u as Gs } from "./chunks/string.DUgD4c9f.js";
|
|
29
29
|
import { g as Ws, a as zs } from "./chunks/template.ClovJacp.js";
|
|
30
30
|
import { c as Zs, a as js, f as Js, g as $s } from "./chunks/time.BiQnh9wt.js";
|
|
31
|
-
import { b as Ks } from "./chunks/transformation.
|
|
31
|
+
import { b as Ks } from "./chunks/transformation.Dir8s_wm.js";
|
|
32
32
|
function b(t) {
|
|
33
33
|
if (!this.ownerDocument.defaultView?.Matrix3 || !t)
|
|
34
34
|
return;
|
package/package.json
CHANGED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { T as n } from "./asset-link-format.BSRDqHg7.js";
|
|
2
|
-
function p({
|
|
3
|
-
asset: _,
|
|
4
|
-
baseUrl: d,
|
|
5
|
-
extension: y,
|
|
6
|
-
parameters: c,
|
|
7
|
-
transformations: o,
|
|
8
|
-
useSession: v = ""
|
|
9
|
-
}) {
|
|
10
|
-
if (d == null)
|
|
11
|
-
return "";
|
|
12
|
-
let t = d;
|
|
13
|
-
const f = o?.findLast(
|
|
14
|
-
(i) => i.key === n.Quality
|
|
15
|
-
);
|
|
16
|
-
if (f && (o = [
|
|
17
|
-
...o?.filter(
|
|
18
|
-
(i) => i.key !== n.Quality
|
|
19
|
-
) || [],
|
|
20
|
-
f
|
|
21
|
-
]), o) {
|
|
22
|
-
const i = [];
|
|
23
|
-
for (let a = 0; a < o.length; a++) {
|
|
24
|
-
const l = o[a];
|
|
25
|
-
if (l.key === n.Rotate) {
|
|
26
|
-
let e = l.value.rotation ?? 0;
|
|
27
|
-
for (; o[a + 1]?.key === n.Rotate; )
|
|
28
|
-
a++, e += o[a].value.rotation ?? 0;
|
|
29
|
-
e !== 0 && i.push({ key: n.Rotate, value: { rotation: e } });
|
|
30
|
-
} else
|
|
31
|
-
i.push(l);
|
|
32
|
-
}
|
|
33
|
-
o = i;
|
|
34
|
-
}
|
|
35
|
-
o && o.length > 0 && (t += "/t/"), o?.forEach(({ key: i, value: a }) => {
|
|
36
|
-
if (i === n.Resize) {
|
|
37
|
-
const l = [
|
|
38
|
-
...[
|
|
39
|
-
{
|
|
40
|
-
key: "re_w_",
|
|
41
|
-
value: Math.round(a.width ?? 0)
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
key: "re_h_",
|
|
45
|
-
value: Math.round(a.height ?? 0)
|
|
46
|
-
}
|
|
47
|
-
].filter((e) => e.value !== void 0).map((e) => ({
|
|
48
|
-
key: e.key,
|
|
49
|
-
value: Math.round(Number(e.value))
|
|
50
|
-
})),
|
|
51
|
-
{
|
|
52
|
-
key: "re_rm_",
|
|
53
|
-
value: "stretch"
|
|
54
|
-
}
|
|
55
|
-
];
|
|
56
|
-
l.forEach(({ key: e, value: u }, r) => {
|
|
57
|
-
t += `${e}${u}${r < l.length - 1 ? "," : ""}`;
|
|
58
|
-
}), t += "/";
|
|
59
|
-
}
|
|
60
|
-
if (i === n.Crop) {
|
|
61
|
-
const l = [
|
|
62
|
-
...[
|
|
63
|
-
{
|
|
64
|
-
key: "c_",
|
|
65
|
-
value: a.mode
|
|
66
|
-
},
|
|
67
|
-
...a.disabledSize ? [] : [
|
|
68
|
-
{
|
|
69
|
-
key: "c_w_",
|
|
70
|
-
value: Math.round(a.width ?? 0)
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
key: "c_h_",
|
|
74
|
-
value: Math.round(a.height ?? 0)
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
key: "c_x_",
|
|
78
|
-
value: Math.round(a.x ?? 0)
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
key: "c_y_",
|
|
82
|
-
value: Math.round(a.y ?? 0)
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
].filter((e) => e.value !== void 0 && e.value !== null).map((e) => ({
|
|
86
|
-
key: e.key,
|
|
87
|
-
value: e.value
|
|
88
|
-
})),
|
|
89
|
-
{
|
|
90
|
-
key: "c_whu_",
|
|
91
|
-
value: "pixel"
|
|
92
|
-
}
|
|
93
|
-
];
|
|
94
|
-
l.forEach(({ key: e, value: u }, r) => {
|
|
95
|
-
const k = ["c_w_", "c_h_", "c_x_", "c_y_"].includes(e);
|
|
96
|
-
t += `${e}${k ? Math.round(Number(u)) : u}${r < l.length - 1 ? "," : ""}`;
|
|
97
|
-
}), t += "/";
|
|
98
|
-
}
|
|
99
|
-
if (i === n.Rotate && ([
|
|
100
|
-
{
|
|
101
|
-
key: "r_a_",
|
|
102
|
-
value: a.rotation
|
|
103
|
-
}
|
|
104
|
-
].filter((e) => e.value !== void 0).map((e) => ({
|
|
105
|
-
key: e.key,
|
|
106
|
-
value: Math.round(Number(e.value))
|
|
107
|
-
})).forEach(({ key: e, value: u }) => {
|
|
108
|
-
t += `${e}${u}`;
|
|
109
|
-
}), t += "/"), i === n.Quality) {
|
|
110
|
-
const l = [
|
|
111
|
-
{
|
|
112
|
-
key: "q_level_",
|
|
113
|
-
value: a.quality
|
|
114
|
-
}
|
|
115
|
-
].filter((e) => e.value !== void 0).map((e) => ({
|
|
116
|
-
key: e.key,
|
|
117
|
-
value: Math.round(Number(e.value))
|
|
118
|
-
}));
|
|
119
|
-
l.forEach(({ key: e, value: u }, r) => {
|
|
120
|
-
t += `${e}${u}${r < l.length - 1 ? "," : ""}`;
|
|
121
|
-
}), t += "/";
|
|
122
|
-
}
|
|
123
|
-
if (i === n.Metadata) {
|
|
124
|
-
const l = [
|
|
125
|
-
{
|
|
126
|
-
key: "fl_keep_metadata",
|
|
127
|
-
value: a.keepMetadata
|
|
128
|
-
}
|
|
129
|
-
].filter((e) => e.value !== void 0).map((e) => ({ key: e.key, value: e.value }));
|
|
130
|
-
l.forEach(({ key: e }, u) => {
|
|
131
|
-
t += `${e}${u < l.length - 1 ? "," : ""}`;
|
|
132
|
-
}), t += "/";
|
|
133
|
-
}
|
|
134
|
-
}), y && (t += `${_?.identifier ?? crypto.randomUUID()}${y}`);
|
|
135
|
-
const h = [];
|
|
136
|
-
return c && c.length > 0 && c.forEach(({ key: i, value: a }) => {
|
|
137
|
-
h.push(
|
|
138
|
-
`${encodeURIComponent(i.trim())}=${encodeURIComponent(a.trim())}`
|
|
139
|
-
);
|
|
140
|
-
}), d && v && h.push(`UseSession=${encodeURIComponent(v)}`), h.length > 0 && (t += `?${h.join("&")}`), t.endsWith("/") && (t = t.slice(0, -1)), t;
|
|
141
|
-
}
|
|
142
|
-
export {
|
|
143
|
-
p as b
|
|
144
|
-
};
|