@nice2dev/erp-adapter 0.1.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 (38) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE +21 -0
  3. package/README.md +96 -0
  4. package/dist/ErpAuthAdapter.d.ts +28 -0
  5. package/dist/ErpAuthAdapter.d.ts.map +1 -0
  6. package/dist/ErpDataAdapter.d.ts +29 -0
  7. package/dist/ErpDataAdapter.d.ts.map +1 -0
  8. package/dist/ErpExportAdapter.d.ts +19 -0
  9. package/dist/ErpExportAdapter.d.ts.map +1 -0
  10. package/dist/ErpFileAdapter.d.ts +23 -0
  11. package/dist/ErpFileAdapter.d.ts.map +1 -0
  12. package/dist/ErpSignalRAdapter.d.ts +17 -0
  13. package/dist/ErpSignalRAdapter.d.ts.map +1 -0
  14. package/dist/index.cjs +2 -0
  15. package/dist/index.cjs.map +1 -0
  16. package/dist/index.d.ts +17 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.mjs +713 -0
  19. package/dist/index.mjs.map +1 -0
  20. package/dist/registries/audioControls.d.ts +3 -0
  21. package/dist/registries/audioControls.d.ts.map +1 -0
  22. package/dist/registries/authControls.d.ts +3 -0
  23. package/dist/registries/authControls.d.ts.map +1 -0
  24. package/dist/registries/businessControls.d.ts +3 -0
  25. package/dist/registries/businessControls.d.ts.map +1 -0
  26. package/dist/registries/gamificationControls.d.ts +3 -0
  27. package/dist/registries/gamificationControls.d.ts.map +1 -0
  28. package/dist/registries/graphicControls.d.ts +3 -0
  29. package/dist/registries/graphicControls.d.ts.map +1 -0
  30. package/dist/registries/index.d.ts +11 -0
  31. package/dist/registries/index.d.ts.map +1 -0
  32. package/dist/registries/socialControls.d.ts +3 -0
  33. package/dist/registries/socialControls.d.ts.map +1 -0
  34. package/dist/registries/threeControls.d.ts +3 -0
  35. package/dist/registries/threeControls.d.ts.map +1 -0
  36. package/dist/types.d.ts +110 -0
  37. package/dist/types.d.ts.map +1 -0
  38. package/package.json +55 -0
