@ixo/editor 1.1.2 → 1.1.3

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.
@@ -1,6 +1,7 @@
1
1
  import {
2
+ getEntity,
2
3
  useMatrixProvider
3
- } from "./chunk-MXVDN3FO.mjs";
4
+ } from "./chunk-2UJGZZWQ.mjs";
4
5
 
5
6
  // src/shadcn/blocks/list/ListBlock.tsx
6
7
  import React30 from "react";
@@ -75,19 +76,13 @@ function Button({
75
76
  import * as React2 from "react";
76
77
  import * as DialogPrimitive from "@radix-ui/react-dialog";
77
78
  import { XIcon } from "lucide-react";
78
- function Dialog({
79
- ...props
80
- }) {
79
+ function Dialog({ ...props }) {
81
80
  return /* @__PURE__ */ React2.createElement(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
82
81
  }
83
- function DialogTrigger({
84
- ...props
85
- }) {
82
+ function DialogTrigger({ ...props }) {
86
83
  return /* @__PURE__ */ React2.createElement(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
87
84
  }
88
- function DialogPortal({
89
- ...props
90
- }) {
85
+ function DialogPortal({ ...props }) {
91
86
  return /* @__PURE__ */ React2.createElement(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
92
87
  }
93
88
  function DialogOverlay({
@@ -137,11 +132,7 @@ function DialogContent({
137
132
 
138
133
  // src/shadcn/components/PenIcon.tsx
139
134
  import React3 from "react";
140
- function PenIcon({
141
- size = 16,
142
- className = "",
143
- color = "secondary"
144
- }) {
135
+ function PenIcon({ size = 16, className = "", color = "secondary" }) {
145
136
  const colors = {
146
137
  primary: "#2F2F2F",
147
138
  secondary: "#9B9B9B",
@@ -253,10 +244,7 @@ function Input({ className, type, ...props }) {
253
244
  // src/shadcn/components/ui/label.tsx
254
245
  import * as React7 from "react";
255
246
  import * as LabelPrimitive from "@radix-ui/react-label";
256
- function Label({
257
- className,
258
- ...props
259
- }) {
247
+ function Label({ className, ...props }) {
260
248
  return /* @__PURE__ */ React7.createElement(
261
249
  LabelPrimitive.Root,
262
250
  {
@@ -273,10 +261,7 @@ function Label({
273
261
  // src/shadcn/components/ui/tabs.tsx
274
262
  import * as React8 from "react";
275
263
  import * as TabsPrimitive from "@radix-ui/react-tabs";
276
- function Tabs({
277
- className,
278
- ...props
279
- }) {
264
+ function Tabs({ className, ...props }) {
280
265
  return /* @__PURE__ */ React8.createElement(
281
266
  TabsPrimitive.Root,
282
267
  {
@@ -286,10 +271,7 @@ function Tabs({
286
271
  }
287
272
  );
288
273
  }
289
- function TabsList({
290
- className,
291
- ...props
292
- }) {
274
+ function TabsList({ className, ...props }) {
293
275
  return /* @__PURE__ */ React8.createElement(
294
276
  TabsPrimitive.List,
295
277
  {
@@ -302,10 +284,7 @@ function TabsList({
302
284
  }
303
285
  );
304
286
  }
305
- function TabsTrigger({
306
- className,
307
- ...props
308
- }) {
287
+ function TabsTrigger({ className, ...props }) {
309
288
  return /* @__PURE__ */ React8.createElement(
310
289
  TabsPrimitive.Trigger,
311
290
  {
@@ -318,10 +297,7 @@ function TabsTrigger({
318
297
  }
319
298
  );
320
299
  }
321
- function TabsContent({
322
- className,
323
- ...props
324
- }) {
300
+ function TabsContent({ className, ...props }) {
325
301
  return /* @__PURE__ */ React8.createElement(
326
302
  TabsPrimitive.Content,
327
303
  {
@@ -340,58 +316,41 @@ import React10 from "react";
340
316
 
341
317
  // src/shadcn/components/ui/card.tsx
342
318
  import * as React9 from "react";
343
- var Card = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
344
- "div",
345
- {
346
- ref,
347
- className: cn(
348
- "rounded-lg border bg-card text-card-foreground shadow-sm",
349
- className
350
- ),
351
- ...props
352
- }
353
- ));
319
+ var Card = React9.forwardRef(
320
+ ({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
321
+ "div",
322
+ {
323
+ ref,
324
+ className: cn("rounded-lg border bg-card text-card-foreground shadow-sm", className),
325
+ ...props
326
+ }
327
+ )
328
+ );
354
329
  Card.displayName = "Card";
355
- var CardHeader = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
356
- "div",
357
- {
358
- ref,
359
- className: cn("flex flex-col space-y-1.5 p-6", className),
360
- ...props
361
- }
362
- ));
330
+ var CardHeader = React9.forwardRef(
331
+ ({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement("div", { ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })
332
+ );
363
333
  CardHeader.displayName = "CardHeader";
364
- var CardTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
365
- "h3",
366
- {
367
- ref,
368
- className: cn(
369
- "text-2xl font-semibold leading-none tracking-tight",
370
- className
371
- ),
372
- ...props
373
- }
374
- ));
334
+ var CardTitle = React9.forwardRef(
335
+ ({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
336
+ "h3",
337
+ {
338
+ ref,
339
+ className: cn("text-2xl font-semibold leading-none tracking-tight", className),
340
+ ...props
341
+ }
342
+ )
343
+ );
375
344
  CardTitle.displayName = "CardTitle";
376
- var CardDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
377
- "p",
378
- {
379
- ref,
380
- className: cn("text-sm text-muted-foreground", className),
381
- ...props
382
- }
383
- ));
345
+ var CardDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement("p", { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
384
346
  CardDescription.displayName = "CardDescription";
385
- var CardContent = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement("div", { ref, className: cn("p-6 pt-0", className), ...props }));
347
+ var CardContent = React9.forwardRef(
348
+ ({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement("div", { ref, className: cn("p-6 pt-0", className), ...props })
349
+ );
386
350
  CardContent.displayName = "CardContent";
387
- var CardFooter = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
388
- "div",
389
- {
390
- ref,
391
- className: cn("flex items-center p-6 pt-0", className),
392
- ...props
393
- }
394
- ));
351
+ var CardFooter = React9.forwardRef(
352
+ ({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement("div", { ref, className: cn("flex items-center p-6 pt-0", className), ...props })
353
+ );
395
354
  CardFooter.displayName = "CardFooter";
396
355
 
397
356
  // src/shadcn/components/SettingsModal/DomainPreview.tsx
@@ -470,42 +429,26 @@ function ListGeneralTab({
470
429
  onDomainChange("");
471
430
  }
472
431
  };
473
- return /* @__PURE__ */ React11.createElement("div", { className: "space-y-6" }, /* @__PURE__ */ React11.createElement("div", null, /* @__PURE__ */ React11.createElement("h2", { className: "text-2xl font-semibold" }, "List"), /* @__PURE__ */ React11.createElement("p", { className: "text-muted-foreground mt-1" }, "Add a domain list to your page")), /* @__PURE__ */ React11.createElement(
474
- Tabs,
432
+ return /* @__PURE__ */ React11.createElement("div", { className: "space-y-6" }, /* @__PURE__ */ React11.createElement("div", null, /* @__PURE__ */ React11.createElement("h2", { className: "text-2xl font-semibold" }, "List"), /* @__PURE__ */ React11.createElement("p", { className: "text-muted-foreground mt-1" }, "Add a domain list to your page")), /* @__PURE__ */ React11.createElement(Tabs, { defaultValue: "this-domain", value: domainType, onValueChange: handleTabChange }, /* @__PURE__ */ React11.createElement(TabsList, { className: "px-1" }, /* @__PURE__ */ React11.createElement(TabsTrigger, { value: "this-domain" }, "This domain"), /* @__PURE__ */ React11.createElement(TabsTrigger, { value: "custom-domain" }, "Custom domain")), /* @__PURE__ */ React11.createElement(TabsContent, { value: "this-domain", className: "space-y-4" }, /* @__PURE__ */ React11.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React11.createElement(Label, { htmlFor: "this-domain-input" }, "Domain"), /* @__PURE__ */ React11.createElement("div", { className: "relative" }, /* @__PURE__ */ React11.createElement(
433
+ Input,
475
434
  {
476
- defaultValue: "this-domain",
477
- value: domainType,
478
- onValueChange: handleTabChange
479
- },
480
- /* @__PURE__ */ React11.createElement(TabsList, { className: "px-1" }, /* @__PURE__ */ React11.createElement(TabsTrigger, { value: "this-domain" }, "This domain"), /* @__PURE__ */ React11.createElement(TabsTrigger, { value: "custom-domain" }, "Custom domain")),
481
- /* @__PURE__ */ React11.createElement(TabsContent, { value: "this-domain", className: "space-y-4" }, /* @__PURE__ */ React11.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React11.createElement(Label, { htmlFor: "this-domain-input" }, "Domain"), /* @__PURE__ */ React11.createElement("div", { className: "relative" }, /* @__PURE__ */ React11.createElement(
482
- Input,
483
- {
484
- id: "this-domain-input",
485
- value: thisDomainValue,
486
- disabled: true,
487
- className: "pr-10",
488
- placeholder: "Enter domain DID"
489
- }
490
- ), isValidDomain && /* @__PURE__ */ React11.createElement(CheckIcon2, { className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-green-500" }))), /* @__PURE__ */ React11.createElement(DomainPreview, { key: thisDomainValue, domainProfile })),
491
- /* @__PURE__ */ React11.createElement(TabsContent, { value: "custom-domain", className: "space-y-4" }, /* @__PURE__ */ React11.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React11.createElement(Label, { htmlFor: "custom-domain-input" }, "Domain"), /* @__PURE__ */ React11.createElement("div", { className: "relative" }, /* @__PURE__ */ React11.createElement(
492
- Input,
493
- {
494
- id: "custom-domain-input",
495
- value: customDomainValue,
496
- onChange: (e) => handleCustomDomainChange(e.target.value),
497
- className: "pr-10",
498
- placeholder: "Enter domain DID",
499
- disabled: isLoading
500
- }
501
- ), isLoading ? /* @__PURE__ */ React11.createElement("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2" }, /* @__PURE__ */ React11.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-gray-900" })) : isValidDomain && customDomainValue && /* @__PURE__ */ React11.createElement(CheckIcon2, { className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-green-500" }))), isValidDomain && customDomainValue && !isLoading && /* @__PURE__ */ React11.createElement(
502
- DomainPreview,
503
- {
504
- key: customDomainValue,
505
- domainProfile
506
- }
507
- ))
508
- ));
435
+ id: "this-domain-input",
436
+ value: thisDomainValue,
437
+ disabled: true,
438
+ className: "pr-10",
439
+ placeholder: "Enter domain DID"
440
+ }
441
+ ), isValidDomain && /* @__PURE__ */ React11.createElement(CheckIcon2, { className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-green-500" }))), /* @__PURE__ */ React11.createElement(DomainPreview, { key: thisDomainValue, domainProfile })), /* @__PURE__ */ React11.createElement(TabsContent, { value: "custom-domain", className: "space-y-4" }, /* @__PURE__ */ React11.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React11.createElement(Label, { htmlFor: "custom-domain-input" }, "Domain"), /* @__PURE__ */ React11.createElement("div", { className: "relative" }, /* @__PURE__ */ React11.createElement(
442
+ Input,
443
+ {
444
+ id: "custom-domain-input",
445
+ value: customDomainValue,
446
+ onChange: (e) => handleCustomDomainChange(e.target.value),
447
+ className: "pr-10",
448
+ placeholder: "Enter domain DID",
449
+ disabled: isLoading
450
+ }
451
+ ), isLoading ? /* @__PURE__ */ React11.createElement("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2" }, /* @__PURE__ */ React11.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-gray-900" })) : isValidDomain && customDomainValue && /* @__PURE__ */ React11.createElement(CheckIcon2, { className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-green-500" }))), isValidDomain && customDomainValue && !isLoading && /* @__PURE__ */ React11.createElement(DomainPreview, { key: customDomainValue, domainProfile }))));
509
452
  }
510
453
 
511
454
  // src/shadcn/blocks/list/ListPreviewTab.tsx
@@ -514,7 +457,7 @@ import React23, { useState as useState3, useEffect as useEffect2 } from "react";
514
457
  // src/shadcn/blocks/list/ListItem.tsx
515
458
  import React22 from "react";
516
459
 
517
- // src/lib/getMediaTypeIcon.tsx
460
+ // src/core/lib/getMediaTypeIcon.tsx
518
461
  import React21 from "react";
519
462
 
520
463
  // src/shadcn/components/icons/DocumentIcon.tsx
@@ -647,11 +590,7 @@ function AudioIcon({
647
590
 
648
591
  // src/shadcn/components/icons/PdfIcon.tsx
649
592
  import React16 from "react";
650
- function PdfIcon({
651
- size = 16,
652
- className = "",
653
- color = "secondary"
654
- }) {
593
+ function PdfIcon({ size = 16, className = "", color = "secondary" }) {
655
594
  const colors = {
656
595
  primary: "#2F2F2F",
657
596
  secondary: "#9B9B9B",
@@ -714,11 +653,7 @@ function JsonIcon({
714
653
 
715
654
  // src/shadcn/components/icons/XmlIcon.tsx
716
655
  import React18 from "react";
717
- function XmlIcon({
718
- size = 16,
719
- className = "",
720
- color = "secondary"
721
- }) {
656
+ function XmlIcon({ size = 16, className = "", color = "secondary" }) {
722
657
  const colors = {
723
658
  primary: "#2F2F2F",
724
659
  secondary: "#9B9B9B",
@@ -808,7 +743,7 @@ function DefaultIcon({
808
743
  );
809
744
  }
810
745
 
811
- // src/lib/getMediaTypeIcon.tsx
746
+ // src/core/lib/getMediaTypeIcon.tsx
812
747
  function getMediaTypeIcon(mediaType, props = {}) {
813
748
  const normalizedType = mediaType?.toLowerCase() || "";
814
749
  if (normalizedType.startsWith("image/")) {
@@ -861,76 +796,13 @@ function ListPreviewTab({ block, domain }) {
861
796
  return /* @__PURE__ */ React23.createElement("div", { className: "flex flex-col gap-4 mt-[30px]" }, items.map((item) => /* @__PURE__ */ React23.createElement(ListItem, { item })));
862
797
  }
863
798
 
864
- // src/lib/graphql-client.ts
865
- var GraphQLClient = class {
866
- constructor(endpoint, headers = {}) {
867
- this.endpoint = endpoint;
868
- this.headers = {
869
- "Content-Type": "application/json",
870
- ...headers
871
- };
872
- }
873
- async request(request) {
874
- const response = await fetch(this.endpoint, {
875
- method: "POST",
876
- headers: this.headers,
877
- body: JSON.stringify(request)
878
- });
879
- if (!response.ok) {
880
- throw new Error(`HTTP error! status: ${response.status}`);
881
- }
882
- const result = await response.json();
883
- if (result.errors && result.errors.length > 0) {
884
- throw new Error(`GraphQL error: ${result.errors[0].message}`);
885
- }
886
- if (!result.data) {
887
- throw new Error("No data returned from GraphQL query");
888
- }
889
- return result.data;
890
- }
891
- };
892
- var ixoGraphQLClient = new GraphQLClient(
893
- "https://devnet-blocksync-graphql.ixo.earth/graphql"
894
- );
895
-
896
- // src/lib/graphql-queries.ts
897
- var ENTITY_QUERY = `
898
- query Entity($entityId: String!) {
899
- entity(id: $entityId) {
900
- context
901
- relayerNode
902
- controller
903
- id
904
- type
905
- startDate
906
- endDate
907
- metadata
908
- linkedResource
909
- settings
910
- service
911
- externalId
912
- }
913
- }
914
- `;
915
- async function getEntity(entityId) {
916
- const response = await ixoGraphQLClient.request({
917
- query: ENTITY_QUERY,
918
- variables: { entityId },
919
- operationName: "Entity"
920
- });
921
- return response.entity;
922
- }
923
-
924
799
  // src/shadcn/components/SwitchOption.tsx
925
800
  import * as React25 from "react";
926
801
 
927
802
  // src/shadcn/components/ui/switch.tsx
928
803
  import * as React24 from "react";
929
804
  import * as SwitchPrimitive from "@radix-ui/react-switch";
930
- function Switch({
931
- className,
932
- ...props
933
- }) {
805
+ function Switch({ className, ...props }) {
934
806
  return /* @__PURE__ */ React24.createElement(
935
807
  SwitchPrimitive.Root,
936
808
  {
@@ -954,30 +826,13 @@ function Switch({
954
826
  }
955
827
 
956
828
  // src/shadcn/components/SwitchOption.tsx
957
- function SwitchOption({
958
- label,
959
- description,
960
- checked,
961
- onChange
962
- }) {
963
- return /* @__PURE__ */ React25.createElement("div", { className: "flex w-full max-w-md items-start justify-between gap-4 py-2" }, /* @__PURE__ */ React25.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React25.createElement("span", { className: "text-sm font-medium leading-none" }, label), /* @__PURE__ */ React25.createElement("span", { className: "mt-1 text-sm text-muted-foreground" }, description)), /* @__PURE__ */ React25.createElement(
964
- Switch,
965
- {
966
- id: label,
967
- "aria-label": label,
968
- checked,
969
- onCheckedChange: onChange
970
- }
971
- ));
829
+ function SwitchOption({ label, description, checked, onChange }) {
830
+ return /* @__PURE__ */ React25.createElement("div", { className: "flex w-full max-w-md items-start justify-between gap-4 py-2" }, /* @__PURE__ */ React25.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React25.createElement("span", { className: "text-sm font-medium leading-none" }, label), /* @__PURE__ */ React25.createElement("span", { className: "mt-1 text-sm text-muted-foreground" }, description)), /* @__PURE__ */ React25.createElement(Switch, { id: label, "aria-label": label, checked, onCheckedChange: onChange }));
972
831
  }
973
832
 
974
833
  // src/shadcn/blocks/list/ListSettingsTab.tsx
975
834
  import React26, { useMemo } from "react";
976
- function ListSettingsTab({
977
- block,
978
- editor,
979
- domain
980
- }) {
835
+ function ListSettingsTab({ block, editor, domain }) {
981
836
  const linkedResources = {
982
837
  count: domain?.linkedResource?.length ?? 0
983
838
  };
@@ -1035,9 +890,9 @@ function ListSettings({ block, editor, setList }) {
1035
890
  setDomain(entity);
1036
891
  const profileResource = entity.settings.Profile;
1037
892
  if (profileResource?.serviceEndpoint) {
1038
- const fetchedProfile = await fetch(
1039
- profileResource.serviceEndpoint
1040
- ).then((res) => res.json());
893
+ const fetchedProfile = await fetch(profileResource.serviceEndpoint).then(
894
+ (res) => res.json()
895
+ );
1041
896
  setDomainProfile(fetchedProfile);
1042
897
  } else {
1043
898
  setDomainProfile(null);
@@ -1103,11 +958,7 @@ function ListSettings({ block, editor, setList }) {
1103
958
  }
1104
959
 
1105
960
  // src/shadcn/blocks/list/ListBlockToolbar.tsx
1106
- function ListBlockToolbar({
1107
- block,
1108
- editor,
1109
- setList
1110
- }) {
961
+ function ListBlockToolbar({ block, editor, setList }) {
1111
962
  return /* @__PURE__ */ React28.createElement("div", { className: "flex justify-between items-center mb-3 pb-2 border-b border-gray-100 dark:border-gray-700" }, /* @__PURE__ */ React28.createElement(
1112
963
  Input,
1113
964
  {
@@ -1144,9 +995,7 @@ function useList() {
1144
995
 
1145
996
  // src/shadcn/blocks/list/ListContainer.tsx
1146
997
  import React29 from "react";
1147
- function ListContainer({
1148
- children
1149
- }) {
998
+ function ListContainer({ children }) {
1150
999
  return /* @__PURE__ */ React29.createElement("div", { className: "flex flex-col gap-2" }, children);
1151
1000
  }
1152
1001
 
@@ -1200,9 +1049,7 @@ var ListBlock = createReactBlockSpec(
1200
1049
 
1201
1050
  // src/shadcn/blocks/overview/OverviewBlock.tsx
1202
1051
  import React36 from "react";
1203
- import {
1204
- createReactBlockSpec as createReactBlockSpec2
1205
- } from "@blocknote/react";
1052
+ import { createReactBlockSpec as createReactBlockSpec2 } from "@blocknote/react";
1206
1053
 
1207
1054
  // src/shadcn/blocks/overview/OverviewBlockToolbar.tsx
1208
1055
  import React35 from "react";
@@ -1308,36 +1155,26 @@ function OverviewGeneralTab({
1308
1155
  onDomainChange("");
1309
1156
  }
1310
1157
  };
1311
- return /* @__PURE__ */ React32.createElement("div", { className: "space-y-6" }, /* @__PURE__ */ React32.createElement("div", null, /* @__PURE__ */ React32.createElement("h2", { className: "text-2xl font-semibold" }, "Overview"), /* @__PURE__ */ React32.createElement("p", { className: "text-muted-foreground mt-1" }, "Add a domain overview to your page")), /* @__PURE__ */ React32.createElement(
1312
- Tabs,
1158
+ return /* @__PURE__ */ React32.createElement("div", { className: "space-y-6" }, /* @__PURE__ */ React32.createElement("div", null, /* @__PURE__ */ React32.createElement("h2", { className: "text-2xl font-semibold" }, "Overview"), /* @__PURE__ */ React32.createElement("p", { className: "text-muted-foreground mt-1" }, "Add a domain overview to your page")), /* @__PURE__ */ React32.createElement(Tabs, { defaultValue: "this-domain", value: domainType, onValueChange: handleTabChange }, /* @__PURE__ */ React32.createElement(TabsList, { className: "px-1" }, /* @__PURE__ */ React32.createElement(TabsTrigger, { value: "this-domain" }, "This domain"), /* @__PURE__ */ React32.createElement(TabsTrigger, { value: "custom-domain" }, "Custom domain")), /* @__PURE__ */ React32.createElement(TabsContent, { value: "this-domain", className: "space-y-4" }, /* @__PURE__ */ React32.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React32.createElement(Label, { htmlFor: "this-domain-input" }, "Domain"), /* @__PURE__ */ React32.createElement("div", { className: "relative" }, /* @__PURE__ */ React32.createElement(
1159
+ Input,
1313
1160
  {
1314
- defaultValue: "this-domain",
1315
- value: domainType,
1316
- onValueChange: handleTabChange
1317
- },
1318
- /* @__PURE__ */ React32.createElement(TabsList, { className: "px-1" }, /* @__PURE__ */ React32.createElement(TabsTrigger, { value: "this-domain" }, "This domain"), /* @__PURE__ */ React32.createElement(TabsTrigger, { value: "custom-domain" }, "Custom domain")),
1319
- /* @__PURE__ */ React32.createElement(TabsContent, { value: "this-domain", className: "space-y-4" }, /* @__PURE__ */ React32.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React32.createElement(Label, { htmlFor: "this-domain-input" }, "Domain"), /* @__PURE__ */ React32.createElement("div", { className: "relative" }, /* @__PURE__ */ React32.createElement(
1320
- Input,
1321
- {
1322
- id: "this-domain-input",
1323
- value: thisDomainValue,
1324
- disabled: true,
1325
- className: "pr-10",
1326
- placeholder: "Enter domain DID"
1327
- }
1328
- ), isValidDomain && /* @__PURE__ */ React32.createElement(CheckIcon3, { className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-green-500" }))), /* @__PURE__ */ React32.createElement(DomainPreview, { domainProfile })),
1329
- /* @__PURE__ */ React32.createElement(TabsContent, { value: "custom-domain", className: "space-y-4" }, /* @__PURE__ */ React32.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React32.createElement(Label, { htmlFor: "custom-domain-input" }, "Domain"), /* @__PURE__ */ React32.createElement("div", { className: "relative" }, /* @__PURE__ */ React32.createElement(
1330
- Input,
1331
- {
1332
- id: "custom-domain-input",
1333
- value: customDomainValue,
1334
- onChange: (e) => handleCustomDomainChange(e.target.value),
1335
- className: "pr-10",
1336
- placeholder: "Enter domain DID",
1337
- disabled: isLoading
1338
- }
1339
- ), isLoading ? /* @__PURE__ */ React32.createElement("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2" }, /* @__PURE__ */ React32.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-gray-900" })) : isValidDomain && customDomainValue && /* @__PURE__ */ React32.createElement(CheckIcon3, { className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-green-500" }))), isValidDomain && customDomainValue && !isLoading && /* @__PURE__ */ React32.createElement(DomainPreview, { domainProfile }))
1340
- ));
1161
+ id: "this-domain-input",
1162
+ value: thisDomainValue,
1163
+ disabled: true,
1164
+ className: "pr-10",
1165
+ placeholder: "Enter domain DID"
1166
+ }
1167
+ ), isValidDomain && /* @__PURE__ */ React32.createElement(CheckIcon3, { className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-green-500" }))), /* @__PURE__ */ React32.createElement(DomainPreview, { domainProfile })), /* @__PURE__ */ React32.createElement(TabsContent, { value: "custom-domain", className: "space-y-4" }, /* @__PURE__ */ React32.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React32.createElement(Label, { htmlFor: "custom-domain-input" }, "Domain"), /* @__PURE__ */ React32.createElement("div", { className: "relative" }, /* @__PURE__ */ React32.createElement(
1168
+ Input,
1169
+ {
1170
+ id: "custom-domain-input",
1171
+ value: customDomainValue,
1172
+ onChange: (e) => handleCustomDomainChange(e.target.value),
1173
+ className: "pr-10",
1174
+ placeholder: "Enter domain DID",
1175
+ disabled: isLoading
1176
+ }
1177
+ ), isLoading ? /* @__PURE__ */ React32.createElement("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2" }, /* @__PURE__ */ React32.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-gray-900" })) : isValidDomain && customDomainValue && /* @__PURE__ */ React32.createElement(CheckIcon3, { className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-green-500" }))), isValidDomain && customDomainValue && !isLoading && /* @__PURE__ */ React32.createElement(DomainPreview, { domainProfile }))));
1341
1178
  }
1342
1179
 
1343
1180
  // src/shadcn/blocks/overview/OverviewPreviewTab.tsx
@@ -1368,9 +1205,7 @@ function OverviewPreviewTab({
1368
1205
  // src/shadcn/blocks/overview/OverviewSettings.tsx
1369
1206
  function OverviewSettings({ block, editor }) {
1370
1207
  const [domainValue, setDomainValue] = useState7(block.props.did);
1371
- const [pageBlocks, setPageBlocks] = useState7(
1372
- block.props.blocks || null
1373
- );
1208
+ const [pageBlocks, setPageBlocks] = useState7(block.props.blocks || null);
1374
1209
  const [loading, setLoading] = useState7(false);
1375
1210
  const [error, setError] = useState7(null);
1376
1211
  const [domainProfile, setDomainProfile] = useState7(null);
@@ -1388,25 +1223,23 @@ function OverviewSettings({ block, editor }) {
1388
1223
  const overviewResource = entity.settings.Page;
1389
1224
  const profileResource = entity.settings.Profile;
1390
1225
  if (overviewResource?.serviceEndpoint) {
1391
- const fetchedPageBlocks = await fetch(
1392
- overviewResource.serviceEndpoint
1393
- ).then((res) => res.json());
1226
+ const fetchedPageBlocks = await fetch(overviewResource.serviceEndpoint).then(
1227
+ (res) => res.json()
1228
+ );
1394
1229
  console.log({ fetchedPageBlocks });
1395
1230
  setPageBlocks(fetchedPageBlocks.blocks || block.props.blocks || null);
1396
1231
  } else {
1397
1232
  setPageBlocks(block.props.blocks || null);
1398
1233
  }
1399
1234
  if (profileResource?.serviceEndpoint) {
1400
- const fetchedProfile = await fetch(
1401
- profileResource.serviceEndpoint
1402
- ).then((res) => res.json());
1235
+ const fetchedProfile = await fetch(profileResource.serviceEndpoint).then(
1236
+ (res) => res.json()
1237
+ );
1403
1238
  setDomainProfile(fetchedProfile);
1404
1239
  }
1405
1240
  setLoading(false);
1406
1241
  } catch (err) {
1407
- setError(
1408
- err instanceof Error ? err.message : "Failed to fetch page blocks"
1409
- );
1242
+ setError(err instanceof Error ? err.message : "Failed to fetch page blocks");
1410
1243
  setPageBlocks(block.props.blocks || null);
1411
1244
  setLoading(false);
1412
1245
  }
@@ -1451,14 +1284,7 @@ function OverviewSettings({ block, editor }) {
1451
1284
  {
1452
1285
  id: "preview",
1453
1286
  label: "Preview",
1454
- content: /* @__PURE__ */ React34.createElement(
1455
- OverviewPreviewTab,
1456
- {
1457
- blocks: pageBlocks ?? null,
1458
- loading,
1459
- error
1460
- }
1461
- )
1287
+ content: /* @__PURE__ */ React34.createElement(OverviewPreviewTab, { blocks: pageBlocks ?? null, loading, error })
1462
1288
  }
1463
1289
  ]
1464
1290
  }
@@ -1466,19 +1292,12 @@ function OverviewSettings({ block, editor }) {
1466
1292
  }
1467
1293
 
1468
1294
  // src/shadcn/blocks/overview/OverviewBlockToolbar.tsx
1469
- function OverviewBlockToolbar({
1470
- block,
1471
- editor
1472
- }) {
1295
+ function OverviewBlockToolbar({ block, editor }) {
1473
1296
  return /* @__PURE__ */ React35.createElement("div", { className: "flex justify-between items-center mb-3 pb-2 border-b border-gray-100 dark:border-gray-700" }, /* @__PURE__ */ React35.createElement("div", { className: "flex gap-2 items-center font-semibold" }, /* @__PURE__ */ React35.createElement(GlobeIcon, { size: 16 }), " Overview"), /* @__PURE__ */ React35.createElement(OverviewSettings, { block, editor }));
1474
1297
  }
1475
1298
 
1476
1299
  // src/shadcn/blocks/overview/OverviewBlock.tsx
1477
- var OverviewBlockContent = ({
1478
- block,
1479
- editor,
1480
- contentRef
1481
- }) => {
1300
+ var OverviewBlockContent = ({ block, editor, contentRef }) => {
1482
1301
  return /* @__PURE__ */ React36.createElement(
1483
1302
  "div",
1484
1303
  {
@@ -1558,7 +1377,12 @@ var getExtraSlashMenuItems = (editor) => [
1558
1377
 
1559
1378
  // src/shadcn/hooks/useCreateIxoEditor.ts
1560
1379
  import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
1561
- import { BlockNoteSchema, defaultBlockSpecs, defaultInlineContentSpecs, defaultStyleSpecs } from "@blocknote/core";
1380
+ import {
1381
+ BlockNoteSchema,
1382
+ defaultBlockSpecs,
1383
+ defaultInlineContentSpecs,
1384
+ defaultStyleSpecs
1385
+ } from "@blocknote/core";
1562
1386
  function useCreateIxoEditor(options) {
1563
1387
  const {
1564
1388
  theme = "light",
@@ -1641,58 +1465,73 @@ function useCreateCollaborativeIxoEditor(options) {
1641
1465
  user,
1642
1466
  matrixClient
1643
1467
  } = options || {};
1644
- const memoizedUser = useMemo2(() => ({
1645
- id: user?.id || "",
1646
- name: user?.name || "",
1647
- color: user?.color || "",
1648
- accessToken: user?.accessToken || ""
1649
- }), [user?.id, user?.name, user?.color, user?.accessToken]);
1468
+ const memoizedUser = useMemo2(
1469
+ () => ({
1470
+ id: user?.id || "",
1471
+ name: user?.name || "",
1472
+ color: user?.color || "",
1473
+ accessToken: user?.accessToken || ""
1474
+ }),
1475
+ [user?.id, user?.name, user?.color, user?.accessToken]
1476
+ );
1650
1477
  const { matrixProvider, connectionStatus } = useMatrixProvider({
1651
1478
  yDoc,
1652
1479
  matrixClient,
1653
1480
  roomId: options.roomId
1654
1481
  });
1655
- const defaultUploadFile = useMemo2(() => uploadFile || (async (file) => {
1656
- return new Promise((resolve, reject) => {
1657
- const reader = new FileReader();
1658
- reader.onloadend = () => {
1659
- const dataUrl = reader.result;
1660
- resolve(dataUrl);
1661
- };
1662
- reader.onerror = reject;
1663
- reader.readAsDataURL(file);
1664
- });
1665
- }), [uploadFile]);
1666
- const schema = useMemo2(() => BlockNoteSchema2.create({
1667
- blockSpecs: {
1668
- ...defaultBlockSpecs2,
1669
- ...blockSpecs
1670
- },
1671
- inlineContentSpecs: {
1672
- ...defaultInlineContentSpecs2
1673
- },
1674
- styleSpecs: {
1675
- ...defaultStyleSpecs2
1676
- }
1677
- }), []);
1678
- const collaborationConfig = useMemo2(() => ({
1679
- provider: matrixProvider,
1680
- fragment: yDoc.getXmlFragment("document"),
1681
- user: {
1682
- name: memoizedUser.name,
1683
- color: memoizedUser.color
1684
- }
1685
- }), [matrixProvider, yDoc, memoizedUser.name, memoizedUser.color]);
1686
- const ixoConfig = useMemo2(() => ({
1687
- theme,
1688
- editable,
1689
- sideMenu,
1690
- slashMenu,
1691
- formattingToolbar,
1692
- linkToolbar,
1693
- filePanel,
1694
- tableHandles
1695
- }), [theme, editable, sideMenu, slashMenu, formattingToolbar, linkToolbar, filePanel, tableHandles]);
1482
+ const defaultUploadFile = useMemo2(
1483
+ () => uploadFile || (async (file) => {
1484
+ return new Promise((resolve, reject) => {
1485
+ const reader = new FileReader();
1486
+ reader.onloadend = () => {
1487
+ const dataUrl = reader.result;
1488
+ resolve(dataUrl);
1489
+ };
1490
+ reader.onerror = reject;
1491
+ reader.readAsDataURL(file);
1492
+ });
1493
+ }),
1494
+ [uploadFile]
1495
+ );
1496
+ const schema = useMemo2(
1497
+ () => BlockNoteSchema2.create({
1498
+ blockSpecs: {
1499
+ ...defaultBlockSpecs2,
1500
+ ...blockSpecs
1501
+ },
1502
+ inlineContentSpecs: {
1503
+ ...defaultInlineContentSpecs2
1504
+ },
1505
+ styleSpecs: {
1506
+ ...defaultStyleSpecs2
1507
+ }
1508
+ }),
1509
+ []
1510
+ );
1511
+ const collaborationConfig = useMemo2(
1512
+ () => ({
1513
+ provider: matrixProvider,
1514
+ fragment: yDoc.getXmlFragment("document"),
1515
+ user: {
1516
+ name: memoizedUser.name,
1517
+ color: memoizedUser.color
1518
+ }
1519
+ }),
1520
+ [matrixProvider, yDoc, memoizedUser.name, memoizedUser.color]
1521
+ );
1522
+ const ixoConfig = useMemo2(
1523
+ () => ({
1524
+ theme,
1525
+ editable,
1526
+ sideMenu,
1527
+ slashMenu,
1528
+ formattingToolbar,
1529
+ linkToolbar,
1530
+ filePanel,
1531
+ tableHandles
1532
+ }),
1533
+ [theme, editable, sideMenu, slashMenu, formattingToolbar, linkToolbar, filePanel, tableHandles]
1534
+ );
1696
1535
  const editor = useCreateBlockNote3({
1697
1536
  schema,
1698
1537
  initialContent,
@@ -1707,10 +1546,7 @@ function useCreateCollaborativeIxoEditor(options) {
1707
1546
 
1708
1547
  // src/shadcn/IxoEditor.tsx
1709
1548
  import React37 from "react";
1710
- import {
1711
- getDefaultReactSlashMenuItems,
1712
- SuggestionMenuController
1713
- } from "@blocknote/react";
1549
+ import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
1714
1550
  import { BlockNoteView as BlockNoteView2 } from "@blocknote/shadcn";
1715
1551
  import { filterSuggestionItems } from "@blocknote/core";
1716
1552
  function IxoEditor({
@@ -1733,43 +1569,34 @@ function IxoEditor({
1733
1569
  filePanel: true,
1734
1570
  tableHandles: true
1735
1571
  };
1736
- return /* @__PURE__ */ React37.createElement(
1737
- "div",
1572
+ return /* @__PURE__ */ React37.createElement("div", { className: `ixo-editor ixo-editor--theme-${config.theme} ${className}` }, /* @__PURE__ */ React37.createElement(
1573
+ BlockNoteView2,
1738
1574
  {
1739
- className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`
1575
+ editor,
1576
+ editable: config.editable,
1577
+ sideMenu: config.sideMenu,
1578
+ slashMenu: false,
1579
+ formattingToolbar: config.formattingToolbar,
1580
+ linkToolbar: config.linkToolbar,
1581
+ filePanel: config.filePanel,
1582
+ tableHandles: config.tableHandles,
1583
+ theme: config.theme,
1584
+ onChange,
1585
+ onSelectionChange
1740
1586
  },
1741
- /* @__PURE__ */ React37.createElement(
1742
- BlockNoteView2,
1587
+ config.slashMenu && /* @__PURE__ */ React37.createElement(
1588
+ SuggestionMenuController,
1743
1589
  {
1744
- editor,
1745
- editable: config.editable,
1746
- sideMenu: config.sideMenu,
1747
- slashMenu: false,
1748
- formattingToolbar: config.formattingToolbar,
1749
- linkToolbar: config.linkToolbar,
1750
- filePanel: config.filePanel,
1751
- tableHandles: config.tableHandles,
1752
- theme: config.theme,
1753
- onChange,
1754
- onSelectionChange
1755
- },
1756
- config.slashMenu && /* @__PURE__ */ React37.createElement(
1757
- SuggestionMenuController,
1758
- {
1759
- triggerCharacter: "/",
1760
- getItems: async (query) => {
1761
- const defaultItems = getDefaultReactSlashMenuItems(editor);
1762
- const customItems = getExtraSlashMenuItems(editor);
1763
- return filterSuggestionItems(
1764
- [...defaultItems, ...customItems],
1765
- query
1766
- );
1767
- }
1590
+ triggerCharacter: "/",
1591
+ getItems: async (query) => {
1592
+ const defaultItems = getDefaultReactSlashMenuItems(editor);
1593
+ const customItems = getExtraSlashMenuItems(editor);
1594
+ return filterSuggestionItems([...defaultItems, ...customItems], query);
1768
1595
  }
1769
- ),
1770
- children
1771
- )
1772
- );
1596
+ }
1597
+ ),
1598
+ children
1599
+ ));
1773
1600
  }
1774
1601
 
1775
1602
  export {
@@ -1781,4 +1608,4 @@ export {
1781
1608
  useCreateCollaborativeIxoEditor,
1782
1609
  IxoEditor
1783
1610
  };
1784
- //# sourceMappingURL=chunk-57TP5N42.mjs.map
1611
+ //# sourceMappingURL=chunk-GSKWOGSU.mjs.map