@fluxo-dev/shell 0.0.40 → 0.0.42

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.
@@ -0,0 +1,385 @@
1
+ import { d as defineComponent, r as ref, c as computed, K as watch, U as openBlock, V as createElementBlock, a2 as createCommentVNode, F as Fragment, aa as renderList, Z as createBaseVNode, $ as createBlock, G as unref, a1 as c, X as normalizeStyle, a6 as withDirectives, a7 as vModelText, W as createVNode, a3 as normalizeClass, aK as nextTick, ac as withCtx, aA as p, ar as useRouter, aX as useRoute, aq as Te, aP as E, k as onMounted, ak as onBeforeUnmount, ad as createTextVNode, ai as createSlots, ab as toDisplayString, a8 as withKeys, by as environmentSchema, a5 as nanoid } from './index.esm2.js';
2
+ import { a, e as m$1, g, p as p$1, _ } from './SidebarButton.vue.esm.js';
3
+ import { a as a$1, b as a$2 } from './SidebarListElement.vue.esm.js';
4
+ import { x, a as a$3 } from './ViewLayoutContent.vue.esm.js';
5
+ import { m } from './ScalarTextField.vue.esm.js';
6
+ import 'react/jsx-runtime';
7
+ import 'react';
8
+ import 'react-redux';
9
+ import 'react-router-dom';
10
+ import '@fluxo-dev/ui-components';
11
+ import '@fluxo-dev/shell-mfe';
12
+ import '@mantine/core';
13
+ import '@fluxo-dev/shell-ravify';
14
+ import '@fluxo-dev/state';
15
+ import '@mantine/hooks';
16
+ import '@mantine/spotlight';
17
+ import '@fluxo-dev/api-client-base';
18
+ import '@mantine/notifications';
19
+ import 'react-dom';
20
+ import '@mantine/form';
21
+ import '@mantine/dates';
22
+ import '@mantine/dropzone';
23
+ import '@fluxo-dev/shell-reporting';
24
+ import '@fluxo-dev/shell-workflow';
25
+ import '@fluxo-dev/shell-bi';
26
+ import '@fluxo-dev/shell-hub';
27
+ import '@fluxo-dev/shell-printing';
28
+ import 'node:crypto';
29
+ import 'util';
30
+
31
+ const D = ["onClick"], V = {
32
+ key: 1,
33
+ class: "!py-0 flex flex-1 gap-2 items-center rounded"
34
+ }, j = ["placeholder"], T = /* @__PURE__ */ defineComponent({
35
+ __name: "EnvironmentColors",
36
+ props: {
37
+ activeColor: {}
38
+ },
39
+ emits: ["select"],
40
+ setup(y) {
41
+ const u = y, t = ref(!1), o = ref(""), i = ref(null), d = [
42
+ { color: "#8E8E8E" },
43
+ { color: "#EF0006" },
44
+ { color: "#EDBE20" },
45
+ { color: "#069061" },
46
+ { color: "#FB892C" },
47
+ { color: "#0082D0" },
48
+ { color: "#5203D1" },
49
+ { color: "#FFC0CB" }
50
+ ], C = computed(() => u.activeColor && !d.some((e) => e.color === u.activeColor) || o.value ? `background-color: ${u.activeColor || o.value};` : "background: linear-gradient(to right, rgb(235, 87, 87), rgb(242, 201, 76), rgb(76, 183, 130), rgb(78, 167, 252), rgb(250, 96, 122));"), k = () => {
51
+ t.value = !t.value, nextTick(() => {
52
+ i.value && i.value.focus();
53
+ });
54
+ };
55
+ return watch(o, (e) => {
56
+ e && !e.startsWith("#") && (o.value = `#${e}`), t.value = !0;
57
+ }), (e, r) => (openBlock(), createElementBlock("div", {
58
+ class: normalizeClass(["flex flex-row gap-1.5 items-center justify-between space-x-1 min-h-10 min-w-[296px] py-1", t.value ? "pl-2 pr-1.5" : "px-2"])
59
+ }, [
60
+ t.value ? createCommentVNode("", !0) : (openBlock(), createElementBlock(Fragment, { key: 0 }, [
61
+ (openBlock(), createElementBlock(Fragment, null, renderList(d, (l) => createBaseVNode("div", {
62
+ key: l.color,
63
+ class: "flex h-5 w-5 cursor-pointer items-center justify-center rounded-full",
64
+ style: normalizeStyle({ backgroundColor: l.color }),
65
+ onClick: (N) => e.$emit("select", l.color)
66
+ }, [
67
+ e.activeColor === l.color && !o.value ? (openBlock(), createBlock(unref(c), {
68
+ key: 0,
69
+ class: "text-c-btn",
70
+ icon: "Checkmark",
71
+ size: "xs"
72
+ })) : createCommentVNode("", !0)
73
+ ], 12, D)), 64)),
74
+ r[2] || (r[2] = createBaseVNode("hr", { class: "w-0.5 h-5 border-ghost border-l" }, null, -1)),
75
+ createBaseVNode("label", {
76
+ class: "cursor-pointer flex flex-row justify-center h-5 w-5 gap-2 items-center rounded-full z-10",
77
+ style: normalizeStyle(C.value),
78
+ onClick: k
79
+ }, [
80
+ !t.value && (e.activeColor === o.value || e.activeColor && !d.some((l) => l.color === e.activeColor)) ? (openBlock(), createBlock(unref(c), {
81
+ key: 0,
82
+ class: "text-c-btn",
83
+ icon: "Checkmark",
84
+ size: "xs"
85
+ })) : createCommentVNode("", !0)
86
+ ], 4)
87
+ ], 64)),
88
+ t.value ? (openBlock(), createElementBlock("div", V, [
89
+ r[3] || (r[3] = createBaseVNode("span", { class: "absolute border border-dashed h-5 w-5 rounded-full" }, null, -1)),
90
+ createBaseVNode("span", {
91
+ class: "h-5 w-5 rounded-full z-[1]",
92
+ style: normalizeStyle(C.value)
93
+ }, null, 4),
94
+ withDirectives(createBaseVNode("input", {
95
+ ref_key: "customColorInputRef",
96
+ ref: i,
97
+ "onUpdate:modelValue": r[0] || (r[0] = (l) => o.value = l),
98
+ class: "border-transparent flex-1 outline-none w-full text-sm",
99
+ placeholder: e.activeColor || "#000000",
100
+ type: "text",
101
+ onInput: r[1] || (r[1] = (l) => e.$emit("select", o.value))
102
+ }, null, 40, j), [
103
+ [vModelText, o.value]
104
+ ]),
105
+ createBaseVNode("button", {
106
+ class: "text-c-3 hover:bg-b-2 p-1.5 rounded-lg",
107
+ type: "button",
108
+ onClick: k
109
+ }, [
110
+ createVNode(unref(c), {
111
+ icon: "Checkmark",
112
+ size: "xs"
113
+ })
114
+ ])
115
+ ])) : createCommentVNode("", !0)
116
+ ], 2));
117
+ }
118
+ });
119
+
120
+ const S = { class: "flex flex-col gap-4" }, B = /* @__PURE__ */ defineComponent({
121
+ __name: "EnvironmentColorModal",
122
+ props: {
123
+ state: {},
124
+ selectedColor: {}
125
+ },
126
+ emits: ["cancel", "submit"],
127
+ setup(r, { emit: s }) {
128
+ const a$1 = r, l = s, t = ref(""), i = (o) => {
129
+ t.value = o;
130
+ };
131
+ return (o, e) => (openBlock(), createBlock(unref(p), {
132
+ size: "xxs",
133
+ state: o.state,
134
+ title: "Edit Environment Color"
135
+ }, {
136
+ default: withCtx(() => [
137
+ createBaseVNode("div", S, [
138
+ createVNode(T, {
139
+ activeColor: t.value || a$1.selectedColor,
140
+ class: "p-1 w-full",
141
+ onSelect: i
142
+ }, null, 8, ["activeColor"]),
143
+ createVNode(a, {
144
+ onCancel: e[0] || (e[0] = (m) => l("cancel")),
145
+ onSubmit: e[1] || (e[1] = (m) => l("submit", t.value))
146
+ })
147
+ ])
148
+ ]),
149
+ _: 1
150
+ }, 8, ["state"]));
151
+ }
152
+ });
153
+
154
+ const w = { class: "flex flex-col gap-3" }, F = /* @__PURE__ */ defineComponent({
155
+ __name: "EnvironmentModal",
156
+ props: {
157
+ state: {}
158
+ },
159
+ emits: ["cancel", "submit"],
160
+ setup(i, { emit: u }) {
161
+ const c = i, r = u, o = ref(""), l = ref("#8E8E8E"), d = (t) => {
162
+ l.value = t;
163
+ };
164
+ return watch(
165
+ () => c.state.open,
166
+ (t) => {
167
+ t && (o.value = "", l.value = "#8E8E8E");
168
+ }
169
+ ), (t, e) => (openBlock(), createBlock(unref(p), {
170
+ size: "xxs",
171
+ state: t.state,
172
+ title: "Add Environment"
173
+ }, {
174
+ default: withCtx(() => [
175
+ createBaseVNode("div", w, [
176
+ createVNode(unref(m), {
177
+ modelValue: o.value,
178
+ "onUpdate:modelValue": e[0] || (e[0] = (n) => o.value = n),
179
+ placeholder: "Environment name"
180
+ }, null, 8, ["modelValue"]),
181
+ createVNode(T, {
182
+ activeColor: l.value,
183
+ class: "p-3 w-full",
184
+ onSelect: d
185
+ }, null, 8, ["activeColor"]),
186
+ createVNode(a, {
187
+ onCancel: e[1] || (e[1] = (n) => r("cancel")),
188
+ onSubmit: e[2] || (e[2] = (n) => r("submit", {
189
+ name: o.value,
190
+ color: l.value
191
+ }))
192
+ })
193
+ ])
194
+ ]),
195
+ _: 1
196
+ }, 8, ["state"]));
197
+ }
198
+ });
199
+
200
+ const pe = { class: "flex-1" }, ye = ["value"], Ke = /* @__PURE__ */ defineComponent({
201
+ __name: "Environment",
202
+ setup(Ee) {
203
+ const f = useRouter(), k = useRoute(), { environments: l, environmentMutators: r, events: C } = Te(), v = E(), p = E(), o = ref(null), V = ref(null), y = ref(!1), E$1 = ref(null), _$1 = ref(""), c = (e) => JSON.parse(e), h = (e) => JSON.stringify(e, null, 2);
204
+ function x$1(e) {
205
+ const t = l[Object.keys(l)[0]], a = (t ? Object.keys(c(t.value)) : []).reduce(
206
+ (D, U) => (D[U] = "", D),
207
+ {}
208
+ ), w = environmentSchema.parse({
209
+ name: e.name,
210
+ uid: nanoid(),
211
+ color: e.color,
212
+ value: h(a),
213
+ isDefault: !1
214
+ });
215
+ r.add(w), o.value = w.uid, f.push(o.value), p.hide();
216
+ }
217
+ function M(e) {
218
+ Object.values(l).forEach((t) => {
219
+ const n = c(t.value);
220
+ e in n || (n[e] = "", r.edit(
221
+ t.uid,
222
+ "value",
223
+ h(n)
224
+ ));
225
+ });
226
+ }
227
+ function O(e) {
228
+ Object.values(l).forEach((t) => {
229
+ const n = c(t.value);
230
+ e in n && (delete n[e], r.edit(
231
+ t.uid,
232
+ "value",
233
+ h(n)
234
+ ));
235
+ });
236
+ }
237
+ function $(e) {
238
+ if (o.value) {
239
+ const t = c(e), n = c(
240
+ l[o.value].value
241
+ );
242
+ Object.keys(t).forEach((a) => {
243
+ a in n || M(a);
244
+ }), Object.keys(n).forEach((a) => {
245
+ a in t || O(a);
246
+ }), r.edit(o.value, "value", e);
247
+ }
248
+ }
249
+ const j = (e) => {
250
+ if (r.delete(e), o.value === e) {
251
+ const t = Object.values(l);
252
+ if (t.length > 0) {
253
+ const n = t[t.length - 1];
254
+ o.value = n.uid, f.push({
255
+ name: "environment",
256
+ params: { environment: n.uid }
257
+ });
258
+ } else
259
+ o.value = l.default.uid, f.push({ name: "environment", params: { environment: "default" } });
260
+ }
261
+ }, K = (e) => {
262
+ E$1.value = e, _$1.value = l[e].color || "", v.show();
263
+ }, I = (e) => {
264
+ E$1.value && (r.edit(E$1.value, "color", e), v.hide());
265
+ }, L = () => {
266
+ const e = f.currentRoute.value.params.environment;
267
+ e ? o.value = e : e === "default" && (o.value = l.default.uid);
268
+ }, R = () => {
269
+ o.value && !l[o.value].isDefault && (y.value = !0, nextTick(() => {
270
+ var e;
271
+ (e = V.value) == null || e.focus();
272
+ }));
273
+ }, B$1 = (e) => {
274
+ const n = e.target.value;
275
+ o.value && !l[o.value].isDefault && r.edit(o.value, "name", n);
276
+ }, N = (e) => {
277
+ e != null && e.createNew && k.name === "environment" && x$1({ name: "", color: "" });
278
+ }, A = () => {
279
+ p.show();
280
+ };
281
+ return watch(
282
+ () => k.params.environment,
283
+ (e) => o.value = e || l.default.uid
284
+ ), onMounted(() => {
285
+ L(), C.hotKeys.on(N);
286
+ }), onBeforeUnmount(() => C.hotKeys.off(N)), (e, t) => (openBlock(), createBlock(a$3, null, {
287
+ default: withCtx(() => [
288
+ createVNode(m$1, { title: "Environment" }, {
289
+ content: withCtx(() => [
290
+ createBaseVNode("div", pe, [
291
+ createVNode(a$1, null, {
292
+ default: withCtx(() => [
293
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (n) => (openBlock(), createBlock(a$2, {
294
+ key: n.uid,
295
+ class: "text-xs",
296
+ isCopyable: !1,
297
+ variable: {
298
+ name: n.name,
299
+ uid: n.uid,
300
+ color: n.color,
301
+ isDefault: n.isDefault
302
+ },
303
+ warningMessage: "Are you sure you want to delete this environment?",
304
+ onClick: (a) => o.value = n.uid,
305
+ onColorModal: K,
306
+ onDelete: (a) => j(n.uid)
307
+ }, null, 8, ["variable", "onClick", "onDelete"]))), 128))
308
+ ]),
309
+ _: 1
310
+ })
311
+ ])
312
+ ]),
313
+ button: withCtx(() => [
314
+ createVNode(g, {
315
+ click: A,
316
+ hotkey: "N"
317
+ }, {
318
+ title: withCtx(() => t[4] || (t[4] = [
319
+ createTextVNode("Add Environment")
320
+ ])),
321
+ _: 1
322
+ })
323
+ ]),
324
+ _: 1
325
+ }),
326
+ createVNode(x, { class: "flex-1" }, {
327
+ default: withCtx(() => [
328
+ createVNode(p$1, null, createSlots({
329
+ default: withCtx(() => [
330
+ o.value ? (openBlock(), createBlock(_, {
331
+ key: 0,
332
+ class: "pl-px pr-2 md:px-4 py-2",
333
+ isCopyable: "",
334
+ language: "json",
335
+ lineNumbers: "",
336
+ lint: "",
337
+ modelValue: unref(l)[o.value].value,
338
+ "onUpdate:modelValue": $
339
+ }, null, 8, ["modelValue"])) : createCommentVNode("", !0)
340
+ ]),
341
+ _: 2
342
+ }, [
343
+ o.value ? {
344
+ name: "title",
345
+ fn: withCtx(() => [
346
+ !y.value || unref(l)[o.value].isDefault ? (openBlock(), createElementBlock("span", {
347
+ key: 0,
348
+ onDblclick: R
349
+ }, toDisplayString(unref(l)[o.value].name), 33)) : (openBlock(), createElementBlock("input", {
350
+ key: 1,
351
+ ref_key: "nameInputRef",
352
+ ref: V,
353
+ class: "ring-1 ring-offset-4 ring-b-outline rounded",
354
+ spellcheck: "false",
355
+ type: "text",
356
+ value: unref(l)[o.value].name,
357
+ onBlur: t[0] || (t[0] = (n) => y.value = !1),
358
+ onInput: B$1,
359
+ onKeyup: t[1] || (t[1] = withKeys((n) => y.value = !1, ["enter"]))
360
+ }, null, 40, ye))
361
+ ]),
362
+ key: "0"
363
+ } : void 0
364
+ ]), 1024)
365
+ ]),
366
+ _: 1
367
+ }),
368
+ createVNode(B, {
369
+ selectedColor: _$1.value,
370
+ state: unref(v),
371
+ onCancel: t[2] || (t[2] = (n) => unref(v).hide()),
372
+ onSubmit: I
373
+ }, null, 8, ["selectedColor", "state"]),
374
+ createVNode(F, {
375
+ state: unref(p),
376
+ onCancel: t[3] || (t[3] = (n) => unref(p).hide()),
377
+ onSubmit: x$1
378
+ }, null, 8, ["state"])
379
+ ]),
380
+ _: 1
381
+ }));
382
+ }
383
+ });
384
+
385
+ export { Ke as default };
@@ -0,0 +1,53 @@
1
+ import { d as defineComponent, U as openBlock, $ as createBlock, ac as withCtx, V as createElementBlock, ab as toDisplayString, _ as renderSlot, Z as createBaseVNode, F as Fragment, aa as renderList, a3 as normalizeClass, W as createVNode, ad as createTextVNode, a2 as createCommentVNode } from './index.esm2.js';
2
+ import { f, i, a as m } from './DataTableInput.vue.esm.js';
3
+ import { p } from './SidebarButton.vue.esm.js';
4
+
5
+ const C = { key: 0 }, N = { class: "custom-scroll flex flex-1 flex-col gap-1.5 p-2 md:p-5" }, E = /* @__PURE__ */ defineComponent({
6
+ __name: "Form",
7
+ props: {
8
+ title: {},
9
+ options: {},
10
+ data: {},
11
+ onUpdate: { type: Function }
12
+ },
13
+ setup(S) {
14
+ return (e, U) => (openBlock(), createBlock(p, null, {
15
+ title: withCtx(() => [
16
+ e.title ? (openBlock(), createElementBlock("span", C, toDisplayString(e.title), 1)) : renderSlot(e.$slots, "title", { key: 1 })
17
+ ]),
18
+ default: withCtx(() => [
19
+ createBaseVNode("div", N, [
20
+ Object.keys(e.data).length > 0 ? (openBlock(), createBlock(f, {
21
+ key: 0,
22
+ columns: [""]
23
+ }, {
24
+ default: withCtx(() => [
25
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(e.options, (o, r) => (openBlock(), createBlock(i, {
26
+ key: r,
27
+ class: normalizeClass({ "border-t": r === 0 })
28
+ }, {
29
+ default: withCtx(() => [
30
+ createVNode(m, {
31
+ modelValue: String(e.data[o.key] ?? ""),
32
+ placeholder: o.placeholder,
33
+ "onUpdate:modelValue": (s) => e.onUpdate(o.key, s)
34
+ }, {
35
+ default: withCtx(() => [
36
+ createTextVNode(toDisplayString(o.label), 1)
37
+ ]),
38
+ _: 2
39
+ }, 1032, ["modelValue", "placeholder", "onUpdate:modelValue"])
40
+ ]),
41
+ _: 2
42
+ }, 1032, ["class"]))), 128))
43
+ ]),
44
+ _: 1
45
+ })) : createCommentVNode("", !0)
46
+ ])
47
+ ]),
48
+ _: 3
49
+ }));
50
+ }
51
+ });
52
+
53
+ export { E };