@orangelogic/design-system 2.101.0 → 2.102.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 (25) hide show
  1. package/library/chunks/{list-editor.DMjclCWz.js → list-editor.CMakbQyU.js} +181 -183
  2. package/library/chunks/transformation.Dir8s_wm.js +151 -0
  3. package/library/components/asset-link-format.js +867 -672
  4. package/library/components/drawer.js +82 -71
  5. package/library/components/list-editor.js +1 -1
  6. package/library/components/molecules.js +1 -1
  7. package/library/components/tag.js +44 -31
  8. package/library/components/types.js +558 -561
  9. package/library/package.json +1 -1
  10. package/library/packages/atoms/src/components/drawer/drawer.d.ts +8 -0
  11. package/library/packages/atoms/src/components/tag/tag.d.ts +11 -1
  12. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +8 -0
  13. package/library/packages/organisms/src/asset-link-format/components/asset-link-format-crop/asset-link-format-crop.d.ts +4 -0
  14. package/library/packages/organisms/src/asset-link-format/components/asset-link-format-quality/asset-link-format-quality.d.ts +4 -0
  15. package/library/packages/organisms/src/asset-link-format/components/asset-link-format-resize/asset-link-format-resize.d.ts +4 -0
  16. package/library/packages/organisms/src/asset-link-format/components/asset-link-format-rotation/asset-link-format-rotation.d.ts +4 -0
  17. package/library/packages/organisms/src/content-builder/styleController.d.ts +2 -1
  18. package/library/packages/types/src/asset-link-format.d.ts +2 -0
  19. package/library/packages/types/src/content-builder.d.ts +5 -1
  20. package/library/packages/types/src/tag.d.ts +1 -0
  21. package/library/packages/utils/src/transformation/transformation.d.ts +4 -1
  22. package/library/react-web-component.d.ts +15 -3
  23. package/library/utils.js +1 -1
  24. package/package.json +1 -1
  25. package/library/chunks/transformation.Cqz3hPaQ.js +0 -144
