@ixo/editor 1.16.0 → 1.18.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.
@@ -36,10 +36,19 @@ var BlocknoteProvider = ({ children, editor, handlers, blockRequirements, editab
36
36
  return;
37
37
  }
38
38
  const updateDocType = () => {
39
+ const authoritativeDocType = editor._authoritativeDocType;
40
+ if (authoritativeDocType) {
41
+ console.log("[BlocknoteContext] Using authoritative local docType:", authoritativeDocType);
42
+ if (authoritativeDocType !== docType) {
43
+ console.log("[BlocknoteContext] Setting docType to authoritative value:", authoritativeDocType);
44
+ setDocType(authoritativeDocType);
45
+ }
46
+ return;
47
+ }
39
48
  const newDocType = editor.getDocType?.() || "flow";
40
- console.log("[BlocknoteContext] updateDocType() called, newDocType:", newDocType, "current docType:", docType);
49
+ console.log("[BlocknoteContext] updateDocType() called, newDocType from YMap:", newDocType, "current docType:", docType);
41
50
  if (newDocType !== docType) {
42
- console.log("[BlocknoteContext] docType changed from", docType, "to", newDocType);
51
+ console.log("[BlocknoteContext] docType changed from", docType, "to", newDocType, "(remote or initial change)");
43
52
  setDocType(newDocType);
44
53
  }
45
54
  };
@@ -54,7 +63,7 @@ var BlocknoteProvider = ({ children, editor, handlers, blockRequirements, editab
54
63
  console.log("[BlocknoteContext] Unobserving YMap");
55
64
  editor._yRoot?.unobserve(observer);
56
65
  };
57
- }, [editor]);
66
+ }, [editor, docType]);
58
67
  useEffect(() => {
59
68
  sharedProposalsRef.current = sharedProposals;
60
69
  }, [sharedProposals]);
@@ -266,6 +275,41 @@ import { Stack as Stack3, SegmentedControl, Button as Button2, Text, Alert } fro
266
275
  import React3, { useCallback as useCallback3, useMemo } from "react";
267
276
  import { Card, Stack as Stack2, TextInput as TextInput2, Select as Select2, Group, Button } from "@mantine/core";
268
277
 
278
+ // src/mantine/blocks/apiRequest/types.ts
279
+ function parseResponseSchema(schemaString) {
280
+ if (!schemaString) return null;
281
+ try {
282
+ return JSON.parse(schemaString);
283
+ } catch (error) {
284
+ console.warn("Failed to parse response schema:", error);
285
+ return null;
286
+ }
287
+ }
288
+ function validateResponseAgainstSchema(response, schema) {
289
+ const errors = [];
290
+ schema.fields.forEach((field) => {
291
+ const value = getNestedValueForValidation(response, field.path);
292
+ if (value === void 0) {
293
+ errors.push(`Missing field: ${field.path}`);
294
+ } else {
295
+ const actualType = Array.isArray(value) ? "array" : typeof value;
296
+ if (field.type === "object" && actualType !== "object") {
297
+ errors.push(`Type mismatch for ${field.path}: expected object, got ${actualType}`);
298
+ } else if (field.type === "array" && !Array.isArray(value)) {
299
+ errors.push(`Type mismatch for ${field.path}: expected array, got ${actualType}`);
300
+ } else if (field.type !== "object" && field.type !== "array" && actualType !== field.type) {
301
+ errors.push(`Type mismatch for ${field.path}: expected ${field.type}, got ${actualType}`);
302
+ }
303
+ }
304
+ });
305
+ return errors;
306
+ }
307
+ function getNestedValueForValidation(obj, path) {
308
+ return path.split(".").reduce((current, key) => {
309
+ return current?.[key];
310
+ }, obj);
311
+ }
312
+
269
313
  // src/mantine/blocks/registry/conditionableProperties.ts
270
314
  var CONDITIONABLE_PROPERTIES = {
271
315
  checkbox: [
@@ -404,10 +448,75 @@ var CONDITIONABLE_PROPERTIES = {
404
448
  type: "string",
405
449
  description: "The JSON string of actions"
406
450
  }
451
+ ],
452
+ apiRequest: [
453
+ {
454
+ name: "endpoint",
455
+ displayName: "Endpoint",
456
+ type: "string",
457
+ description: "The API endpoint URL"
458
+ },
459
+ {
460
+ name: "method",
461
+ displayName: "HTTP Method",
462
+ type: "select",
463
+ selectOptions: [
464
+ { value: "GET", label: "GET" },
465
+ { value: "POST", label: "POST" },
466
+ { value: "PUT", label: "PUT" },
467
+ { value: "DELETE", label: "DELETE" },
468
+ { value: "PATCH", label: "PATCH" }
469
+ ],
470
+ description: "The HTTP method for the request"
471
+ },
472
+ {
473
+ name: "response",
474
+ displayName: "Response",
475
+ type: "string",
476
+ description: "The response data from the API request"
477
+ },
478
+ {
479
+ name: "status",
480
+ displayName: "Status",
481
+ type: "select",
482
+ selectOptions: [
483
+ { value: "idle", label: "Idle" },
484
+ { value: "loading", label: "Loading" },
485
+ { value: "success", label: "Success" },
486
+ { value: "error", label: "Error" }
487
+ ],
488
+ description: "The current status of the API request"
489
+ },
490
+ {
491
+ name: "title",
492
+ displayName: "Title",
493
+ type: "string",
494
+ description: "The title of the API request block"
495
+ },
496
+ {
497
+ name: "description",
498
+ displayName: "Description",
499
+ type: "string",
500
+ description: "The description of the API request block"
501
+ }
407
502
  ]
408
503
  };
