@ixo/editor 1.0.1 → 1.1.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.
- package/README.md +160 -136
- package/dist/chunk-57TP5N42.mjs +1784 -0
- package/dist/chunk-57TP5N42.mjs.map +1 -0
- package/dist/chunk-MXVDN3FO.mjs +169 -0
- package/dist/chunk-MXVDN3FO.mjs.map +1 -0
- package/dist/graphql-client-BmODcqPE.d.mts +135 -0
- package/dist/index.d.mts +1328 -0
- package/dist/index.mjs +27 -0
- package/dist/index.mjs.map +1 -0
- package/dist/mantine/index.d.mts +1253 -0
- package/dist/mantine/index.mjs +413 -0
- package/dist/mantine/index.mjs.map +1 -0
- package/dist/shadcn/index.d.mts +6 -0
- package/dist/shadcn/index.mjs +27 -0
- package/dist/shadcn/index.mjs.map +1 -0
- package/fonts/inter-v12-latin/inter-v12-latin-100.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-100.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-200.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-200.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-300.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-300.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-500.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-500.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-600.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-600.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-700.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-700.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-800.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-800.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-900.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-900.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-regular.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-regular.woff2 +0 -0
- package/package.json +32 -10
- package/style-core.css +243 -0
- package/style-mantine.css +340 -0
- package/style-shadcn.css +340 -0
- package/style.css +94 -0
- package/dist/blocks/index.d.ts +0 -85
- package/dist/blocks/index.d.ts.map +0 -1
- package/dist/blocks/index.js +0 -50
- package/dist/blocks/list/ListBlock.d.ts +0 -59
- package/dist/blocks/list/ListBlock.d.ts.map +0 -1
- package/dist/blocks/list/ListBlock.js +0 -51
- package/dist/blocks/list/ListBlockToolbar.d.ts +0 -9
- package/dist/blocks/list/ListBlockToolbar.d.ts.map +0 -1
- package/dist/blocks/list/ListBlockToolbar.js +0 -26
- package/dist/blocks/list/ListContainer.d.ts +0 -5
- package/dist/blocks/list/ListContainer.d.ts.map +0 -1
- package/dist/blocks/list/ListContainer.js +0 -10
- package/dist/blocks/list/ListGeneralTab.d.ts +0 -11
- package/dist/blocks/list/ListGeneralTab.d.ts.map +0 -1
- package/dist/blocks/list/ListGeneralTab.js +0 -134
- package/dist/blocks/list/ListItem.d.ts +0 -8
- package/dist/blocks/list/ListItem.d.ts.map +0 -1
- package/dist/blocks/list/ListItem.js +0 -24
- package/dist/blocks/list/ListPreviewTab.d.ts +0 -9
- package/dist/blocks/list/ListPreviewTab.d.ts.map +0 -1
- package/dist/blocks/list/ListPreviewTab.js +0 -51
- package/dist/blocks/list/ListSettings.d.ts +0 -3
- package/dist/blocks/list/ListSettings.d.ts.map +0 -1
- package/dist/blocks/list/ListSettings.js +0 -115
- package/dist/blocks/list/ListSettingsTab.d.ts +0 -10
- package/dist/blocks/list/ListSettingsTab.d.ts.map +0 -1
- package/dist/blocks/list/ListSettingsTab.js +0 -64
- package/dist/blocks/list/index.d.ts +0 -3
- package/dist/blocks/list/index.d.ts.map +0 -1
- package/dist/blocks/list/index.js +0 -5
- package/dist/blocks/list/useList.d.ts +0 -5
- package/dist/blocks/list/useList.d.ts.map +0 -1
- package/dist/blocks/list/useList.js +0 -11
- package/dist/blocks/overview/OverviewBlock.d.ts +0 -33
- package/dist/blocks/overview/OverviewBlock.d.ts.map +0 -1
- package/dist/blocks/overview/OverviewBlock.js +0 -34
- package/dist/blocks/overview/OverviewBlockToolbar.d.ts +0 -8
- package/dist/blocks/overview/OverviewBlockToolbar.d.ts.map +0 -1
- package/dist/blocks/overview/OverviewBlockToolbar.js +0 -16
- package/dist/blocks/overview/OverviewGeneralTab.d.ts +0 -11
- package/dist/blocks/overview/OverviewGeneralTab.d.ts.map +0 -1
- package/dist/blocks/overview/OverviewGeneralTab.js +0 -134
- package/dist/blocks/overview/OverviewPreviewTab.d.ts +0 -10
- package/dist/blocks/overview/OverviewPreviewTab.d.ts.map +0 -1
- package/dist/blocks/overview/OverviewPreviewTab.js +0 -30
- package/dist/blocks/overview/OverviewSettings.d.ts +0 -3
- package/dist/blocks/overview/OverviewSettings.d.ts.map +0 -1
- package/dist/blocks/overview/OverviewSettings.js +0 -114
- package/dist/blocks/overview/index.d.ts +0 -3
- package/dist/blocks/overview/index.d.ts.map +0 -1
- package/dist/blocks/overview/index.js +0 -5
- package/dist/blocks/overview/useOverview.d.ts +0 -11
- package/dist/blocks/overview/useOverview.d.ts.map +0 -1
- package/dist/blocks/overview/useOverview.js +0 -61
- package/dist/components/GlobeIcon.d.ts +0 -9
- package/dist/components/GlobeIcon.d.ts.map +0 -1
- package/dist/components/GlobeIcon.js +0 -20
- package/dist/components/IxoEditor.d.ts +0 -14
- package/dist/components/IxoEditor.d.ts.map +0 -1
- package/dist/components/IxoEditor.js +0 -41
- package/dist/components/PenIcon.d.ts +0 -9
- package/dist/components/PenIcon.d.ts.map +0 -1
- package/dist/components/PenIcon.js +0 -20
- package/dist/components/SettingsIcon.d.ts +0 -9
- package/dist/components/SettingsIcon.d.ts.map +0 -1
- package/dist/components/SettingsIcon.js +0 -21
- package/dist/components/SettingsModal/AdvancedTab.d.ts +0 -8
- package/dist/components/SettingsModal/AdvancedTab.d.ts.map +0 -1
- package/dist/components/SettingsModal/AdvancedTab.js +0 -14
- package/dist/components/SettingsModal/DomainPreview.d.ts +0 -7
- package/dist/components/SettingsModal/DomainPreview.d.ts.map +0 -1
- package/dist/components/SettingsModal/DomainPreview.js +0 -22
- package/dist/components/SettingsModal/FeatureASettings.d.ts +0 -3
- package/dist/components/SettingsModal/FeatureASettings.d.ts.map +0 -1
- package/dist/components/SettingsModal/FeatureASettings.js +0 -74
- package/dist/components/SettingsModal/GeneralTab.d.ts +0 -10
- package/dist/components/SettingsModal/GeneralTab.d.ts.map +0 -1
- package/dist/components/SettingsModal/GeneralTab.js +0 -111
- package/dist/components/SettingsModal/PreviewTab.d.ts +0 -8
- package/dist/components/SettingsModal/PreviewTab.d.ts.map +0 -1
- package/dist/components/SettingsModal/PreviewTab.js +0 -14
- package/dist/components/SettingsModal/SettingsModal.d.ts +0 -16
- package/dist/components/SettingsModal/SettingsModal.d.ts.map +0 -1
- package/dist/components/SettingsModal/SettingsModal.js +0 -61
- package/dist/components/SettingsModal/SettingsNavigation.d.ts +0 -15
- package/dist/components/SettingsModal/SettingsNavigation.d.ts.map +0 -1
- package/dist/components/SettingsModal/SettingsNavigation.js +0 -21
- package/dist/components/SettingsModal/index.d.ts +0 -8
- package/dist/components/SettingsModal/index.d.ts.map +0 -1
- package/dist/components/SettingsModal/index.js +0 -17
- package/dist/components/SwitchOption.d.ts +0 -9
- package/dist/components/SwitchOption.d.ts.map +0 -1
- package/dist/components/SwitchOption.js +0 -45
- package/dist/components/icons/ArchiveIcon.d.ts +0 -9
- package/dist/components/icons/ArchiveIcon.d.ts.map +0 -1
- package/dist/components/icons/ArchiveIcon.js +0 -18
- package/dist/components/icons/AudioIcon.d.ts +0 -9
- package/dist/components/icons/AudioIcon.d.ts.map +0 -1
- package/dist/components/icons/AudioIcon.js +0 -17
- package/dist/components/icons/DefaultIcon.d.ts +0 -9
- package/dist/components/icons/DefaultIcon.d.ts.map +0 -1
- package/dist/components/icons/DefaultIcon.js +0 -17
- package/dist/components/icons/DocumentIcon.d.ts +0 -9
- package/dist/components/icons/DocumentIcon.d.ts.map +0 -1
- package/dist/components/icons/DocumentIcon.js +0 -20
- package/dist/components/icons/ImageIcon.d.ts +0 -9
- package/dist/components/icons/ImageIcon.d.ts.map +0 -1
- package/dist/components/icons/ImageIcon.js +0 -18
- package/dist/components/icons/JsonIcon.d.ts +0 -9
- package/dist/components/icons/JsonIcon.d.ts.map +0 -1
- package/dist/components/icons/JsonIcon.js +0 -19
- package/dist/components/icons/PdfIcon.d.ts +0 -9
- package/dist/components/icons/PdfIcon.d.ts.map +0 -1
- package/dist/components/icons/PdfIcon.js +0 -20
- package/dist/components/icons/VideoIcon.d.ts +0 -9
- package/dist/components/icons/VideoIcon.d.ts.map +0 -1
- package/dist/components/icons/VideoIcon.js +0 -17
- package/dist/components/icons/XmlIcon.d.ts +0 -9
- package/dist/components/icons/XmlIcon.d.ts.map +0 -1
- package/dist/components/icons/XmlIcon.js +0 -19
- package/dist/components/icons/index.d.ts +0 -10
- package/dist/components/icons/index.d.ts.map +0 -1
- package/dist/components/icons/index.js +0 -24
- package/dist/components/ui/button.d.ts +0 -11
- package/dist/components/ui/button.d.ts.map +0 -1
- package/dist/components/ui/button.js +0 -68
- package/dist/components/ui/card.d.ts +0 -9
- package/dist/components/ui/card.d.ts.map +0 -1
- package/dist/components/ui/card.js +0 -56
- package/dist/components/ui/dialog.d.ts +0 -16
- package/dist/components/ui/dialog.d.ts.map +0 -1
- package/dist/components/ui/dialog.js +0 -85
- package/dist/components/ui/dropdown-menu.d.ts +0 -26
- package/dist/components/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/components/ui/dropdown-menu.js +0 -110
- package/dist/components/ui/input.d.ts +0 -4
- package/dist/components/ui/input.d.ts.map +0 -1
- package/dist/components/ui/input.js +0 -41
- package/dist/components/ui/label.d.ts +0 -5
- package/dist/components/ui/label.d.ts.map +0 -1
- package/dist/components/ui/label.js +0 -42
- package/dist/components/ui/switch.d.ts +0 -5
- package/dist/components/ui/switch.d.ts.map +0 -1
- package/dist/components/ui/switch.js +0 -44
- package/dist/components/ui/tabs.d.ts +0 -8
- package/dist/components/ui/tabs.d.ts.map +0 -1
- package/dist/components/ui/tabs.js +0 -54
- package/dist/components/ui/toggle-group.d.ts +0 -8
- package/dist/components/ui/toggle-group.d.ts.map +0 -1
- package/dist/components/ui/toggle-group.js +0 -57
- package/dist/components/ui/toggle.d.ts +0 -10
- package/dist/components/ui/toggle.d.ts.map +0 -1
- package/dist/components/ui/toggle.js +0 -62
- package/dist/hooks/useCollaborativeIxoEditor.d.ts +0 -571
- package/dist/hooks/useCollaborativeIxoEditor.d.ts.map +0 -1
- package/dist/hooks/useCollaborativeIxoEditor.js +0 -127
- package/dist/hooks/useCreateIxoEditor.d.ts +0 -568
- package/dist/hooks/useCreateIxoEditor.d.ts.map +0 -1
- package/dist/hooks/useCreateIxoEditor.js +0 -62
- package/dist/hooks/useMatrixProvider.d.ts +0 -13
- package/dist/hooks/useMatrixProvider.d.ts.map +0 -1
- package/dist/hooks/useMatrixProvider.js +0 -147
- package/dist/index.d.ts +0 -12
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -24
- package/dist/lib/graphql-client.d.ts +0 -27
- package/dist/lib/graphql-client.d.ts.map +0 -1
- package/dist/lib/graphql-client.js +0 -36
- package/dist/lib/graphql-queries.d.ts +0 -31
- package/dist/lib/graphql-queries.d.ts.map +0 -1
- package/dist/lib/graphql-queries.js +0 -40
- package/dist/lib/utils/getMediaTypeIcon.d.ts +0 -20
- package/dist/lib/utils/getMediaTypeIcon.d.ts.map +0 -1
- package/dist/lib/utils/getMediaTypeIcon.js +0 -96
- package/dist/lib/utils/index.d.ts +0 -4
- package/dist/lib/utils/index.d.ts.map +0 -1
- package/dist/lib/utils/index.js +0 -12
- package/dist/lib/utils.d.ts +0 -3
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -8
- package/dist/types/Domain.d.ts +0 -18
- package/dist/types/Domain.d.ts.map +0 -1
- package/dist/types/Domain.js +0 -2
- package/dist/types/index.d.ts +0 -77
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
|
@@ -0,0 +1,1784 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useMatrixProvider
|
|
3
|
+
} from "./chunk-MXVDN3FO.mjs";
|
|
4
|
+
|
|
5
|
+
// src/shadcn/blocks/list/ListBlock.tsx
|
|
6
|
+
import React30 from "react";
|
|
7
|
+
import { createReactBlockSpec } from "@blocknote/react";
|
|
8
|
+
|
|
9
|
+
// src/shadcn/blocks/list/ListBlockToolbar.tsx
|
|
10
|
+
import React28 from "react";
|
|
11
|
+
|
|
12
|
+
// src/shadcn/blocks/list/ListSettings.tsx
|
|
13
|
+
import React27, { useState as useState4, useEffect as useEffect3 } from "react";
|
|
14
|
+
|
|
15
|
+
// src/shadcn/components/SettingsModal/SettingsModal.tsx
|
|
16
|
+
import React5, { useState } from "react";
|
|
17
|
+
|
|
18
|
+
// src/shadcn/components/ui/button.tsx
|
|
19
|
+
import * as React from "react";
|
|
20
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
21
|
+
import { cva } from "class-variance-authority";
|
|
22
|
+
|
|
23
|
+
// src/shadcn/lib/utils.ts
|
|
24
|
+
import { clsx } from "clsx";
|
|
25
|
+
import { twMerge } from "tailwind-merge";
|
|
26
|
+
function cn(...inputs) {
|
|
27
|
+
return twMerge(clsx(inputs));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// src/shadcn/components/ui/button.tsx
|
|
31
|
+
var buttonVariants = cva(
|
|
32
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
33
|
+
{
|
|
34
|
+
variants: {
|
|
35
|
+
variant: {
|
|
36
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
37
|
+
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
38
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
39
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
40
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
41
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
42
|
+
},
|
|
43
|
+
size: {
|
|
44
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
45
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
46
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
47
|
+
icon: "size-9"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
variant: "default",
|
|
52
|
+
size: "default"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
function Button({
|
|
57
|
+
className,
|
|
58
|
+
variant,
|
|
59
|
+
size,
|
|
60
|
+
asChild = false,
|
|
61
|
+
...props
|
|
62
|
+
}) {
|
|
63
|
+
const Comp = asChild ? Slot : "button";
|
|
64
|
+
return /* @__PURE__ */ React.createElement(
|
|
65
|
+
Comp,
|
|
66
|
+
{
|
|
67
|
+
"data-slot": "button",
|
|
68
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
69
|
+
...props
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// src/shadcn/components/ui/dialog.tsx
|
|
75
|
+
import * as React2 from "react";
|
|
76
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
77
|
+
import { XIcon } from "lucide-react";
|
|
78
|
+
function Dialog({
|
|
79
|
+
...props
|
|
80
|
+
}) {
|
|
81
|
+
return /* @__PURE__ */ React2.createElement(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
82
|
+
}
|
|
83
|
+
function DialogTrigger({
|
|
84
|
+
...props
|
|
85
|
+
}) {
|
|
86
|
+
return /* @__PURE__ */ React2.createElement(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
87
|
+
}
|
|
88
|
+
function DialogPortal({
|
|
89
|
+
...props
|
|
90
|
+
}) {
|
|
91
|
+
return /* @__PURE__ */ React2.createElement(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
92
|
+
}
|
|
93
|
+
function DialogOverlay({
|
|
94
|
+
className,
|
|
95
|
+
...props
|
|
96
|
+
}) {
|
|
97
|
+
return /* @__PURE__ */ React2.createElement(
|
|
98
|
+
DialogPrimitive.Overlay,
|
|
99
|
+
{
|
|
100
|
+
"data-slot": "dialog-overlay",
|
|
101
|
+
className: cn(
|
|
102
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
103
|
+
className
|
|
104
|
+
),
|
|
105
|
+
...props
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
function DialogContent({
|
|
110
|
+
className,
|
|
111
|
+
children,
|
|
112
|
+
showCloseButton = true,
|
|
113
|
+
...props
|
|
114
|
+
}) {
|
|
115
|
+
return /* @__PURE__ */ React2.createElement(DialogPortal, { "data-slot": "dialog-portal" }, /* @__PURE__ */ React2.createElement(DialogOverlay, null), /* @__PURE__ */ React2.createElement(
|
|
116
|
+
DialogPrimitive.Content,
|
|
117
|
+
{
|
|
118
|
+
"data-slot": "dialog-content",
|
|
119
|
+
className: cn(
|
|
120
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
121
|
+
className
|
|
122
|
+
),
|
|
123
|
+
...props
|
|
124
|
+
},
|
|
125
|
+
children,
|
|
126
|
+
showCloseButton && /* @__PURE__ */ React2.createElement(
|
|
127
|
+
DialogPrimitive.Close,
|
|
128
|
+
{
|
|
129
|
+
"data-slot": "dialog-close",
|
|
130
|
+
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
131
|
+
},
|
|
132
|
+
/* @__PURE__ */ React2.createElement(XIcon, null),
|
|
133
|
+
/* @__PURE__ */ React2.createElement("span", { className: "sr-only" }, "Close")
|
|
134
|
+
)
|
|
135
|
+
));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// src/shadcn/components/PenIcon.tsx
|
|
139
|
+
import React3 from "react";
|
|
140
|
+
function PenIcon({
|
|
141
|
+
size = 16,
|
|
142
|
+
className = "",
|
|
143
|
+
color = "secondary"
|
|
144
|
+
}) {
|
|
145
|
+
const colors = {
|
|
146
|
+
primary: "#2F2F2F",
|
|
147
|
+
secondary: "#9B9B9B",
|
|
148
|
+
accent: "#1976D2"
|
|
149
|
+
};
|
|
150
|
+
return /* @__PURE__ */ React3.createElement(
|
|
151
|
+
"svg",
|
|
152
|
+
{
|
|
153
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
154
|
+
width: size,
|
|
155
|
+
height: size,
|
|
156
|
+
viewBox: "0 0 24 24",
|
|
157
|
+
fill: "none",
|
|
158
|
+
stroke: colors[color],
|
|
159
|
+
strokeWidth: "1.5",
|
|
160
|
+
strokeLinecap: "round",
|
|
161
|
+
strokeLinejoin: "round",
|
|
162
|
+
className: `transition-colors duration-200 hover:stroke-[#1976D2] ${className}`,
|
|
163
|
+
style: {
|
|
164
|
+
cursor: "pointer"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
/* @__PURE__ */ React3.createElement("path", { d: "M13 21h8" }),
|
|
168
|
+
/* @__PURE__ */ React3.createElement("path", { d: "m15 5 4 4" }),
|
|
169
|
+
/* @__PURE__ */ React3.createElement("path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" })
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// src/shadcn/components/SettingsModal/SettingsNavigation.tsx
|
|
174
|
+
import React4 from "react";
|
|
175
|
+
import { CheckIcon } from "lucide-react";
|
|
176
|
+
function SettingsNavigation({
|
|
177
|
+
activeTab,
|
|
178
|
+
onTabChange,
|
|
179
|
+
onAddToPage,
|
|
180
|
+
navigationItems,
|
|
181
|
+
loading = false
|
|
182
|
+
}) {
|
|
183
|
+
return /* @__PURE__ */ React4.createElement("div", { className: "w-56 border-r bg-muted/50 p-6 flex flex-col" }, /* @__PURE__ */ React4.createElement("nav", { className: "space-y-2 flex-1" }, navigationItems.map((item) => /* @__PURE__ */ React4.createElement(
|
|
184
|
+
"button",
|
|
185
|
+
{
|
|
186
|
+
key: item.id,
|
|
187
|
+
onClick: () => !loading && onTabChange(item.id),
|
|
188
|
+
disabled: loading,
|
|
189
|
+
className: `w-full text-left px-3 py-2 rounded-md text-sm font-medium transition-colors ${activeTab === item.id ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted"} ${loading ? "opacity-50 cursor-not-allowed" : ""}`
|
|
190
|
+
},
|
|
191
|
+
item.label,
|
|
192
|
+
loading && item.id !== activeTab && /* @__PURE__ */ React4.createElement("div", { className: "inline-block ml-2 animate-spin rounded-full h-3 w-3 border-b border-current opacity-50" })
|
|
193
|
+
))), /* @__PURE__ */ React4.createElement("div", { className: "mt-auto pt-4" }, /* @__PURE__ */ React4.createElement(
|
|
194
|
+
Button,
|
|
195
|
+
{
|
|
196
|
+
onClick: onAddToPage,
|
|
197
|
+
disabled: loading,
|
|
198
|
+
className: "w-full bg-black hover:bg-black/90 text-white rounded-md justify-start px-3 py-2 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
199
|
+
},
|
|
200
|
+
/* @__PURE__ */ React4.createElement(CheckIcon, { className: "mr-2 h-4 w-4" }),
|
|
201
|
+
"Add to page"
|
|
202
|
+
)));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// src/shadcn/components/SettingsModal/SettingsModal.tsx
|
|
206
|
+
function SettingsModal({
|
|
207
|
+
tabs,
|
|
208
|
+
onAddToPage,
|
|
209
|
+
loading = false,
|
|
210
|
+
open,
|
|
211
|
+
onOpenChange
|
|
212
|
+
}) {
|
|
213
|
+
const [activeTab, setActiveTab] = useState(tabs[0]?.id || "general");
|
|
214
|
+
const navigationItems = tabs.map((tab) => ({
|
|
215
|
+
id: tab.id,
|
|
216
|
+
label: tab.label
|
|
217
|
+
}));
|
|
218
|
+
const activeTabContent = tabs.find((tab) => tab.id === activeTab)?.content;
|
|
219
|
+
return /* @__PURE__ */ React5.createElement(Dialog, { open, onOpenChange }, /* @__PURE__ */ React5.createElement(DialogTrigger, { asChild: true }, /* @__PURE__ */ React5.createElement(Button, { variant: "secondary", className: "font-semibold" }, /* @__PURE__ */ React5.createElement(PenIcon, null), " Edit")), /* @__PURE__ */ React5.createElement(DialogContent, { className: "max-w-4xl h-[600px] p-0 rounded-2xl" }, /* @__PURE__ */ React5.createElement("div", { className: "flex h-full overflow-hidden" }, /* @__PURE__ */ React5.createElement(
|
|
220
|
+
SettingsNavigation,
|
|
221
|
+
{
|
|
222
|
+
activeTab,
|
|
223
|
+
onTabChange: setActiveTab,
|
|
224
|
+
onAddToPage,
|
|
225
|
+
navigationItems,
|
|
226
|
+
loading
|
|
227
|
+
}
|
|
228
|
+
), /* @__PURE__ */ React5.createElement("div", { className: "flex-1 p-6 overflow-y-auto" }, activeTabContent))));
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// src/shadcn/blocks/list/ListGeneralTab.tsx
|
|
232
|
+
import React11, { useState as useState2, useEffect } from "react";
|
|
233
|
+
|
|
234
|
+
// src/shadcn/components/ui/input.tsx
|
|
235
|
+
import * as React6 from "react";
|
|
236
|
+
function Input({ className, type, ...props }) {
|
|
237
|
+
return /* @__PURE__ */ React6.createElement(
|
|
238
|
+
"input",
|
|
239
|
+
{
|
|
240
|
+
type,
|
|
241
|
+
"data-slot": "input",
|
|
242
|
+
className: cn(
|
|
243
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
244
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
245
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
246
|
+
className
|
|
247
|
+
),
|
|
248
|
+
...props
|
|
249
|
+
}
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// src/shadcn/components/ui/label.tsx
|
|
254
|
+
import * as React7 from "react";
|
|
255
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
256
|
+
function Label({
|
|
257
|
+
className,
|
|
258
|
+
...props
|
|
259
|
+
}) {
|
|
260
|
+
return /* @__PURE__ */ React7.createElement(
|
|
261
|
+
LabelPrimitive.Root,
|
|
262
|
+
{
|
|
263
|
+
"data-slot": "label",
|
|
264
|
+
className: cn(
|
|
265
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
266
|
+
className
|
|
267
|
+
),
|
|
268
|
+
...props
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// src/shadcn/components/ui/tabs.tsx
|
|
274
|
+
import * as React8 from "react";
|
|
275
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
276
|
+
function Tabs({
|
|
277
|
+
className,
|
|
278
|
+
...props
|
|
279
|
+
}) {
|
|
280
|
+
return /* @__PURE__ */ React8.createElement(
|
|
281
|
+
TabsPrimitive.Root,
|
|
282
|
+
{
|
|
283
|
+
"data-slot": "tabs",
|
|
284
|
+
className: cn("flex flex-col gap-2", className),
|
|
285
|
+
...props
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
function TabsList({
|
|
290
|
+
className,
|
|
291
|
+
...props
|
|
292
|
+
}) {
|
|
293
|
+
return /* @__PURE__ */ React8.createElement(
|
|
294
|
+
TabsPrimitive.List,
|
|
295
|
+
{
|
|
296
|
+
"data-slot": "tabs-list",
|
|
297
|
+
className: cn(
|
|
298
|
+
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
|
|
299
|
+
className
|
|
300
|
+
),
|
|
301
|
+
...props
|
|
302
|
+
}
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
function TabsTrigger({
|
|
306
|
+
className,
|
|
307
|
+
...props
|
|
308
|
+
}) {
|
|
309
|
+
return /* @__PURE__ */ React8.createElement(
|
|
310
|
+
TabsPrimitive.Trigger,
|
|
311
|
+
{
|
|
312
|
+
"data-slot": "tabs-trigger",
|
|
313
|
+
className: cn(
|
|
314
|
+
"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
315
|
+
className
|
|
316
|
+
),
|
|
317
|
+
...props
|
|
318
|
+
}
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
function TabsContent({
|
|
322
|
+
className,
|
|
323
|
+
...props
|
|
324
|
+
}) {
|
|
325
|
+
return /* @__PURE__ */ React8.createElement(
|
|
326
|
+
TabsPrimitive.Content,
|
|
327
|
+
{
|
|
328
|
+
"data-slot": "tabs-content",
|
|
329
|
+
className: cn("flex-1 outline-none", className),
|
|
330
|
+
...props
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// src/shadcn/blocks/list/ListGeneralTab.tsx
|
|
336
|
+
import { CheckIcon as CheckIcon2 } from "lucide-react";
|
|
337
|
+
|
|
338
|
+
// src/shadcn/components/SettingsModal/DomainPreview.tsx
|
|
339
|
+
import React10 from "react";
|
|
340
|
+
|
|
341
|
+
// src/shadcn/components/ui/card.tsx
|
|
342
|
+
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
|
+
));
|
|
354
|
+
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
|
+
));
|
|
363
|
+
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
|
+
));
|
|
375
|
+
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
|
+
));
|
|
384
|
+
CardDescription.displayName = "CardDescription";
|
|
385
|
+
var CardContent = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
386
|
+
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
|
+
));
|
|
395
|
+
CardFooter.displayName = "CardFooter";
|
|
396
|
+
|
|
397
|
+
// src/shadcn/components/SettingsModal/DomainPreview.tsx
|
|
398
|
+
function DomainPreview({ domainProfile }) {
|
|
399
|
+
if (!domainProfile) {
|
|
400
|
+
return null;
|
|
401
|
+
}
|
|
402
|
+
return /* @__PURE__ */ React10.createElement(Card, { className: "border-0 shadow-sm rounded-xl" }, /* @__PURE__ */ React10.createElement(CardContent, { className: "p-4" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-start space-x-4" }, /* @__PURE__ */ React10.createElement("div", { className: "w-16 h-16 bg-muted rounded-lg flex items-center justify-center shrink-0" }, /* @__PURE__ */ React10.createElement(
|
|
403
|
+
"img",
|
|
404
|
+
{
|
|
405
|
+
src: domainProfile.image ?? "https://studio.ixo.earth/domain-profile-default.jpg",
|
|
406
|
+
alt: domainProfile.name,
|
|
407
|
+
className: "w-full h-full object-cover rounded-lg border-2 border-gray-200"
|
|
408
|
+
}
|
|
409
|
+
)), /* @__PURE__ */ React10.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React10.createElement("h3", { className: "font-semibold text-lg" }, domainProfile.name), /* @__PURE__ */ React10.createElement("p", { className: "text-muted-foreground text-sm" }, domainProfile.description)))));
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// src/shadcn/blocks/list/ListGeneralTab.tsx
|
|
413
|
+
function ListGeneralTab({
|
|
414
|
+
block: _block,
|
|
415
|
+
editor: _editor,
|
|
416
|
+
domainValue,
|
|
417
|
+
onDomainChange,
|
|
418
|
+
domainProfile
|
|
419
|
+
}) {
|
|
420
|
+
const [domainType, setDomainType] = useState2("this-domain");
|
|
421
|
+
const [isValidDomain, setIsValidDomain] = useState2(true);
|
|
422
|
+
const [isLoading, setIsLoading] = useState2(false);
|
|
423
|
+
const [customDomainValue, setCustomDomainValue] = useState2("");
|
|
424
|
+
const thisDomainValue = "did:ixo:entity:example123";
|
|
425
|
+
useEffect(() => {
|
|
426
|
+
if (domainValue) {
|
|
427
|
+
if (domainValue === thisDomainValue) {
|
|
428
|
+
setDomainType("this-domain");
|
|
429
|
+
setIsValidDomain(true);
|
|
430
|
+
} else {
|
|
431
|
+
setDomainType("custom-domain");
|
|
432
|
+
setCustomDomainValue(domainValue);
|
|
433
|
+
setIsValidDomain(true);
|
|
434
|
+
}
|
|
435
|
+
} else {
|
|
436
|
+
setDomainType("this-domain");
|
|
437
|
+
setCustomDomainValue("");
|
|
438
|
+
setIsValidDomain(true);
|
|
439
|
+
}
|
|
440
|
+
}, [domainValue, thisDomainValue]);
|
|
441
|
+
const handleCustomDomainChange = async (did) => {
|
|
442
|
+
setCustomDomainValue(did);
|
|
443
|
+
if (!did) {
|
|
444
|
+
setIsValidDomain(false);
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
const isValid = did.startsWith("did:") && did.length > 10;
|
|
448
|
+
if (isValid) {
|
|
449
|
+
setIsLoading(true);
|
|
450
|
+
try {
|
|
451
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
452
|
+
setIsValidDomain(true);
|
|
453
|
+
onDomainChange(did);
|
|
454
|
+
} catch (error) {
|
|
455
|
+
setIsValidDomain(false);
|
|
456
|
+
} finally {
|
|
457
|
+
setIsLoading(false);
|
|
458
|
+
}
|
|
459
|
+
} else {
|
|
460
|
+
setIsValidDomain(false);
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
const handleTabChange = (value) => {
|
|
464
|
+
setDomainType(value);
|
|
465
|
+
if (value === "this-domain") {
|
|
466
|
+
setIsValidDomain(true);
|
|
467
|
+
onDomainChange(thisDomainValue);
|
|
468
|
+
} else {
|
|
469
|
+
setIsValidDomain(false);
|
|
470
|
+
onDomainChange("");
|
|
471
|
+
}
|
|
472
|
+
};
|
|
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,
|
|
475
|
+
{
|
|
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
|
+
));
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// src/shadcn/blocks/list/ListPreviewTab.tsx
|
|
512
|
+
import React23, { useState as useState3, useEffect as useEffect2 } from "react";
|
|
513
|
+
|
|
514
|
+
// src/shadcn/blocks/list/ListItem.tsx
|
|
515
|
+
import React22 from "react";
|
|
516
|
+
|
|
517
|
+
// src/lib/getMediaTypeIcon.tsx
|
|
518
|
+
import React21 from "react";
|
|
519
|
+
|
|
520
|
+
// src/shadcn/components/icons/DocumentIcon.tsx
|
|
521
|
+
import React12 from "react";
|
|
522
|
+
function DocumentIcon({
|
|
523
|
+
size = 16,
|
|
524
|
+
className = "",
|
|
525
|
+
color = "secondary"
|
|
526
|
+
}) {
|
|
527
|
+
const colors = {
|
|
528
|
+
primary: "#2F2F2F",
|
|
529
|
+
secondary: "#9B9B9B",
|
|
530
|
+
accent: "#1976D2"
|
|
531
|
+
};
|
|
532
|
+
return /* @__PURE__ */ React12.createElement(
|
|
533
|
+
"svg",
|
|
534
|
+
{
|
|
535
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
536
|
+
width: size,
|
|
537
|
+
height: size,
|
|
538
|
+
viewBox: "0 0 24 24",
|
|
539
|
+
fill: "none",
|
|
540
|
+
stroke: colors[color],
|
|
541
|
+
strokeWidth: "1.5",
|
|
542
|
+
strokeLinecap: "round",
|
|
543
|
+
strokeLinejoin: "round",
|
|
544
|
+
className: `transition-colors duration-200 ${className}`
|
|
545
|
+
},
|
|
546
|
+
/* @__PURE__ */ React12.createElement("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }),
|
|
547
|
+
/* @__PURE__ */ React12.createElement("polyline", { points: "14,2 14,8 20,8" }),
|
|
548
|
+
/* @__PURE__ */ React12.createElement("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
549
|
+
/* @__PURE__ */ React12.createElement("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
|
|
550
|
+
/* @__PURE__ */ React12.createElement("polyline", { points: "10,9 9,9 8,9" })
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
// src/shadcn/components/icons/ImageIcon.tsx
|
|
555
|
+
import React13 from "react";
|
|
556
|
+
function ImageIcon({
|
|
557
|
+
size = 16,
|
|
558
|
+
className = "",
|
|
559
|
+
color = "secondary"
|
|
560
|
+
}) {
|
|
561
|
+
const colors = {
|
|
562
|
+
primary: "#2F2F2F",
|
|
563
|
+
secondary: "#9B9B9B",
|
|
564
|
+
accent: "#1976D2"
|
|
565
|
+
};
|
|
566
|
+
return /* @__PURE__ */ React13.createElement(
|
|
567
|
+
"svg",
|
|
568
|
+
{
|
|
569
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
570
|
+
width: size,
|
|
571
|
+
height: size,
|
|
572
|
+
viewBox: "0 0 24 24",
|
|
573
|
+
fill: "none",
|
|
574
|
+
stroke: colors[color],
|
|
575
|
+
strokeWidth: "1.5",
|
|
576
|
+
strokeLinecap: "round",
|
|
577
|
+
strokeLinejoin: "round",
|
|
578
|
+
className: `transition-colors duration-200 ${className}`
|
|
579
|
+
},
|
|
580
|
+
/* @__PURE__ */ React13.createElement("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2" }),
|
|
581
|
+
/* @__PURE__ */ React13.createElement("circle", { cx: "9", cy: "9", r: "2" }),
|
|
582
|
+
/* @__PURE__ */ React13.createElement("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
|
|
583
|
+
);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// src/shadcn/components/icons/VideoIcon.tsx
|
|
587
|
+
import React14 from "react";
|
|
588
|
+
function VideoIcon({
|
|
589
|
+
size = 16,
|
|
590
|
+
className = "",
|
|
591
|
+
color = "secondary"
|
|
592
|
+
}) {
|
|
593
|
+
const colors = {
|
|
594
|
+
primary: "#2F2F2F",
|
|
595
|
+
secondary: "#9B9B9B",
|
|
596
|
+
accent: "#1976D2"
|
|
597
|
+
};
|
|
598
|
+
return /* @__PURE__ */ React14.createElement(
|
|
599
|
+
"svg",
|
|
600
|
+
{
|
|
601
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
602
|
+
width: size,
|
|
603
|
+
height: size,
|
|
604
|
+
viewBox: "0 0 24 24",
|
|
605
|
+
fill: "none",
|
|
606
|
+
stroke: colors[color],
|
|
607
|
+
strokeWidth: "1.5",
|
|
608
|
+
strokeLinecap: "round",
|
|
609
|
+
strokeLinejoin: "round",
|
|
610
|
+
className: `transition-colors duration-200 ${className}`
|
|
611
|
+
},
|
|
612
|
+
/* @__PURE__ */ React14.createElement("path", { d: "m22 8-6 4 6 4V8Z" }),
|
|
613
|
+
/* @__PURE__ */ React14.createElement("rect", { width: "14", height: "12", x: "2", y: "6", rx: "2", ry: "2" })
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
// src/shadcn/components/icons/AudioIcon.tsx
|
|
618
|
+
import React15 from "react";
|
|
619
|
+
function AudioIcon({
|
|
620
|
+
size = 16,
|
|
621
|
+
className = "",
|
|
622
|
+
color = "secondary"
|
|
623
|
+
}) {
|
|
624
|
+
const colors = {
|
|
625
|
+
primary: "#2F2F2F",
|
|
626
|
+
secondary: "#9B9B9B",
|
|
627
|
+
accent: "#1976D2"
|
|
628
|
+
};
|
|
629
|
+
return /* @__PURE__ */ React15.createElement(
|
|
630
|
+
"svg",
|
|
631
|
+
{
|
|
632
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
633
|
+
width: size,
|
|
634
|
+
height: size,
|
|
635
|
+
viewBox: "0 0 24 24",
|
|
636
|
+
fill: "none",
|
|
637
|
+
stroke: colors[color],
|
|
638
|
+
strokeWidth: "1.5",
|
|
639
|
+
strokeLinecap: "round",
|
|
640
|
+
strokeLinejoin: "round",
|
|
641
|
+
className: `transition-colors duration-200 ${className}`
|
|
642
|
+
},
|
|
643
|
+
/* @__PURE__ */ React15.createElement("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
644
|
+
/* @__PURE__ */ React15.createElement("path", { d: "m19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
645
|
+
);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
// src/shadcn/components/icons/PdfIcon.tsx
|
|
649
|
+
import React16 from "react";
|
|
650
|
+
function PdfIcon({
|
|
651
|
+
size = 16,
|
|
652
|
+
className = "",
|
|
653
|
+
color = "secondary"
|
|
654
|
+
}) {
|
|
655
|
+
const colors = {
|
|
656
|
+
primary: "#2F2F2F",
|
|
657
|
+
secondary: "#9B9B9B",
|
|
658
|
+
accent: "#1976D2"
|
|
659
|
+
};
|
|
660
|
+
return /* @__PURE__ */ React16.createElement(
|
|
661
|
+
"svg",
|
|
662
|
+
{
|
|
663
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
664
|
+
width: size,
|
|
665
|
+
height: size,
|
|
666
|
+
viewBox: "0 0 24 24",
|
|
667
|
+
fill: "none",
|
|
668
|
+
stroke: colors[color],
|
|
669
|
+
strokeWidth: "1.5",
|
|
670
|
+
strokeLinecap: "round",
|
|
671
|
+
strokeLinejoin: "round",
|
|
672
|
+
className: `transition-colors duration-200 ${className}`
|
|
673
|
+
},
|
|
674
|
+
/* @__PURE__ */ React16.createElement("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }),
|
|
675
|
+
/* @__PURE__ */ React16.createElement("polyline", { points: "14,2 14,8 20,8" }),
|
|
676
|
+
/* @__PURE__ */ React16.createElement("path", { d: "M10 12h4" }),
|
|
677
|
+
/* @__PURE__ */ React16.createElement("path", { d: "M10 16h2" }),
|
|
678
|
+
/* @__PURE__ */ React16.createElement("path", { d: "M8 12v4" })
|
|
679
|
+
);
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
// src/shadcn/components/icons/JsonIcon.tsx
|
|
683
|
+
import React17 from "react";
|
|
684
|
+
function JsonIcon({
|
|
685
|
+
size = 16,
|
|
686
|
+
className = "",
|
|
687
|
+
color = "secondary"
|
|
688
|
+
}) {
|
|
689
|
+
const colors = {
|
|
690
|
+
primary: "#2F2F2F",
|
|
691
|
+
secondary: "#9B9B9B",
|
|
692
|
+
accent: "#1976D2"
|
|
693
|
+
};
|
|
694
|
+
return /* @__PURE__ */ React17.createElement(
|
|
695
|
+
"svg",
|
|
696
|
+
{
|
|
697
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
698
|
+
width: size,
|
|
699
|
+
height: size,
|
|
700
|
+
viewBox: "0 0 24 24",
|
|
701
|
+
fill: "none",
|
|
702
|
+
stroke: colors[color],
|
|
703
|
+
strokeWidth: "1.5",
|
|
704
|
+
strokeLinecap: "round",
|
|
705
|
+
strokeLinejoin: "round",
|
|
706
|
+
className: `transition-colors duration-200 ${className}`
|
|
707
|
+
},
|
|
708
|
+
/* @__PURE__ */ React17.createElement("path", { d: "M5 12s2.545-5 7-5c4.454 0 7 5 7 5s-2.546 5-7 5c-4.455 0-7-5-7-5z" }),
|
|
709
|
+
/* @__PURE__ */ React17.createElement("path", { d: "M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2z" }),
|
|
710
|
+
/* @__PURE__ */ React17.createElement("path", { d: "M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2" }),
|
|
711
|
+
/* @__PURE__ */ React17.createElement("path", { d: "M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2" })
|
|
712
|
+
);
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
// src/shadcn/components/icons/XmlIcon.tsx
|
|
716
|
+
import React18 from "react";
|
|
717
|
+
function XmlIcon({
|
|
718
|
+
size = 16,
|
|
719
|
+
className = "",
|
|
720
|
+
color = "secondary"
|
|
721
|
+
}) {
|
|
722
|
+
const colors = {
|
|
723
|
+
primary: "#2F2F2F",
|
|
724
|
+
secondary: "#9B9B9B",
|
|
725
|
+
accent: "#1976D2"
|
|
726
|
+
};
|
|
727
|
+
return /* @__PURE__ */ React18.createElement(
|
|
728
|
+
"svg",
|
|
729
|
+
{
|
|
730
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
731
|
+
width: size,
|
|
732
|
+
height: size,
|
|
733
|
+
viewBox: "0 0 24 24",
|
|
734
|
+
fill: "none",
|
|
735
|
+
stroke: colors[color],
|
|
736
|
+
strokeWidth: "1.5",
|
|
737
|
+
strokeLinecap: "round",
|
|
738
|
+
strokeLinejoin: "round",
|
|
739
|
+
className: `transition-colors duration-200 ${className}`
|
|
740
|
+
},
|
|
741
|
+
/* @__PURE__ */ React18.createElement("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }),
|
|
742
|
+
/* @__PURE__ */ React18.createElement("polyline", { points: "14,2 14,8 20,8" }),
|
|
743
|
+
/* @__PURE__ */ React18.createElement("path", { d: "m9 13 2 2-2 2" }),
|
|
744
|
+
/* @__PURE__ */ React18.createElement("path", { d: "m15 13-2 2 2 2" })
|
|
745
|
+
);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
// src/shadcn/components/icons/ArchiveIcon.tsx
|
|
749
|
+
import React19 from "react";
|
|
750
|
+
function ArchiveIcon({
|
|
751
|
+
size = 16,
|
|
752
|
+
className = "",
|
|
753
|
+
color = "secondary"
|
|
754
|
+
}) {
|
|
755
|
+
const colors = {
|
|
756
|
+
primary: "#2F2F2F",
|
|
757
|
+
secondary: "#9B9B9B",
|
|
758
|
+
accent: "#1976D2"
|
|
759
|
+
};
|
|
760
|
+
return /* @__PURE__ */ React19.createElement(
|
|
761
|
+
"svg",
|
|
762
|
+
{
|
|
763
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
764
|
+
width: size,
|
|
765
|
+
height: size,
|
|
766
|
+
viewBox: "0 0 24 24",
|
|
767
|
+
fill: "none",
|
|
768
|
+
stroke: colors[color],
|
|
769
|
+
strokeWidth: "1.5",
|
|
770
|
+
strokeLinecap: "round",
|
|
771
|
+
strokeLinejoin: "round",
|
|
772
|
+
className: `transition-colors duration-200 ${className}`
|
|
773
|
+
},
|
|
774
|
+
/* @__PURE__ */ React19.createElement("rect", { width: "20", height: "5", x: "2", y: "3", rx: "1" }),
|
|
775
|
+
/* @__PURE__ */ React19.createElement("path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8" }),
|
|
776
|
+
/* @__PURE__ */ React19.createElement("path", { d: "M10 12h4" })
|
|
777
|
+
);
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
// src/shadcn/components/icons/DefaultIcon.tsx
|
|
781
|
+
import React20 from "react";
|
|
782
|
+
function DefaultIcon({
|
|
783
|
+
size = 16,
|
|
784
|
+
className = "",
|
|
785
|
+
color = "secondary"
|
|
786
|
+
}) {
|
|
787
|
+
const colors = {
|
|
788
|
+
primary: "#2F2F2F",
|
|
789
|
+
secondary: "#9B9B9B",
|
|
790
|
+
accent: "#1976D2"
|
|
791
|
+
};
|
|
792
|
+
return /* @__PURE__ */ React20.createElement(
|
|
793
|
+
"svg",
|
|
794
|
+
{
|
|
795
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
796
|
+
width: size,
|
|
797
|
+
height: size,
|
|
798
|
+
viewBox: "0 0 24 24",
|
|
799
|
+
fill: "none",
|
|
800
|
+
stroke: colors[color],
|
|
801
|
+
strokeWidth: "1.5",
|
|
802
|
+
strokeLinecap: "round",
|
|
803
|
+
strokeLinejoin: "round",
|
|
804
|
+
className: `transition-colors duration-200 ${className}`
|
|
805
|
+
},
|
|
806
|
+
/* @__PURE__ */ React20.createElement("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }),
|
|
807
|
+
/* @__PURE__ */ React20.createElement("polyline", { points: "14,2 14,8 20,8" })
|
|
808
|
+
);
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
// src/lib/getMediaTypeIcon.tsx
|
|
812
|
+
function getMediaTypeIcon(mediaType, props = {}) {
|
|
813
|
+
const normalizedType = mediaType?.toLowerCase() || "";
|
|
814
|
+
if (normalizedType.startsWith("image/")) {
|
|
815
|
+
return /* @__PURE__ */ React21.createElement(ImageIcon, { ...props });
|
|
816
|
+
}
|
|
817
|
+
if (normalizedType.startsWith("video/")) {
|
|
818
|
+
return /* @__PURE__ */ React21.createElement(VideoIcon, { ...props });
|
|
819
|
+
}
|
|
820
|
+
if (normalizedType.startsWith("audio/")) {
|
|
821
|
+
return /* @__PURE__ */ React21.createElement(AudioIcon, { ...props });
|
|
822
|
+
}
|
|
823
|
+
if (normalizedType.includes("pdf") || normalizedType === "application/pdf") {
|
|
824
|
+
return /* @__PURE__ */ React21.createElement(PdfIcon, { ...props });
|
|
825
|
+
}
|
|
826
|
+
if (normalizedType.includes("json") || normalizedType === "application/json" || normalizedType === "text/json") {
|
|
827
|
+
return /* @__PURE__ */ React21.createElement(JsonIcon, { ...props });
|
|
828
|
+
}
|
|
829
|
+
if (normalizedType.includes("xml") || normalizedType === "application/xml" || normalizedType === "text/xml" || normalizedType === "application/rss+xml" || normalizedType === "application/atom+xml") {
|
|
830
|
+
return /* @__PURE__ */ React21.createElement(XmlIcon, { ...props });
|
|
831
|
+
}
|
|
832
|
+
if (normalizedType.includes("zip") || normalizedType.includes("rar") || normalizedType.includes("tar") || normalizedType.includes("gzip") || normalizedType.includes("7z") || normalizedType === "application/x-compressed" || normalizedType === "application/x-zip-compressed" || normalizedType === "multipart/x-zip") {
|
|
833
|
+
return /* @__PURE__ */ React21.createElement(ArchiveIcon, { ...props });
|
|
834
|
+
}
|
|
835
|
+
if (normalizedType.startsWith("text/") || normalizedType.includes("document") || normalizedType.includes("word") || normalizedType.includes("excel") || normalizedType.includes("powerpoint") || normalizedType.includes("spreadsheet") || normalizedType.includes("presentation")) {
|
|
836
|
+
return /* @__PURE__ */ React21.createElement(DocumentIcon, { ...props });
|
|
837
|
+
}
|
|
838
|
+
return /* @__PURE__ */ React21.createElement(DefaultIcon, { ...props });
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
// src/shadcn/blocks/list/ListItem.tsx
|
|
842
|
+
function ListItem({ item, index = 0 }) {
|
|
843
|
+
const title = typeof item === "string" ? item : item.description || item.title || item.name || `Item ${index + 1}`;
|
|
844
|
+
const mediaType = typeof item === "object" ? item.mediaType || "" : "";
|
|
845
|
+
return /* @__PURE__ */ React22.createElement("div", { className: "group w-full bg-white rounded-lg p-4 border border-gray-100 hover:bg-gray-50 transition-colors duration-150 ease-in-out cursor-pointer" }, /* @__PURE__ */ React22.createElement("div", { className: "flex items-center justify-between space-x-4" }, /* @__PURE__ */ React22.createElement("div", { className: "flex items-center space-x-3 flex-1 min-w-0" }, /* @__PURE__ */ React22.createElement("div", { className: "flex-shrink-0 w-8 h-8 bg-gray-100 rounded-md flex items-center justify-center" }, getMediaTypeIcon(mediaType, {
|
|
846
|
+
size: 16,
|
|
847
|
+
className: "text-gray-500",
|
|
848
|
+
color: "secondary"
|
|
849
|
+
})), /* @__PURE__ */ React22.createElement("span", { className: "font-semibold text-gray-800 truncate flex-1" }, title))));
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
// src/shadcn/blocks/list/ListPreviewTab.tsx
|
|
853
|
+
function ListPreviewTab({ block, domain }) {
|
|
854
|
+
const [items, setItems] = useState3([]);
|
|
855
|
+
const showResources = block.props.showLinkedResources;
|
|
856
|
+
useEffect2(() => {
|
|
857
|
+
if (showResources) {
|
|
858
|
+
setItems(domain.linkedResource);
|
|
859
|
+
}
|
|
860
|
+
}, []);
|
|
861
|
+
return /* @__PURE__ */ React23.createElement("div", { className: "flex flex-col gap-4 mt-[30px]" }, items.map((item) => /* @__PURE__ */ React23.createElement(ListItem, { item })));
|
|
862
|
+
}
|
|
863
|
+
|
|
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
|
+
// src/shadcn/components/SwitchOption.tsx
|
|
925
|
+
import * as React25 from "react";
|
|
926
|
+
|
|
927
|
+
// src/shadcn/components/ui/switch.tsx
|
|
928
|
+
import * as React24 from "react";
|
|
929
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
930
|
+
function Switch({
|
|
931
|
+
className,
|
|
932
|
+
...props
|
|
933
|
+
}) {
|
|
934
|
+
return /* @__PURE__ */ React24.createElement(
|
|
935
|
+
SwitchPrimitive.Root,
|
|
936
|
+
{
|
|
937
|
+
"data-slot": "switch",
|
|
938
|
+
className: cn(
|
|
939
|
+
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
940
|
+
className
|
|
941
|
+
),
|
|
942
|
+
...props
|
|
943
|
+
},
|
|
944
|
+
/* @__PURE__ */ React24.createElement(
|
|
945
|
+
SwitchPrimitive.Thumb,
|
|
946
|
+
{
|
|
947
|
+
"data-slot": "switch-thumb",
|
|
948
|
+
className: cn(
|
|
949
|
+
"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
|
|
950
|
+
)
|
|
951
|
+
}
|
|
952
|
+
)
|
|
953
|
+
);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
// 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
|
+
));
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
// src/shadcn/blocks/list/ListSettingsTab.tsx
|
|
975
|
+
import React26, { useMemo } from "react";
|
|
976
|
+
function ListSettingsTab({
|
|
977
|
+
block,
|
|
978
|
+
editor,
|
|
979
|
+
domain
|
|
980
|
+
}) {
|
|
981
|
+
const linkedResources = {
|
|
982
|
+
count: domain?.linkedResource?.length ?? 0
|
|
983
|
+
};
|
|
984
|
+
const isCollection = useMemo(() => {
|
|
985
|
+
return domain?.type === "asset/collection";
|
|
986
|
+
}, [domain]);
|
|
987
|
+
return /* @__PURE__ */ React26.createElement("div", null, /* @__PURE__ */ React26.createElement(
|
|
988
|
+
SwitchOption,
|
|
989
|
+
{
|
|
990
|
+
label: `Linked Resources ${linkedResources.count}`,
|
|
991
|
+
description: "Resources linked to this list",
|
|
992
|
+
checked: block.props.showLinkedResources,
|
|
993
|
+
onChange: (checked) => {
|
|
994
|
+
editor.updateBlock(block.id, {
|
|
995
|
+
props: {
|
|
996
|
+
showLinkedResources: checked
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
), isCollection && /* @__PURE__ */ React26.createElement(
|
|
1002
|
+
SwitchOption,
|
|
1003
|
+
{
|
|
1004
|
+
label: "Display assets in collection",
|
|
1005
|
+
description: "Display assets in collection",
|
|
1006
|
+
checked: block.props.showAssetsInCollection,
|
|
1007
|
+
onChange: (checked) => {
|
|
1008
|
+
editor.updateBlock(block.id, {
|
|
1009
|
+
props: {
|
|
1010
|
+
showAssetsInCollection: checked
|
|
1011
|
+
}
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
));
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
// src/shadcn/blocks/list/ListSettings.tsx
|
|
1019
|
+
function ListSettings({ block, editor, setList }) {
|
|
1020
|
+
const [domainValue, setDomainValue] = useState4(block.props.did);
|
|
1021
|
+
const [loading, setLoading] = useState4(false);
|
|
1022
|
+
const [domainProfile, setDomainProfile] = useState4(null);
|
|
1023
|
+
const [modalOpen, setModalOpen] = useState4(false);
|
|
1024
|
+
const [domain, setDomain] = useState4(null);
|
|
1025
|
+
useEffect3(() => {
|
|
1026
|
+
if (!domainValue) {
|
|
1027
|
+
setDomainProfile(null);
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
1030
|
+
setLoading(true);
|
|
1031
|
+
setDomainProfile(null);
|
|
1032
|
+
const fetchEntity = async () => {
|
|
1033
|
+
try {
|
|
1034
|
+
const entity = await getEntity(domainValue);
|
|
1035
|
+
setDomain(entity);
|
|
1036
|
+
const profileResource = entity.settings.Profile;
|
|
1037
|
+
if (profileResource?.serviceEndpoint) {
|
|
1038
|
+
const fetchedProfile = await fetch(
|
|
1039
|
+
profileResource.serviceEndpoint
|
|
1040
|
+
).then((res) => res.json());
|
|
1041
|
+
setDomainProfile(fetchedProfile);
|
|
1042
|
+
} else {
|
|
1043
|
+
setDomainProfile(null);
|
|
1044
|
+
}
|
|
1045
|
+
setLoading(false);
|
|
1046
|
+
} catch (err) {
|
|
1047
|
+
setDomainProfile(null);
|
|
1048
|
+
setLoading(false);
|
|
1049
|
+
}
|
|
1050
|
+
};
|
|
1051
|
+
fetchEntity();
|
|
1052
|
+
}, [domainValue]);
|
|
1053
|
+
const handleDidChange = (did) => {
|
|
1054
|
+
setDomainValue(did);
|
|
1055
|
+
};
|
|
1056
|
+
const handleAddToPage = () => {
|
|
1057
|
+
editor.updateBlock(block.id, {
|
|
1058
|
+
props: {
|
|
1059
|
+
did: domainValue
|
|
1060
|
+
}
|
|
1061
|
+
});
|
|
1062
|
+
console.log("Adding to page with DID:", domainValue);
|
|
1063
|
+
if (block.props.showLinkedResources && domain?.linkedResource) {
|
|
1064
|
+
setList(domain.linkedResource);
|
|
1065
|
+
}
|
|
1066
|
+
setModalOpen(false);
|
|
1067
|
+
};
|
|
1068
|
+
return /* @__PURE__ */ React27.createElement(
|
|
1069
|
+
SettingsModal,
|
|
1070
|
+
{
|
|
1071
|
+
onAddToPage: handleAddToPage,
|
|
1072
|
+
loading,
|
|
1073
|
+
open: modalOpen,
|
|
1074
|
+
onOpenChange: setModalOpen,
|
|
1075
|
+
tabs: [
|
|
1076
|
+
{
|
|
1077
|
+
id: "general",
|
|
1078
|
+
label: "General",
|
|
1079
|
+
content: /* @__PURE__ */ React27.createElement(
|
|
1080
|
+
ListGeneralTab,
|
|
1081
|
+
{
|
|
1082
|
+
block,
|
|
1083
|
+
editor,
|
|
1084
|
+
domainValue,
|
|
1085
|
+
onDomainChange: handleDidChange,
|
|
1086
|
+
domainProfile
|
|
1087
|
+
}
|
|
1088
|
+
)
|
|
1089
|
+
},
|
|
1090
|
+
{
|
|
1091
|
+
id: "settings",
|
|
1092
|
+
label: "Settings",
|
|
1093
|
+
content: /* @__PURE__ */ React27.createElement(ListSettingsTab, { block, editor, domain })
|
|
1094
|
+
},
|
|
1095
|
+
{
|
|
1096
|
+
id: "preview",
|
|
1097
|
+
label: "Preview",
|
|
1098
|
+
content: /* @__PURE__ */ React27.createElement(ListPreviewTab, { block, domain })
|
|
1099
|
+
}
|
|
1100
|
+
]
|
|
1101
|
+
}
|
|
1102
|
+
);
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
// src/shadcn/blocks/list/ListBlockToolbar.tsx
|
|
1106
|
+
function ListBlockToolbar({
|
|
1107
|
+
block,
|
|
1108
|
+
editor,
|
|
1109
|
+
setList
|
|
1110
|
+
}) {
|
|
1111
|
+
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
|
+
Input,
|
|
1113
|
+
{
|
|
1114
|
+
value: block.props.title,
|
|
1115
|
+
placeholder: "New list",
|
|
1116
|
+
className: "font-semibold flex-1 border-0 bg-transparent px-2 py-1 focus-visible:ring-0 focus-visible:ring-offset-0 hover:bg-gray-50 dark:hover:bg-gray-700 focus:bg-gray-50 dark:focus:bg-gray-700 notion-list-title-input",
|
|
1117
|
+
style: {
|
|
1118
|
+
color: "#2F2F2F",
|
|
1119
|
+
fontFamily: "Inter, Helvetica, Arial, sans-serif",
|
|
1120
|
+
fontSize: "14px",
|
|
1121
|
+
fontWeight: 600
|
|
1122
|
+
},
|
|
1123
|
+
onChange: (e) => {
|
|
1124
|
+
editor.updateBlock(block, {
|
|
1125
|
+
props: {
|
|
1126
|
+
...block.props,
|
|
1127
|
+
title: e.target.value
|
|
1128
|
+
}
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
), /* @__PURE__ */ React28.createElement(ListSettings, { block, editor, setList }));
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
// src/shadcn/blocks/list/useList.tsx
|
|
1136
|
+
import { useState as useState5 } from "react";
|
|
1137
|
+
function useList() {
|
|
1138
|
+
const [list, setList] = useState5([]);
|
|
1139
|
+
return {
|
|
1140
|
+
list,
|
|
1141
|
+
setList
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
// src/shadcn/blocks/list/ListContainer.tsx
|
|
1146
|
+
import React29 from "react";
|
|
1147
|
+
function ListContainer({
|
|
1148
|
+
children
|
|
1149
|
+
}) {
|
|
1150
|
+
return /* @__PURE__ */ React29.createElement("div", { className: "flex flex-col gap-2" }, children);
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
// src/shadcn/blocks/list/ListBlock.tsx
|
|
1154
|
+
var ListBlockContent = ({ block, editor }) => {
|
|
1155
|
+
const { list, setList } = useList();
|
|
1156
|
+
return /* @__PURE__ */ React30.createElement(
|
|
1157
|
+
"div",
|
|
1158
|
+
{
|
|
1159
|
+
style: {
|
|
1160
|
+
width: "100%",
|
|
1161
|
+
borderRadius: "6px",
|
|
1162
|
+
padding: "16px",
|
|
1163
|
+
backgroundColor: "#FFFFFF",
|
|
1164
|
+
fontFamily: "Inter, Helvetica, Arial, sans-serif"
|
|
1165
|
+
}
|
|
1166
|
+
},
|
|
1167
|
+
/* @__PURE__ */ React30.createElement(ListBlockToolbar, { block, editor, setList }),
|
|
1168
|
+
/* @__PURE__ */ React30.createElement("div", { style: { minHeight: "40px" } }, /* @__PURE__ */ React30.createElement(ListContainer, null, list?.map((item, index) => /* @__PURE__ */ React30.createElement(ListItem, { key: index, item, index }))))
|
|
1169
|
+
);
|
|
1170
|
+
};
|
|
1171
|
+
var ListBlock = createReactBlockSpec(
|
|
1172
|
+
{
|
|
1173
|
+
type: "list",
|
|
1174
|
+
propSchema: {
|
|
1175
|
+
title: {
|
|
1176
|
+
default: ""
|
|
1177
|
+
},
|
|
1178
|
+
did: {
|
|
1179
|
+
default: ""
|
|
1180
|
+
},
|
|
1181
|
+
fragmentIdentifier: {
|
|
1182
|
+
default: ""
|
|
1183
|
+
},
|
|
1184
|
+
listItemType: {
|
|
1185
|
+
default: "keyvalue"
|
|
1186
|
+
},
|
|
1187
|
+
showLinkedResources: {
|
|
1188
|
+
default: false
|
|
1189
|
+
},
|
|
1190
|
+
showAssetsInCollection: {
|
|
1191
|
+
default: false
|
|
1192
|
+
}
|
|
1193
|
+
},
|
|
1194
|
+
content: "none"
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
render: ListBlockContent
|
|
1198
|
+
}
|
|
1199
|
+
);
|
|
1200
|
+
|
|
1201
|
+
// src/shadcn/blocks/overview/OverviewBlock.tsx
|
|
1202
|
+
import React36 from "react";
|
|
1203
|
+
import {
|
|
1204
|
+
createReactBlockSpec as createReactBlockSpec2
|
|
1205
|
+
} from "@blocknote/react";
|
|
1206
|
+
|
|
1207
|
+
// src/shadcn/blocks/overview/OverviewBlockToolbar.tsx
|
|
1208
|
+
import React35 from "react";
|
|
1209
|
+
|
|
1210
|
+
// src/shadcn/components/GlobeIcon.tsx
|
|
1211
|
+
import React31 from "react";
|
|
1212
|
+
function GlobeIcon({
|
|
1213
|
+
size = 16,
|
|
1214
|
+
className = "",
|
|
1215
|
+
color = "secondary"
|
|
1216
|
+
}) {
|
|
1217
|
+
const colors = {
|
|
1218
|
+
primary: "#2F2F2F",
|
|
1219
|
+
secondary: "#9B9B9B",
|
|
1220
|
+
accent: "#1976D2"
|
|
1221
|
+
};
|
|
1222
|
+
return /* @__PURE__ */ React31.createElement(
|
|
1223
|
+
"svg",
|
|
1224
|
+
{
|
|
1225
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1226
|
+
width: size,
|
|
1227
|
+
height: size,
|
|
1228
|
+
viewBox: "0 0 24 24",
|
|
1229
|
+
fill: "none",
|
|
1230
|
+
stroke: colors[color],
|
|
1231
|
+
strokeWidth: "1.5",
|
|
1232
|
+
strokeLinecap: "round",
|
|
1233
|
+
strokeLinejoin: "round",
|
|
1234
|
+
className: `transition-colors duration-200 hover:stroke-[#1976D2] ${className}`,
|
|
1235
|
+
style: {
|
|
1236
|
+
cursor: "pointer"
|
|
1237
|
+
}
|
|
1238
|
+
},
|
|
1239
|
+
/* @__PURE__ */ React31.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1240
|
+
/* @__PURE__ */ React31.createElement("path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" }),
|
|
1241
|
+
/* @__PURE__ */ React31.createElement("path", { d: "M2 12h20" })
|
|
1242
|
+
);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
// src/shadcn/blocks/overview/OverviewSettings.tsx
|
|
1246
|
+
import React34, { useState as useState7, useEffect as useEffect5 } from "react";
|
|
1247
|
+
|
|
1248
|
+
// src/shadcn/blocks/overview/OverviewGeneralTab.tsx
|
|
1249
|
+
import React32, { useState as useState6, useEffect as useEffect4 } from "react";
|
|
1250
|
+
import { CheckIcon as CheckIcon3 } from "lucide-react";
|
|
1251
|
+
function OverviewGeneralTab({
|
|
1252
|
+
block: _block,
|
|
1253
|
+
editor: _editor,
|
|
1254
|
+
domainValue,
|
|
1255
|
+
onDomainChange,
|
|
1256
|
+
domainProfile
|
|
1257
|
+
}) {
|
|
1258
|
+
const [domainType, setDomainType] = useState6("this-domain");
|
|
1259
|
+
const [isValidDomain, setIsValidDomain] = useState6(true);
|
|
1260
|
+
const [isLoading, setIsLoading] = useState6(false);
|
|
1261
|
+
const [customDomainValue, setCustomDomainValue] = useState6("");
|
|
1262
|
+
const thisDomainValue = "did:ixo:entity:example123";
|
|
1263
|
+
useEffect4(() => {
|
|
1264
|
+
if (domainValue) {
|
|
1265
|
+
if (domainValue === thisDomainValue) {
|
|
1266
|
+
setDomainType("this-domain");
|
|
1267
|
+
setIsValidDomain(true);
|
|
1268
|
+
} else {
|
|
1269
|
+
setDomainType("custom-domain");
|
|
1270
|
+
setCustomDomainValue(domainValue);
|
|
1271
|
+
setIsValidDomain(true);
|
|
1272
|
+
}
|
|
1273
|
+
} else {
|
|
1274
|
+
setDomainType("this-domain");
|
|
1275
|
+
setCustomDomainValue("");
|
|
1276
|
+
setIsValidDomain(true);
|
|
1277
|
+
}
|
|
1278
|
+
}, [domainValue, thisDomainValue]);
|
|
1279
|
+
const handleCustomDomainChange = async (did) => {
|
|
1280
|
+
setCustomDomainValue(did);
|
|
1281
|
+
if (!did) {
|
|
1282
|
+
setIsValidDomain(false);
|
|
1283
|
+
return;
|
|
1284
|
+
}
|
|
1285
|
+
const isValid = did.startsWith("did:") && did.length > 10;
|
|
1286
|
+
if (isValid) {
|
|
1287
|
+
setIsLoading(true);
|
|
1288
|
+
try {
|
|
1289
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
1290
|
+
setIsValidDomain(true);
|
|
1291
|
+
onDomainChange(did);
|
|
1292
|
+
} catch (error) {
|
|
1293
|
+
setIsValidDomain(false);
|
|
1294
|
+
} finally {
|
|
1295
|
+
setIsLoading(false);
|
|
1296
|
+
}
|
|
1297
|
+
} else {
|
|
1298
|
+
setIsValidDomain(false);
|
|
1299
|
+
}
|
|
1300
|
+
};
|
|
1301
|
+
const handleTabChange = (value) => {
|
|
1302
|
+
setDomainType(value);
|
|
1303
|
+
if (value === "this-domain") {
|
|
1304
|
+
setIsValidDomain(true);
|
|
1305
|
+
onDomainChange(thisDomainValue);
|
|
1306
|
+
} else {
|
|
1307
|
+
setIsValidDomain(false);
|
|
1308
|
+
onDomainChange("");
|
|
1309
|
+
}
|
|
1310
|
+
};
|
|
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,
|
|
1313
|
+
{
|
|
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
|
+
));
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
// src/shadcn/blocks/overview/OverviewPreviewTab.tsx
|
|
1344
|
+
import React33 from "react";
|
|
1345
|
+
import { BlockNoteView } from "@blocknote/shadcn";
|
|
1346
|
+
import { useCreateBlockNote } from "@blocknote/react";
|
|
1347
|
+
function OverviewPreviewTab({
|
|
1348
|
+
blocks,
|
|
1349
|
+
loading = false,
|
|
1350
|
+
error = null
|
|
1351
|
+
}) {
|
|
1352
|
+
const editor = useCreateBlockNote({
|
|
1353
|
+
...blocks ? { initialContent: blocks } : {}
|
|
1354
|
+
});
|
|
1355
|
+
console.log({ blocks });
|
|
1356
|
+
if (loading) {
|
|
1357
|
+
return /* @__PURE__ */ React33.createElement("div", { className: "flex items-center justify-center p-8" }, /* @__PURE__ */ React33.createElement("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900" }));
|
|
1358
|
+
}
|
|
1359
|
+
if (error) {
|
|
1360
|
+
return /* @__PURE__ */ React33.createElement("div", { className: "flex items-center justify-center p-8 text-red-500" }, /* @__PURE__ */ React33.createElement("p", null, "Error loading preview: ", error));
|
|
1361
|
+
}
|
|
1362
|
+
if (blocks === null) {
|
|
1363
|
+
return /* @__PURE__ */ React33.createElement("div", { className: "flex items-center justify-center p-8 text-gray-500" }, /* @__PURE__ */ React33.createElement("p", null, "No content available"));
|
|
1364
|
+
}
|
|
1365
|
+
return /* @__PURE__ */ React33.createElement(BlockNoteView, { editor, editable: false });
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
// src/shadcn/blocks/overview/OverviewSettings.tsx
|
|
1369
|
+
function OverviewSettings({ block, editor }) {
|
|
1370
|
+
const [domainValue, setDomainValue] = useState7(block.props.did);
|
|
1371
|
+
const [pageBlocks, setPageBlocks] = useState7(
|
|
1372
|
+
block.props.blocks || null
|
|
1373
|
+
);
|
|
1374
|
+
const [loading, setLoading] = useState7(false);
|
|
1375
|
+
const [error, setError] = useState7(null);
|
|
1376
|
+
const [domainProfile, setDomainProfile] = useState7(null);
|
|
1377
|
+
const [modalOpen, setModalOpen] = useState7(false);
|
|
1378
|
+
useEffect5(() => {
|
|
1379
|
+
if (!domainValue) {
|
|
1380
|
+
setPageBlocks(block.props.blocks || null);
|
|
1381
|
+
return;
|
|
1382
|
+
}
|
|
1383
|
+
setLoading(true);
|
|
1384
|
+
setError(null);
|
|
1385
|
+
const fetchPageBlocks = async () => {
|
|
1386
|
+
try {
|
|
1387
|
+
const entity = await getEntity(domainValue);
|
|
1388
|
+
const overviewResource = entity.settings.Page;
|
|
1389
|
+
const profileResource = entity.settings.Profile;
|
|
1390
|
+
if (overviewResource?.serviceEndpoint) {
|
|
1391
|
+
const fetchedPageBlocks = await fetch(
|
|
1392
|
+
overviewResource.serviceEndpoint
|
|
1393
|
+
).then((res) => res.json());
|
|
1394
|
+
console.log({ fetchedPageBlocks });
|
|
1395
|
+
setPageBlocks(fetchedPageBlocks.blocks || block.props.blocks || null);
|
|
1396
|
+
} else {
|
|
1397
|
+
setPageBlocks(block.props.blocks || null);
|
|
1398
|
+
}
|
|
1399
|
+
if (profileResource?.serviceEndpoint) {
|
|
1400
|
+
const fetchedProfile = await fetch(
|
|
1401
|
+
profileResource.serviceEndpoint
|
|
1402
|
+
).then((res) => res.json());
|
|
1403
|
+
setDomainProfile(fetchedProfile);
|
|
1404
|
+
}
|
|
1405
|
+
setLoading(false);
|
|
1406
|
+
} catch (err) {
|
|
1407
|
+
setError(
|
|
1408
|
+
err instanceof Error ? err.message : "Failed to fetch page blocks"
|
|
1409
|
+
);
|
|
1410
|
+
setPageBlocks(block.props.blocks || null);
|
|
1411
|
+
setLoading(false);
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1414
|
+
fetchPageBlocks();
|
|
1415
|
+
}, [domainValue, block.props.blocks]);
|
|
1416
|
+
const handleDidChange = (did) => {
|
|
1417
|
+
setDomainValue(did);
|
|
1418
|
+
};
|
|
1419
|
+
const handleAddToPage = () => {
|
|
1420
|
+
editor.updateBlock(block.id, {
|
|
1421
|
+
props: {
|
|
1422
|
+
did: domainValue
|
|
1423
|
+
},
|
|
1424
|
+
children: pageBlocks
|
|
1425
|
+
});
|
|
1426
|
+
console.log("Adding to page with DID:", domainValue);
|
|
1427
|
+
setModalOpen(false);
|
|
1428
|
+
};
|
|
1429
|
+
return /* @__PURE__ */ React34.createElement(
|
|
1430
|
+
SettingsModal,
|
|
1431
|
+
{
|
|
1432
|
+
onAddToPage: handleAddToPage,
|
|
1433
|
+
loading,
|
|
1434
|
+
open: modalOpen,
|
|
1435
|
+
onOpenChange: setModalOpen,
|
|
1436
|
+
tabs: [
|
|
1437
|
+
{
|
|
1438
|
+
id: "general",
|
|
1439
|
+
label: "General",
|
|
1440
|
+
content: /* @__PURE__ */ React34.createElement(
|
|
1441
|
+
OverviewGeneralTab,
|
|
1442
|
+
{
|
|
1443
|
+
block,
|
|
1444
|
+
editor,
|
|
1445
|
+
domainValue,
|
|
1446
|
+
onDomainChange: handleDidChange,
|
|
1447
|
+
domainProfile
|
|
1448
|
+
}
|
|
1449
|
+
)
|
|
1450
|
+
},
|
|
1451
|
+
{
|
|
1452
|
+
id: "preview",
|
|
1453
|
+
label: "Preview",
|
|
1454
|
+
content: /* @__PURE__ */ React34.createElement(
|
|
1455
|
+
OverviewPreviewTab,
|
|
1456
|
+
{
|
|
1457
|
+
blocks: pageBlocks ?? null,
|
|
1458
|
+
loading,
|
|
1459
|
+
error
|
|
1460
|
+
}
|
|
1461
|
+
)
|
|
1462
|
+
}
|
|
1463
|
+
]
|
|
1464
|
+
}
|
|
1465
|
+
);
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
// src/shadcn/blocks/overview/OverviewBlockToolbar.tsx
|
|
1469
|
+
function OverviewBlockToolbar({
|
|
1470
|
+
block,
|
|
1471
|
+
editor
|
|
1472
|
+
}) {
|
|
1473
|
+
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
|
+
}
|
|
1475
|
+
|
|
1476
|
+
// src/shadcn/blocks/overview/OverviewBlock.tsx
|
|
1477
|
+
var OverviewBlockContent = ({
|
|
1478
|
+
block,
|
|
1479
|
+
editor,
|
|
1480
|
+
contentRef
|
|
1481
|
+
}) => {
|
|
1482
|
+
return /* @__PURE__ */ React36.createElement(
|
|
1483
|
+
"div",
|
|
1484
|
+
{
|
|
1485
|
+
style: {
|
|
1486
|
+
width: "100%",
|
|
1487
|
+
backgroundColor: "#FFFFFF",
|
|
1488
|
+
borderRadius: "8px"
|
|
1489
|
+
}
|
|
1490
|
+
},
|
|
1491
|
+
/* @__PURE__ */ React36.createElement(OverviewBlockToolbar, { block, editor }),
|
|
1492
|
+
/* @__PURE__ */ React36.createElement("div", { ref: contentRef })
|
|
1493
|
+
);
|
|
1494
|
+
};
|
|
1495
|
+
var OverviewBlock = createReactBlockSpec2(
|
|
1496
|
+
{
|
|
1497
|
+
type: "overview",
|
|
1498
|
+
propSchema: {
|
|
1499
|
+
did: { default: "" }
|
|
1500
|
+
},
|
|
1501
|
+
content: "inline"
|
|
1502
|
+
// <– KEY: makes this block host nested editable content
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
render: OverviewBlockContent
|
|
1506
|
+
}
|
|
1507
|
+
);
|
|
1508
|
+
|
|
1509
|
+
// src/shadcn/blocks/index.ts
|
|
1510
|
+
var blockSpecs = {
|
|
1511
|
+
list: ListBlock,
|
|
1512
|
+
overview: OverviewBlock
|
|
1513
|
+
};
|
|
1514
|
+
var getExtraSlashMenuItems = (editor) => [
|
|
1515
|
+
{
|
|
1516
|
+
title: "List",
|
|
1517
|
+
onItemClick: () => {
|
|
1518
|
+
editor.insertBlocks(
|
|
1519
|
+
[
|
|
1520
|
+
{
|
|
1521
|
+
type: "list",
|
|
1522
|
+
props: {
|
|
1523
|
+
title: "",
|
|
1524
|
+
did: "",
|
|
1525
|
+
fragmentIdentifier: ""
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
],
|
|
1529
|
+
editor.getTextCursorPosition().block,
|
|
1530
|
+
"after"
|
|
1531
|
+
);
|
|
1532
|
+
},
|
|
1533
|
+
aliases: ["list", "data", "dynamic"],
|
|
1534
|
+
group: "Domains",
|
|
1535
|
+
subtext: "Create a dynamic list from DID data"
|
|
1536
|
+
},
|
|
1537
|
+
{
|
|
1538
|
+
title: "Overview",
|
|
1539
|
+
onItemClick: () => {
|
|
1540
|
+
editor.insertBlocks(
|
|
1541
|
+
[
|
|
1542
|
+
{
|
|
1543
|
+
type: "overview",
|
|
1544
|
+
props: {
|
|
1545
|
+
did: ""
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
],
|
|
1549
|
+
editor.getTextCursorPosition().block,
|
|
1550
|
+
"after"
|
|
1551
|
+
);
|
|
1552
|
+
},
|
|
1553
|
+
aliases: ["overview", "overview-block", "data-overview"],
|
|
1554
|
+
group: "Domains",
|
|
1555
|
+
subtext: "Create an overview from DID data"
|
|
1556
|
+
}
|
|
1557
|
+
];
|
|
1558
|
+
|
|
1559
|
+
// src/shadcn/hooks/useCreateIxoEditor.ts
|
|
1560
|
+
import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
1561
|
+
import { BlockNoteSchema, defaultBlockSpecs, defaultInlineContentSpecs, defaultStyleSpecs } from "@blocknote/core";
|
|
1562
|
+
function useCreateIxoEditor(options) {
|
|
1563
|
+
const {
|
|
1564
|
+
theme = "light",
|
|
1565
|
+
uploadFile,
|
|
1566
|
+
initialContent,
|
|
1567
|
+
editable = true,
|
|
1568
|
+
sideMenu = true,
|
|
1569
|
+
slashMenu = true,
|
|
1570
|
+
formattingToolbar = true,
|
|
1571
|
+
linkToolbar = true,
|
|
1572
|
+
filePanel = true,
|
|
1573
|
+
tableHandles = true
|
|
1574
|
+
} = options || {};
|
|
1575
|
+
const defaultUploadFile = uploadFile || (async (file) => {
|
|
1576
|
+
return new Promise((resolve, reject) => {
|
|
1577
|
+
const reader = new FileReader();
|
|
1578
|
+
reader.onloadend = () => {
|
|
1579
|
+
const dataUrl = reader.result;
|
|
1580
|
+
resolve(dataUrl);
|
|
1581
|
+
};
|
|
1582
|
+
reader.onerror = reject;
|
|
1583
|
+
reader.readAsDataURL(file);
|
|
1584
|
+
});
|
|
1585
|
+
});
|
|
1586
|
+
const schema = BlockNoteSchema.create({
|
|
1587
|
+
blockSpecs: {
|
|
1588
|
+
...defaultBlockSpecs,
|
|
1589
|
+
...blockSpecs
|
|
1590
|
+
},
|
|
1591
|
+
inlineContentSpecs: {
|
|
1592
|
+
...defaultInlineContentSpecs
|
|
1593
|
+
},
|
|
1594
|
+
styleSpecs: {
|
|
1595
|
+
...defaultStyleSpecs
|
|
1596
|
+
}
|
|
1597
|
+
});
|
|
1598
|
+
const editor = useCreateBlockNote2({
|
|
1599
|
+
schema,
|
|
1600
|
+
initialContent,
|
|
1601
|
+
uploadFile: defaultUploadFile
|
|
1602
|
+
});
|
|
1603
|
+
if (editor) {
|
|
1604
|
+
editor._ixoConfig = {
|
|
1605
|
+
theme,
|
|
1606
|
+
editable,
|
|
1607
|
+
sideMenu,
|
|
1608
|
+
slashMenu,
|
|
1609
|
+
formattingToolbar,
|
|
1610
|
+
linkToolbar,
|
|
1611
|
+
filePanel,
|
|
1612
|
+
tableHandles
|
|
1613
|
+
};
|
|
1614
|
+
}
|
|
1615
|
+
return editor;
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
// src/shadcn/hooks/useCollaborativeIxoEditor.ts
|
|
1619
|
+
import { useCreateBlockNote as useCreateBlockNote3 } from "@blocknote/react";
|
|
1620
|
+
import {
|
|
1621
|
+
BlockNoteSchema as BlockNoteSchema2,
|
|
1622
|
+
defaultBlockSpecs as defaultBlockSpecs2,
|
|
1623
|
+
defaultInlineContentSpecs as defaultInlineContentSpecs2,
|
|
1624
|
+
defaultStyleSpecs as defaultStyleSpecs2
|
|
1625
|
+
} from "@blocknote/core";
|
|
1626
|
+
import * as Y from "yjs";
|
|
1627
|
+
import { useMemo as useMemo2 } from "react";
|
|
1628
|
+
function useCreateCollaborativeIxoEditor(options) {
|
|
1629
|
+
const yDoc = useMemo2(() => new Y.Doc(), []);
|
|
1630
|
+
const {
|
|
1631
|
+
theme = "light",
|
|
1632
|
+
uploadFile,
|
|
1633
|
+
initialContent,
|
|
1634
|
+
editable = true,
|
|
1635
|
+
sideMenu = true,
|
|
1636
|
+
slashMenu = true,
|
|
1637
|
+
formattingToolbar = true,
|
|
1638
|
+
linkToolbar = true,
|
|
1639
|
+
filePanel = true,
|
|
1640
|
+
tableHandles = true,
|
|
1641
|
+
user,
|
|
1642
|
+
matrixClient
|
|
1643
|
+
} = 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]);
|
|
1650
|
+
const { matrixProvider, connectionStatus } = useMatrixProvider({
|
|
1651
|
+
yDoc,
|
|
1652
|
+
matrixClient,
|
|
1653
|
+
roomId: options.roomId
|
|
1654
|
+
});
|
|
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]);
|
|
1696
|
+
const editor = useCreateBlockNote3({
|
|
1697
|
+
schema,
|
|
1698
|
+
initialContent,
|
|
1699
|
+
uploadFile: defaultUploadFile,
|
|
1700
|
+
collaboration: collaborationConfig
|
|
1701
|
+
});
|
|
1702
|
+
if (editor) {
|
|
1703
|
+
editor._ixoConfig = ixoConfig;
|
|
1704
|
+
}
|
|
1705
|
+
return { editor, connectionStatus };
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
// src/shadcn/IxoEditor.tsx
|
|
1709
|
+
import React37 from "react";
|
|
1710
|
+
import {
|
|
1711
|
+
getDefaultReactSlashMenuItems,
|
|
1712
|
+
SuggestionMenuController
|
|
1713
|
+
} from "@blocknote/react";
|
|
1714
|
+
import { BlockNoteView as BlockNoteView2 } from "@blocknote/shadcn";
|
|
1715
|
+
import { filterSuggestionItems } from "@blocknote/core";
|
|
1716
|
+
function IxoEditor({
|
|
1717
|
+
editor,
|
|
1718
|
+
className = "",
|
|
1719
|
+
onChange,
|
|
1720
|
+
onSelectionChange,
|
|
1721
|
+
children
|
|
1722
|
+
}) {
|
|
1723
|
+
if (!editor) {
|
|
1724
|
+
return null;
|
|
1725
|
+
}
|
|
1726
|
+
const config = editor._ixoConfig || {
|
|
1727
|
+
theme: "light",
|
|
1728
|
+
editable: true,
|
|
1729
|
+
sideMenu: true,
|
|
1730
|
+
slashMenu: true,
|
|
1731
|
+
formattingToolbar: true,
|
|
1732
|
+
linkToolbar: true,
|
|
1733
|
+
filePanel: true,
|
|
1734
|
+
tableHandles: true
|
|
1735
|
+
};
|
|
1736
|
+
return /* @__PURE__ */ React37.createElement(
|
|
1737
|
+
"div",
|
|
1738
|
+
{
|
|
1739
|
+
className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`
|
|
1740
|
+
},
|
|
1741
|
+
/* @__PURE__ */ React37.createElement(
|
|
1742
|
+
BlockNoteView2,
|
|
1743
|
+
{
|
|
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
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
),
|
|
1770
|
+
children
|
|
1771
|
+
)
|
|
1772
|
+
);
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
export {
|
|
1776
|
+
ListBlock,
|
|
1777
|
+
OverviewBlock,
|
|
1778
|
+
blockSpecs,
|
|
1779
|
+
getExtraSlashMenuItems,
|
|
1780
|
+
useCreateIxoEditor,
|
|
1781
|
+
useCreateCollaborativeIxoEditor,
|
|
1782
|
+
IxoEditor
|
|
1783
|
+
};
|
|
1784
|
+
//# sourceMappingURL=chunk-57TP5N42.mjs.map
|