@ixo/editor 1.10.0 → 1.11.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.
|
@@ -772,7 +772,7 @@ function ReusablePanel({ extraTabs, context }) {
|
|
|
772
772
|
}
|
|
773
773
|
];
|
|
774
774
|
const defaultValue = tabs.length > 0 ? tabs[0].value : "conditions";
|
|
775
|
-
return /* @__PURE__ */ React6.createElement(Tabs, { defaultValue }, /* @__PURE__ */ React6.createElement(Tabs.List, null, tabs.map((tab) => /* @__PURE__ */ React6.createElement(Tabs.Tab, { key: tab.value, value: tab.value }, tab.label))), tabs.map((tab) => /* @__PURE__ */ React6.createElement(Tabs.Panel, { key: tab.value, value: tab.value }, tab.content)));
|
|
775
|
+
return /* @__PURE__ */ React6.createElement(Tabs, { defaultValue }, /* @__PURE__ */ React6.createElement(Tabs.List, null, tabs.map((tab) => /* @__PURE__ */ React6.createElement(Tabs.Tab, { key: tab.value, value: tab.value }, tab.label))), tabs.map((tab) => /* @__PURE__ */ React6.createElement(Tabs.Panel, { key: tab.value, value: tab.value, mt: 10 }, tab.content)));
|
|
776
776
|
}
|
|
777
777
|
|
|
778
778
|
// src/mantine/blocks/checkbox/template/GeneralTab.tsx
|
|
@@ -1036,14 +1036,15 @@ import { Card as Card2, Checkbox, Group as Group2, Stack as Stack6, Text as Text
|
|
|
1036
1036
|
|
|
1037
1037
|
// src/mantine/utils/iconMap.tsx
|
|
1038
1038
|
import React9 from "react";
|
|
1039
|
-
import { IconSquareCheck, IconFileText, IconCheckbox, IconNote, IconChecklist, IconThumbUp } from "@tabler/icons-react";
|
|
1039
|
+
import { IconSquareCheck, IconFileText, IconCheckbox, IconNote, IconChecklist, IconThumbUp, IconBell } from "@tabler/icons-react";
|
|
1040
1040
|
var ICON_MAP = {
|
|
1041
1041
|
"square-check": IconSquareCheck,
|
|
1042
1042
|
"file-text": IconFileText,
|
|
1043
1043
|
checklist: IconChecklist,
|
|
1044
1044
|
checkbox: IconCheckbox,
|
|
1045
1045
|
note: IconNote,
|
|
1046
|
-
"thumb-up": IconThumbUp
|
|
1046
|
+
"thumb-up": IconThumbUp,
|
|
1047
|
+
bell: IconBell
|
|
1047
1048
|
};
|
|
1048
1049
|
var getIcon = (key, size = 20, stroke = 1.5, fallback = "square-check") => {
|
|
1049
1050
|
const validKey = key in ICON_MAP ? key : fallback;
|
|
@@ -3276,7 +3277,7 @@ var GeneralTab3 = ({ title, description, onTitleChange, onDescriptionChange }) =
|
|
|
3276
3277
|
|
|
3277
3278
|
// src/mantine/blocks/proposal/template/ActionsTab.tsx
|
|
3278
3279
|
import React74, { useCallback as useCallback11, useEffect as useEffect11, useState as useState16 } from "react";
|
|
3279
|
-
import {
|
|
3280
|
+
import { Card as Card13, Stack as Stack58 } from "@mantine/core";
|
|
3280
3281
|
|
|
3281
3282
|
// src/mantine/blocks/proposal/actions-components/ActionsCard.tsx
|
|
3282
3283
|
import React42 from "react";
|
|
@@ -6001,7 +6002,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
6001
6002
|
}
|
|
6002
6003
|
},
|
|
6003
6004
|
/* @__PURE__ */ React73.createElement(Tabs2.List, null, ACTION_CATEGORIES.map((category) => /* @__PURE__ */ React73.createElement(Tabs2.Tab, { key: category.id, value: category.id }, /* @__PURE__ */ React73.createElement(Group19, { gap: "xs" }, /* @__PURE__ */ React73.createElement("span", null, category.icon), /* @__PURE__ */ React73.createElement("span", null, category.label))))),
|
|
6004
|
-
ACTION_CATEGORIES.map((category) => /* @__PURE__ */ React73.createElement(Tabs2.Panel, { key: category.id, value: category.id }, /* @__PURE__ */ React73.createElement(SimpleGrid, { cols: 2, spacing: "xs" }, (categorizedActions.get(category.id) || []).map((config) => /* @__PURE__ */ React73.createElement(
|
|
6005
|
+
ACTION_CATEGORIES.map((category) => /* @__PURE__ */ React73.createElement(Tabs2.Panel, { key: category.id, value: category.id, mt: 10 }, /* @__PURE__ */ React73.createElement(SimpleGrid, { cols: 2, spacing: "xs" }, (categorizedActions.get(category.id) || []).map((config) => /* @__PURE__ */ React73.createElement(
|
|
6005
6006
|
Paper5,
|
|
6006
6007
|
{
|
|
6007
6008
|
key: config.value,
|
|
@@ -6153,19 +6154,7 @@ var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
|
6153
6154
|
setIsEditorVisible(false);
|
|
6154
6155
|
setEditingIndex(null);
|
|
6155
6156
|
}, []);
|
|
6156
|
-
return /* @__PURE__ */ React74.createElement(Stack58, { gap: "md" }, /* @__PURE__ */ React74.createElement(
|
|
6157
|
-
Button12,
|
|
6158
|
-
{
|
|
6159
|
-
onClick: handleAddAction,
|
|
6160
|
-
style: {
|
|
6161
|
-
backgroundColor: "#4dabf7",
|
|
6162
|
-
"&:hover": {
|
|
6163
|
-
backgroundColor: "#339af0"
|
|
6164
|
-
}
|
|
6165
|
-
}
|
|
6166
|
-
},
|
|
6167
|
-
"Add Action"
|
|
6168
|
-
), /* @__PURE__ */ React74.createElement(ActionsCard, { actions: currentActions, isSelected: false, onClick: () => {
|
|
6157
|
+
return /* @__PURE__ */ React74.createElement(Stack58, { gap: "md" }, /* @__PURE__ */ React74.createElement(ActionsCard, { actions: currentActions, isSelected: false, onClick: () => {
|
|
6169
6158
|
}, onEditAction: handleEditAction, onRemoveAction: handleRemoveAction }), isEditorVisible && /* @__PURE__ */ React74.createElement(
|
|
6170
6159
|
Card13,
|
|
6171
6160
|
{
|
|
@@ -8239,6 +8228,566 @@ var EnumChecklistBlock = createReactBlockSpec6(
|
|
|
8239
8228
|
}
|
|
8240
8229
|
);
|
|
8241
8230
|
|
|
8231
|
+
// src/mantine/blocks/notify/NotifyBlockSpec.tsx
|
|
8232
|
+
import React103 from "react";
|
|
8233
|
+
import { createReactBlockSpec as createReactBlockSpec7 } from "@blocknote/react";
|
|
8234
|
+
|
|
8235
|
+
// src/mantine/blocks/notify/NotifyBlock.tsx
|
|
8236
|
+
import React102 from "react";
|
|
8237
|
+
|
|
8238
|
+
// src/mantine/blocks/notify/template/TemplateView.tsx
|
|
8239
|
+
import React100, { useMemo as useMemo14 } from "react";
|
|
8240
|
+
|
|
8241
|
+
// src/mantine/blocks/notify/template/TemplateConfig.tsx
|
|
8242
|
+
import React99, { useCallback as useCallback17 } from "react";
|
|
8243
|
+
import { Paper as Paper11, CloseButton as CloseButton7, Title as Title7 } from "@mantine/core";
|
|
8244
|
+
|
|
8245
|
+
// src/mantine/blocks/notify/template/GeneralTab.tsx
|
|
8246
|
+
import React98, { useEffect as useEffect17, useState as useState26 } from "react";
|
|
8247
|
+
import { Divider as Divider6, Select as Select11, Stack as Stack74, Text as Text49, TextInput as TextInput36, Textarea as Textarea20, Button as Button24, Group as Group30, ActionIcon as ActionIcon13, Paper as Paper10 } from "@mantine/core";
|
|
8248
|
+
import { IconTrash as IconTrash2, IconPlus as IconPlus2 } from "@tabler/icons-react";
|
|
8249
|
+
var GeneralTab5 = ({
|
|
8250
|
+
title,
|
|
8251
|
+
description,
|
|
8252
|
+
channel,
|
|
8253
|
+
to,
|
|
8254
|
+
cc,
|
|
8255
|
+
bcc,
|
|
8256
|
+
subject,
|
|
8257
|
+
body,
|
|
8258
|
+
bodyType,
|
|
8259
|
+
from,
|
|
8260
|
+
replyTo,
|
|
8261
|
+
onTitleChange,
|
|
8262
|
+
onDescriptionChange,
|
|
8263
|
+
onChannelChange,
|
|
8264
|
+
onToChange,
|
|
8265
|
+
onCcChange,
|
|
8266
|
+
onBccChange,
|
|
8267
|
+
onSubjectChange,
|
|
8268
|
+
onBodyChange,
|
|
8269
|
+
onBodyTypeChange,
|
|
8270
|
+
onFromChange,
|
|
8271
|
+
onReplyToChange
|
|
8272
|
+
}) => {
|
|
8273
|
+
const [localTitle, setLocalTitle] = useState26(title || "");
|
|
8274
|
+
const [localDescription, setLocalDescription] = useState26(description || "");
|
|
8275
|
+
const [localChannel, setLocalChannel] = useState26(channel || "email");
|
|
8276
|
+
const [localTo, setLocalTo] = useState26(to || []);
|
|
8277
|
+
const [localCc, setLocalCc] = useState26(cc || []);
|
|
8278
|
+
const [localBcc, setLocalBcc] = useState26(bcc || []);
|
|
8279
|
+
const [localSubject, setLocalSubject] = useState26(subject || "");
|
|
8280
|
+
const [localBody, setLocalBody] = useState26(body || "");
|
|
8281
|
+
const [localBodyType, setLocalBodyType] = useState26(bodyType || "text");
|
|
8282
|
+
const [localFrom, setLocalFrom] = useState26(from || "");
|
|
8283
|
+
const [localReplyTo, setLocalReplyTo] = useState26(replyTo || "");
|
|
8284
|
+
useEffect17(() => setLocalTitle(title || ""), [title]);
|
|
8285
|
+
useEffect17(() => setLocalDescription(description || ""), [description]);
|
|
8286
|
+
useEffect17(() => setLocalChannel(channel || "email"), [channel]);
|
|
8287
|
+
useEffect17(() => setLocalTo(to || []), [to]);
|
|
8288
|
+
useEffect17(() => setLocalCc(cc || []), [cc]);
|
|
8289
|
+
useEffect17(() => setLocalBcc(bcc || []), [bcc]);
|
|
8290
|
+
useEffect17(() => setLocalSubject(subject || ""), [subject]);
|
|
8291
|
+
useEffect17(() => setLocalBody(body || ""), [body]);
|
|
8292
|
+
useEffect17(() => setLocalBodyType(bodyType || "text"), [bodyType]);
|
|
8293
|
+
useEffect17(() => setLocalFrom(from || ""), [from]);
|
|
8294
|
+
useEffect17(() => setLocalReplyTo(replyTo || ""), [replyTo]);
|
|
8295
|
+
const handleAddRecipient = (type) => {
|
|
8296
|
+
const setter = type === "to" ? setLocalTo : type === "cc" ? setLocalCc : setLocalBcc;
|
|
8297
|
+
const callback = type === "to" ? onToChange : type === "cc" ? onCcChange : onBccChange;
|
|
8298
|
+
const current = type === "to" ? localTo : type === "cc" ? localCc : localBcc;
|
|
8299
|
+
const newRecipients = [...current, ""];
|
|
8300
|
+
setter(newRecipients);
|
|
8301
|
+
callback(newRecipients);
|
|
8302
|
+
};
|
|
8303
|
+
const handleRemoveRecipient = (type, index) => {
|
|
8304
|
+
const setter = type === "to" ? setLocalTo : type === "cc" ? setLocalCc : setLocalBcc;
|
|
8305
|
+
const callback = type === "to" ? onToChange : type === "cc" ? onCcChange : onBccChange;
|
|
8306
|
+
const current = type === "to" ? localTo : type === "cc" ? localCc : localBcc;
|
|
8307
|
+
const newRecipients = current.filter((_, i) => i !== index);
|
|
8308
|
+
setter(newRecipients);
|
|
8309
|
+
callback(newRecipients);
|
|
8310
|
+
};
|
|
8311
|
+
const handleRecipientChange = (type, index, value) => {
|
|
8312
|
+
const setter = type === "to" ? setLocalTo : type === "cc" ? setLocalCc : setLocalBcc;
|
|
8313
|
+
const callback = type === "to" ? onToChange : type === "cc" ? onCcChange : onBccChange;
|
|
8314
|
+
const current = type === "to" ? localTo : type === "cc" ? localCc : localBcc;
|
|
8315
|
+
const newRecipients = [...current];
|
|
8316
|
+
newRecipients[index] = value;
|
|
8317
|
+
setter(newRecipients);
|
|
8318
|
+
callback(newRecipients);
|
|
8319
|
+
};
|
|
8320
|
+
return /* @__PURE__ */ React98.createElement(Stack74, { gap: "lg" }, /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React98.createElement(
|
|
8321
|
+
TextInput36,
|
|
8322
|
+
{
|
|
8323
|
+
placeholder: "e.g. Welcome Email",
|
|
8324
|
+
value: localTitle,
|
|
8325
|
+
onChange: (event) => {
|
|
8326
|
+
const newTitle = event.currentTarget.value;
|
|
8327
|
+
setLocalTitle(newTitle);
|
|
8328
|
+
onTitleChange(newTitle);
|
|
8329
|
+
}
|
|
8330
|
+
}
|
|
8331
|
+
)), /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React98.createElement(
|
|
8332
|
+
Textarea20,
|
|
8333
|
+
{
|
|
8334
|
+
placeholder: "Describe what this notification does",
|
|
8335
|
+
minRows: 2,
|
|
8336
|
+
value: localDescription,
|
|
8337
|
+
onChange: (event) => {
|
|
8338
|
+
const newDescription = event.currentTarget.value;
|
|
8339
|
+
setLocalDescription(newDescription);
|
|
8340
|
+
onDescriptionChange(newDescription);
|
|
8341
|
+
}
|
|
8342
|
+
}
|
|
8343
|
+
)), /* @__PURE__ */ React98.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 600 }, "Channel"), /* @__PURE__ */ React98.createElement(
|
|
8344
|
+
Select11,
|
|
8345
|
+
{
|
|
8346
|
+
value: localChannel,
|
|
8347
|
+
onChange: (value) => {
|
|
8348
|
+
const newChannel = value || "email";
|
|
8349
|
+
setLocalChannel(newChannel);
|
|
8350
|
+
onChannelChange(newChannel);
|
|
8351
|
+
},
|
|
8352
|
+
data: [
|
|
8353
|
+
{ value: "email", label: "Email" },
|
|
8354
|
+
{ value: "sms", label: "SMS (Coming Soon)", disabled: true },
|
|
8355
|
+
{ value: "whatsapp", label: "WhatsApp (Coming Soon)", disabled: true },
|
|
8356
|
+
{ value: "rcs", label: "RCS (Coming Soon)", disabled: true }
|
|
8357
|
+
]
|
|
8358
|
+
}
|
|
8359
|
+
)), /* @__PURE__ */ React98.createElement(Divider6, { variant: "dashed" }), localChannel === "email" && /* @__PURE__ */ React98.createElement(React98.Fragment, null, /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, /* @__PURE__ */ React98.createElement(Group30, { justify: "space-between" }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 600 }, "To (Recipients)"), /* @__PURE__ */ React98.createElement(Button24, { size: "xs", leftSection: /* @__PURE__ */ React98.createElement(IconPlus2, { size: 14 }), onClick: () => handleAddRecipient("to") }, "Add")), localTo.length === 0 && /* @__PURE__ */ React98.createElement(Text49, { size: "xs", c: "dimmed" }, "No recipients added yet"), /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, localTo.map((recipient, index) => /* @__PURE__ */ React98.createElement(Paper10, { key: index, p: "xs", withBorder: true }, /* @__PURE__ */ React98.createElement(Group30, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React98.createElement(TextInput36, { style: { flex: 1 }, placeholder: "email@example.com", value: recipient, onChange: (e) => handleRecipientChange("to", index, e.currentTarget.value) }), /* @__PURE__ */ React98.createElement(ActionIcon13, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("to", index) }, /* @__PURE__ */ React98.createElement(IconTrash2, { size: 16 }))))))), /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, /* @__PURE__ */ React98.createElement(Group30, { justify: "space-between" }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 600 }, "CC (Optional)"), /* @__PURE__ */ React98.createElement(Button24, { size: "xs", leftSection: /* @__PURE__ */ React98.createElement(IconPlus2, { size: 14 }), onClick: () => handleAddRecipient("cc") }, "Add")), localCc.length > 0 && /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, localCc.map((recipient, index) => /* @__PURE__ */ React98.createElement(Paper10, { key: index, p: "xs", withBorder: true }, /* @__PURE__ */ React98.createElement(Group30, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React98.createElement(
|
|
8360
|
+
TextInput36,
|
|
8361
|
+
{
|
|
8362
|
+
style: { flex: 1 },
|
|
8363
|
+
placeholder: "email@example.com",
|
|
8364
|
+
value: recipient,
|
|
8365
|
+
onChange: (e) => handleRecipientChange("cc", index, e.currentTarget.value)
|
|
8366
|
+
}
|
|
8367
|
+
), /* @__PURE__ */ React98.createElement(ActionIcon13, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("cc", index) }, /* @__PURE__ */ React98.createElement(IconTrash2, { size: 16 }))))))), /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, /* @__PURE__ */ React98.createElement(Group30, { justify: "space-between" }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 600 }, "BCC (Optional)"), /* @__PURE__ */ React98.createElement(Button24, { size: "xs", leftSection: /* @__PURE__ */ React98.createElement(IconPlus2, { size: 14 }), onClick: () => handleAddRecipient("bcc") }, "Add")), localBcc.length > 0 && /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, localBcc.map((recipient, index) => /* @__PURE__ */ React98.createElement(Paper10, { key: index, p: "xs", withBorder: true }, /* @__PURE__ */ React98.createElement(Group30, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React98.createElement(
|
|
8368
|
+
TextInput36,
|
|
8369
|
+
{
|
|
8370
|
+
style: { flex: 1 },
|
|
8371
|
+
placeholder: "email@example.com",
|
|
8372
|
+
value: recipient,
|
|
8373
|
+
onChange: (e) => handleRecipientChange("bcc", index, e.currentTarget.value)
|
|
8374
|
+
}
|
|
8375
|
+
), /* @__PURE__ */ React98.createElement(ActionIcon13, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("bcc", index) }, /* @__PURE__ */ React98.createElement(IconTrash2, { size: 16 }))))))), /* @__PURE__ */ React98.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 600 }, "From (Optional)"), /* @__PURE__ */ React98.createElement(
|
|
8376
|
+
TextInput36,
|
|
8377
|
+
{
|
|
8378
|
+
placeholder: "sender@example.com",
|
|
8379
|
+
value: localFrom,
|
|
8380
|
+
onChange: (event) => {
|
|
8381
|
+
const newFrom = event.currentTarget.value;
|
|
8382
|
+
setLocalFrom(newFrom);
|
|
8383
|
+
onFromChange(newFrom);
|
|
8384
|
+
}
|
|
8385
|
+
}
|
|
8386
|
+
), /* @__PURE__ */ React98.createElement(Text49, { size: "xs", c: "dimmed" }, "Custom sender email address")), /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 600 }, "Reply-To (Optional)"), /* @__PURE__ */ React98.createElement(
|
|
8387
|
+
TextInput36,
|
|
8388
|
+
{
|
|
8389
|
+
placeholder: "reply@example.com",
|
|
8390
|
+
value: localReplyTo,
|
|
8391
|
+
onChange: (event) => {
|
|
8392
|
+
const newReplyTo = event.currentTarget.value;
|
|
8393
|
+
setLocalReplyTo(newReplyTo);
|
|
8394
|
+
onReplyToChange(newReplyTo);
|
|
8395
|
+
}
|
|
8396
|
+
}
|
|
8397
|
+
), /* @__PURE__ */ React98.createElement(Text49, { size: "xs", c: "dimmed" }, "Where replies should be sent")), /* @__PURE__ */ React98.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 600 }, "Subject"), /* @__PURE__ */ React98.createElement(
|
|
8398
|
+
TextInput36,
|
|
8399
|
+
{
|
|
8400
|
+
placeholder: "Email subject line",
|
|
8401
|
+
value: localSubject,
|
|
8402
|
+
onChange: (event) => {
|
|
8403
|
+
const newSubject = event.currentTarget.value;
|
|
8404
|
+
setLocalSubject(newSubject);
|
|
8405
|
+
onSubjectChange(newSubject);
|
|
8406
|
+
}
|
|
8407
|
+
}
|
|
8408
|
+
)), /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 600 }, "Body Type"), /* @__PURE__ */ React98.createElement(
|
|
8409
|
+
Select11,
|
|
8410
|
+
{
|
|
8411
|
+
value: localBodyType,
|
|
8412
|
+
onChange: (value) => {
|
|
8413
|
+
const newBodyType = value || "text";
|
|
8414
|
+
setLocalBodyType(newBodyType);
|
|
8415
|
+
onBodyTypeChange(newBodyType);
|
|
8416
|
+
},
|
|
8417
|
+
data: [
|
|
8418
|
+
{ value: "text", label: "Plain Text" },
|
|
8419
|
+
{ value: "html", label: "HTML" }
|
|
8420
|
+
]
|
|
8421
|
+
}
|
|
8422
|
+
)), /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 600 }, "Body"), /* @__PURE__ */ React98.createElement(
|
|
8423
|
+
Textarea20,
|
|
8424
|
+
{
|
|
8425
|
+
placeholder: localBodyType === "html" ? "<h1>Hello!</h1><p>Welcome to our service.</p>" : "Email body content",
|
|
8426
|
+
minRows: 6,
|
|
8427
|
+
value: localBody,
|
|
8428
|
+
onChange: (event) => {
|
|
8429
|
+
const newBody = event.currentTarget.value;
|
|
8430
|
+
setLocalBody(newBody);
|
|
8431
|
+
onBodyChange(newBody);
|
|
8432
|
+
}
|
|
8433
|
+
}
|
|
8434
|
+
), /* @__PURE__ */ React98.createElement(Text49, { size: "xs", c: "dimmed" }, localBodyType === "html" ? "HTML content for the email body" : "Plain text content for the email body"))));
|
|
8435
|
+
};
|
|
8436
|
+
|
|
8437
|
+
// src/mantine/blocks/notify/template/TemplateConfig.tsx
|
|
8438
|
+
var TemplateConfig5 = ({ editor, block }) => {
|
|
8439
|
+
const { closePanel } = usePanelStore();
|
|
8440
|
+
const updateProp = useCallback17(
|
|
8441
|
+
(key, value) => {
|
|
8442
|
+
editor.updateBlock(block, {
|
|
8443
|
+
props: {
|
|
8444
|
+
...block.props,
|
|
8445
|
+
[key]: value
|
|
8446
|
+
}
|
|
8447
|
+
});
|
|
8448
|
+
},
|
|
8449
|
+
[editor, block]
|
|
8450
|
+
);
|
|
8451
|
+
const handleToChange = useCallback17(
|
|
8452
|
+
(to) => {
|
|
8453
|
+
updateProp("to", JSON.stringify(to));
|
|
8454
|
+
},
|
|
8455
|
+
[updateProp]
|
|
8456
|
+
);
|
|
8457
|
+
const handleCcChange = useCallback17(
|
|
8458
|
+
(cc) => {
|
|
8459
|
+
updateProp("cc", JSON.stringify(cc));
|
|
8460
|
+
},
|
|
8461
|
+
[updateProp]
|
|
8462
|
+
);
|
|
8463
|
+
const handleBccChange = useCallback17(
|
|
8464
|
+
(bcc) => {
|
|
8465
|
+
updateProp("bcc", JSON.stringify(bcc));
|
|
8466
|
+
},
|
|
8467
|
+
[updateProp]
|
|
8468
|
+
);
|
|
8469
|
+
return /* @__PURE__ */ React99.createElement(
|
|
8470
|
+
Paper11,
|
|
8471
|
+
{
|
|
8472
|
+
p: "md",
|
|
8473
|
+
shadow: "sm",
|
|
8474
|
+
style: {
|
|
8475
|
+
height: "100%",
|
|
8476
|
+
display: "flex",
|
|
8477
|
+
flexDirection: "column"
|
|
8478
|
+
}
|
|
8479
|
+
},
|
|
8480
|
+
/* @__PURE__ */ React99.createElement(
|
|
8481
|
+
"div",
|
|
8482
|
+
{
|
|
8483
|
+
style: {
|
|
8484
|
+
display: "flex",
|
|
8485
|
+
justifyContent: "space-between",
|
|
8486
|
+
alignItems: "center",
|
|
8487
|
+
marginBottom: "1rem"
|
|
8488
|
+
}
|
|
8489
|
+
},
|
|
8490
|
+
/* @__PURE__ */ React99.createElement(Title7, { order: 3 }, "Notification Settings"),
|
|
8491
|
+
/* @__PURE__ */ React99.createElement(CloseButton7, { onClick: closePanel })
|
|
8492
|
+
),
|
|
8493
|
+
/* @__PURE__ */ React99.createElement(
|
|
8494
|
+
ReusablePanel,
|
|
8495
|
+
{
|
|
8496
|
+
extraTabs: [
|
|
8497
|
+
{
|
|
8498
|
+
label: "General",
|
|
8499
|
+
value: "general",
|
|
8500
|
+
content: /* @__PURE__ */ React99.createElement(
|
|
8501
|
+
GeneralTab5,
|
|
8502
|
+
{
|
|
8503
|
+
title: block.props.title || "",
|
|
8504
|
+
description: block.props.description || "",
|
|
8505
|
+
channel: block.props.channel || "email",
|
|
8506
|
+
to: (() => {
|
|
8507
|
+
try {
|
|
8508
|
+
return typeof block.props.to === "string" ? JSON.parse(block.props.to) : block.props.to || [];
|
|
8509
|
+
} catch {
|
|
8510
|
+
return [];
|
|
8511
|
+
}
|
|
8512
|
+
})(),
|
|
8513
|
+
cc: (() => {
|
|
8514
|
+
try {
|
|
8515
|
+
return typeof block.props.cc === "string" ? JSON.parse(block.props.cc) : block.props.cc || [];
|
|
8516
|
+
} catch {
|
|
8517
|
+
return [];
|
|
8518
|
+
}
|
|
8519
|
+
})(),
|
|
8520
|
+
bcc: (() => {
|
|
8521
|
+
try {
|
|
8522
|
+
return typeof block.props.bcc === "string" ? JSON.parse(block.props.bcc) : block.props.bcc || [];
|
|
8523
|
+
} catch {
|
|
8524
|
+
return [];
|
|
8525
|
+
}
|
|
8526
|
+
})(),
|
|
8527
|
+
subject: block.props.subject || "",
|
|
8528
|
+
body: block.props.body || "",
|
|
8529
|
+
bodyType: block.props.bodyType || "text",
|
|
8530
|
+
from: block.props.from || "",
|
|
8531
|
+
replyTo: block.props.replyTo || "",
|
|
8532
|
+
onTitleChange: (value) => updateProp("title", value),
|
|
8533
|
+
onDescriptionChange: (value) => updateProp("description", value),
|
|
8534
|
+
onChannelChange: (value) => updateProp("channel", value),
|
|
8535
|
+
onToChange: handleToChange,
|
|
8536
|
+
onCcChange: handleCcChange,
|
|
8537
|
+
onBccChange: handleBccChange,
|
|
8538
|
+
onSubjectChange: (value) => updateProp("subject", value),
|
|
8539
|
+
onBodyChange: (value) => updateProp("body", value),
|
|
8540
|
+
onBodyTypeChange: (value) => updateProp("bodyType", value),
|
|
8541
|
+
onFromChange: (value) => updateProp("from", value),
|
|
8542
|
+
onReplyToChange: (value) => updateProp("replyTo", value)
|
|
8543
|
+
}
|
|
8544
|
+
)
|
|
8545
|
+
}
|
|
8546
|
+
],
|
|
8547
|
+
context: { editor, block }
|
|
8548
|
+
}
|
|
8549
|
+
)
|
|
8550
|
+
);
|
|
8551
|
+
};
|
|
8552
|
+
|
|
8553
|
+
// src/mantine/blocks/notify/template/TemplateView.tsx
|
|
8554
|
+
import { Card as Card22, Group as Group31, Stack as Stack75, Text as Text50, ActionIcon as ActionIcon14, Badge as Badge12 } from "@mantine/core";
|
|
8555
|
+
var NOTIFY_TEMPLATE_PANEL_ID = "notify-template-panel";
|
|
8556
|
+
var NotifyTemplateView = ({ editor, block }) => {
|
|
8557
|
+
const panelId = `${NOTIFY_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
8558
|
+
const panelContent = useMemo14(() => /* @__PURE__ */ React100.createElement(TemplateConfig5, { editor, block }), [editor, block]);
|
|
8559
|
+
const { open } = usePanel(panelId, panelContent);
|
|
8560
|
+
const channel = block.props.channel || "email";
|
|
8561
|
+
const to = (() => {
|
|
8562
|
+
try {
|
|
8563
|
+
const parsed = typeof block.props.to === "string" ? JSON.parse(block.props.to) : block.props.to;
|
|
8564
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
8565
|
+
} catch {
|
|
8566
|
+
return [];
|
|
8567
|
+
}
|
|
8568
|
+
})();
|
|
8569
|
+
const getChannelColor = (channel2) => {
|
|
8570
|
+
switch (channel2) {
|
|
8571
|
+
case "email":
|
|
8572
|
+
return "blue";
|
|
8573
|
+
case "sms":
|
|
8574
|
+
return "green";
|
|
8575
|
+
case "whatsapp":
|
|
8576
|
+
return "teal";
|
|
8577
|
+
case "rcs":
|
|
8578
|
+
return "violet";
|
|
8579
|
+
default:
|
|
8580
|
+
return "gray";
|
|
8581
|
+
}
|
|
8582
|
+
};
|
|
8583
|
+
return /* @__PURE__ */ React100.createElement(Card22, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React100.createElement(Badge12, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React100.createElement(Group31, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React100.createElement(Group31, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React100.createElement(ActionIcon14, { variant: "light", color: getChannelColor(channel), size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "bell")), /* @__PURE__ */ React100.createElement(Stack75, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React100.createElement(Group31, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React100.createElement(Badge12, { size: "sm", variant: "filled", color: getChannelColor(channel) }, channel.toUpperCase()), /* @__PURE__ */ React100.createElement(Text50, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Notification")), /* @__PURE__ */ React100.createElement(Text50, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, to.length > 0 ? `To: ${to.join(", ")}` : "Click to configure recipients"), block.props.description && /* @__PURE__ */ React100.createElement(Text50, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description)))));
|
|
8584
|
+
};
|
|
8585
|
+
|
|
8586
|
+
// src/mantine/blocks/notify/flow/FlowView.tsx
|
|
8587
|
+
import React101, { useState as useState27 } from "react";
|
|
8588
|
+
import { Card as Card23, Group as Group32, Stack as Stack76, Text as Text51, ActionIcon as ActionIcon15, Tooltip as Tooltip5, Button as Button25, Badge as Badge13, Collapse as Collapse2, Alert as Alert10, Loader as Loader4, Code as Code2 } from "@mantine/core";
|
|
8589
|
+
import { IconSend as IconSend2, IconChevronDown as IconChevronDown2, IconChevronUp as IconChevronUp2, IconCheck, IconX } from "@tabler/icons-react";
|
|
8590
|
+
var NotifyFlowView = ({ editor, block, isDisabled }) => {
|
|
8591
|
+
const disabled = isDisabled?.isDisabled === "disable";
|
|
8592
|
+
const [isLoading, setIsLoading] = useState27(false);
|
|
8593
|
+
const [showDetails, setShowDetails] = useState27(false);
|
|
8594
|
+
let handlers = null;
|
|
8595
|
+
try {
|
|
8596
|
+
handlers = useBlocknoteHandlers();
|
|
8597
|
+
} catch {
|
|
8598
|
+
handlers = null;
|
|
8599
|
+
}
|
|
8600
|
+
const channel = block.props.channel || "email";
|
|
8601
|
+
const status = block.props.status || "idle";
|
|
8602
|
+
const to = (() => {
|
|
8603
|
+
try {
|
|
8604
|
+
return typeof block.props.to === "string" ? JSON.parse(block.props.to) : block.props.to || [];
|
|
8605
|
+
} catch {
|
|
8606
|
+
return [];
|
|
8607
|
+
}
|
|
8608
|
+
})();
|
|
8609
|
+
const cc = (() => {
|
|
8610
|
+
try {
|
|
8611
|
+
return typeof block.props.cc === "string" ? JSON.parse(block.props.cc) : block.props.cc || [];
|
|
8612
|
+
} catch {
|
|
8613
|
+
return [];
|
|
8614
|
+
}
|
|
8615
|
+
})();
|
|
8616
|
+
const bcc = (() => {
|
|
8617
|
+
try {
|
|
8618
|
+
return typeof block.props.bcc === "string" ? JSON.parse(block.props.bcc) : block.props.bcc || [];
|
|
8619
|
+
} catch {
|
|
8620
|
+
return [];
|
|
8621
|
+
}
|
|
8622
|
+
})();
|
|
8623
|
+
const getChannelColor = (channel2) => {
|
|
8624
|
+
switch (channel2) {
|
|
8625
|
+
case "email":
|
|
8626
|
+
return "blue";
|
|
8627
|
+
case "sms":
|
|
8628
|
+
return "green";
|
|
8629
|
+
case "whatsapp":
|
|
8630
|
+
return "teal";
|
|
8631
|
+
case "rcs":
|
|
8632
|
+
return "violet";
|
|
8633
|
+
default:
|
|
8634
|
+
return "gray";
|
|
8635
|
+
}
|
|
8636
|
+
};
|
|
8637
|
+
const getStatusColor = (status2) => {
|
|
8638
|
+
switch (status2) {
|
|
8639
|
+
case "sent":
|
|
8640
|
+
return "green";
|
|
8641
|
+
case "failed":
|
|
8642
|
+
return "red";
|
|
8643
|
+
case "sending":
|
|
8644
|
+
return "blue";
|
|
8645
|
+
default:
|
|
8646
|
+
return "gray";
|
|
8647
|
+
}
|
|
8648
|
+
};
|
|
8649
|
+
const handleSendNotification = async () => {
|
|
8650
|
+
if (disabled || !handlers || to.length === 0) return;
|
|
8651
|
+
setIsLoading(true);
|
|
8652
|
+
editor.updateBlock(block, {
|
|
8653
|
+
props: { ...block.props, status: "sending", errorMessage: "" }
|
|
8654
|
+
});
|
|
8655
|
+
try {
|
|
8656
|
+
if (channel === "email") {
|
|
8657
|
+
const params = {
|
|
8658
|
+
channel: "email",
|
|
8659
|
+
to: to.filter((email) => email.trim() !== ""),
|
|
8660
|
+
cc: cc.filter((email) => email.trim() !== ""),
|
|
8661
|
+
bcc: bcc.filter((email) => email.trim() !== ""),
|
|
8662
|
+
subject: block.props.subject || "",
|
|
8663
|
+
body: block.props.body || "",
|
|
8664
|
+
bodyType: block.props.bodyType || "text",
|
|
8665
|
+
from: block.props.from || void 0,
|
|
8666
|
+
replyTo: block.props.replyTo || void 0
|
|
8667
|
+
};
|
|
8668
|
+
if (params.cc?.length === 0) delete params.cc;
|
|
8669
|
+
if (params.bcc?.length === 0) delete params.bcc;
|
|
8670
|
+
const response = await handlers.sendNotification(params);
|
|
8671
|
+
editor.updateBlock(block, {
|
|
8672
|
+
props: {
|
|
8673
|
+
...block.props,
|
|
8674
|
+
status: "sent",
|
|
8675
|
+
messageId: response.messageId,
|
|
8676
|
+
sentAt: response.timestamp,
|
|
8677
|
+
errorMessage: ""
|
|
8678
|
+
}
|
|
8679
|
+
});
|
|
8680
|
+
}
|
|
8681
|
+
} catch (error) {
|
|
8682
|
+
editor.updateBlock(block, {
|
|
8683
|
+
props: {
|
|
8684
|
+
...block.props,
|
|
8685
|
+
status: "failed",
|
|
8686
|
+
errorMessage: error instanceof Error ? error.message : "Failed to send notification"
|
|
8687
|
+
}
|
|
8688
|
+
});
|
|
8689
|
+
} finally {
|
|
8690
|
+
setIsLoading(false);
|
|
8691
|
+
}
|
|
8692
|
+
};
|
|
8693
|
+
const canSend = !disabled && !isLoading && handlers && to.length > 0 && (channel === "email" ? block.props.subject && block.props.body : true);
|
|
8694
|
+
const sendButton = /* @__PURE__ */ React101.createElement(
|
|
8695
|
+
Button25,
|
|
8696
|
+
{
|
|
8697
|
+
size: "sm",
|
|
8698
|
+
variant: "light",
|
|
8699
|
+
color: getChannelColor(channel),
|
|
8700
|
+
leftSection: isLoading ? /* @__PURE__ */ React101.createElement(Loader4, { size: 14 }) : status === "sent" ? /* @__PURE__ */ React101.createElement(IconCheck, { size: 14 }) : /* @__PURE__ */ React101.createElement(IconSend2, { size: 14 }),
|
|
8701
|
+
onClick: handleSendNotification,
|
|
8702
|
+
disabled: !canSend,
|
|
8703
|
+
style: { flexShrink: 0 }
|
|
8704
|
+
},
|
|
8705
|
+
isLoading ? "Sending..." : status === "sent" ? "Sent" : "Send"
|
|
8706
|
+
);
|
|
8707
|
+
return /* @__PURE__ */ React101.createElement(Card23, { withBorder: true, padding: "md", radius: "md", style: { width: "100%" } }, /* @__PURE__ */ React101.createElement(Stack76, { gap: "md" }, /* @__PURE__ */ React101.createElement(Group32, { wrap: "nowrap", justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React101.createElement(Group32, { wrap: "nowrap", align: "flex-start", style: { flex: 1 } }, /* @__PURE__ */ React101.createElement(ActionIcon15, { variant: "light", color: getChannelColor(channel), size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "bell")), /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React101.createElement(Group32, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React101.createElement(Badge13, { size: "sm", variant: "filled", color: getChannelColor(channel) }, channel.toUpperCase()), /* @__PURE__ */ React101.createElement(Text51, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Notification"), status !== "idle" && /* @__PURE__ */ React101.createElement(Badge13, { size: "xs", variant: "dot", color: getStatusColor(status) }, status)), /* @__PURE__ */ React101.createElement(Text51, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, to.length > 0 ? `To: ${to.slice(0, 2).join(", ")}${to.length > 2 ? ` +${to.length - 2} more` : ""}` : "No recipients"), block.props.description && /* @__PURE__ */ React101.createElement(Text51, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), /* @__PURE__ */ React101.createElement(Group32, { gap: "xs", style: { flexShrink: 0 } }, disabled && isDisabled?.message ? /* @__PURE__ */ React101.createElement(Tooltip5, { label: isDisabled.message, position: "left", withArrow: true }, sendButton) : sendButton, /* @__PURE__ */ React101.createElement(ActionIcon15, { variant: "subtle", onClick: () => setShowDetails(!showDetails) }, showDetails ? /* @__PURE__ */ React101.createElement(IconChevronUp2, { size: 16 }) : /* @__PURE__ */ React101.createElement(IconChevronDown2, { size: 16 })))), status === "failed" && block.props.errorMessage && /* @__PURE__ */ React101.createElement(Alert10, { color: "red", icon: /* @__PURE__ */ React101.createElement(IconX, { size: 16 }), title: "Failed to send", styles: { message: { fontSize: "12px" } } }, block.props.errorMessage), status === "sent" && block.props.messageId && /* @__PURE__ */ React101.createElement(Alert10, { color: "green", icon: /* @__PURE__ */ React101.createElement(IconCheck, { size: 16 }), title: "Sent successfully", styles: { message: { fontSize: "12px" } } }, "Message ID: ", block.props.messageId, block.props.sentAt && /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement("br", null), "Sent at: ", new Date(block.props.sentAt).toLocaleString())), /* @__PURE__ */ React101.createElement(Collapse2, { in: showDetails }, /* @__PURE__ */ React101.createElement(Stack76, { gap: "md" }, channel === "email" && /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Text51, { size: "xs", fw: 600, c: "dimmed" }, "Recipients:"), /* @__PURE__ */ React101.createElement(Code2, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
|
|
8708
|
+
{
|
|
8709
|
+
to: to.filter((e) => e.trim() !== ""),
|
|
8710
|
+
...cc.length > 0 && { cc: cc.filter((e) => e.trim() !== "") },
|
|
8711
|
+
...bcc.length > 0 && { bcc: bcc.filter((e) => e.trim() !== "") }
|
|
8712
|
+
},
|
|
8713
|
+
null,
|
|
8714
|
+
2
|
|
8715
|
+
))), block.props.subject && /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Text51, { size: "xs", fw: 600, c: "dimmed" }, "Subject:"), /* @__PURE__ */ React101.createElement(Text51, { size: "xs" }, block.props.subject)), block.props.body && /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Text51, { size: "xs", fw: 600, c: "dimmed" }, "Body (", block.props.bodyType || "text", "):"), /* @__PURE__ */ React101.createElement(Code2, { block: true, style: { fontSize: "11px", maxHeight: "200px", overflow: "auto" } }, block.props.body)), (block.props.from || block.props.replyTo) && /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Text51, { size: "xs", fw: 600, c: "dimmed" }, "Additional:"), /* @__PURE__ */ React101.createElement(Code2, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
|
|
8716
|
+
{
|
|
8717
|
+
...block.props.from && { from: block.props.from },
|
|
8718
|
+
...block.props.replyTo && { replyTo: block.props.replyTo }
|
|
8719
|
+
},
|
|
8720
|
+
null,
|
|
8721
|
+
2
|
|
8722
|
+
))))))));
|
|
8723
|
+
};
|
|
8724
|
+
|
|
8725
|
+
// src/mantine/blocks/notify/NotifyBlock.tsx
|
|
8726
|
+
function NotifyBlock({ editor, block }) {
|
|
8727
|
+
const { editable } = useBlocknoteContext();
|
|
8728
|
+
const { actions } = useBlockConditions(block, editor);
|
|
8729
|
+
if (editable) {
|
|
8730
|
+
return /* @__PURE__ */ React102.createElement(NotifyTemplateView, { editor, block });
|
|
8731
|
+
}
|
|
8732
|
+
const conditionConfig = parseConditionConfig(block.props.conditions);
|
|
8733
|
+
const hasVisibility = hasVisibilityConditions(conditionConfig);
|
|
8734
|
+
const showActionExists = actions.some((a) => a.action === "show");
|
|
8735
|
+
const shouldHide = hasVisibility && !showActionExists;
|
|
8736
|
+
if (shouldHide) {
|
|
8737
|
+
return null;
|
|
8738
|
+
}
|
|
8739
|
+
const hasEnable = hasEnableConditions(conditionConfig);
|
|
8740
|
+
const enableActionExists = actions.some((a) => a.action === "enable");
|
|
8741
|
+
const shouldDisable = hasEnable && !enableActionExists;
|
|
8742
|
+
return /* @__PURE__ */ React102.createElement(NotifyFlowView, { block, editor, isDisabled: shouldDisable ? { isDisabled: "disable", message: "Notification disabled by conditions" } : void 0 });
|
|
8743
|
+
}
|
|
8744
|
+
|
|
8745
|
+
// src/mantine/blocks/notify/NotifyBlockSpec.tsx
|
|
8746
|
+
var NotifyBlockSpec = createReactBlockSpec7(
|
|
8747
|
+
{
|
|
8748
|
+
type: "notify",
|
|
8749
|
+
propSchema: {
|
|
8750
|
+
title: { default: "" },
|
|
8751
|
+
description: { default: "" },
|
|
8752
|
+
icon: { default: "bell" },
|
|
8753
|
+
// Notification channel configuration
|
|
8754
|
+
channel: { default: "email" },
|
|
8755
|
+
// Email-specific fields
|
|
8756
|
+
to: { default: "[]" },
|
|
8757
|
+
// JSON array of recipients
|
|
8758
|
+
cc: { default: "[]" },
|
|
8759
|
+
// JSON array of CC recipients
|
|
8760
|
+
bcc: { default: "[]" },
|
|
8761
|
+
// JSON array of BCC recipients
|
|
8762
|
+
subject: { default: "" },
|
|
8763
|
+
body: { default: "" },
|
|
8764
|
+
bodyType: { default: "text" },
|
|
8765
|
+
// 'text' or 'html'
|
|
8766
|
+
from: { default: "" },
|
|
8767
|
+
replyTo: { default: "" },
|
|
8768
|
+
// SMS/WhatsApp fields
|
|
8769
|
+
templateId: { default: "" },
|
|
8770
|
+
templateVariables: { default: "{}" },
|
|
8771
|
+
// JSON object
|
|
8772
|
+
// Execution status
|
|
8773
|
+
status: { default: "idle" },
|
|
8774
|
+
// 'idle', 'sending', 'sent', 'failed'
|
|
8775
|
+
messageId: { default: "" },
|
|
8776
|
+
sentAt: { default: "" },
|
|
8777
|
+
errorMessage: { default: "" },
|
|
8778
|
+
// Conditions
|
|
8779
|
+
conditions: { default: "" }
|
|
8780
|
+
},
|
|
8781
|
+
content: "inline"
|
|
8782
|
+
},
|
|
8783
|
+
{
|
|
8784
|
+
render: (props) => {
|
|
8785
|
+
const ixoProps = props;
|
|
8786
|
+
return /* @__PURE__ */ React103.createElement(NotifyBlock, { ...ixoProps });
|
|
8787
|
+
}
|
|
8788
|
+
}
|
|
8789
|
+
);
|
|
8790
|
+
|
|
8242
8791
|
// src/mantine/blocks/registry/blockRegistry.ts
|
|
8243
8792
|
var BlockRegistry = class {
|
|
8244
8793
|
constructor() {
|
|
@@ -8332,12 +8881,43 @@ blockRegistry.register({
|
|
|
8332
8881
|
validDependencies: [],
|
|
8333
8882
|
defaultProps: {}
|
|
8334
8883
|
});
|
|
8884
|
+
blockRegistry.register({
|
|
8885
|
+
type: "notify",
|
|
8886
|
+
propSchema: {
|
|
8887
|
+
title: "",
|
|
8888
|
+
description: "",
|
|
8889
|
+
icon: "bell",
|
|
8890
|
+
channel: "email",
|
|
8891
|
+
to: "[]",
|
|
8892
|
+
cc: "[]",
|
|
8893
|
+
bcc: "[]",
|
|
8894
|
+
subject: "",
|
|
8895
|
+
body: "",
|
|
8896
|
+
bodyType: "text",
|
|
8897
|
+
from: "",
|
|
8898
|
+
replyTo: "",
|
|
8899
|
+
templateId: "",
|
|
8900
|
+
templateVariables: "{}",
|
|
8901
|
+
status: "idle",
|
|
8902
|
+
messageId: "",
|
|
8903
|
+
sentAt: "",
|
|
8904
|
+
errorMessage: "",
|
|
8905
|
+
conditions: ""
|
|
8906
|
+
},
|
|
8907
|
+
validDependencies: [],
|
|
8908
|
+
defaultProps: {
|
|
8909
|
+
icon: "bell",
|
|
8910
|
+
channel: "email",
|
|
8911
|
+
bodyType: "text",
|
|
8912
|
+
status: "idle"
|
|
8913
|
+
}
|
|
8914
|
+
});
|
|
8335
8915
|
|
|
8336
8916
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
8337
|
-
import { useMemo as
|
|
8917
|
+
import { useMemo as useMemo15, useEffect as useEffect18, useState as useState28, useCallback as useCallback18 } from "react";
|
|
8338
8918
|
|
|
8339
8919
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
8340
|
-
import { useMemo as
|
|
8920
|
+
import { useMemo as useMemo16 } from "react";
|
|
8341
8921
|
|
|
8342
8922
|
// src/mantine/blocks/index.ts
|
|
8343
8923
|
var blockSpecs = {
|
|
@@ -8346,7 +8926,8 @@ var blockSpecs = {
|
|
|
8346
8926
|
enumChecklist: EnumChecklistBlock,
|
|
8347
8927
|
overview: OverviewBlock,
|
|
8348
8928
|
proposal: ProposalBlockSpec,
|
|
8349
|
-
apiRequest: ApiRequestBlockSpec
|
|
8929
|
+
apiRequest: ApiRequestBlockSpec,
|
|
8930
|
+
notify: NotifyBlockSpec
|
|
8350
8931
|
};
|
|
8351
8932
|
var getExtraSlashMenuItems = (editor) => {
|
|
8352
8933
|
const slashMenuList = [
|
|
@@ -8510,6 +9091,73 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
8510
9091
|
aliases: ["actions", "proposal-actions", "dao-actions", "governance-actions"],
|
|
8511
9092
|
group: "DAO",
|
|
8512
9093
|
subtext: "Manage proposal actions"
|
|
9094
|
+
},
|
|
9095
|
+
{
|
|
9096
|
+
title: "API Request",
|
|
9097
|
+
onItemClick: () => {
|
|
9098
|
+
editor.insertBlocks(
|
|
9099
|
+
[
|
|
9100
|
+
{
|
|
9101
|
+
type: "apiRequest",
|
|
9102
|
+
props: {
|
|
9103
|
+
title: "",
|
|
9104
|
+
description: "",
|
|
9105
|
+
icon: "square-check",
|
|
9106
|
+
endpoint: "",
|
|
9107
|
+
method: "GET",
|
|
9108
|
+
headers: "[]",
|
|
9109
|
+
body: "[]",
|
|
9110
|
+
response: "",
|
|
9111
|
+
status: "idle",
|
|
9112
|
+
conditions: ""
|
|
9113
|
+
}
|
|
9114
|
+
}
|
|
9115
|
+
],
|
|
9116
|
+
editor.getTextCursorPosition().block,
|
|
9117
|
+
"after"
|
|
9118
|
+
);
|
|
9119
|
+
},
|
|
9120
|
+
aliases: ["api", "api-request", "request", "http", "fetch"],
|
|
9121
|
+
group: "Basics",
|
|
9122
|
+
subtext: "Make HTTP requests and handle responses"
|
|
9123
|
+
},
|
|
9124
|
+
{
|
|
9125
|
+
title: "Notification",
|
|
9126
|
+
onItemClick: () => {
|
|
9127
|
+
editor.insertBlocks(
|
|
9128
|
+
[
|
|
9129
|
+
{
|
|
9130
|
+
type: "notify",
|
|
9131
|
+
props: {
|
|
9132
|
+
title: "",
|
|
9133
|
+
description: "",
|
|
9134
|
+
icon: "bell",
|
|
9135
|
+
channel: "email",
|
|
9136
|
+
to: "[]",
|
|
9137
|
+
cc: "[]",
|
|
9138
|
+
bcc: "[]",
|
|
9139
|
+
subject: "",
|
|
9140
|
+
body: "",
|
|
9141
|
+
bodyType: "text",
|
|
9142
|
+
from: "",
|
|
9143
|
+
replyTo: "",
|
|
9144
|
+
templateId: "",
|
|
9145
|
+
templateVariables: "{}",
|
|
9146
|
+
status: "idle",
|
|
9147
|
+
messageId: "",
|
|
9148
|
+
sentAt: "",
|
|
9149
|
+
errorMessage: "",
|
|
9150
|
+
conditions: ""
|
|
9151
|
+
}
|
|
9152
|
+
}
|
|
9153
|
+
],
|
|
9154
|
+
editor.getTextCursorPosition().block,
|
|
9155
|
+
"after"
|
|
9156
|
+
);
|
|
9157
|
+
},
|
|
9158
|
+
aliases: ["notify", "notification", "email", "alert", "message", "bird"],
|
|
9159
|
+
group: "Basics",
|
|
9160
|
+
subtext: "Send notifications via Email, SMS, or WhatsApp"
|
|
8513
9161
|
}
|
|
8514
9162
|
];
|
|
8515
9163
|
const yRoot = editor?._yRoot;
|
|
@@ -8588,15 +9236,15 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
8588
9236
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
8589
9237
|
|
|
8590
9238
|
// src/core/hooks/useMatrixProvider.ts
|
|
8591
|
-
import { useEffect as
|
|
9239
|
+
import { useEffect as useEffect19, useState as useState29, useRef as useRef3, useCallback as useCallback19, useMemo as useMemo17 } from "react";
|
|
8592
9240
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
8593
9241
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
8594
|
-
const [matrixProvider, setProvider] =
|
|
8595
|
-
const [status, setStatus] =
|
|
9242
|
+
const [matrixProvider, setProvider] = useState29(null);
|
|
9243
|
+
const [status, setStatus] = useState29("disconnected");
|
|
8596
9244
|
const isMountedRef = useRef3(true);
|
|
8597
9245
|
const providerRef = useRef3(null);
|
|
8598
9246
|
const retryTimeoutRef = useRef3(null);
|
|
8599
|
-
const providerOptions =
|
|
9247
|
+
const providerOptions = useMemo17(
|
|
8600
9248
|
() => ({
|
|
8601
9249
|
translator: {
|
|
8602
9250
|
updateEventType: "matrix-crdt.doc_update",
|
|
@@ -8609,22 +9257,22 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
8609
9257
|
}),
|
|
8610
9258
|
[]
|
|
8611
9259
|
);
|
|
8612
|
-
const handleDocumentAvailable =
|
|
9260
|
+
const handleDocumentAvailable = useCallback19(() => {
|
|
8613
9261
|
if (isMountedRef.current) {
|
|
8614
9262
|
setStatus("connected");
|
|
8615
9263
|
}
|
|
8616
9264
|
}, []);
|
|
8617
|
-
const handleDocumentUnavailable =
|
|
9265
|
+
const handleDocumentUnavailable = useCallback19(() => {
|
|
8618
9266
|
if (isMountedRef.current) {
|
|
8619
9267
|
setStatus("failed");
|
|
8620
9268
|
}
|
|
8621
9269
|
}, []);
|
|
8622
|
-
const handleCanWriteChanged =
|
|
9270
|
+
const handleCanWriteChanged = useCallback19(() => {
|
|
8623
9271
|
if (isMountedRef.current && providerRef.current) {
|
|
8624
9272
|
setStatus(providerRef.current.canWrite ? "connected" : "failed");
|
|
8625
9273
|
}
|
|
8626
9274
|
}, []);
|
|
8627
|
-
const initProvider =
|
|
9275
|
+
const initProvider = useCallback19(async () => {
|
|
8628
9276
|
if (!isMountedRef.current) return;
|
|
8629
9277
|
if (retryTimeoutRef.current) {
|
|
8630
9278
|
clearTimeout(retryTimeoutRef.current);
|
|
@@ -8658,7 +9306,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
8658
9306
|
}
|
|
8659
9307
|
}
|
|
8660
9308
|
}, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
|
|
8661
|
-
|
|
9309
|
+
useEffect19(() => {
|
|
8662
9310
|
isMountedRef.current = true;
|
|
8663
9311
|
initProvider();
|
|
8664
9312
|
return () => {
|
|
@@ -8675,7 +9323,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
8675
9323
|
setStatus("disconnected");
|
|
8676
9324
|
};
|
|
8677
9325
|
}, [initProvider]);
|
|
8678
|
-
|
|
9326
|
+
useEffect19(() => {
|
|
8679
9327
|
return () => {
|
|
8680
9328
|
isMountedRef.current = false;
|
|
8681
9329
|
};
|
|
@@ -8684,17 +9332,17 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
8684
9332
|
}
|
|
8685
9333
|
|
|
8686
9334
|
// src/mantine/hooks/useCollaborativeYDoc.ts
|
|
8687
|
-
import { useMemo as
|
|
9335
|
+
import { useMemo as useMemo18 } from "react";
|
|
8688
9336
|
import * as Y from "yjs";
|
|
8689
9337
|
function useCollaborativeYDoc(_options) {
|
|
8690
|
-
return
|
|
9338
|
+
return useMemo18(() => {
|
|
8691
9339
|
const doc = new Y.Doc();
|
|
8692
9340
|
return doc;
|
|
8693
9341
|
}, []);
|
|
8694
9342
|
}
|
|
8695
9343
|
|
|
8696
9344
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
8697
|
-
import { useMemo as
|
|
9345
|
+
import { useMemo as useMemo19, useEffect as useEffect20 } from "react";
|
|
8698
9346
|
function useCreateCollaborativeIxoEditor(options) {
|
|
8699
9347
|
const yDoc = useCollaborativeYDoc(options);
|
|
8700
9348
|
const {
|
|
@@ -8712,7 +9360,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8712
9360
|
matrixClient,
|
|
8713
9361
|
permissions = { write: false }
|
|
8714
9362
|
} = options || {};
|
|
8715
|
-
const memoizedUser =
|
|
9363
|
+
const memoizedUser = useMemo19(
|
|
8716
9364
|
() => ({
|
|
8717
9365
|
id: user?.id || "",
|
|
8718
9366
|
name: user?.name || "",
|
|
@@ -8727,7 +9375,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8727
9375
|
matrixClient,
|
|
8728
9376
|
roomId: options.roomId
|
|
8729
9377
|
});
|
|
8730
|
-
const defaultUploadFile =
|
|
9378
|
+
const defaultUploadFile = useMemo19(
|
|
8731
9379
|
() => uploadFile || (async (file) => {
|
|
8732
9380
|
return new Promise((resolve, reject) => {
|
|
8733
9381
|
const reader = new FileReader();
|
|
@@ -8741,7 +9389,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8741
9389
|
}),
|
|
8742
9390
|
[uploadFile]
|
|
8743
9391
|
);
|
|
8744
|
-
const schema =
|
|
9392
|
+
const schema = useMemo19(
|
|
8745
9393
|
() => BlockNoteSchema2.create({
|
|
8746
9394
|
blockSpecs: {
|
|
8747
9395
|
...defaultBlockSpecs2,
|
|
@@ -8756,11 +9404,11 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8756
9404
|
}),
|
|
8757
9405
|
[]
|
|
8758
9406
|
);
|
|
8759
|
-
const root =
|
|
8760
|
-
const documentFragment =
|
|
8761
|
-
const flowArray =
|
|
8762
|
-
const userFragment =
|
|
8763
|
-
const collaborationConfig =
|
|
9407
|
+
const root = useMemo19(() => yDoc.getMap("root"), [yDoc]);
|
|
9408
|
+
const documentFragment = useMemo19(() => yDoc.getXmlFragment("document"), [yDoc]);
|
|
9409
|
+
const flowArray = useMemo19(() => yDoc.getArray("flow"), [yDoc]);
|
|
9410
|
+
const userFragment = useMemo19(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
|
|
9411
|
+
const collaborationConfig = useMemo19(
|
|
8764
9412
|
() => ({
|
|
8765
9413
|
provider: matrixProvider,
|
|
8766
9414
|
fragment: documentFragment,
|
|
@@ -8772,7 +9420,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8772
9420
|
}),
|
|
8773
9421
|
[matrixProvider, documentFragment, memoizedUser.name, memoizedUser.color]
|
|
8774
9422
|
);
|
|
8775
|
-
const ixoConfig =
|
|
9423
|
+
const ixoConfig = useMemo19(
|
|
8776
9424
|
() => ({
|
|
8777
9425
|
theme,
|
|
8778
9426
|
editable,
|
|
@@ -8791,7 +9439,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8791
9439
|
uploadFile: defaultUploadFile,
|
|
8792
9440
|
collaboration: collaborationConfig
|
|
8793
9441
|
});
|
|
8794
|
-
const titleText =
|
|
9442
|
+
const titleText = useMemo19(() => yDoc.getText("title"), [yDoc]);
|
|
8795
9443
|
let ixoEditor;
|
|
8796
9444
|
if (editor) {
|
|
8797
9445
|
ixoEditor = editor;
|
|
@@ -8848,12 +9496,12 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8848
9496
|
root.set("docType", value);
|
|
8849
9497
|
};
|
|
8850
9498
|
}
|
|
8851
|
-
|
|
9499
|
+
useEffect20(() => {
|
|
8852
9500
|
if (ixoEditor) {
|
|
8853
9501
|
ixoEditor.isEditable = editable;
|
|
8854
9502
|
}
|
|
8855
9503
|
}, [ixoEditor, editable]);
|
|
8856
|
-
|
|
9504
|
+
useEffect20(() => {
|
|
8857
9505
|
if (connectionStatus !== "connected") {
|
|
8858
9506
|
return;
|
|
8859
9507
|
}
|
|
@@ -8886,19 +9534,19 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8886
9534
|
}
|
|
8887
9535
|
|
|
8888
9536
|
// src/mantine/IxoEditor.tsx
|
|
8889
|
-
import
|
|
9537
|
+
import React105 from "react";
|
|
8890
9538
|
import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
|
|
8891
9539
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
8892
9540
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
8893
9541
|
import { MantineProvider } from "@mantine/core";
|
|
8894
9542
|
|
|
8895
9543
|
// src/mantine/components/PanelContent.tsx
|
|
8896
|
-
import
|
|
9544
|
+
import React104 from "react";
|
|
8897
9545
|
function PanelContent() {
|
|
8898
9546
|
const { activePanel, registeredPanels } = usePanelStore();
|
|
8899
9547
|
const isOpen = activePanel !== null;
|
|
8900
9548
|
const content = activePanel ? registeredPanels.get(activePanel) : null;
|
|
8901
|
-
return /* @__PURE__ */
|
|
9549
|
+
return /* @__PURE__ */ React104.createElement(
|
|
8902
9550
|
"div",
|
|
8903
9551
|
{
|
|
8904
9552
|
style: {
|
|
@@ -8922,7 +9570,7 @@ function IxoEditorContent({
|
|
|
8922
9570
|
onSelectionChange,
|
|
8923
9571
|
children
|
|
8924
9572
|
}) {
|
|
8925
|
-
return /* @__PURE__ */
|
|
9573
|
+
return /* @__PURE__ */ React105.createElement("div", { style: { display: "flex", height: "100%" } }, /* @__PURE__ */ React105.createElement("div", { className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`, style: { flex: 1 } }, /* @__PURE__ */ React105.createElement(
|
|
8926
9574
|
BlockNoteView,
|
|
8927
9575
|
{
|
|
8928
9576
|
editor,
|
|
@@ -8937,7 +9585,7 @@ function IxoEditorContent({
|
|
|
8937
9585
|
onChange,
|
|
8938
9586
|
onSelectionChange
|
|
8939
9587
|
},
|
|
8940
|
-
config.slashMenu && /* @__PURE__ */
|
|
9588
|
+
config.slashMenu && /* @__PURE__ */ React105.createElement(
|
|
8941
9589
|
SuggestionMenuController,
|
|
8942
9590
|
{
|
|
8943
9591
|
triggerCharacter: "/",
|
|
@@ -8949,7 +9597,7 @@ function IxoEditorContent({
|
|
|
8949
9597
|
}
|
|
8950
9598
|
),
|
|
8951
9599
|
children
|
|
8952
|
-
)), /* @__PURE__ */
|
|
9600
|
+
)), /* @__PURE__ */ React105.createElement(PanelContent, null));
|
|
8953
9601
|
}
|
|
8954
9602
|
function IxoEditor({
|
|
8955
9603
|
editor,
|
|
@@ -8975,9 +9623,9 @@ function IxoEditor({
|
|
|
8975
9623
|
tableHandles: true
|
|
8976
9624
|
};
|
|
8977
9625
|
const isEditable = editable;
|
|
8978
|
-
const editorContent = /* @__PURE__ */
|
|
9626
|
+
const editorContent = /* @__PURE__ */ React105.createElement(BlocknoteProvider, { editor, handlers, blockRequirements, editable: isEditable }, /* @__PURE__ */ React105.createElement(IxoEditorContent, { editor, config, isEditable, className, onChange, onSelectionChange }, children));
|
|
8979
9627
|
if (mantineTheme) {
|
|
8980
|
-
return /* @__PURE__ */
|
|
9628
|
+
return /* @__PURE__ */ React105.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
|
|
8981
9629
|
}
|
|
8982
9630
|
return editorContent;
|
|
8983
9631
|
}
|
|
@@ -9061,4 +9709,4 @@ export {
|
|
|
9061
9709
|
ixoGraphQLClient,
|
|
9062
9710
|
getEntity
|
|
9063
9711
|
};
|
|
9064
|
-
//# sourceMappingURL=chunk-
|
|
9712
|
+
//# sourceMappingURL=chunk-7MKIYHNA.mjs.map
|