package/dist/index.mjs ADDED
@@ -0,0 +1,713 @@
1
+ class y {
2
+ constructor(e) {
3
+ this.cfg = typeof e == "string" ? { baseUrl: e } : e;
4
+ }
5
+ async request(e, a) {
6
+ const t = this.cfg.fetch ?? globalThis.fetch, l = {
7
+ "Content-Type": "application/json",
8
+ ...this.cfg.headers
9
+ };
10
+ if (this.cfg.tokenFactory) {
11
+ const r = await this.cfg.tokenFactory();
12
+ l.Authorization = `Bearer ${r}`;
13
+ }
14
+ const o = await t(`${this.cfg.baseUrl}${e}`, { ...a, headers: { ...l, ...a == null ? void 0 : a.headers } });
15
+ if (!o.ok) throw new Error(`ERP request failed: ${o.status} ${o.statusText}`);
16
+ return o.json();
17
+ }
18
+ /** Load paged/filtered/sorted data. */
19
+ async load(e) {
20
+ var l, o;
21
+ const a = new URLSearchParams();
22
+ (e == null ? void 0 : e.skip) != null && a.set("skip", String(e.skip)), (e == null ? void 0 : e.take) != null && a.set("take", String(e.take)), e != null && e.search && a.set("search", e.search), (l = e == null ? void 0 : e.sort) != null && l.length && a.set("sort", JSON.stringify(e.sort)), (o = e == null ? void 0 : e.filters) != null && o.length && a.set("filters", JSON.stringify(e.filters));
23
+ const t = a.toString();
24
+ return this.request(t ? `?${t}` : "");
25
+ }
26
+ /** Get single entity by id. */
27
+ async getById(e) {
28
+ return this.request(`/${e}`);
29
+ }
30
+ /** Create entity. */
31
+ async create(e) {
32
+ return this.request("", { method: "POST", body: JSON.stringify(e) });
33
+ }
34
+ /** Update entity. */
35
+ async update(e, a) {
36
+ return this.request(`/${e}`, { method: "PUT", body: JSON.stringify(a) });
37
+ }
38
+ /** Delete entity. */
39
+ async remove(e) {
40
+ return this.request(`/${e}`, { method: "DELETE" });
41
+ }
42
+ /** Batch delete. */
43
+ async removeBatch(e) {
44
+ return this.request("/batch-delete", { method: "POST", body: JSON.stringify({ ids: e }) });
45
+ }
46
+ }
47
+ async function g(s) {
48
+ const e = await import("@microsoft/signalr");
49
+ let a = "disconnected";
50
+ const t = /* @__PURE__ */ new Set(), l = (n) => {
51
+ a = n, t.forEach((u) => u(n));
52
+ }, r = new e.HubConnectionBuilder().withUrl(s.hubUrl, {
53
+ accessTokenFactory: s.accessTokenFactory ? () => s.accessTokenFactory() : void 0
54
+ }).withAutomaticReconnect().build();
55
+ return r.onreconnecting(() => l("reconnecting")), r.onreconnected(() => l("connected")), r.onclose(() => l("disconnected")), {
56
+ get status() {
57
+ return a;
58
+ },
59
+ async start() {
60
+ l("connecting"), await r.start(), l("connected");
61
+ },
62
+ async stop() {
63
+ await r.stop(), l("disconnected");
64
+ },
65
+ on(n, u) {
66
+ r.on(n, u);
67
+ },
68
+ off(n, u) {
69
+ r.off(n, u);
70
+ },
71
+ invoke(n, ...u) {
72
+ return r.invoke(n, ...u);
73
+ },
74
+ onStatusChange(n) {
75
+ return t.add(n), () => t.delete(n);
76
+ }
77
+ };
78
+ }
79
+ class w {
80
+ constructor(e) {
81
+ this.accessToken = null, this.refreshToken = null, this.tokenFactory = async () => {
82
+ if (!this.accessToken) throw new Error("Not authenticated");
83
+ return this.accessToken;
84
+ }, this.cfg = e;
85
+ }
86
+ /** Current access token (or null). */
87
+ getAccessToken() {
88
+ return this.accessToken;
89
+ }
90
+ async post(e, a) {
91
+ const l = await (this.cfg.fetch ?? globalThis.fetch)(`${this.cfg.baseUrl}${e}`, {
92
+ method: "POST",
93
+ headers: { "Content-Type": "application/json" },
94
+ body: JSON.stringify(a)
95
+ });
96
+ if (!l.ok) throw new Error(`Auth request failed: ${l.status}`);
97
+ return l.json();
98
+ }
99
+ /** Login with username/password. */
100
+ async login(e) {
101
+ var t, l;
102
+ const a = await this.post("/login", e);
103
+ return a.token && (this.accessToken = a.token, this.refreshToken = a.refreshToken ?? null, (l = (t = this.cfg).onTokens) == null || l.call(t, a.token, a.refreshToken ?? "")), a;
104
+ }
105
+ /** Refresh the access token. */
106
+ async refresh() {
107
+ var a, t;
108
+ if (!this.refreshToken) throw new Error("No refresh token");
109
+ const e = await this.post("/refresh", { refreshToken: this.refreshToken });
110
+ return e.token && (this.accessToken = e.token, this.refreshToken = e.refreshToken ?? this.refreshToken, (t = (a = this.cfg).onTokens) == null || t.call(a, e.token, this.refreshToken)), e;
111
+ }
112
+ /** Get current user info. */
113
+ async me() {
114
+ const a = await (this.cfg.fetch ?? globalThis.fetch)(`${this.cfg.baseUrl}/me`, {
115
+ headers: { Authorization: `Bearer ${this.accessToken}` }
116
+ });
117
+ if (!a.ok) throw new Error(`Auth /me failed: ${a.status}`);
118
+ return a.json();
119
+ }
120
+ /** Logout (invalidate tokens on server). */
121
+ async logout() {
122
+ try {
123
+ await (this.cfg.fetch ?? globalThis.fetch)(`${this.cfg.baseUrl}/logout`, {
124
+ method: "POST",
125
+ headers: { Authorization: `Bearer ${this.accessToken}` }
126
+ });
127
+ } finally {
128
+ this.accessToken = null, this.refreshToken = null;
129
+ }
130
+ }
131
+ }
132
+ class V {
133
+ constructor(e) {
134
+ this.cfg = e;
135
+ }
136
+ async headers() {
137
+ const e = {};
138
+ return this.cfg.tokenFactory && (e.Authorization = `Bearer ${await this.cfg.tokenFactory()}`), e;
139
+ }
140
+ /** Upload a file. Returns file metadata on success. */
141
+ async upload(e, a) {
142
+ const t = this.cfg.fetch ?? globalThis.fetch, l = new FormData();
143
+ l.append("file", e), a && l.append("folder", a);
144
+ const o = await t(this.cfg.baseUrl, {
145
+ method: "POST",
146
+ headers: await this.headers(),
147
+ body: l
148
+ });
149
+ if (!o.ok) throw new Error(`File upload failed: ${o.status}`);
150
+ return o.json();
151
+ }
152
+ /** Upload multiple files. */
153
+ async uploadMultiple(e, a) {
154
+ const t = this.cfg.fetch ?? globalThis.fetch, l = new FormData();
155
+ e.forEach((r) => l.append("files", r)), a && l.append("folder", a);
156
+ const o = await t(`${this.cfg.baseUrl}/batch`, {
157
+ method: "POST",
158
+ headers: await this.headers(),
159
+ body: l
160
+ });
161
+ if (!o.ok) throw new Error(`Batch upload failed: ${o.status}`);
162
+ return o.json();
163
+ }
164
+ /** Get file metadata by id. */
165
+ async getInfo(e) {
166
+ const t = await (this.cfg.fetch ?? globalThis.fetch)(`${this.cfg.baseUrl}/${e}/info`, {
167
+ headers: { ...await this.headers(), "Content-Type": "application/json" }
168
+ });
169
+ if (!t.ok) throw new Error(`File info failed: ${t.status}`);
170
+ return t.json();
171
+ }
172
+ /** Get a download URL (or blob URL) for a file. */
173
+ async getDownloadUrl(e) {
174
+ const t = await (this.cfg.fetch ?? globalThis.fetch)(`${this.cfg.baseUrl}/${e}`, {
175
+ headers: await this.headers()
176
+ });
177
+ if (!t.ok) throw new Error(`File download failed: ${t.status}`);
178
+ const l = await t.blob();
179
+ return URL.createObjectURL(l);
180
+ }
181
+ /** Delete file by id. */
182
+ async remove(e) {
183
+ const t = await (this.cfg.fetch ?? globalThis.fetch)(`${this.cfg.baseUrl}/${e}`, {
184
+ method: "DELETE",
185
+ headers: { ...await this.headers(), "Content-Type": "application/json" }
186
+ });
187
+ if (!t.ok) throw new Error(`File delete failed: ${t.status}`);
188
+ return t.json();
189
+ }
190
+ }
191
+ class v {
192
+ constructor(e) {
193
+ this.cfg = e;
194
+ }
195
+ async headers() {
196
+ const e = { "Content-Type": "application/json" };
197
+ return this.cfg.tokenFactory && (e.Authorization = `Bearer ${await this.cfg.tokenFactory()}`), e;
198
+ }
199
+ /** Request a server-side export. Returns a download URL / job id. */
200
+ async requestExport(e) {
201
+ const t = await (this.cfg.fetch ?? globalThis.fetch)(this.cfg.baseUrl, {
202
+ method: "POST",
203
+ headers: await this.headers(),
204
+ body: JSON.stringify(e)
205
+ });
206
+ if (!t.ok) throw new Error(`Export request failed: ${t.status}`);
207
+ return t.json();
208
+ }
209
+ /** Download an exported file as a Blob. */
210
+ async download(e) {
211
+ const t = await (this.cfg.fetch ?? globalThis.fetch)(e, {
212
+ headers: await this.headers()
213
+ });
214
+ if (!t.ok) throw new Error(`Export download failed: ${t.status}`);
215
+ return t.blob();
216
+ }
217
+ /** Trigger browser download for an export. */
218
+ async downloadToFile(e, a) {
219
+ var i;
220
+ const t = await this.requestExport(e);
221
+ if (!((i = t.data) != null && i.downloadUrl)) throw new Error("No download URL returned");
222
+ const l = await this.download(t.data.downloadUrl), o = URL.createObjectURL(l), r = document.createElement("a");
223
+ r.href = o, r.download = a ?? `export.${e.format}`, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(o);
224
+ }
225
+ }
226
+ const c = [
227
+ {
228
+ type: "NiceAudioPlayer",
229
+ label: "Audio Player",
230
+ category: "Audio",
231
+ icon: "music",
232
+ defaultProps: { src: "", autoplay: !1, showWaveform: !0 },
233
+ propDescriptors: [
234
+ { name: "src", type: "string", label: "Audio source URL" },
235
+ { name: "autoplay", type: "boolean", label: "Auto-play", defaultValue: !1 },
236
+ { name: "loop", type: "boolean", label: "Loop", defaultValue: !1 },
237
+ { name: "showWaveform", type: "boolean", label: "Show waveform", defaultValue: !0 },
238
+ { name: "showPlaylist", type: "boolean", label: "Show playlist", defaultValue: !1 },
239
+ { name: "visualizerMode", type: "select", label: "Visualizer mode", options: [
240
+ { label: "None", value: "none" },
241
+ { label: "Bars", value: "bars" },
242
+ { label: "Wave", value: "wave" },
243
+ { label: "Circle", value: "circle" }
244
+ ], defaultValue: "bars" },
245
+ { name: "height", type: "size", label: "Height", group: "Layout" }
246
+ ]
247
+ },
248
+ {
249
+ type: "NiceWaveform",
250
+ label: "Waveform",
251
+ category: "Audio",
252
+ icon: "waveform",
253
+ defaultProps: { peaks: [], color: "#4a90d9" },
254
+ propDescriptors: [
255
+ { name: "peaks", type: "json", label: "Peak data (JSON array)" },
256
+ { name: "color", type: "color", label: "Waveform color", defaultValue: "#4a90d9" },
257
+ { name: "progressColor", type: "color", label: "Progress color", defaultValue: "#1b5e20" },
258
+ { name: "barWidth", type: "number", label: "Bar width (px)", min: 1, max: 10, step: 1, defaultValue: 2 },
259
+ { name: "height", type: "size", label: "Height", group: "Layout" },
260
+ { name: "interactive", type: "boolean", label: "Allow seeking", defaultValue: !0 }
261
+ ]
262
+ },
263
+ {
264
+ type: "NicePianoRoll",
265
+ label: "Piano Roll",
266
+ category: "Audio",
267
+ icon: "piano",
268
+ defaultProps: { notes: [], octaves: 4, startOctave: 3 },
269
+ propDescriptors: [
270
+ { name: "notes", type: "json", label: "MIDI notes (JSON)" },
271
+ { name: "octaves", type: "number", label: "Visible octaves", min: 1, max: 8, defaultValue: 4 },
272
+ { name: "startOctave", type: "number", label: "Start octave", min: 0, max: 8, defaultValue: 3 },
273
+ { name: "quantize", type: "select", label: "Quantize", options: [
274
+ { label: "1/4", value: "4" },
275
+ { label: "1/8", value: "8" },
276
+ { label: "1/16", value: "16" },
277
+ { label: "1/32", value: "32" }
278
+ ], defaultValue: "16" },
279
+ { name: "readOnly", type: "boolean", label: "Read only", defaultValue: !1 },
280
+ { name: "height", type: "size", label: "Height", group: "Layout" }
281
+ ]
282
+ },
283
+ {
284
+ type: "NiceKaraoke",
285
+ label: "Karaoke",
286
+ category: "Audio",
287
+ icon: "microphone",
288
+ defaultProps: { lyrics: [], audioSrc: "" },
289
+ propDescriptors: [
290
+ { name: "audioSrc", type: "string", label: "Audio source URL" },
291
+ { name: "lyrics", type: "json", label: "Lyrics (JSON array of {time, text})" },
292
+ { name: "showScore", type: "boolean", label: "Show score", defaultValue: !0 },
293
+ { name: "pitchDetection", type: "boolean", label: "Pitch detection", defaultValue: !0 },
294
+ { name: "highlightColor", type: "color", label: "Highlight color", defaultValue: "#ffd700" },
295
+ { name: "fontSize", type: "size", label: "Font size", group: "Typography" }
296
+ ]
297
+ }
298
+ ], p = [
299
+ {
300
+ type: "NicePixelEditor",
301
+ label: "Pixel Editor",
302
+ category: "Graphics",
303
+ icon: "grid",
304
+ defaultProps: { width: 32, height: 32, palette: [] },
305
+ propDescriptors: [
306
+ { name: "width", type: "number", label: "Canvas width (px)", min: 1, max: 256, defaultValue: 32 },
307
+ { name: "height", type: "number", label: "Canvas height (px)", min: 1, max: 256, defaultValue: 32 },
308
+ { name: "palette", type: "json", label: "Color palette (JSON array)" },
309
+ { name: "gridVisible", type: "boolean", label: "Show grid", defaultValue: !0 },
310
+ { name: "zoom", type: "number", label: "Zoom level", min: 1, max: 32, step: 1, defaultValue: 8 },
311
+ { name: "layers", type: "boolean", label: "Enable layers", defaultValue: !0 },
312
+ { name: "onion", type: "boolean", label: "Onion skin (animation)", defaultValue: !1 }
313
+ ]
314
+ },
315
+ {
316
+ type: "NiceVectorEditor",
317
+ label: "Vector Editor",
318
+ category: "Graphics",
319
+ icon: "pen-tool",
320
+ defaultProps: { width: 800, height: 600 },
321
+ propDescriptors: [
322
+ { name: "width", type: "number", label: "Canvas width", min: 100, max: 4096, defaultValue: 800, group: "Layout" },
323
+ { name: "height", type: "number", label: "Canvas height", min: 100, max: 4096, defaultValue: 600, group: "Layout" },
324
+ { name: "showRulers", type: "boolean", label: "Show rulers", defaultValue: !0 },
325
+ { name: "snapToGrid", type: "boolean", label: "Snap to grid", defaultValue: !0 },
326
+ { name: "gridSize", type: "number", label: "Grid size", min: 1, max: 100, defaultValue: 10 },
327
+ { name: "fillColor", type: "color", label: "Default fill", defaultValue: "#ffffff" },
328
+ { name: "strokeColor", type: "color", label: "Default stroke", defaultValue: "#000000" },
329
+ { name: "strokeWidth", type: "number", label: "Stroke width", min: 0, max: 20, step: 0.5, defaultValue: 1 }
330
+ ]
331
+ },
332
+ {
333
+ type: "NicePhotoEditor",
334
+ label: "Photo Editor",
335
+ category: "Graphics",
336
+ icon: "image",
337
+ defaultProps: { src: "" },
338
+ propDescriptors: [
339
+ { name: "src", type: "string", label: "Image source URL" },
340
+ { name: "crop", type: "boolean", label: "Allow crop", defaultValue: !0 },
341
+ { name: "rotate", type: "boolean", label: "Allow rotate", defaultValue: !0 },
342
+ { name: "filters", type: "boolean", label: "Show filters", defaultValue: !0 },
343
+ { name: "adjustments", type: "boolean", label: "Show adjustments", defaultValue: !0 },
344
+ { name: "text", type: "boolean", label: "Allow text overlay", defaultValue: !0 },
345
+ { name: "outputFormat", type: "select", label: "Output format", options: [
346
+ { label: "PNG", value: "png" },
347
+ { label: "JPEG", value: "jpeg" },
348
+ { label: "WebP", value: "webp" }
349
+ ], defaultValue: "png" },
350
+ { name: "maxWidth", type: "number", label: "Max output width", min: 100, max: 8192, group: "Output" }
351
+ ]
352
+ }
353
+ ], d = [
354
+ {
355
+ type: "NiceModelEditor",
356
+ label: "3D Model Editor",
357
+ category: "3D",
358
+ icon: "cube",
359
+ defaultProps: { modelUrl: "" },
360
+ propDescriptors: [
361
+ { name: "modelUrl", type: "string", label: "Model URL (.glb / .gltf)" },
362
+ { name: "environmentMap", type: "select", label: "Environment", options: [
363
+ { label: "Studio", value: "studio" },
364
+ { label: "Outdoor", value: "outdoor" },
365
+ { label: "Warehouse", value: "warehouse" },
366
+ { label: "None", value: "none" }
367
+ ], defaultValue: "studio" },
368
+ { name: "showGrid", type: "boolean", label: "Show grid", defaultValue: !0 },
369
+ { name: "showAxes", type: "boolean", label: "Show axes", defaultValue: !0 },
370
+ { name: "enablePhysics", type: "boolean", label: "Enable physics", defaultValue: !1 },
371
+ { name: "wireframe", type: "boolean", label: "Wireframe mode", defaultValue: !1 },
372
+ { name: "backgroundColor", type: "color", label: "Background", defaultValue: "#1a1a2e" },
373
+ { name: "height", type: "size", label: "Viewport height", group: "Layout" }
374
+ ]
375
+ },
376
+ {
377
+ type: "NiceModelViewer",
378
+ label: "3D Model Viewer",
379
+ category: "3D",
380
+ icon: "eye",
381
+ defaultProps: { modelUrl: "", autoRotate: !0 },
382
+ propDescriptors: [
383
+ { name: "modelUrl", type: "string", label: "Model URL (.glb / .gltf)" },
384
+ { name: "autoRotate", type: "boolean", label: "Auto-rotate", defaultValue: !0 },
385
+ { name: "rotateSpeed", type: "number", label: "Rotate speed", min: 0.1, max: 10, step: 0.1, defaultValue: 1 },
386
+ { name: "zoom", type: "boolean", label: "Allow zoom", defaultValue: !0 },
387
+ { name: "pan", type: "boolean", label: "Allow pan", defaultValue: !0 },
388
+ { name: "environmentMap", type: "select", label: "Environment", options: [
389
+ { label: "Studio", value: "studio" },
390
+ { label: "Outdoor", value: "outdoor" },
391
+ { label: "Warehouse", value: "warehouse" },
392
+ { label: "None", value: "none" }
393
+ ], defaultValue: "studio" },
394
+ { name: "backgroundColor", type: "color", label: "Background", defaultValue: "#1a1a2e" },
395
+ { name: "showAnnotations", type: "boolean", label: "Show annotations", defaultValue: !1 },
396
+ { name: "height", type: "size", label: "Viewport height", group: "Layout" }
397
+ ]
398
+ }
399
+ ], b = [
400
+ {
401
+ type: "NiceLeaderboard",
402
+ label: "Leaderboard",
403
+ category: "Gamification",
404
+ icon: "trophy",
405
+ defaultProps: { dataSource: [], maxRows: 10 },
406
+ propDescriptors: [
407
+ { name: "dataSource", type: "json", label: "Data source (JSON)" },
408
+ { name: "maxRows", type: "number", label: "Max visible rows", min: 3, max: 100, defaultValue: 10 },
409
+ { name: "showRank", type: "boolean", label: "Show rank column", defaultValue: !0 },
410
+ { name: "showAvatar", type: "boolean", label: "Show avatar", defaultValue: !0 },
411
+ { name: "highlightCurrentUser", type: "boolean", label: "Highlight current user", defaultValue: !0 },
412
+ { name: "scoreField", type: "string", label: "Score field name", defaultValue: "score" },
413
+ { name: "nameField", type: "string", label: "Name field name", defaultValue: "name" },
414
+ { name: "variant", type: "variant", label: "Visual style", defaultValue: "default" }
415
+ ]
416
+ },
417
+ {
418
+ type: "NiceAchievement",
419
+ label: "Achievement Badge",
420
+ category: "Gamification",
421
+ icon: "award",
422
+ defaultProps: { title: "Achievement", unlocked: !1 },
423
+ propDescriptors: [
424
+ { name: "title", type: "string", label: "Achievement title", defaultValue: "Achievement" },
425
+ { name: "description", type: "string", label: "Description" },
426
+ { name: "icon", type: "string", label: "Icon URL" },
427
+ { name: "unlocked", type: "boolean", label: "Unlocked", defaultValue: !1 },
428
+ { name: "progress", type: "number", label: "Progress (0-100)", min: 0, max: 100, defaultValue: 0 },
429
+ { name: "rarity", type: "select", label: "Rarity", options: [
430
+ { label: "Common", value: "common" },
431
+ { label: "Rare", value: "rare" },
432
+ { label: "Epic", value: "epic" },
433
+ { label: "Legendary", value: "legendary" }
434
+ ], defaultValue: "common" },
435
+ { name: "size", type: "size", label: "Badge size", group: "Layout" }
436
+ ]
437
+ },
438
+ {
439
+ type: "NiceQuest",
440
+ label: "Quest Tracker",
441
+ category: "Gamification",
442
+ icon: "map",
443
+ defaultProps: { title: "Quest", steps: [] },
444
+ propDescriptors: [
445
+ { name: "title", type: "string", label: "Quest title", defaultValue: "Quest" },
446
+ { name: "description", type: "string", label: "Quest description" },
447
+ { name: "steps", type: "json", label: "Steps (JSON array of {title, completed})" },
448
+ { name: "reward", type: "string", label: "Reward description" },
449
+ { name: "rewardXP", type: "number", label: "Reward XP", min: 0, defaultValue: 100 },
450
+ { name: "showProgress", type: "boolean", label: "Show progress bar", defaultValue: !0 },
451
+ { name: "variant", type: "variant", label: "Visual style", defaultValue: "default" }
452
+ ]
453
+ },
454
+ {
455
+ type: "NiceXPBar",
456
+ label: "XP Progress Bar",
457
+ category: "Gamification",
458
+ icon: "zap",
459
+ defaultProps: { currentXP: 0, maxXP: 1e3, level: 1 },
460
+ propDescriptors: [
461
+ { name: "currentXP", type: "number", label: "Current XP", min: 0, defaultValue: 0 },
462
+ { name: "maxXP", type: "number", label: "Max XP (next level)", min: 1, defaultValue: 1e3 },
463
+ { name: "level", type: "number", label: "Current level", min: 1, defaultValue: 1 },
464
+ { name: "showLabel", type: "boolean", label: "Show XP label", defaultValue: !0 },
465
+ { name: "showLevel", type: "boolean", label: "Show level badge", defaultValue: !0 },
466
+ { name: "color", type: "color", label: "Bar color", defaultValue: "#4caf50" },
467
+ { name: "animated", type: "boolean", label: "Animate changes", defaultValue: !0 },
468
+ { name: "height", type: "size", label: "Bar height", group: "Layout" }
469
+ ]
470
+ }
471
+ ], m = [
472
+ {
473
+ type: "NiceAddress",
474
+ label: "Address Editor",
475
+ category: "Business",
476
+ icon: "map-pin",
477
+ defaultProps: { country: "PL" },
478
+ propDescriptors: [
479
+ { name: "street", type: "string", label: "Street", group: "Address" },
480
+ { name: "city", type: "string", label: "City", group: "Address" },
481
+ { name: "postalCode", type: "string", label: "Postal code", group: "Address" },
482
+ { name: "country", type: "select", label: "Country", options: [
483
+ { label: "Poland", value: "PL" },
484
+ { label: "Germany", value: "DE" },
485
+ { label: "USA", value: "US" },
486
+ { label: "UK", value: "GB" },
487
+ { label: "France", value: "FR" }
488
+ ], defaultValue: "PL", group: "Address" },
489
+ { name: "showMap", type: "boolean", label: "Show map preview", defaultValue: !1 },
490
+ { name: "readOnly", type: "boolean", label: "Read only", defaultValue: !1 }
491
+ ]
492
+ },
493
+ {
494
+ type: "NicePhone",
495
+ label: "Phone Input",
496
+ category: "Business",
497
+ icon: "phone",
498
+ defaultProps: { countryCode: "+48" },
499
+ propDescriptors: [
500
+ { name: "value", type: "string", label: "Phone number" },
501
+ { name: "countryCode", type: "string", label: "Default country code", defaultValue: "+48" },
502
+ { name: "showFlag", type: "boolean", label: "Show country flag", defaultValue: !0 },
503
+ { name: "format", type: "select", label: "Format", options: [
504
+ { label: "International", value: "international" },
505
+ { label: "National", value: "national" },
506
+ { label: "E.164", value: "e164" }
507
+ ], defaultValue: "international" },
508
+ { name: "readOnly", type: "boolean", label: "Read only", defaultValue: !1 }
509
+ ]
510
+ },
511
+ {
512
+ type: "NiceCurrency",
513
+ label: "Currency Input",
514
+ category: "Business",
515
+ icon: "dollar-sign",
516
+ defaultProps: { currency: "PLN", decimals: 2 },
517
+ propDescriptors: [
518
+ { name: "value", type: "number", label: "Amount", defaultValue: 0 },
519
+ { name: "currency", type: "select", label: "Currency", options: [
520
+ { label: "PLN", value: "PLN" },
521
+ { label: "EUR", value: "EUR" },
522
+ { label: "USD", value: "USD" },
523
+ { label: "GBP", value: "GBP" }
524
+ ], defaultValue: "PLN" },
525
+ { name: "decimals", type: "number", label: "Decimal places", min: 0, max: 4, defaultValue: 2 },
526
+ { name: "showCurrencySymbol", type: "boolean", label: "Show symbol", defaultValue: !0 },
527
+ { name: "thousandSeparator", type: "boolean", label: "Thousand separator", defaultValue: !0 },
528
+ { name: "readOnly", type: "boolean", label: "Read only", defaultValue: !1 }
529
+ ]
530
+ },
531
+ {
532
+ type: "NiceVAT",
533
+ label: "VAT Input",
534
+ category: "Business",
535
+ icon: "percent",
536
+ defaultProps: { rate: 23, country: "PL" },
537
+ propDescriptors: [
538
+ { name: "netValue", type: "number", label: "Net value", defaultValue: 0, group: "Values" },
539
+ { name: "rate", type: "number", label: "VAT rate (%)", min: 0, max: 100, defaultValue: 23, group: "Values" },
540
+ { name: "country", type: "select", label: "Country", options: [
541
+ { label: "Poland", value: "PL" },
542
+ { label: "Germany", value: "DE" },
543
+ { label: "France", value: "FR" }
544
+ ], defaultValue: "PL" },
545
+ { name: "showGross", type: "boolean", label: "Show gross value", defaultValue: !0 },
546
+ { name: "showVatAmount", type: "boolean", label: "Show VAT amount", defaultValue: !0 },
547
+ { name: "readOnly", type: "boolean", label: "Read only", defaultValue: !1 }
548
+ ]
549
+ },
550
+ {
551
+ type: "NiceInvoiceLines",
552
+ label: "Invoice Lines",
553
+ category: "Business",
554
+ icon: "file-text",
555
+ defaultProps: { lines: [], currency: "PLN" },
556
+ propDescriptors: [
557
+ { name: "lines", type: "json", label: "Invoice lines (JSON)" },
558
+ { name: "currency", type: "select", label: "Currency", options: [
559
+ { label: "PLN", value: "PLN" },
560
+ { label: "EUR", value: "EUR" },
561
+ { label: "USD", value: "USD" }
562
+ ], defaultValue: "PLN" },
563
+ { name: "showVAT", type: "boolean", label: "Show VAT column", defaultValue: !0 },
564
+ { name: "showDiscount", type: "boolean", label: "Show discount column", defaultValue: !1 },
565
+ { name: "showTotal", type: "boolean", label: "Show totals row", defaultValue: !0 },
566
+ { name: "editable", type: "boolean", label: "Editable", defaultValue: !0 },
567
+ { name: "readOnly", type: "boolean", label: "Read only", defaultValue: !1 }
568
+ ]
569
+ }
570
+ ], h = [
571
+ {
572
+ type: "NiceLoginForm",
573
+ label: "Login Form",
574
+ category: "Auth",
575
+ icon: "log-in",
576
+ defaultProps: { showRemember: !0, showForgotPassword: !0 },
577
+ propDescriptors: [
578
+ { name: "title", type: "string", label: "Form title", defaultValue: "Sign In" },
579
+ { name: "showRemember", type: "boolean", label: "Show 'Remember me'", defaultValue: !0 },
580
+ { name: "showForgotPassword", type: "boolean", label: "Show 'Forgot password'", defaultValue: !0 },
581
+ { name: "showRegisterLink", type: "boolean", label: "Show register link", defaultValue: !1 },
582
+ { name: "showLogo", type: "boolean", label: "Show logo", defaultValue: !0 },
583
+ { name: "logoUrl", type: "string", label: "Logo URL", group: "Branding" },
584
+ { name: "primaryColor", type: "color", label: "Primary color", defaultValue: "#1976d2", group: "Branding" },
585
+ { name: "variant", type: "variant", label: "Visual style", defaultValue: "card" }
586
+ ]
587
+ },
588
+ {
589
+ type: "NiceCaptcha",
590
+ label: "Captcha",
591
+ category: "Auth",
592
+ icon: "shield",
593
+ defaultProps: { provider: "recaptcha", size: "normal" },
594
+ propDescriptors: [
595
+ { name: "provider", type: "select", label: "Provider", options: [
596
+ { label: "reCAPTCHA v2", value: "recaptcha" },
597
+ { label: "reCAPTCHA v3", value: "recaptcha-v3" },
598
+ { label: "hCaptcha", value: "hcaptcha" },
599
+ { label: "Turnstile", value: "turnstile" }
600
+ ], defaultValue: "recaptcha" },
601
+ { name: "siteKey", type: "string", label: "Site key" },
602
+ { name: "size", type: "select", label: "Size", options: [
603
+ { label: "Normal", value: "normal" },
604
+ { label: "Compact", value: "compact" },
605
+ { label: "Invisible", value: "invisible" }
606
+ ], defaultValue: "normal" },
607
+ { name: "theme", type: "select", label: "Theme", options: [
608
+ { label: "Light", value: "light" },
609
+ { label: "Dark", value: "dark" }
610
+ ], defaultValue: "light" }
611
+ ]
612
+ },
613
+ {
614
+ type: "Nice2FASetup",
615
+ label: "2FA Setup",
616
+ category: "Auth",
617
+ icon: "key",
618
+ defaultProps: { method: "totp" },
619
+ propDescriptors: [
620
+ { name: "method", type: "select", label: "2FA method", options: [
621
+ { label: "TOTP (Authenticator)", value: "totp" },
622
+ { label: "SMS", value: "sms" },
623
+ { label: "Email", value: "email" }
624
+ ], defaultValue: "totp" },
625
+ { name: "issuer", type: "string", label: "Issuer name", defaultValue: "OmniVerk" },
626
+ { name: "showBackupCodes", type: "boolean", label: "Show backup codes", defaultValue: !0 },
627
+ { name: "showQR", type: "boolean", label: "Show QR code", defaultValue: !0 },
628
+ { name: "codeLength", type: "number", label: "Code length", min: 4, max: 8, defaultValue: 6 }
629
+ ]
630
+ }
631
+ ], f = [
632
+ {
633
+ type: "NiceComments",
634
+ label: "Comments",
635
+ category: "Social",
636
+ icon: "message-circle",
637
+ defaultProps: { threadId: "", allowReplies: !0 },
638
+ propDescriptors: [
639
+ { name: "threadId", type: "string", label: "Thread ID / entity ID" },
640
+ { name: "allowReplies", type: "boolean", label: "Allow replies (nested)", defaultValue: !0 },
641
+ { name: "maxDepth", type: "number", label: "Max nesting depth", min: 1, max: 10, defaultValue: 3 },
642
+ { name: "sortOrder", type: "select", label: "Default sort", options: [
643
+ { label: "Newest first", value: "newest" },
644
+ { label: "Oldest first", value: "oldest" },
645
+ { label: "Most liked", value: "popular" }
646
+ ], defaultValue: "newest" },
647
+ { name: "allowReactions", type: "boolean", label: "Allow reactions", defaultValue: !0 },
648
+ { name: "showAvatar", type: "boolean", label: "Show avatars", defaultValue: !0 },
649
+ { name: "readOnly", type: "boolean", label: "Read only", defaultValue: !1 }
650
+ ]
651
+ },
652
+ {
653
+ type: "NiceRatings",
654
+ label: "Ratings",
655
+ category: "Social",
656
+ icon: "star",
657
+ defaultProps: { maxStars: 5, allowHalf: !0 },
658
+ propDescriptors: [
659
+ { name: "value", type: "number", label: "Current rating", min: 0, max: 10, step: 0.5, defaultValue: 0 },
660
+ { name: "maxStars", type: "number", label: "Maximum stars", min: 3, max: 10, defaultValue: 5 },
661
+ { name: "allowHalf", type: "boolean", label: "Allow half stars", defaultValue: !0 },
662
+ { name: "showCount", type: "boolean", label: "Show vote count", defaultValue: !0 },
663
+ { name: "showAverage", type: "boolean", label: "Show average", defaultValue: !0 },
664
+ { name: "color", type: "color", label: "Star color", defaultValue: "#ffc107" },
665
+ { name: "size", type: "size", label: "Star size", group: "Layout" },
666
+ { name: "readOnly", type: "boolean", label: "Read only", defaultValue: !1 }
667
+ ]
668
+ },
669
+ {
670
+ type: "NiceWiki",
671
+ label: "Wiki Editor",
672
+ category: "Social",
673
+ icon: "book",
674
+ defaultProps: { content: "", showTOC: !0 },
675
+ propDescriptors: [
676
+ { name: "content", type: "string", label: "Initial content (Markdown)" },
677
+ { name: "showTOC", type: "boolean", label: "Show table of contents", defaultValue: !0 },
678
+ { name: "showHistory", type: "boolean", label: "Show version history", defaultValue: !0 },
679
+ { name: "allowEdit", type: "boolean", label: "Allow editing", defaultValue: !0 },
680
+ { name: "showToolbar", type: "boolean", label: "Show Markdown toolbar", defaultValue: !0 },
681
+ { name: "previewMode", type: "select", label: "Preview mode", options: [
682
+ { label: "Side by side", value: "split" },
683
+ { label: "Tab switch", value: "tabs" },
684
+ { label: "Live preview", value: "live" }
685
+ ], defaultValue: "split" },
686
+ { name: "maxLength", type: "number", label: "Max content length", min: 0, defaultValue: 0 }
687
+ ]
688
+ }
689
+ ], S = [
690
+ ...c,
691
+ ...p,
692
+ ...d,
693
+ ...b,
694
+ ...m,
695
+ ...h,
696
+ ...f
697
+ ];
698
+ export {
699
+ w as ErpAuthAdapter,
700
+ y as ErpDataAdapter,
701
+ v as ErpExportAdapter,
702
+ V as ErpFileAdapter,
703
+ S as allControlRegistries,
704
+ c as audioControlRegistry,
705
+ h as authControlRegistry,
706
+ m as businessControlRegistry,
707
+ g as createSignalRAdapter,
708
+ b as gamificationControlRegistry,
709
+ p as graphicControlRegistry,
710
+ f as socialControlRegistry,
711
+ d as threeControlRegistry
712
+ };
713
+ //# sourceMappingURL=index.mjs.map