409
- function getConditionableProperties(blockType) {
410
- return CONDITIONABLE_PROPERTIES[blockType] || [];
504
+ function getConditionableProperties(blockType, block) {
505
+ const baseProperties = CONDITIONABLE_PROPERTIES[blockType] || [];
506
+ if (blockType === "apiRequest" && block?.props?.responseSchema) {
507
+ const schema = parseResponseSchema(block.props.responseSchema);
508
+ if (schema && schema.fields.length > 0) {
509
+ const schemaProperties = schema.fields.map((field) => ({
510
+ name: `response.${field.path}`,
511
+ displayName: field.displayName,
512
+ type: field.type,
513
+ description: field.description || `Response field: ${field.displayName}`
514
+ }));
515
+ const filteredBase = baseProperties.filter((prop) => prop.name !== "response");
516
+ return [...filteredBase, ...schemaProperties];
517
+ }
518
+ }
519
+ return baseProperties;
411
520
  }
412
521
  function getPropertyByName(blockType, propertyName) {
413
522
  const properties = getConditionableProperties(blockType);
@@ -1298,7 +1407,7 @@ import React16, { useMemo as useMemo6 } from "react";
1298
1407
 
1299
1408
  // src/mantine/blocks/list/template/TemplateConfig.tsx
1300
1409
  import React15, { useCallback as useCallback8 } from "react";
1301
- import { Paper as Paper2, CloseButton as CloseButton2, Title as Title2 } from "@mantine/core";
1410
+ import { Paper as Paper2, CloseButton as CloseButton2, Title as Title2, Flex } from "@mantine/core";
1302
1411
 
1303
1412
  // src/mantine/blocks/list/template/GeneralTab.tsx
1304
1413
  import React14, { useState as useState4 } from "react";
@@ -1333,7 +1442,8 @@ var linkedResourcesSortFields = [
1333
1442
  { key: "serviceEndpoint", label: "Service Endpoint", type: "string" }
1334
1443
  ];
1335
1444
  var linkedResourcesSelectionPanelConfig = {
1336
- title: (item) => item.description || "Linked Resource",
1445
+ image: (item) => item.image,
1446
+ title: (item) => item.title || "Linked Resource",
1337
1447
  description: (item) => item.description || "No description",
1338
1448
  prompts: (item) => [{ text: `ID: ${item.id}` }, { text: `Encrypted: ${item.encrypted ? "Yes" : "No"}` }, { text: `Service Endpoint: ${item.serviceEndpoint}` }],
1339
1449
  actionSections: (item) => item.actionSections,
@@ -1377,6 +1487,7 @@ var assetsFilterFields = [
1377
1487
  { key: "available", label: "Unavailable", type: false }
1378
1488
  ];
1379
1489
  var assetsSelectionPanelConfig = {
1490
+ image: (item) => item.image,
1380
1491
  title: (item) => item.name || "Unnamed Asset",
1381
1492
  description: (item) => item.description || "No description",
1382
1493
  prompts: () => [{ text: `How many assets are available?` }, { text: `What are carbon credits` }],
@@ -1446,6 +1557,7 @@ var collectionsSortFields = [
1446
1557
  ];
1447
1558
  var collectionsHandlerKey = "getCollections";
1448
1559
  var collectionsSelectionPanelConfig = {
1560
+ image: (item) => item.image,
1449
1561
  title: (item) => item.name || "Unnamed Collection",
1450
1562
  description: (item) => item.description || "No description",
1451
1563
  prompts: (item) => [{ text: `DID: ${item.did}` }, { text: `Type: ${item.type}` }],
@@ -1485,6 +1597,7 @@ var investmentsFilterFields = [
1485
1597
  var investmentsHandlerKey = "getInvestments";
1486
1598
  var investmentsSelectionPanelConfig = {
1487
1599
  title: (item) => item.name || "Investment Opportunity",
1600
+ image: (item) => item.image,
1488
1601
  description: (item) => item.description || "No description",
1489
1602
  prompts: (item) => [
1490
1603
  { text: `Price: ${item.price} ${item.currency}` },
@@ -1527,6 +1640,7 @@ var oraclesFilterFields = [
1527
1640
  var oraclesHandlerKey = "getOracles";
1528
1641
  var oraclesSelectionPanelConfig = {
1529
1642
  title: (item) => item.name || "Oracle",
1643
+ image: (item) => item.image,
1530
1644
  description: (item) => item.description || "No description",
1531
1645
  prompts: (item) => [{ text: `Flows Amount: ${item.flowsAmount}` }, { text: `Active: ${item.isActive ? "Yes" : "No"}` }, { text: `Invited: ${item.isInvited ? "Yes" : "No"}` }],
1532
1646
  actionSections: (item) => item.actionSections,
@@ -1562,6 +1676,7 @@ var podsFilterFields = [
1562
1676
  ];
1563
1677
  var podsHandlerKey = "getPODs";
1564
1678
  var podsSelectionPanelConfig = {
1679
+ image: (item) => item.image,
1565
1680
  title: (item) => item.name || "POD",
1566
1681
  description: (item) => item.description || "No description",
1567
1682
  prompts: (item) => [{ text: `Start Date: ${item.startDate}` }, { text: `End Date: ${item.endDate}` }, { text: `Member: ${item.isMember ? "Yes" : "No"}` }],
@@ -1595,6 +1710,7 @@ var proposalsSortFields = [
1595
1710
  ];
1596
1711
  var proposalsHandlerKey = "getProposals";
1597
1712
  var proposalsSelectionPanelConfig = {
1713
+ image: (item) => item.image,
1598
1714
  title: (item) => item.name || "Proposal",
1599
1715
  description: (item) => item.description || "No description",
1600
1716
  prompts: (item) => [{ text: `DID: ${item.did}` }, { text: `Status: ${item.status}` }],
@@ -1630,6 +1746,7 @@ var requestsFilterFields = [
1630
1746
  ];
1631
1747
  var requestsHandlerKey = "getRequests";
1632
1748
  var requestsSelectionPanelConfig = {
1749
+ image: (item) => item.image,
1633
1750
  title: (item) => item.name || "Request",
1634
1751
  description: (item) => item.description || "No description",
1635
1752
  prompts: (item) => [{ text: `Total Applications: ${item.totalApplications}` }, { text: `Member: ${item.isMember ? "Yes" : "No"}` }, { text: `DID: ${item.did}` }],
@@ -1674,6 +1791,7 @@ var groupMembersSortFields = [
1674
1791
  ];
1675
1792
  var groupMembersHandlerKey = "getGroupMembers";
1676
1793
  var groupMembersSelectionPanelConfig = {
1794
+ image: (item) => item.image,
1677
1795
  title: (item) => item.username || "Unknown Member",
1678
1796
  description: (item) => item.description || "No description",
1679
1797
  prompts: (item) => [{ text: `Address: ${item.address}` }, { text: `DID: ${item.did}` }],
@@ -1757,6 +1875,7 @@ var daoMembersSortFields = [
1757
1875
  ];
1758
1876
  var daoMembersHandlerKey = "getDaoMembers";
1759
1877
  var daoMembersSelectionPanelConfig = {
1878
+ image: (item) => item.image,
1760
1879
  title: (item) => item.username || "Unknown Member",
1761
1880
  description: (item) => item.description || "No description",
1762
1881
  prompts: (item) => [{ text: `Address: ${item.address}` }, { text: `DID: ${item.did}` }],
@@ -1784,9 +1903,10 @@ var projectsSortFields = [{ key: "name", label: "Name", type: "string" }];
1784
1903
  var projectsFilterFields = [];
1785
1904
  var projectsHandlerKey = "getProjects";
1786
1905
  var projectsSelectionPanelConfig = {
1906
+ image: (item) => item.image,
1787
1907
  title: (item) => item.name || "Project",
1788
1908
  description: (item) => item.description || "No description",
1789
- prompts: (item) => [{ text: `DID: ${item.did}` }],
1909
+ prompts: (item) => [{ text: `DID: ${item.did}` }, { text: `Type: ${item.type}` }],
1790
1910
  actionSections: (item) => item.actionSections,
1791
1911
  detailsHandlerKey: "getProjectDetails"
1792
1912
  };
@@ -1812,8 +1932,9 @@ var daosFilterFields = [];
1812
1932
  var daosHandlerKey = "getDaos";
1813
1933
  var daosSelectionPanelConfig = {
1814
1934
  title: (item) => item.name || "Dao",
1935
+ image: (item) => item.image,
1815
1936
  description: (item) => item.description || "No description",
1816
- prompts: (item) => [{ text: `DID: ${item.did}` }],
1937
+ prompts: (item) => [{ text: `DID: ${item.did}` }, { text: `Type: ${item.type}` }],
1817
1938
  actionSections: (item) => item.actionSections,
1818
1939
  detailsHandlerKey: "getDaoDetails"
1819
1940
  };
@@ -2156,24 +2277,11 @@ var TemplateConfig2 = ({ editor, block }) => {
2156
2277
  p: "md",
2157
2278
  shadow: "sm",
2158
2279
  style: {
2159
- height: "100%",
2160
2280
  display: "flex",
2161
2281
  flexDirection: "column"
2162
2282
  }
2163
2283
  },
2164
- /* @__PURE__ */ React15.createElement(
2165
- "div",
2166
- {
2167
- style: {
2168
- display: "flex",
2169
- justifyContent: "space-between",
2170
- alignItems: "center",
2171
- marginBottom: "1rem"
2172
- }
2173
- },
2174
- /* @__PURE__ */ React15.createElement(Title2, { order: 3 }, "List Settings"),
2175
- /* @__PURE__ */ React15.createElement(CloseButton2, { onClick: closePanel })
2176
- ),
2284
+ /* @__PURE__ */ React15.createElement(Flex, { align: "center", justify: "space-between", mb: "1rem" }, /* @__PURE__ */ React15.createElement(Title2, { order: 3 }, "List Settings"), /* @__PURE__ */ React15.createElement(CloseButton2, { onClick: closePanel })),
2177
2285
  /* @__PURE__ */ React15.createElement(
2178
2286
  ReusablePanel,
2179
2287
  {
@@ -2204,11 +2312,11 @@ var ListTemplateView = ({ editor, block }) => {
2204
2312
 
2205
2313
  // src/mantine/blocks/list/flow/ListFlowView.tsx
2206
2314
  import React40, { useState as useState6, useEffect as useEffect6, useMemo as useMemo9, useCallback as useCallback10 } from "react";
2207
- import { Group as Group7, Stack as Stack26, Text as Text26, ActionIcon as ActionIcon5, Alert as Alert4, Loader as Loader2, Center as Center2, Flex as Flex17, Button as Button5, Title as Title4, Collapse } from "@mantine/core";
2315
+ import { Group as Group7, Stack as Stack26, Text as Text26, ActionIcon as ActionIcon5, Alert as Alert4, Loader as Loader2, Center as Center2, Flex as Flex18, Button as Button5, Title as Title4, Collapse } from "@mantine/core";
2208
2316
 
2209
2317
  // src/mantine/blocks/list/linked_resources/LinkedResourcesList.tsx
2210
2318
  import React20 from "react";
2211
- import { Stack as Stack10, Text as Text8, Box as Box2, Flex as Flex2 } from "@mantine/core";
2319
+ import { Stack as Stack10, Text as Text8, Box as Box2, Flex as Flex3 } from "@mantine/core";
2212
2320
 
2213
2321
  // src/core/lib/getMediaTypeIcon.tsx
2214
2322
  import { IconArchive, IconDeviceAudioTape, IconFileTypeXml, IconImageInPicture, IconPdf, IconFile, IconJson, IconVideo } from "@tabler/icons-react";
@@ -2243,10 +2351,10 @@ function getMediaTypeIcon(mediaType, props = {}) {
2243
2351
  }
2244
2352
 
2245
2353
  // src/mantine/blocks/list/ListItemContainer.tsx
2246
- import { Flex } from "@mantine/core";
2354
+ import { Flex as Flex2 } from "@mantine/core";
2247
2355
  import React18 from "react";
2248
2356
  function ListItemContainer({ children }) {
2249
- return /* @__PURE__ */ React18.createElement(Flex, { styles: { root: { borderRadius: 16, border: `1px solid rgba(255, 255, 255, 0.06)` } }, p: 20, bg: "rgba(255, 255, 255, 0.02)", justify: "space-between" }, children);
2357
+ return /* @__PURE__ */ React18.createElement(Flex2, { styles: { root: { borderRadius: 16, border: `1px solid rgba(255, 255, 255, 0.06)` } }, p: 20, bg: "rgba(255, 255, 255, 0.02)", justify: "space-between" }, children);
2250
2358
  }
2251
2359
 
2252
2360
  // src/mantine/blocks/list/ListItemCheckbox.tsx
@@ -2278,7 +2386,7 @@ var LinkedResourcesList = ({ items, mods, isItemChecked, onItemCheck, config: _c
2278
2386
  }
2279
2387
  const rows = items.map((item, index) => {
2280
2388
  const title = item.description || item.id || `Resource ${index + 1}`;
2281
- return /* @__PURE__ */ React20.createElement(ListItemContainer, { key: item.id || index }, /* @__PURE__ */ React20.createElement(Flex2, { align: "center", gap: "sm" }, /* @__PURE__ */ React20.createElement(
2389
+ return /* @__PURE__ */ React20.createElement(ListItemContainer, { key: item.id || index }, /* @__PURE__ */ React20.createElement(Flex3, { align: "center", gap: "sm" }, /* @__PURE__ */ React20.createElement(
2282
2390
  Box2,
2283
2391
  {
2284
2392
  style: {
@@ -2293,7 +2401,7 @@ var LinkedResourcesList = ({ items, mods, isItemChecked, onItemCheck, config: _c
2293
2401
  }
2294
2402
  },
2295
2403
  getMediaTypeIcon(item.mediaType, { size: 16 })
2296
- ), /* @__PURE__ */ React20.createElement(Stack10, { gap: 0 }, /* @__PURE__ */ React20.createElement(Text8, { size: "sm" }, title), item.type && /* @__PURE__ */ React20.createElement(Text8, { size: "xs", c: "dimmed" }, item.type))), /* @__PURE__ */ React20.createElement(Flex2, { align: "center", gap: "md" }, /* @__PURE__ */ React20.createElement(Stack10, { ta: "right", gap: 0 }, /* @__PURE__ */ React20.createElement(Text8, { size: "sm" }, item.encrypted === "true" ? "Private" : "Public"), /* @__PURE__ */ React20.createElement(Text8, { size: "xs", c: "dimmed" }, item.encrypted === "true" ? "Ask for access" : "Accessible")), mods && /* @__PURE__ */ React20.createElement(
2404
+ ), /* @__PURE__ */ React20.createElement(Stack10, { gap: 0 }, /* @__PURE__ */ React20.createElement(Text8, { size: "sm" }, title), item.type && /* @__PURE__ */ React20.createElement(Text8, { size: "xs", c: "dimmed" }, item.type))), /* @__PURE__ */ React20.createElement(Flex3, { align: "center", gap: "md" }, /* @__PURE__ */ React20.createElement(Stack10, { ta: "right", gap: 0 }, /* @__PURE__ */ React20.createElement(Text8, { size: "sm" }, item.encrypted === "true" ? "Private" : "Public"), /* @__PURE__ */ React20.createElement(Text8, { size: "xs", c: "dimmed" }, item.encrypted === "true" ? "Ask for access" : "Accessible")), mods && /* @__PURE__ */ React20.createElement(
2297
2405
  ListItemCheckbox,
2298
2406
  {
2299
2407
  ariaLabel: `Select resource ${item.id}`,
@@ -2307,7 +2415,7 @@ var LinkedResourcesList = ({ items, mods, isItemChecked, onItemCheck, config: _c
2307
2415
 
2308
2416
  // src/mantine/blocks/list/assets/AssetsList.tsx
2309
2417
  import React21 from "react";
2310
- import { Text as Text9, Box as Box3, Stack as Stack11, Flex as Flex3, Image } from "@mantine/core";
2418
+ import { Text as Text9, Box as Box3, Stack as Stack11, Flex as Flex4, Image } from "@mantine/core";
2311
2419
 
2312
2420
  // src/core/lib/formatters.ts
2313
2421
  var formatNumber = (value) => typeof value === "number" ? value.toLocaleString() : "-";
@@ -2325,13 +2433,13 @@ var AssetsList = ({ items, mods, isItemChecked, onItemCheck }) => {
2325
2433
  if (!items || items.length === 0) {
2326
2434
  return /* @__PURE__ */ React21.createElement(Text9, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No assets found");
2327
2435
  }
2328
- const rows = items.map((asset) => /* @__PURE__ */ React21.createElement(ListItemContainer, { key: asset.did }, /* @__PURE__ */ React21.createElement(Flex3, { align: "center", gap: "sm" }, /* @__PURE__ */ React21.createElement(Image, { radius: 16, w: 32, h: 32, src: asset.icon }), /* @__PURE__ */ React21.createElement(Stack11, { gap: 0 }, /* @__PURE__ */ React21.createElement(Text9, { size: "sm" }, asset.name || "-", " ", asset.alsoKnownAs || "-"), asset.totalCarbon !== void 0 && /* @__PURE__ */ React21.createElement(Text9, { size: "sm", c: "dimmed" }, formatNumber(asset.totalCarbon), " CARBON"))), /* @__PURE__ */ React21.createElement(Flex3, { align: "center", gap: "md" }, /* @__PURE__ */ React21.createElement(Stack11, { ta: "right", gap: 0 }, /* @__PURE__ */ React21.createElement(Text9, { size: "sm" }, asset.currency || "", formatNumber(asset.price)), /* @__PURE__ */ React21.createElement(Text9, { size: "sm", c: "dimmed" }, asset.available ? "Available" : "Unavailable")), mods && /* @__PURE__ */ React21.createElement(ListItemCheckbox, { ariaLabel: `Select asset ${asset.did}`, checked: isItemChecked?.(asset.did), onCheck: (checked) => onItemCheck?.(asset.did, checked) }))));
2436
+ const rows = items.map((asset) => /* @__PURE__ */ React21.createElement(ListItemContainer, { key: asset.did }, /* @__PURE__ */ React21.createElement(Flex4, { align: "center", gap: "sm" }, /* @__PURE__ */ React21.createElement(Image, { radius: 16, w: 32, h: 32, src: asset.icon }), /* @__PURE__ */ React21.createElement(Stack11, { gap: 0 }, /* @__PURE__ */ React21.createElement(Text9, { size: "sm" }, asset.name || "-", " ", asset.alsoKnownAs || "-"), asset.totalCarbon !== void 0 && /* @__PURE__ */ React21.createElement(Text9, { size: "sm", c: "dimmed" }, formatNumber(asset.totalCarbon), " CARBON"))), /* @__PURE__ */ React21.createElement(Flex4, { align: "center", gap: "md" }, /* @__PURE__ */ React21.createElement(Stack11, { ta: "right", gap: 0 }, /* @__PURE__ */ React21.createElement(Text9, { size: "sm" }, asset.currency || "", formatNumber(asset.price)), /* @__PURE__ */ React21.createElement(Text9, { size: "sm", c: "dimmed" }, asset.available ? "Available" : "Unavailable")), mods && /* @__PURE__ */ React21.createElement(ListItemCheckbox, { ariaLabel: `Select asset ${asset.did}`, checked: isItemChecked?.(asset.did), onCheck: (checked) => onItemCheck?.(asset.did, checked) }))));
2329
2437
  return /* @__PURE__ */ React21.createElement(Box3, { flex: 1 }, /* @__PURE__ */ React21.createElement(Stack11, null, rows));
2330
2438
  };
2331
2439
 
2332
2440
  // src/mantine/blocks/list/transactions/TransactionsList.tsx
2333
2441
  import React22 from "react";
2334
- import { Text as Text10, Badge as Badge3, Tooltip as Tooltip2, Box as Box4, Flex as Flex4, Stack as Stack12 } from "@mantine/core";
2442
+ import { Text as Text10, Badge as Badge3, Tooltip as Tooltip2, Box as Box4, Flex as Flex5, Stack as Stack12 } from "@mantine/core";
2335
2443
  var formatTime = (timeStr) => {
2336
2444
  try {
2337
2445
  const date = new Date(timeStr);
@@ -2348,7 +2456,7 @@ var TransactionsList = ({ items, mods, isItemChecked, onItemCheck, config: _conf
2348
2456
  if (!items || items.length === 0) {
2349
2457
  return /* @__PURE__ */ React22.createElement(Text10, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No transactions found");
2350
2458
  }
2351
- const rows = items.map((transaction, index) => /* @__PURE__ */ React22.createElement(ListItemContainer, { key: transaction.transactionHash || index }, /* @__PURE__ */ React22.createElement(Flex4, { align: "center", gap: "sm" }, /* @__PURE__ */ React22.createElement(Stack12, { gap: 2 }, /* @__PURE__ */ React22.createElement(Tooltip2, { label: transaction.transactionHash, position: "top" }, /* @__PURE__ */ React22.createElement(Text10, { size: "sm", style: { fontFamily: "monospace" } }, truncateHash(transaction.transactionHash))), /* @__PURE__ */ React22.createElement(Text10, { size: "sm", c: "dimmed" }, transaction.memo || "-"))), /* @__PURE__ */ React22.createElement(Flex4, { align: "center", gap: "md" }, /* @__PURE__ */ React22.createElement(Stack12, { ta: "right", gap: 2 }, /* @__PURE__ */ React22.createElement(Badge3, { size: "sm", variant: "light", color: "blue", style: { fontFamily: "monospace", fontSize: "10px" } }, transaction.typeUrl), /* @__PURE__ */ React22.createElement(Text10, { size: "xs", c: "dimmed" }, formatTime(transaction.time))), mods && /* @__PURE__ */ React22.createElement(
2459
+ const rows = items.map((transaction, index) => /* @__PURE__ */ React22.createElement(ListItemContainer, { key: transaction.transactionHash || index }, /* @__PURE__ */ React22.createElement(Flex5, { align: "center", gap: "sm" }, /* @__PURE__ */ React22.createElement(Stack12, { gap: 2 }, /* @__PURE__ */ React22.createElement(Tooltip2, { label: transaction.transactionHash, position: "top" }, /* @__PURE__ */ React22.createElement(Text10, { size: "sm", style: { fontFamily: "monospace" } }, truncateHash(transaction.transactionHash))), /* @__PURE__ */ React22.createElement(Text10, { size: "sm", c: "dimmed" }, transaction.memo || "-"))), /* @__PURE__ */ React22.createElement(Flex5, { align: "center", gap: "md" }, /* @__PURE__ */ React22.createElement(Stack12, { ta: "right", gap: 2 }, /* @__PURE__ */ React22.createElement(Badge3, { size: "sm", variant: "light", color: "blue", style: { fontFamily: "monospace", fontSize: "10px" } }, transaction.typeUrl), /* @__PURE__ */ React22.createElement(Text10, { size: "xs", c: "dimmed" }, formatTime(transaction.time))), mods && /* @__PURE__ */ React22.createElement(
2352
2460
  ListItemCheckbox,
2353
2461
  {
2354
2462
  ariaLabel: `Select transaction ${transaction.transactionHash}`,
@@ -2361,12 +2469,12 @@ var TransactionsList = ({ items, mods, isItemChecked, onItemCheck, config: _conf
2361
2469
 
2362
2470
  // src/mantine/blocks/list/collections/CollectionsList.tsx
2363
2471
  import React23 from "react";
2364
- import { Text as Text11, Box as Box5, Image as Image2, Stack as Stack13, Flex as Flex5 } from "@mantine/core";
2472
+ import { Text as Text11, Box as Box5, Image as Image2, Stack as Stack13, Flex as Flex6 } from "@mantine/core";
2365
2473
  var CollectionsList = ({ items, mods, isItemChecked, onItemCheck }) => {
2366
2474
  if (!items || items.length === 0) {
2367
2475
  return /* @__PURE__ */ React23.createElement(Text11, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No collections found");
2368
2476
  }
2369
- const rows = items.map((collection) => /* @__PURE__ */ React23.createElement(ListItemContainer, { key: collection.did }, /* @__PURE__ */ React23.createElement(Flex5, { align: "center", gap: "sm" }, /* @__PURE__ */ React23.createElement(Image2, { radius: 16, w: 32, h: 32, src: collection.icon }), /* @__PURE__ */ React23.createElement(Stack13, { gap: 0 }, /* @__PURE__ */ React23.createElement(Text11, { size: "sm" }, collection.name), /* @__PURE__ */ React23.createElement(Text11, { size: "sm", c: "dimmed" }, collection.brand))), /* @__PURE__ */ React23.createElement(Flex5, { align: "center", gap: "md" }, /* @__PURE__ */ React23.createElement(Stack13, { ta: "right", gap: 0 }, /* @__PURE__ */ React23.createElement(Text11, { size: "sm" }, collection.totalAssets, " Assets"), /* @__PURE__ */ React23.createElement(Text11, { size: "sm", c: "dimmed" }, collection.currency, collection.price)), mods && /* @__PURE__ */ React23.createElement(
2477
+ const rows = items.map((collection) => /* @__PURE__ */ React23.createElement(ListItemContainer, { key: collection.did }, /* @__PURE__ */ React23.createElement(Flex6, { align: "center", gap: "sm" }, /* @__PURE__ */ React23.createElement(Image2, { radius: 16, w: 32, h: 32, src: collection.icon }), /* @__PURE__ */ React23.createElement(Stack13, { gap: 0 }, /* @__PURE__ */ React23.createElement(Text11, { size: "sm" }, collection.name), /* @__PURE__ */ React23.createElement(Text11, { size: "sm", c: "dimmed" }, collection.brand))), /* @__PURE__ */ React23.createElement(Flex6, { align: "center", gap: "md" }, /* @__PURE__ */ React23.createElement(Stack13, { ta: "right", gap: 0 }, /* @__PURE__ */ React23.createElement(Text11, { size: "sm" }, collection.totalAssets, " Assets"), /* @__PURE__ */ React23.createElement(Text11, { size: "sm", c: "dimmed" }, collection.currency, collection.price)), mods && /* @__PURE__ */ React23.createElement(
2370
2478
  ListItemCheckbox,
2371
2479
  {
2372
2480
  ariaLabel: `Select collection ${collection.did}`,
@@ -2379,12 +2487,12 @@ var CollectionsList = ({ items, mods, isItemChecked, onItemCheck }) => {
2379
2487
 
2380
2488
  // src/mantine/blocks/list/investments/InvestmentsList.tsx
2381
2489
  import React24 from "react";
2382
- import { Text as Text12, Box as Box6, Image as Image3, Stack as Stack14, Flex as Flex6, Progress } from "@mantine/core";
2490
+ import { Text as Text12, Box as Box6, Image as Image3, Stack as Stack14, Flex as Flex7, Progress } from "@mantine/core";
2383
2491
  var InvestmentsList = ({ items, mods, isItemChecked, onItemCheck }) => {
2384
2492
  if (!items || items.length === 0) {
2385
2493
  return /* @__PURE__ */ React24.createElement(Text12, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No investments found");
2386
2494
  }
2387
- const rows = items.map((investment) => /* @__PURE__ */ React24.createElement(ListItemContainer, { key: investment.did }, /* @__PURE__ */ React24.createElement(Flex6, { align: "center", gap: "sm" }, /* @__PURE__ */ React24.createElement(Image3, { radius: 16, w: 32, h: 32, src: investment.icon }), /* @__PURE__ */ React24.createElement(Stack14, { gap: 0 }, /* @__PURE__ */ React24.createElement(Text12, { size: "sm" }, investment.name || "-"), /* @__PURE__ */ React24.createElement(Text12, { size: "sm", c: "dimmed" }, investment.brand || "-"))), /* @__PURE__ */ React24.createElement(Flex6, { align: "center", gap: "md" }, /* @__PURE__ */ React24.createElement(Stack14, { ta: "right", gap: 0 }, /* @__PURE__ */ React24.createElement(Flex6, { gap: "5px" }, /* @__PURE__ */ React24.createElement(Text12, { size: "sm" }, investment.currency + formatNumber(investment.currentAmount)), /* @__PURE__ */ React24.createElement(Text12, { size: "sm", c: "dimmed" }, "/ ", investment.currency + formatNumber(investment.maxAmount))), /* @__PURE__ */ React24.createElement(Text12, { size: "xs", c: "dimmed" }, /* @__PURE__ */ React24.createElement(Progress, { color: "rgb(0, 255, 157)", radius: "xl", size: "lg", value: investment.currentAmount * 100 / investment.maxAmount }))), mods && /* @__PURE__ */ React24.createElement(
2495
+ const rows = items.map((investment) => /* @__PURE__ */ React24.createElement(ListItemContainer, { key: investment.did }, /* @__PURE__ */ React24.createElement(Flex7, { align: "center", gap: "sm" }, /* @__PURE__ */ React24.createElement(Image3, { radius: 16, w: 32, h: 32, src: investment.icon }), /* @__PURE__ */ React24.createElement(Stack14, { gap: 0 }, /* @__PURE__ */ React24.createElement(Text12, { size: "sm" }, investment.name || "-"), /* @__PURE__ */ React24.createElement(Text12, { size: "sm", c: "dimmed" }, investment.brand || "-"))), /* @__PURE__ */ React24.createElement(Flex7, { align: "center", gap: "md" }, /* @__PURE__ */ React24.createElement(Stack14, { ta: "right", gap: 0 }, /* @__PURE__ */ React24.createElement(Flex7, { gap: "5px" }, /* @__PURE__ */ React24.createElement(Text12, { size: "sm" }, investment.currency + formatNumber(investment.currentAmount)), /* @__PURE__ */ React24.createElement(Text12, { size: "sm", c: "dimmed" }, "/ ", investment.currency + formatNumber(investment.maxAmount))), /* @__PURE__ */ React24.createElement(Text12, { size: "xs", c: "dimmed" }, /* @__PURE__ */ React24.createElement(Progress, { color: "rgb(0, 255, 157)", radius: "xl", size: "lg", value: investment.currentAmount * 100 / investment.maxAmount }))), mods && /* @__PURE__ */ React24.createElement(
2388
2496
  ListItemCheckbox,
2389
2497
  {
2390
2498
  ariaLabel: `Select investment ${investment.did}`,
@@ -2397,62 +2505,62 @@ var InvestmentsList = ({ items, mods, isItemChecked, onItemCheck }) => {
2397
2505
 
2398
2506
  // src/mantine/blocks/list/oracles/OraclesList.tsx
2399
2507
  import React25 from "react";
2400
- import { Text as Text13, Box as Box7, Image as Image4, Stack as Stack15, Flex as Flex7 } from "@mantine/core";
2508
+ import { Text as Text13, Box as Box7, Image as Image4, Stack as Stack15, Flex as Flex8 } from "@mantine/core";
2401
2509
  var OraclesList = ({ items, mods, isItemChecked, onItemCheck }) => {
2402
2510
  if (!items || items.length === 0) {
2403
2511
  return /* @__PURE__ */ React25.createElement(Text13, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No oracles found");
2404
2512
  }
2405
- const rows = items.map((oracle) => /* @__PURE__ */ React25.createElement(ListItemContainer, { key: oracle.did }, /* @__PURE__ */ React25.createElement(Flex7, { align: "center", gap: "sm" }, /* @__PURE__ */ React25.createElement(Image4, { radius: 16, w: 32, h: 32, src: oracle.icon }), /* @__PURE__ */ React25.createElement(Stack15, { gap: 0 }, /* @__PURE__ */ React25.createElement(Text13, { size: "sm" }, oracle.name || "-"), /* @__PURE__ */ React25.createElement(Text13, { size: "sm", c: "dimmed" }, oracle.brand || "-"))), /* @__PURE__ */ React25.createElement(Flex7, { align: "center", gap: "md" }, /* @__PURE__ */ React25.createElement(Stack15, { ta: "right", gap: 0 }, /* @__PURE__ */ React25.createElement(Text13, { size: "sm" }, oracle.currency || "-"), /* @__PURE__ */ React25.createElement(Text13, { size: "xs", c: "dimmed" }, oracle.minPoints, " - ", oracle.maxPoints, " pts"), /* @__PURE__ */ React25.createElement(Text13, { size: "xs", c: "dimmed" }, oracle.flowsAmount, " Flows")), mods && /* @__PURE__ */ React25.createElement(ListItemCheckbox, { ariaLabel: `Select oracle ${oracle.did}`, checked: isItemChecked?.(oracle.did), onCheck: (checked) => onItemCheck?.(oracle.did, checked) }))));
2513
+ const rows = items.map((oracle) => /* @__PURE__ */ React25.createElement(ListItemContainer, { key: oracle.did }, /* @__PURE__ */ React25.createElement(Flex8, { align: "center", gap: "sm" }, /* @__PURE__ */ React25.createElement(Image4, { radius: 16, w: 32, h: 32, src: oracle.icon }), /* @__PURE__ */ React25.createElement(Stack15, { gap: 0 }, /* @__PURE__ */ React25.createElement(Text13, { size: "sm" }, oracle.name || "-"), /* @__PURE__ */ React25.createElement(Text13, { size: "sm", c: "dimmed" }, oracle.brand || "-"))), /* @__PURE__ */ React25.createElement(Flex8, { align: "center", gap: "md" }, /* @__PURE__ */ React25.createElement(Stack15, { ta: "right", gap: 0 }, /* @__PURE__ */ React25.createElement(Text13, { size: "sm" }, oracle.currency || "-"), /* @__PURE__ */ React25.createElement(Text13, { size: "xs", c: "dimmed" }, oracle.minPoints, " - ", oracle.maxPoints, " pts"), /* @__PURE__ */ React25.createElement(Text13, { size: "xs", c: "dimmed" }, oracle.flowsAmount, " Flows")), mods && /* @__PURE__ */ React25.createElement(ListItemCheckbox, { ariaLabel: `Select oracle ${oracle.did}`, checked: isItemChecked?.(oracle.did), onCheck: (checked) => onItemCheck?.(oracle.did, checked) }))));
2406
2514
  return /* @__PURE__ */ React25.createElement(Box7, { flex: 1 }, /* @__PURE__ */ React25.createElement(Stack15, null, rows));
2407
2515
  };
2408
2516
 
2409
2517
  // src/mantine/blocks/list/pods/PODsList.tsx
2410
2518
  import React26 from "react";
2411
- import { Text as Text14, Box as Box8, Image as Image5, Stack as Stack16, Flex as Flex8 } from "@mantine/core";
2519
+ import { Text as Text14, Box as Box8, Image as Image5, Stack as Stack16, Flex as Flex9 } from "@mantine/core";
2412
2520
  var PodsList = ({ items, mods, isItemChecked, onItemCheck }) => {
2413
2521
  if (!items || items.length === 0) {
2414
2522
  return /* @__PURE__ */ React26.createElement(Text14, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No PODs found");
2415
2523
  }
2416
- const rows = items.map((pod) => /* @__PURE__ */ React26.createElement(ListItemContainer, { key: pod.did }, /* @__PURE__ */ React26.createElement(Flex8, { align: "center", gap: "sm" }, /* @__PURE__ */ React26.createElement(Image5, { radius: 16, w: 32, h: 32, src: pod.icon }), /* @__PURE__ */ React26.createElement(Stack16, { gap: 0 }, /* @__PURE__ */ React26.createElement(Text14, { size: "sm" }, pod.name || "-"), /* @__PURE__ */ React26.createElement(Text14, { size: "sm", c: "dimmed" }, pod.startDate, " \u2192 ", pod.endDate))), /* @__PURE__ */ React26.createElement(Flex8, { align: "center", gap: "md" }, /* @__PURE__ */ React26.createElement(Stack16, { ta: "right", gap: 0 }, /* @__PURE__ */ React26.createElement(Text14, { size: "sm" }, pod.members, " Members"), /* @__PURE__ */ React26.createElement(Text14, { size: "sm", c: "dimmed" }, pod.totalProposals, " Proposals")), mods && /* @__PURE__ */ React26.createElement(ListItemCheckbox, { ariaLabel: `Select pod ${pod.did}`, checked: isItemChecked?.(pod.did), onCheck: (checked) => onItemCheck?.(pod.did, checked) }))));
2524
+ const rows = items.map((pod) => /* @__PURE__ */ React26.createElement(ListItemContainer, { key: pod.did }, /* @__PURE__ */ React26.createElement(Flex9, { align: "center", gap: "sm" }, /* @__PURE__ */ React26.createElement(Image5, { radius: 16, w: 32, h: 32, src: pod.icon }), /* @__PURE__ */ React26.createElement(Stack16, { gap: 0 }, /* @__PURE__ */ React26.createElement(Text14, { size: "sm" }, pod.name || "-"), /* @__PURE__ */ React26.createElement(Text14, { size: "sm", c: "dimmed" }, pod.startDate, " \u2192 ", pod.endDate))), /* @__PURE__ */ React26.createElement(Flex9, { align: "center", gap: "md" }, /* @__PURE__ */ React26.createElement(Stack16, { ta: "right", gap: 0 }, /* @__PURE__ */ React26.createElement(Text14, { size: "sm" }, pod.members, " Members"), /* @__PURE__ */ React26.createElement(Text14, { size: "sm", c: "dimmed" }, pod.totalProposals, " Proposals")), mods && /* @__PURE__ */ React26.createElement(ListItemCheckbox, { ariaLabel: `Select pod ${pod.did}`, checked: isItemChecked?.(pod.did), onCheck: (checked) => onItemCheck?.(pod.did, checked) }))));
2417
2525
  return /* @__PURE__ */ React26.createElement(Box8, { flex: 1 }, /* @__PURE__ */ React26.createElement(Stack16, null, rows));
2418
2526
  };
2419
2527
 
2420
2528
  // src/mantine/blocks/list/proposals/ProposalsList.tsx
2421
2529
  import React27 from "react";
2422
- import { Text as Text15, Box as Box9, Image as Image6, Stack as Stack17, Flex as Flex9, Badge as Badge4 } from "@mantine/core";
2530
+ import { Text as Text15, Box as Box9, Image as Image6, Stack as Stack17, Flex as Flex10, Badge as Badge4 } from "@mantine/core";
2423
2531
  var ProposalsList = ({ items, mods, isItemChecked, onItemCheck }) => {
2424
2532
  if (!items || items.length === 0) {
2425
2533
  return /* @__PURE__ */ React27.createElement(Text15, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No proposals found");
2426
2534
  }
2427
- const rows = items.map((proposal) => /* @__PURE__ */ React27.createElement(ListItemContainer, { key: proposal.did }, /* @__PURE__ */ React27.createElement(Flex9, { align: "center", gap: "sm" }, /* @__PURE__ */ React27.createElement(Image6, { radius: 16, w: 32, h: 32, src: proposal.icon }), /* @__PURE__ */ React27.createElement(Stack17, { gap: 0 }, /* @__PURE__ */ React27.createElement(Text15, { size: "sm" }, proposal.name || "-"), /* @__PURE__ */ React27.createElement(Text15, { size: "xs", c: "dimmed" }, proposal.description || "-"))), /* @__PURE__ */ React27.createElement(Flex9, { align: "center", gap: "md" }, /* @__PURE__ */ React27.createElement(Stack17, { ta: "right", align: "end", gap: 0 }, /* @__PURE__ */ React27.createElement(Badge4, { size: "sm", variant: "light", color: "blue", style: { fontFamily: "monospace", fontSize: "10px" } }, proposal.status), /* @__PURE__ */ React27.createElement(Text15, { size: "sm", c: "dimmed" }, proposal.isVotedOn ? "Voted" : "Not voted")), mods && /* @__PURE__ */ React27.createElement(ListItemCheckbox, { ariaLabel: `Select proposal ${proposal.did}`, checked: isItemChecked?.(proposal.did), onCheck: (checked) => onItemCheck?.(proposal.did, checked) }))));
2535
+ const rows = items.map((proposal) => /* @__PURE__ */ React27.createElement(ListItemContainer, { key: proposal.did }, /* @__PURE__ */ React27.createElement(Flex10, { align: "center", gap: "sm" }, /* @__PURE__ */ React27.createElement(Image6, { radius: 16, w: 32, h: 32, src: proposal.icon }), /* @__PURE__ */ React27.createElement(Stack17, { gap: 0 }, /* @__PURE__ */ React27.createElement(Text15, { size: "sm" }, proposal.name || "-"), /* @__PURE__ */ React27.createElement(Text15, { size: "xs", c: "dimmed" }, proposal.description || "-"))), /* @__PURE__ */ React27.createElement(Flex10, { align: "center", gap: "md" }, /* @__PURE__ */ React27.createElement(Stack17, { ta: "right", align: "end", gap: 0 }, /* @__PURE__ */ React27.createElement(Badge4, { size: "sm", variant: "light", color: "blue", style: { fontFamily: "monospace", fontSize: "10px" } }, proposal.status), /* @__PURE__ */ React27.createElement(Text15, { size: "sm", c: "dimmed" }, proposal.isVotedOn ? "Voted" : "Not voted")), mods && /* @__PURE__ */ React27.createElement(ListItemCheckbox, { ariaLabel: `Select proposal ${proposal.did}`, checked: isItemChecked?.(proposal.did), onCheck: (checked) => onItemCheck?.(proposal.did, checked) }))));
2428
2536
  return /* @__PURE__ */ React27.createElement(Box9, { flex: 1 }, /* @__PURE__ */ React27.createElement(Stack17, null, rows));
2429
2537
  };
2430
2538
 
2431
2539
  // src/mantine/blocks/list/requests/RequestsList.tsx
2432
2540
  import React28 from "react";
2433
- import { Text as Text16, Box as Box10, Image as Image7, Stack as Stack18, Flex as Flex10 } from "@mantine/core";
2541
+ import { Text as Text16, Box as Box10, Image as Image7, Stack as Stack18, Flex as Flex11 } from "@mantine/core";
2434
2542
  var RequestsList = ({ items, mods, isItemChecked, onItemCheck }) => {
2435
2543
  if (!items || items.length === 0) {
2436
2544
  return /* @__PURE__ */ React28.createElement(Text16, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No requests found");
2437
2545
  }
2438
- const rows = items.map((request) => /* @__PURE__ */ React28.createElement(ListItemContainer, { key: request.did }, /* @__PURE__ */ React28.createElement(Flex10, { align: "center", gap: "sm" }, /* @__PURE__ */ React28.createElement(Image7, { radius: 16, w: 32, h: 32, src: request.icon }), /* @__PURE__ */ React28.createElement(Stack18, { gap: 0 }, /* @__PURE__ */ React28.createElement(Text16, { size: "sm" }, request.name || "-"), /* @__PURE__ */ React28.createElement(Text16, { size: "sm", c: "dimmed" }, request.brand || "-"))), /* @__PURE__ */ React28.createElement(Flex10, { align: "center", gap: "md" }, /* @__PURE__ */ React28.createElement(Stack18, { ta: "right", gap: 0 }, /* @__PURE__ */ React28.createElement(Text16, { size: "sm", c: "dimmed" }, request.currency || "", request.budget ?? "-"), /* @__PURE__ */ React28.createElement(Text16, { size: "xs", c: "dimmed" }, request.totalApplications ?? 0, " Applications")), mods && /* @__PURE__ */ React28.createElement(ListItemCheckbox, { ariaLabel: `Select request ${request.did}`, checked: isItemChecked?.(request.did), onCheck: (checked) => onItemCheck?.(request.did, checked) }))));
2546
+ const rows = items.map((request) => /* @__PURE__ */ React28.createElement(ListItemContainer, { key: request.did }, /* @__PURE__ */ React28.createElement(Flex11, { align: "center", gap: "sm" }, /* @__PURE__ */ React28.createElement(Image7, { radius: 16, w: 32, h: 32, src: request.icon }), /* @__PURE__ */ React28.createElement(Stack18, { gap: 0 }, /* @__PURE__ */ React28.createElement(Text16, { size: "sm" }, request.name || "-"), /* @__PURE__ */ React28.createElement(Text16, { size: "sm", c: "dimmed" }, request.brand || "-"))), /* @__PURE__ */ React28.createElement(Flex11, { align: "center", gap: "md" }, /* @__PURE__ */ React28.createElement(Stack18, { ta: "right", gap: 0 }, /* @__PURE__ */ React28.createElement(Text16, { size: "sm", c: "dimmed" }, request.currency || "", request.budget ?? "-"), /* @__PURE__ */ React28.createElement(Text16, { size: "xs", c: "dimmed" }, request.totalApplications ?? 0, " Applications")), mods && /* @__PURE__ */ React28.createElement(ListItemCheckbox, { ariaLabel: `Select request ${request.did}`, checked: isItemChecked?.(request.did), onCheck: (checked) => onItemCheck?.(request.did, checked) }))));
2439
2547
  return /* @__PURE__ */ React28.createElement(Box10, { flex: 1 }, /* @__PURE__ */ React28.createElement(Stack18, null, rows));
2440
2548
  };
2441
2549
 
2442
2550
  // src/mantine/blocks/list/members/MembersList.tsx
2443
2551
  import React29 from "react";
2444
- import { Text as Text17, Box as Box11, Image as Image8, Stack as Stack19, Flex as Flex11 } from "@mantine/core";
2552
+ import { Text as Text17, Box as Box11, Image as Image8, Stack as Stack19, Flex as Flex12 } from "@mantine/core";
2445
2553
  var MembersList = ({ items, mods, isItemChecked, onItemCheck }) => {
2446
2554
  if (!items || items.length === 0) {
2447
2555
  return /* @__PURE__ */ React29.createElement(Text17, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No members found");
2448
2556
  }
2449
- const rows = items.map((member) => /* @__PURE__ */ React29.createElement(ListItemContainer, { key: member.did }, /* @__PURE__ */ React29.createElement(Flex11, { align: "center", gap: "sm" }, /* @__PURE__ */ React29.createElement(Image8, { radius: 16, w: 32, h: 32, src: member.icon }), /* @__PURE__ */ React29.createElement(Stack19, { gap: 0 }, /* @__PURE__ */ React29.createElement(Text17, { size: "sm" }, member.username || "-"), /* @__PURE__ */ React29.createElement(Text17, { size: "xs", c: "dimmed" }, member.address || "-"))), /* @__PURE__ */ React29.createElement(Flex11, { align: "center", gap: "md" }, /* @__PURE__ */ React29.createElement(Stack19, { ta: "right", gap: 0 }, /* @__PURE__ */ React29.createElement(Text17, { size: "sm" }, member.percentage), /* @__PURE__ */ React29.createElement(Text17, { size: "sm", c: "dimmed" }, member.role)), mods && /* @__PURE__ */ React29.createElement(ListItemCheckbox, { ariaLabel: `Select member ${member.did}`, checked: isItemChecked?.(member.did), onCheck: (checked) => onItemCheck?.(member.did, checked) }))));
2557
+ const rows = items.map((member) => /* @__PURE__ */ React29.createElement(ListItemContainer, { key: member.did }, /* @__PURE__ */ React29.createElement(Flex12, { align: "center", gap: "sm" }, /* @__PURE__ */ React29.createElement(Image8, { radius: 16, w: 32, h: 32, src: member.icon }), /* @__PURE__ */ React29.createElement(Stack19, { gap: 0 }, /* @__PURE__ */ React29.createElement(Text17, { size: "sm" }, member.username || "-"), /* @__PURE__ */ React29.createElement(Text17, { size: "xs", c: "dimmed" }, member.address || "-"))), /* @__PURE__ */ React29.createElement(Flex12, { align: "center", gap: "md" }, /* @__PURE__ */ React29.createElement(Stack19, { ta: "right", gap: 0 }, /* @__PURE__ */ React29.createElement(Text17, { size: "sm" }, member.percentage), /* @__PURE__ */ React29.createElement(Text17, { size: "sm", c: "dimmed" }, member.role)), mods && /* @__PURE__ */ React29.createElement(ListItemCheckbox, { ariaLabel: `Select member ${member.did}`, checked: isItemChecked?.(member.did), onCheck: (checked) => onItemCheck?.(member.did, checked) }))));
2450
2558
  return /* @__PURE__ */ React29.createElement(Box11, { flex: 1 }, /* @__PURE__ */ React29.createElement(Stack19, null, rows));
2451
2559
  };
2452
2560
 
2453
2561
  // src/mantine/blocks/list/validators/ValidatorsList.tsx
2454
2562
  import React30 from "react";
2455
- import { Text as Text18, Box as Box12, Image as Image9, Stack as Stack20, Flex as Flex12 } from "@mantine/core";
2563
+ import { Text as Text18, Box as Box12, Image as Image9, Stack as Stack20, Flex as Flex13 } from "@mantine/core";
2456
2564
 
2457
2565
  // src/core/utils/numbers.ts
2458
2566
  var numberFormatter = (num, digits) => {
@@ -2483,7 +2591,7 @@ var ValidatorsList = ({ items, mods, isItemChecked, onItemCheck }) => {
2483
2591
  if (!items || items.length === 0) {
2484
2592
  return /* @__PURE__ */ React30.createElement(Text18, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No validators found");
2485
2593
  }
2486
- const rows = items.map((v) => /* @__PURE__ */ React30.createElement(ListItemContainer, { key: v.did }, /* @__PURE__ */ React30.createElement(Flex12, { align: "center", gap: "sm" }, /* @__PURE__ */ React30.createElement(Image9, { radius: 16, w: 32, h: 32, src: v.icon }), /* @__PURE__ */ React30.createElement(Stack20, { gap: 0 }, /* @__PURE__ */ React30.createElement(Text18, { size: "sm" }, v.name || "-"), /* @__PURE__ */ React30.createElement(Text18, { size: "xs", c: "dimmed" }, v.description || "-"))), /* @__PURE__ */ React30.createElement(Flex12, { align: "center", gap: "md" }, /* @__PURE__ */ React30.createElement(Stack20, { ta: "right", gap: 0 }, /* @__PURE__ */ React30.createElement(Text18, { size: "sm" }, numberFormatter(getDisplayDelegatedTokensFromValidator(v), 2), " ", v.currency), /* @__PURE__ */ React30.createElement(Text18, { size: "sm", c: "dimmed" }, v.commission, "% fee"), /* @__PURE__ */ React30.createElement(Text18, { size: "xs", c: "dimmed" }, v.isActive ? "Active" : "Inactive", " \u2022 ", v.isStaked ? "Staked" : "Not staked", " \u2022 ", v.isBonding ? "Bonding" : "Not bonding")), mods && /* @__PURE__ */ React30.createElement(ListItemCheckbox, { ariaLabel: `Select validator ${v.did}`, checked: isItemChecked?.(v.did), onCheck: (checked) => onItemCheck?.(v.did, checked) }))));
2594
+ const rows = items.map((v) => /* @__PURE__ */ React30.createElement(ListItemContainer, { key: v.did }, /* @__PURE__ */ React30.createElement(Flex13, { align: "center", gap: "sm" }, /* @__PURE__ */ React30.createElement(Image9, { radius: 16, w: 32, h: 32, src: v.icon }), /* @__PURE__ */ React30.createElement(Stack20, { gap: 0 }, /* @__PURE__ */ React30.createElement(Text18, { size: "sm" }, v.name || "-"), /* @__PURE__ */ React30.createElement(Text18, { size: "xs", c: "dimmed" }, v.description || "-"))), /* @__PURE__ */ React30.createElement(Flex13, { align: "center", gap: "md" }, /* @__PURE__ */ React30.createElement(Stack20, { ta: "right", gap: 0 }, /* @__PURE__ */ React30.createElement(Text18, { size: "sm" }, numberFormatter(getDisplayDelegatedTokensFromValidator(v), 2), " ", v.currency), /* @__PURE__ */ React30.createElement(Text18, { size: "sm", c: "dimmed" }, v.commission, "% fee"), /* @__PURE__ */ React30.createElement(Text18, { size: "xs", c: "dimmed" }, v.isActive ? "Active" : "Inactive", " \u2022 ", v.isStaked ? "Staked" : "Not staked", " \u2022 ", v.isBonding ? "Bonding" : "Not bonding")), mods && /* @__PURE__ */ React30.createElement(ListItemCheckbox, { ariaLabel: `Select validator ${v.did}`, checked: isItemChecked?.(v.did), onCheck: (checked) => onItemCheck?.(v.did, checked) }))));
2487
2595
  return /* @__PURE__ */ React30.createElement(Box12, { flex: 1 }, /* @__PURE__ */ React30.createElement(Stack20, null, rows));
2488
2596
  };
2489
2597
 
@@ -2582,7 +2690,7 @@ function filterListItems(items, filterOption) {
2582
2690
  }
2583
2691
 
2584
2692
  // src/mantine/blocks/list/flow/ListFlowView.tsx
2585
- import { IconArrowDown as IconArrowDown2, IconArrowRight as IconArrowRight2, IconArrowUp as IconArrowUp2, IconChevronDown, IconChevronUp, IconRefresh, IconSettings, IconAlertCircle } from "@tabler/icons-react";
2693
+ import { IconArrowDown as IconArrowDown2, IconArrowUp as IconArrowUp2, IconChevronDown, IconChevronUp, IconRefresh, IconSettings, IconAlertCircle } from "@tabler/icons-react";
2586
2694
 
2587
2695
  // src/mantine/blocks/list/ListPagination.tsx
2588
2696
  import React33 from "react";
@@ -2616,12 +2724,12 @@ var DEFAULT_PAGE_SIZE = 5;
2616
2724
 
2617
2725
  // src/mantine/blocks/list/dao_members/MembersList.tsx
2618
2726
  import React34 from "react";
2619
- import { Text as Text21, Box as Box13, Image as Image10, Stack as Stack21, Flex as Flex13 } from "@mantine/core";
2727
+ import { Text as Text21, Box as Box13, Image as Image10, Stack as Stack21, Flex as Flex14 } from "@mantine/core";
2620
2728
  var DaoMembersList = ({ items, mods, isItemChecked, onItemCheck }) => {
2621
2729
  if (!items || items.length === 0) {
2622
2730
  return /* @__PURE__ */ React34.createElement(Text21, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No members found");
2623
2731
  }
2624
- const rows = items.map((member) => /* @__PURE__ */ React34.createElement(ListItemContainer, { key: member.did }, /* @__PURE__ */ React34.createElement(Flex13, { align: "center", gap: "sm" }, /* @__PURE__ */ React34.createElement(Image10, { radius: 16, w: 32, h: 32, src: member.icon }), /* @__PURE__ */ React34.createElement(Stack21, { gap: 0 }, /* @__PURE__ */ React34.createElement(Text21, { size: "sm", fw: 500 }, member.username || "Unknown User"), /* @__PURE__ */ React34.createElement(Text21, { size: "xs", c: "dimmed", lineClamp: 1 }, member.address || "No address"))), /* @__PURE__ */ React34.createElement(Flex13, { align: "center", gap: "md" }, /* @__PURE__ */ React34.createElement(Stack21, { ta: "right", gap: 0 }, /* @__PURE__ */ React34.createElement(Text21, { size: "sm", fw: 500, c: "blue" }, member.percentage || "0%"), /* @__PURE__ */ React34.createElement(Text21, { size: "xs", c: "dimmed", tt: "capitalize" }, member.role || "member")), mods && /* @__PURE__ */ React34.createElement(
2732
+ const rows = items.map((member) => /* @__PURE__ */ React34.createElement(ListItemContainer, { key: member.did }, /* @__PURE__ */ React34.createElement(Flex14, { align: "center", gap: "sm" }, /* @__PURE__ */ React34.createElement(Image10, { radius: 16, w: 32, h: 32, src: member.icon }), /* @__PURE__ */ React34.createElement(Stack21, { gap: 0 }, /* @__PURE__ */ React34.createElement(Text21, { size: "sm", fw: 500 }, member.username || "Unknown User"), /* @__PURE__ */ React34.createElement(Text21, { size: "xs", c: "dimmed", lineClamp: 1 }, member.address || "No address"))), /* @__PURE__ */ React34.createElement(Flex14, { align: "center", gap: "md" }, /* @__PURE__ */ React34.createElement(Stack21, { ta: "right", gap: 0 }, /* @__PURE__ */ React34.createElement(Text21, { size: "sm", fw: 500, c: "blue" }, member.percentage || "0%"), /* @__PURE__ */ React34.createElement(Text21, { size: "xs", c: "dimmed", tt: "capitalize" }, member.role || "member")), mods && /* @__PURE__ */ React34.createElement(
2625
2733
  ListItemCheckbox,
2626
2734
  {
2627
2735
  ariaLabel: `Select member ${member.username || member.did}`,
@@ -2638,14 +2746,14 @@ import { Paper as Paper4, CloseButton as CloseButton3, Stack as Stack23, Alert a
2638
2746
 
2639
2747
  // src/mantine/blocks/list/components/SelectionPanelContent.tsx
2640
2748
  import React35 from "react";
2641
- import { Stack as Stack22, Text as Text22, Title as Title3, Divider as Divider2, Flex as Flex14, Paper as Paper3, Group as Group6 } from "@mantine/core";
2749
+ import { Stack as Stack22, Text as Text22, Title as Title3, Divider as Divider2, Flex as Flex15, Paper as Paper3, Group as Group6 } from "@mantine/core";
2642
2750
  import { useHover } from "@mantine/hooks";
2643
2751
  import { IconArrowRight, IconTarget } from "@tabler/icons-react";
2644
2752
  var SelectionPanelHeader = ({ title, description }) => {
2645
2753
  return /* @__PURE__ */ React35.createElement(Stack22, { gap: "xs" }, /* @__PURE__ */ React35.createElement(Title3, { fw: 400, order: 3 }, title), /* @__PURE__ */ React35.createElement(Text22, { c: "dimmed" }, description));
2646
2754
  };
2647
2755
  var SelectionPromptItem = ({ prompt }) => {
2648
- return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(Flex14, { gap: 10 }, /* @__PURE__ */ React35.createElement(IconArrowRight, { size: 24, color: "white" }), /* @__PURE__ */ React35.createElement(Text22, null, prompt.text)), /* @__PURE__ */ React35.createElement(Divider2, { c: "dimmed", h: 1 }));
2756
+ return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(Flex15, { gap: 10 }, /* @__PURE__ */ React35.createElement(IconArrowRight, { size: 24, color: "white" }), /* @__PURE__ */ React35.createElement(Text22, null, prompt.text)), /* @__PURE__ */ React35.createElement(Divider2, { c: "dimmed", h: 1 }));
2649
2757
  };
2650
2758
  var SelectionPrompts = ({ prompts }) => {
2651
2759
  if (!prompts || prompts.length === 0) return null;
@@ -2808,29 +2916,41 @@ var ListSelectionPanel = ({ selectedIds, listType }) => {
2808
2916
  }
2809
2917
  }
2810
2918
  ),
2811
- loading ? /* @__PURE__ */ React36.createElement(Center, { h: 200 }, /* @__PURE__ */ React36.createElement(Loader, null)) : error ? /* @__PURE__ */ React36.createElement(Alert3, { color: "red", title: "Error" }, /* @__PURE__ */ React36.createElement(Text23, { size: "sm" }, error)) : itemData ? /* @__PURE__ */ React36.createElement(Stack23, { gap: "md", style: { flex: 1 } }, /* @__PURE__ */ React36.createElement(SelectionPanelHeader, { title: panelConfig.title(itemData), description: panelConfig.description(itemData) }), /* @__PURE__ */ React36.createElement(SelectionPrompts, { prompts: panelConfig.prompts(itemData) }), /* @__PURE__ */ React36.createElement(SelectionActionSections, { sections: panelConfig.actionSections(itemData), itemId: selectedItemId, itemData })) : /* @__PURE__ */ React36.createElement(SelectionPanelEmpty, { message: "Failed to load item details" })
2919
+ loading ? /* @__PURE__ */ React36.createElement(Center, { h: 200 }, /* @__PURE__ */ React36.createElement(Loader, null)) : error ? /* @__PURE__ */ React36.createElement(Alert3, { color: "red", title: "Error" }, /* @__PURE__ */ React36.createElement(Text23, { size: "sm" }, error)) : itemData ? /* @__PURE__ */ React36.createElement(Stack23, { gap: "md", style: { flex: 1 } }, /* @__PURE__ */ React36.createElement(SelectionPanelHeader, { title: panelConfig.title(itemData), description: panelConfig.description(itemData) }), panelConfig?.image && /* @__PURE__ */ React36.createElement(
2920
+ "img",
2921
+ {
2922
+ src: panelConfig?.image(itemData),
2923
+ alt: "Selected item preview",
2924
+ style: {
2925
+ borderRadius: 8,
2926
+ width: "100%",
2927
+ height: 240,
2928
+ objectFit: "cover"
2929
+ }
2930
+ }
2931
+ ), /* @__PURE__ */ React36.createElement(SelectionPrompts, { prompts: panelConfig.prompts(itemData) }), /* @__PURE__ */ React36.createElement(SelectionActionSections, { sections: panelConfig.actionSections(itemData), itemId: selectedItemId, itemData })) : /* @__PURE__ */ React36.createElement(SelectionPanelEmpty, { message: "Failed to load item details" })
2812
2932
  );
2813
2933
  };
2814
2934
 
2815
2935
  // src/mantine/blocks/list/projects/ProjectsList.tsx
2816
2936
  import React37 from "react";
2817
- import { Text as Text24, Box as Box14, Image as Image11, Stack as Stack24, Flex as Flex15 } from "@mantine/core";
2937
+ import { Text as Text24, Box as Box14, Image as Image11, Stack as Stack24, Flex as Flex16 } from "@mantine/core";
2818
2938
  var ProjectsList = ({ items, mods, isItemChecked, onItemCheck }) => {
2819
2939
  if (!items || items.length === 0) {
2820
2940
  return /* @__PURE__ */ React37.createElement(Text24, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No Projects found");
2821
2941
  }
2822
- const rows = items.map((project) => /* @__PURE__ */ React37.createElement(ListItemContainer, { key: project.did }, /* @__PURE__ */ React37.createElement(Flex15, { align: "center", gap: "sm" }, /* @__PURE__ */ React37.createElement(Image11, { radius: 16, w: 32, h: 32, src: project.icon }), /* @__PURE__ */ React37.createElement(Stack24, { gap: 0 }, /* @__PURE__ */ React37.createElement(Text24, { size: "sm" }, project.name || "-"), /* @__PURE__ */ React37.createElement(Text24, { size: "sm", c: "dimmed" }, shortStr(project.description, 50, 0) || "-"))), /* @__PURE__ */ React37.createElement(Flex15, { align: "center", gap: "md" }, mods && /* @__PURE__ */ React37.createElement(ListItemCheckbox, { ariaLabel: `Select request ${project.did}`, checked: isItemChecked?.(project.did), onCheck: (checked) => onItemCheck?.(project.did, checked) }))));
2942
+ const rows = items.map((project) => /* @__PURE__ */ React37.createElement(ListItemContainer, { key: project.did }, /* @__PURE__ */ React37.createElement(Flex16, { align: "center", gap: "sm" }, /* @__PURE__ */ React37.createElement(Image11, { radius: 16, w: 32, h: 32, src: project.icon }), /* @__PURE__ */ React37.createElement(Stack24, { gap: 0 }, /* @__PURE__ */ React37.createElement(Text24, { size: "sm" }, project.name || "-"), /* @__PURE__ */ React37.createElement(Text24, { size: "sm", c: "dimmed" }, shortStr(project.description, 50, 0) || "-"))), /* @__PURE__ */ React37.createElement(Flex16, { align: "center", gap: "md" }, mods && /* @__PURE__ */ React37.createElement(ListItemCheckbox, { ariaLabel: `Select request ${project.did}`, checked: isItemChecked?.(project.did), onCheck: (checked) => onItemCheck?.(project.did, checked) }))));
2823
2943
  return /* @__PURE__ */ React37.createElement(Box14, { flex: 1 }, /* @__PURE__ */ React37.createElement(Stack24, null, rows));
2824
2944
  };
2825
2945
 
2826
2946
  // src/mantine/blocks/list/daos/DaosList.tsx
2827
2947
  import React38 from "react";
2828
- import { Text as Text25, Box as Box15, Image as Image12, Stack as Stack25, Flex as Flex16 } from "@mantine/core";
2948
+ import { Text as Text25, Box as Box15, Image as Image12, Stack as Stack25, Flex as Flex17 } from "@mantine/core";
2829
2949
  var DaosList = ({ items, mods, isItemChecked, onItemCheck }) => {
2830
2950
  if (!items || items.length === 0) {
2831
2951
  return /* @__PURE__ */ React38.createElement(Text25, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No Daos found");
2832
2952
  }
2833
- const rows = items.map((dao) => /* @__PURE__ */ React38.createElement(ListItemContainer, { key: dao.did }, /* @__PURE__ */ React38.createElement(Flex16, { align: "center", gap: "sm" }, /* @__PURE__ */ React38.createElement(Image12, { radius: 16, w: 32, h: 32, src: dao.icon }), /* @__PURE__ */ React38.createElement(Stack25, { gap: 0 }, /* @__PURE__ */ React38.createElement(Text25, { size: "sm" }, dao.name || "-"), /* @__PURE__ */ React38.createElement(Text25, { size: "sm", c: "dimmed" }, shortStr(dao.description, 50, 0) || "-"))), /* @__PURE__ */ React38.createElement(Flex16, { align: "center", gap: "md" }, mods && /* @__PURE__ */ React38.createElement(ListItemCheckbox, { ariaLabel: `Select request ${dao.did}`, checked: isItemChecked?.(dao.did), onCheck: (checked) => onItemCheck?.(dao.did, checked) }))));
2953
+ const rows = items.map((dao) => /* @__PURE__ */ React38.createElement(ListItemContainer, { key: dao.did }, /* @__PURE__ */ React38.createElement(Flex17, { align: "center", gap: "sm" }, /* @__PURE__ */ React38.createElement(Image12, { radius: 16, w: 32, h: 32, src: dao.icon }), /* @__PURE__ */ React38.createElement(Stack25, { gap: 0 }, /* @__PURE__ */ React38.createElement(Text25, { size: "sm" }, dao.name || "-"), /* @__PURE__ */ React38.createElement(Text25, { size: "sm", c: "dimmed" }, shortStr(dao.description, 50, 0) || "-"))), /* @__PURE__ */ React38.createElement(Flex17, { align: "center", gap: "md" }, mods && /* @__PURE__ */ React38.createElement(ListItemCheckbox, { ariaLabel: `Select request ${dao.did}`, checked: isItemChecked?.(dao.did), onCheck: (checked) => onItemCheck?.(dao.did, checked) }))));
2834
2954
  return /* @__PURE__ */ React38.createElement(Box15, { flex: 1 }, /* @__PURE__ */ React38.createElement(Stack25, null, rows));
2835
2955
  };
2836
2956
 
@@ -2944,7 +3064,7 @@ var ListFlowView = ({ block, editor }) => {
2944
3064
  () => /* @__PURE__ */ React40.createElement(ListSelectionPanel, { editor, block, selectedIds, listType }),
2945
3065
  [editor, block, selectedIds, listType]
2946
3066
  );
2947
- const { open: openSelectionPanel } = usePanel(selectionPanelId, selectionPanelContent);
3067
+ const { open: openSelectionPanel, close: closeSelectionPanel } = usePanel(selectionPanelId, selectionPanelContent);
2948
3068
  useEffect6(() => {
2949
3069
  if (selectionMode === "single" && selectedIds.size > 1) {
2950
3070
  const arr = Array.from(selectedIds);
@@ -2964,15 +3084,21 @@ var ListFlowView = ({ block, editor }) => {
2964
3084
  const nextSelectedIds = new Set(prev);
2965
3085
  if (selectionMode === "single") {
2966
3086
  if (checked) {
3087
+ openSelectionPanel();
2967
3088
  return /* @__PURE__ */ new Set([id]);
2968
3089
  }
2969
3090
  nextSelectedIds.delete(id);
3091
+ closeSelectionPanel();
2970
3092
  return nextSelectedIds;
2971
3093
  }
2972
3094
  if (checked) {
3095
+ openSelectionPanel();
2973
3096
  nextSelectedIds.add(id);
2974
3097
  } else {
2975
3098
  nextSelectedIds.delete(id);
3099
+ if (nextSelectedIds.size === 0) {
3100
+ closeSelectionPanel();
3101
+ }
2976
3102
  }
2977
3103
  return nextSelectedIds;
2978
3104
  });
@@ -3226,10 +3352,10 @@ var ListFlowView = ({ block, editor }) => {
3226
3352
  if (!listType) {
3227
3353
  return /* @__PURE__ */ React40.createElement(Center2, { py: "xl" }, /* @__PURE__ */ React40.createElement(Text26, { size: "sm", c: "dimmed" }, "List not configured"));
3228
3354
  }
3229
- return /* @__PURE__ */ React40.createElement(Stack26, { w: "100%" }, /* @__PURE__ */ React40.createElement(Flex17, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React40.createElement(Title4, { order: 4 }, getListNameByType(listType)), /* @__PURE__ */ React40.createElement(ActionIcon5, { variant: "subtle", size: "sm", onClick: toggle, "aria-label": opened ? "Collapse" : "Expand", title: opened ? "Collapse" : "Expand" }, opened ? /* @__PURE__ */ React40.createElement(IconChevronUp, { size: 18 }) : /* @__PURE__ */ React40.createElement(IconChevronDown, { size: 18 }))), /* @__PURE__ */ React40.createElement(Collapse, { pb: 5, px: 5, in: opened }, /* @__PURE__ */ React40.createElement(Stack26, { mih: totalPages !== 1 ? 500 : void 0, w: "100%" }, /* @__PURE__ */ React40.createElement(Flex17, { align: "center", gap: "xs" }, listSortConfig?.key && /* @__PURE__ */ React40.createElement(Flex17, { align: "center" }, /* @__PURE__ */ React40.createElement(Text26, { size: "xs" }, listSortConfig.key?.replace(/([A-Z])/g, " $1").replace(
3355
+ return /* @__PURE__ */ React40.createElement(Stack26, { w: "100%" }, /* @__PURE__ */ React40.createElement(Flex18, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React40.createElement(Title4, { order: 4 }, getListNameByType(listType)), /* @__PURE__ */ React40.createElement(ActionIcon5, { variant: "subtle", size: "sm", onClick: toggle, "aria-label": opened ? "Collapse" : "Expand", title: opened ? "Collapse" : "Expand" }, opened ? /* @__PURE__ */ React40.createElement(IconChevronUp, { size: 18 }) : /* @__PURE__ */ React40.createElement(IconChevronDown, { size: 18 }))), /* @__PURE__ */ React40.createElement(Collapse, { pb: 5, px: 5, in: opened }, /* @__PURE__ */ React40.createElement(Stack26, { mih: totalPages !== 1 ? 500 : void 0, w: "100%" }, /* @__PURE__ */ React40.createElement(Flex18, { align: "center", gap: "xs" }, listSortConfig?.key && /* @__PURE__ */ React40.createElement(Flex18, { align: "center" }, /* @__PURE__ */ React40.createElement(Text26, { size: "xs" }, listSortConfig.key?.replace(/([A-Z])/g, " $1").replace(
3230
3356
  /^./,
3231
3357
  (str) => str.toUpperCase()
3232
- ), " "), /* @__PURE__ */ React40.createElement(Text26, { lh: 0.5 }, listSortConfig.direction === "asc" && /* @__PURE__ */ React40.createElement(IconArrowUp2, { size: 18 }), listSortConfig.direction === "desc" && /* @__PURE__ */ React40.createElement(IconArrowDown2, { size: 18 }))), selectionMode && /* @__PURE__ */ React40.createElement(Text26, { lh: 0.5 }, selectionMode === "single" ? "Single Selection" : "Multi Selection")), /* @__PURE__ */ React40.createElement(Flex17, { justify: "space-between" }, /* @__PURE__ */ React40.createElement(Flex17, { gap: "xs", align: "center" }, /* @__PURE__ */ React40.createElement(FilterTab, { key: "All", label: "All", isActive: !listFilterConfig?.key, onClick: () => handleFilterChange(null) }), Array.isArray(listFilterConfigOptions) && listFilterConfigOptions.length > 0 && listFilterConfigOptions.map(({ key, label, type }) => /* @__PURE__ */ React40.createElement(
3358
+ ), " "), /* @__PURE__ */ React40.createElement(Text26, { lh: 0.5 }, listSortConfig.direction === "asc" && /* @__PURE__ */ React40.createElement(IconArrowUp2, { size: 18 }), listSortConfig.direction === "desc" && /* @__PURE__ */ React40.createElement(IconArrowDown2, { size: 18 }))), selectionMode && /* @__PURE__ */ React40.createElement(Text26, { lh: 0.5 }, selectionMode === "single" ? "Single Selection" : "Multi Selection")), /* @__PURE__ */ React40.createElement(Flex18, { justify: "space-between" }, /* @__PURE__ */ React40.createElement(Flex18, { gap: "xs", align: "center" }, /* @__PURE__ */ React40.createElement(FilterTab, { key: "All", label: "All", isActive: !listFilterConfig?.key, onClick: () => handleFilterChange(null) }), Array.isArray(listFilterConfigOptions) && listFilterConfigOptions.length > 0 && listFilterConfigOptions.map(({ key, label, type }) => /* @__PURE__ */ React40.createElement(
3233
3359
  FilterTab,
3234
3360
  {
3235
3361
  key: label,
@@ -3237,7 +3363,7 @@ var ListFlowView = ({ block, editor }) => {
3237
3363
  isActive: listFilterConfig?.key === key && listFilterConfig?.value === type,
3238
3364
  onClick: () => handleFilterChange({ key, value: type })
3239
3365
  }
3240
- ))), /* @__PURE__ */ React40.createElement(Flex17, { gap: "xs" }, /* @__PURE__ */ React40.createElement(ActionIcon5, { variant: "subtle", size: "sm", onClick: fetchData, loading }, /* @__PURE__ */ React40.createElement(IconRefresh, { size: 18 })), editable && /* @__PURE__ */ React40.createElement(ActionIcon5, { variant: "subtle", size: "sm", onClick: openPanel }, /* @__PURE__ */ React40.createElement(IconSettings, { size: 18 })), selectedIds.size > 0 && /* @__PURE__ */ React40.createElement(ActionIcon5, { variant: "subtle", size: "sm", onClick: openSelectionPanel }, /* @__PURE__ */ React40.createElement(IconArrowRight2, null)), listConfig && listSortConfigOptions && listSortConfigOptions?.length > 0 && /* @__PURE__ */ React40.createElement(
3366
+ ))), /* @__PURE__ */ React40.createElement(Flex18, { gap: "xs" }, /* @__PURE__ */ React40.createElement(ActionIcon5, { variant: "subtle", size: "sm", onClick: fetchData, loading }, /* @__PURE__ */ React40.createElement(IconRefresh, { size: 18 })), editable && /* @__PURE__ */ React40.createElement(ActionIcon5, { variant: "subtle", size: "sm", onClick: openPanel }, /* @__PURE__ */ React40.createElement(IconSettings, { size: 18 })), listConfig && listSortConfigOptions && listSortConfigOptions?.length > 0 && /* @__PURE__ */ React40.createElement(
3241
3367
  ListActionsMenu,
3242
3368
  {
3243
3369
  onSelectActionClick: (mode) => setSelectionMode(mode),
@@ -3247,7 +3373,7 @@ var ListFlowView = ({ block, editor }) => {
3247
3373
  onChange: (sortOption) => handleSortChange(sortOption),
3248
3374
  onDownloadCsv: data?.items ? () => downloadArrayAsCsv(data.items) : void 0
3249
3375
  }
3250
- ))), /* @__PURE__ */ React40.createElement(Flex17, { flex: 1 }, loading ? /* @__PURE__ */ React40.createElement(Center2, { py: "xl", w: "100%" }, /* @__PURE__ */ React40.createElement(Loader2, { size: "md", mx: "auto" })) : error ? /* @__PURE__ */ React40.createElement(Alert4, { color: "red", title: "Failed to load data", icon: /* @__PURE__ */ React40.createElement(IconAlertCircle, { size: 18 }) }, /* @__PURE__ */ React40.createElement(Stack26, { gap: "xs" }, /* @__PURE__ */ React40.createElement(Text26, { size: "sm" }, showErrorDetails ? error : "Unable to fetch list data"), /* @__PURE__ */ React40.createElement(Group7, { gap: "xs" }, /* @__PURE__ */ React40.createElement(Button5, { size: "xs", variant: "subtle", onClick: fetchData }, "Retry"), /* @__PURE__ */ React40.createElement(Button5, { size: "xs", variant: "subtle", onClick: () => setShowErrorDetails(!showErrorDetails) }, showErrorDetails ? "Hide" : "Show", " Details")))) : /* @__PURE__ */ React40.createElement(Stack26, { flex: 1 }, /* @__PURE__ */ React40.createElement(Stack26, { gap: "md" }, renderListComponent(), /* @__PURE__ */ React40.createElement(
3376
+ ))), /* @__PURE__ */ React40.createElement(Flex18, { flex: 1 }, loading ? /* @__PURE__ */ React40.createElement(Center2, { py: "xl", w: "100%" }, /* @__PURE__ */ React40.createElement(Loader2, { size: "md", mx: "auto" })) : error ? /* @__PURE__ */ React40.createElement(Alert4, { color: "red", title: "Failed to load data", icon: /* @__PURE__ */ React40.createElement(IconAlertCircle, { size: 18 }) }, /* @__PURE__ */ React40.createElement(Stack26, { gap: "xs" }, /* @__PURE__ */ React40.createElement(Text26, { size: "sm" }, showErrorDetails ? error : "Unable to fetch list data"), /* @__PURE__ */ React40.createElement(Group7, { gap: "xs" }, /* @__PURE__ */ React40.createElement(Button5, { size: "xs", variant: "subtle", onClick: fetchData }, "Retry"), /* @__PURE__ */ React40.createElement(Button5, { size: "xs", variant: "subtle", onClick: () => setShowErrorDetails(!showErrorDetails) }, showErrorDetails ? "Hide" : "Show", " Details")))) : /* @__PURE__ */ React40.createElement(Stack26, { flex: 1 }, /* @__PURE__ */ React40.createElement(Stack26, { gap: "md" }, renderListComponent(), /* @__PURE__ */ React40.createElement(
3251
3377
  ListPagination,
3252
3378
  {
3253
3379
  page,
@@ -3434,19 +3560,32 @@ import { Paper as Paper6, CloseButton as CloseButton4, Title as Title5 } from "@
3434
3560
 
3435
3561
  // src/mantine/blocks/proposal/template/GeneralTab.tsx
3436
3562
  import React44, { useEffect as useEffect8, useState as useState8 } from "react";
3437
- import { Stack as Stack27, Text as Text27, TextInput as TextInput5, Textarea as Textarea2, Select as Select3, Loader as Loader3 } from "@mantine/core";
3563
+ import { Stack as Stack27, Text as Text27, TextInput as TextInput5, Textarea as Textarea2, Select as Select3, Loader as Loader3, SegmentedControl as SegmentedControl4 } from "@mantine/core";
3438
3564
  var GeneralTab3 = ({ title, description, coreAddress, onTitleChange, onDescriptionChange, onGroupChange }) => {
3439
3565
  const handlers = useBlocknoteHandlers();
3440
3566
  const [localTitle, setLocalTitle] = useState8(title || "");
3441
3567
  const [localDescription, setLocalDescription] = useState8(description || "");
3442
3568
  const [groups, setGroups] = useState8([]);
3443
3569
  const [loadingGroups, setLoadingGroups] = useState8(false);
3570
+ const [inputMode, setInputMode] = useState8("select");
3571
+ const [manualAddress, setManualAddress] = useState8("");
3444
3572
  useEffect8(() => {
3445
3573
  setLocalTitle(title || "");
3446
3574
  }, [title]);
3447
3575
  useEffect8(() => {
3448
3576
  setLocalDescription(description || "");
3449
3577
  }, [description]);
3578
+ useEffect8(() => {
3579
+ if (coreAddress) {
3580
+ const matchesGroup = groups.some((g) => g.coreAddress === coreAddress);
3581
+ if (matchesGroup) {
3582
+ setInputMode("select");
3583
+ } else {
3584
+ setInputMode("manual");
3585
+ setManualAddress(coreAddress);
3586
+ }
3587
+ }
3588
+ }, [coreAddress, groups]);
3450
3589
  useEffect8(() => {
3451
3590
  const fetchGroups = async () => {
3452
3591
  if (!handlers?.getDAOGroups) {
@@ -3489,6 +3628,17 @@ var GeneralTab3 = ({ title, description, coreAddress, onTitleChange, onDescripti
3489
3628
  }
3490
3629
  }
3491
3630
  )), /* @__PURE__ */ React44.createElement(Stack27, { gap: "xs" }, /* @__PURE__ */ React44.createElement(Text27, { size: "sm", fw: 600 }, "Group"), /* @__PURE__ */ React44.createElement(
3631
+ SegmentedControl4,
3632
+ {
3633
+ value: inputMode,
3634
+ onChange: (value) => setInputMode(value),
3635
+ data: [
3636
+ { label: "Select DAO", value: "select" },
3637
+ { label: "Manual Entry", value: "manual" }
3638
+ ],
3639
+ fullWidth: true
3640
+ }
3641
+ ), inputMode === "select" ? /* @__PURE__ */ React44.createElement(
3492
3642
  Select3,
3493
3643
  {
3494
3644
  placeholder: loadingGroups ? "Loading groups..." : "Select a DAO group",
@@ -3509,6 +3659,17 @@ var GeneralTab3 = ({ title, description, coreAddress, onTitleChange, onDescripti
3509
3659
  rightSection: loadingGroups ? /* @__PURE__ */ React44.createElement(Loader3, { size: "xs" }) : void 0,
3510
3660
  searchable: true
3511
3661
  }
3662
+ ) : /* @__PURE__ */ React44.createElement(
3663
+ TextInput5,
3664
+ {
3665
+ placeholder: "Enter DAO core address",
3666
+ value: manualAddress,
3667
+ onChange: (event) => {
3668
+ const newAddress = event.currentTarget.value;
3669
+ setManualAddress(newAddress);
3670
+ onGroupChange(newAddress);
3671
+ }
3672
+ }
3512
3673
  )));
3513
3674
  };
3514
3675
 
@@ -6589,8 +6750,8 @@ var OnChainProposalCard = ({
6589
6750
  };
6590
6751
 
6591
6752
  // src/mantine/blocks/proposal/flow/FlowConfig.tsx
6592
- import React84, { useCallback as useCallback15, useState as useState21 } from "react";
6593
- import { Paper as Paper7, CloseButton as CloseButton5, Title as Title6, Stack as Stack66, TextInput as TextInput33, Textarea as Textarea18, Button as Button16, Text as Text41, Card as Card18 } from "@mantine/core";
6753
+ import React84, { useCallback as useCallback15, useState as useState21, useEffect as useEffect15 } from "react";
6754
+ import { Paper as Paper7, CloseButton as CloseButton5, Title as Title6, Stack as Stack66, TextInput as TextInput33, Textarea as Textarea18, Button as Button16, Text as Text41, Card as Card18, Select as Select10, Loader as Loader4, SegmentedControl as SegmentedControl5 } from "@mantine/core";
6594
6755
 
6595
6756
  // src/mantine/blocks/proposal/flow/useFlowBusinessLogic.ts
6596
6757
  import { useEffect as useEffect12, useState as useState17 } from "react";
@@ -7173,9 +7334,14 @@ var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated
7173
7334
  // src/mantine/blocks/proposal/flow/FlowConfig.tsx
7174
7335
  var FlowConfig = ({ editor, block }) => {
7175
7336
  const { closePanel } = usePanelStore();
7337
+ const handlers = useBlocknoteHandlers();
7176
7338
  const coreAddress = block.props.coreAddress || "";
7177
7339
  const [errors, setErrors] = useState21({});
7178
7340
  const [isCreating, setIsCreating] = useState21(false);
7341
+ const [groups, setGroups] = useState21([]);
7342
+ const [loadingGroups, setLoadingGroups] = useState21(false);
7343
+ const [inputMode, setInputMode] = useState21("select");
7344
+ const [manualAddress, setManualAddress] = useState21("");
7179
7345
  const { createProposal, title, description, proposalId } = useFlowBusinessLogic({
7180
7346
  block,
7181
7347
  editor
@@ -7193,6 +7359,35 @@ var FlowConfig = ({ editor, block }) => {
7193
7359
  },
7194
7360
  [editor, block]
7195
7361
  );
7362
+ useEffect15(() => {
7363
+ if (coreAddress) {
7364
+ const matchesGroup = groups.some((g) => g.coreAddress === coreAddress);
7365
+ if (matchesGroup) {
7366
+ setInputMode("select");
7367
+ } else {
7368
+ setInputMode("manual");
7369
+ setManualAddress(coreAddress);
7370
+ }
7371
+ }
7372
+ }, [coreAddress, groups]);
7373
+ useEffect15(() => {
7374
+ const fetchGroups = async () => {
7375
+ if (!handlers?.getDAOGroups) {
7376
+ console.warn("getDAOGroups handler not available");
7377
+ return;
7378
+ }
7379
+ setLoadingGroups(true);
7380
+ try {
7381
+ const daoGroups = await handlers.getDAOGroups();
7382
+ setGroups(daoGroups);
7383
+ } catch (error) {
7384
+ console.error("Failed to fetch DAO groups:", error);
7385
+ } finally {
7386
+ setLoadingGroups(false);
7387
+ }
7388
+ };
7389
+ fetchGroups();
7390
+ }, [handlers]);
7196
7391
  const validateForm = () => {
7197
7392
  const newErrors = {};
7198
7393
  if (!title.trim()) {
@@ -7219,7 +7414,52 @@ var FlowConfig = ({ editor, block }) => {
7219
7414
  setIsCreating(false);
7220
7415
  }
7221
7416
  };
7222
- const createProposalTab = /* @__PURE__ */ React84.createElement(Stack66, { gap: "lg" }, coreAddress && /* @__PURE__ */ React84.createElement(Card18, { padding: "sm", radius: "md", withBorder: true }, /* @__PURE__ */ React84.createElement(Text41, { size: "xs", c: "dimmed" }, "Core Address:", " ", /* @__PURE__ */ React84.createElement(Text41, { span: true, ff: "monospace", c: "bright" }, coreAddress.slice(0, 20), "...", coreAddress.slice(-10)))), /* @__PURE__ */ React84.createElement(
7417
+ const createProposalTab = /* @__PURE__ */ React84.createElement(Stack66, { gap: "lg" }, /* @__PURE__ */ React84.createElement(Stack66, { gap: "xs" }, /* @__PURE__ */ React84.createElement(Text41, { size: "sm", fw: 600 }, "DAO Group"), /* @__PURE__ */ React84.createElement(
7418
+ SegmentedControl5,
7419
+ {
7420
+ value: inputMode,
7421
+ onChange: (value) => setInputMode(value),
7422
+ data: [
7423
+ { label: "Select DAO", value: "select" },
7424
+ { label: "Manual Entry", value: "manual" }
7425
+ ],
7426
+ fullWidth: true,
7427
+ disabled: isProposalCreated
7428
+ }
7429
+ ), inputMode === "select" ? /* @__PURE__ */ React84.createElement(
7430
+ Select10,
7431
+ {
7432
+ placeholder: loadingGroups ? "Loading groups..." : "Select a DAO group",
7433
+ value: groups.find((g) => g.coreAddress === coreAddress)?.id || null,
7434
+ onChange: (value) => {
7435
+ if (value) {
7436
+ const selectedGroup = groups.find((g) => g.id === value);
7437
+ if (selectedGroup) {
7438
+ updateProp("coreAddress", selectedGroup.coreAddress);
7439
+ }
7440
+ }
7441
+ },
7442
+ data: groups.map((group) => ({
7443
+ value: group.id,
7444
+ label: group.name
7445
+ })),
7446
+ disabled: loadingGroups || isProposalCreated,
7447
+ rightSection: loadingGroups ? /* @__PURE__ */ React84.createElement(Loader4, { size: "xs" }) : void 0,
7448
+ searchable: true
7449
+ }
7450
+ ) : /* @__PURE__ */ React84.createElement(
7451
+ TextInput33,
7452
+ {
7453
+ placeholder: "Enter DAO core address",
7454
+ value: manualAddress,
7455
+ onChange: (event) => {
7456
+ const newAddress = event.currentTarget.value;
7457
+ setManualAddress(newAddress);
7458
+ updateProp("coreAddress", newAddress);
7459
+ },
7460
+ disabled: isProposalCreated
7461
+ }
7462
+ ), coreAddress && /* @__PURE__ */ React84.createElement(Card18, { padding: "sm", radius: "md", withBorder: true }, /* @__PURE__ */ React84.createElement(Text41, { size: "xs", c: "dimmed" }, "Core Address:", " ", /* @__PURE__ */ React84.createElement(Text41, { span: true, ff: "monospace", c: "bright" }, coreAddress.slice(0, 20), "...", coreAddress.slice(-10))))), /* @__PURE__ */ React84.createElement(
7223
7463
  TextInput33,
7224
7464
  {
7225
7465
  label: "Title",
@@ -7416,23 +7656,393 @@ var ProposalBlockSpec = createReactBlockSpec4(
7416
7656
  );
7417
7657
 
7418
7658
  // src/mantine/blocks/apiRequest/ApiRequestBlockSpec.tsx
7419
- import React93 from "react";
7659
+ import React96 from "react";
7420
7660
  import { createReactBlockSpec as createReactBlockSpec5 } from "@blocknote/react";
7421
7661
 
7422
7662
  // src/mantine/blocks/apiRequest/ApiRequestBlock.tsx
7423
- import React92 from "react";
7663
+ import React95 from "react";
7424
7664
 
7425
7665
  // src/mantine/blocks/apiRequest/template/TemplateView.tsx
7426
- import React90, { useMemo as useMemo13 } from "react";
7666
+ import React93, { useMemo as useMemo16 } from "react";
7427
7667
 
7428
7668
  // src/mantine/blocks/apiRequest/template/TemplateConfig.tsx
7429
- import React89, { useCallback as useCallback16 } from "react";
7430
- import { Paper as Paper9, CloseButton as CloseButton6, Title as Title7 } from "@mantine/core";
7669
+ import React92, { useCallback as useCallback17, useMemo as useMemo15 } from "react";
7670
+ import { Paper as Paper10, CloseButton as CloseButton6, Title as Title7 } from "@mantine/core";
7431
7671
 
7432
7672
  // src/mantine/blocks/apiRequest/template/GeneralTab.tsx
7433
- import React88, { useEffect as useEffect15, useState as useState22 } from "react";
7434
- import { Divider as Divider5, Select as Select10, Stack as Stack67, Text as Text42, TextInput as TextInput34, Textarea as Textarea19, Button as Button17, Group as Group23, ActionIcon as ActionIcon10, Paper as Paper8 } from "@mantine/core";
7673
+ import React90, { useEffect as useEffect16, useState as useState24 } from "react";
7674
+ import { Divider as Divider5, Select as Select11, Stack as Stack68, Text as Text43, TextInput as TextInput34, Textarea as Textarea19, Button as Button18, Group as Group25, ActionIcon as ActionIcon12, Paper as Paper8 } from "@mantine/core";
7435
7675
  import { IconTrash, IconPlus } from "@tabler/icons-react";
7676
+
7677
+ // src/mantine/components/DataInput/DataInput.tsx
7678
+ import React89, { useState as useState23, useCallback as useCallback16, useMemo as useMemo14 } from "react";
7679
+ import { Input as Input2, ActionIcon as ActionIcon11, Tooltip as Tooltip5, Badge as Badge11, Group as Group24 } from "@mantine/core";
7680
+ import { IconVariable, IconX as IconX2 } from "@tabler/icons-react";
7681
+
7682
+ // src/mantine/components/DataInput/BlockPropSelector.tsx
7683
+ import React88, { useState as useState22, useMemo as useMemo13 } from "react";
7684
+ import { Popover, Text as Text42, Stack as Stack67, Group as Group23, ActionIcon as ActionIcon10, Input, ScrollArea as ScrollArea4, Badge as Badge10, Box as Box17, Tooltip as Tooltip4 } from "@mantine/core";
7685
+ import { IconSearch, IconX, IconCircle, IconChevronRight, IconArrowLeft } from "@tabler/icons-react";
7686
+ function buildPropertyTree(properties) {
7687
+ const root = [];
7688
+ properties.forEach((prop) => {
7689
+ const pathParts = prop.name.split(".");
7690
+ let currentLevel = root;
7691
+ pathParts.forEach((part, index) => {
7692
+ const isLastPart = index === pathParts.length - 1;
7693
+ const fullPath = pathParts.slice(0, index + 1).join(".");
7694
+ let existingNode = currentLevel.find((node) => node.name === part);
7695
+ if (!existingNode) {
7696
+ const newNode = {
7697
+ name: part,
7698
+ displayName: isLastPart ? prop.displayName : part,
7699
+ type: isLastPart ? prop.type : "object",
7700
+ fullPath,
7701
+ children: [],
7702
+ isLeaf: isLastPart
7703
+ };
7704
+ currentLevel.push(newNode);
7705
+ existingNode = newNode;
7706
+ }
7707
+ if (!isLastPart) {
7708
+ currentLevel = existingNode.children;
7709
+ }
7710
+ });
7711
+ });
7712
+ return root;
7713
+ }
7714
+ function getBlockDisplayName2(block) {
7715
+ const title = block.props?.title || block.props?.name || block.props?.label;
7716
+ if (title) {
7717
+ return title;
7718
+ }
7719
+ return `${block.type} (${block.id.slice(0, 8)}...)`;
7720
+ }
7721
+ function getBlockTypeColor(blockType) {
7722
+ const colorMap = {
7723
+ checkbox: "blue",
7724
+ proposal: "green",
7725
+ proposalVote: "teal",
7726
+ list: "orange",
7727
+ overview: "purple",
7728
+ proposalActions: "pink",
7729
+ apiRequest: "cyan"
7730
+ };
7731
+ return colorMap[blockType] || "gray";
7732
+ }
7733
+ function BlockPropSelector({ children, opened, onClose, onSelect, editorDocument, currentBlockId }) {
7734
+ const [searchQuery, setSearchQuery] = useState22("");
7735
+ const [selectedBlock, setSelectedBlock] = useState22(null);
7736
+ const [navigationPath, setNavigationPath] = useState22([]);
7737
+ const availableBlocks = useMemo13(() => {
7738
+ if (!editorDocument) return [];
7739
+ return editorDocument.filter((block) => {
7740
+ if (currentBlockId && block.id === currentBlockId) {
7741
+ return false;
7742
+ }
7743
+ const props = getConditionableProperties(block.type);
7744
+ return props.length > 0;
7745
+ }).map((block) => ({
7746
+ ...block,
7747
+ displayName: getBlockDisplayName2(block),
7748
+ properties: getConditionableProperties(block.type, block),
7749
+ propertyTree: buildPropertyTree(getConditionableProperties(block.type, block))
7750
+ }));
7751
+ }, [editorDocument, currentBlockId]);
7752
+ const filteredBlocks = useMemo13(() => {
7753
+ if (!searchQuery.trim()) {
7754
+ return availableBlocks;
7755
+ }
7756
+ const query = searchQuery.toLowerCase();
7757
+ return availableBlocks.filter((block) => {
7758
+ if (block.displayName.toLowerCase().includes(query)) {
7759
+ return true;
7760
+ }
7761
+ if (block.type.toLowerCase().includes(query)) {
7762
+ return true;
7763
+ }
7764
+ return block.properties.some((prop) => prop.name.toLowerCase().includes(query) || prop.displayName.toLowerCase().includes(query));
7765
+ });
7766
+ }, [availableBlocks, searchQuery]);
7767
+ const currentNodes = useMemo13(() => {
7768
+ if (!selectedBlock) return [];
7769
+ if (navigationPath.length === 0) {
7770
+ return selectedBlock.propertyTree;
7771
+ } else {
7772
+ const lastNode = navigationPath[navigationPath.length - 1];
7773
+ return lastNode.children;
7774
+ }
7775
+ }, [selectedBlock, navigationPath]);
7776
+ const handleBlockSelect = (block) => {
7777
+ setSelectedBlock(block);
7778
+ setNavigationPath([]);
7779
+ setSearchQuery("");
7780
+ };
7781
+ const handleNodeClick = (node) => {
7782
+ if (node.isLeaf) {
7783
+ onSelect({
7784
+ blockId: selectedBlock.id,
7785
+ blockType: selectedBlock.type,
7786
+ propName: node.fullPath,
7787
+ propDisplayName: node.displayName
7788
+ });
7789
+ handleClose();
7790
+ } else {
7791
+ setNavigationPath([...navigationPath, node]);
7792
+ }
7793
+ };
7794
+ const handleBack = () => {
7795
+ if (navigationPath.length > 0) {
7796
+ setNavigationPath(navigationPath.slice(0, -1));
7797
+ } else {
7798
+ setSelectedBlock(null);
7799
+ }
7800
+ };
7801
+ const handleClose = () => {
7802
+ setSelectedBlock(null);
7803
+ setNavigationPath([]);
7804
+ setSearchQuery("");
7805
+ onClose();
7806
+ };
7807
+ return /* @__PURE__ */ React88.createElement(Popover, { opened, onClose: handleClose, position: "bottom-end", width: 420, shadow: "md", withinPortal: true }, /* @__PURE__ */ React88.createElement(Popover.Target, null, children), /* @__PURE__ */ React88.createElement(Popover.Dropdown, { p: "md" }, /* @__PURE__ */ React88.createElement(Stack67, { gap: "md" }, /* @__PURE__ */ React88.createElement(Group23, { justify: "space-between", align: "center" }, /* @__PURE__ */ React88.createElement(Group23, { gap: "xs" }, (selectedBlock || navigationPath.length > 0) && /* @__PURE__ */ React88.createElement(ActionIcon10, { variant: "subtle", size: "sm", onClick: handleBack }, /* @__PURE__ */ React88.createElement(IconArrowLeft, { size: 16 })), /* @__PURE__ */ React88.createElement(Text42, { fw: 600, size: "sm" }, !selectedBlock ? "Select a Block" : navigationPath.length === 0 ? `${selectedBlock.displayName} - Select Property` : `${navigationPath[navigationPath.length - 1].displayName}`)), /* @__PURE__ */ React88.createElement(ActionIcon10, { variant: "subtle", size: "sm", onClick: handleClose }, /* @__PURE__ */ React88.createElement(IconX, { size: 16 }))), !selectedBlock && /* @__PURE__ */ React88.createElement(
7808
+ Input,
7809
+ {
7810
+ placeholder: "Search blocks and properties...",
7811
+ leftSection: /* @__PURE__ */ React88.createElement(IconSearch, { size: 16 }),
7812
+ value: searchQuery,
7813
+ onChange: (e) => setSearchQuery(e.currentTarget.value),
7814
+ size: "xs",
7815
+ rightSection: searchQuery && /* @__PURE__ */ React88.createElement(ActionIcon10, { variant: "subtle", onClick: () => setSearchQuery(""), size: "xs" }, /* @__PURE__ */ React88.createElement(IconX, { size: 12 }))
7816
+ }
7817
+ ), /* @__PURE__ */ React88.createElement(ScrollArea4, { h: 300, type: "auto" }, !selectedBlock ? (
7818
+ // Block selection view
7819
+ filteredBlocks.length === 0 ? /* @__PURE__ */ React88.createElement(Text42, { c: "dimmed", ta: "center", py: "xl", size: "sm" }, availableBlocks.length === 0 ? "No blocks with referenceable properties found" : "No blocks match your search") : /* @__PURE__ */ React88.createElement(Stack67, { gap: "sm" }, filteredBlocks.map((block) => /* @__PURE__ */ React88.createElement(
7820
+ Box17,
7821
+ {
7822
+ key: block.id,
7823
+ onClick: () => handleBlockSelect(block),
7824
+ style: {
7825
+ borderRadius: "6px",
7826
+ border: "1px solid var(--mantine-color-gray-3)",
7827
+ padding: "12px",
7828
+ cursor: "pointer",
7829
+ transition: "all 0.15s ease"
7830
+ },
7831
+ onMouseEnter: (e) => {
7832
+ e.currentTarget.style.backgroundColor = "var(--mantine-color-gray-0)";
7833
+ e.currentTarget.style.borderColor = "var(--mantine-color-gray-4)";
7834
+ },
7835
+ onMouseLeave: (e) => {
7836
+ e.currentTarget.style.backgroundColor = "transparent";
7837
+ e.currentTarget.style.borderColor = "var(--mantine-color-gray-3)";
7838
+ }
7839
+ },
7840
+ /* @__PURE__ */ React88.createElement(Group23, { gap: "xs", justify: "space-between" }, /* @__PURE__ */ React88.createElement(Group23, { gap: "xs" }, /* @__PURE__ */ React88.createElement(
7841
+ IconCircle,
7842
+ {
7843
+ size: 10,
7844
+ fill: `var(--mantine-color-${getBlockTypeColor(block.type)}-6)`,
7845
+ color: `var(--mantine-color-${getBlockTypeColor(block.type)}-6)`
7846
+ }
7847
+ ), /* @__PURE__ */ React88.createElement(Text42, { fw: 500, size: "sm" }, block.displayName), /* @__PURE__ */ React88.createElement(Badge10, { size: "xs", variant: "light", color: getBlockTypeColor(block.type) }, block.type)), /* @__PURE__ */ React88.createElement(IconChevronRight, { size: 16, color: "var(--mantine-color-gray-5)" }))
7848
+ )))
7849
+ ) : (
7850
+ // Property navigation view
7851
+ currentNodes.length === 0 ? /* @__PURE__ */ React88.createElement(Text42, { c: "dimmed", ta: "center", py: "xl", size: "sm" }, "No properties available") : /* @__PURE__ */ React88.createElement(Stack67, { gap: "xs" }, currentNodes.map((node, index) => /* @__PURE__ */ React88.createElement(Tooltip4, { key: index, label: node.isLeaf ? `Select ${node.displayName}` : `Navigate into ${node.displayName}`, position: "left", withArrow: true }, /* @__PURE__ */ React88.createElement(
7852
+ Box17,
7853
+ {
7854
+ onClick: () => handleNodeClick(node),
7855
+ style: {
7856
+ padding: "10px 12px",
7857
+ borderRadius: "4px",
7858
+ cursor: "pointer",
7859
+ transition: "background-color 0.15s ease",
7860
+ border: "1px solid transparent"
7861
+ },
7862
+ onMouseEnter: (e) => {
7863
+ e.currentTarget.style.backgroundColor = "var(--mantine-color-gray-0)";
7864
+ e.currentTarget.style.borderColor = "var(--mantine-color-gray-3)";
7865
+ },
7866
+ onMouseLeave: (e) => {
7867
+ e.currentTarget.style.backgroundColor = "transparent";
7868
+ e.currentTarget.style.borderColor = "transparent";
7869
+ }
7870
+ },
7871
+ /* @__PURE__ */ React88.createElement(Group23, { gap: "xs", justify: "space-between" }, /* @__PURE__ */ React88.createElement(Group23, { gap: "xs" }, /* @__PURE__ */ React88.createElement(Text42, { size: "sm" }, node.displayName), /* @__PURE__ */ React88.createElement(Badge10, { size: "xs", variant: "dot", color: "gray" }, node.type)), !node.isLeaf && /* @__PURE__ */ React88.createElement(IconChevronRight, { size: 16, color: "var(--mantine-color-gray-5)" }))
7872
+ ))))
7873
+ )))));
7874
+ }
7875
+
7876
+ // src/mantine/utils/referenceResolver.ts
7877
+ var REFERENCE_REGEX = /\{\{([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_.]+)\}\}/g;
7878
+ function parseReferences(input) {
7879
+ const references = [];
7880
+ const regex = new RegExp(REFERENCE_REGEX);
7881
+ let match;
7882
+ while ((match = regex.exec(input)) !== null) {
7883
+ references.push({
7884
+ fullMatch: match[0],
7885
+ blockId: match[1],
7886
+ propPath: match[2],
7887
+ startIndex: match.index,
7888
+ endIndex: match.index + match[0].length
7889
+ });
7890
+ }
7891
+ return references;
7892
+ }
7893
+ function getNestedValue(obj, path) {
7894
+ return path.split(".").reduce((current, key) => {
7895
+ return current?.[key];
7896
+ }, obj);
7897
+ }
7898
+ function resolveSingleReference(blockId, propPath, editorDocument) {
7899
+ if (!editorDocument || !Array.isArray(editorDocument)) {
7900
+ console.warn("Invalid editor document provided to resolveSingleReference");
7901
+ return void 0;
7902
+ }
7903
+ const block = editorDocument.find((b) => b.id === blockId);
7904
+ if (!block) {
7905
+ console.warn(`Block not found: ${blockId}`);
7906
+ return void 0;
7907
+ }
7908
+ if (propPath.startsWith("response.")) {
7909
+ const responseData = block.props.response;
7910
+ if (!responseData) {
7911
+ console.warn(`No response data in block ${blockId}`);
7912
+ return void 0;
7913
+ }
7914
+ try {
7915
+ const parsedResponse = typeof responseData === "string" ? JSON.parse(responseData) : responseData;
7916
+ const innerPath = propPath.substring("response.".length);
7917
+ const value2 = getNestedValue(parsedResponse, innerPath);
7918
+ if (value2 === void 0) {
7919
+ console.warn(`Property not found in response: ${innerPath} in block ${blockId}`);
7920
+ }
7921
+ return value2;
7922
+ } catch (error) {
7923
+ console.warn(`Failed to parse response JSON for block ${blockId}:`, error);
7924
+ return void 0;
7925
+ }
7926
+ }
7927
+ const value = getNestedValue(block.props, propPath);
7928
+ if (value === void 0) {
7929
+ console.warn(`Property not found: ${propPath} in block ${blockId}`);
7930
+ }
7931
+ return value;
7932
+ }
7933
+ function resolveReferences(input, editorDocument, options = {}) {
7934
+ const { fallback = "", stringifyObjects = true } = options;
7935
+ if (input == null) {
7936
+ return "";
7937
+ }
7938
+ const inputStr = String(input);
7939
+ const references = parseReferences(inputStr);
7940
+ if (references.length === 0) {
7941
+ return inputStr;
7942
+ }
7943
+ let result = inputStr;
7944
+ for (let i = references.length - 1; i >= 0; i--) {
7945
+ const ref = references[i];
7946
+ const resolvedValue = resolveSingleReference(ref.blockId, ref.propPath, editorDocument);
7947
+ let replacementStr;
7948
+ if (resolvedValue === void 0 || resolvedValue === null) {
7949
+ replacementStr = fallback;
7950
+ } else if (typeof resolvedValue === "object") {
7951
+ replacementStr = stringifyObjects ? JSON.stringify(resolvedValue) : fallback;
7952
+ } else {
7953
+ replacementStr = String(resolvedValue);
7954
+ }
7955
+ result = result.substring(0, ref.startIndex) + replacementStr + result.substring(ref.endIndex);
7956
+ }
7957
+ return result;
7958
+ }
7959
+ function hasReferences(input) {
7960
+ if (input == null) return false;
7961
+ return parseReferences(String(input)).length > 0;
7962
+ }
7963
+ function createReference(blockId, propPath) {
7964
+ return `{{${blockId}.${propPath}}}`;
7965
+ }
7966
+
7967
+ // src/mantine/components/DataInput/DataInput.tsx
7968
+ function DataInput({
7969
+ value,
7970
+ onChange,
7971
+ placeholder,
7972
+ editorDocument,
7973
+ currentBlockId,
7974
+ leftSection,
7975
+ disabled = false,
7976
+ description,
7977
+ label,
7978
+ required,
7979
+ size = "sm"
7980
+ }) {
7981
+ const [selectorOpened, setSelectorOpened] = useState23(false);
7982
+ const containsReferences = useMemo14(() => {
7983
+ return hasReferences(value);
7984
+ }, [value]);
7985
+ const references = useMemo14(() => {
7986
+ return parseReferences(value || "");
7987
+ }, [value]);
7988
+ const handleOpenSelector = useCallback16(() => {
7989
+ setSelectorOpened(true);
7990
+ }, []);
7991
+ const handleCloseSelector = useCallback16(() => {
7992
+ setSelectorOpened(false);
7993
+ }, []);
7994
+ const handleSelectProperty = useCallback16(
7995
+ (selection) => {
7996
+ const reference = createReference(selection.blockId, selection.propName);
7997
+ const newValue = value ? `${value}${reference}` : reference;
7998
+ onChange(newValue);
7999
+ },
8000
+ [value, onChange]
8001
+ );
8002
+ const handleClearReferences = useCallback16(() => {
8003
+ let newValue = value || "";
8004
+ references.forEach((ref) => {
8005
+ newValue = newValue.replace(ref.fullMatch, "");
8006
+ });
8007
+ onChange(newValue);
8008
+ }, [value, references, onChange]);
8009
+ return /* @__PURE__ */ React89.createElement(Input2.Wrapper, { label, description, required, size, style: { width: "100%" } }, /* @__PURE__ */ React89.createElement(
8010
+ Input2,
8011
+ {
8012
+ value: value || "",
8013
+ onChange: (e) => onChange(e.currentTarget.value),
8014
+ placeholder,
8015
+ leftSection,
8016
+ disabled,
8017
+ size,
8018
+ style: { width: "100%" },
8019
+ rightSectionPointerEvents: "all",
8020
+ rightSection: /* @__PURE__ */ React89.createElement(Group24, { gap: 4, wrap: "nowrap" }, containsReferences && /* @__PURE__ */ React89.createElement(Tooltip5, { label: "Click to clear all references", position: "left" }, /* @__PURE__ */ React89.createElement(Badge11, { size: "sm", variant: "light", color: "blue", style: { cursor: "pointer" }, onClick: handleClearReferences, leftSection: /* @__PURE__ */ React89.createElement(IconX2, { size: 10 }) }, references.length, " ref", references.length !== 1 ? "s" : "")), /* @__PURE__ */ React89.createElement(
8021
+ BlockPropSelector,
8022
+ {
8023
+ opened: selectorOpened,
8024
+ onClose: handleCloseSelector,
8025
+ onSelect: handleSelectProperty,
8026
+ editorDocument,
8027
+ currentBlockId
8028
+ },
8029
+ /* @__PURE__ */ React89.createElement(Tooltip5, { label: "Insert reference to another block's property", position: "left" }, /* @__PURE__ */ React89.createElement(
8030
+ ActionIcon11,
8031
+ {
8032
+ variant: containsReferences ? "light" : "subtle",
8033
+ color: containsReferences ? "blue" : "gray",
8034
+ onClick: handleOpenSelector,
8035
+ disabled,
8036
+ size
8037
+ },
8038
+ /* @__PURE__ */ React89.createElement(IconVariable, { size: 16 })
8039
+ ))
8040
+ ))
8041
+ }
8042
+ ));
8043
+ }
8044
+
8045
+ // src/mantine/blocks/apiRequest/template/GeneralTab.tsx
7436
8046
  var GeneralTab4 = ({
7437
8047
  title,
7438
8048
  description,
@@ -7445,20 +8055,22 @@ var GeneralTab4 = ({
7445
8055
  onEndpointChange,
7446
8056
  onMethodChange,
7447
8057
  onHeadersChange,
7448
- onBodyChange
8058
+ onBodyChange,
8059
+ editor,
8060
+ blockId
7449
8061
  }) => {
7450
- const [localTitle, setLocalTitle] = useState22(title || "");
7451
- const [localDescription, setLocalDescription] = useState22(description || "");
7452
- const [localEndpoint, setLocalEndpoint] = useState22(endpoint || "");
7453
- const [localMethod, setLocalMethod] = useState22(method || "GET");
7454
- const [localHeaders, setLocalHeaders] = useState22(headers || []);
7455
- const [localBody, setLocalBody] = useState22(body || []);
7456
- useEffect15(() => setLocalTitle(title || ""), [title]);
7457
- useEffect15(() => setLocalDescription(description || ""), [description]);
7458
- useEffect15(() => setLocalEndpoint(endpoint || ""), [endpoint]);
7459
- useEffect15(() => setLocalMethod(method || "GET"), [method]);
7460
- useEffect15(() => setLocalHeaders(headers || []), [headers]);
7461
- useEffect15(() => setLocalBody(body || []), [body]);
8062
+ const [localTitle, setLocalTitle] = useState24(title || "");
8063
+ const [localDescription, setLocalDescription] = useState24(description || "");
8064
+ const [localEndpoint, setLocalEndpoint] = useState24(endpoint || "");
8065
+ const [localMethod, setLocalMethod] = useState24(method || "GET");
8066
+ const [localHeaders, setLocalHeaders] = useState24(headers || []);
8067
+ const [localBody, setLocalBody] = useState24(body || []);
8068
+ useEffect16(() => setLocalTitle(title || ""), [title]);
8069
+ useEffect16(() => setLocalDescription(description || ""), [description]);
8070
+ useEffect16(() => setLocalEndpoint(endpoint || ""), [endpoint]);
8071
+ useEffect16(() => setLocalMethod(method || "GET"), [method]);
8072
+ useEffect16(() => setLocalHeaders(headers || []), [headers]);
8073
+ useEffect16(() => setLocalBody(body || []), [body]);
7462
8074
  const handleAddHeader = () => {
7463
8075
  const newHeaders = [...localHeaders, { key: "", value: "" }];
7464
8076
  setLocalHeaders(newHeaders);
@@ -7491,7 +8103,7 @@ var GeneralTab4 = ({
7491
8103
  setLocalBody(newBody);
7492
8104
  onBodyChange(newBody);
7493
8105
  };
7494
- return /* @__PURE__ */ React88.createElement(Stack67, { gap: "lg" }, /* @__PURE__ */ React88.createElement(Stack67, { gap: "xs" }, /* @__PURE__ */ React88.createElement(Text42, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React88.createElement(
8106
+ return /* @__PURE__ */ React90.createElement(Stack68, { gap: "lg" }, /* @__PURE__ */ React90.createElement(Stack68, { gap: "xs" }, /* @__PURE__ */ React90.createElement(Text43, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React90.createElement(
7495
8107
  TextInput34,
7496
8108
  {
7497
8109
  placeholder: "e.g. Submit User Data",
@@ -7502,7 +8114,7 @@ var GeneralTab4 = ({
7502
8114
  onTitleChange(newTitle);
7503
8115
  }
7504
8116
  }
7505
- )), /* @__PURE__ */ React88.createElement(Stack67, { gap: "xs" }, /* @__PURE__ */ React88.createElement(Text42, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React88.createElement(
8117
+ )), /* @__PURE__ */ React90.createElement(Stack68, { gap: "xs" }, /* @__PURE__ */ React90.createElement(Text43, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React90.createElement(
7506
8118
  Textarea19,
7507
8119
  {
7508
8120
  placeholder: "Describe what this API request does",
@@ -7514,8 +8126,8 @@ var GeneralTab4 = ({
7514
8126
  onDescriptionChange(newDescription);
7515
8127
  }
7516
8128
  }
7517
- )), /* @__PURE__ */ React88.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React88.createElement(Stack67, { gap: "xs" }, /* @__PURE__ */ React88.createElement(Text42, { size: "sm", fw: 600 }, "HTTP Method"), /* @__PURE__ */ React88.createElement(
7518
- Select10,
8129
+ )), /* @__PURE__ */ React90.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React90.createElement(Stack68, { gap: "xs" }, /* @__PURE__ */ React90.createElement(Text43, { size: "sm", fw: 600 }, "HTTP Method"), /* @__PURE__ */ React90.createElement(
8130
+ Select11,
7519
8131
  {
7520
8132
  value: localMethod,
7521
8133
  onChange: (value) => {
@@ -7531,7 +8143,7 @@ var GeneralTab4 = ({
7531
8143
  { value: "PATCH", label: "PATCH" }
7532
8144
  ]
7533
8145
  }
7534
- )), /* @__PURE__ */ React88.createElement(Stack67, { gap: "xs" }, /* @__PURE__ */ React88.createElement(Text42, { size: "sm", fw: 600 }, "Endpoint URL"), /* @__PURE__ */ React88.createElement(
8146
+ )), /* @__PURE__ */ React90.createElement(Stack68, { gap: "xs" }, /* @__PURE__ */ React90.createElement(Text43, { size: "sm", fw: 600 }, "Endpoint URL"), /* @__PURE__ */ React90.createElement(
7535
8147
  TextInput34,
7536
8148
  {
7537
8149
  placeholder: "https://api.example.com/endpoint",
@@ -7542,45 +8154,140 @@ var GeneralTab4 = ({
7542
8154
  onEndpointChange(newEndpoint);
7543
8155
  }
7544
8156
  }
7545
- )), /* @__PURE__ */ React88.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React88.createElement(Stack67, { gap: "xs" }, /* @__PURE__ */ React88.createElement(Group23, { justify: "space-between" }, /* @__PURE__ */ React88.createElement(Text42, { size: "sm", fw: 600 }, "Request Headers"), /* @__PURE__ */ React88.createElement(Button17, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ React88.createElement(IconPlus, { size: 14 }), onClick: handleAddHeader }, "Add Header")), /* @__PURE__ */ React88.createElement(Text42, { size: "xs" }, "Add custom headers to your API request (e.g., Authorization, Content-Type)"), localHeaders.length > 0 && /* @__PURE__ */ React88.createElement(Stack67, { gap: "xs" }, localHeaders.map((header, index) => /* @__PURE__ */ React88.createElement(Paper8, { key: index, p: "xs" }, /* @__PURE__ */ React88.createElement(Group23, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React88.createElement(
7546
- TextInput34,
8157
+ )), /* @__PURE__ */ React90.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React90.createElement(Stack68, { gap: "xs" }, /* @__PURE__ */ React90.createElement(Group25, { justify: "space-between" }, /* @__PURE__ */ React90.createElement(Text43, { size: "sm", fw: 600 }, "Request Headers"), /* @__PURE__ */ React90.createElement(Button18, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ React90.createElement(IconPlus, { size: 14 }), onClick: handleAddHeader }, "Add Header")), /* @__PURE__ */ React90.createElement(Text43, { size: "xs" }, "Add custom headers to your API request (e.g., Authorization, Content-Type)"), localHeaders.length > 0 && /* @__PURE__ */ React90.createElement(Stack68, { gap: "xs" }, localHeaders.map((header, index) => /* @__PURE__ */ React90.createElement(Paper8, { key: index, p: "xs" }, /* @__PURE__ */ React90.createElement(Group25, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React90.createElement(
8158
+ DataInput,
7547
8159
  {
7548
8160
  placeholder: "Header key (e.g., Authorization)",
7549
8161
  value: header.key,
7550
- onChange: (event) => handleHeaderChange(index, "key", event.currentTarget.value),
7551
- style: { flex: 1 }
8162
+ onChange: (value) => handleHeaderChange(index, "key", value),
8163
+ editorDocument: editor?.document || [],
8164
+ currentBlockId: blockId,
8165
+ size: "sm"
7552
8166
  }
7553
- ), /* @__PURE__ */ React88.createElement(
7554
- TextInput34,
8167
+ ), /* @__PURE__ */ React90.createElement(
8168
+ DataInput,
7555
8169
  {
7556
8170
  placeholder: "Header value (e.g., Bearer token123)",
7557
8171
  value: header.value,
7558
- onChange: (event) => handleHeaderChange(index, "value", event.currentTarget.value),
7559
- style: { flex: 1 }
8172
+ onChange: (value) => handleHeaderChange(index, "value", value),
8173
+ editorDocument: editor?.document || [],
8174
+ currentBlockId: blockId,
8175
+ size: "sm"
7560
8176
  }
7561
- ), /* @__PURE__ */ React88.createElement(ActionIcon10, { color: "red", variant: "subtle", onClick: () => handleRemoveHeader(index) }, /* @__PURE__ */ React88.createElement(IconTrash, { size: 16 }))))))), /* @__PURE__ */ React88.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React88.createElement(Stack67, { gap: "xs" }, /* @__PURE__ */ React88.createElement(Group23, { justify: "space-between" }, /* @__PURE__ */ React88.createElement(Text42, { size: "sm", fw: 600 }, "Request Body (JSON)"), /* @__PURE__ */ React88.createElement(Button17, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ React88.createElement(IconPlus, { size: 14 }), onClick: handleAddBodyField }, "Add Field")), /* @__PURE__ */ React88.createElement(Text42, { size: "xs" }, "Build your JSON request body as key-value pairs"), localBody.length > 0 && /* @__PURE__ */ React88.createElement(Stack67, { gap: "xs" }, localBody.map((field, index) => /* @__PURE__ */ React88.createElement(Paper8, { key: index, p: "xs" }, /* @__PURE__ */ React88.createElement(Group23, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React88.createElement(
7562
- TextInput34,
8177
+ ), /* @__PURE__ */ React90.createElement(ActionIcon12, { color: "red", variant: "subtle", onClick: () => handleRemoveHeader(index) }, /* @__PURE__ */ React90.createElement(IconTrash, { size: 16 }))))))), /* @__PURE__ */ React90.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React90.createElement(Stack68, { gap: "xs" }, /* @__PURE__ */ React90.createElement(Group25, { justify: "space-between" }, /* @__PURE__ */ React90.createElement(Text43, { size: "sm", fw: 600 }, "Request Body (JSON)"), /* @__PURE__ */ React90.createElement(Button18, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ React90.createElement(IconPlus, { size: 14 }), onClick: handleAddBodyField }, "Add Field")), /* @__PURE__ */ React90.createElement(Text43, { size: "xs" }, "Build your JSON request body as key-value pairs"), localBody.length > 0 && /* @__PURE__ */ React90.createElement(Stack68, { gap: "xs" }, localBody.map((field, index) => /* @__PURE__ */ React90.createElement(Paper8, { key: index, p: "xs" }, /* @__PURE__ */ React90.createElement(Group25, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React90.createElement(
8178
+ DataInput,
7563
8179
  {
7564
8180
  placeholder: "Field key (e.g., name)",
7565
8181
  value: field.key,
7566
- onChange: (event) => handleBodyFieldChange(index, "key", event.currentTarget.value),
7567
- style: { flex: 1 }
8182
+ onChange: (value) => handleBodyFieldChange(index, "key", value),
8183
+ editorDocument: editor?.document || [],
8184
+ currentBlockId: blockId,
8185
+ size: "sm"
7568
8186
  }
7569
- ), /* @__PURE__ */ React88.createElement(
7570
- TextInput34,
8187
+ ), /* @__PURE__ */ React90.createElement(
8188
+ DataInput,
7571
8189
  {
7572
8190
  placeholder: "Field value (e.g., John Doe)",
7573
8191
  value: field.value,
7574
- onChange: (event) => handleBodyFieldChange(index, "value", event.currentTarget.value),
7575
- style: { flex: 1 }
8192
+ onChange: (value) => handleBodyFieldChange(index, "value", value),
8193
+ editorDocument: editor?.document || [],
8194
+ currentBlockId: blockId,
8195
+ size: "sm"
8196
+ }
8197
+ ), /* @__PURE__ */ React90.createElement(ActionIcon12, { color: "red", variant: "subtle", onClick: () => handleRemoveBodyField(index) }, /* @__PURE__ */ React90.createElement(IconTrash, { size: 16 }))))))));
8198
+ };
8199
+
8200
+ // src/mantine/blocks/apiRequest/template/ResponseSchemaTab.tsx
8201
+ import React91 from "react";
8202
+ import { Stack as Stack69, Text as Text44, Button as Button19, Group as Group26, ActionIcon as ActionIcon13, Paper as Paper9, TextInput as TextInput35, Select as Select12, Textarea as Textarea20, Alert as Alert9, Code } from "@mantine/core";
8203
+ import { IconTrash as IconTrash2, IconPlus as IconPlus2, IconInfoCircle } from "@tabler/icons-react";
8204
+ var ResponseSchemaTab = ({ schema, onSchemaChange, blockId }) => {
8205
+ const fields = schema?.fields || [];
8206
+ const handleAddField = () => {
8207
+ const newFields = [
8208
+ ...fields,
8209
+ {
8210
+ path: "",
8211
+ displayName: "",
8212
+ type: "string",
8213
+ description: ""
8214
+ }
8215
+ ];
8216
+ onSchemaChange({ fields: newFields });
8217
+ };
8218
+ const handleRemoveField = (index) => {
8219
+ const newFields = fields.filter((_, i) => i !== index);
8220
+ onSchemaChange({ fields: newFields });
8221
+ };
8222
+ const handleFieldChange = (index, key, value) => {
8223
+ const newFields = [...fields];
8224
+ newFields[index] = { ...newFields[index], [key]: value };
8225
+ onSchemaChange({ fields: newFields });
8226
+ };
8227
+ return /* @__PURE__ */ React91.createElement(Stack69, { gap: "lg" }, /* @__PURE__ */ React91.createElement(Alert9, { icon: /* @__PURE__ */ React91.createElement(IconInfoCircle, { size: 16 }), title: "Response Schema", color: "blue" }, /* @__PURE__ */ React91.createElement(Text44, { size: "xs" }, "Define the expected structure of your API response. This allows other blocks to reference specific fields from the response data using the DataInput component.")), /* @__PURE__ */ React91.createElement(Stack69, { gap: "xs" }, /* @__PURE__ */ React91.createElement(Text44, { size: "sm", fw: 600 }, "How it works"), /* @__PURE__ */ React91.createElement(Text44, { size: "xs", c: "dimmed" }, "1. Define response fields using dot notation (e.g., ", /* @__PURE__ */ React91.createElement(Code, null, "customer.email"), ")"), /* @__PURE__ */ React91.createElement(Text44, { size: "xs", c: "dimmed" }, "2. Fields become available in DataInput selectors across other blocks"), /* @__PURE__ */ React91.createElement(Text44, { size: "xs", c: "dimmed" }, "3. Reference them like: ", /* @__PURE__ */ React91.createElement(Code, null, `{{${blockId}.response.customer.email}}`))), /* @__PURE__ */ React91.createElement(Stack69, { gap: "xs" }, /* @__PURE__ */ React91.createElement(Group26, { justify: "space-between" }, /* @__PURE__ */ React91.createElement(Text44, { size: "sm", fw: 600 }, "Response Fields"), /* @__PURE__ */ React91.createElement(Button19, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ React91.createElement(IconPlus2, { size: 14 }), onClick: handleAddField }, "Add Field")), fields.length === 0 ? /* @__PURE__ */ React91.createElement(Paper9, { p: "md", withBorder: true, style: { backgroundColor: "var(--mantine-color-gray-0)" } }, /* @__PURE__ */ React91.createElement(Text44, { size: "sm", c: "dimmed", ta: "center" }, 'No response fields defined yet. Click "Add Field" to start defining your response structure.')) : /* @__PURE__ */ React91.createElement(Stack69, { gap: "md" }, fields.map((field, index) => /* @__PURE__ */ React91.createElement(Paper9, { key: index, p: "md", withBorder: true }, /* @__PURE__ */ React91.createElement(Stack69, { gap: "sm" }, /* @__PURE__ */ React91.createElement(Group26, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React91.createElement(Text44, { size: "sm", fw: 500 }, "Field ", index + 1), /* @__PURE__ */ React91.createElement(ActionIcon13, { color: "red", variant: "subtle", onClick: () => handleRemoveField(index) }, /* @__PURE__ */ React91.createElement(IconTrash2, { size: 16 }))), /* @__PURE__ */ React91.createElement(
8228
+ TextInput35,
8229
+ {
8230
+ label: "Field Path",
8231
+ placeholder: "e.g., customer.email or product.id",
8232
+ description: "Use dot notation to specify nested fields in the API response",
8233
+ value: field.path,
8234
+ onChange: (e) => handleFieldChange(index, "path", e.currentTarget.value),
8235
+ required: true,
8236
+ size: "sm"
8237
+ }
8238
+ ), /* @__PURE__ */ React91.createElement(
8239
+ TextInput35,
8240
+ {
8241
+ label: "Display Name",
8242
+ placeholder: "e.g., User Email",
8243
+ description: "Human-readable name shown in DataInput selector",
8244
+ value: field.displayName,
8245
+ onChange: (e) => handleFieldChange(index, "displayName", e.currentTarget.value),
8246
+ required: true,
8247
+ size: "sm"
8248
+ }
8249
+ ), /* @__PURE__ */ React91.createElement(
8250
+ Select12,
8251
+ {
8252
+ label: "Type",
8253
+ description: "Expected data type of this field",
8254
+ value: field.type,
8255
+ onChange: (value) => handleFieldChange(index, "type", value || "string"),
8256
+ data: [
8257
+ { value: "string", label: "String" },
8258
+ { value: "number", label: "Number" },
8259
+ { value: "boolean", label: "Boolean" },
8260
+ { value: "object", label: "Object" },
8261
+ { value: "array", label: "Array" }
8262
+ ],
8263
+ size: "sm"
8264
+ }
8265
+ ), /* @__PURE__ */ React91.createElement(
8266
+ Textarea20,
8267
+ {
8268
+ label: "Description (optional)",
8269
+ placeholder: "Describe what this field represents",
8270
+ value: field.description || "",
8271
+ onChange: (e) => handleFieldChange(index, "description", e.currentTarget.value),
8272
+ minRows: 2,
8273
+ size: "sm"
7576
8274
  }
7577
- ), /* @__PURE__ */ React88.createElement(ActionIcon10, { color: "red", variant: "subtle", onClick: () => handleRemoveBodyField(index) }, /* @__PURE__ */ React88.createElement(IconTrash, { size: 16 }))))))));
8275
+ ), field.path && field.displayName && /* @__PURE__ */ React91.createElement(Stack69, { gap: 4 }, /* @__PURE__ */ React91.createElement(Text44, { size: "xs", c: "dimmed" }, "Reference format:"), /* @__PURE__ */ React91.createElement(Code, { block: true, style: { fontSize: "11px" } }, `{{${blockId}.response.${field.path}}}`))))))), fields.length === 0 && /* @__PURE__ */ React91.createElement(Stack69, { gap: "xs" }, /* @__PURE__ */ React91.createElement(Text44, { size: "sm", fw: 600 }, "Example Schema"), /* @__PURE__ */ React91.createElement(Text44, { size: "xs", c: "dimmed" }, "For a typical API response like:"), /* @__PURE__ */ React91.createElement(Code, { block: true, style: { fontSize: "11px" } }, `{
8276
+ "customer": {
8277
+ "email": "user@example.com",
8278
+ "name": "John Doe"
8279
+ },
8280
+ "product": {
8281
+ "id": "l1v6r07b",
8282
+ "name": "Product-1"
8283
+ }
8284
+ }`), /* @__PURE__ */ React91.createElement(Text44, { size: "xs", c: "dimmed" }, "You would define fields like:"), /* @__PURE__ */ React91.createElement(Text44, { size: "xs", c: "dimmed" }, "\u2022 Path: ", /* @__PURE__ */ React91.createElement(Code, null, "customer.email"), ', Display Name: "Customer Email", Type: string'), /* @__PURE__ */ React91.createElement(Text44, { size: "xs", c: "dimmed" }, "\u2022 Path: ", /* @__PURE__ */ React91.createElement(Code, null, "customer.name"), ', Display Name: "Customer Name", Type: string'), /* @__PURE__ */ React91.createElement(Text44, { size: "xs", c: "dimmed" }, "\u2022 Path: ", /* @__PURE__ */ React91.createElement(Code, null, "product.id"), ', Display Name: "Product ID", Type: string'), /* @__PURE__ */ React91.createElement(Text44, { size: "xs", c: "dimmed" }, "\u2022 Path: ", /* @__PURE__ */ React91.createElement(Code, null, "product.name"), ', Display Name: "Product Name", Type: string')));
7578
8285
  };
7579
8286
 
7580
8287
  // src/mantine/blocks/apiRequest/template/TemplateConfig.tsx
7581
8288
  var TemplateConfig4 = ({ editor, block }) => {
7582
8289
  const { closePanel } = usePanelStore();
7583
- const updateProp = useCallback16(
8290
+ const updateProp = useCallback17(
7584
8291
  (key, value) => {
7585
8292
  editor.updateBlock(block, {
7586
8293
  props: {
@@ -7591,20 +8298,88 @@ var TemplateConfig4 = ({ editor, block }) => {
7591
8298
  },
7592
8299
  [editor, block]
7593
8300
  );
7594
- const handleHeadersChange = useCallback16(
8301
+ const handleHeadersChange = useCallback17(
7595
8302
  (headers) => {
7596
8303
  updateProp("headers", JSON.stringify(headers));
7597
8304
  },
7598
8305
  [updateProp]
7599
8306
  );
7600
- const handleBodyChange = useCallback16(
8307
+ const handleBodyChange = useCallback17(
7601
8308
  (body) => {
7602
8309
  updateProp("body", JSON.stringify(body));
7603
8310
  },
7604
8311
  [updateProp]
7605
8312
  );
7606
- return /* @__PURE__ */ React89.createElement(
7607
- Paper9,
8313
+ const handleSchemaChange = useCallback17(
8314
+ (schema) => {
8315
+ updateProp("responseSchema", JSON.stringify(schema));
8316
+ },
8317
+ [updateProp]
8318
+ );
8319
+ const parsedResponseSchema = useMemo15(() => {
8320
+ return parseResponseSchema(block.props.responseSchema);
8321
+ }, [block.props.responseSchema]);
8322
+ const tabs = useMemo15(
8323
+ () => [
8324
+ {
8325
+ label: "General",
8326
+ value: "general",
8327
+ content: /* @__PURE__ */ React92.createElement(
8328
+ GeneralTab4,
8329
+ {
8330
+ title: block.props.title || "",
8331
+ description: block.props.description || "",
8332
+ endpoint: block.props.endpoint || "",
8333
+ method: block.props.method || "GET",
8334
+ headers: (() => {
8335
+ try {
8336
+ return typeof block.props.headers === "string" ? JSON.parse(block.props.headers) : block.props.headers || [];
8337
+ } catch {
8338
+ return [];
8339
+ }
8340
+ })(),
8341
+ body: (() => {
8342
+ try {
8343
+ return typeof block.props.body === "string" ? JSON.parse(block.props.body) : block.props.body || [];
8344
+ } catch {
8345
+ return [];
8346
+ }
8347
+ })(),
8348
+ onTitleChange: (value) => updateProp("title", value),
8349
+ onDescriptionChange: (value) => updateProp("description", value),
8350
+ onEndpointChange: (value) => updateProp("endpoint", value),
8351
+ onMethodChange: (value) => updateProp("method", value),
8352
+ onHeadersChange: handleHeadersChange,
8353
+ onBodyChange: handleBodyChange,
8354
+ editor,
8355
+ blockId: block.id
8356
+ }
8357
+ )
8358
+ },
8359
+ {
8360
+ label: "Response Schema",
8361
+ value: "response-schema",
8362
+ content: /* @__PURE__ */ React92.createElement(ResponseSchemaTab, { schema: parsedResponseSchema, onSchemaChange: handleSchemaChange, blockId: block.id })
8363
+ }
8364
+ ],
8365
+ [
8366
+ block.props.title,
8367
+ block.props.description,
8368
+ block.props.endpoint,
8369
+ block.props.method,
8370
+ block.props.headers,
8371
+ block.props.body,
8372
+ block.id,
8373
+ parsedResponseSchema,
8374
+ updateProp,
8375
+ handleHeadersChange,
8376
+ handleBodyChange,
8377
+ handleSchemaChange,
8378
+ editor
8379
+ ]
8380
+ );
8381
+ return /* @__PURE__ */ React92.createElement(
8382
+ Paper10,
7608
8383
  {
7609
8384
  p: "md",
7610
8385
  shadow: "sm",
@@ -7614,7 +8389,7 @@ var TemplateConfig4 = ({ editor, block }) => {
7614
8389
  flexDirection: "column"
7615
8390
  }
7616
8391
  },
7617
- /* @__PURE__ */ React89.createElement(
8392
+ /* @__PURE__ */ React92.createElement(
7618
8393
  "div",
7619
8394
  {
7620
8395
  style: {
@@ -7624,59 +8399,19 @@ var TemplateConfig4 = ({ editor, block }) => {
7624
8399
  marginBottom: "1rem"
7625
8400
  }
7626
8401
  },
7627
- /* @__PURE__ */ React89.createElement(Title7, { order: 3 }, "API Request Settings"),
7628
- /* @__PURE__ */ React89.createElement(CloseButton6, { onClick: closePanel })
8402
+ /* @__PURE__ */ React92.createElement(Title7, { order: 3 }, "API Request Settings"),
8403
+ /* @__PURE__ */ React92.createElement(CloseButton6, { onClick: closePanel })
7629
8404
  ),
7630
- /* @__PURE__ */ React89.createElement(
7631
- ReusablePanel,
7632
- {
7633
- extraTabs: [
7634
- {
7635
- label: "General",
7636
- value: "general",
7637
- content: /* @__PURE__ */ React89.createElement(
7638
- GeneralTab4,
7639
- {
7640
- title: block.props.title || "",
7641
- description: block.props.description || "",
7642
- endpoint: block.props.endpoint || "",
7643
- method: block.props.method || "GET",
7644
- headers: (() => {
7645
- try {
7646
- return typeof block.props.headers === "string" ? JSON.parse(block.props.headers) : block.props.headers || [];
7647
- } catch {
7648
- return [];
7649
- }
7650
- })(),
7651
- body: (() => {
7652
- try {
7653
- return typeof block.props.body === "string" ? JSON.parse(block.props.body) : block.props.body || [];
7654
- } catch {
7655
- return [];
7656
- }
7657
- })(),
7658
- onTitleChange: (value) => updateProp("title", value),
7659
- onDescriptionChange: (value) => updateProp("description", value),
7660
- onEndpointChange: (value) => updateProp("endpoint", value),
7661
- onMethodChange: (value) => updateProp("method", value),
7662
- onHeadersChange: handleHeadersChange,
7663
- onBodyChange: handleBodyChange
7664
- }
7665
- )
7666
- }
7667
- ],
7668
- context: { editor, block }
7669
- }
7670
- )
8405
+ /* @__PURE__ */ React92.createElement(ReusablePanel, { extraTabs: tabs, context: { editor, block } })
7671
8406
  );
7672
8407
  };
7673
8408
 
7674
8409
  // src/mantine/blocks/apiRequest/template/TemplateView.tsx
7675
- import { Card as Card19, Group as Group24, Stack as Stack68, Text as Text43, ActionIcon as ActionIcon11, Badge as Badge10 } from "@mantine/core";
8410
+ import { Card as Card19, Group as Group27, Stack as Stack70, Text as Text45, ActionIcon as ActionIcon14, Badge as Badge12 } from "@mantine/core";
7676
8411
  var API_REQUEST_TEMPLATE_PANEL_ID = "api-request-template-panel";
7677
8412
  var ApiRequestTemplateView = ({ editor, block }) => {
7678
8413
  const panelId = `${API_REQUEST_TEMPLATE_PANEL_ID}-${block.id}`;
7679
- const panelContent = useMemo13(() => /* @__PURE__ */ React90.createElement(TemplateConfig4, { editor, block }), [editor, block]);
8414
+ const panelContent = useMemo16(() => /* @__PURE__ */ React93.createElement(TemplateConfig4, { editor, block }), [editor, block]);
7680
8415
  const { open } = usePanel(panelId, panelContent);
7681
8416
  const method = block.props.method || "GET";
7682
8417
  const endpoint = block.props.endpoint || "https://api.example.com/endpoint";
@@ -7696,17 +8431,18 @@ var ApiRequestTemplateView = ({ editor, block }) => {
7696
8431
  return "gray";
7697
8432
  }
7698
8433
  };
7699
- return /* @__PURE__ */ React90.createElement(Card19, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React90.createElement(Badge10, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React90.createElement(Group24, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React90.createElement(Group24, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React90.createElement(ActionIcon11, { variant: "light", color: "violet", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "square-check")), /* @__PURE__ */ React90.createElement(Stack68, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React90.createElement(Group24, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React90.createElement(Badge10, { size: "sm", variant: "filled", color: getMethodColor(method) }, method), /* @__PURE__ */ React90.createElement(Text43, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "API Request")), /* @__PURE__ */ React90.createElement(Text43, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, endpoint), block.props.description && /* @__PURE__ */ React90.createElement(Text43, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description)))));
8434
+ return /* @__PURE__ */ React93.createElement(Card19, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React93.createElement(Badge12, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React93.createElement(Group27, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React93.createElement(Group27, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React93.createElement(ActionIcon14, { variant: "light", color: "violet", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "square-check")), /* @__PURE__ */ React93.createElement(Stack70, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React93.createElement(Group27, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React93.createElement(Badge12, { size: "sm", variant: "filled", color: getMethodColor(method) }, method), /* @__PURE__ */ React93.createElement(Text45, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "API Request")), /* @__PURE__ */ React93.createElement(Text45, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, endpoint), block.props.description && /* @__PURE__ */ React93.createElement(Text45, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description)))));
7700
8435
  };
7701
8436
 
7702
8437
  // src/mantine/blocks/apiRequest/flow/FlowView.tsx
7703
- import React91, { useState as useState23 } from "react";
7704
- import { Card as Card20, Group as Group25, Stack as Stack69, Text as Text44, ActionIcon as ActionIcon12, Tooltip as Tooltip4, Button as Button18, Badge as Badge11, Collapse as Collapse2, Code, Loader as Loader4, Alert as Alert9 } from "@mantine/core";
7705
- import { IconSend, IconChevronDown as IconChevronDown2, IconChevronUp as IconChevronUp2 } from "@tabler/icons-react";
8438
+ import React94, { useState as useState25 } from "react";
8439
+ import { Card as Card20, Group as Group28, Stack as Stack71, Text as Text46, ActionIcon as ActionIcon15, Tooltip as Tooltip6, Button as Button20, Badge as Badge13, Collapse as Collapse2, Code as Code2, Loader as Loader5, Alert as Alert10 } from "@mantine/core";
8440
+ import { IconSend, IconChevronDown as IconChevronDown2, IconChevronUp as IconChevronUp2, IconAlertTriangle } from "@tabler/icons-react";
7706
8441
  var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
7707
8442
  const disabled = isDisabled?.isDisabled === "disable";
7708
- const [isLoading, setIsLoading] = useState23(false);
7709
- const [showDetails, setShowDetails] = useState23(false);
8443
+ const [isLoading, setIsLoading] = useState25(false);
8444
+ const [showDetails, setShowDetails] = useState25(false);
8445
+ const [validationWarnings, setValidationWarnings] = useState25([]);
7710
8446
  const method = block.props.method || "GET";
7711
8447
  const endpoint = block.props.endpoint || "";
7712
8448
  const headers = (() => {
@@ -7760,17 +8496,23 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
7760
8496
  props: { ...block.props, status: "loading", response: "" }
7761
8497
  });
7762
8498
  try {
8499
+ const editorDocument = editor?.document || [];
8500
+ const resolvedEndpoint = resolveReferences(endpoint, editorDocument);
7763
8501
  const headersObj = {};
7764
8502
  headers.forEach((h) => {
7765
8503
  if (h.key && h.value) {
7766
- headersObj[h.key] = h.value;
8504
+ const resolvedKey = resolveReferences(h.key, editorDocument);
8505
+ const resolvedValue = resolveReferences(h.value, editorDocument);
8506
+ headersObj[resolvedKey] = resolvedValue;
7767
8507
  }
7768
8508
  });
7769
8509
  const bodyObj = {};
7770
8510
  if (method !== "GET") {
7771
8511
  body.forEach((b) => {
7772
8512
  if (b.key && b.value) {
7773
- bodyObj[b.key] = b.value;
8513
+ const resolvedKey = resolveReferences(b.key, editorDocument);
8514
+ const resolvedValue = resolveReferences(b.value, editorDocument);
8515
+ bodyObj[resolvedKey] = resolvedValue;
7774
8516
  }
7775
8517
  });
7776
8518
  }
@@ -7784,21 +8526,24 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
7784
8526
  if (method !== "GET" && Object.keys(bodyObj).length > 0) {
7785
8527
  fetchOptions.body = JSON.stringify(bodyObj);
7786
8528
  }
7787
- const apiResponse = await fetch(endpoint, fetchOptions);
8529
+ const apiResponse = await fetch(resolvedEndpoint, fetchOptions);
7788
8530
  const responseData = await apiResponse.json();
8531
+ const schema = parseResponseSchema(block.props.responseSchema);
8532
+ if (schema && schema.fields.length > 0) {
8533
+ const errors = validateResponseAgainstSchema(responseData, schema);
8534
+ if (errors.length > 0) {
8535
+ console.warn("Response validation warnings:", errors);
8536
+ setValidationWarnings(errors);
8537
+ setShowDetails(true);
8538
+ } else {
8539
+ setValidationWarnings([]);
8540
+ }
8541
+ }
7789
8542
  editor.updateBlock(block, {
7790
8543
  props: {
7791
8544
  ...block.props,
7792
8545
  status: apiResponse.ok ? "success" : "error",
7793
- response: JSON.stringify(
7794
- {
7795
- status: apiResponse.status,
7796
- statusText: apiResponse.statusText,
7797
- data: responseData
7798
- },
7799
- null,
7800
- 2
7801
- )
8546
+ response: JSON.stringify(responseData, null, 2)
7802
8547
  }
7803
8548
  });
7804
8549
  } catch (error) {
@@ -7819,21 +8564,21 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
7819
8564
  setIsLoading(false);
7820
8565
  }
7821
8566
  };
7822
- const executeButton = /* @__PURE__ */ React91.createElement(
7823
- Button18,
8567
+ const executeButton = /* @__PURE__ */ React94.createElement(
8568
+ Button20,
7824
8569
  {
7825
8570
  size: "sm",
7826
8571
  variant: "light",
7827
8572
  color: getMethodColor(method),
7828
- leftSection: isLoading ? /* @__PURE__ */ React91.createElement(Loader4, { size: 14 }) : /* @__PURE__ */ React91.createElement(IconSend, { size: 14 }),
8573
+ leftSection: isLoading ? /* @__PURE__ */ React94.createElement(Loader5, { size: 14 }) : /* @__PURE__ */ React94.createElement(IconSend, { size: 14 }),
7829
8574
  onClick: handleExecuteRequest,
7830
8575
  disabled: disabled || isLoading || !endpoint,
7831
8576
  style: { flexShrink: 0 }
7832
8577
  },
7833
8578
  isLoading ? "Sending..." : "Execute"
7834
8579
  );
7835
- return /* @__PURE__ */ React91.createElement(Card20, { withBorder: true, padding: "md", radius: "md", style: { width: "100%" } }, /* @__PURE__ */ React91.createElement(Stack69, { gap: "md" }, /* @__PURE__ */ React91.createElement(Group25, { wrap: "nowrap", justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React91.createElement(Group25, { wrap: "nowrap", align: "flex-start", style: { flex: 1 } }, /* @__PURE__ */ React91.createElement(ActionIcon12, { variant: "light", color: "violet", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "square-check")), /* @__PURE__ */ React91.createElement(Stack69, { gap: "xs", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React91.createElement(Group25, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React91.createElement(Badge11, { size: "sm", variant: "filled", color: getMethodColor(method) }, method), /* @__PURE__ */ React91.createElement(Text44, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "API Request"), status !== "idle" && /* @__PURE__ */ React91.createElement(Badge11, { size: "xs", variant: "dot", color: getStatusColor(status) }, status)), /* @__PURE__ */ React91.createElement(
7836
- Text44,
8580
+ return /* @__PURE__ */ React94.createElement(Card20, { withBorder: true, padding: "md", radius: "md", style: { width: "100%" } }, /* @__PURE__ */ React94.createElement(Stack71, { gap: "md" }, /* @__PURE__ */ React94.createElement(Group28, { wrap: "nowrap", justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React94.createElement(Group28, { wrap: "nowrap", align: "flex-start", style: { flex: 1 } }, /* @__PURE__ */ React94.createElement(ActionIcon15, { variant: "light", color: "violet", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "square-check")), /* @__PURE__ */ React94.createElement(Stack71, { gap: "xs", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React94.createElement(Group28, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React94.createElement(Badge13, { size: "sm", variant: "filled", color: getMethodColor(method) }, method), /* @__PURE__ */ React94.createElement(Text46, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "API Request"), status !== "idle" && /* @__PURE__ */ React94.createElement(Badge13, { size: "xs", variant: "dot", color: getStatusColor(status) }, status)), /* @__PURE__ */ React94.createElement(
8581
+ Text46,
7837
8582
  {
7838
8583
  size: "xs",
7839
8584
  c: "dimmed",
@@ -7845,7 +8590,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
7845
8590
  }
7846
8591
  },
7847
8592
  endpoint || "No endpoint configured"
7848
- ), block.props.description && /* @__PURE__ */ React91.createElement(Text44, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), /* @__PURE__ */ React91.createElement(Group25, { gap: "xs", style: { flexShrink: 0 } }, disabled && isDisabled?.message ? /* @__PURE__ */ React91.createElement(Tooltip4, { label: isDisabled.message, position: "left", withArrow: true }, executeButton) : executeButton, /* @__PURE__ */ React91.createElement(ActionIcon12, { variant: "subtle", onClick: () => setShowDetails(!showDetails), disabled: headers.length === 0 && body.length === 0 && !response }, showDetails ? /* @__PURE__ */ React91.createElement(IconChevronUp2, { size: 16 }) : /* @__PURE__ */ React91.createElement(IconChevronDown2, { size: 16 })))), /* @__PURE__ */ React91.createElement(Collapse2, { in: showDetails }, /* @__PURE__ */ React91.createElement(Stack69, { gap: "md" }, headers.length > 0 && /* @__PURE__ */ React91.createElement(Stack69, { gap: "xs" }, /* @__PURE__ */ React91.createElement(Text44, { size: "xs", fw: 600, c: "dimmed" }, "Headers:"), /* @__PURE__ */ React91.createElement(Code, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
8593
+ ), block.props.description && /* @__PURE__ */ React94.createElement(Text46, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), /* @__PURE__ */ React94.createElement(Group28, { gap: "xs", style: { flexShrink: 0 } }, disabled && isDisabled?.message ? /* @__PURE__ */ React94.createElement(Tooltip6, { label: isDisabled.message, position: "left", withArrow: true }, executeButton) : executeButton, /* @__PURE__ */ React94.createElement(ActionIcon15, { variant: "subtle", onClick: () => setShowDetails(!showDetails), disabled: headers.length === 0 && body.length === 0 && !response }, showDetails ? /* @__PURE__ */ React94.createElement(IconChevronUp2, { size: 16 }) : /* @__PURE__ */ React94.createElement(IconChevronDown2, { size: 16 })))), /* @__PURE__ */ React94.createElement(Collapse2, { in: showDetails }, /* @__PURE__ */ React94.createElement(Stack71, { gap: "md" }, validationWarnings.length > 0 && /* @__PURE__ */ React94.createElement(Alert10, { icon: /* @__PURE__ */ React94.createElement(IconAlertTriangle, { size: 16 }), title: "Schema Validation Warnings", color: "yellow" }, /* @__PURE__ */ React94.createElement(Stack71, { gap: "xs" }, /* @__PURE__ */ React94.createElement(Text46, { size: "xs" }, "The API response does not match the defined schema:"), validationWarnings.map((warning, index) => /* @__PURE__ */ React94.createElement(Text46, { key: index, size: "xs", c: "dimmed" }, "\u2022 ", warning)))), headers.length > 0 && /* @__PURE__ */ React94.createElement(Stack71, { gap: "xs" }, /* @__PURE__ */ React94.createElement(Text46, { size: "xs", fw: 600, c: "dimmed" }, "Headers:"), /* @__PURE__ */ React94.createElement(Code2, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
7849
8594
  headers.reduce(
7850
8595
  (acc, h) => {
7851
8596
  if (h.key && h.value) acc[h.key] = h.value;
@@ -7855,7 +8600,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
7855
8600
  ),
7856
8601
  null,
7857
8602
  2
7858
- ))), method !== "GET" && body.length > 0 && /* @__PURE__ */ React91.createElement(Stack69, { gap: "xs" }, /* @__PURE__ */ React91.createElement(Text44, { size: "xs", fw: 600, c: "dimmed" }, "Body:"), /* @__PURE__ */ React91.createElement(Code, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
8603
+ ))), method !== "GET" && body.length > 0 && /* @__PURE__ */ React94.createElement(Stack71, { gap: "xs" }, /* @__PURE__ */ React94.createElement(Text46, { size: "xs", fw: 600, c: "dimmed" }, "Body:"), /* @__PURE__ */ React94.createElement(Code2, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
7859
8604
  body.reduce(
7860
8605
  (acc, b) => {
7861
8606
  if (b.key && b.value) acc[b.key] = b.value;
@@ -7865,7 +8610,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
7865
8610
  ),
7866
8611
  null,
7867
8612
  2
7868
- ))), response && /* @__PURE__ */ React91.createElement(Stack69, { gap: "xs" }, /* @__PURE__ */ React91.createElement(Text44, { size: "xs", fw: 600, c: "dimmed" }, "Response:"), status === "error" ? /* @__PURE__ */ React91.createElement(Alert9, { color: "red", title: "Error", styles: { message: { fontSize: "11px" } } }, /* @__PURE__ */ React91.createElement(Code, { block: true, style: { fontSize: "11px" } }, response)) : /* @__PURE__ */ React91.createElement(Code, { block: true, style: { fontSize: "11px", maxHeight: "300px", overflow: "auto" } }, response))))));
8613
+ ))), response && /* @__PURE__ */ React94.createElement(Stack71, { gap: "xs" }, /* @__PURE__ */ React94.createElement(Text46, { size: "xs", fw: 600, c: "dimmed" }, "Response:"), status === "error" ? /* @__PURE__ */ React94.createElement(Alert10, { color: "red", title: "Error", styles: { message: { fontSize: "11px" } } }, /* @__PURE__ */ React94.createElement(Code2, { block: true, style: { fontSize: "11px" } }, response)) : /* @__PURE__ */ React94.createElement(Code2, { block: true, style: { fontSize: "11px", maxHeight: "300px", overflow: "auto" } }, response))))));
7869
8614
  };
7870
8615
 
7871
8616
  // src/mantine/blocks/apiRequest/ApiRequestBlock.tsx
@@ -7873,7 +8618,7 @@ function ApiRequestBlock({ editor, block }) {
7873
8618
  const { docType } = useBlocknoteContext();
7874
8619
  const { actions } = useBlockConditions(block, editor);
7875
8620
  if (docType === "template") {
7876
- return /* @__PURE__ */ React92.createElement(ApiRequestTemplateView, { editor, block });
8621
+ return /* @__PURE__ */ React95.createElement(ApiRequestTemplateView, { editor, block });
7877
8622
  }
7878
8623
  const conditionConfig = parseConditionConfig(block.props.conditions);
7879
8624
  const hasVisibility = hasVisibilityConditions(conditionConfig);
@@ -7885,7 +8630,7 @@ function ApiRequestBlock({ editor, block }) {
7885
8630
  const hasEnable = hasEnableConditions(conditionConfig);
7886
8631
  const enableActionExists = actions.some((a) => a.action === "enable");
7887
8632
  const shouldDisable = hasEnable && !enableActionExists;
7888
- return /* @__PURE__ */ React92.createElement(
8633
+ return /* @__PURE__ */ React95.createElement(
7889
8634
  ApiRequestFlowView,
7890
8635
  {
7891
8636
  block,
@@ -7930,6 +8675,9 @@ var ApiRequestBlockSpec = createReactBlockSpec5(
7930
8675
  status: {
7931
8676
  default: "idle"
7932
8677
  },
8678
+ responseSchema: {
8679
+ default: ""
8680
+ },
7933
8681
  conditions: {
7934
8682
  default: ""
7935
8683
  }
@@ -7939,37 +8687,37 @@ var ApiRequestBlockSpec = createReactBlockSpec5(
7939
8687
  {
7940
8688
  render: (props) => {
7941
8689
  const ixoProps = props;
7942
- return /* @__PURE__ */ React93.createElement(ApiRequestBlock, { ...ixoProps });
8690
+ return /* @__PURE__ */ React96.createElement(ApiRequestBlock, { ...ixoProps });
7943
8691
  }
7944
8692
  }
7945
8693
  );
7946
8694
 
7947
8695
  // src/mantine/blocks/enumChecklist/EnumChecklistBlock.tsx
7948
- import React100, { useState as useState25, useEffect as useEffect16, useMemo as useMemo14, useCallback as useCallback17 } from "react";
8696
+ import React103, { useState as useState27, useEffect as useEffect17, useMemo as useMemo17, useCallback as useCallback18 } from "react";
7949
8697
  import { createReactBlockSpec as createReactBlockSpec6 } from "@blocknote/react";
7950
- import { Stack as Stack75, Text as Text50, Button as Button23, ActionIcon as ActionIcon13, Center as Center3, Flex as Flex19 } from "@mantine/core";
8698
+ import { Stack as Stack77, Text as Text52, Button as Button25, ActionIcon as ActionIcon16, Center as Center3, Flex as Flex20 } from "@mantine/core";
7951
8699
 
7952
8700
  // src/mantine/blocks/enumChecklist/oracle_personalities/index.tsx
7953
- import React94 from "react";
7954
- import { Box as Box17, Flex as Flex18, Stack as Stack70, Text as Text45, Image as Image13 } from "@mantine/core";
8701
+ import React97 from "react";
8702
+ import { Box as Box18, Flex as Flex19, Stack as Stack72, Text as Text47, Image as Image13 } from "@mantine/core";
7955
8703
  function OraclePersonalitiesEnumList({ selectionMode, isItemChecked, onItemCheck, items }) {
7956
8704
  if (!items || items.length === 0) {
7957
- return /* @__PURE__ */ React94.createElement(Text45, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No assets found");
8705
+ return /* @__PURE__ */ React97.createElement(Text47, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No assets found");
7958
8706
  }
7959
- const rows = items.map(({ id, name, description, voice, icon }) => /* @__PURE__ */ React94.createElement(ListItemContainer, { key: id }, /* @__PURE__ */ React94.createElement(Flex18, { align: "center", gap: "sm" }, /* @__PURE__ */ React94.createElement(Image13, { radius: 16, w: 62, h: 62, src: icon, alt: name }), /* @__PURE__ */ React94.createElement(Stack70, { gap: 0 }, /* @__PURE__ */ React94.createElement(Text45, { size: "sm", fw: 500 }, name || "-"), description !== void 0 && /* @__PURE__ */ React94.createElement(Text45, { size: "sm", c: "dimmed" }, description))), /* @__PURE__ */ React94.createElement(Flex18, { align: "center", gap: "md" }, /* @__PURE__ */ React94.createElement(Stack70, { ta: "right", gap: 0 }, /* @__PURE__ */ React94.createElement(Text45, { size: "sm", fw: 500 }, "Voice"), /* @__PURE__ */ React94.createElement(Text45, { size: "sm", c: "dimmed" }, voice)), selectionMode && /* @__PURE__ */ React94.createElement(ListItemCheckbox, { ariaLabel: `Select oracle ${name}`, checked: isItemChecked?.(id), onCheck: (checked) => onItemCheck?.(id, checked) }))));
7960
- return /* @__PURE__ */ React94.createElement(Box17, { flex: 1 }, /* @__PURE__ */ React94.createElement(Stack70, null, rows));
8707
+ const rows = items.map(({ id, name, description, voice, icon }) => /* @__PURE__ */ React97.createElement(ListItemContainer, { key: id }, /* @__PURE__ */ React97.createElement(Flex19, { align: "center", gap: "sm" }, /* @__PURE__ */ React97.createElement(Image13, { radius: 16, w: 62, h: 62, src: icon, alt: name }), /* @__PURE__ */ React97.createElement(Stack72, { gap: 0 }, /* @__PURE__ */ React97.createElement(Text47, { size: "sm", fw: 500 }, name || "-"), description !== void 0 && /* @__PURE__ */ React97.createElement(Text47, { size: "sm", c: "dimmed" }, description))), /* @__PURE__ */ React97.createElement(Flex19, { align: "center", gap: "md" }, /* @__PURE__ */ React97.createElement(Stack72, { ta: "right", gap: 0 }, /* @__PURE__ */ React97.createElement(Text47, { size: "sm", fw: 500 }, "Voice"), /* @__PURE__ */ React97.createElement(Text47, { size: "sm", c: "dimmed" }, voice)), selectionMode && /* @__PURE__ */ React97.createElement(ListItemCheckbox, { ariaLabel: `Select oracle ${name}`, checked: isItemChecked?.(id), onCheck: (checked) => onItemCheck?.(id, checked) }))));
8708
+ return /* @__PURE__ */ React97.createElement(Box18, { flex: 1 }, /* @__PURE__ */ React97.createElement(Stack72, null, rows));
7961
8709
  }
7962
8710
 
7963
8711
  // src/mantine/blocks/enumChecklist/EnumChecklistConfigModal.tsx
7964
- import React99, { useState as useState24 } from "react";
7965
- import { Modal, Group as Group29, Box as Box19 } from "@mantine/core";
8712
+ import React102, { useState as useState26 } from "react";
8713
+ import { Modal, Group as Group32, Box as Box20 } from "@mantine/core";
7966
8714
 
7967
8715
  // src/mantine/blocks/list/modal/ModalNavigation.tsx
7968
- import React95 from "react";
7969
- import { Stack as Stack71, Button as Button19, Text as Text46 } from "@mantine/core";
8716
+ import React98 from "react";
8717
+ import { Stack as Stack73, Button as Button21, Text as Text48 } from "@mantine/core";
7970
8718
  var ModalNavigation = ({ steps, activeStep, onStepChange, showUpdateButton = false, onUpdateBlock }) => {
7971
- return /* @__PURE__ */ React95.createElement(Stack71, { gap: "xs", style: { height: "100%" } }, /* @__PURE__ */ React95.createElement(Stack71, { gap: "xs", style: { flex: 1 } }, steps.map((step) => /* @__PURE__ */ React95.createElement(
7972
- Button19,
8719
+ return /* @__PURE__ */ React98.createElement(Stack73, { gap: "xs", style: { height: "100%" } }, /* @__PURE__ */ React98.createElement(Stack73, { gap: "xs", style: { flex: 1 } }, steps.map((step) => /* @__PURE__ */ React98.createElement(
8720
+ Button21,
7973
8721
  {
7974
8722
  key: step.id,
7975
8723
  variant: activeStep === step.id ? "filled" : "subtle",
@@ -7986,13 +8734,13 @@ var ModalNavigation = ({ steps, activeStep, onStepChange, showUpdateButton = fal
7986
8734
  }
7987
8735
  }
7988
8736
  },
7989
- /* @__PURE__ */ React95.createElement(Stack71, { gap: 2, align: "flex-start" }, /* @__PURE__ */ React95.createElement(Text46, { size: "sm", fw: 500 }, step.label), /* @__PURE__ */ React95.createElement(Text46, { size: "xs", opacity: 0.7 }, step.description))
7990
- ))), showUpdateButton && /* @__PURE__ */ React95.createElement(Button19, { variant: "filled", color: "blue", onClick: onUpdateBlock, style: { marginTop: "auto" } }, "Update Block"));
8737
+ /* @__PURE__ */ React98.createElement(Stack73, { gap: 2, align: "flex-start" }, /* @__PURE__ */ React98.createElement(Text48, { size: "sm", fw: 500 }, step.label), /* @__PURE__ */ React98.createElement(Text48, { size: "xs", opacity: 0.7 }, step.description))
8738
+ ))), showUpdateButton && /* @__PURE__ */ React98.createElement(Button21, { variant: "filled", color: "blue", onClick: onUpdateBlock, style: { marginTop: "auto" } }, "Update Block"));
7991
8739
  };
7992
8740
 
7993
8741
  // src/mantine/blocks/enumChecklist/EnumChecklistTypeSelection.tsx
7994
- import React96 from "react";
7995
- import { Stack as Stack72, Card as Card21, Group as Group26, Text as Text47, Box as Box18, Button as Button20 } from "@mantine/core";
8742
+ import React99 from "react";
8743
+ import { Stack as Stack74, Card as Card21, Group as Group29, Text as Text49, Box as Box19, Button as Button22 } from "@mantine/core";
7996
8744
 
7997
8745
  // src/mantine/blocks/enumChecklist/oracle_personalities/config.ts
7998
8746
  var oraclePersonalitiesMetadata = {
@@ -8121,7 +8869,7 @@ function getEnumListItems(type) {
8121
8869
  // src/mantine/blocks/enumChecklist/EnumChecklistTypeSelection.tsx
8122
8870
  var EnumChecklistTypeSelection = ({ selectedType, onTypeSelect, onNext }) => {
8123
8871
  const enumListsMeta = getEnumListTypesMetadata();
8124
- return /* @__PURE__ */ React96.createElement(Stack72, { gap: "md" }, /* @__PURE__ */ React96.createElement("div", null, /* @__PURE__ */ React96.createElement(Text47, { size: "lg", fw: 600, mb: "xs" }, "Choose List Type"), /* @__PURE__ */ React96.createElement(Text47, { size: "sm", c: "dimmed" }, "Select the type of list you want to create")), /* @__PURE__ */ React96.createElement(Stack72, { gap: "sm" }, enumListsMeta.map((enumChecklistMeta) => /* @__PURE__ */ React96.createElement(
8872
+ return /* @__PURE__ */ React99.createElement(Stack74, { gap: "md" }, /* @__PURE__ */ React99.createElement("div", null, /* @__PURE__ */ React99.createElement(Text49, { size: "lg", fw: 600, mb: "xs" }, "Choose List Type"), /* @__PURE__ */ React99.createElement(Text49, { size: "sm", c: "dimmed" }, "Select the type of list you want to create")), /* @__PURE__ */ React99.createElement(Stack74, { gap: "sm" }, enumListsMeta.map((enumChecklistMeta) => /* @__PURE__ */ React99.createElement(
8125
8873
  Card21,
8126
8874
  {
8127
8875
  key: enumChecklistMeta.id,
@@ -8134,8 +8882,8 @@ var EnumChecklistTypeSelection = ({ selectedType, onTypeSelect, onNext }) => {
8134
8882
  },
8135
8883
  onClick: () => onTypeSelect(enumChecklistMeta.id)
8136
8884
  },
8137
- /* @__PURE__ */ React96.createElement(Group26, { gap: "md", align: "flex-start" }, /* @__PURE__ */ React96.createElement(
8138
- Box18,
8885
+ /* @__PURE__ */ React99.createElement(Group29, { gap: "md", align: "flex-start" }, /* @__PURE__ */ React99.createElement(
8886
+ Box19,
8139
8887
  {
8140
8888
  style: {
8141
8889
  width: 48,
@@ -8150,36 +8898,36 @@ var EnumChecklistTypeSelection = ({ selectedType, onTypeSelect, onNext }) => {
8150
8898
  }
8151
8899
  },
8152
8900
  enumChecklistMeta.icon
8153
- ), /* @__PURE__ */ React96.createElement(Stack72, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React96.createElement(Text47, { size: "md", fw: 600 }, enumChecklistMeta.name), /* @__PURE__ */ React96.createElement(Text47, { size: "sm", c: "dimmed" }, enumChecklistMeta.description)))
8154
- ))), /* @__PURE__ */ React96.createElement(Group26, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React96.createElement(Button20, { onClick: onNext, disabled: !selectedType }, "Next")));
8901
+ ), /* @__PURE__ */ React99.createElement(Stack74, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React99.createElement(Text49, { size: "md", fw: 600 }, enumChecklistMeta.name), /* @__PURE__ */ React99.createElement(Text49, { size: "sm", c: "dimmed" }, enumChecklistMeta.description)))
8902
+ ))), /* @__PURE__ */ React99.createElement(Group29, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React99.createElement(Button22, { onClick: onNext, disabled: !selectedType }, "Next")));
8155
8903
  };
8156
8904
 
8157
8905
  // src/mantine/blocks/enumChecklist/EnumChecklistPreviewStep.tsx
8158
- import React97 from "react";
8159
- import { Stack as Stack73, Text as Text48, Button as Button21, Group as Group27 } from "@mantine/core";
8906
+ import React100 from "react";
8907
+ import { Stack as Stack75, Text as Text50, Button as Button23, Group as Group30 } from "@mantine/core";
8160
8908
  var EnumChecklistPreviewStep = ({ listType, onAddToBlock, onPrev }) => {
8161
8909
  const renderListComponent = () => {
8162
8910
  switch (listType) {
8163
8911
  case "oracle_personalities":
8164
- return /* @__PURE__ */ React97.createElement(OraclePersonalitiesEnumList, { items: getEnumListItems(listType) });
8912
+ return /* @__PURE__ */ React100.createElement(OraclePersonalitiesEnumList, { items: getEnumListItems(listType) });
8165
8913
  default:
8166
8914
  return null;
8167
8915
  }
8168
8916
  };
8169
- return /* @__PURE__ */ React97.createElement(Stack73, { gap: "md" }, /* @__PURE__ */ React97.createElement("div", null, /* @__PURE__ */ React97.createElement(Text48, { size: "lg", fw: 600, mb: "xs" }, "Preview ", getEnumListNameByType(listType)), /* @__PURE__ */ React97.createElement(Text48, { size: "sm", c: "dimmed" }, "Preview how your list will look with the current configuration")), /* @__PURE__ */ React97.createElement("div", { style: { maxHeight: "400px", overflow: "auto" } }, renderListComponent()), /* @__PURE__ */ React97.createElement(Group27, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React97.createElement(Button21, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React97.createElement(Button21, { onClick: onAddToBlock }, "Add to Block")));
8917
+ return /* @__PURE__ */ React100.createElement(Stack75, { gap: "md" }, /* @__PURE__ */ React100.createElement("div", null, /* @__PURE__ */ React100.createElement(Text50, { size: "lg", fw: 600, mb: "xs" }, "Preview ", getEnumListNameByType(listType)), /* @__PURE__ */ React100.createElement(Text50, { size: "sm", c: "dimmed" }, "Preview how your list will look with the current configuration")), /* @__PURE__ */ React100.createElement("div", { style: { maxHeight: "400px", overflow: "auto" } }, renderListComponent()), /* @__PURE__ */ React100.createElement(Group30, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React100.createElement(Button23, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React100.createElement(Button23, { onClick: onAddToBlock }, "Add to Block")));
8170
8918
  };
8171
8919
 
8172
8920
  // src/mantine/blocks/enumChecklist/EnumChecklistConfigurationStep.tsx
8173
- import React98 from "react";
8174
- import { Stack as Stack74, TextInput as TextInput35, Text as Text49, Button as Button22, Group as Group28, Switch as Switch4, Select as Select11 } from "@mantine/core";
8921
+ import React101 from "react";
8922
+ import { Stack as Stack76, TextInput as TextInput36, Text as Text51, Button as Button24, Group as Group31, Switch as Switch4, Select as Select13 } from "@mantine/core";
8175
8923
  var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onConfigChange, onPrev, onNext, isValid }) => {
8176
8924
  const typeConfig = ENUM_LIST_CONFIG[listType];
8177
8925
  const configFields = getEnumListTypesConfigFields(listType);
8178
8926
  const renderListConfigField = (field) => {
8179
8927
  switch (field.type) {
8180
8928
  case "text":
8181
- return /* @__PURE__ */ React98.createElement(
8182
- TextInput35,
8929
+ return /* @__PURE__ */ React101.createElement(
8930
+ TextInput36,
8183
8931
  {
8184
8932
  label: field.label,
8185
8933
  description: field.description,
@@ -8190,7 +8938,7 @@ var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onC
8190
8938
  }
8191
8939
  );
8192
8940
  case "switch":
8193
- return /* @__PURE__ */ React98.createElement(
8941
+ return /* @__PURE__ */ React101.createElement(
8194
8942
  Switch4,
8195
8943
  {
8196
8944
  label: field.label,
@@ -8200,8 +8948,8 @@ var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onC
8200
8948
  }
8201
8949
  );
8202
8950
  case "select":
8203
- return /* @__PURE__ */ React98.createElement(
8204
- Select11,
8951
+ return /* @__PURE__ */ React101.createElement(
8952
+ Select13,
8205
8953
  {
8206
8954
  label: field.label,
8207
8955
  description: field.description,
@@ -8213,8 +8961,8 @@ var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onC
8213
8961
  }
8214
8962
  );
8215
8963
  default:
8216
- return /* @__PURE__ */ React98.createElement(
8217
- TextInput35,
8964
+ return /* @__PURE__ */ React101.createElement(
8965
+ TextInput36,
8218
8966
  {
8219
8967
  label: field.label,
8220
8968
  description: field.description,
@@ -8226,14 +8974,14 @@ var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onC
8226
8974
  );
8227
8975
  }
8228
8976
  };
8229
- return /* @__PURE__ */ React98.createElement(Stack74, { gap: "md" }, /* @__PURE__ */ React98.createElement("div", null, /* @__PURE__ */ React98.createElement(Text49, { size: "lg", fw: 600, mb: "xs" }, "Configure ", typeConfig.metadata.name), /* @__PURE__ */ React98.createElement(Text49, { size: "sm", c: "dimmed" }, typeConfig.metadata.description)), /* @__PURE__ */ React98.createElement(Stack74, { gap: "sm" }, configFields.map((field) => /* @__PURE__ */ React98.createElement("div", { key: field.key }, renderListConfigField(field)))), /* @__PURE__ */ React98.createElement(Group28, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React98.createElement(Button22, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React98.createElement(Button22, { onClick: onNext, disabled: !isValid }, "Next")));
8977
+ return /* @__PURE__ */ React101.createElement(Stack76, { gap: "md" }, /* @__PURE__ */ React101.createElement("div", null, /* @__PURE__ */ React101.createElement(Text51, { size: "lg", fw: 600, mb: "xs" }, "Configure ", typeConfig.metadata.name), /* @__PURE__ */ React101.createElement(Text51, { size: "sm", c: "dimmed" }, typeConfig.metadata.description)), /* @__PURE__ */ React101.createElement(Stack76, { gap: "sm" }, configFields.map((field) => /* @__PURE__ */ React101.createElement("div", { key: field.key }, renderListConfigField(field)))), /* @__PURE__ */ React101.createElement(Group31, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React101.createElement(Button24, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React101.createElement(Button24, { onClick: onNext, disabled: !isValid }, "Next")));
8230
8978
  };
8231
8979
 
8232
8980
  // src/mantine/blocks/enumChecklist/EnumChecklistConfigModal.tsx
8233
8981
  var EnumChecklistConfigModal = ({ opened, onClose, onSave, initialConfig }) => {
8234
- const [activeStep, setActiveStep] = useState24("type");
8235
- const [selectedType, setSelectedType] = useState24(initialConfig?.listType || null);
8236
- const [config, setConfig] = useState24(initialConfig?.listConfig || {});
8982
+ const [activeStep, setActiveStep] = useState26("type");
8983
+ const [selectedType, setSelectedType] = useState26(initialConfig?.listType || null);
8984
+ const [config, setConfig] = useState26(initialConfig?.listConfig || {});
8237
8985
  const handleTypeSelect = (type) => {
8238
8986
  setSelectedType(type);
8239
8987
  const configFieldsByType = getEnumListTypesConfigFields(type);
@@ -8288,9 +9036,9 @@ var EnumChecklistConfigModal = ({ opened, onClose, onSave, initialConfig }) => {
8288
9036
  const renderStepContent = () => {
8289
9037
  switch (activeStep) {
8290
9038
  case "type":
8291
- return /* @__PURE__ */ React99.createElement(EnumChecklistTypeSelection, { selectedType, onTypeSelect: handleTypeSelect, onNext: () => setActiveStep("configure") });
9039
+ return /* @__PURE__ */ React102.createElement(EnumChecklistTypeSelection, { selectedType, onTypeSelect: handleTypeSelect, onNext: () => setActiveStep("configure") });
8292
9040
  case "configure":
8293
- return selectedType ? /* @__PURE__ */ React99.createElement(
9041
+ return selectedType ? /* @__PURE__ */ React102.createElement(
8294
9042
  EnumChecklistConfigurationStep,
8295
9043
  {
8296
9044
  enumChecklistType: selectedType,
@@ -8302,22 +9050,22 @@ var EnumChecklistConfigModal = ({ opened, onClose, onSave, initialConfig }) => {
8302
9050
  }
8303
9051
  ) : null;
8304
9052
  case "preview":
8305
- return selectedType ? /* @__PURE__ */ React99.createElement(EnumChecklistPreviewStep, { listType: selectedType, onAddToBlock: handleAddToBlock, onPrev: () => setActiveStep("configure") }) : null;
9053
+ return selectedType ? /* @__PURE__ */ React102.createElement(EnumChecklistPreviewStep, { listType: selectedType, onAddToBlock: handleAddToBlock, onPrev: () => setActiveStep("configure") }) : null;
8306
9054
  default:
8307
9055
  return null;
8308
9056
  }
8309
9057
  };
8310
- return /* @__PURE__ */ React99.createElement(Modal, { opened, onClose: handleClose, title: "Configure Enum Checklist Block", size: "xl" }, /* @__PURE__ */ React99.createElement(Group29, { align: "flex-start", gap: "lg", style: { minHeight: "400px" } }, /* @__PURE__ */ React99.createElement(Box19, { style: { width: "200px", flexShrink: 0, height: "400px", display: "flex" } }, /* @__PURE__ */ React99.createElement(ModalNavigation, { steps, activeStep, onStepChange: setActiveStep, showUpdateButton: selectedType !== null, onUpdateBlock: handleAddToBlock })), /* @__PURE__ */ React99.createElement(Box19, { style: { flex: 1 } }, renderStepContent())));
9058
+ return /* @__PURE__ */ React102.createElement(Modal, { opened, onClose: handleClose, title: "Configure Enum Checklist Block", size: "xl" }, /* @__PURE__ */ React102.createElement(Group32, { align: "flex-start", gap: "lg", style: { minHeight: "400px" } }, /* @__PURE__ */ React102.createElement(Box20, { style: { width: "200px", flexShrink: 0, height: "400px", display: "flex" } }, /* @__PURE__ */ React102.createElement(ModalNavigation, { steps, activeStep, onStepChange: setActiveStep, showUpdateButton: selectedType !== null, onUpdateBlock: handleAddToBlock })), /* @__PURE__ */ React102.createElement(Box20, { style: { flex: 1 } }, renderStepContent())));
8311
9059
  };
8312
9060
 
8313
9061
  // src/mantine/blocks/enumChecklist/EnumChecklistBlock.tsx
8314
- var IconSettings2 = () => /* @__PURE__ */ React100.createElement("span", null, "\u2699\uFE0F");
9062
+ var IconSettings2 = () => /* @__PURE__ */ React103.createElement("span", null, "\u2699\uFE0F");
8315
9063
  var EnumChecklistBlockType = "enumChecklist";
8316
9064
  var EnumChecklistBlockContent = ({ block, editor }) => {
8317
- const [modalOpened, setModalOpened] = useState25(false);
9065
+ const [modalOpened, setModalOpened] = useState27(false);
8318
9066
  const { editable } = useBlocknoteContext();
8319
9067
  const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
8320
- const listConfig = useMemo14(() => {
9068
+ const listConfig = useMemo17(() => {
8321
9069
  if (block.props.listConfig && block.props.listConfig !== "{}") {
8322
9070
  try {
8323
9071
  return JSON.parse(block.props.listConfig);
@@ -8328,7 +9076,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
8328
9076
  }
8329
9077
  return {};
8330
9078
  }, [block.props.listConfig]);
8331
- const selectedIds = useMemo14(() => {
9079
+ const selectedIds = useMemo17(() => {
8332
9080
  if (block.props.selectedIds && block.props.selectedIds !== "[]") {
8333
9081
  try {
8334
9082
  return new Set(JSON.parse(block.props.selectedIds));
@@ -8339,7 +9087,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
8339
9087
  }
8340
9088
  return /* @__PURE__ */ new Set();
8341
9089
  }, [block.props.selectedIds]);
8342
- useEffect16(() => {
9090
+ useEffect17(() => {
8343
9091
  if (listConfig?.selection_mode === "single" && selectedIds.size > 1) {
8344
9092
  const arr = Array.from(selectedIds);
8345
9093
  const lastSelected = arr.length > 0 ? arr[arr.length - 1] : void 0;
@@ -8348,13 +9096,13 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
8348
9096
  });
8349
9097
  }
8350
9098
  }, [listConfig?.selection_mode, selectedIds]);
8351
- const isItemChecked = useCallback17(
9099
+ const isItemChecked = useCallback18(
8352
9100
  (id) => {
8353
9101
  return selectedIds.has(id);
8354
9102
  },
8355
9103
  [selectedIds]
8356
9104
  );
8357
- const onItemCheck = useCallback17(
9105
+ const onItemCheck = useCallback18(
8358
9106
  (id, checked) => {
8359
9107
  const currentSelectedIds = Array.from(selectedIds);
8360
9108
  let newSelectedIds;
@@ -8397,7 +9145,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
8397
9145
  if (!listType) return null;
8398
9146
  switch (listType) {
8399
9147
  case "oracle_personalities":
8400
- return /* @__PURE__ */ React100.createElement(
9148
+ return /* @__PURE__ */ React103.createElement(
8401
9149
  OraclePersonalitiesEnumList,
8402
9150
  {
8403
9151
  items: getEnumListItems(listType),
@@ -8410,7 +9158,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
8410
9158
  return null;
8411
9159
  }
8412
9160
  };
8413
- return /* @__PURE__ */ React100.createElement(Stack75, { w: "100%" }, listType && /* @__PURE__ */ React100.createElement(Flex19, { align: "center", justify: "space-between", gap: "xs" }, /* @__PURE__ */ React100.createElement(Text50, null, getEnumListNameByType(listType)), listConfig.listSelectionMode && /* @__PURE__ */ React100.createElement(Text50, { lh: 0.5, c: "dimmed" }, listConfig?.selection_mode === "single" ? "Single Selection" : "Multi Selection"), editable && /* @__PURE__ */ React100.createElement(Flex19, { justify: listType ? "space-between" : "flex-end" }, /* @__PURE__ */ React100.createElement(Flex19, { gap: "xs" }, /* @__PURE__ */ React100.createElement(ActionIcon13, { variant: "subtle", size: "sm", onClick: () => setModalOpened(true) }, /* @__PURE__ */ React100.createElement(IconSettings2, null))))), /* @__PURE__ */ React100.createElement(Flex19, { flex: 1 }, !listType ? /* @__PURE__ */ React100.createElement(Center3, { py: "xl" }, /* @__PURE__ */ React100.createElement(Stack75, { align: "center", gap: "sm" }, /* @__PURE__ */ React100.createElement(Text50, { size: "sm", c: "dimmed", ta: "center" }, "No list type configured"), /* @__PURE__ */ React100.createElement(Button23, { size: "sm", variant: "light", onClick: () => setModalOpened(true) }, "Configure List"))) : /* @__PURE__ */ React100.createElement(Stack75, { gap: "md", flex: 1 }, renderListComponent())), /* @__PURE__ */ React100.createElement(
9161
+ return /* @__PURE__ */ React103.createElement(Stack77, { w: "100%" }, listType && /* @__PURE__ */ React103.createElement(Flex20, { align: "center", justify: "space-between", gap: "xs" }, /* @__PURE__ */ React103.createElement(Text52, null, getEnumListNameByType(listType)), listConfig.listSelectionMode && /* @__PURE__ */ React103.createElement(Text52, { lh: 0.5, c: "dimmed" }, listConfig?.selection_mode === "single" ? "Single Selection" : "Multi Selection"), editable && /* @__PURE__ */ React103.createElement(Flex20, { justify: listType ? "space-between" : "flex-end" }, /* @__PURE__ */ React103.createElement(Flex20, { gap: "xs" }, /* @__PURE__ */ React103.createElement(ActionIcon16, { variant: "subtle", size: "sm", onClick: () => setModalOpened(true) }, /* @__PURE__ */ React103.createElement(IconSettings2, null))))), /* @__PURE__ */ React103.createElement(Flex20, { flex: 1 }, !listType ? /* @__PURE__ */ React103.createElement(Center3, { py: "xl" }, /* @__PURE__ */ React103.createElement(Stack77, { align: "center", gap: "sm" }, /* @__PURE__ */ React103.createElement(Text52, { size: "sm", c: "dimmed", ta: "center" }, "No list type configured"), /* @__PURE__ */ React103.createElement(Button25, { size: "sm", variant: "light", onClick: () => setModalOpened(true) }, "Configure List"))) : /* @__PURE__ */ React103.createElement(Stack77, { gap: "md", flex: 1 }, renderListComponent())), /* @__PURE__ */ React103.createElement(
8414
9162
  EnumChecklistConfigModal,
8415
9163
  {
8416
9164
  opened: modalOpened,
@@ -8442,28 +9190,28 @@ var EnumChecklistBlock = createReactBlockSpec6(
8442
9190
  content: "none"
8443
9191
  },
8444
9192
  {
8445
- render: (props) => /* @__PURE__ */ React100.createElement(EnumChecklistBlockContent, { ...props })
9193
+ render: (props) => /* @__PURE__ */ React103.createElement(EnumChecklistBlockContent, { ...props })
8446
9194
  }
8447
9195
  );
8448
9196
 
8449
9197
  // src/mantine/blocks/notify/NotifyBlockSpec.tsx
8450
- import React106 from "react";
9198
+ import React109 from "react";
8451
9199
  import { createReactBlockSpec as createReactBlockSpec7 } from "@blocknote/react";
8452
9200
 
8453
9201
  // src/mantine/blocks/notify/NotifyBlock.tsx
8454
- import React105 from "react";
9202
+ import React108 from "react";
8455
9203
 
8456
9204
  // src/mantine/blocks/notify/template/TemplateView.tsx
8457
- import React103, { useMemo as useMemo15 } from "react";
9205
+ import React106, { useMemo as useMemo18 } from "react";
8458
9206
 
8459
9207
  // src/mantine/blocks/notify/template/TemplateConfig.tsx
8460
- import React102, { useCallback as useCallback18 } from "react";
8461
- import { Paper as Paper11, CloseButton as CloseButton7, Title as Title8 } from "@mantine/core";
9208
+ import React105, { useCallback as useCallback19 } from "react";
9209
+ import { Paper as Paper12, CloseButton as CloseButton7, Title as Title8 } from "@mantine/core";
8462
9210
 
8463
9211
  // src/mantine/blocks/notify/template/GeneralTab.tsx
8464
- import React101, { useEffect as useEffect17, useState as useState26 } from "react";
8465
- import { Divider as Divider6, Select as Select12, Stack as Stack76, Text as Text51, TextInput as TextInput36, Textarea as Textarea20, Button as Button24, Group as Group30, ActionIcon as ActionIcon14, Paper as Paper10 } from "@mantine/core";
8466
- import { IconTrash as IconTrash2, IconPlus as IconPlus2 } from "@tabler/icons-react";
9212
+ import React104, { useEffect as useEffect18, useState as useState28 } from "react";
9213
+ import { Divider as Divider6, Select as Select14, Stack as Stack78, Text as Text53, TextInput as TextInput37, Textarea as Textarea21, Button as Button26, Group as Group33, ActionIcon as ActionIcon17, Paper as Paper11 } from "@mantine/core";
9214
+ import { IconTrash as IconTrash3, IconPlus as IconPlus3 } from "@tabler/icons-react";
8467
9215
  var GeneralTab5 = ({
8468
9216
  title,
8469
9217
  description,
@@ -8486,30 +9234,32 @@ var GeneralTab5 = ({
8486
9234
  onBodyChange,
8487
9235
  onBodyTypeChange,
8488
9236
  onFromChange,
8489
- onReplyToChange
9237
+ onReplyToChange,
9238
+ editor,
9239
+ blockId
8490
9240
  }) => {
8491
- const [localTitle, setLocalTitle] = useState26(title || "");
8492
- const [localDescription, setLocalDescription] = useState26(description || "");
8493
- const [localChannel, setLocalChannel] = useState26(channel || "email");
8494
- const [localTo, setLocalTo] = useState26(to || []);
8495
- const [localCc, setLocalCc] = useState26(cc || []);
8496
- const [localBcc, setLocalBcc] = useState26(bcc || []);
8497
- const [localSubject, setLocalSubject] = useState26(subject || "");
8498
- const [localBody, setLocalBody] = useState26(body || "");
8499
- const [localBodyType, setLocalBodyType] = useState26(bodyType || "text");
8500
- const [localFrom, setLocalFrom] = useState26(from || "");
8501
- const [localReplyTo, setLocalReplyTo] = useState26(replyTo || "");
8502
- useEffect17(() => setLocalTitle(title || ""), [title]);
8503
- useEffect17(() => setLocalDescription(description || ""), [description]);
8504
- useEffect17(() => setLocalChannel(channel || "email"), [channel]);
8505
- useEffect17(() => setLocalTo(to || []), [to]);
8506
- useEffect17(() => setLocalCc(cc || []), [cc]);
8507
- useEffect17(() => setLocalBcc(bcc || []), [bcc]);
8508
- useEffect17(() => setLocalSubject(subject || ""), [subject]);
8509
- useEffect17(() => setLocalBody(body || ""), [body]);
8510
- useEffect17(() => setLocalBodyType(bodyType || "text"), [bodyType]);
8511
- useEffect17(() => setLocalFrom(from || ""), [from]);
8512
- useEffect17(() => setLocalReplyTo(replyTo || ""), [replyTo]);
9241
+ const [localTitle, setLocalTitle] = useState28(title || "");
9242
+ const [localDescription, setLocalDescription] = useState28(description || "");
9243
+ const [localChannel, setLocalChannel] = useState28(channel || "email");
9244
+ const [localTo, setLocalTo] = useState28(to || []);
9245
+ const [localCc, setLocalCc] = useState28(cc || []);
9246
+ const [localBcc, setLocalBcc] = useState28(bcc || []);
9247
+ const [localSubject, setLocalSubject] = useState28(subject || "");
9248
+ const [localBody, setLocalBody] = useState28(body || "");
9249
+ const [localBodyType, setLocalBodyType] = useState28(bodyType || "text");
9250
+ const [localFrom, setLocalFrom] = useState28(from || "");
9251
+ const [localReplyTo, setLocalReplyTo] = useState28(replyTo || "");
9252
+ useEffect18(() => setLocalTitle(title || ""), [title]);
9253
+ useEffect18(() => setLocalDescription(description || ""), [description]);
9254
+ useEffect18(() => setLocalChannel(channel || "email"), [channel]);
9255
+ useEffect18(() => setLocalTo(to || []), [to]);
9256
+ useEffect18(() => setLocalCc(cc || []), [cc]);
9257
+ useEffect18(() => setLocalBcc(bcc || []), [bcc]);
9258
+ useEffect18(() => setLocalSubject(subject || ""), [subject]);
9259
+ useEffect18(() => setLocalBody(body || ""), [body]);
9260
+ useEffect18(() => setLocalBodyType(bodyType || "text"), [bodyType]);
9261
+ useEffect18(() => setLocalFrom(from || ""), [from]);
9262
+ useEffect18(() => setLocalReplyTo(replyTo || ""), [replyTo]);
8513
9263
  const handleAddRecipient = (type) => {
8514
9264
  const setter = type === "to" ? setLocalTo : type === "cc" ? setLocalCc : setLocalBcc;
8515
9265
  const callback = type === "to" ? onToChange : type === "cc" ? onCcChange : onBccChange;
@@ -8535,8 +9285,8 @@ var GeneralTab5 = ({
8535
9285
  setter(newRecipients);
8536
9286
  callback(newRecipients);
8537
9287
  };
8538
- return /* @__PURE__ */ React101.createElement(Stack76, { gap: "lg" }, /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Text51, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React101.createElement(
8539
- TextInput36,
9288
+ return /* @__PURE__ */ React104.createElement(Stack78, { gap: "lg" }, /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Text53, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React104.createElement(
9289
+ TextInput37,
8540
9290
  {
8541
9291
  placeholder: "e.g. Welcome Email",
8542
9292
  value: localTitle,
@@ -8546,8 +9296,8 @@ var GeneralTab5 = ({
8546
9296
  onTitleChange(newTitle);
8547
9297
  }
8548
9298
  }
8549
- )), /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Text51, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React101.createElement(
8550
- Textarea20,
9299
+ )), /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Text53, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React104.createElement(
9300
+ Textarea21,
8551
9301
  {
8552
9302
  placeholder: "Describe what this notification does",
8553
9303
  minRows: 2,
@@ -8558,8 +9308,8 @@ var GeneralTab5 = ({
8558
9308
  onDescriptionChange(newDescription);
8559
9309
  }
8560
9310
  }
8561
- )), /* @__PURE__ */ React101.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Text51, { size: "sm", fw: 600 }, "Channel"), /* @__PURE__ */ React101.createElement(
8562
- Select12,
9311
+ )), /* @__PURE__ */ React104.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Text53, { size: "sm", fw: 600 }, "Channel"), /* @__PURE__ */ React104.createElement(
9312
+ Select14,
8563
9313
  {
8564
9314
  value: localChannel,
8565
9315
  onChange: (value) => {
@@ -8574,24 +9324,38 @@ var GeneralTab5 = ({
8574
9324
  { value: "rcs", label: "RCS (Coming Soon)", disabled: true }
8575
9325
  ]
8576
9326
  }
8577
- )), /* @__PURE__ */ React101.createElement(Divider6, { variant: "dashed" }), localChannel === "email" && /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Group30, { justify: "space-between" }, /* @__PURE__ */ React101.createElement(Text51, { size: "sm", fw: 600 }, "To (Recipients)"), /* @__PURE__ */ React101.createElement(Button24, { size: "xs", leftSection: /* @__PURE__ */ React101.createElement(IconPlus2, { size: 14 }), onClick: () => handleAddRecipient("to") }, "Add")), localTo.length === 0 && /* @__PURE__ */ React101.createElement(Text51, { size: "xs", c: "dimmed" }, "No recipients added yet"), /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, localTo.map((recipient, index) => /* @__PURE__ */ React101.createElement(Paper10, { key: index, p: "xs", withBorder: true }, /* @__PURE__ */ React101.createElement(Group30, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React101.createElement(TextInput36, { style: { flex: 1 }, placeholder: "email@example.com", value: recipient, onChange: (e) => handleRecipientChange("to", index, e.currentTarget.value) }), /* @__PURE__ */ React101.createElement(ActionIcon14, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("to", index) }, /* @__PURE__ */ React101.createElement(IconTrash2, { size: 16 }))))))), /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Group30, { justify: "space-between" }, /* @__PURE__ */ React101.createElement(Text51, { size: "sm", fw: 600 }, "CC (Optional)"), /* @__PURE__ */ React101.createElement(Button24, { size: "xs", leftSection: /* @__PURE__ */ React101.createElement(IconPlus2, { size: 14 }), onClick: () => handleAddRecipient("cc") }, "Add")), localCc.length > 0 && /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, localCc.map((recipient, index) => /* @__PURE__ */ React101.createElement(Paper10, { key: index, p: "xs", withBorder: true }, /* @__PURE__ */ React101.createElement(Group30, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React101.createElement(
8578
- TextInput36,
9327
+ )), /* @__PURE__ */ React104.createElement(Divider6, { variant: "dashed" }), localChannel === "email" && /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Group33, { justify: "space-between" }, /* @__PURE__ */ React104.createElement(Text53, { size: "sm", fw: 600 }, "To (Recipients)"), /* @__PURE__ */ React104.createElement(Button26, { size: "xs", leftSection: /* @__PURE__ */ React104.createElement(IconPlus3, { size: 14 }), onClick: () => handleAddRecipient("to") }, "Add")), localTo.length === 0 && /* @__PURE__ */ React104.createElement(Text53, { size: "xs", c: "dimmed" }, "No recipients added yet"), /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, localTo.map((recipient, index) => /* @__PURE__ */ React104.createElement(Paper11, { key: index, p: "xs", withBorder: true }, /* @__PURE__ */ React104.createElement(Group33, { gap: "xs", wrap: "nowrap", align: "flex-start" }, /* @__PURE__ */ React104.createElement(
9328
+ DataInput,
9329
+ {
9330
+ placeholder: "email@example.com or reference",
9331
+ value: recipient,
9332
+ onChange: (value) => handleRecipientChange("to", index, value),
9333
+ editorDocument: editor?.document || [],
9334
+ currentBlockId: blockId,
9335
+ size: "sm"
9336
+ }
9337
+ ), /* @__PURE__ */ React104.createElement(ActionIcon17, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("to", index) }, /* @__PURE__ */ React104.createElement(IconTrash3, { size: 16 }))))))), /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Group33, { justify: "space-between" }, /* @__PURE__ */ React104.createElement(Text53, { size: "sm", fw: 600 }, "CC (Optional)"), /* @__PURE__ */ React104.createElement(Button26, { size: "xs", leftSection: /* @__PURE__ */ React104.createElement(IconPlus3, { size: 14 }), onClick: () => handleAddRecipient("cc") }, "Add")), localCc.length > 0 && /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, localCc.map((recipient, index) => /* @__PURE__ */ React104.createElement(Paper11, { key: index, p: "xs", withBorder: true }, /* @__PURE__ */ React104.createElement(Group33, { gap: "xs", wrap: "nowrap", align: "flex-start" }, /* @__PURE__ */ React104.createElement(
9338
+ DataInput,
8579
9339
  {
8580
- style: { flex: 1 },
8581
- placeholder: "email@example.com",
9340
+ placeholder: "email@example.com or reference",
8582
9341
  value: recipient,
8583
- onChange: (e) => handleRecipientChange("cc", index, e.currentTarget.value)
9342
+ onChange: (value) => handleRecipientChange("cc", index, value),
9343
+ editorDocument: editor?.document || [],
9344
+ currentBlockId: blockId,
9345
+ size: "sm"
8584
9346
  }
8585
- ), /* @__PURE__ */ React101.createElement(ActionIcon14, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("cc", index) }, /* @__PURE__ */ React101.createElement(IconTrash2, { size: 16 }))))))), /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Group30, { justify: "space-between" }, /* @__PURE__ */ React101.createElement(Text51, { size: "sm", fw: 600 }, "BCC (Optional)"), /* @__PURE__ */ React101.createElement(Button24, { size: "xs", leftSection: /* @__PURE__ */ React101.createElement(IconPlus2, { size: 14 }), onClick: () => handleAddRecipient("bcc") }, "Add")), localBcc.length > 0 && /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, localBcc.map((recipient, index) => /* @__PURE__ */ React101.createElement(Paper10, { key: index, p: "xs", withBorder: true }, /* @__PURE__ */ React101.createElement(Group30, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React101.createElement(
8586
- TextInput36,
9347
+ ), /* @__PURE__ */ React104.createElement(ActionIcon17, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("cc", index) }, /* @__PURE__ */ React104.createElement(IconTrash3, { size: 16 }))))))), /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Group33, { justify: "space-between" }, /* @__PURE__ */ React104.createElement(Text53, { size: "sm", fw: 600 }, "BCC (Optional)"), /* @__PURE__ */ React104.createElement(Button26, { size: "xs", leftSection: /* @__PURE__ */ React104.createElement(IconPlus3, { size: 14 }), onClick: () => handleAddRecipient("bcc") }, "Add")), localBcc.length > 0 && /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, localBcc.map((recipient, index) => /* @__PURE__ */ React104.createElement(Paper11, { key: index, p: "xs", withBorder: true }, /* @__PURE__ */ React104.createElement(Group33, { gap: "xs", wrap: "nowrap", align: "flex-start" }, /* @__PURE__ */ React104.createElement(
9348
+ DataInput,
8587
9349
  {
8588
- style: { flex: 1 },
8589
- placeholder: "email@example.com",
9350
+ placeholder: "email@example.com or reference",
8590
9351
  value: recipient,
8591
- onChange: (e) => handleRecipientChange("bcc", index, e.currentTarget.value)
9352
+ onChange: (value) => handleRecipientChange("bcc", index, value),
9353
+ editorDocument: editor?.document || [],
9354
+ currentBlockId: blockId,
9355
+ size: "sm"
8592
9356
  }
8593
- ), /* @__PURE__ */ React101.createElement(ActionIcon14, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("bcc", index) }, /* @__PURE__ */ React101.createElement(IconTrash2, { size: 16 }))))))), /* @__PURE__ */ React101.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Text51, { size: "sm", fw: 600 }, "From (Optional)"), /* @__PURE__ */ React101.createElement(
8594
- TextInput36,
9357
+ ), /* @__PURE__ */ React104.createElement(ActionIcon17, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("bcc", index) }, /* @__PURE__ */ React104.createElement(IconTrash3, { size: 16 }))))))), /* @__PURE__ */ React104.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Text53, { size: "sm", fw: 600 }, "From (Optional)"), /* @__PURE__ */ React104.createElement(
9358
+ TextInput37,
8595
9359
  {
8596
9360
  placeholder: "sender@example.com",
8597
9361
  value: localFrom,
@@ -8601,8 +9365,8 @@ var GeneralTab5 = ({
8601
9365
  onFromChange(newFrom);
8602
9366
  }
8603
9367
  }
8604
- ), /* @__PURE__ */ React101.createElement(Text51, { size: "xs", c: "dimmed" }, "Custom sender email address")), /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Text51, { size: "sm", fw: 600 }, "Reply-To (Optional)"), /* @__PURE__ */ React101.createElement(
8605
- TextInput36,
9368
+ ), /* @__PURE__ */ React104.createElement(Text53, { size: "xs", c: "dimmed" }, "Custom sender email address")), /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Text53, { size: "sm", fw: 600 }, "Reply-To (Optional)"), /* @__PURE__ */ React104.createElement(
9369
+ TextInput37,
8606
9370
  {
8607
9371
  placeholder: "reply@example.com",
8608
9372
  value: localReplyTo,
@@ -8612,8 +9376,8 @@ var GeneralTab5 = ({
8612
9376
  onReplyToChange(newReplyTo);
8613
9377
  }
8614
9378
  }
8615
- ), /* @__PURE__ */ React101.createElement(Text51, { size: "xs", c: "dimmed" }, "Where replies should be sent")), /* @__PURE__ */ React101.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Text51, { size: "sm", fw: 600 }, "Subject"), /* @__PURE__ */ React101.createElement(
8616
- TextInput36,
9379
+ ), /* @__PURE__ */ React104.createElement(Text53, { size: "xs", c: "dimmed" }, "Where replies should be sent")), /* @__PURE__ */ React104.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Text53, { size: "sm", fw: 600 }, "Subject"), /* @__PURE__ */ React104.createElement(
9380
+ TextInput37,
8617
9381
  {
8618
9382
  placeholder: "Email subject line",
8619
9383
  value: localSubject,
@@ -8623,8 +9387,8 @@ var GeneralTab5 = ({
8623
9387
  onSubjectChange(newSubject);
8624
9388
  }
8625
9389
  }
8626
- )), /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Text51, { size: "sm", fw: 600 }, "Body Type"), /* @__PURE__ */ React101.createElement(
8627
- Select12,
9390
+ )), /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Text53, { size: "sm", fw: 600 }, "Body Type"), /* @__PURE__ */ React104.createElement(
9391
+ Select14,
8628
9392
  {
8629
9393
  value: localBodyType,
8630
9394
  onChange: (value) => {
@@ -8637,8 +9401,8 @@ var GeneralTab5 = ({
8637
9401
  { value: "html", label: "HTML" }
8638
9402
  ]
8639
9403
  }
8640
- )), /* @__PURE__ */ React101.createElement(Stack76, { gap: "xs" }, /* @__PURE__ */ React101.createElement(Text51, { size: "sm", fw: 600 }, "Body"), /* @__PURE__ */ React101.createElement(
8641
- Textarea20,
9404
+ )), /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Text53, { size: "sm", fw: 600 }, "Body"), /* @__PURE__ */ React104.createElement(
9405
+ Textarea21,
8642
9406
  {
8643
9407
  placeholder: localBodyType === "html" ? "<h1>Hello!</h1><p>Welcome to our service.</p>" : "Email body content",
8644
9408
  minRows: 6,
@@ -8649,13 +9413,13 @@ var GeneralTab5 = ({
8649
9413
  onBodyChange(newBody);
8650
9414
  }
8651
9415
  }
8652
- ), /* @__PURE__ */ React101.createElement(Text51, { size: "xs", c: "dimmed" }, localBodyType === "html" ? "HTML content for the email body" : "Plain text content for the email body"))));
9416
+ ), /* @__PURE__ */ React104.createElement(Text53, { size: "xs", c: "dimmed" }, localBodyType === "html" ? "HTML content for the email body" : "Plain text content for the email body"))));
8653
9417
  };
8654
9418
 
8655
9419
  // src/mantine/blocks/notify/template/TemplateConfig.tsx
8656
9420
  var TemplateConfig5 = ({ editor, block }) => {
8657
9421
  const { closePanel } = usePanelStore();
8658
- const updateProp = useCallback18(
9422
+ const updateProp = useCallback19(
8659
9423
  (key, value) => {
8660
9424
  editor.updateBlock(block, {
8661
9425
  props: {
@@ -8666,26 +9430,26 @@ var TemplateConfig5 = ({ editor, block }) => {
8666
9430
  },
8667
9431
  [editor, block]
8668
9432
  );
8669
- const handleToChange = useCallback18(
9433
+ const handleToChange = useCallback19(
8670
9434
  (to) => {
8671
9435
  updateProp("to", JSON.stringify(to));
8672
9436
  },
8673
9437
  [updateProp]
8674
9438
  );
8675
- const handleCcChange = useCallback18(
9439
+ const handleCcChange = useCallback19(
8676
9440
  (cc) => {
8677
9441
  updateProp("cc", JSON.stringify(cc));
8678
9442
  },
8679
9443
  [updateProp]
8680
9444
  );
8681
- const handleBccChange = useCallback18(
9445
+ const handleBccChange = useCallback19(
8682
9446
  (bcc) => {
8683
9447
  updateProp("bcc", JSON.stringify(bcc));
8684
9448
  },
8685
9449
  [updateProp]
8686
9450
  );
8687
- return /* @__PURE__ */ React102.createElement(
8688
- Paper11,
9451
+ return /* @__PURE__ */ React105.createElement(
9452
+ Paper12,
8689
9453
  {
8690
9454
  p: "md",
8691
9455
  shadow: "sm",
@@ -8695,7 +9459,7 @@ var TemplateConfig5 = ({ editor, block }) => {
8695
9459
  flexDirection: "column"
8696
9460
  }
8697
9461
  },
8698
- /* @__PURE__ */ React102.createElement(
9462
+ /* @__PURE__ */ React105.createElement(
8699
9463
  "div",
8700
9464
  {
8701
9465
  style: {
@@ -8705,17 +9469,17 @@ var TemplateConfig5 = ({ editor, block }) => {
8705
9469
  marginBottom: "1rem"
8706
9470
  }
8707
9471
  },
8708
- /* @__PURE__ */ React102.createElement(Title8, { order: 3 }, "Notification Settings"),
8709
- /* @__PURE__ */ React102.createElement(CloseButton7, { onClick: closePanel })
9472
+ /* @__PURE__ */ React105.createElement(Title8, { order: 3 }, "Notification Settings"),
9473
+ /* @__PURE__ */ React105.createElement(CloseButton7, { onClick: closePanel })
8710
9474
  ),
8711
- /* @__PURE__ */ React102.createElement(
9475
+ /* @__PURE__ */ React105.createElement(
8712
9476
  ReusablePanel,
8713
9477
  {
8714
9478
  extraTabs: [
8715
9479
  {
8716
9480
  label: "General",
8717
9481
  value: "general",
8718
- content: /* @__PURE__ */ React102.createElement(
9482
+ content: /* @__PURE__ */ React105.createElement(
8719
9483
  GeneralTab5,
8720
9484
  {
8721
9485
  title: block.props.title || "",
@@ -8757,7 +9521,9 @@ var TemplateConfig5 = ({ editor, block }) => {
8757
9521
  onBodyChange: (value) => updateProp("body", value),
8758
9522
  onBodyTypeChange: (value) => updateProp("bodyType", value),
8759
9523
  onFromChange: (value) => updateProp("from", value),
8760
- onReplyToChange: (value) => updateProp("replyTo", value)
9524
+ onReplyToChange: (value) => updateProp("replyTo", value),
9525
+ editor,
9526
+ blockId: block.id
8761
9527
  }
8762
9528
  )
8763
9529
  }
@@ -8769,11 +9535,11 @@ var TemplateConfig5 = ({ editor, block }) => {
8769
9535
  };
8770
9536
 
8771
9537
  // src/mantine/blocks/notify/template/TemplateView.tsx
8772
- import { Card as Card22, Group as Group31, Stack as Stack77, Text as Text52, ActionIcon as ActionIcon15, Badge as Badge12 } from "@mantine/core";
9538
+ import { Card as Card22, Group as Group34, Stack as Stack79, Text as Text54, ActionIcon as ActionIcon18, Badge as Badge14 } from "@mantine/core";
8773
9539
  var NOTIFY_TEMPLATE_PANEL_ID = "notify-template-panel";
8774
9540
  var NotifyTemplateView = ({ editor, block }) => {
8775
9541
  const panelId = `${NOTIFY_TEMPLATE_PANEL_ID}-${block.id}`;
8776
- const panelContent = useMemo15(() => /* @__PURE__ */ React103.createElement(TemplateConfig5, { editor, block }), [editor, block]);
9542
+ const panelContent = useMemo18(() => /* @__PURE__ */ React106.createElement(TemplateConfig5, { editor, block }), [editor, block]);
8777
9543
  const { open } = usePanel(panelId, panelContent);
8778
9544
  const channel = block.props.channel || "email";
8779
9545
  const to = (() => {
@@ -8798,17 +9564,17 @@ var NotifyTemplateView = ({ editor, block }) => {
8798
9564
  return "gray";
8799
9565
  }
8800
9566
  };
8801
- return /* @__PURE__ */ React103.createElement(Card22, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React103.createElement(Badge12, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React103.createElement(Group31, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React103.createElement(Group31, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React103.createElement(ActionIcon15, { variant: "light", color: getChannelColor(channel), size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "bell")), /* @__PURE__ */ React103.createElement(Stack77, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React103.createElement(Group31, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React103.createElement(Badge12, { size: "sm", variant: "filled", color: getChannelColor(channel) }, channel.toUpperCase()), /* @__PURE__ */ React103.createElement(Text52, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Notification")), /* @__PURE__ */ React103.createElement(Text52, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, to.length > 0 ? `To: ${to.join(", ")}` : "Click to configure recipients"), block.props.description && /* @__PURE__ */ React103.createElement(Text52, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description)))));
9567
+ return /* @__PURE__ */ React106.createElement(Card22, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React106.createElement(Badge14, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React106.createElement(Group34, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React106.createElement(Group34, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React106.createElement(ActionIcon18, { variant: "light", color: getChannelColor(channel), size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "bell")), /* @__PURE__ */ React106.createElement(Stack79, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React106.createElement(Group34, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React106.createElement(Badge14, { size: "sm", variant: "filled", color: getChannelColor(channel) }, channel.toUpperCase()), /* @__PURE__ */ React106.createElement(Text54, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Notification")), /* @__PURE__ */ React106.createElement(Text54, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, to.length > 0 ? `To: ${to.join(", ")}` : "Click to configure recipients"), block.props.description && /* @__PURE__ */ React106.createElement(Text54, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description)))));
8802
9568
  };
8803
9569
 
8804
9570
  // src/mantine/blocks/notify/flow/FlowView.tsx
8805
- import React104, { useState as useState27 } from "react";
8806
- import { Card as Card23, Group as Group32, Stack as Stack78, Text as Text53, ActionIcon as ActionIcon16, Tooltip as Tooltip5, Button as Button25, Badge as Badge13, Collapse as Collapse3, Alert as Alert10, Loader as Loader5, Code as Code2 } from "@mantine/core";
8807
- import { IconSend as IconSend2, IconChevronDown as IconChevronDown3, IconChevronUp as IconChevronUp3, IconCheck, IconX } from "@tabler/icons-react";
9571
+ import React107, { useState as useState29 } from "react";
9572
+ import { Card as Card23, Group as Group35, Stack as Stack80, Text as Text55, ActionIcon as ActionIcon19, Tooltip as Tooltip7, Button as Button27, Badge as Badge15, Collapse as Collapse3, Alert as Alert11, Loader as Loader6, Code as Code3 } from "@mantine/core";
9573
+ import { IconSend as IconSend2, IconChevronDown as IconChevronDown3, IconChevronUp as IconChevronUp3, IconCheck, IconX as IconX3 } from "@tabler/icons-react";
8808
9574
  var NotifyFlowView = ({ editor, block, isDisabled }) => {
8809
9575
  const disabled = isDisabled?.isDisabled === "disable";
8810
- const [isLoading, setIsLoading] = useState27(false);
8811
- const [showDetails, setShowDetails] = useState27(false);
9576
+ const [isLoading, setIsLoading] = useState29(false);
9577
+ const [showDetails, setShowDetails] = useState29(false);
8812
9578
  let handlers = null;
8813
9579
  try {
8814
9580
  handlers = useBlocknoteHandlers();
@@ -8871,17 +9637,25 @@ var NotifyFlowView = ({ editor, block, isDisabled }) => {
8871
9637
  props: { ...block.props, status: "sending", errorMessage: "" }
8872
9638
  });
8873
9639
  try {
9640
+ const editorDocument = editor?.document || [];
8874
9641
  if (channel === "email") {
9642
+ const resolvedTo = to.filter((email) => email.trim() !== "").map((email) => resolveReferences(email, editorDocument));
9643
+ const resolvedCc = cc.filter((email) => email.trim() !== "").map((email) => resolveReferences(email, editorDocument));
9644
+ const resolvedBcc = bcc.filter((email) => email.trim() !== "").map((email) => resolveReferences(email, editorDocument));
9645
+ const resolvedSubject = resolveReferences(block.props.subject || "", editorDocument);
9646
+ const resolvedBody = resolveReferences(block.props.body || "", editorDocument);
9647
+ const resolvedFrom = block.props.from ? resolveReferences(block.props.from, editorDocument) : void 0;
9648
+ const resolvedReplyTo = block.props.replyTo ? resolveReferences(block.props.replyTo, editorDocument) : void 0;
8875
9649
  const params = {
8876
9650
  channel: "email",
8877
- to: to.filter((email) => email.trim() !== ""),
8878
- cc: cc.filter((email) => email.trim() !== ""),
8879
- bcc: bcc.filter((email) => email.trim() !== ""),
8880
- subject: block.props.subject || "",
8881
- body: block.props.body || "",
9651
+ to: resolvedTo,
9652
+ cc: resolvedCc,
9653
+ bcc: resolvedBcc,
9654
+ subject: resolvedSubject,
9655
+ body: resolvedBody,
8882
9656
  bodyType: block.props.bodyType || "text",
8883
- from: block.props.from || void 0,
8884
- replyTo: block.props.replyTo || void 0
9657
+ from: resolvedFrom,
9658
+ replyTo: resolvedReplyTo
8885
9659
  };
8886
9660
  if (params.cc?.length === 0) delete params.cc;
8887
9661
  if (params.bcc?.length === 0) delete params.bcc;
@@ -8909,20 +9683,20 @@ var NotifyFlowView = ({ editor, block, isDisabled }) => {
8909
9683
  }
8910
9684
  };
8911
9685
  const canSend = !disabled && !isLoading && handlers && to.length > 0 && (channel === "email" ? block.props.subject && block.props.body : true);
8912
- const sendButton = /* @__PURE__ */ React104.createElement(
8913
- Button25,
9686
+ const sendButton = /* @__PURE__ */ React107.createElement(
9687
+ Button27,
8914
9688
  {
8915
9689
  size: "sm",
8916
9690
  variant: "light",
8917
9691
  color: getChannelColor(channel),
8918
- leftSection: isLoading ? /* @__PURE__ */ React104.createElement(Loader5, { size: 14 }) : status === "sent" ? /* @__PURE__ */ React104.createElement(IconCheck, { size: 14 }) : /* @__PURE__ */ React104.createElement(IconSend2, { size: 14 }),
9692
+ leftSection: isLoading ? /* @__PURE__ */ React107.createElement(Loader6, { size: 14 }) : status === "sent" ? /* @__PURE__ */ React107.createElement(IconCheck, { size: 14 }) : /* @__PURE__ */ React107.createElement(IconSend2, { size: 14 }),
8919
9693
  onClick: handleSendNotification,
8920
9694
  disabled: !canSend,
8921
9695
  style: { flexShrink: 0 }
8922
9696
  },
8923
9697
  isLoading ? "Sending..." : status === "sent" ? "Sent" : "Send"
8924
9698
  );
8925
- return /* @__PURE__ */ React104.createElement(Card23, { withBorder: true, padding: "md", radius: "md", style: { width: "100%" } }, /* @__PURE__ */ React104.createElement(Stack78, { gap: "md" }, /* @__PURE__ */ React104.createElement(Group32, { wrap: "nowrap", justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React104.createElement(Group32, { wrap: "nowrap", align: "flex-start", style: { flex: 1 } }, /* @__PURE__ */ React104.createElement(ActionIcon16, { variant: "light", color: getChannelColor(channel), size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "bell")), /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React104.createElement(Group32, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React104.createElement(Badge13, { size: "sm", variant: "filled", color: getChannelColor(channel) }, channel.toUpperCase()), /* @__PURE__ */ React104.createElement(Text53, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Notification"), status !== "idle" && /* @__PURE__ */ React104.createElement(Badge13, { size: "xs", variant: "dot", color: getStatusColor(status) }, status)), /* @__PURE__ */ React104.createElement(Text53, { 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__ */ React104.createElement(Text53, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), /* @__PURE__ */ React104.createElement(Group32, { gap: "xs", style: { flexShrink: 0 } }, disabled && isDisabled?.message ? /* @__PURE__ */ React104.createElement(Tooltip5, { label: isDisabled.message, position: "left", withArrow: true }, sendButton) : sendButton, /* @__PURE__ */ React104.createElement(ActionIcon16, { variant: "subtle", onClick: () => setShowDetails(!showDetails) }, showDetails ? /* @__PURE__ */ React104.createElement(IconChevronUp3, { size: 16 }) : /* @__PURE__ */ React104.createElement(IconChevronDown3, { size: 16 })))), status === "failed" && block.props.errorMessage && /* @__PURE__ */ React104.createElement(Alert10, { color: "red", icon: /* @__PURE__ */ React104.createElement(IconX, { size: 16 }), title: "Failed to send", styles: { message: { fontSize: "12px" } } }, block.props.errorMessage), status === "sent" && block.props.messageId && /* @__PURE__ */ React104.createElement(Alert10, { color: "green", icon: /* @__PURE__ */ React104.createElement(IconCheck, { size: 16 }), title: "Sent successfully", styles: { message: { fontSize: "12px" } } }, "Message ID: ", block.props.messageId, block.props.sentAt && /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement("br", null), "Sent at: ", new Date(block.props.sentAt).toLocaleString())), /* @__PURE__ */ React104.createElement(Collapse3, { in: showDetails }, /* @__PURE__ */ React104.createElement(Stack78, { gap: "md" }, channel === "email" && /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Text53, { size: "xs", fw: 600, c: "dimmed" }, "Recipients:"), /* @__PURE__ */ React104.createElement(Code2, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
9699
+ return /* @__PURE__ */ React107.createElement(Card23, { withBorder: true, padding: "md", radius: "md", style: { width: "100%" } }, /* @__PURE__ */ React107.createElement(Stack80, { gap: "md" }, /* @__PURE__ */ React107.createElement(Group35, { wrap: "nowrap", justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React107.createElement(Group35, { wrap: "nowrap", align: "flex-start", style: { flex: 1 } }, /* @__PURE__ */ React107.createElement(ActionIcon19, { variant: "light", color: getChannelColor(channel), size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "bell")), /* @__PURE__ */ React107.createElement(Stack80, { gap: "xs", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React107.createElement(Group35, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React107.createElement(Badge15, { size: "sm", variant: "filled", color: getChannelColor(channel) }, channel.toUpperCase()), /* @__PURE__ */ React107.createElement(Text55, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Notification"), status !== "idle" && /* @__PURE__ */ React107.createElement(Badge15, { size: "xs", variant: "dot", color: getStatusColor(status) }, status)), /* @__PURE__ */ React107.createElement(Text55, { 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__ */ React107.createElement(Text55, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), /* @__PURE__ */ React107.createElement(Group35, { gap: "xs", style: { flexShrink: 0 } }, disabled && isDisabled?.message ? /* @__PURE__ */ React107.createElement(Tooltip7, { label: isDisabled.message, position: "left", withArrow: true }, sendButton) : sendButton, /* @__PURE__ */ React107.createElement(ActionIcon19, { variant: "subtle", onClick: () => setShowDetails(!showDetails) }, showDetails ? /* @__PURE__ */ React107.createElement(IconChevronUp3, { size: 16 }) : /* @__PURE__ */ React107.createElement(IconChevronDown3, { size: 16 })))), status === "failed" && block.props.errorMessage && /* @__PURE__ */ React107.createElement(Alert11, { color: "red", icon: /* @__PURE__ */ React107.createElement(IconX3, { size: 16 }), title: "Failed to send", styles: { message: { fontSize: "12px" } } }, block.props.errorMessage), status === "sent" && block.props.messageId && /* @__PURE__ */ React107.createElement(Alert11, { color: "green", icon: /* @__PURE__ */ React107.createElement(IconCheck, { size: 16 }), title: "Sent successfully", styles: { message: { fontSize: "12px" } } }, "Message ID: ", block.props.messageId, block.props.sentAt && /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement("br", null), "Sent at: ", new Date(block.props.sentAt).toLocaleString())), /* @__PURE__ */ React107.createElement(Collapse3, { in: showDetails }, /* @__PURE__ */ React107.createElement(Stack80, { gap: "md" }, channel === "email" && /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React107.createElement(Text55, { size: "xs", fw: 600, c: "dimmed" }, "Recipients:"), /* @__PURE__ */ React107.createElement(Code3, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
8926
9700
  {
8927
9701
  to: to.filter((e) => e.trim() !== ""),
8928
9702
  ...cc.length > 0 && { cc: cc.filter((e) => e.trim() !== "") },
@@ -8930,7 +9704,7 @@ var NotifyFlowView = ({ editor, block, isDisabled }) => {
8930
9704
  },
8931
9705
  null,
8932
9706
  2
8933
- ))), block.props.subject && /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Text53, { size: "xs", fw: 600, c: "dimmed" }, "Subject:"), /* @__PURE__ */ React104.createElement(Text53, { size: "xs" }, block.props.subject)), block.props.body && /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Text53, { size: "xs", fw: 600, c: "dimmed" }, "Body (", block.props.bodyType || "text", "):"), /* @__PURE__ */ React104.createElement(Code2, { block: true, style: { fontSize: "11px", maxHeight: "200px", overflow: "auto" } }, block.props.body)), (block.props.from || block.props.replyTo) && /* @__PURE__ */ React104.createElement(Stack78, { gap: "xs" }, /* @__PURE__ */ React104.createElement(Text53, { size: "xs", fw: 600, c: "dimmed" }, "Additional:"), /* @__PURE__ */ React104.createElement(Code2, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
9707
+ ))), block.props.subject && /* @__PURE__ */ React107.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React107.createElement(Text55, { size: "xs", fw: 600, c: "dimmed" }, "Subject:"), /* @__PURE__ */ React107.createElement(Text55, { size: "xs" }, block.props.subject)), block.props.body && /* @__PURE__ */ React107.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React107.createElement(Text55, { size: "xs", fw: 600, c: "dimmed" }, "Body (", block.props.bodyType || "text", "):"), /* @__PURE__ */ React107.createElement(Code3, { block: true, style: { fontSize: "11px", maxHeight: "200px", overflow: "auto" } }, block.props.body)), (block.props.from || block.props.replyTo) && /* @__PURE__ */ React107.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React107.createElement(Text55, { size: "xs", fw: 600, c: "dimmed" }, "Additional:"), /* @__PURE__ */ React107.createElement(Code3, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
8934
9708
  {
8935
9709
  ...block.props.from && { from: block.props.from },
8936
9710
  ...block.props.replyTo && { replyTo: block.props.replyTo }
@@ -8945,7 +9719,7 @@ function NotifyBlock({ editor, block }) {
8945
9719
  const { editable } = useBlocknoteContext();
8946
9720
  const { actions } = useBlockConditions(block, editor);
8947
9721
  if (editable) {
8948
- return /* @__PURE__ */ React105.createElement(NotifyTemplateView, { editor, block });
9722
+ return /* @__PURE__ */ React108.createElement(NotifyTemplateView, { editor, block });
8949
9723
  }
8950
9724
  const conditionConfig = parseConditionConfig(block.props.conditions);
8951
9725
  const hasVisibility = hasVisibilityConditions(conditionConfig);
@@ -8957,7 +9731,7 @@ function NotifyBlock({ editor, block }) {
8957
9731
  const hasEnable = hasEnableConditions(conditionConfig);
8958
9732
  const enableActionExists = actions.some((a) => a.action === "enable");
8959
9733
  const shouldDisable = hasEnable && !enableActionExists;
8960
- return /* @__PURE__ */ React105.createElement(NotifyFlowView, { block, editor, isDisabled: shouldDisable ? { isDisabled: "disable", message: "Notification disabled by conditions" } : void 0 });
9734
+ return /* @__PURE__ */ React108.createElement(NotifyFlowView, { block, editor, isDisabled: shouldDisable ? { isDisabled: "disable", message: "Notification disabled by conditions" } : void 0 });
8961
9735
  }
8962
9736
 
8963
9737
  // src/mantine/blocks/notify/NotifyBlockSpec.tsx
@@ -9001,18 +9775,18 @@ var NotifyBlockSpec = createReactBlockSpec7(
9001
9775
  {
9002
9776
  render: (props) => {
9003
9777
  const ixoProps = props;
9004
- return /* @__PURE__ */ React106.createElement(NotifyBlock, { ...ixoProps });
9778
+ return /* @__PURE__ */ React109.createElement(NotifyBlock, { ...ixoProps });
9005
9779
  }
9006
9780
  }
9007
9781
  );
9008
9782
 
9009
9783
  // src/mantine/blocks/list/ui/ListBlocksToolbar.tsx
9010
- import React107 from "react";
9011
- import { ActionIcon as ActionIcon17, Group as Group33, Tooltip as Tooltip6 } from "@mantine/core";
9784
+ import React110 from "react";
9785
+ import { ActionIcon as ActionIcon20, Group as Group36, Tooltip as Tooltip8 } from "@mantine/core";
9012
9786
  import { IconChevronUp as IconChevronUp4, IconChevronDown as IconChevronDown4 } from "@tabler/icons-react";
9013
9787
  var ListBlocksToolbar = () => {
9014
9788
  const { broadcastCollapse } = useListBlocksUI();
9015
- return /* @__PURE__ */ React107.createElement(Group33, { gap: "xs" }, /* @__PURE__ */ React107.createElement(Tooltip6, { label: "Collapse all lists", withArrow: true }, /* @__PURE__ */ React107.createElement(ActionIcon17, { c: "dimmed", variant: "subtle", size: "sm", "aria-label": "Collapse all lists", onClick: () => broadcastCollapse("collapse") }, /* @__PURE__ */ React107.createElement(IconChevronUp4, { size: 18 }))), /* @__PURE__ */ React107.createElement(Tooltip6, { label: "Expand all lists", withArrow: true }, /* @__PURE__ */ React107.createElement(ActionIcon17, { c: "dimmed", variant: "subtle", size: "sm", "aria-label": "Expand all lists", onClick: () => broadcastCollapse("expand") }, /* @__PURE__ */ React107.createElement(IconChevronDown4, { size: 18 }))));
9789
+ return /* @__PURE__ */ React110.createElement(Group36, { gap: "xs" }, /* @__PURE__ */ React110.createElement(Tooltip8, { label: "Collapse all lists", withArrow: true }, /* @__PURE__ */ React110.createElement(ActionIcon20, { c: "dimmed", variant: "subtle", size: "sm", "aria-label": "Collapse all lists", onClick: () => broadcastCollapse("collapse") }, /* @__PURE__ */ React110.createElement(IconChevronUp4, { size: 18 }))), /* @__PURE__ */ React110.createElement(Tooltip8, { label: "Expand all lists", withArrow: true }, /* @__PURE__ */ React110.createElement(ActionIcon20, { c: "dimmed", variant: "subtle", size: "sm", "aria-label": "Expand all lists", onClick: () => broadcastCollapse("expand") }, /* @__PURE__ */ React110.createElement(IconChevronDown4, { size: 18 }))));
9016
9790
  };
9017
9791
 
9018
9792
  // src/mantine/blocks/registry/blockRegistry.ts
@@ -9141,10 +9915,10 @@ blockRegistry.register({
9141
9915
  });
9142
9916
 
9143
9917
  // src/mantine/blocks/hooks/useBlockDependencies.ts
9144
- import { useMemo as useMemo16, useEffect as useEffect18, useState as useState28, useCallback as useCallback19 } from "react";
9918
+ import { useMemo as useMemo19, useEffect as useEffect19, useState as useState30, useCallback as useCallback20 } from "react";
9145
9919
 
9146
9920
  // src/mantine/blocks/hooks/useDependsOn.ts
9147
- import { useMemo as useMemo17 } from "react";
9921
+ import { useMemo as useMemo20 } from "react";
9148
9922
 
9149
9923
  // src/mantine/blocks/index.ts
9150
9924
  var blockSpecs = {
@@ -9248,31 +10022,6 @@ var getExtraSlashMenuItems = (editor) => {
9248
10022
  group: "Domains",
9249
10023
  subtext: "Create an overview from DID data"
9250
10024
  },
9251
- {
9252
- title: "Proposal Vote",
9253
- onItemClick: () => {
9254
- editor.insertBlocks(
9255
- [
9256
- {
9257
- type: "proposalVote",
9258
- props: {
9259
- title: "",
9260
- subtitle: "",
9261
- icon: 'A\uFFFD\uFFFD,\uFFFD?"A3A_A,A?',
9262
- status: "open",
9263
- daysLeft: 0,
9264
- conditions: ""
9265
- }
9266
- }
9267
- ],
9268
- editor.getTextCursorPosition().block,
9269
- "after"
9270
- );
9271
- },
9272
- aliases: ["vote", "proposal-vote", "governance-vote", "dao-vote"],
9273
- group: "DAO",
9274
- subtext: "Create a proposal voting block"
9275
- },
9276
10025
  {
9277
10026
  title: "Proposal",
9278
10027
  onItemClick: () => {
@@ -9297,28 +10046,6 @@ var getExtraSlashMenuItems = (editor) => {
9297
10046
  group: "DAO",
9298
10047
  subtext: "Create a new DAO proposal"
9299
10048
  },
9300
- {
9301
- title: "Proposal Actions",
9302
- onItemClick: () => {
9303
- editor.insertBlocks(
9304
- [
9305
- {
9306
- type: "proposalActions",
9307
- props: {
9308
- proposalBlockId: "",
9309
- hasDependencies: true,
9310
- actions: "[]"
9311
- }
9312
- }
9313
- ],
9314
- editor.getTextCursorPosition().block,
9315
- "after"
9316
- );
9317
- },
9318
- aliases: ["actions", "proposal-actions", "dao-actions", "governance-actions"],
9319
- group: "DAO",
9320
- subtext: "Manage proposal actions"
9321
- },
9322
10049
  {
9323
10050
  title: "API Request",
9324
10051
  onItemClick: () => {
@@ -9390,7 +10117,7 @@ var getExtraSlashMenuItems = (editor) => {
9390
10117
  const yRoot = editor?._yRoot;
9391
10118
  const docType = yRoot?.get("docType");
9392
10119
  if (docType === "page") {
9393
- return slashMenuList.filter((item) => item.title !== "Proposal Actions" && item.title !== "Proposal Vote" && item.title !== "Proposal");
10120
+ return slashMenuList.filter((item) => item.title !== "Proposal");
9394
10121
  }
9395
10122
  return slashMenuList;
9396
10123
  };
@@ -9463,15 +10190,15 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
9463
10190
  import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
9464
10191
 
9465
10192
  // src/core/hooks/useMatrixProvider.ts
9466
- import { useEffect as useEffect19, useState as useState29, useRef as useRef4, useCallback as useCallback20, useMemo as useMemo18 } from "react";
10193
+ import { useEffect as useEffect20, useState as useState31, useRef as useRef4, useCallback as useCallback21, useMemo as useMemo21 } from "react";
9467
10194
  import { MatrixProvider } from "@ixo/matrix-crdt";
9468
10195
  function useMatrixProvider({ matrixClient, roomId, yDoc }) {
9469
- const [matrixProvider, setProvider] = useState29(null);
9470
- const [status, setStatus] = useState29("disconnected");
10196
+ const [matrixProvider, setProvider] = useState31(null);
10197
+ const [status, setStatus] = useState31("disconnected");
9471
10198
  const isMountedRef = useRef4(true);
9472
10199
  const providerRef = useRef4(null);
9473
10200
  const retryTimeoutRef = useRef4(null);
9474
- const providerOptions = useMemo18(
10201
+ const providerOptions = useMemo21(
9475
10202
  () => ({
9476
10203
  translator: {
9477
10204
  updateEventType: "matrix-crdt.doc_update",
@@ -9484,22 +10211,22 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
9484
10211
  }),
9485
10212
  []
9486
10213
  );
9487
- const handleDocumentAvailable = useCallback20(() => {
10214
+ const handleDocumentAvailable = useCallback21(() => {
9488
10215
  if (isMountedRef.current) {
9489
10216
  setStatus("connected");
9490
10217
  }
9491
10218
  }, []);
9492
- const handleDocumentUnavailable = useCallback20(() => {
10219
+ const handleDocumentUnavailable = useCallback21(() => {
9493
10220
  if (isMountedRef.current) {
9494
10221
  setStatus("failed");
9495
10222
  }
9496
10223
  }, []);
9497
- const handleCanWriteChanged = useCallback20(() => {
10224
+ const handleCanWriteChanged = useCallback21(() => {
9498
10225
  if (isMountedRef.current && providerRef.current) {
9499
10226
  setStatus(providerRef.current.canWrite ? "connected" : "failed");
9500
10227
  }
9501
10228
  }, []);
9502
- const initProvider = useCallback20(async () => {
10229
+ const initProvider = useCallback21(async () => {
9503
10230
  if (!isMountedRef.current) return;
9504
10231
  if (retryTimeoutRef.current) {
9505
10232
  clearTimeout(retryTimeoutRef.current);
@@ -9533,7 +10260,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
9533
10260
  }
9534
10261
  }
9535
10262
  }, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
9536
- useEffect19(() => {
10263
+ useEffect20(() => {
9537
10264
  isMountedRef.current = true;
9538
10265
  initProvider();
9539
10266
  return () => {
@@ -9550,7 +10277,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
9550
10277
  setStatus("disconnected");
9551
10278
  };
9552
10279
  }, [initProvider]);
9553
- useEffect19(() => {
10280
+ useEffect20(() => {
9554
10281
  return () => {
9555
10282
  isMountedRef.current = false;
9556
10283
  };
@@ -9559,17 +10286,17 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
9559
10286
  }
9560
10287
 
9561
10288
  // src/mantine/hooks/useCollaborativeYDoc.ts
9562
- import { useMemo as useMemo19 } from "react";
10289
+ import { useMemo as useMemo22 } from "react";
9563
10290
  import * as Y from "yjs";
9564
10291
  function useCollaborativeYDoc(_options) {
9565
- return useMemo19(() => {
10292
+ return useMemo22(() => {
9566
10293
  const doc = new Y.Doc();
9567
10294
  return doc;
9568
10295
  }, []);
9569
10296
  }
9570
10297
 
9571
10298
  // src/mantine/hooks/useCollaborativeIxoEditor.ts
9572
- import { useMemo as useMemo20, useEffect as useEffect20 } from "react";
10299
+ import { useMemo as useMemo23, useEffect as useEffect21 } from "react";
9573
10300
  function useCreateCollaborativeIxoEditor(options) {
9574
10301
  const yDoc = useCollaborativeYDoc(options);
9575
10302
  const {
@@ -9587,7 +10314,7 @@ function useCreateCollaborativeIxoEditor(options) {
9587
10314
  matrixClient,
9588
10315
  permissions = { write: false }
9589
10316
  } = options || {};
9590
- const memoizedUser = useMemo20(
10317
+ const memoizedUser = useMemo23(
9591
10318
  () => ({
9592
10319
  id: user?.id || "",
9593
10320
  name: user?.name || "",
@@ -9602,7 +10329,7 @@ function useCreateCollaborativeIxoEditor(options) {
9602
10329
  matrixClient,
9603
10330
  roomId: options.roomId
9604
10331
  });
9605
- const defaultUploadFile = useMemo20(
10332
+ const defaultUploadFile = useMemo23(
9606
10333
  () => uploadFile || (async (file) => {
9607
10334
  return new Promise((resolve, reject) => {
9608
10335
  const reader = new FileReader();
@@ -9616,7 +10343,7 @@ function useCreateCollaborativeIxoEditor(options) {
9616
10343
  }),
9617
10344
  [uploadFile]
9618
10345
  );
9619
- const schema = useMemo20(
10346
+ const schema = useMemo23(
9620
10347
  () => BlockNoteSchema2.create({
9621
10348
  blockSpecs: {
9622
10349
  ...defaultBlockSpecs2,
@@ -9631,11 +10358,11 @@ function useCreateCollaborativeIxoEditor(options) {
9631
10358
  }),
9632
10359
  []
9633
10360
  );
9634
- const root = useMemo20(() => yDoc.getMap("root"), [yDoc]);
9635
- const documentFragment = useMemo20(() => yDoc.getXmlFragment("document"), [yDoc]);
9636
- const flowArray = useMemo20(() => yDoc.getArray("flow"), [yDoc]);
9637
- const userFragment = useMemo20(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
9638
- const collaborationConfig = useMemo20(
10361
+ const root = useMemo23(() => yDoc.getMap("root"), [yDoc]);
10362
+ const documentFragment = useMemo23(() => yDoc.getXmlFragment("document"), [yDoc]);
10363
+ const flowArray = useMemo23(() => yDoc.getArray("flow"), [yDoc]);
10364
+ const userFragment = useMemo23(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
10365
+ const collaborationConfig = useMemo23(
9639
10366
  () => ({
9640
10367
  provider: matrixProvider,
9641
10368
  fragment: documentFragment,
@@ -9647,7 +10374,7 @@ function useCreateCollaborativeIxoEditor(options) {
9647
10374
  }),
9648
10375
  [matrixProvider, documentFragment, memoizedUser.name, memoizedUser.color]
9649
10376
  );
9650
- const ixoConfig = useMemo20(
10377
+ const ixoConfig = useMemo23(
9651
10378
  () => ({
9652
10379
  theme,
9653
10380
  editable,
@@ -9666,7 +10393,7 @@ function useCreateCollaborativeIxoEditor(options) {
9666
10393
  uploadFile: defaultUploadFile,
9667
10394
  collaboration: collaborationConfig
9668
10395
  });
9669
- const titleText = useMemo20(() => yDoc.getText("title"), [yDoc]);
10396
+ const titleText = useMemo23(() => yDoc.getText("title"), [yDoc]);
9670
10397
  let ixoEditor;
9671
10398
  if (editor) {
9672
10399
  ixoEditor = editor;
@@ -9725,15 +10452,16 @@ function useCreateCollaborativeIxoEditor(options) {
9725
10452
  return;
9726
10453
  }
9727
10454
  console.log("[useCollaborativeIxoEditor] setDocType() called, setting docType to:", value);
10455
+ ixoEditor._authoritativeDocType = value;
9728
10456
  root.set("docType", value);
9729
10457
  };
9730
10458
  }
9731
- useEffect20(() => {
10459
+ useEffect21(() => {
9732
10460
  if (ixoEditor) {
9733
10461
  ixoEditor.isEditable = editable;
9734
10462
  }
9735
10463
  }, [ixoEditor, editable]);
9736
- useEffect20(() => {
10464
+ useEffect21(() => {
9737
10465
  if (connectionStatus !== "connected") {
9738
10466
  return;
9739
10467
  }
@@ -9767,26 +10495,30 @@ function useCreateCollaborativeIxoEditor(options) {
9767
10495
  }
9768
10496
 
9769
10497
  // src/mantine/IxoEditor.tsx
9770
- import React109 from "react";
10498
+ import React112 from "react";
9771
10499
  import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
9772
10500
  import { BlockNoteView } from "@blocknote/mantine";
9773
10501
  import { filterSuggestionItems } from "@blocknote/core";
9774
- import { Flex as Flex20, MantineProvider, Text as Text54 } from "@mantine/core";
10502
+ import { Flex as Flex21, MantineProvider, Text as Text56 } from "@mantine/core";
9775
10503
 
9776
10504
  // src/mantine/components/PanelContent.tsx
9777
- import React108 from "react";
10505
+ import React111 from "react";
10506
+ import { Box as Box21 } from "@mantine/core";
9778
10507
  function PanelContent() {
9779
10508
  const { activePanel, registeredPanels } = usePanelStore();
9780
10509
  const isOpen = activePanel !== null;
9781
10510
  const content = activePanel ? registeredPanels.get(activePanel) : null;
9782
- return /* @__PURE__ */ React108.createElement(
9783
- "div",
10511
+ return /* @__PURE__ */ React111.createElement(
10512
+ Box21,
9784
10513
  {
10514
+ pos: "sticky",
10515
+ right: 0,
10516
+ top: 0,
9785
10517
  style: {
9786
- position: "relative",
9787
- flexBasis: isOpen ? "50%" : "0",
9788
- transition: "flex-basis 0.2s ease",
9789
- overflow: "hidden"
10518
+ width: isOpen ? "50%" : "0",
10519
+ height: "calc(100vh - 150px)",
10520
+ transition: "width 0.2s ease",
10521
+ overflow: isOpen ? "auto" : "hidden"
9790
10522
  }
9791
10523
  },
9792
10524
  isOpen && content
@@ -9803,7 +10535,7 @@ function IxoEditorContent({
9803
10535
  onSelectionChange,
9804
10536
  children
9805
10537
  }) {
9806
- return /* @__PURE__ */ React109.createElement("div", { style: { display: "flex", height: "100%" } }, /* @__PURE__ */ React109.createElement("div", { className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`, style: { flex: 1 } }, /* @__PURE__ */ React109.createElement(
10538
+ return /* @__PURE__ */ React112.createElement("div", { style: { display: "flex", height: "100%" } }, /* @__PURE__ */ React112.createElement("div", { className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`, style: { flex: 1 } }, /* @__PURE__ */ React112.createElement(
9807
10539
  BlockNoteView,
9808
10540
  {
9809
10541
  editor,
@@ -9818,7 +10550,7 @@ function IxoEditorContent({
9818
10550
  onChange,
9819
10551
  onSelectionChange
9820
10552
  },
9821
- config.slashMenu && /* @__PURE__ */ React109.createElement(
10553
+ config.slashMenu && /* @__PURE__ */ React112.createElement(
9822
10554
  SuggestionMenuController,
9823
10555
  {
9824
10556
  triggerCharacter: "/",
@@ -9830,7 +10562,7 @@ function IxoEditorContent({
9830
10562
  }
9831
10563
  ),
9832
10564
  children
9833
- )), /* @__PURE__ */ React109.createElement(PanelContent, null));
10565
+ )), /* @__PURE__ */ React112.createElement(PanelContent, null));
9834
10566
  }
9835
10567
  function IxoEditor({
9836
10568
  editor,
@@ -9856,9 +10588,9 @@ function IxoEditor({
9856
10588
  tableHandles: true
9857
10589
  };
9858
10590
  const isEditable = editable;
9859
- const editorContent = /* @__PURE__ */ React109.createElement(BlocknoteProvider, { editor, handlers, blockRequirements, editable: isEditable }, /* @__PURE__ */ React109.createElement(ListBlocksUIProvider, null, /* @__PURE__ */ React109.createElement(Flex20, { pr: 25, justify: "flex-end", align: "center", gap: "xs" }, /* @__PURE__ */ React109.createElement(Text54, { size: "xs", c: "dimmed", tt: "uppercase" }, "Global actions"), /* @__PURE__ */ React109.createElement(ListBlocksToolbar, null)), /* @__PURE__ */ React109.createElement(IxoEditorContent, { editor, config, isEditable, className, onChange, onSelectionChange }, children)));
10591
+ const editorContent = /* @__PURE__ */ React112.createElement(BlocknoteProvider, { editor, handlers, blockRequirements, editable: isEditable }, /* @__PURE__ */ React112.createElement(ListBlocksUIProvider, null, /* @__PURE__ */ React112.createElement(Flex21, { pr: 25, justify: "flex-end", align: "center", gap: "xs" }, /* @__PURE__ */ React112.createElement(Text56, { size: "xs", c: "dimmed", tt: "uppercase" }, "Global actions"), /* @__PURE__ */ React112.createElement(ListBlocksToolbar, null)), /* @__PURE__ */ React112.createElement(IxoEditorContent, { editor, config, isEditable, className, onChange, onSelectionChange }, children)));
9860
10592
  if (mantineTheme) {
9861
- return /* @__PURE__ */ React109.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
10593
+ return /* @__PURE__ */ React112.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
9862
10594
  }
9863
10595
  return editorContent;
9864
10596
  }
@@ -9942,4 +10674,4 @@ export {
9942
10674
  ixoGraphQLClient,
9943
10675
  getEntity
9944
10676
  };
9945
- //# sourceMappingURL=chunk-BIYUE2UP.mjs.map
10677
+ //# sourceMappingURL=chunk-JQ2HK6IY.mjs.map