@burdenoff/microfe-channel 2026.715.2 → 2026.731.1
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/channel/components/MarkdownEditor.d.ts +23 -0
- package/dist/channel/components/MarkdownEditor.d.ts.map +1 -0
- package/dist/channel/components/MarkdownEditor.js +172 -0
- package/dist/channel/components/MarkdownEditor.js.map +1 -0
- package/dist/channel/modules/channels/pages/ChannelDetailsPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelDetailsPage.js +47 -46
- package/dist/channel/modules/channels/pages/ChannelDetailsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/CreateChannelPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/CreateChannelPage.js +158 -156
- package/dist/channel/modules/channels/pages/CreateChannelPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/EditChannelPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/EditChannelPage.js +125 -123
- package/dist/channel/modules/channels/pages/EditChannelPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/SendMessagePage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/SendMessagePage.js +171 -171
- package/dist/channel/modules/channels/pages/SendMessagePage.js.map +1 -1
- package/package.json +5 -5
|
@@ -2,19 +2,20 @@ import { useChannel as e } from "../../../providers/ChannelProvider.js";
|
|
|
2
2
|
import { useChannels as t } from "../../../hooks/useChannels.js";
|
|
3
3
|
import { PermissionGuard as n } from "../../../components/PermissionGuard.js";
|
|
4
4
|
import { CHANNEL_PERMISSIONS as r } from "../../../constants/permissions.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { MarkdownEditor as i } from "../../../components/MarkdownEditor.js";
|
|
6
|
+
import { useState as a } from "react";
|
|
7
|
+
import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
8
|
+
import { AlertCircle as s, ArrowLeft as c, Bell as l, CheckCircle2 as u, Globe as d, Hash as f, Inbox as p, Loader2 as m, Mail as h, MessageCircle as g, MessageSquare as _, Radio as v, Save as y, Send as b, Smartphone as x, Users as S } from "lucide-react";
|
|
9
|
+
import { useNavigate as C } from "react-router-dom";
|
|
10
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
11
|
+
import { EmphasisPanel as E, GlassCard as D, OptionalFields as O, PagePurpose as k } from "@burdenoff/fe-libs/ui";
|
|
11
12
|
//#region src/channel/modules/channels/pages/CreateChannelPage.tsx
|
|
12
|
-
var
|
|
13
|
+
var A = [
|
|
13
14
|
{
|
|
14
15
|
value: "EMAIL",
|
|
15
16
|
label: "Email",
|
|
16
17
|
description: "Send emails via various providers",
|
|
17
|
-
icon:
|
|
18
|
+
icon: h,
|
|
18
19
|
color: "text-accent-blue bg-accent-blue-subtle border-accent-blue-subtle",
|
|
19
20
|
adapters: [{
|
|
20
21
|
value: "AWS_SES",
|
|
@@ -28,7 +29,7 @@ var k = [
|
|
|
28
29
|
value: "SMS",
|
|
29
30
|
label: "SMS",
|
|
30
31
|
description: "Send text messages",
|
|
31
|
-
icon:
|
|
32
|
+
icon: x,
|
|
32
33
|
color: "text-status-success-text bg-status-success-bg-subtle border-status-success-bg-subtle",
|
|
33
34
|
adapters: [{
|
|
34
35
|
value: "AWS_SNS",
|
|
@@ -42,7 +43,7 @@ var k = [
|
|
|
42
43
|
value: "PUSH",
|
|
43
44
|
label: "Push",
|
|
44
45
|
description: "Mobile & web push",
|
|
45
|
-
icon:
|
|
46
|
+
icon: l,
|
|
46
47
|
color: "text-accent-purple bg-accent-purple-subtle border-accent-purple-subtle",
|
|
47
48
|
adapters: [{
|
|
48
49
|
value: "FCM",
|
|
@@ -53,7 +54,7 @@ var k = [
|
|
|
53
54
|
value: "INAPP",
|
|
54
55
|
label: "In-App",
|
|
55
56
|
description: "In-app notifications",
|
|
56
|
-
icon:
|
|
57
|
+
icon: p,
|
|
57
58
|
color: "text-accent-indigo bg-accent-indigo-subtle border-accent-indigo-subtle",
|
|
58
59
|
adapters: [{
|
|
59
60
|
value: "INAPP_NATIVE",
|
|
@@ -64,7 +65,7 @@ var k = [
|
|
|
64
65
|
value: "SLACK",
|
|
65
66
|
label: "Slack",
|
|
66
67
|
description: "Workspace notifications",
|
|
67
|
-
icon:
|
|
68
|
+
icon: f,
|
|
68
69
|
color: "text-accent-pink bg-accent-pink-subtle border-accent-pink-subtle",
|
|
69
70
|
adapters: [{
|
|
70
71
|
value: "SLACK_BOT",
|
|
@@ -75,7 +76,7 @@ var k = [
|
|
|
75
76
|
value: "TEAMS",
|
|
76
77
|
label: "Teams",
|
|
77
78
|
description: "Teams notifications",
|
|
78
|
-
icon:
|
|
79
|
+
icon: S,
|
|
79
80
|
color: "text-accent-cyan bg-accent-cyan-subtle border-accent-cyan-subtle",
|
|
80
81
|
adapters: [{
|
|
81
82
|
value: "TEAMS_BOT",
|
|
@@ -86,7 +87,7 @@ var k = [
|
|
|
86
87
|
value: "DISCORD",
|
|
87
88
|
label: "Discord",
|
|
88
89
|
description: "Server notifications",
|
|
89
|
-
icon:
|
|
90
|
+
icon: g,
|
|
90
91
|
color: "text-accent-violet bg-accent-violet-subtle border-accent-violet-subtle",
|
|
91
92
|
adapters: [{
|
|
92
93
|
value: "DISCORD_BOT",
|
|
@@ -97,7 +98,7 @@ var k = [
|
|
|
97
98
|
value: "WHATSAPP",
|
|
98
99
|
label: "WhatsApp",
|
|
99
100
|
description: "Business messaging",
|
|
100
|
-
icon:
|
|
101
|
+
icon: b,
|
|
101
102
|
color: "text-accent-emerald bg-accent-emerald-subtle border-accent-emerald-subtle",
|
|
102
103
|
adapters: [{
|
|
103
104
|
value: "WHATSAPP_CLOUD",
|
|
@@ -111,7 +112,7 @@ var k = [
|
|
|
111
112
|
value: "WEBCHAT",
|
|
112
113
|
label: "Webchat",
|
|
113
114
|
description: "Chat widgets",
|
|
114
|
-
icon:
|
|
115
|
+
icon: _,
|
|
115
116
|
color: "text-accent-teal bg-accent-teal-subtle border-accent-teal-subtle",
|
|
116
117
|
adapters: []
|
|
117
118
|
},
|
|
@@ -119,7 +120,7 @@ var k = [
|
|
|
119
120
|
value: "WEBHOOK",
|
|
120
121
|
label: "Webhook",
|
|
121
122
|
description: "HTTP webhooks",
|
|
122
|
-
icon:
|
|
123
|
+
icon: d,
|
|
123
124
|
color: "text-accent-orange bg-accent-orange-subtle border-accent-orange-subtle",
|
|
124
125
|
adapters: [{
|
|
125
126
|
value: "WEBHOOK_HTTP",
|
|
@@ -127,11 +128,11 @@ var k = [
|
|
|
127
128
|
}]
|
|
128
129
|
}
|
|
129
130
|
];
|
|
130
|
-
function
|
|
131
|
-
let
|
|
132
|
-
let n =
|
|
131
|
+
function j() {
|
|
132
|
+
let l = C(), { organizationId: d } = e(), { createChannel: f } = t(), { t: p } = o(), h = (e, t) => {
|
|
133
|
+
let n = p(e);
|
|
133
134
|
return n === e ? t : n;
|
|
134
|
-
}, [
|
|
135
|
+
}, [g, _] = a(!1), [b, x] = a(null), [S, j] = a({
|
|
135
136
|
name: "",
|
|
136
137
|
platform: "EMAIL",
|
|
137
138
|
description: "",
|
|
@@ -139,210 +140,211 @@ function A() {
|
|
|
139
140
|
status: "ACTIVE",
|
|
140
141
|
priority: 100,
|
|
141
142
|
platformConfig: ""
|
|
142
|
-
}),
|
|
143
|
-
|
|
143
|
+
}), M = A.find((e) => e.value === S.platform)?.adapters || [], N = A.find((e) => e.value === S.platform), P = (e) => {
|
|
144
|
+
j((t) => ({
|
|
144
145
|
...t,
|
|
145
146
|
platform: e,
|
|
146
147
|
adapterType: ""
|
|
147
148
|
}));
|
|
148
149
|
};
|
|
149
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ w(n, {
|
|
150
151
|
permission: r.CHANNEL_CREATE,
|
|
151
|
-
children: /* @__PURE__ */
|
|
152
|
+
children: /* @__PURE__ */ T("div", {
|
|
152
153
|
className: "p-3 sm:p-6 space-y-6 max-w-5xl mx-auto",
|
|
153
154
|
children: [
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ w("div", {
|
|
155
156
|
className: "flex items-center justify-between",
|
|
156
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ T("div", {
|
|
157
158
|
className: "flex items-center gap-3",
|
|
158
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ w("button", {
|
|
159
160
|
type: "button",
|
|
160
|
-
onClick: () =>
|
|
161
|
+
onClick: () => l(-1),
|
|
161
162
|
className: "p-2 text-text-secondary hover:text-text-primary hover:bg-surface-hover rounded-lg transition-colors",
|
|
162
|
-
children: /* @__PURE__ */
|
|
163
|
-
}), /* @__PURE__ */
|
|
163
|
+
children: /* @__PURE__ */ w(c, { size: 20 })
|
|
164
|
+
}), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("h1", {
|
|
164
165
|
className: "text-xl font-bold text-text-primary flex items-center gap-2",
|
|
165
|
-
children: [/* @__PURE__ */
|
|
166
|
+
children: [/* @__PURE__ */ w(v, {
|
|
166
167
|
size: 22,
|
|
167
168
|
className: "text-accent-primary"
|
|
168
|
-
}),
|
|
169
|
-
}), /* @__PURE__ */
|
|
169
|
+
}), h("channel.createChannel", "Create Channel")]
|
|
170
|
+
}), /* @__PURE__ */ w("p", {
|
|
170
171
|
className: "text-sm text-text-secondary mt-0.5",
|
|
171
|
-
children:
|
|
172
|
+
children: h("channel.createChannelSubtitle", "Set up a new communication channel")
|
|
172
173
|
})] })]
|
|
173
174
|
})
|
|
174
175
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
icon: /* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ w(k, {
|
|
177
|
+
icon: /* @__PURE__ */ w(v, {
|
|
177
178
|
size: 15,
|
|
178
179
|
"aria-hidden": "true"
|
|
179
180
|
}),
|
|
180
|
-
children:
|
|
181
|
+
children: h("channel.createChannelPurpose", "Set up a new way to reach people — for example a transactional email sender, an SMS gateway, a Slack workspace or a push provider. Name it, pick the platform and provider, and you will get a channel you can then authenticate and send through. Create one channel per provider account you want messages to flow through.")
|
|
181
182
|
}),
|
|
182
|
-
|
|
183
|
+
b && /* @__PURE__ */ T("div", {
|
|
183
184
|
className: "flex items-center gap-3 p-3 bg-error-500/10 border border-status-error-border/30 rounded-lg",
|
|
184
|
-
children: [/* @__PURE__ */
|
|
185
|
+
children: [/* @__PURE__ */ w(s, {
|
|
185
186
|
size: 16,
|
|
186
187
|
className: "text-status-error-text shrink-0"
|
|
187
|
-
}), /* @__PURE__ */
|
|
188
|
+
}), /* @__PURE__ */ w("p", {
|
|
188
189
|
className: "text-sm text-error-400",
|
|
189
|
-
children:
|
|
190
|
+
children: b
|
|
190
191
|
})]
|
|
191
192
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ T("form", {
|
|
193
194
|
onSubmit: async (e) => {
|
|
194
|
-
if (e.preventDefault(),
|
|
195
|
-
|
|
195
|
+
if (e.preventDefault(), x(null), !S.name.trim()) {
|
|
196
|
+
x(h("channel.validation.nameRequired", "Channel name is required"));
|
|
196
197
|
return;
|
|
197
198
|
}
|
|
198
|
-
if (!
|
|
199
|
-
|
|
199
|
+
if (!d) {
|
|
200
|
+
x(h("channel.validation.organizationRequired", "Organization context is required. Please ensure an organization is selected."));
|
|
200
201
|
return;
|
|
201
202
|
}
|
|
202
203
|
let t;
|
|
203
|
-
if (
|
|
204
|
-
t = JSON.parse(
|
|
204
|
+
if (S.platformConfig.trim()) try {
|
|
205
|
+
t = JSON.parse(S.platformConfig);
|
|
205
206
|
} catch {
|
|
206
|
-
|
|
207
|
+
x(h("channel.validation.platformConfigJson", "Platform Config must be valid JSON"));
|
|
207
208
|
return;
|
|
208
209
|
}
|
|
209
|
-
|
|
210
|
+
_(!0);
|
|
210
211
|
try {
|
|
211
|
-
let e = await
|
|
212
|
-
name:
|
|
213
|
-
platform:
|
|
214
|
-
organizationId:
|
|
215
|
-
description:
|
|
216
|
-
adapterType:
|
|
217
|
-
status:
|
|
218
|
-
priority:
|
|
212
|
+
let e = await f({
|
|
213
|
+
name: S.name.trim(),
|
|
214
|
+
platform: S.platform,
|
|
215
|
+
organizationId: d,
|
|
216
|
+
description: S.description.trim() || void 0,
|
|
217
|
+
adapterType: S.adapterType || void 0,
|
|
218
|
+
status: S.status,
|
|
219
|
+
priority: S.priority,
|
|
219
220
|
platformConfig: t
|
|
220
221
|
});
|
|
221
|
-
e ?
|
|
222
|
+
e ? l(`../${e.id}`) : x(h("channel.createFailed", "Failed to create channel"));
|
|
222
223
|
} catch (e) {
|
|
223
|
-
|
|
224
|
+
x(e instanceof Error ? e.message : h("channel.createFailed", "Failed to create channel"));
|
|
224
225
|
} finally {
|
|
225
|
-
|
|
226
|
+
_(!1);
|
|
226
227
|
}
|
|
227
228
|
},
|
|
228
229
|
className: "space-y-6",
|
|
229
230
|
children: [
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ T("div", {
|
|
231
232
|
className: "grid gap-5 lg:grid-cols-2",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
233
|
+
children: [/* @__PURE__ */ T(E, {
|
|
233
234
|
className: "p-5 space-y-4",
|
|
234
235
|
children: [
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ w("h2", {
|
|
236
237
|
className: "text-sm font-semibold text-text-primary uppercase tracking-wider",
|
|
237
|
-
children:
|
|
238
|
+
children: h("channel.basicInformation", "Basic Information")
|
|
238
239
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("label", {
|
|
240
241
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
241
242
|
children: [
|
|
242
|
-
|
|
243
|
+
h("channel.name", "Name"),
|
|
243
244
|
" ",
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ w("span", {
|
|
245
246
|
className: "text-status-error-text",
|
|
246
247
|
children: "*"
|
|
247
248
|
})
|
|
248
249
|
]
|
|
249
|
-
}), /* @__PURE__ */
|
|
250
|
-
"aria-label":
|
|
250
|
+
}), /* @__PURE__ */ w("input", {
|
|
251
|
+
"aria-label": h("channel.namePlaceholder", "e.g., Primary Email, SMS Alerts"),
|
|
251
252
|
type: "text",
|
|
252
|
-
value:
|
|
253
|
-
onChange: (e) =>
|
|
253
|
+
value: S.name,
|
|
254
|
+
onChange: (e) => j((t) => ({
|
|
254
255
|
...t,
|
|
255
256
|
name: e.target.value
|
|
256
257
|
})),
|
|
257
258
|
className: "w-full px-3 py-2 text-sm bg-surface border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 placeholder:text-text-secondary",
|
|
258
|
-
placeholder:
|
|
259
|
+
placeholder: h("channel.namePlaceholder", "e.g., Primary Email, SMS Alerts")
|
|
259
260
|
})] }),
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
262
|
+
htmlFor: "channel-create-description",
|
|
261
263
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
262
|
-
children:
|
|
263
|
-
}), /* @__PURE__ */
|
|
264
|
-
|
|
265
|
-
value:
|
|
266
|
-
onChange: (e) =>
|
|
264
|
+
children: h("channel.description", "Description")
|
|
265
|
+
}), /* @__PURE__ */ w(i, {
|
|
266
|
+
id: "channel-create-description",
|
|
267
|
+
value: S.description,
|
|
268
|
+
onChange: (e) => j((t) => ({
|
|
267
269
|
...t,
|
|
268
|
-
description: e
|
|
270
|
+
description: e
|
|
269
271
|
})),
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
272
|
+
"aria-label": h("channel.descriptionPlaceholder", "Optional description of this channel's purpose"),
|
|
273
|
+
placeholder: h("channel.descriptionPlaceholder", "Optional description of this channel's purpose"),
|
|
274
|
+
rows: 3
|
|
273
275
|
})] })
|
|
274
276
|
]
|
|
275
|
-
}), /* @__PURE__ */
|
|
277
|
+
}), /* @__PURE__ */ T(D, {
|
|
276
278
|
treatment: "plain",
|
|
277
279
|
className: "p-5 border-border-seam space-y-4",
|
|
278
280
|
children: [
|
|
279
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ w("h2", {
|
|
280
282
|
className: "text-sm font-semibold text-text-primary uppercase tracking-wider",
|
|
281
|
-
children:
|
|
283
|
+
children: h("channel.providerStatus", "Provider & Status")
|
|
282
284
|
}),
|
|
283
|
-
/* @__PURE__ */
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ T("div", { children: [
|
|
286
|
+
/* @__PURE__ */ w("label", {
|
|
285
287
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
286
|
-
children:
|
|
288
|
+
children: h("channel.providerAdapter", "Provider / Adapter")
|
|
287
289
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
value:
|
|
290
|
-
onChange: (e) =>
|
|
290
|
+
/* @__PURE__ */ T("select", {
|
|
291
|
+
value: S.adapterType,
|
|
292
|
+
onChange: (e) => j((t) => ({
|
|
291
293
|
...t,
|
|
292
294
|
adapterType: e.target.value
|
|
293
295
|
})),
|
|
294
296
|
className: "w-full px-3 py-2 text-sm bg-surface border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 text-text-primary",
|
|
295
|
-
children: [/* @__PURE__ */
|
|
297
|
+
children: [/* @__PURE__ */ w("option", {
|
|
296
298
|
value: "",
|
|
297
|
-
children:
|
|
298
|
-
}),
|
|
299
|
+
children: h("channel.selectProvider", "Select a provider (optional)")
|
|
300
|
+
}), M.map((e) => /* @__PURE__ */ w("option", {
|
|
299
301
|
value: e.value,
|
|
300
302
|
children: e.label
|
|
301
303
|
}, e.value))]
|
|
302
304
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ w("p", {
|
|
304
306
|
className: "mt-1 text-[11px] text-text-secondary",
|
|
305
|
-
children:
|
|
307
|
+
children: N ? h("channel.providersAvailableForPlatform", `${M.length} providers available for ${N.label}`) : h("channel.selectPlatformFirst", "Select a platform first")
|
|
306
308
|
})
|
|
307
309
|
] }),
|
|
308
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ T("div", {
|
|
309
311
|
className: "grid gap-4 sm:grid-cols-2",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
+
children: [/* @__PURE__ */ T("div", { children: [
|
|
313
|
+
/* @__PURE__ */ w("label", {
|
|
312
314
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
313
|
-
children:
|
|
315
|
+
children: h("channel.status", "Status")
|
|
314
316
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
value:
|
|
317
|
-
onChange: (e) =>
|
|
317
|
+
/* @__PURE__ */ T("select", {
|
|
318
|
+
value: S.status,
|
|
319
|
+
onChange: (e) => j((t) => ({
|
|
318
320
|
...t,
|
|
319
321
|
status: e.target.value
|
|
320
322
|
})),
|
|
321
323
|
className: "w-full px-3 py-2 text-sm bg-surface border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 text-text-primary",
|
|
322
|
-
children: [/* @__PURE__ */
|
|
324
|
+
children: [/* @__PURE__ */ w("option", {
|
|
323
325
|
value: "ACTIVE",
|
|
324
|
-
children:
|
|
325
|
-
}), /* @__PURE__ */
|
|
326
|
+
children: h("channel.status.active", "Active")
|
|
327
|
+
}), /* @__PURE__ */ w("option", {
|
|
326
328
|
value: "INACTIVE",
|
|
327
|
-
children:
|
|
329
|
+
children: h("channel.status.inactive", "Inactive")
|
|
328
330
|
})]
|
|
329
331
|
}),
|
|
330
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ w("p", {
|
|
331
333
|
className: "mt-1 text-[11px] text-text-secondary",
|
|
332
|
-
children:
|
|
334
|
+
children: S.status === "ACTIVE" ? h("channel.statusHint.active", "Ready to send immediately") : h("channel.statusHint.inactive", "Configure before activating")
|
|
333
335
|
})
|
|
334
|
-
] }), /* @__PURE__ */
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
+
] }), /* @__PURE__ */ T("div", { children: [
|
|
337
|
+
/* @__PURE__ */ w("label", {
|
|
336
338
|
htmlFor: "create-channel-priority",
|
|
337
339
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
338
|
-
children:
|
|
340
|
+
children: h("channel.priority", "Priority")
|
|
339
341
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ w("input", {
|
|
341
343
|
id: "create-channel-priority",
|
|
342
|
-
"aria-label":
|
|
344
|
+
"aria-label": h("channel.priority", "Priority"),
|
|
343
345
|
type: "number",
|
|
344
|
-
value:
|
|
345
|
-
onChange: (e) =>
|
|
346
|
+
value: S.priority,
|
|
347
|
+
onChange: (e) => j((t) => ({
|
|
346
348
|
...t,
|
|
347
349
|
priority: parseInt(e.target.value) || 0
|
|
348
350
|
})),
|
|
@@ -350,47 +352,47 @@ function A() {
|
|
|
350
352
|
max: 100,
|
|
351
353
|
className: "w-full px-3 py-2 text-sm bg-surface border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50"
|
|
352
354
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ w("p", {
|
|
354
356
|
className: "mt-1 text-[11px] text-text-secondary",
|
|
355
|
-
children:
|
|
357
|
+
children: h("channel.priorityHint", "Lower = higher priority (0-100)")
|
|
356
358
|
})
|
|
357
359
|
] })]
|
|
358
360
|
})
|
|
359
361
|
]
|
|
360
362
|
})]
|
|
361
363
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ T(D, {
|
|
363
365
|
treatment: "plain",
|
|
364
366
|
className: "p-5 border-border-seam space-y-4",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
367
|
+
children: [/* @__PURE__ */ T("h2", {
|
|
366
368
|
className: "text-sm font-semibold text-text-primary uppercase tracking-wider",
|
|
367
369
|
children: [
|
|
368
|
-
|
|
370
|
+
h("channel.platform", "Platform"),
|
|
369
371
|
" ",
|
|
370
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ w("span", {
|
|
371
373
|
className: "text-status-error-text",
|
|
372
374
|
children: "*"
|
|
373
375
|
})
|
|
374
376
|
]
|
|
375
|
-
}), /* @__PURE__ */
|
|
377
|
+
}), /* @__PURE__ */ w("div", {
|
|
376
378
|
className: "grid gap-2 grid-cols-2 sm:grid-cols-3 lg:grid-cols-5",
|
|
377
|
-
children:
|
|
378
|
-
let t = e.icon, n =
|
|
379
|
-
return /* @__PURE__ */
|
|
379
|
+
children: A.map((e) => {
|
|
380
|
+
let t = e.icon, n = S.platform === e.value;
|
|
381
|
+
return /* @__PURE__ */ T("button", {
|
|
380
382
|
type: "button",
|
|
381
|
-
onClick: () =>
|
|
383
|
+
onClick: () => P(e.value),
|
|
382
384
|
className: `relative flex flex-col items-center gap-1.5 p-3 rounded-lg border transition-all text-center ${n ? `${e.color} border-current ring-1 ring-current` : "border-border-subtle hover:bg-surface-hover text-text-secondary hover:text-text-primary"}`,
|
|
383
385
|
children: [
|
|
384
|
-
n && /* @__PURE__ */
|
|
386
|
+
n && /* @__PURE__ */ w(u, {
|
|
385
387
|
size: 14,
|
|
386
388
|
className: "absolute top-1.5 right-1.5 text-current"
|
|
387
389
|
}),
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ w(t, { size: 20 }),
|
|
391
|
+
/* @__PURE__ */ w("span", {
|
|
390
392
|
className: "text-xs font-semibold",
|
|
391
393
|
children: e.label
|
|
392
394
|
}),
|
|
393
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ w("span", {
|
|
394
396
|
className: "text-[10px] leading-tight opacity-70",
|
|
395
397
|
children: e.description
|
|
396
398
|
})
|
|
@@ -399,55 +401,55 @@ function A() {
|
|
|
399
401
|
})
|
|
400
402
|
})]
|
|
401
403
|
}),
|
|
402
|
-
/* @__PURE__ */
|
|
403
|
-
title:
|
|
404
|
-
children: /* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ w(O, {
|
|
405
|
+
title: h("channel.advancedOptions", "Advanced settings"),
|
|
406
|
+
children: /* @__PURE__ */ w("div", {
|
|
405
407
|
className: "grid gap-4 lg:grid-cols-2",
|
|
406
|
-
children: /* @__PURE__ */
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
+
children: /* @__PURE__ */ T("div", { children: [
|
|
409
|
+
/* @__PURE__ */ T("label", {
|
|
408
410
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
409
411
|
children: [
|
|
410
|
-
|
|
412
|
+
h("channel.platformConfig", "Platform Config"),
|
|
411
413
|
" ",
|
|
412
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ w("span", {
|
|
413
415
|
className: "text-[10px] text-text-secondary",
|
|
414
416
|
children: "(JSON)"
|
|
415
417
|
})
|
|
416
418
|
]
|
|
417
419
|
}),
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
"aria-label":
|
|
420
|
-
value:
|
|
421
|
-
onChange: (e) =>
|
|
420
|
+
/* @__PURE__ */ w("textarea", {
|
|
421
|
+
"aria-label": h("channel.platformConfig", "Platform Config"),
|
|
422
|
+
value: S.platformConfig,
|
|
423
|
+
onChange: (e) => j((t) => ({
|
|
422
424
|
...t,
|
|
423
425
|
platformConfig: e.target.value
|
|
424
426
|
})),
|
|
425
427
|
rows: 3,
|
|
426
428
|
className: "w-full px-3 py-2 text-sm bg-surface border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 resize-none font-mono placeholder:text-text-secondary",
|
|
427
|
-
placeholder:
|
|
429
|
+
placeholder: h("channel.platformConfigPlaceholder", "{\"fromEmail\": \"noreply@example.com\"}")
|
|
428
430
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ w("p", {
|
|
430
432
|
className: "mt-1 text-[11px] text-text-secondary",
|
|
431
|
-
children:
|
|
433
|
+
children: h("channel.platformConfigHint", "Platform-specific configuration as JSON")
|
|
432
434
|
})
|
|
433
435
|
] })
|
|
434
436
|
})
|
|
435
437
|
}),
|
|
436
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ T("div", {
|
|
437
439
|
className: "flex items-center justify-between pt-2",
|
|
438
|
-
children: [/* @__PURE__ */
|
|
440
|
+
children: [/* @__PURE__ */ w("button", {
|
|
439
441
|
type: "button",
|
|
440
|
-
onClick: () =>
|
|
442
|
+
onClick: () => l("/channels/list"),
|
|
441
443
|
className: "px-4 py-2 text-sm text-text-secondary hover:text-text-primary hover:bg-surface-hover border border-border-subtle rounded-lg transition-colors",
|
|
442
|
-
children:
|
|
443
|
-
}), /* @__PURE__ */
|
|
444
|
+
children: h("channel.cancel", "Cancel")
|
|
445
|
+
}), /* @__PURE__ */ T("button", {
|
|
444
446
|
type: "submit",
|
|
445
|
-
disabled:
|
|
447
|
+
disabled: g || !S.name.trim(),
|
|
446
448
|
className: "inline-flex items-center gap-2 px-5 py-2 text-sm font-medium text-action-primary-text bg-action-primary-bg hover:bg-action-primary-bg-hover rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
447
|
-
children: [
|
|
449
|
+
children: [g ? /* @__PURE__ */ w(m, {
|
|
448
450
|
size: 16,
|
|
449
451
|
className: "animate-spin"
|
|
450
|
-
}) : /* @__PURE__ */
|
|
452
|
+
}) : /* @__PURE__ */ w(y, { size: 16 }), h("channel.createChannel", "Create Channel")]
|
|
451
453
|
})]
|
|
452
454
|
})
|
|
453
455
|
]
|
|
@@ -457,6 +459,6 @@ function A() {
|
|
|
457
459
|
});
|
|
458
460
|
}
|
|
459
461
|
//#endregion
|
|
460
|
-
export {
|
|
462
|
+
export { j as CreateChannelPage };
|
|
461
463
|
|
|
462
464
|
//# sourceMappingURL=CreateChannelPage.js.map
|