@ixo/editor 2.11.0 → 2.13.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.
@@ -16776,8 +16776,8 @@ function useCreateCollaborativeIxoEditor(options) {
16776
16776
  }
16777
16777
 
16778
16778
  // src/mantine/components/CoverImage.tsx
16779
- import React165, { useState as useState61, useRef as useRef11, useEffect as useEffect45 } from "react";
16780
- import { Box as Box29, Button as Button32, Group as Group51 } from "@mantine/core";
16779
+ import React166, { useState as useState61, useRef as useRef11, useEffect as useEffect45 } from "react";
16780
+ import { Box as Box29, Group as Group51 } from "@mantine/core";
16781
16781
 
16782
16782
  // src/core/lib/imageTransform.ts
16783
16783
  var CLOUDFLARE_CDN_BASE = "https://www.ixo.earth/cdn-cgi/image";
@@ -16909,6 +16909,30 @@ function transformIconImage(sourceUrl, size = "default", customOptions) {
16909
16909
  return transformImage(sourceUrl, options);
16910
16910
  }
16911
16911
 
16912
+ // src/mantine/components/Base/CoverImageButton.tsx
16913
+ import React165 from "react";
16914
+ import { Button as Button32 } from "@mantine/core";
16915
+ function CoverImageButton({ isActive = false, children, onClick, style }) {
16916
+ return /* @__PURE__ */ React165.createElement(
16917
+ Button32,
16918
+ {
16919
+ onClick,
16920
+ variant: "filled",
16921
+ size: "xs",
16922
+ style: {
16923
+ backgroundColor: isActive ? "rgba(55, 53, 47, 0.9)" : "rgba(255, 255, 255, 0.9)",
16924
+ color: isActive ? "white" : "#37352f",
16925
+ fontSize: "12px",
16926
+ fontWeight: 500,
16927
+ padding: "4px 8px",
16928
+ height: "auto",
16929
+ ...style
16930
+ }
16931
+ },
16932
+ children
16933
+ );
16934
+ }
16935
+
16912
16936
  // src/mantine/components/CoverImage.tsx
16913
16937
  function CoverImage({ coverImageUrl, logoUrl }) {
16914
16938
  const { editor, handlers, editable } = useBlocknoteContext();
@@ -17009,7 +17033,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
17009
17033
  return null;
17010
17034
  }
17011
17035
  if (!hasCover) {
17012
- return /* @__PURE__ */ React165.createElement(
17036
+ return /* @__PURE__ */ React166.createElement(
17013
17037
  Box29,
17014
17038
  {
17015
17039
  style: {
@@ -17022,7 +17046,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
17022
17046
  onMouseEnter: () => editable && setIsHovering(true),
17023
17047
  onMouseLeave: () => editable && setIsHovering(false)
17024
17048
  },
17025
- /* @__PURE__ */ React165.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "relative", height: "100%" } }, /* @__PURE__ */ React165.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }), /* @__PURE__ */ React165.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") }), editable && isHovering && !logoSrc && /* @__PURE__ */ React165.createElement(
17049
+ /* @__PURE__ */ React166.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "relative", height: "100%" } }, /* @__PURE__ */ React166.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }), /* @__PURE__ */ React166.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") }), editable && isHovering && !logoSrc && /* @__PURE__ */ React166.createElement(
17026
17050
  Group51,
17027
17051
  {
17028
17052
  gap: "xs",
@@ -17033,45 +17057,12 @@ function CoverImage({ coverImageUrl, logoUrl }) {
17033
17057
  zIndex: 10
17034
17058
  }
17035
17059
  },
