@combeenation/custom-code-sdk 0.0.1-alpha11 → 0.0.1-alpha13
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/bundle.cjs.js +1 -1
- package/dist/bundle.es.js +400 -509
- package/dist/index.d.ts +338 -62
- package/package.json +8 -6
package/dist/bundle.es.js
CHANGED
|
@@ -1,517 +1,408 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
throw new Error(`Cannot access API for Input "${this.id}".`);
|
|
210
|
-
}
|
|
211
|
-
onRendered(n) {
|
|
212
|
-
var t;
|
|
213
|
-
return ((t = i(this, f)) == null ? void 0 : t.addOnRenderedCallback(n)) ?? { unsubscribe: () => {
|
|
214
|
-
} };
|
|
215
|
-
}
|
|
216
|
-
async setVisible(n) {
|
|
217
|
-
var t;
|
|
218
|
-
await ((t = i(this, f)) == null ? void 0 : t.setVisible(n));
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
_ = new WeakMap(), f = new WeakMap();
|
|
222
|
-
var L, w;
|
|
223
|
-
class je {
|
|
224
|
-
constructor(n) {
|
|
225
|
-
d(this, "id");
|
|
226
|
-
a(this, L, "v1");
|
|
227
|
-
a(this, w);
|
|
228
|
-
var s, o;
|
|
229
|
-
this.id = n;
|
|
230
|
-
const t = (o = (s = window.Cbn) == null ? void 0 : s.getCustomCodeSdkBridge) == null ? void 0 : o.call(s, i(this, L));
|
|
231
|
-
if (u(this, w, t == null ? void 0 : t.getPanelSdkBridge(this.id)), !i(this, w))
|
|
232
|
-
throw new Error(`Cannot access API for Panel "${this.id}".`);
|
|
233
|
-
}
|
|
234
|
-
onRendered(n) {
|
|
235
|
-
var t;
|
|
236
|
-
return ((t = i(this, w)) == null ? void 0 : t.addOnRenderedCallback(n)) ?? { unsubscribe: () => {
|
|
237
|
-
} };
|
|
238
|
-
}
|
|
239
|
-
async setVisible(n) {
|
|
240
|
-
var t;
|
|
241
|
-
await ((t = i(this, w)) == null ? void 0 : t.setVisible(n));
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
L = new WeakMap(), w = new WeakMap();
|
|
245
|
-
var U, l;
|
|
246
|
-
class Ke {
|
|
247
|
-
constructor(n) {
|
|
248
|
-
d(this, "id");
|
|
249
|
-
a(this, U, "v1");
|
|
250
|
-
a(this, l);
|
|
251
|
-
var s, o;
|
|
252
|
-
this.id = n;
|
|
253
|
-
const t = (o = (s = window.Cbn) == null ? void 0 : s.getCustomCodeSdkBridge) == null ? void 0 : o.call(s, i(this, U));
|
|
254
|
-
if (u(this, l, t == null ? void 0 : t.getTextSdkBridge(this.id)), !i(this, l))
|
|
255
|
-
throw new Error(`Cannot access API for Text "${this.id}".`);
|
|
256
|
-
}
|
|
257
|
-
onRendered(n) {
|
|
258
|
-
var t;
|
|
259
|
-
return ((t = i(this, l)) == null ? void 0 : t.addOnRenderedCallback(n)) ?? { unsubscribe: () => {
|
|
260
|
-
} };
|
|
261
|
-
}
|
|
262
|
-
async setVisible(n) {
|
|
263
|
-
var t;
|
|
264
|
-
await ((t = i(this, l)) == null ? void 0 : t.setVisible(n));
|
|
265
|
-
}
|
|
266
|
-
setText(n) {
|
|
267
|
-
var t;
|
|
268
|
-
(t = i(this, l)) == null || t.setText(n);
|
|
269
|
-
}
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var t = Object.defineProperty, n = (e, n) => {
|
|
4
|
+
let r = {};
|
|
5
|
+
for (var i in e) t(r, i, {
|
|
6
|
+
get: e[i],
|
|
7
|
+
enumerable: !0
|
|
8
|
+
});
|
|
9
|
+
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
10
|
+
}, r = "0.0.1-alpha13", i = class {
|
|
11
|
+
id;
|
|
12
|
+
#e = "v1";
|
|
13
|
+
#t = void 0;
|
|
14
|
+
constructor(e) {
|
|
15
|
+
this.id = e;
|
|
16
|
+
let t = window.Cbn?.getCustomCodeSdkBridge?.(this.#e);
|
|
17
|
+
if (this.#t = t?.getButtonSdkBridge(this.id), !this.#t) throw Error(`Cannot access API for Button "${this.id}".`);
|
|
18
|
+
}
|
|
19
|
+
onRendered(e) {
|
|
20
|
+
return this.#t?.addOnRenderedCallback(e) ?? { unsubscribe: () => {} };
|
|
21
|
+
}
|
|
22
|
+
onClick(e) {
|
|
23
|
+
return this.#t?.addOnClickCallback(e) ?? { unsubscribe: () => {} };
|
|
24
|
+
}
|
|
25
|
+
async setVisible(e) {
|
|
26
|
+
await this.#t?.setVisible(e);
|
|
27
|
+
}
|
|
28
|
+
setText(e) {
|
|
29
|
+
this.#t?.setText(e);
|
|
30
|
+
}
|
|
31
|
+
}, a = class {
|
|
32
|
+
id;
|
|
33
|
+
#e = "v1";
|
|
34
|
+
#t = void 0;
|
|
35
|
+
constructor(e) {
|
|
36
|
+
this.id = e;
|
|
37
|
+
let t = window.Cbn?.getCustomCodeSdkBridge?.(this.#e);
|
|
38
|
+
if (this.#t = t?.getCheckboxSdkBridge(this.id), !this.#t) throw Error(`Cannot access API for Checkbox "${this.id}".`);
|
|
39
|
+
}
|
|
40
|
+
onRendered(e) {
|
|
41
|
+
return this.#t?.addOnRenderedCallback(e) ?? { unsubscribe: () => {} };
|
|
42
|
+
}
|
|
43
|
+
async setVisible(e) {
|
|
44
|
+
await this.#t?.setVisible(e);
|
|
45
|
+
}
|
|
46
|
+
}, o = class {
|
|
47
|
+
id;
|
|
48
|
+
#e = "v1";
|
|
49
|
+
#t = void 0;
|
|
50
|
+
constructor(e) {
|
|
51
|
+
this.id = e;
|
|
52
|
+
let t = window.Cbn?.getCustomCodeSdkBridge?.(this.#e);
|
|
53
|
+
if (this.#t = t?.getCollapsibleSdkBridge(this.id), !this.#t) throw Error(`Cannot access API for Collapsible "${this.id}".`);
|
|
54
|
+
}
|
|
55
|
+
onRendered(e) {
|
|
56
|
+
return this.#t?.addOnRenderedCallback(e) ?? { unsubscribe: () => {} };
|
|
57
|
+
}
|
|
58
|
+
async setVisible(e) {
|
|
59
|
+
await this.#t?.setVisible(e);
|
|
60
|
+
}
|
|
61
|
+
}, s = class {
|
|
62
|
+
id;
|
|
63
|
+
#e = "v1";
|
|
64
|
+
#t = void 0;
|
|
65
|
+
constructor(e) {
|
|
66
|
+
this.id = e;
|
|
67
|
+
let t = window.Cbn?.getCustomCodeSdkBridge?.(this.#e);
|
|
68
|
+
if (this.#t = t?.getComboboxSdkBridge(this.id), !this.#t) throw Error(`Cannot access API for Combobox "${this.id}".`);
|
|
69
|
+
}
|
|
70
|
+
onRendered(e) {
|
|
71
|
+
return this.#t?.addOnRenderedCallback(e) ?? { unsubscribe: () => {} };
|
|
72
|
+
}
|
|
73
|
+
onItemRendered(e) {
|
|
74
|
+
return this.#t?.addOnItemRenderedCallback(e) ?? { unsubscribe: () => {} };
|
|
75
|
+
}
|
|
76
|
+
onValueItemRendered(e) {
|
|
77
|
+
return this.#t?.addOnValueItemRenderedCallback(e) ?? { unsubscribe: () => {} };
|
|
78
|
+
}
|
|
79
|
+
onGroupHeaderRendered(e) {
|
|
80
|
+
return this.#t?.addOnGroupHeaderRenderedCallback(e) ?? { unsubscribe: () => {} };
|
|
81
|
+
}
|
|
82
|
+
onValueChange(e) {
|
|
83
|
+
return this.#t?.addOnValueChangeCallback(e) ?? { unsubscribe: () => {} };
|
|
84
|
+
}
|
|
85
|
+
onItemClicked(e) {
|
|
86
|
+
return this.#t?.addOnItemClickedCallback(e) ?? { unsubscribe: () => {} };
|
|
87
|
+
}
|
|
88
|
+
async setVisible(e) {
|
|
89
|
+
await this.#t?.setVisible(e);
|
|
90
|
+
}
|
|
91
|
+
setEntries(e) {
|
|
92
|
+
this.#t?.setEntries(e);
|
|
93
|
+
}
|
|
94
|
+
setGroupData(e) {
|
|
95
|
+
this.#t?.setGroupData(e);
|
|
96
|
+
}
|
|
97
|
+
}, c = class {
|
|
98
|
+
id;
|
|
99
|
+
#e = "v1";
|
|
100
|
+
#t = void 0;
|
|
101
|
+
constructor(e) {
|
|
102
|
+
this.id = e;
|
|
103
|
+
let t = window.Cbn?.getCustomCodeSdkBridge?.(this.#e);
|
|
104
|
+
if (this.#t = t?.getCustomCtrlSdkBridge(this.id), !this.#t) throw Error(`Cannot access API for Custom Control "${this.id}".`);
|
|
105
|
+
}
|
|
106
|
+
set renderFn(e) {
|
|
107
|
+
this.#t?.setRenderFn(e);
|
|
108
|
+
}
|
|
109
|
+
async render(e) {
|
|
110
|
+
typeof e == "function" && (this.renderFn = e), await this.#t?.render();
|
|
111
|
+
}
|
|
112
|
+
onRendered(e) {
|
|
113
|
+
return this.#t?.addOnRenderedCallback(e) ?? { unsubscribe: () => {} };
|
|
114
|
+
}
|
|
115
|
+
getElement() {
|
|
116
|
+
return this.#t?.getElement();
|
|
117
|
+
}
|
|
118
|
+
async setVisible(e) {
|
|
119
|
+
await this.#t?.setVisible(e);
|
|
120
|
+
}
|
|
121
|
+
}, l = class {
|
|
122
|
+
id;
|
|
123
|
+
#e = "v1";
|
|
124
|
+
#t = void 0;
|
|
125
|
+
constructor(e) {
|
|
126
|
+
this.id = e;
|
|
127
|
+
let t = window.Cbn?.getCustomCodeSdkBridge?.(this.#e);
|
|
128
|
+
if (this.#t = t?.getDataviewSdkBridge(this.id), !this.#t) throw Error(`Cannot access API for Dataview "${this.id}".`);
|
|
129
|
+
}
|
|
130
|
+
onRendered(e) {
|
|
131
|
+
return this.#t?.addOnRenderedCallback(e) ?? { unsubscribe: () => {} };
|
|
132
|
+
}
|
|
133
|
+
onItemRendered(e) {
|
|
134
|
+
return this.#t?.addOnItemRenderedCallback(e) ?? { unsubscribe: () => {} };
|
|
135
|
+
}
|
|
136
|
+
onGroupHeaderRendered(e) {
|
|
137
|
+
return this.#t?.addOnGroupHeaderRenderedCallback(e) ?? { unsubscribe: () => {} };
|
|
138
|
+
}
|
|
139
|
+
onValueChange(e) {
|
|
140
|
+
return this.#t?.addOnValueChangeCallback(e) ?? { unsubscribe: () => {} };
|
|
141
|
+
}
|
|
142
|
+
onItemClicked(e) {
|
|
143
|
+
return this.#t?.addOnItemClickedCallback(e) ?? { unsubscribe: () => {} };
|
|
144
|
+
}
|
|
145
|
+
async setVisible(e) {
|
|
146
|
+
await this.#t?.setVisible(e);
|
|
147
|
+
}
|
|
148
|
+
setEntries(e) {
|
|
149
|
+
this.#t?.setEntries(e);
|
|
150
|
+
}
|
|
151
|
+
setGroupData(e) {
|
|
152
|
+
this.#t?.setGroupData(e);
|
|
153
|
+
}
|
|
154
|
+
}, ee = class {
|
|
155
|
+
id;
|
|
156
|
+
#e = "v1";
|
|
157
|
+
#t = void 0;
|
|
158
|
+
constructor(e) {
|
|
159
|
+
this.id = e;
|
|
160
|
+
let t = window.Cbn?.getCustomCodeSdkBridge?.(this.#e);
|
|
161
|
+
if (this.#t = t?.getInputSdkBridge(this.id), !this.#t) throw Error(`Cannot access API for Input "${this.id}".`);
|
|
162
|
+
}
|
|
163
|
+
onRendered(e) {
|
|
164
|
+
return this.#t?.addOnRenderedCallback(e) ?? { unsubscribe: () => {} };
|
|
165
|
+
}
|
|
166
|
+
async setVisible(e) {
|
|
167
|
+
await this.#t?.setVisible(e);
|
|
168
|
+
}
|
|
169
|
+
}, u = class {
|
|
170
|
+
id;
|
|
171
|
+
#e = "v1";
|
|
172
|
+
#t = void 0;
|
|
173
|
+
constructor(e) {
|
|
174
|
+
this.id = e;
|
|
175
|
+
let t = window.Cbn?.getCustomCodeSdkBridge?.(this.#e);
|
|
176
|
+
if (this.#t = t?.getPanelSdkBridge(this.id), !this.#t) throw Error(`Cannot access API for Panel "${this.id}".`);
|
|
177
|
+
}
|
|
178
|
+
onRendered(e) {
|
|
179
|
+
return this.#t?.addOnRenderedCallback(e) ?? { unsubscribe: () => {} };
|
|
180
|
+
}
|
|
181
|
+
async setVisible(e) {
|
|
182
|
+
await this.#t?.setVisible(e);
|
|
183
|
+
}
|
|
184
|
+
}, te = class {
|
|
185
|
+
id;
|
|
186
|
+
#e = "v1";
|
|
187
|
+
#t = void 0;
|
|
188
|
+
constructor(e) {
|
|
189
|
+
this.id = e;
|
|
190
|
+
let t = window.Cbn?.getCustomCodeSdkBridge?.(this.#e);
|
|
191
|
+
if (this.#t = t?.getTextSdkBridge(this.id), !this.#t) throw Error(`Cannot access API for Text "${this.id}".`);
|
|
192
|
+
}
|
|
193
|
+
onRendered(e) {
|
|
194
|
+
return this.#t?.addOnRenderedCallback(e) ?? { unsubscribe: () => {} };
|
|
195
|
+
}
|
|
196
|
+
async setVisible(e) {
|
|
197
|
+
await this.#t?.setVisible(e);
|
|
198
|
+
}
|
|
199
|
+
setText(e) {
|
|
200
|
+
this.#t?.setText(e);
|
|
201
|
+
}
|
|
202
|
+
}, d = 1, f = [];
|
|
203
|
+
function ne(e, t) {
|
|
204
|
+
if (f.length >= d) throw Error(`Only ${d} \`ConfiguratorClient\` can be created at a time.`);
|
|
205
|
+
f.push({
|
|
206
|
+
client: e,
|
|
207
|
+
internals: t
|
|
208
|
+
});
|
|
270
209
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
throw new Error(`Only ${G} \`ConfiguratorClient\` can be created at a time.`);
|
|
276
|
-
v.push({ client: e, internals: n });
|
|
210
|
+
function p() {
|
|
211
|
+
let e = f[0];
|
|
212
|
+
if (!e) throw Error("Operation not possible as no `ConfiguratorClient` has been registered yet.");
|
|
213
|
+
return e.client;
|
|
277
214
|
}
|
|
278
|
-
function
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return e.client;
|
|
215
|
+
function m() {
|
|
216
|
+
let e = f[0];
|
|
217
|
+
if (!e) throw Error("Operation not possible as no `ConfiguratorClient` has been registered yet.");
|
|
218
|
+
return e.internals;
|
|
283
219
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region src/utils/sdk-bridge.provider.ts
|
|
222
|
+
var h = window.Cbn?.getCustomCodeSdkBridge?.("v1");
|
|
223
|
+
if (!h) throw Error("Cannot access Configurator SDK bridge. Make sure to only use the `custom-code-sdk` inside a Combeenation Configurator.");
|
|
224
|
+
var g = h.createCfgrClient("v1", ne);
|
|
225
|
+
if (!g) throw Error("Cannot create Configurator Client. Make sure to only use the `custom-code-sdk` inside a Combeenation Configurator.");
|
|
226
|
+
var _ = h.getParentPageUtilsSdkBridge(), v = h.getCfgrUtilsSdkBridge(), re = h.getViewer3dSdkBridge(), y = g, b = /* @__PURE__ */ function(e) {
|
|
227
|
+
return e[e.Any = 1] = "Any", e[e.Image = 2] = "Image", e;
|
|
228
|
+
}({}), x = /* @__PURE__ */ function(e) {
|
|
229
|
+
return e[e.PdfAsset = 0] = "PdfAsset", e[e.Asset = 1] = "Asset", e[e.Merge = 2] = "Merge", e[e.OutputToCfgnFile = 4] = "OutputToCfgnFile", e;
|
|
230
|
+
}({}), S = /* @__PURE__ */ function(e) {
|
|
231
|
+
return e[e.PdfAsset = x.PdfAsset] = "PdfAsset", e[e.Asset = x.Asset] = "Asset", e;
|
|
232
|
+
}({}), C = (e) => v.uploadCfgnFiles(e, b.Image), w = (e) => v.uploadCfgnFiles(e, b.Any), T = (e) => v.uploadTempCfgnFiles(e, b.Image), E = (e) => v.uploadTempCfgnFiles(e, b.Any), D = (e) => v.convertDocument(e);
|
|
233
|
+
async function O(e, t, n, r) {
|
|
234
|
+
let i = t.length > 1, a = "MergeTask", o = "Task_", s = t.map((t, n) => t.type === S.PdfAsset ? {
|
|
235
|
+
type: x.PdfAsset,
|
|
236
|
+
name: `${o}${n}`,
|
|
237
|
+
bundleAliasName: e,
|
|
238
|
+
assetPath: t.assetPath,
|
|
239
|
+
context: t.context
|
|
240
|
+
} : {
|
|
241
|
+
type: x.Asset,
|
|
242
|
+
name: `${o}${n}`,
|
|
243
|
+
bundleAliasName: e,
|
|
244
|
+
assetPath: t.assetPath
|
|
245
|
+
});
|
|
246
|
+
return i && s.push({
|
|
247
|
+
type: x.Merge,
|
|
248
|
+
name: a,
|
|
249
|
+
inputTaskNames: s.map((e) => e.name)
|
|
250
|
+
}), s.push({
|
|
251
|
+
type: x.OutputToCfgnFile,
|
|
252
|
+
inputTaskName: i ? a : s[0].name,
|
|
253
|
+
name: "OutputPdfTask",
|
|
254
|
+
cfgnFileExtension: "pdf",
|
|
255
|
+
cfgnFileName: n,
|
|
256
|
+
cfgnFileDisplayName: r
|
|
257
|
+
}), v.convertDocument(s);
|
|
289
258
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
name: `${B}${j}`,
|
|
310
|
-
bundleAliasName: e,
|
|
311
|
-
assetPath: g.assetPath,
|
|
312
|
-
context: g.context
|
|
313
|
-
} : {
|
|
314
|
-
type: h.Asset,
|
|
315
|
-
name: `${B}${j}`,
|
|
316
|
-
bundleAliasName: e,
|
|
317
|
-
assetPath: g.assetPath
|
|
318
|
-
}
|
|
319
|
-
);
|
|
320
|
-
return o && E.push({
|
|
321
|
-
type: h.Merge,
|
|
322
|
-
name: k,
|
|
323
|
-
inputTaskNames: E.map((g) => g.name)
|
|
324
|
-
}), E.push({
|
|
325
|
-
type: h.OutputToCfgnFile,
|
|
326
|
-
inputTaskName: o ? k : E[0].name,
|
|
327
|
-
name: "OutputPdfTask",
|
|
328
|
-
cfgnFileExtension: "pdf",
|
|
329
|
-
cfgnFileName: t,
|
|
330
|
-
cfgnFileDisplayName: s
|
|
331
|
-
}), V.convertDocument(E);
|
|
332
|
-
}
|
|
333
|
-
const N = {
|
|
334
|
-
Text: "Text",
|
|
335
|
-
Number: "Number",
|
|
336
|
-
Logic: "Logic"
|
|
337
|
-
}, I = {
|
|
338
|
-
ValueComponent: "ValueComponent",
|
|
339
|
-
TableComponent: "TableComponent",
|
|
340
|
-
// TODO WTT: We're not actively supporting the following cmp types (yet). Neither in editor v2, nor in the headless
|
|
341
|
-
// cfgr client. However, they're still sent w/ our cspd updates, which is why we still list them in our cspd
|
|
342
|
-
// update Zod typings to not fail at parsing etc.
|
|
343
|
-
//
|
|
344
|
-
// If we decide to not support them at all, neither in editor v2, nor in the headless cfgr client, remove
|
|
345
|
-
// them from here and update our cspd update data to not include them anymore.
|
|
346
|
-
//
|
|
347
|
-
// Also see & update `IgnoredCmpBaseTypes` accordingly.
|
|
348
|
-
RecordComponent: "RecordComponent",
|
|
349
|
-
ResourceComponent: "ResourceComponent",
|
|
350
|
-
GraphicComponent: "GraphicComponent",
|
|
351
|
-
CheckoutComponent: "CheckoutComponent"
|
|
352
|
-
}, R = {
|
|
353
|
-
ValueEditor: "ValueEditor",
|
|
354
|
-
TableEditor: "TableEditor",
|
|
355
|
-
Fiber: "Fiber",
|
|
356
|
-
FiberEditor: "FiberEditor",
|
|
357
|
-
CfgrField: "CfgrField"
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region ../../packages/be-lib/src/lib/hive-enums.ts
|
|
261
|
+
var k = {
|
|
262
|
+
Text: "Text",
|
|
263
|
+
Number: "Number",
|
|
264
|
+
Logic: "Logic",
|
|
265
|
+
Image: "Image",
|
|
266
|
+
FileUrl: "FileUrl",
|
|
267
|
+
TextAsset: "TextAsset",
|
|
268
|
+
Table: "Table"
|
|
269
|
+
};
|
|
270
|
+
`${k.Text}`, `${k.Number}`;
|
|
271
|
+
var A = {
|
|
272
|
+
ValueComponent: "ValueComponent",
|
|
273
|
+
TableComponent: "TableComponent",
|
|
274
|
+
RecordComponent: "RecordComponent",
|
|
275
|
+
ResourceComponent: "ResourceComponent",
|
|
276
|
+
GraphicComponent: "GraphicComponent",
|
|
277
|
+
CheckoutComponent: "CheckoutComponent"
|
|
358
278
|
};
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
279
|
+
A.GraphicComponent, A.CheckoutComponent, A.ResourceComponent, A.RecordComponent;
|
|
280
|
+
var j = {
|
|
281
|
+
ValueEditor: "ValueEditor",
|
|
282
|
+
TableEditor: "TableEditor",
|
|
283
|
+
Fiber: "Fiber",
|
|
284
|
+
FiberEditor: "FiberEditor",
|
|
285
|
+
CfgrField: "CfgrField"
|
|
286
|
+
};
|
|
287
|
+
e.enum([
|
|
288
|
+
j.ValueEditor,
|
|
289
|
+
j.TableEditor,
|
|
290
|
+
j.Fiber,
|
|
291
|
+
j.FiberEditor,
|
|
292
|
+
j.CfgrField
|
|
293
|
+
]), e.union([
|
|
294
|
+
e.string(),
|
|
295
|
+
e.number(),
|
|
296
|
+
e.boolean()
|
|
365
297
|
]);
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
),
|
|
381
|
-
|
|
382
|
-
);
|
|
383
|
-
r.union([
|
|
384
|
-
le,
|
|
385
|
-
be,
|
|
386
|
-
he,
|
|
387
|
-
pe,
|
|
388
|
-
r.literal(I.GraphicComponent),
|
|
389
|
-
r.literal(I.CheckoutComponent)
|
|
298
|
+
var M = (e) => typeof e == "string";
|
|
299
|
+
e.string(), e.enum([
|
|
300
|
+
k.Text,
|
|
301
|
+
k.Number,
|
|
302
|
+
k.Logic
|
|
303
|
+
]), e.string(), e.custom((e) => M(e) && e.toLowerCase() === e);
|
|
304
|
+
var N = (e) => e?.toLowerCase() ?? "";
|
|
305
|
+
e.string();
|
|
306
|
+
var P = e.custom((e) => M(e) ? RegExp(`^${A.ValueComponent}<.*>$`).test(e) : !1), F = e.custom((e) => M(e) ? RegExp(`^${A.RecordComponent}<.*>$`).test(e) : !1), I = e.custom((e) => M(e) ? RegExp(`^${A.ResourceComponent}<.*>$`).test(e) : !1), ie = e.custom((e) => M(e) ? RegExp(`^${A.TableComponent}<.*>$`).test(e) : !1);
|
|
307
|
+
e.union([
|
|
308
|
+
P,
|
|
309
|
+
ie,
|
|
310
|
+
F,
|
|
311
|
+
I,
|
|
312
|
+
e.literal(A.GraphicComponent),
|
|
313
|
+
e.literal(A.CheckoutComponent)
|
|
390
314
|
]);
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
d(this, "name");
|
|
414
|
-
d(this, "zodType");
|
|
415
|
-
this.name = n, this.zodType = t, we(this);
|
|
416
|
-
}
|
|
417
|
-
/**
|
|
418
|
-
* Function for receiving the value of a component.
|
|
419
|
-
*/
|
|
420
|
-
async getValue() {
|
|
421
|
-
return await X().getCmpValue(this.name);
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Sends the ChangeConfigurationValue request to the server
|
|
425
|
-
*/
|
|
426
|
-
async setInput(n) {
|
|
427
|
-
const t = W(this.name);
|
|
428
|
-
await ie().setCmpInput(t, n, this.zodType);
|
|
429
|
-
}
|
|
430
|
-
/**
|
|
431
|
-
* @param listener Called whenever the value of the given cmp has changed
|
|
432
|
-
* @param callImmediately `True:` The listener is immediately called with the current value of the cmp at the
|
|
433
|
-
* time, the listener is added\
|
|
434
|
-
* `False:` The listener will be called for the first time when the value of the cmp
|
|
435
|
-
* actually changes
|
|
436
|
-
* @param condition A predicate function which is given the new cmp value.\
|
|
437
|
-
* The function can decide on whether the listener is called or not by returning true or false.
|
|
438
|
-
*/
|
|
439
|
-
onValueChanged(n, t = !1, s) {
|
|
440
|
-
X().onCmpValueChanged(this.name, n, s, t);
|
|
441
|
-
}
|
|
315
|
+
var L = e.union([
|
|
316
|
+
e.string(),
|
|
317
|
+
e.number(),
|
|
318
|
+
e.boolean()
|
|
319
|
+
]), ae = e.union([
|
|
320
|
+
L,
|
|
321
|
+
e.array(L),
|
|
322
|
+
e.object({}),
|
|
323
|
+
e.unknown()
|
|
324
|
+
]);
|
|
325
|
+
e.object({
|
|
326
|
+
$typ: e.literal("Error"),
|
|
327
|
+
Id: e.string(),
|
|
328
|
+
Message: e.string(),
|
|
329
|
+
route: e.unknown().optional()
|
|
330
|
+
}).or(ae);
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region ../configurator-client/src/cmps-registry.ts
|
|
333
|
+
var R = /* @__PURE__ */ new Map();
|
|
334
|
+
function oe(e) {
|
|
335
|
+
let t = N(e.name);
|
|
336
|
+
R.has(t) || R.set(t, e);
|
|
442
337
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
ue as uploadFiles,
|
|
515
|
-
ce as uploadImages,
|
|
516
|
-
Y as version
|
|
517
|
-
};
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region ../configurator-client/src/cmps/value-component.ts
|
|
340
|
+
var se = class {
|
|
341
|
+
name;
|
|
342
|
+
zodType;
|
|
343
|
+
constructor(e, t) {
|
|
344
|
+
this.name = e, this.zodType = t, oe(this);
|
|
345
|
+
}
|
|
346
|
+
async getValue() {
|
|
347
|
+
return await p().getCmpValue(this.name);
|
|
348
|
+
}
|
|
349
|
+
async setInput(e) {
|
|
350
|
+
let t = N(this.name);
|
|
351
|
+
await m().setCmpInput(t, e, this.zodType);
|
|
352
|
+
}
|
|
353
|
+
onValueChanged(e, t = !1, n) {
|
|
354
|
+
p().onCmpValueChanged(this.name, e, n, t);
|
|
355
|
+
}
|
|
356
|
+
}, z = () => v.getAssetPaths(), B = /* @__PURE__ */ function(e) {
|
|
357
|
+
return e[e.Facebook = 0] = "Facebook", e[e.Pinterest = 1] = "Pinterest", e[e.Twitter = 2] = "Twitter", e[e.LinkedIn = 3] = "LinkedIn", e[e.WhatsApp = 4] = "WhatsApp", e[e.Custom = 5] = "Custom", e[e.NativeShare = 6] = "NativeShare", e;
|
|
358
|
+
}({}), V = y.onAnyCmpValueChanged.bind(y), H = async (e) => {
|
|
359
|
+
if (await y.finishConfiguration(e?.input), e.sendDataToParentPage) {
|
|
360
|
+
let t = e.transformParentPageData();
|
|
361
|
+
await _.sendConfigurationFinished(t);
|
|
362
|
+
}
|
|
363
|
+
}, U = async (e) => {
|
|
364
|
+
let t = B[e.platform], n = e.imageUrl ?? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+X2ZkAAAAASUVORK5CYII=", r = {
|
|
365
|
+
...e,
|
|
366
|
+
platform: t,
|
|
367
|
+
imageUrl: n
|
|
368
|
+
}, i = await y.shareConfiguration(r);
|
|
369
|
+
await v.openShareWindow(e.platform, i);
|
|
370
|
+
let { shareUrl: a, shareConfigurationId: o } = i;
|
|
371
|
+
return {
|
|
372
|
+
shareUrl: a,
|
|
373
|
+
shareConfigurationId: o
|
|
374
|
+
};
|
|
375
|
+
}, W = () => _.isInIFrame(), G = (e) => _.setIFrameSize(e), K = (e) => v.navigateToLogin(e), q = async (e) => {
|
|
376
|
+
let { promise: t, resolve: n } = Promise.withResolvers(), r = {};
|
|
377
|
+
for (let [t, i] of Object.entries(e)) i.onValueChanged((i) => {
|
|
378
|
+
r[t] = i, Object.keys(e).every((e) => e in r) && n(r);
|
|
379
|
+
}, !0);
|
|
380
|
+
return t;
|
|
381
|
+
}, J = (e, t) => _.sendCustomMsg(e, t), Y = (e) => _.redirectParentPage(e), X = () => _.getParentPageUrl(), Z = (e, t) => _.fireAnalyticsEvent(e, t), Q = (e) => _.onParentPageEvent(e), $ = async (e, t) => re.createArPage(e, t), ce = /* @__PURE__ */ n({
|
|
382
|
+
configuratorIsInIFrame: () => W,
|
|
383
|
+
convertDocument: () => D,
|
|
384
|
+
createArPage: () => $,
|
|
385
|
+
createPdfFromAssets: () => O,
|
|
386
|
+
createSyncCmpValuesStore: () => q,
|
|
387
|
+
finishConfiguration: () => H,
|
|
388
|
+
fireAnalyticsEvent: () => Z,
|
|
389
|
+
getAssetPaths: () => z,
|
|
390
|
+
getParentPageUrl: () => X,
|
|
391
|
+
navigateToLogin: () => K,
|
|
392
|
+
onAnyCmpValueChanged: () => V,
|
|
393
|
+
onParentPageEvent: () => Q,
|
|
394
|
+
redirectParentPage: () => Y,
|
|
395
|
+
sendCustomMsgToParentPage: () => J,
|
|
396
|
+
setConfiguratorIFrameSize: () => G,
|
|
397
|
+
shareConfiguration: () => U,
|
|
398
|
+
uploadFiles: () => w,
|
|
399
|
+
uploadImages: () => C,
|
|
400
|
+
uploadTempFiles: () => E,
|
|
401
|
+
uploadTempImages: () => T,
|
|
402
|
+
version: () => r
|
|
403
|
+
});
|
|
404
|
+
//#endregion
|
|
405
|
+
//#region src/index.ts
|
|
406
|
+
console.log(`Loading custom code SDK v${r}`);
|
|
407
|
+
//#endregion
|
|
408
|
+
export { i as Button, ce as CbnSdk, a as Checkbox, o as Collapsible, s as Combobox, S as CreatePdfTaskTypes, c as CustomControl, l as Dataview, x as DocumentConvertTaskTypes, ee as Input, u as Panel, te as Text, se as ValueComponent, W as configuratorIsInIFrame, D as convertDocument, $ as createArPage, O as createPdfFromAssets, q as createSyncCmpValuesStore, H as finishConfiguration, Z as fireAnalyticsEvent, z as getAssetPaths, X as getParentPageUrl, K as navigateToLogin, V as onAnyCmpValueChanged, Q as onParentPageEvent, Y as redirectParentPage, J as sendCustomMsgToParentPage, G as setConfiguratorIFrameSize, U as shareConfiguration, w as uploadFiles, C as uploadImages, E as uploadTempFiles, T as uploadTempImages, r as version };
|