@orangelogic/design-system 2.160.0 → 2.162.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.
Files changed (31) hide show
  1. package/library/chunks/{asset-link-format.CUPqX8XL.js → asset-link-format.DLAzKfhk.js} +188 -188
  2. package/library/chunks/{color-swatch-group.Dg5avknJ.js → color-swatch-group.CLv1LSZy.js} +16 -4
  3. package/library/chunks/drag.DenOh3AE.js +39 -0
  4. package/library/chunks/transformation.D1alV_s4.js +189 -0
  5. package/library/components/asset-link-format.js +2 -2
  6. package/library/components/color-picker.js +1 -1
  7. package/library/components/color-swatch-group.js +1 -1
  8. package/library/components/image-comparer.js +1 -1
  9. package/library/components/organisms.js +2 -2
  10. package/library/components/range.js +1 -1
  11. package/library/components/sidebar.js +1 -1
  12. package/library/components/split-panel.js +1 -1
  13. package/library/components/types.js +19870 -19744
  14. package/library/package.json +1 -1
  15. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Page/Page.d.ts +6 -0
  16. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Validate/Validate.d.ts +6 -0
  17. package/library/packages/molecules/src/annotator/annotator.d.ts +14 -1
  18. package/library/packages/molecules/src/pdf-viewer-toolbar/pdf-viewer-toolbar.d.ts +1 -0
  19. package/library/packages/organisms/src/content-builder/components/config-manager/config-manager.d.ts +25 -0
  20. package/library/packages/organisms/src/content-builder/content-builder-constants.d.ts +1 -0
  21. package/library/packages/organisms/src/content-builder/content-builder.d.ts +41 -0
  22. package/library/packages/organisms/src/content-builder/plugins/plugin-factory.d.ts +5 -0
  23. package/library/packages/organisms/src/content-builder/styleController.d.ts +1 -0
  24. package/library/packages/types/src/content-builder.d.ts +7 -0
  25. package/library/packages/types/src/pdf-viewer-toolbar.d.ts +4 -3
  26. package/library/packages/utils/src/transformation/transformation.d.ts +8 -0
  27. package/library/react-web-component.d.ts +22 -2
  28. package/library/utils.js +4 -3
  29. package/package.json +1 -1
  30. package/library/chunks/drag.DXEXVXPv.js +0 -18
  31. package/library/chunks/transformation.BDmd3kER.js +0 -163
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "2.160.0",
4
+ "version": "2.162.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {
@@ -20,6 +20,12 @@ export default class Page extends Module implements IPage {
20
20
  dataChanging: boolean;
21
21
  pageSizes: number[];
22
22
  mode: 'remote' | 'local' | 'progressive_load' | 'progressive_scroll';
23
+ /**
24
+ * Coalesces bursts of 'row-added'/'row-deleted' (e.g. a streaming loader
25
+ * calling addData() per chunk, which dispatches one event per row) into a
26
+ * single pipeline refresh instead of one full re-render per row.
27
+ */
28
+ private rowsUpdatedScheduled;
23
29
  constructor(table: Tabulator);
24
30
  options(key: string): any;
25
31
  initialize(): void;
@@ -106,6 +106,12 @@ export default class Validate extends Module {
106
106
  * responsive.
107
107
  */
108
108
  private validateColumnsOnMainThread;
109
+ /**
110
+ * Only style cells that already have real DOM (`cell.loaded`). Calling
111
+ * `getElement()` on an unloaded cell forces it to generate a detached
112
+ * element — the virtual renderer's later `layoutCell()` call (on scroll/
113
+ * page change) is what actually applies the style once the cell is real.
114
+ */
109
115
  private applyCellInvalidState;
110
116
  private clearCellInvalidState;
111
117
  private runSuppressed;
@@ -40,7 +40,11 @@ export default class CxAnnotator extends CortexElement {
40
40
  markerArea: MarkerArea | null;
41
41
  color: string;
42
42
  lineWeight: number;
43
- /** Internal cache of the latest annotation state, kept in sync with the marker area. */
43
+ /**
44
+ * Last known good annotation state. Synced from the marker area only when
45
+ * its state has non-zero dimensions, so hidden (0×0) captures never
46
+ * replace a valid recovery source.
47
+ */
44
48
  private annotationStateValue;
45
49
  private resizeObserver;
46
50
  get currentMarker(): import('@markerjs/markerjs3').MarkerBase | undefined;
@@ -58,6 +62,15 @@ export default class CxAnnotator extends CortexElement {
58
62
  private destroyMarkerArea;
59
63
  private initMarkerArea;
60
64
  private restoreAnnotationState;
65
+ /**
66
+ * Builds the state to pass to markerjs3's restoreState. A state that
67
+ * carries markers keeps its own width/height (the canvas size the markers
68
+ * were drawn at) so markerjs3 rescales them to the current target size;
69
+ * overriding those dimensions here would skip that scaling and render the
70
+ * markers at their original pixel coordinates on a different-sized canvas.
71
+ * Empty or dimensionless states adopt the target size instead.
72
+ */
73
+ private toRestorableState;
61
74
  private handleAreaStateChange;
62
75
  private handleMarkerAreaShow;
63
76
  /**
@@ -90,6 +90,7 @@ export default class CxPdfViewerToolbar extends CortexElement {
90
90
  private handleMoreOptionsSelect;
91
91
  private renderLeft;
92
92
  private static getScaleOptions;
93
+ private renderCustomScaleOption;
93
94
  private renderMiddle;
94
95
  private renderRight;
95
96
  render(): TemplateResult;
@@ -66,6 +66,31 @@ export default class CxConfigManager extends CortexElement {
66
66
  * @default false
67
67
  */
68
68
  enableFontFamilyControls: boolean;
69
+ /**
70
+ * Default asset format applied to image blocks.
71
+ * @default 'TRX'
72
+ */
73
+ defaultImageFormat: string;
74
+ /**
75
+ * Default asset format applied to video poster (thumbnail) blocks.
76
+ * @default 'TRX'
77
+ */
78
+ defaultVideoPosterFormat: string;
79
+ /**
80
+ * Default asset format applied to gallery blocks.
81
+ * @default 'TRX'
82
+ */
83
+ defaultGalleryFormat: string;
84
+ /**
85
+ * Default asset format applied to carousel blocks.
86
+ * @default 'TRX'
87
+ */
88
+ defaultCarouselFormat: string;
89
+ /**
90
+ * Default asset format applied to timeline blocks.
91
+ * @default 'TRX'
92
+ */
93
+ defaultTimelineFormat: string;
69
94
  /**
70
95
  * Root folder ids the folder-picker controls are restricted to (forwarded to
71
96
  * cx-config-form). Sourced from the space's configured root folders.
@@ -32,3 +32,4 @@ export declare const BLOCK_CAROUSEL_LIMITED_BLOCKS: BlockType[];
32
32
  export declare const NEWLY_ADDED_COMPONENT_DELAY = 500;
33
33
  export declare const OPEN_ON_NEWLY_ADDED_COMPONENT: Set<BlockType>;
34
34
  export declare const MULTI_LANGUAGE_BLOCKS: Set<BlockType>;
35
+ export declare const DEFAULT_IMAGE_FORMAT = "TR1";
@@ -18,6 +18,12 @@ import { CxRTEBubbleMenu, CxRTETableGenerator } from './plugins';
18
18
  * download-format, and asset-format-picker controls on image, video, gallery,
19
19
  * carousel, and timeline blocks. Off by default.
20
20
  *
21
+ * `default-image-format`, `default-video-poster-format`,
22
+ * `default-gallery-format`, `default-carousel-format`, and
23
+ * `default-timeline-format` set the initial format for their respective block
24
+ * type. All apply regardless of `enable-asset-format-controls`, and act as the
25
+ * fallback when a block has not had its format explicitly configured.
26
+ *
21
27
  * @event cx-change - Emitted when the content builder changes.
22
28
  */
23
29
  export default class CxContentBuilder extends CortexElement {
@@ -105,6 +111,41 @@ export default class CxContentBuilder extends CortexElement {
105
111
  * @default false
106
112
  */
107
113
  enableAssetFormatControls: boolean;
114
+ /**
115
+ * Default asset format applied to image blocks.
116
+ * Used as the initial format when a block is added, whether or not
117
+ * `enable-asset-format-controls` is on.
118
+ * @default 'TR1'
119
+ */
120
+ defaultImageFormat: string;
121
+ /**
122
+ * Default asset format applied to video poster (thumbnail) blocks.
123
+ * Used as the initial format when a block is added, whether or not
124
+ * `enable-asset-format-controls` is on.
125
+ * @default 'TR1'
126
+ */
127
+ defaultVideoPosterFormat: string;
128
+ /**
129
+ * Default asset format applied to gallery blocks.
130
+ * Used as the initial format when a block is added, whether or not
131
+ * `enable-asset-format-controls` is on.
132
+ * @default 'TR1'
133
+ */
134
+ defaultGalleryFormat: string;
135
+ /**
136
+ * Default asset format applied to carousel blocks.
137
+ * Used as the initial format when a block is added, whether or not
138
+ * `enable-asset-format-controls` is on.
139
+ * @default 'TR1'
140
+ */
141
+ defaultCarouselFormat: string;
142
+ /**
143
+ * Default asset format applied to timeline blocks.
144
+ * Used as the initial format when a block is added, whether or not
145
+ * `enable-asset-format-controls` is on.
146
+ * @default 'TR1'
147
+ */
148
+ defaultTimelineFormat: string;
108
149
  /**
109
150
  * Set `enable-font-family-controls` to expose the font family / style / weight
110
151
  * pickers (and their font-size controls) in the block config sidebar.
@@ -4,6 +4,11 @@ import { LocalizeController } from '../../../../utils/src/custom-element/i18n';
4
4
  import { Component, ComponentDefinition, ComponentView, ComponentViewDefinition, Editor } from 'grapesjs';
5
5
 
6
6
  export type EditorPluginOptions = {
7
+ defaultCarouselFormat?: string;
8
+ defaultGalleryFormat?: string;
9
+ defaultImageFormat?: string;
10
+ defaultTimelineFormat?: string;
11
+ defaultVideoPosterFormat?: string;
7
12
  enableAssetFormatControls?: boolean;
8
13
  localize: LocalizeController;
9
14
  multiLanguage?: boolean;
@@ -139,6 +139,7 @@ export default class StyleController {
139
139
  multiple?: boolean;
140
140
  pickerConfigs?: {
141
141
  accepts?: string[];
142
+ defaultFormat?: string;
142
143
  multiple?: boolean;
143
144
  nameKey?: string;
144
145
  parentAssetIdKey?: string;
@@ -157,6 +157,8 @@ export type PropertyConfig<T = Record<string, any>> = Omit<TraitProperties, 'opt
157
157
  options?: Option[];
158
158
  pickerConfigs?: {
159
159
  accepts?: string[];
160
+ /** The format code used to resolve a preview src immediately after picking an image (before the user configures a format). */
161
+ defaultFormat?: string;
160
162
  multiple?: boolean;
161
163
  /** The block-attribute key that stores the asset name. Defaults to 'name'. */
162
164
  nameKey?: string;
@@ -355,6 +357,11 @@ export declare enum DataSourceId {
355
357
  TranslatableTexts = "TRANSLATABLE_TEXTS"
356
358
  }
357
359
  export type ConfigsOptions = {
360
+ defaultCarouselFormat?: string;
361
+ defaultGalleryFormat?: string;
362
+ defaultImageFormat?: string;
363
+ defaultTimelineFormat?: string;
364
+ defaultVideoPosterFormat?: string;
358
365
  enableAssetFormatControls?: boolean;
359
366
  enableFontFamilyControls?: boolean;
360
367
  };
@@ -11,10 +11,11 @@ export type PdfViewerScrollMode = 'page' | 'vertical' | 'horizontal' | 'wrapped'
11
11
  /** How page spreads are joined. */
12
12
  export type PdfViewerSpreadMode = 'none' | 'odd' | 'even';
13
13
  /**
14
- * The zoom scale. Either a named mode, a percentage zoom factor (as a string, e.g.
15
- * `'150-percent'` = 150%), or `'custom'` for a non-preset factor shown via `customScalePercent`.
14
+ * The zoom scale: a named mode, one of the select's percentage presets, or — for a
15
+ * zoom off that list, e.g. once the zoom buttons step past 400% — the raw scale
16
+ * factor as a number string (`'4.6'` = 460%).
16
17
  */
17
- export type PdfViewerScaleValue = 'auto' | 'page-actual' | 'page-fit' | 'page-width' | '50-percent' | '75-percent' | '100-percent' | '125-percent' | '150-percent' | '200-percent' | '300-percent' | '400-percent';
18
+ export type PdfViewerScaleValue = 'auto' | 'page-actual' | 'page-fit' | 'page-width' | '50-percent' | '75-percent' | '100-percent' | '125-percent' | '150-percent' | '200-percent' | '300-percent' | '400-percent' | `${number}`;
18
19
  /** A row in the "View on asset" dropdown. */
19
20
  export interface ViewOnAssetRow {
20
21
  checked: boolean;
@@ -11,3 +11,11 @@ export declare function buildTransformationString({ asset, baseUrl, extension, o
11
11
  transformations?: Transformation[];
12
12
  useSession?: string;
13
13
  }): string;
14
+ /**
15
+ * Applies transformations to a (possibly finished) asset URL and returns the display URL.
16
+ *
17
+ * The backend resolver splits on the FIRST `/t/` after the access key, so for `/AssetLink/`
18
+ * URLs the transform is anchored right after the access key (before any prettyName/ext tail)
19
+ * and merged into an existing `/t/`. Other URLs keep the plain append behavior.
20
+ */
21
+ export declare function applyTransformationsToUrl(url: string, transformations: Transformation[]): string;
@@ -6840,7 +6840,7 @@
6840
6840
  /**
6841
6841
  * Current zoom scale.
6842
6842
  */
6843
- scaleValue?: 'auto' | 'page-actual' | 'page-fit' | 'page-width' | '50-percent' | '75-percent' | '100-percent' | '125-percent' | '150-percent' | '200-percent' | '300-percent' | '400-percent';
6843
+ scaleValue?: 'auto' | 'page-actual' | 'page-fit' | 'page-width' | '50-percent' | '75-percent' | '100-percent' | '125-percent' | '150-percent' | '200-percent' | '300-percent' | '400-percent' | string;
6844
6844
  /**
6845
6845
  * Disables the zoom-in button.
6846
6846
  */
@@ -9647,7 +9647,7 @@
9647
9647
  preRender?: boolean;
9648
9648
  }
9649
9649
  /**
9650
- * The `cx-content-builder` component is used to create and manage content blocks in a CMS.<br/> Set `enable-asset-format-controls` to expose the asset format, transformation, download-format, and asset-format-picker controls on image, video, gallery, carousel, and timeline blocks. Off by default.
9650
+ * The `cx-content-builder` component is used to create and manage content blocks in a CMS.<br/> Set `enable-asset-format-controls` to expose the asset format, transformation, download-format, and asset-format-picker controls on image, video, gallery, carousel, and timeline blocks. Off by default.<br/> `default-image-format`, `default-video-poster-format`, `default-gallery-format`, `default-carousel-format`, and `default-timeline-format` set the initial format for their respective block type. All apply regardless of `enable-asset-format-controls`, and act as the fallback when a block has not had its format explicitly configured.
9651
9651
  */
9652
9652
  interface CxContentBuilderAttributes extends HTMLAttributes<CxContentBuilder> {
9653
9653
 
@@ -9687,6 +9687,26 @@
9687
9687
  * Whether to expose the asset format / transformation / download-format / asset-format-picker controls in the per-block config sidebar for image, video, gallery, carousel, and timeline blocks. <br/>@default false
9688
9688
  */
9689
9689
  enableAssetFormatControls?: boolean;
9690
+ /**
9691
+ * Default asset format applied to image blocks. Used as the initial format when a block is added, whether or not `enable-asset-format-controls` is on. <br/>@default 'TR1'
9692
+ */
9693
+ defaultImageFormat?: string;
9694
+ /**
9695
+ * Default asset format applied to video poster (thumbnail) blocks. Used as the initial format when a block is added, whether or not `enable-asset-format-controls` is on. <br/>@default 'TR1'
9696
+ */
9697
+ defaultVideoPosterFormat?: string;
9698
+ /**
9699
+ * Default asset format applied to gallery blocks. Used as the initial format when a block is added, whether or not `enable-asset-format-controls` is on. <br/>@default 'TR1'
9700
+ */
9701
+ defaultGalleryFormat?: string;
9702
+ /**
9703
+ * Default asset format applied to carousel blocks. Used as the initial format when a block is added, whether or not `enable-asset-format-controls` is on. <br/>@default 'TR1'
9704
+ */
9705
+ defaultCarouselFormat?: string;
9706
+ /**
9707
+ * Default asset format applied to timeline blocks. Used as the initial format when a block is added, whether or not `enable-asset-format-controls` is on. <br/>@default 'TR1'
9708
+ */
9709
+ defaultTimelineFormat?: string;
9690
9710
  /**
9691
9711
  * Set `enable-font-family-controls` to expose the font family / style / weight pickers (and their font-size controls) in the block config sidebar. <br/>@default false
9692
9712
  */
package/library/utils.js CHANGED
@@ -9,7 +9,7 @@ import { t as Ae } from "./chunks/converters.DkDtLstb.js";
9
9
  import { c as Le } from "./chunks/custom-element.L4WJXn1j.js";
10
10
  import { d as Re } from "./chunks/debounce.DaHuiSGU.js";
11
11
  import { d as Ve } from "./chunks/default-value.COZopaet.js";
12
- import { d as Oe } from "./chunks/drag.DXEXVXPv.js";
12
+ import { d as Oe } from "./chunks/drag.DenOh3AE.js";
13
13
  import { f as Ye } from "./chunks/focus-when-visible.jWSw9ks0.js";
14
14
  import { f as k } from "./chunks/form.CP9KLGjF.js";
15
15
  import { F as Ue, c as _e, g as Pe, v as Xe, a as He } from "./chunks/form.CP9KLGjF.js";
@@ -34,7 +34,7 @@ import { s as ga } from "./chunks/parse.Cu5nBDTb.js";
34
34
  import { b as pa, o as Da, d as Ta, e as wa, f as Ca, m as xa, q as Ma, g as ya, h as Sa, l as Ea, p as Aa, z as Ia, y as La, a as va, c as Ra, s as ba, x as Va, v as Fa, t as Oa, r as ka, w as Ya, i as Na, n as Ua, u as _a } from "./chunks/string.BhJ0Zogu.js";
35
35
  import { g as Xa, a as Ha } from "./chunks/template.ClovJacp.js";
36
36
  import { c as Ba, f as $a, a as Ga, g as za } from "./chunks/time.DWfbnPnM.js";
37
- import { b as Qa } from "./chunks/transformation.BDmd3kER.js";
37
+ import { a as Qa, b as Za } from "./chunks/transformation.D1alV_s4.js";
38
38
  function n(t) {
39
39
  const e = t.getFullYear(), r = String(t.getMonth() + 1).padStart(2, "0"), s = String(t.getDate()).padStart(2, "0");
40
40
  return `${e}-${r}-${s}`;
@@ -598,7 +598,8 @@ export {
598
598
  we as animateTo,
599
599
  O as appendProtocol,
600
600
  Et as appendQueryParam,
601
- Qa as buildTransformationString,
601
+ Qa as applyTransformationsToUrl,
602
+ Za as buildTransformationString,
602
603
  ea as buildWaveformPath,
603
604
  $r as calculateAspectRatioFit,
604
605
  ze as clamp,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "2.160.0",
4
+ "version": "2.162.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {
@@ -1,18 +0,0 @@
1
- function s(i, e) {
2
- function o(t) {
3
- const l = i.getBoundingClientRect(), f = i.ownerDocument.defaultView, d = l.left + f.scrollX, a = l.top + f.scrollY;
4
- let u = t.pageX - d, r = t.pageY - a;
5
- if (t._parentEvent) {
6
- const n = t.target;
7
- n instanceof HTMLElement && (u += n.getBoundingClientRect().left + n.ownerDocument.defaultView.scrollX, r += n.getBoundingClientRect().top + n.ownerDocument.defaultView.scrollY);
8
- }
9
- e?.onMove && e.onMove(u, r, t);
10
- }
11
- function c() {
12
- document.removeEventListener("pointermove", o), document.removeEventListener("pointerup", c), e?.onStop && e.onStop();
13
- }
14
- document.addEventListener("pointermove", o, { passive: !0 }), document.addEventListener("pointerup", c), e?.initialEvent instanceof PointerEvent && o(e.initialEvent);
15
- }
16
- export {
17
- s as d
18
- };
@@ -1,163 +0,0 @@
1
- import { T as n, U as $ } from "./asset-link-format.QzzboHHE.js";
2
- function R({
3
- asset: p,
4
- baseUrl: c,
5
- extension: f,
6
- options: _,
7
- parameters: y,
8
- transformations: r,
9
- useSession: k = ""
10
- }) {
11
- if (c == null)
12
- return "";
13
- let i = c;
14
- const s = r?.findLast(
15
- (a) => a.key === n.Quality
16
- );
17
- if (s && (r = [
18
- ...r?.filter(
19
- (a) => a.key !== n.Quality
20
- ) || [],
21
- s
22
- ]), r) {
23
- const a = [];
24
- for (let e = 0; e < r.length; e++) {
25
- const o = r[e];
26
- if (o.key === n.Rotate) {
27
- let t = o.value.rotation ?? 0;
28
- for (; r[e + 1]?.key === n.Rotate; )
29
- e++, t += r[e].value.rotation ?? 0;
30
- t !== 0 && a.push({ key: n.Rotate, value: { rotation: t } });
31
- } else
32
- a.push(o);
33
- }
34
- r = a;
35
- }
36
- r && r.length > 0 && (i += "/t/"), r?.forEach(({ key: a, value: e }) => {
37
- if (a === n.Resize) {
38
- if (e.unit === $.AspectRatio && e.ratioWidth && e.ratioHeight) {
39
- i += `re_ar_${e.ratioWidth}:${e.ratioHeight}/`;
40
- return;
41
- }
42
- const o = [
43
- ...[
44
- {
45
- key: "re_w_",
46
- value: Math.round(e.width ?? 0)
47
- },
48
- {
49
- key: "re_h_",
50
- value: Math.round(e.height ?? 0)
51
- }
52
- ].filter((t) => t.value !== void 0).map((t) => ({
53
- key: t.key,
54
- value: Math.round(Number(t.value))
55
- })),
56
- {
57
- key: "re_rm_",
58
- value: "stretch"
59
- }
60
- ];
61
- o.forEach(({ key: t, value: d }, u) => {
62
- i += `${t}${d}${u < o.length - 1 ? "," : ""}`;
63
- }), i += "/";
64
- }
65
- if (a === n.Crop) {
66
- const o = e.unit === $.AspectRatio && !!e.ratioWidth && !!e.ratioHeight, t = !e.disabledSize && !o, d = t && (e.x !== void 0 || e.y !== void 0), u = [
67
- ...[
68
- {
69
- key: "c_",
70
- value: e.mode
71
- },
72
- ...o ? [
73
- {
74
- key: "ar_",
75
- value: `${e.ratioWidth}:${e.ratioHeight}`
76
- }
77
- ] : [],
78
- ...t ? [
79
- {
80
- key: "c_w_",
81
- value: Math.round(e.width ?? 0)
82
- },
83
- {
84
- key: "c_h_",
85
- value: Math.round(e.height ?? 0)
86
- },
87
- {
88
- key: "c_x_",
89
- value: Math.round(e.x ?? 0) === 0 && _?.omitZeroXY ? void 0 : Math.round(e.x ?? 0)
90
- },
91
- {
92
- key: "c_y_",
93
- value: Math.round(e.y ?? 0) === 0 && _?.omitZeroXY ? void 0 : Math.round(e.y ?? 0)
94
- }
95
- ] : [],
96
- ...!d && e.focusMode && e.focusMode !== "manual" ? [
97
- {
98
- key: e.isFocusModeAuto ? "acm_" : "c_g_",
99
- value: e.focusMode
100
- }
101
- ] : []
102
- ].filter((h) => h.value !== void 0 && h.value !== null).map((h) => ({
103
- key: h.key,
104
- value: h.value
105
- })),
106
- ...o ? [] : [
107
- {
108
- key: "c_whu_",
109
- value: "pixel"
110
- }
111
- ]
112
- ];
113
- u.forEach(({ key: h, value: v }, M) => {
114
- const g = ["c_w_", "c_h_", "c_x_", "c_y_"].includes(h);
115
- i += `${h}${g ? Math.round(Number(v)) : v}${M < u.length - 1 ? "," : ""}`;
116
- }), i += "/";
117
- }
118
- if (a === n.Rotate && ([
119
- {
120
- key: "r_a_",
121
- value: e.rotation
122
- }
123
- ].filter((t) => t.value !== void 0).map((t) => ({
124
- key: t.key,
125
- value: Math.round(Number(t.value))
126
- })).forEach(({ key: t, value: d }) => {
127
- i += `${t}${d}`;
128
- }), i += "/"), a === n.Quality) {
129
- const o = [
130
- {
131
- key: "q_level_",
132
- value: e.quality
133
- }
134
- ].filter((t) => t.value !== void 0).map((t) => ({
135
- key: t.key,
136
- value: Math.round(Number(t.value))
137
- }));
138
- o.forEach(({ key: t, value: d }, u) => {
139
- i += `${t}${d}${u < o.length - 1 ? "," : ""}`;
140
- }), i += "/";
141
- }
142
- if (a === n.Metadata) {
143
- const o = [
144
- {
145
- key: "fl_keep_metadata",
146
- value: e.keepMetadata
147
- }
148
- ].filter((t) => t.value !== void 0).map((t) => ({ key: t.key, value: t.value }));
149
- o.forEach(({ key: t }, d) => {
150
- i += `${t}${d < o.length - 1 ? "," : ""}`;
151
- }), i += "/";
152
- }
153
- }), f && (i += `${p?.identifier ?? crypto.randomUUID()}${f}`);
154
- const l = [];
155
- return y && y.length > 0 && y.forEach(({ key: a, value: e }) => {
156
- l.push(
157
- `${encodeURIComponent(a.trim())}=${encodeURIComponent(e.trim())}`
158
- );
159
- }), c && k && l.push(`UseSession=${encodeURIComponent(k)}`), l.length > 0 && (i += `?${l.join("&")}`), i.endsWith("/") && (i = i.slice(0, -1)), i;
160
- }
161
- export {
162
- R as b
163
- };