17036
- /* @__PURE__ */ React165.createElement(
17037
- Button32,
17038
- {
17039
- variant: "filled",
17040
- size: "xs",
17041
- onClick: handleAddLogo,
17042
- style: {
17043
- backgroundColor: "rgba(255, 255, 255, 0.9)",
17044
- color: "#37352f",
17045
- fontSize: "12px",
17046
- fontWeight: 500,
17047
- padding: "4px 8px",
17048
- height: "auto"
17049
- }
17050
- },
17051
- "Add icon"
17052
- ),
17053
- /* @__PURE__ */ React165.createElement(
17054
- Button32,
17055
- {
17056
- variant: "filled",
17057
- size: "xs",
17058
- onClick: handleAddCover,
17059
- style: {
17060
- backgroundColor: "rgba(255, 255, 255, 0.9)",
17061
- color: "#37352f",
17062
- fontSize: "12px",
17063
- fontWeight: 500,
17064
- padding: "4px 8px",
17065
- height: "auto"
17066
- }
17067
- },
17068
- "Add cover"
17069
- )
17070
- ), logoSrc && /* @__PURE__ */ React165.createElement(
17060
+ /* @__PURE__ */ React166.createElement(CoverImageButton, { onClick: handleAddLogo }, "Add icon"),
17061
+ /* @__PURE__ */ React166.createElement(CoverImageButton, { onClick: handleAddCover }, "Add cover")
17062
+ ), logoSrc && /* @__PURE__ */ React166.createElement(
17071
17063
  Box29,
17072
17064
  {
17073
17065
  style: {
17074
- borderRadius: "100%",
17075
17066
  position: "relative",
17076
17067
  insetInlineStart: "0",
17077
17068
  width: "120px",
@@ -17082,7 +17073,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
17082
17073
  zIndex: 11
17083
17074
  }
17084
17075
  },
17085
- /* @__PURE__ */ React165.createElement(
17076
+ /* @__PURE__ */ React166.createElement(
17086
17077
  "img",
17087
17078
  {
17088
17079
  src: logoSrc,
@@ -17090,12 +17081,13 @@ function CoverImage({ coverImageUrl, logoUrl }) {
17090
17081
  style: {
17091
17082
  width: "100%",
17092
17083
  height: "100%",
17084
+ borderRadius: "100%",
17093
17085
  boxShadow: "0 1px 2px rgba(0, 0, 0, 0.1)",
17094
17086
  objectFit: "cover"
17095
17087
  }
17096
17088
  }
17097
17089
  ),
17098
- editable && isHovering && /* @__PURE__ */ React165.createElement(
17090
+ editable && isHovering && /* @__PURE__ */ React166.createElement(
17099
17091
  "div",
17100
17092
  {
17101
17093
  style: {
@@ -17110,62 +17102,14 @@ function CoverImage({ coverImageUrl, logoUrl }) {
17110
17102
  alignItems: "center"
17111
17103
  }
17112
17104
  },
17113
- /* @__PURE__ */ React165.createElement(
17114
- Button32,
17115
- {
17116
- variant: "filled",
17117
- size: "xs",
17118
- onClick: handleChangeLogo,
17119
- style: {
17120
- backgroundColor: "rgba(255, 255, 255, 0.9)",
17121
- color: "#37352f",
17122
- fontSize: "12px",
17123
- fontWeight: 500,
17124
- padding: "4px 8px",
17125
- height: "auto"
17126
- }
17127
- },
17128
- "Change"
17129
- ),
17130
- /* @__PURE__ */ React165.createElement(
17131
- Button32,
17132
- {
17133
- variant: "filled",
17134
- size: "xs",
17135
- onClick: handleRemoveLogo,
17136
- style: {
17137
- backgroundColor: "rgba(255, 255, 255, 0.9)",
17138
- color: "#37352f",
17139
- fontSize: "12px",
17140
- fontWeight: 500,
17141
- padding: "4px 8px",
17142
- height: "auto"
17143
- }
17144
- },
17145
- "Remove"
17146
- ),
17147
- /* @__PURE__ */ React165.createElement(
17148
- Button32,
17149
- {
17150
- variant: "filled",
17151
- size: "xs",
17152
- onClick: handleAddCover,
17153
- style: {
17154
- backgroundColor: "rgba(255, 255, 255, 0.9)",
17155
- color: "#37352f",
17156
- fontSize: "12px",
17157
- fontWeight: 500,
17158
- padding: "4px 8px",
17159
- height: "auto"
17160
- }
17161
- },
17162
- "Add cover"
17163
- )
17105
+ /* @__PURE__ */ React166.createElement(CoverImageButton, { onClick: handleChangeLogo }, "Change"),
17106
+ /* @__PURE__ */ React166.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove"),
17107
+ /* @__PURE__ */ React166.createElement(CoverImageButton, { onClick: handleAddCover }, "Add cover")
17164
17108
  )
17165
17109
  ))
17166
17110
  );
17167
17111
  }
17168
- return /* @__PURE__ */ React165.createElement(
17112
+ return /* @__PURE__ */ React166.createElement(
17169
17113
  Box29,
17170
17114
  {
17171
17115
  style: {
@@ -17186,7 +17130,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
17186
17130
  onMouseMove: handleMouseMove,
17187
17131
  onClick: () => isRepositioning && setIsRepositioning(false)
17188
17132
  },
17189
- /* @__PURE__ */ React165.createElement(
17133
+ /* @__PURE__ */ React166.createElement(
17190
17134
  "img",
17191
17135
  {
17192
17136
  src: coverUrl,
@@ -17204,7 +17148,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
17204
17148
  }
17205
17149
  }
17206
17150
  ),
17207
- editable && isHovering && /* @__PURE__ */ React165.createElement(
17151
+ editable && isHovering && /* @__PURE__ */ React166.createElement(
17208
17152
  Group51,
17209
17153
  {
17210
17154
  gap: "xs",
@@ -17215,59 +17159,11 @@ function CoverImage({ coverImageUrl, logoUrl }) {
17215
17159
  zIndex: 10
17216
17160
  }
17217
17161
  },
17218
- /* @__PURE__ */ React165.createElement(
17219
- Button32,
17220
- {
17221
- variant: "filled",
17222
- size: "xs",
17223
- onClick: handleChangeCover,
17224
- style: {
17225
- backgroundColor: "rgba(255, 255, 255, 0.9)",
17226
- color: "#37352f",
17227
- fontSize: "12px",
17228
- fontWeight: 500,
17229
- padding: "4px 8px",
17230
- height: "auto"
17231
- }
17232
- },
17233
- "Change cover"
17234
- ),
17235
- /* @__PURE__ */ React165.createElement(
17236
- Button32,
17237
- {
17238
- variant: "filled",
17239
- size: "xs",
17240
- onClick: handleReposition,
17241
- style: {
17242
- backgroundColor: isRepositioning ? "rgba(55, 53, 47, 0.9)" : "rgba(255, 255, 255, 0.9)",
17243
- color: isRepositioning ? "white" : "#37352f",
17244
- fontSize: "12px",
17245
- fontWeight: 500,
17246
- padding: "4px 8px",
17247
- height: "auto"
17248
- }
17249
- },
17250
- isRepositioning ? "Done" : "Reposition"
17251
- ),
17252
- /* @__PURE__ */ React165.createElement(
17253
- Button32,
17254
- {
17255
- variant: "filled",
17256
- size: "xs",
17257
- onClick: handleRemoveCover,
17258
- style: {
17259
- backgroundColor: "rgba(255, 255, 255, 0.9)",
17260
- color: "#37352f",
17261
- fontSize: "12px",
17262
- fontWeight: 500,
17263
- padding: "4px 8px",
17264
- height: "auto"
17265
- }
17266
- },
17267
- "Remove"
17268
- )
17162
+ /* @__PURE__ */ React166.createElement(CoverImageButton, { onClick: handleChangeCover }, "Change cover"),
17163
+ /* @__PURE__ */ React166.createElement(CoverImageButton, { onClick: handleReposition, isActive: isRepositioning }, isRepositioning ? "Done" : "Reposition"),
17164
+ /* @__PURE__ */ React166.createElement(CoverImageButton, { onClick: handleRemoveCover }, "Remove")
17269
17165
  ),
17270
- /* @__PURE__ */ React165.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "absolute", bottom: 0, left: -40, right: 0, height: "70px" } }, /* @__PURE__ */ React165.createElement(
17166
+ /* @__PURE__ */ React166.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "absolute", bottom: 0, left: -40, right: 0, height: "70px" } }, /* @__PURE__ */ React166.createElement(
17271
17167
  Box29,
17272
17168
  {
17273
17169
  style: {
@@ -17276,17 +17172,16 @@ function CoverImage({ coverImageUrl, logoUrl }) {
17276
17172
  insetInlineStart: "0",
17277
17173
  width: "120px",
17278
17174
  height: "120px",
17279
- zIndex: 11,
17280
- padding: 12,
17281
- borderRadius: "100%"
17175
+ zIndex: 11
17282
17176
  }
17283
17177
  },
17284
- logoSrc && /* @__PURE__ */ React165.createElement(
17178
+ logoSrc && /* @__PURE__ */ React166.createElement(
17285
17179
  "img",
17286
17180
  {
17287
17181
  src: logoSrc,
17288
17182
  alt: "Logo",
17289
17183
  style: {
17184
+ borderRadius: "100%",
17290
17185
  width: "100%",
17291
17186
  height: "100%",
17292
17187
  boxShadow: "0 1px 2px rgba(0, 0, 0, 0.1)",
@@ -17294,9 +17189,9 @@ function CoverImage({ coverImageUrl, logoUrl }) {
17294
17189
  }
17295
17190
  }
17296
17191
  ),
17297
- editable && isHovering && /* @__PURE__ */ React165.createElement(React165.Fragment, null, logoSrc ? (
17192
+ editable && isHovering && /* @__PURE__ */ React166.createElement(React166.Fragment, null, logoSrc ? (
17298
17193
  // Logo exists: Show Change/Remove buttons when hovering on cover
17299
- /* @__PURE__ */ React165.createElement(
17194
+ /* @__PURE__ */ React166.createElement(
17300
17195
  Group51,
17301
17196
  {
17302
17197
  gap: "xs",
@@ -17307,60 +17202,20 @@ function CoverImage({ coverImageUrl, logoUrl }) {
17307
17202
  zIndex: 12
17308
17203
  }
17309
17204
  },
17310
- /* @__PURE__ */ React165.createElement(
17311
- Button32,
17312
- {
17313
- variant: "filled",
17314
- size: "xs",
17315
- onClick: handleChangeLogo,
17316
- style: {
17317
- backgroundColor: "rgba(255, 255, 255, 0.9)",
17318
- color: "#37352f",
17319
- fontSize: "12px",
17320
- fontWeight: 500,
17321
- padding: "4px 8px",
17322
- height: "auto"
17323
- }
17324
- },
17325
- "Change"
17326
- ),
17327
- /* @__PURE__ */ React165.createElement(
17328
- Button32,
17329
- {
17330
- variant: "filled",
17331
- size: "xs",
17332
- onClick: handleRemoveLogo,
17333
- style: {
17334
- backgroundColor: "rgba(255, 255, 255, 0.9)",
17335
- color: "#37352f",
17336
- fontSize: "12px",
17337
- fontWeight: 500,
17338
- padding: "4px 8px",
17339
- height: "auto"
17340
- }
17341
- },
17342
- "Remove"
17343
- )
17205
+ /* @__PURE__ */ React166.createElement(CoverImageButton, { onClick: handleChangeLogo }, "Change"),
17206
+ /* @__PURE__ */ React166.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove")
17344
17207
  )
17345
17208
  ) : (
17346
17209
  // No logo: Show "Add icon" button when hovering anywhere on cover
17347
- /* @__PURE__ */ React165.createElement(
17348
- Button32,
17210
+ /* @__PURE__ */ React166.createElement(
17211
+ CoverImageButton,
17349
17212
  {
17350
- variant: "filled",
17351
- size: "xs",
17352
17213
  onClick: handleAddLogo,
17353
17214
  style: {
17354
17215
  position: "absolute",
17355
17216
  top: "50%",
17356
17217
  left: "50%",
17357
17218
  transform: "translate(-50%, -50%)",
17358
- backgroundColor: "rgba(255, 255, 255, 0.9)",
17359
- color: "#37352f",
17360
- fontSize: "12px",
17361
- fontWeight: 500,
17362
- padding: "4px 8px",
17363
- height: "auto",
17364
17219
  zIndex: 12
17365
17220
  }
17366
17221
  },
@@ -17368,13 +17223,13 @@ function CoverImage({ coverImageUrl, logoUrl }) {
17368
17223
  )
17369
17224
  ))
17370
17225
  )),
17371
- /* @__PURE__ */ React165.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }),
17372
- /* @__PURE__ */ React165.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") })
17226
+ /* @__PURE__ */ React166.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }),
17227
+ /* @__PURE__ */ React166.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") })
17373
17228
  );
17374
17229
  }
17375
17230
 
17376
17231
  // src/mantine/components/PageHeader.tsx
17377
- import React166, { useState as useState62, useRef as useRef12, useEffect as useEffect46 } from "react";
17232
+ import React167, { useState as useState62, useRef as useRef12, useEffect as useEffect46 } from "react";
17378
17233
  function PageHeader({
17379
17234
  title = "New page",
17380
17235
  icon,
@@ -17406,14 +17261,14 @@ function PageHeader({
17406
17261
  setIsMenuOpen(false);
17407
17262
  }
17408
17263
  };
17409
- return /* @__PURE__ */ React166.createElement("div", { style: styles.container }, /* @__PURE__ */ React166.createElement("div", { style: styles.leftSection }, /* @__PURE__ */ React166.createElement("span", { style: styles.icon }, icon || "\u{1F4C4}"), /* @__PURE__ */ React166.createElement("span", { style: styles.title }, title), isPrivate && /* @__PURE__ */ React166.createElement("button", { style: styles.privacyBadge }, /* @__PURE__ */ React166.createElement("span", { style: styles.lockIcon }, "\u{1F512}"), /* @__PURE__ */ React166.createElement("span", null, "Private"), /* @__PURE__ */ React166.createElement("span", { style: styles.chevron }, "\u25BE"))), /* @__PURE__ */ React166.createElement("div", { style: styles.rightSection }, lastEdited && /* @__PURE__ */ React166.createElement("span", { style: styles.editedText }, lastEdited), onShare && /* @__PURE__ */ React166.createElement("button", { style: styles.shareButton, onClick: onShare }, "Share"), onFavorite && /* @__PURE__ */ React166.createElement("button", { style: styles.iconButton, onClick: onFavorite }, isFavorited ? "\u2605" : "\u2606"), menuItems.length > 0 && /* @__PURE__ */ React166.createElement("div", { style: styles.menuContainer, ref: menuRef }, /* @__PURE__ */ React166.createElement(
17264
+ return /* @__PURE__ */ React167.createElement("div", { style: styles.container }, /* @__PURE__ */ React167.createElement("div", { style: styles.leftSection }, /* @__PURE__ */ React167.createElement("span", { style: styles.icon }, icon || "\u{1F4C4}"), /* @__PURE__ */ React167.createElement("span", { style: styles.title }, title), isPrivate && /* @__PURE__ */ React167.createElement("button", { style: styles.privacyBadge }, /* @__PURE__ */ React167.createElement("span", { style: styles.lockIcon }, "\u{1F512}"), /* @__PURE__ */ React167.createElement("span", null, "Private"), /* @__PURE__ */ React167.createElement("span", { style: styles.chevron }, "\u25BE"))), /* @__PURE__ */ React167.createElement("div", { style: styles.rightSection }, lastEdited && /* @__PURE__ */ React167.createElement("span", { style: styles.editedText }, lastEdited), onShare && /* @__PURE__ */ React167.createElement("button", { style: styles.shareButton, onClick: onShare }, "Share"), onFavorite && /* @__PURE__ */ React167.createElement("button", { style: styles.iconButton, onClick: onFavorite }, isFavorited ? "\u2605" : "\u2606"), menuItems.length > 0 && /* @__PURE__ */ React167.createElement("div", { style: styles.menuContainer, ref: menuRef }, /* @__PURE__ */ React167.createElement(
17410
17265
  "button",
17411
17266
  {
17412
17267
  style: styles.menuButton,
17413
17268
  onClick: () => setIsMenuOpen(!isMenuOpen),
17414
17269
  "aria-label": "Menu"
17415
17270
  },
17416
- /* @__PURE__ */ React166.createElement(
17271
+ /* @__PURE__ */ React167.createElement(
17417
17272
  "svg",
17418
17273
  {
17419
17274
  width: "16",
@@ -17421,11 +17276,11 @@ function PageHeader({
17421
17276
  viewBox: "0 0 16 16",
17422
17277
  fill: "currentColor"
17423
17278
  },
17424
- /* @__PURE__ */ React166.createElement("circle", { cx: "3", cy: "8", r: "1.5" }),
17425
- /* @__PURE__ */ React166.createElement("circle", { cx: "8", cy: "8", r: "1.5" }),
17426
- /* @__PURE__ */ React166.createElement("circle", { cx: "13", cy: "8", r: "1.5" })
17279
+ /* @__PURE__ */ React167.createElement("circle", { cx: "3", cy: "8", r: "1.5" }),
17280
+ /* @__PURE__ */ React167.createElement("circle", { cx: "8", cy: "8", r: "1.5" }),
17281
+ /* @__PURE__ */ React167.createElement("circle", { cx: "13", cy: "8", r: "1.5" })
17427
17282
  )
17428
- ), isMenuOpen && /* @__PURE__ */ React166.createElement("div", { style: styles.dropdown }, menuItems.map((item, index) => /* @__PURE__ */ React166.createElement(React166.Fragment, { key: index }, item.divider && index > 0 && /* @__PURE__ */ React166.createElement("div", { style: styles.divider }), /* @__PURE__ */ React166.createElement(
17283
+ ), isMenuOpen && /* @__PURE__ */ React167.createElement("div", { style: styles.dropdown }, menuItems.map((item, index) => /* @__PURE__ */ React167.createElement(React167.Fragment, { key: index }, item.divider && index > 0 && /* @__PURE__ */ React167.createElement("div", { style: styles.divider }), /* @__PURE__ */ React167.createElement(
17429
17284
  "button",
17430
17285
  {
17431
17286
  style: {
@@ -17435,8 +17290,8 @@ function PageHeader({
17435
17290
  onClick: () => handleMenuItemClick(item),
17436
17291
  disabled: item.disabled
17437
17292
  },
17438
- item.icon && /* @__PURE__ */ React166.createElement("span", { style: styles.menuItemIcon }, item.icon),
17439
- /* @__PURE__ */ React166.createElement("span", null, item.label)
17293
+ item.icon && /* @__PURE__ */ React167.createElement("span", { style: styles.menuItemIcon }, item.icon),
17294
+ /* @__PURE__ */ React167.createElement("span", null, item.label)
17440
17295
  )))))));
17441
17296
  }
17442
17297
  var styles = {
@@ -17567,13 +17422,22 @@ var styles = {
17567
17422
  };
17568
17423
 
17569
17424
  // src/mantine/components/ExternalDropZone.tsx
17570
- import React167, { useCallback as useCallback42, useEffect as useEffect47, useRef as useRef13, useState as useState63 } from "react";
17425
+ import React168, { useCallback as useCallback42, useEffect as useEffect47, useRef as useRef13, useState as useState63 } from "react";
17571
17426
  import { Box as Box30 } from "@mantine/core";
17572
17427
  var SCROLL_ZONE_SIZE = 80;
17573
17428
  var SCROLL_SPEED = 12;
17574
- var ExternalDropZone = ({ editor, onDrop, acceptedType = "application/x-artifact", dropIndicator, children }) => {
17429
+ var ExternalDropZone = ({
17430
+ editor,
17431
+ onDrop,
17432
+ acceptedType = "application/x-artifact",
17433
+ dropIndicator,
17434
+ isPlacementMode = false,
17435
+ onPlacementCancel,
17436
+ children
17437
+ }) => {
17575
17438
  const containerRef = useRef13(null);
17576
17439
  const [isValidDrag, setIsValidDrag] = useState63(false);
17440
+ const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState63(false);
17577
17441
  const [indicatorStyle, setIndicatorStyle] = useState63({});
17578
17442
  const dropPositionRef = useRef13(null);
17579
17443
  const scrollAnimationRef = useRef13(null);
@@ -17743,8 +17607,87 @@ var ExternalDropZone = ({ editor, onDrop, acceptedType = "application/x-artifact
17743
17607
  window.addEventListener("dragend", handleGlobalDragEnd);
17744
17608
  return () => window.removeEventListener("dragend", handleGlobalDragEnd);
17745
17609
  }, [stopAutoScroll]);
17610
+ const handleOverlayMouseMove = useCallback42(
17611
+ (e) => {
17612
+ setIsHoveringInPlacementMode(true);
17613
+ checkAutoScroll(e.clientY);
17614
+ const result = findDropPosition(e.clientY);
17615
+ if (result) {
17616
+ dropPositionRef.current = result.position;
17617
+ setIndicatorStyle({
17618
+ position: "absolute",
17619
+ top: result.indicatorTop,
17620
+ left: 0,
17621
+ right: 0,
17622
+ zIndex: 9999,
17623
+ pointerEvents: "none"
17624
+ });
17625
+ }
17626
+ },
17627
+ [findDropPosition, checkAutoScroll]
17628
+ );
17629
+ const handleOverlayMouseLeave = useCallback42(() => {
17630
+ setIsHoveringInPlacementMode(false);
17631
+ dropPositionRef.current = null;
17632
+ stopAutoScroll();
17633
+ }, [stopAutoScroll]);
17634
+ const handleOverlayClick = useCallback42(
17635
+ (e) => {
17636
+ e.preventDefault();
17637
+ e.stopPropagation();
17638
+ const position = dropPositionRef.current;
17639
+ if (position) {
17640
+ onDrop(position);
17641
+ }
17642
+ setIsHoveringInPlacementMode(false);
17643
+ dropPositionRef.current = null;
17644
+ stopAutoScroll();
17645
+ },
17646
+ [onDrop, stopAutoScroll]
17647
+ );
17648
+ const handleOverlayWheel = useCallback42(
17649
+ (e) => {
17650
+ const container = getScrollContainer();
17651
+ if (container === window) {
17652
+ window.scrollBy(0, e.deltaY);
17653
+ } else {
17654
+ container.scrollBy(0, e.deltaY);
17655
+ }
17656
+ },
17657
+ [getScrollContainer]
17658
+ );
17746
17659
  useEffect47(() => {
17747
- if (isValidDrag) {
17660
+ if (!isPlacementMode) return;
17661
+ const handleKeyDown = (e) => {
17662
+ if (e.key === "Escape") {
17663
+ onPlacementCancel?.();
17664
+ }
17665
+ };
17666
+ const handleGlobalClick = (e) => {
17667
+ const target = e.target;
17668
+ if (target.closest("[data-placement-toggle]")) {
17669
+ return;
17670
+ }
17671
+ if (containerRef.current && !containerRef.current.contains(target)) {
17672
+ onPlacementCancel?.();
17673
+ }
17674
+ };
17675
+ document.addEventListener("keydown", handleKeyDown);
17676
+ document.addEventListener("click", handleGlobalClick, true);
17677
+ return () => {
17678
+ document.removeEventListener("keydown", handleKeyDown);
17679
+ document.removeEventListener("click", handleGlobalClick, true);
17680
+ };
17681
+ }, [isPlacementMode, onPlacementCancel]);
17682
+ useEffect47(() => {
17683
+ if (!isPlacementMode) {
17684
+ setIsHoveringInPlacementMode(false);
17685
+ dropPositionRef.current = null;
17686
+ }
17687
+ }, [isPlacementMode]);
17688
+ useEffect47(() => {
17689
+ const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
17690
+ if (isActive) {
17748
17691
  document.body.classList.add("external-artifact-drag-active");
17749
17692
  } else {
17750
17693
  document.body.classList.remove("external-artifact-drag-active");
@@ -17752,7 +17695,7 @@ var ExternalDropZone = ({ editor, onDrop, acceptedType = "application/x-artifact
17752
17695
  return () => {
17753
17696
  document.body.classList.remove("external-artifact-drag-active");
17754
17697
  };
17755
- }, [isValidDrag]);
17698
+ }, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
17756
17699
  useEffect47(() => {
17757
17700
  return () => {
17758
17701
  if (scrollAnimationRef.current) {
@@ -17760,33 +17703,59 @@ var ExternalDropZone = ({ editor, onDrop, acceptedType = "application/x-artifact
17760
17703
  }
17761
17704
  };
17762
17705
  }, []);
17763
- const indicatorWithPosition = dropIndicator && React167.isValidElement(dropIndicator) ? React167.cloneElement(dropIndicator, {
17706
+ const indicatorWithPosition = dropIndicator && React168.isValidElement(dropIndicator) ? React168.cloneElement(dropIndicator, {
17764
17707
  indicatorTop: typeof indicatorStyle.top === "number" ? indicatorStyle.top : void 0
17765
17708
  }) : dropIndicator;
17766
- return /* @__PURE__ */ React167.createElement(
17709
+ const shouldShowIndicator = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
17710
+ return /* @__PURE__ */ React168.createElement(
17767
17711
  Box30,
17768
17712
  {
17769
17713
  ref: containerRef,
17770
- style: { position: "relative", width: "100%", height: "100%" },
17714
+ style: {
17715
+ position: "relative",
17716
+ width: "100%",
17717
+ height: "100%"
17718
+ },
17771
17719
  onDragOver: handleDragOver,
17772
17720
  onDragLeave: handleDragLeave,
17773
17721
  onDrop: handleDrop,
17774
- "data-external-drag": isValidDrag ? "true" : void 0
17722
+ "data-external-drag": isValidDrag ? "true" : void 0,
17723
+ "data-placement-mode": isPlacementMode ? "true" : void 0
17775
17724
  },
17776
17725
  children,
17777
- isValidDrag && indicatorWithPosition && /* @__PURE__ */ React167.createElement(Box30, { style: { ...indicatorStyle, background: "none", border: "none", boxShadow: "none" } }, indicatorWithPosition)
17726
+ isPlacementMode && /* @__PURE__ */ React168.createElement(
17727
+ Box30,
17728
+ {
17729
+ style: {
17730
+ position: "absolute",
17731
+ top: 0,
17732
+ left: 0,
17733
+ right: 0,
17734
+ bottom: 0,
17735
+ cursor: "crosshair",
17736
+ zIndex: 9998,
17737
+ // Below the indicator (9999) but above content
17738
+ background: "transparent"
17739
+ },
17740
+ onMouseMove: handleOverlayMouseMove,
17741
+ onMouseLeave: handleOverlayMouseLeave,
17742
+ onClick: handleOverlayClick,
17743
+ onWheel: handleOverlayWheel
17744
+ }
17745
+ ),
17746
+ shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */ React168.createElement(Box30, { style: { ...indicatorStyle, background: "none", border: "none", boxShadow: "none" } }, indicatorWithPosition)
17778
17747
  );
17779
17748
  };
17780
17749
 
17781
17750
  // src/mantine/IxoEditor.tsx
17782
- import React169 from "react";
17751
+ import React170 from "react";
17783
17752
  import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
17784
17753
  import { BlockNoteView } from "@blocknote/mantine";
17785
17754
  import { filterSuggestionItems } from "@blocknote/core";
17786
17755
  import { MantineProvider } from "@mantine/core";
17787
17756
 
17788
17757
  // src/mantine/components/PanelContent.tsx
17789
- import React168 from "react";
17758
+ import React169 from "react";
17790
17759
  import { Box as Box31 } from "@mantine/core";
17791
17760
  var panelStyles = {
17792
17761
  light: {
@@ -17816,7 +17785,7 @@ function PanelContent({ theme }) {
17816
17785
  const { activePanel, registeredPanels } = usePanelStore();
17817
17786
  const isOpen = activePanel !== null;
17818
17787
  const content = activePanel ? registeredPanels.get(activePanel) : null;
17819
- return /* @__PURE__ */ React168.createElement(
17788
+ return /* @__PURE__ */ React169.createElement(
17820
17789
  Box31,
17821
17790
  {
17822
17791
  pos: "sticky",
@@ -17851,11 +17820,13 @@ function IxoEditorContent({
17851
17820
  pageHeaderProps,
17852
17821
  onExternalDrop,
17853
17822
  externalDropType,
17854
- dropIndicator
17823
+ dropIndicator,
17824
+ isPlacementMode,
17825
+ onPlacementCancel
17855
17826
  }) {
17856
17827
  const { activePanel } = usePanelStore();
17857
17828
  const isPanelOpen = activePanel !== null;
17858
- const editorContent = /* @__PURE__ */ React169.createElement(
17829
+ const editorContent = /* @__PURE__ */ React170.createElement(
17859
17830
  BlockNoteView,
17860
17831
  {
17861
17832
  editor,
@@ -17870,7 +17841,7 @@ function IxoEditorContent({
17870
17841
  onChange,
17871
17842
  onSelectionChange
17872
17843
  },
17873
- config.slashMenu && /* @__PURE__ */ React169.createElement(
17844
+ config.slashMenu && /* @__PURE__ */ React170.createElement(
17874
17845
  SuggestionMenuController,
17875
17846
  {
17876
17847
  triggerCharacter: "/",
@@ -17883,7 +17854,7 @@ function IxoEditorContent({
17883
17854
  ),
17884
17855
  children
17885
17856
  );
17886
- return /* @__PURE__ */ React169.createElement("div", { style: { display: "flex", height: "100%", width: "100%", gap: 0 } }, /* @__PURE__ */ React169.createElement(
17857
+ return /* @__PURE__ */ React170.createElement("div", { style: { display: "flex", height: "100%", width: "100%", gap: 0 } }, /* @__PURE__ */ React170.createElement(
17887
17858
  "div",
17888
17859
  {
17889
17860
  className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`,
@@ -17892,10 +17863,22 @@ function IxoEditorContent({
17892
17863
  transition: "width 0.2s ease"
17893
17864
  }
17894
17865
  },
17895
- selfNav && /* @__PURE__ */ React169.createElement(PageHeader, { ...pageHeaderProps }),
17896
- /* @__PURE__ */ React169.createElement(CoverImage, { coverImageUrl, logoUrl }),
17897
- onExternalDrop ? /* @__PURE__ */ React169.createElement(ExternalDropZone, { editor, onDrop: onExternalDrop, acceptedType: externalDropType, dropIndicator }, editorContent) : editorContent
17898
- ), isPanelVisible && /* @__PURE__ */ React169.createElement(PanelContent, { theme: config.theme }));
17866
+ selfNav && /* @__PURE__ */ React170.createElement(PageHeader, { ...pageHeaderProps }),
17867
+ /* @__PURE__ */ React170.createElement(CoverImage, { coverImageUrl, logoUrl }),
17868
+ (onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */ React170.createElement(
17869
+ ExternalDropZone,
17870
+ {
17871
+ editor,
17872
+ onDrop: onExternalDrop || (() => {
17873
+ }),
17874
+ acceptedType: externalDropType,
17875
+ dropIndicator,
17876
+ isPlacementMode,
17877
+ onPlacementCancel
17878
+ },
17879
+ editorContent
17880
+ ) : editorContent
17881
+ ), isPanelVisible && /* @__PURE__ */ React170.createElement(PanelContent, { theme: config.theme }));
17899
17882
  }
17900
17883
  function IxoEditor({
17901
17884
  editor,
@@ -17917,7 +17900,9 @@ function IxoEditor({
17917
17900
  dynamicListPanelRenderer,
17918
17901
  onExternalDrop,
17919
17902
  externalDropType,
17920
- dropIndicator
17903
+ dropIndicator,
17904
+ isPlacementMode,
17905
+ onPlacementCancel
17921
17906
  }) {
17922
17907
  if (!editor) {
17923
17908
  return null;
@@ -17932,7 +17917,7 @@ function IxoEditor({
17932
17917
  tableHandles: true
17933
17918
  };
17934
17919
  const isEditable = editable;
17935
- const editorContent = /* @__PURE__ */ React169.createElement(
17920
+ const editorContent = /* @__PURE__ */ React170.createElement(
17936
17921
  BlocknoteProvider,
17937
17922
  {
17938
17923
  editor,
@@ -17943,7 +17928,7 @@ function IxoEditor({
17943
17928
  getDynamicListData,
17944
17929
  dynamicListPanelRenderer
17945
17930
  },
17946
- /* @__PURE__ */ React169.createElement(
17931
+ /* @__PURE__ */ React170.createElement(
17947
17932
  IxoEditorContent,
17948
17933
  {
17949
17934
  isPanelVisible,
@@ -17959,19 +17944,21 @@ function IxoEditor({
17959
17944
  pageHeaderProps,
17960
17945
  onExternalDrop,
17961
17946
  externalDropType,
17962
- dropIndicator
17947
+ dropIndicator,
17948
+ isPlacementMode,
17949
+ onPlacementCancel
17963
17950
  },
17964
17951
  children
17965
17952
  )
17966
17953
  );
17967
17954
  if (mantineTheme) {
17968
- return /* @__PURE__ */ React169.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
17955
+ return /* @__PURE__ */ React170.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
17969
17956
  }
17970
17957
  return editorContent;
17971
17958
  }
17972
17959
 
17973
17960
  // src/mantine/components/EntitySigningSetup.tsx
17974
- import React170, { useState as useState64 } from "react";
17961
+ import React171, { useState as useState64 } from "react";
17975
17962
  import { Modal as Modal3, Stack as Stack112, Text as Text85, TextInput as TextInput6, Button as Button33, Alert as Alert23, Group as Group52 } from "@mantine/core";
17976
17963
  import { IconAlertCircle as IconAlertCircle10, IconCheck as IconCheck5, IconKey as IconKey2 } from "@tabler/icons-react";
17977
17964
  var EntitySigningSetup = ({
@@ -18025,15 +18012,15 @@ var EntitySigningSetup = ({
18025
18012
  setSuccess(false);
18026
18013
  }
18027
18014
  };
18028
- return /* @__PURE__ */ React170.createElement(
18015
+ return /* @__PURE__ */ React171.createElement(
18029
18016
  Modal3,
18030
18017
  {
18031
18018
  opened,
18032
18019
  onClose: handleClose,
18033
- title: /* @__PURE__ */ React170.createElement(Group52, { gap: "xs" }, /* @__PURE__ */ React170.createElement(IconKey2, { size: 20 }), /* @__PURE__ */ React170.createElement(Text85, { fw: 600 }, "Entity Signing Setup")),
18020
+ title: /* @__PURE__ */ React171.createElement(Group52, { gap: "xs" }, /* @__PURE__ */ React171.createElement(IconKey2, { size: 20 }), /* @__PURE__ */ React171.createElement(Text85, { fw: 600 }, "Entity Signing Setup")),
18034
18021
  size: "md"
18035
18022
  },
18036
- /* @__PURE__ */ React170.createElement(Stack112, { gap: "md" }, success ? /* @__PURE__ */ React170.createElement(Alert23, { color: "green", icon: /* @__PURE__ */ React170.createElement(IconCheck5, { size: 16 }) }, "Entity signing key set up successfully!") : /* @__PURE__ */ React170.createElement(React170.Fragment, null, /* @__PURE__ */ React170.createElement(Text85, { size: "sm", c: "dimmed" }, "Flow authorization requires a signing key for", " ", /* @__PURE__ */ React170.createElement(Text85, { span: true, fw: 500 }, entityName || entityDid), "."), /* @__PURE__ */ React170.createElement(Alert23, { color: "blue", variant: "light" }, /* @__PURE__ */ React170.createElement(Text85, { size: "sm" }, "This is a ", /* @__PURE__ */ React170.createElement("strong", null, "one-time setup"), " that allows flows to grant permissions without requiring wallet signatures for each delegation.")), /* @__PURE__ */ React170.createElement(Stack112, { gap: "xs" }, /* @__PURE__ */ React170.createElement(Text85, { size: "sm", fw: 500 }, "What happens:"), /* @__PURE__ */ React170.createElement(Text85, { size: "sm", c: "dimmed" }, "1. A new signing key is generated"), /* @__PURE__ */ React170.createElement(Text85, { size: "sm", c: "dimmed" }, "2. Key is registered on the entity's DID document (requires wallet)"), /* @__PURE__ */ React170.createElement(Text85, { size: "sm", c: "dimmed" }, "3. Key is stored encrypted in the entity's Matrix room")), /* @__PURE__ */ React170.createElement(
18023
+ /* @__PURE__ */ React171.createElement(Stack112, { gap: "md" }, success ? /* @__PURE__ */ React171.createElement(Alert23, { color: "green", icon: /* @__PURE__ */ React171.createElement(IconCheck5, { size: 16 }) }, "Entity signing key set up successfully!") : /* @__PURE__ */ React171.createElement(React171.Fragment, null, /* @__PURE__ */ React171.createElement(Text85, { size: "sm", c: "dimmed" }, "Flow authorization requires a signing key for", " ", /* @__PURE__ */ React171.createElement(Text85, { span: true, fw: 500 }, entityName || entityDid), "."), /* @__PURE__ */ React171.createElement(Alert23, { color: "blue", variant: "light" }, /* @__PURE__ */ React171.createElement(Text85, { size: "sm" }, "This is a ", /* @__PURE__ */ React171.createElement("strong", null, "one-time setup"), " that allows flows to grant permissions without requiring wallet signatures for each delegation.")), /* @__PURE__ */ React171.createElement(Stack112, { gap: "xs" }, /* @__PURE__ */ React171.createElement(Text85, { size: "sm", fw: 500 }, "What happens:"), /* @__PURE__ */ React171.createElement(Text85, { size: "sm", c: "dimmed" }, "1. A new signing key is generated"), /* @__PURE__ */ React171.createElement(Text85, { size: "sm", c: "dimmed" }, "2. Key is registered on the entity's DID document (requires wallet)"), /* @__PURE__ */ React171.createElement(Text85, { size: "sm", c: "dimmed" }, "3. Key is stored encrypted in the entity's Matrix room")), /* @__PURE__ */ React171.createElement(
18037
18024
  TextInput6,
18038
18025
  {
18039
18026
  label: "Enter PIN to encrypt signing key",
@@ -18044,7 +18031,7 @@ var EntitySigningSetup = ({
18044
18031
  onChange: (e) => setPin(e.currentTarget.value),
18045
18032
  disabled: loading
18046
18033
  }
18047
- ), /* @__PURE__ */ React170.createElement(
18034
+ ), /* @__PURE__ */ React171.createElement(
18048
18035
  TextInput6,
18049
18036
  {
18050
18037
  label: "Confirm PIN",
@@ -18054,12 +18041,12 @@ var EntitySigningSetup = ({
18054
18041
  onChange: (e) => setConfirmPin(e.currentTarget.value),
18055
18042
  disabled: loading
18056
18043
  }
18057
- ), error && /* @__PURE__ */ React170.createElement(Alert23, { color: "red", icon: /* @__PURE__ */ React170.createElement(IconAlertCircle10, { size: 16 }) }, error), /* @__PURE__ */ React170.createElement(Group52, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React170.createElement(Button33, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React170.createElement(
18044
+ ), error && /* @__PURE__ */ React171.createElement(Alert23, { color: "red", icon: /* @__PURE__ */ React171.createElement(IconAlertCircle10, { size: 16 }) }, error), /* @__PURE__ */ React171.createElement(Group52, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React171.createElement(Button33, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React171.createElement(
18058
18045
  Button33,
18059
18046
  {
18060
18047
  onClick: handleSetup,
18061
18048
  loading,
18062
- leftSection: /* @__PURE__ */ React170.createElement(IconKey2, { size: 16 })
18049
+ leftSection: /* @__PURE__ */ React171.createElement(IconKey2, { size: 16 })
18063
18050
  },
18064
18051
  "Setup Entity Signing"
18065
18052
  ))))
@@ -18067,7 +18054,7 @@ var EntitySigningSetup = ({
18067
18054
  };
18068
18055
 
18069
18056
  // src/mantine/components/FlowPermissionsPanel.tsx
18070
- import React171, { useState as useState65, useEffect as useEffect48, useMemo as useMemo53 } from "react";
18057
+ import React172, { useState as useState65, useEffect as useEffect48, useMemo as useMemo53 } from "react";
18071
18058
  import { Stack as Stack113, Text as Text86, Paper as Paper16, Group as Group53, Badge as Badge23, Button as Button34, ActionIcon as ActionIcon26, Loader as Loader23, Alert as Alert24, Divider as Divider11 } from "@mantine/core";
18072
18059
  import { IconPlus as IconPlus5, IconTrash as IconTrash5, IconShieldCheck as IconShieldCheck2, IconUser as IconUser4, IconRobot as IconRobot3, IconBuilding } from "@tabler/icons-react";
18073
18060
  var FlowPermissionsPanel = ({
@@ -18121,11 +18108,11 @@ var FlowPermissionsPanel = ({
18121
18108
  const getIcon2 = (type) => {
18122
18109
  switch (type) {
18123
18110
  case "oracle":
18124
- return /* @__PURE__ */ React171.createElement(IconRobot3, { size: 16 });
18111
+ return /* @__PURE__ */ React172.createElement(IconRobot3, { size: 16 });
18125
18112
  case "entity":
18126
- return /* @__PURE__ */ React171.createElement(IconBuilding, { size: 16 });
18113
+ return /* @__PURE__ */ React172.createElement(IconBuilding, { size: 16 });
18127
18114
  default:
18128
- return /* @__PURE__ */ React171.createElement(IconUser4, { size: 16 });
18115
+ return /* @__PURE__ */ React172.createElement(IconUser4, { size: 16 });
18129
18116
  }
18130
18117
  };
18131
18118
  const formatCapabilities = (caps) => {
@@ -18144,7 +18131,7 @@ var FlowPermissionsPanel = ({
18144
18131
  if (date < /* @__PURE__ */ new Date()) return "Expired";
18145
18132
  return date.toLocaleDateString();
18146
18133
  };
18147
- return /* @__PURE__ */ React171.createElement(Stack113, { gap: "md" }, /* @__PURE__ */ React171.createElement(Stack113, { gap: "xs" }, /* @__PURE__ */ React171.createElement(Text86, { fw: 600, size: "sm" }, "Root Authority"), /* @__PURE__ */ React171.createElement(Paper16, { p: "sm", withBorder: true }, /* @__PURE__ */ React171.createElement(Group53, { gap: "xs" }, /* @__PURE__ */ React171.createElement(IconShieldCheck2, { size: 20, color: "var(--mantine-color-green-6)" }), /* @__PURE__ */ React171.createElement(Stack113, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React171.createElement(Text86, { size: "sm", fw: 500 }, entityName || entityDid), /* @__PURE__ */ React171.createElement(Text86, { size: "xs", c: "dimmed" }, rootCapability ? `Granted: ${new Date(rootCapability.issuedAt).toLocaleDateString()}` : "Root capability not set up")), /* @__PURE__ */ React171.createElement(Badge23, { color: "green", variant: "light" }, "Entity")))), /* @__PURE__ */ React171.createElement(Divider11, { label: "Delegated Permissions", labelPosition: "center" }), loading ? /* @__PURE__ */ React171.createElement(Group53, { justify: "center", py: "xl" }, /* @__PURE__ */ React171.createElement(Loader23, { size: "sm" })) : delegations.length === 0 ? /* @__PURE__ */ React171.createElement(Alert24, { color: "gray", variant: "light" }, /* @__PURE__ */ React171.createElement(Text86, { size: "sm" }, "No permissions have been granted yet.")) : /* @__PURE__ */ React171.createElement(Stack113, { gap: "xs" }, delegations.map(({ capability, displayName, type }) => /* @__PURE__ */ React171.createElement(Paper16, { key: capability.id, p: "sm", withBorder: true }, /* @__PURE__ */ React171.createElement(Group53, { justify: "space-between" }, /* @__PURE__ */ React171.createElement(Group53, { gap: "xs" }, getIcon2(type), /* @__PURE__ */ React171.createElement(Stack113, { gap: 2 }, /* @__PURE__ */ React171.createElement(Text86, { size: "sm", fw: 500 }, displayName), /* @__PURE__ */ React171.createElement(Text86, { size: "xs", c: "dimmed" }, formatCapabilities(capability.capabilities)), /* @__PURE__ */ React171.createElement(Group53, { gap: "xs" }, /* @__PURE__ */ React171.createElement(Text86, { size: "xs", c: "dimmed" }, "Expires: ", formatExpiration(capability.expiration)), /* @__PURE__ */ React171.createElement(Text86, { size: "xs", c: "dimmed" }, "\u2022"), /* @__PURE__ */ React171.createElement(Text86, { size: "xs", c: "dimmed" }, "Granted by: ", capability.issuer === entityDid ? "Entity" : capability.issuer.slice(-8))))), /* @__PURE__ */ React171.createElement(
18134
+ return /* @__PURE__ */ React172.createElement(Stack113, { gap: "md" }, /* @__PURE__ */ React172.createElement(Stack113, { gap: "xs" }, /* @__PURE__ */ React172.createElement(Text86, { fw: 600, size: "sm" }, "Root Authority"), /* @__PURE__ */ React172.createElement(Paper16, { p: "sm", withBorder: true }, /* @__PURE__ */ React172.createElement(Group53, { gap: "xs" }, /* @__PURE__ */ React172.createElement(IconShieldCheck2, { size: 20, color: "var(--mantine-color-green-6)" }), /* @__PURE__ */ React172.createElement(Stack113, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React172.createElement(Text86, { size: "sm", fw: 500 }, entityName || entityDid), /* @__PURE__ */ React172.createElement(Text86, { size: "xs", c: "dimmed" }, rootCapability ? `Granted: ${new Date(rootCapability.issuedAt).toLocaleDateString()}` : "Root capability not set up")), /* @__PURE__ */ React172.createElement(Badge23, { color: "green", variant: "light" }, "Entity")))), /* @__PURE__ */ React172.createElement(Divider11, { label: "Delegated Permissions", labelPosition: "center" }), loading ? /* @__PURE__ */ React172.createElement(Group53, { justify: "center", py: "xl" }, /* @__PURE__ */ React172.createElement(Loader23, { size: "sm" })) : delegations.length === 0 ? /* @__PURE__ */ React172.createElement(Alert24, { color: "gray", variant: "light" }, /* @__PURE__ */ React172.createElement(Text86, { size: "sm" }, "No permissions have been granted yet.")) : /* @__PURE__ */ React172.createElement(Stack113, { gap: "xs" }, delegations.map(({ capability, displayName, type }) => /* @__PURE__ */ React172.createElement(Paper16, { key: capability.id, p: "sm", withBorder: true }, /* @__PURE__ */ React172.createElement(Group53, { justify: "space-between" }, /* @__PURE__ */ React172.createElement(Group53, { gap: "xs" }, getIcon2(type), /* @__PURE__ */ React172.createElement(Stack113, { gap: 2 }, /* @__PURE__ */ React172.createElement(Text86, { size: "sm", fw: 500 }, displayName), /* @__PURE__ */ React172.createElement(Text86, { size: "xs", c: "dimmed" }, formatCapabilities(capability.capabilities)), /* @__PURE__ */ React172.createElement(Group53, { gap: "xs" }, /* @__PURE__ */ React172.createElement(Text86, { size: "xs", c: "dimmed" }, "Expires: ", formatExpiration(capability.expiration)), /* @__PURE__ */ React172.createElement(Text86, { size: "xs", c: "dimmed" }, "\u2022"), /* @__PURE__ */ React172.createElement(Text86, { size: "xs", c: "dimmed" }, "Granted by: ", capability.issuer === entityDid ? "Entity" : capability.issuer.slice(-8))))), /* @__PURE__ */ React172.createElement(
18148
18135
  ActionIcon26,
18149
18136
  {
18150
18137
  color: "red",
@@ -18153,11 +18140,11 @@ var FlowPermissionsPanel = ({
18153
18140
  loading: revoking === capability.id,
18154
18141
  disabled: !!revoking
18155
18142
  },
18156
- /* @__PURE__ */ React171.createElement(IconTrash5, { size: 16 })
18157
- ))))), /* @__PURE__ */ React171.createElement(
18143
+ /* @__PURE__ */ React172.createElement(IconTrash5, { size: 16 })
18144
+ ))))), /* @__PURE__ */ React172.createElement(
18158
18145
  Button34,
18159
18146
  {
18160
- leftSection: /* @__PURE__ */ React171.createElement(IconPlus5, { size: 16 }),
18147
+ leftSection: /* @__PURE__ */ React172.createElement(IconPlus5, { size: 16 }),
18161
18148
  variant: "light",
18162
18149
  onClick: onGrantPermission
18163
18150
  },
@@ -18166,7 +18153,7 @@ var FlowPermissionsPanel = ({
18166
18153
  };
18167
18154
 
18168
18155
  // src/mantine/components/GrantPermissionModal.tsx
18169
- import React172, { useState as useState66, useCallback as useCallback43 } from "react";
18156
+ import React173, { useState as useState66, useCallback as useCallback43 } from "react";
18170
18157
  import {
18171
18158
  Modal as Modal4,
18172
18159
  Stack as Stack114,
@@ -18299,29 +18286,29 @@ var GrantPermissionModal = ({
18299
18286
  resetForm();
18300
18287
  }
18301
18288
  };
18302
- return /* @__PURE__ */ React172.createElement(
18289
+ return /* @__PURE__ */ React173.createElement(
18303
18290
  Modal4,
18304
18291
  {
18305
18292
  opened,
18306
18293
  onClose: handleClose,
18307
- title: /* @__PURE__ */ React172.createElement(Group54, { gap: "xs" }, /* @__PURE__ */ React172.createElement(IconShieldPlus3, { size: 20 }), /* @__PURE__ */ React172.createElement(Text87, { fw: 600 }, "Grant Permission")),
18294
+ title: /* @__PURE__ */ React173.createElement(Group54, { gap: "xs" }, /* @__PURE__ */ React173.createElement(IconShieldPlus3, { size: 20 }), /* @__PURE__ */ React173.createElement(Text87, { fw: 600 }, "Grant Permission")),
18308
18295
  size: "lg"
18309
18296
  },
18310
- /* @__PURE__ */ React172.createElement(Stack114, { gap: "md" }, /* @__PURE__ */ React172.createElement(Stack114, { gap: "xs" }, /* @__PURE__ */ React172.createElement(Text87, { size: "sm", fw: 500 }, "Recipient Type"), /* @__PURE__ */ React172.createElement(Radio6.Group, { value: recipientType, onChange: (v) => {
18297
+ /* @__PURE__ */ React173.createElement(Stack114, { gap: "md" }, /* @__PURE__ */ React173.createElement(Stack114, { gap: "xs" }, /* @__PURE__ */ React173.createElement(Text87, { size: "sm", fw: 500 }, "Recipient Type"), /* @__PURE__ */ React173.createElement(Radio6.Group, { value: recipientType, onChange: (v) => {
18311
18298
  setRecipientType(v);
18312
18299
  setSelectedRecipient(null);
18313
18300
  setSearchResults([]);
18314
- } }, /* @__PURE__ */ React172.createElement(Group54, null, /* @__PURE__ */ React172.createElement(Radio6, { value: "user", label: "User" }), /* @__PURE__ */ React172.createElement(Radio6, { value: "oracle", label: "Oracle" }), /* @__PURE__ */ React172.createElement(Radio6, { value: "manual", label: "Enter DID" })))), recipientType !== "manual" ? /* @__PURE__ */ React172.createElement(Stack114, { gap: "xs" }, /* @__PURE__ */ React172.createElement(
18301
+ } }, /* @__PURE__ */ React173.createElement(Group54, null, /* @__PURE__ */ React173.createElement(Radio6, { value: "user", label: "User" }), /* @__PURE__ */ React173.createElement(Radio6, { value: "oracle", label: "Oracle" }), /* @__PURE__ */ React173.createElement(Radio6, { value: "manual", label: "Enter DID" })))), recipientType !== "manual" ? /* @__PURE__ */ React173.createElement(Stack114, { gap: "xs" }, /* @__PURE__ */ React173.createElement(
18315
18302
  TextInput7,
18316
18303
  {
18317
18304
  placeholder: recipientType === "oracle" ? "Search oracles..." : "Search users...",
18318
- leftSection: /* @__PURE__ */ React172.createElement(IconSearch5, { size: 16 }),
18319
- rightSection: searching ? /* @__PURE__ */ React172.createElement(Loader24, { size: 14 }) : null,
18305
+ leftSection: /* @__PURE__ */ React173.createElement(IconSearch5, { size: 16 }),
18306
+ rightSection: searching ? /* @__PURE__ */ React173.createElement(Loader24, { size: 14 }) : null,
18320
18307
  value: searchQuery,
18321
18308
  onChange: (e) => setSearchQuery(e.currentTarget.value),
18322
18309
  onKeyDown: (e) => e.key === "Enter" && handleSearch()
18323
18310
  }
18324
- ), selectedRecipient ? /* @__PURE__ */ React172.createElement(Paper17, { p: "sm", withBorder: true }, /* @__PURE__ */ React172.createElement(Group54, { justify: "space-between" }, /* @__PURE__ */ React172.createElement(Group54, { gap: "xs" }, recipientType === "oracle" ? /* @__PURE__ */ React172.createElement(IconRobot4, { size: 16 }) : /* @__PURE__ */ React172.createElement(IconUser5, { size: 16 }), /* @__PURE__ */ React172.createElement(Text87, { size: "sm" }, selectedRecipient.displayName), /* @__PURE__ */ React172.createElement(Badge24, { size: "xs", variant: "light" }, selectedRecipient.did.slice(-12))), /* @__PURE__ */ React172.createElement(ActionIcon27, { size: "sm", variant: "subtle", onClick: () => setSelectedRecipient(null) }, /* @__PURE__ */ React172.createElement(IconX8, { size: 14 })))) : searchResults.length > 0 ? /* @__PURE__ */ React172.createElement(Paper17, { p: "xs", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React172.createElement(Stack114, { gap: 4 }, searchResults.map((result) => /* @__PURE__ */ React172.createElement(
18311
+ ), selectedRecipient ? /* @__PURE__ */ React173.createElement(Paper17, { p: "sm", withBorder: true }, /* @__PURE__ */ React173.createElement(Group54, { justify: "space-between" }, /* @__PURE__ */ React173.createElement(Group54, { gap: "xs" }, recipientType === "oracle" ? /* @__PURE__ */ React173.createElement(IconRobot4, { size: 16 }) : /* @__PURE__ */ React173.createElement(IconUser5, { size: 16 }), /* @__PURE__ */ React173.createElement(Text87, { size: "sm" }, selectedRecipient.displayName), /* @__PURE__ */ React173.createElement(Badge24, { size: "xs", variant: "light" }, selectedRecipient.did.slice(-12))), /* @__PURE__ */ React173.createElement(ActionIcon27, { size: "sm", variant: "subtle", onClick: () => setSelectedRecipient(null) }, /* @__PURE__ */ React173.createElement(IconX8, { size: 14 })))) : searchResults.length > 0 ? /* @__PURE__ */ React173.createElement(Paper17, { p: "xs", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React173.createElement(Stack114, { gap: 4 }, searchResults.map((result) => /* @__PURE__ */ React173.createElement(
18325
18312
  Button35,
18326
18313
  {
18327
18314
  key: result.did,
@@ -18331,7 +18318,7 @@ var GrantPermissionModal = ({
18331
18318
  onClick: () => setSelectedRecipient(result)
18332
18319
  },
18333
18320
  result.displayName
18334
- )))) : null) : /* @__PURE__ */ React172.createElement(
18321
+ )))) : null) : /* @__PURE__ */ React173.createElement(
18335
18322
  TextInput7,
18336
18323
  {
18337
18324
  label: "Recipient DID",
@@ -18339,12 +18326,12 @@ var GrantPermissionModal = ({
18339
18326
  value: manualDid,
18340
18327
  onChange: (e) => setManualDid(e.currentTarget.value)
18341
18328
  }
18342
- ), /* @__PURE__ */ React172.createElement(Divider12, null), /* @__PURE__ */ React172.createElement(Stack114, { gap: "xs" }, /* @__PURE__ */ React172.createElement(Text87, { size: "sm", fw: 500 }, "Permission Scope"), singleBlockMode && fixedBlock ? (
18329
+ ), /* @__PURE__ */ React173.createElement(Divider12, null), /* @__PURE__ */ React173.createElement(Stack114, { gap: "xs" }, /* @__PURE__ */ React173.createElement(Text87, { size: "sm", fw: 500 }, "Permission Scope"), singleBlockMode && fixedBlock ? (
18343
18330
  // Single block mode: show fixed block info
18344
- /* @__PURE__ */ React172.createElement(Paper17, { p: "sm", withBorder: true }, /* @__PURE__ */ React172.createElement(Group54, { gap: "xs" }, /* @__PURE__ */ React172.createElement(Badge24, { variant: "light", color: "blue" }, fixedBlock.type), /* @__PURE__ */ React172.createElement(Text87, { size: "sm" }, fixedBlock.name || `Block ${fixedBlock.id.slice(-8)}`)), /* @__PURE__ */ React172.createElement(Text87, { size: "xs", c: "dimmed", mt: "xs" }, "Permission will be granted to execute this specific block."))
18331
+ /* @__PURE__ */ React173.createElement(Paper17, { p: "sm", withBorder: true }, /* @__PURE__ */ React173.createElement(Group54, { gap: "xs" }, /* @__PURE__ */ React173.createElement(Badge24, { variant: "light", color: "blue" }, fixedBlock.type), /* @__PURE__ */ React173.createElement(Text87, { size: "sm" }, fixedBlock.name || `Block ${fixedBlock.id.slice(-8)}`)), /* @__PURE__ */ React173.createElement(Text87, { size: "xs", c: "dimmed", mt: "xs" }, "Permission will be granted to execute this specific block."))
18345
18332
  ) : (
18346
18333
  // Multi-block mode: show scope selection
18347
- /* @__PURE__ */ React172.createElement(React172.Fragment, null, /* @__PURE__ */ React172.createElement(Radio6.Group, { value: scopeType, onChange: (v) => setScopeType(v) }, /* @__PURE__ */ React172.createElement(Stack114, { gap: "xs" }, /* @__PURE__ */ React172.createElement(Radio6, { value: "full", label: "Full flow access (can execute any block)" }), /* @__PURE__ */ React172.createElement(Radio6, { value: "blocks", label: "Specific blocks only" }))), scopeType === "blocks" && /* @__PURE__ */ React172.createElement(Paper17, { p: "sm", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React172.createElement(Stack114, { gap: "xs" }, blocks.map((block) => /* @__PURE__ */ React172.createElement(
18334
+ /* @__PURE__ */ React173.createElement(React173.Fragment, null, /* @__PURE__ */ React173.createElement(Radio6.Group, { value: scopeType, onChange: (v) => setScopeType(v) }, /* @__PURE__ */ React173.createElement(Stack114, { gap: "xs" }, /* @__PURE__ */ React173.createElement(Radio6, { value: "full", label: "Full flow access (can execute any block)" }), /* @__PURE__ */ React173.createElement(Radio6, { value: "blocks", label: "Specific blocks only" }))), scopeType === "blocks" && /* @__PURE__ */ React173.createElement(Paper17, { p: "sm", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React173.createElement(Stack114, { gap: "xs" }, blocks.map((block) => /* @__PURE__ */ React173.createElement(
18348
18335
  Checkbox12,
18349
18336
  {
18350
18337
  key: block.id,
@@ -18359,14 +18346,14 @@ var GrantPermissionModal = ({
18359
18346
  }
18360
18347
  }
18361
18348
  )))))
18362
- )), /* @__PURE__ */ React172.createElement(Divider12, null), /* @__PURE__ */ React172.createElement(Stack114, { gap: "xs" }, /* @__PURE__ */ React172.createElement(
18349
+ )), /* @__PURE__ */ React173.createElement(Divider12, null), /* @__PURE__ */ React173.createElement(Stack114, { gap: "xs" }, /* @__PURE__ */ React173.createElement(
18363
18350
  Checkbox12,
18364
18351
  {
18365
18352
  label: "Set expiration",
18366
18353
  checked: expirationEnabled,
18367
18354
  onChange: (e) => setExpirationEnabled(e.currentTarget.checked)
18368
18355
  }
18369
- ), expirationEnabled && /* @__PURE__ */ React172.createElement(
18356
+ ), expirationEnabled && /* @__PURE__ */ React173.createElement(
18370
18357
  NumberInput3,
18371
18358
  {
18372
18359
  label: "Expires in (days)",
@@ -18376,7 +18363,7 @@ var GrantPermissionModal = ({
18376
18363
  min: 1,
18377
18364
  max: 365
18378
18365
  }
18379
- )), /* @__PURE__ */ React172.createElement(
18366
+ )), /* @__PURE__ */ React173.createElement(
18380
18367
  Checkbox12,
18381
18368
  {
18382
18369
  label: "Recipient can grant permissions to others",
@@ -18384,7 +18371,7 @@ var GrantPermissionModal = ({
18384
18371
  checked: canDelegate,
18385
18372
  onChange: (e) => setCanDelegate(e.currentTarget.checked)
18386
18373
  }
18387
- ), /* @__PURE__ */ React172.createElement(Divider12, null), /* @__PURE__ */ React172.createElement(
18374
+ ), /* @__PURE__ */ React173.createElement(Divider12, null), /* @__PURE__ */ React173.createElement(
18388
18375
  TextInput7,
18389
18376
  {
18390
18377
  label: "Enter your PIN to sign this delegation",
@@ -18393,7 +18380,7 @@ var GrantPermissionModal = ({
18393
18380
  value: pin,
18394
18381
  onChange: (e) => setPin(e.currentTarget.value)
18395
18382
  }
18396
- ), error && /* @__PURE__ */ React172.createElement(Alert25, { color: "red" }, error), /* @__PURE__ */ React172.createElement(Group54, { justify: "flex-end" }, /* @__PURE__ */ React172.createElement(Button35, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React172.createElement(Button35, { onClick: handleGrant, loading }, "Grant Permission")))
18383
+ ), error && /* @__PURE__ */ React173.createElement(Alert25, { color: "red" }, error), /* @__PURE__ */ React173.createElement(Group54, { justify: "flex-end" }, /* @__PURE__ */ React173.createElement(Button35, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React173.createElement(Button35, { onClick: handleGrant, loading }, "Grant Permission")))
18397
18384
  );
18398
18385
  };
18399
18386
 
@@ -18499,4 +18486,4 @@ export {
18499
18486
  ixoGraphQLClient,
18500
18487
  getEntity
18501
18488
  };
18502
- //# sourceMappingURL=chunk-SYSJYAKU.mjs.map
18489
+ //# sourceMappingURL=chunk-JRIF7FLP.mjs.map