@@ -0,0 +1,151 @@
1
+ import { T as r } from "./asset-link-format.BSRDqHg7.js";
2
+ function m({
3
+ asset: k,
4
+ baseUrl: h,
5
+ extension: y,
6
+ options: f,
7
+ parameters: c,
8
+ transformations: l,
9
+ useSession: _ = ""
10
+ }) {
11
+ if (h == null)
12
+ return "";
13
+ let a = h;
14
+ const v = l?.findLast(
15
+ (i) => i.key === r.Quality
16
+ );
17
+ if (v && (l = [
18
+ ...l?.filter(
19
+ (i) => i.key !== r.Quality
20
+ ) || [],
21
+ v
22
+ ]), l) {
23
+ const i = [];
24
+ for (let o = 0; o < l.length; o++) {
25
+ const t = l[o];
26
+ if (t.key === r.Rotate) {
27
+ let e = t.value.rotation ?? 0;
28
+ for (; l[o + 1]?.key === r.Rotate; )
29
+ o++, e += l[o].value.rotation ?? 0;
30
+ e !== 0 && i.push({ key: r.Rotate, value: { rotation: e } });
31
+ } else
32
+ i.push(t);
33
+ }
34
+ l = i;
35
+ }
36
+ l && l.length > 0 && (a += "/t/"), l?.forEach(({ key: i, value: o }) => {
37
+ if (i === r.Resize) {
38
+ const t = [
39
+ ...[
40
+ {
41
+ key: "re_w_",
42
+ value: Math.round(o.width ?? 0)
43
+ },
44
+ {
45
+ key: "re_h_",
46
+ value: Math.round(o.height ?? 0)
47
+ }
48
+ ].filter((e) => e.value !== void 0).map((e) => ({
49
+ key: e.key,
50
+ value: Math.round(Number(e.value))
51
+ })),
52
+ {
53
+ key: "re_rm_",
54
+ value: "stretch"
55
+ }
56
+ ];
57
+ t.forEach(({ key: e, value: u }, n) => {
58
+ a += `${e}${u}${n < t.length - 1 ? "," : ""}`;
59
+ }), a += "/";
60
+ }
61
+ if (i === r.Crop) {
62
+ const t = [
63
+ ...[
64
+ {
65
+ key: "c_",
66
+ value: o.mode
67
+ },
68
+ ...o.disabledSize ? [] : [
69
+ {
70
+ key: "c_w_",
71
+ value: Math.round(o.width ?? 0)
72
+ },
73
+ {
74
+ key: "c_h_",
75
+ value: Math.round(o.height ?? 0)
76
+ },
77
+ {
78
+ key: "c_x_",
79
+ value: Math.round(o.x ?? 0) === 0 && f?.omitZeroXY ? void 0 : Math.round(o.x ?? 0)
80
+ },
81
+ {
82
+ key: "c_y_",
83
+ value: Math.round(o.y ?? 0) === 0 && f?.omitZeroXY ? void 0 : Math.round(o.y ?? 0)
84
+ }
85
+ ],
86
+ ...o.focusMode && o.focusMode !== "manual" ? [
87
+ {
88
+ key: o.isFocusModeAuto ? "acm_" : "c_g_",
89
+ value: o.focusMode
90
+ }
91
+ ] : []
92
+ ].filter((e) => e.value !== void 0 && e.value !== null).map((e) => ({
93
+ key: e.key,
94
+ value: e.value
95
+ })),
96
+ {
97
+ key: "c_whu_",
98
+ value: "pixel"
99
+ }
100
+ ];
101
+ t.forEach(({ key: e, value: u }, n) => {
102
+ const s = ["c_w_", "c_h_", "c_x_", "c_y_"].includes(e);
103
+ a += `${e}${s ? Math.round(Number(u)) : u}${n < t.length - 1 ? "," : ""}`;
104
+ }), a += "/";
105
+ }
106
+ if (i === r.Rotate && ([
107
+ {
108
+ key: "r_a_",
109
+ value: o.rotation
110
+ }
111
+ ].filter((e) => e.value !== void 0).map((e) => ({
112
+ key: e.key,
113
+ value: Math.round(Number(e.value))
114
+ })).forEach(({ key: e, value: u }) => {
115
+ a += `${e}${u}`;
116
+ }), a += "/"), i === r.Quality) {
117
+ const t = [
118
+ {
119
+ key: "q_level_",
120
+ value: o.quality
121
+ }
122
+ ].filter((e) => e.value !== void 0).map((e) => ({
123
+ key: e.key,
124
+ value: Math.round(Number(e.value))
125
+ }));
126
+ t.forEach(({ key: e, value: u }, n) => {
127
+ a += `${e}${u}${n < t.length - 1 ? "," : ""}`;
128
+ }), a += "/";
129
+ }
130
+ if (i === r.Metadata) {
131
+ const t = [
132
+ {
133
+ key: "fl_keep_metadata",
134
+ value: o.keepMetadata
135
+ }
136
+ ].filter((e) => e.value !== void 0).map((e) => ({ key: e.key, value: e.value }));
137
+ t.forEach(({ key: e }, u) => {
138
+ a += `${e}${u < t.length - 1 ? "," : ""}`;
139
+ }), a += "/";
140
+ }
141
+ }), y && (a += `${k?.identifier ?? crypto.randomUUID()}${y}`);
142
+ const d = [];
143
+ return c && c.length > 0 && c.forEach(({ key: i, value: o }) => {
144
+ d.push(
145
+ `${encodeURIComponent(i.trim())}=${encodeURIComponent(o.trim())}`
146
+ );
147
+ }), h && _ && d.push(`UseSession=${encodeURIComponent(_)}`), d.length > 0 && (a += `?${d.join("&")}`), a.endsWith("/") && (a = a.slice(0, -1)), a;
148
+ }
149
+ export {
150
+ m as b
151
+ };