@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
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.OverviewSettings = OverviewSettings;
|
|
40
|
-
const react_1 = __importStar(require("react"));
|
|
41
|
-
const SettingsModal_1 = require("../../components/SettingsModal/SettingsModal");
|
|
42
|
-
const OverviewGeneralTab_1 = require("./OverviewGeneralTab");
|
|
43
|
-
const OverviewPreviewTab_1 = __importDefault(require("./OverviewPreviewTab"));
|
|
44
|
-
const graphql_queries_1 = require("../../lib/graphql-queries");
|
|
45
|
-
function OverviewSettings({ block, editor }) {
|
|
46
|
-
const [domainValue, setDomainValue] = (0, react_1.useState)(block.props.did);
|
|
47
|
-
const [pageBlocks, setPageBlocks] = (0, react_1.useState)(block.props.blocks || null);
|
|
48
|
-
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
49
|
-
const [error, setError] = (0, react_1.useState)(null);
|
|
50
|
-
const [domainProfile, setDomainProfile] = (0, react_1.useState)(null);
|
|
51
|
-
const [modalOpen, setModalOpen] = (0, react_1.useState)(false);
|
|
52
|
-
(0, react_1.useEffect)(() => {
|
|
53
|
-
if (!domainValue) {
|
|
54
|
-
setPageBlocks(block.props.blocks || null);
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
setLoading(true);
|
|
58
|
-
setError(null);
|
|
59
|
-
const fetchPageBlocks = async () => {
|
|
60
|
-
try {
|
|
61
|
-
const entity = await (0, graphql_queries_1.getEntity)(domainValue);
|
|
62
|
-
// Get the Page setting like in useOverview.tsx
|
|
63
|
-
const overviewResource = entity.settings.Page;
|
|
64
|
-
const profileResource = entity.settings.Profile;
|
|
65
|
-
if (overviewResource?.serviceEndpoint) {
|
|
66
|
-
const fetchedPageBlocks = await fetch(overviewResource.serviceEndpoint).then((res) => res.json());
|
|
67
|
-
console.log({ fetchedPageBlocks });
|
|
68
|
-
setPageBlocks(fetchedPageBlocks.blocks || block.props.blocks || null);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
setPageBlocks(block.props.blocks || null);
|
|
72
|
-
}
|
|
73
|
-
if (profileResource?.serviceEndpoint) {
|
|
74
|
-
const fetchedProfile = await fetch(profileResource.serviceEndpoint).then((res) => res.json());
|
|
75
|
-
setDomainProfile(fetchedProfile);
|
|
76
|
-
}
|
|
77
|
-
setLoading(false);
|
|
78
|
-
}
|
|
79
|
-
catch (err) {
|
|
80
|
-
setError(err instanceof Error ? err.message : "Failed to fetch page blocks");
|
|
81
|
-
setPageBlocks(block.props.blocks || null);
|
|
82
|
-
setLoading(false);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
fetchPageBlocks();
|
|
86
|
-
}, [domainValue, block.props.blocks]);
|
|
87
|
-
const handleDidChange = (did) => {
|
|
88
|
-
setDomainValue(did);
|
|
89
|
-
};
|
|
90
|
-
const handleAddToPage = () => {
|
|
91
|
-
// Handle add to page logic here
|
|
92
|
-
editor.updateBlock(block.id, {
|
|
93
|
-
props: {
|
|
94
|
-
did: domainValue,
|
|
95
|
-
},
|
|
96
|
-
children: pageBlocks,
|
|
97
|
-
});
|
|
98
|
-
console.log("Adding to page with DID:", domainValue);
|
|
99
|
-
// Close the modal after updating blocks
|
|
100
|
-
setModalOpen(false);
|
|
101
|
-
};
|
|
102
|
-
return (react_1.default.createElement(SettingsModal_1.SettingsModal, { onAddToPage: handleAddToPage, loading: loading, open: modalOpen, onOpenChange: setModalOpen, tabs: [
|
|
103
|
-
{
|
|
104
|
-
id: "general",
|
|
105
|
-
label: "General",
|
|
106
|
-
content: (react_1.default.createElement(OverviewGeneralTab_1.OverviewGeneralTab, { block: block, editor: editor, domainValue: domainValue, onDomainChange: handleDidChange, domainProfile: domainProfile })),
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
id: "preview",
|
|
110
|
-
label: "Preview",
|
|
111
|
-
content: (react_1.default.createElement(OverviewPreviewTab_1.default, { blocks: pageBlocks ?? null, loading: loading, error: error })),
|
|
112
|
-
},
|
|
113
|
-
] }));
|
|
114
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/blocks/overview/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OverviewBlock = void 0;
|
|
4
|
-
var OverviewBlock_1 = require("./OverviewBlock");
|
|
5
|
-
Object.defineProperty(exports, "OverviewBlock", { enumerable: true, get: function () { return OverviewBlock_1.OverviewBlock; } });
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface UseOverviewProps {
|
|
2
|
-
did: string;
|
|
3
|
-
}
|
|
4
|
-
export default function useOverview({ did }: UseOverviewProps): {
|
|
5
|
-
resource: any;
|
|
6
|
-
loading: boolean;
|
|
7
|
-
error: string | null;
|
|
8
|
-
refetch: () => void;
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=useOverview.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useOverview.d.ts","sourceRoot":"","sources":["../../../src/blocks/overview/useOverview.tsx"],"names":[],"mappings":"AAGA,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,GAAG,EAAE,EAAE,gBAAgB;;;;;EAwE5D"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = useOverview;
|
|
4
|
-
const graphql_queries_1 = require("../../lib/graphql-queries");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
function useOverview({ did }) {
|
|
7
|
-
const [resource, setResource] = (0, react_1.useState)(null);
|
|
8
|
-
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
9
|
-
const [error, setError] = (0, react_1.useState)(null);
|
|
10
|
-
(0, react_1.useEffect)(() => {
|
|
11
|
-
if (!did) {
|
|
12
|
-
setResource(null);
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
setLoading(true);
|
|
16
|
-
setError(null);
|
|
17
|
-
const fetchEntity = async () => {
|
|
18
|
-
try {
|
|
19
|
-
const entity = await (0, graphql_queries_1.getEntity)(did);
|
|
20
|
-
console.log({ entity });
|
|
21
|
-
// Find the resource with id = {id}#pag from linkedResource array
|
|
22
|
-
const overviewResource = entity.settings.Page;
|
|
23
|
-
const pageBlocks = await fetch(overviewResource.serviceEndpoint).then((res) => res.json());
|
|
24
|
-
setResource(pageBlocks || null);
|
|
25
|
-
setLoading(false);
|
|
26
|
-
}
|
|
27
|
-
catch (err) {
|
|
28
|
-
setError(err instanceof Error ? err.message : "Failed to fetch entity");
|
|
29
|
-
setLoading(false);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
fetchEntity();
|
|
33
|
-
}, [did]);
|
|
34
|
-
const refetch = () => {
|
|
35
|
-
if (did) {
|
|
36
|
-
setLoading(true);
|
|
37
|
-
setError(null);
|
|
38
|
-
const fetchEntity = async () => {
|
|
39
|
-
try {
|
|
40
|
-
const entity = await (0, graphql_queries_1.getEntity)(did);
|
|
41
|
-
console.log({ entity });
|
|
42
|
-
// Find the resource with id = {id}#pag from linkedResource array
|
|
43
|
-
const overviewResource = entity.linkedResource?.find((resource) => resource.id === `{id}#pag`);
|
|
44
|
-
setResource(overviewResource || null);
|
|
45
|
-
setLoading(false);
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
setError(err instanceof Error ? err.message : "Failed to fetch entity");
|
|
49
|
-
setLoading(false);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
fetchEntity();
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
return {
|
|
56
|
-
resource,
|
|
57
|
-
loading,
|
|
58
|
-
error,
|
|
59
|
-
refetch,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface GlobeIconProps {
|
|
3
|
-
size?: number;
|
|
4
|
-
className?: string;
|
|
5
|
-
color?: "primary" | "secondary" | "accent";
|
|
6
|
-
}
|
|
7
|
-
export default function GlobeIcon({ size, className, color, }: GlobeIconProps): React.JSX.Element;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=GlobeIcon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GlobeIcon.d.ts","sourceRoot":"","sources":["../../src/components/GlobeIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;CAC5C;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,IAAS,EACT,SAAc,EACd,KAAmB,GACpB,EAAE,cAAc,qBA4BhB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = GlobeIcon;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
function GlobeIcon({ size = 16, className = "", color = "secondary", }) {
|
|
9
|
-
const colors = {
|
|
10
|
-
primary: "#2F2F2F",
|
|
11
|
-
secondary: "#9B9B9B",
|
|
12
|
-
accent: "#1976D2",
|
|
13
|
-
};
|
|
14
|
-
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: colors[color], strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: `transition-colors duration-200 hover:stroke-[#1976D2] ${className}`, style: {
|
|
15
|
-
cursor: "pointer",
|
|
16
|
-
} },
|
|
17
|
-
react_1.default.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
18
|
-
react_1.default.createElement("path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" }),
|
|
19
|
-
react_1.default.createElement("path", { d: "M2 12h20" })));
|
|
20
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { BlockNoteEditor } from "@blocknote/core";
|
|
3
|
-
export interface IxoEditorProps {
|
|
4
|
-
editor: BlockNoteEditor<any, any, any> | undefined;
|
|
5
|
-
className?: string;
|
|
6
|
-
onChange?: () => void;
|
|
7
|
-
onSelectionChange?: () => void;
|
|
8
|
-
children?: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* IxoEditor component - A customized BlockNote editor for IXO
|
|
12
|
-
*/
|
|
13
|
-
export declare function IxoEditor({ editor, className, onChange, onSelectionChange, children, }: IxoEditorProps): React.JSX.Element | null;
|
|
14
|
-
//# sourceMappingURL=IxoEditor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IxoEditor.d.ts","sourceRoot":"","sources":["../../src/components/IxoEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIvD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,SAAc,EACd,QAAQ,EACR,iBAAiB,EACjB,QAAQ,GACT,EAAE,cAAc,4BAsDhB"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.IxoEditor = IxoEditor;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const react_2 = require("@blocknote/react");
|
|
9
|
-
const shadcn_1 = require("@blocknote/shadcn");
|
|
10
|
-
const core_1 = require("@blocknote/core");
|
|
11
|
-
const blocks_1 = require("../blocks");
|
|
12
|
-
/**
|
|
13
|
-
* IxoEditor component - A customized BlockNote editor for IXO
|
|
14
|
-
*/
|
|
15
|
-
function IxoEditor({ editor, className = "", onChange, onSelectionChange, children, }) {
|
|
16
|
-
if (!editor) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
// Get IXO configuration from editor
|
|
20
|
-
const config = editor._ixoConfig || {
|
|
21
|
-
theme: "light",
|
|
22
|
-
editable: true,
|
|
23
|
-
sideMenu: true,
|
|
24
|
-
slashMenu: true,
|
|
25
|
-
formattingToolbar: true,
|
|
26
|
-
linkToolbar: true,
|
|
27
|
-
filePanel: true,
|
|
28
|
-
tableHandles: true,
|
|
29
|
-
};
|
|
30
|
-
return (react_1.default.createElement("div", { className: `ixo-editor ixo-editor--theme-${config.theme} ${className}` },
|
|
31
|
-
react_1.default.createElement(shadcn_1.BlockNoteView, { editor: editor, editable: config.editable, sideMenu: config.sideMenu, slashMenu: false, formattingToolbar: config.formattingToolbar, linkToolbar: config.linkToolbar, filePanel: config.filePanel, tableHandles: config.tableHandles, theme: config.theme, onChange: onChange, onSelectionChange: onSelectionChange },
|
|
32
|
-
config.slashMenu && (react_1.default.createElement(react_2.SuggestionMenuController, { triggerCharacter: "/", getItems: async (query) => {
|
|
33
|
-
// Get default slash menu items for the current editor
|
|
34
|
-
const defaultItems = (0, react_2.getDefaultReactSlashMenuItems)(editor);
|
|
35
|
-
// Add our custom items
|
|
36
|
-
const customItems = (0, blocks_1.getExtraSlashMenuItems)(editor);
|
|
37
|
-
// Combine and filter based on query
|
|
38
|
-
return (0, core_1.filterSuggestionItems)([...defaultItems, ...customItems], query);
|
|
39
|
-
} })),
|
|
40
|
-
children)));
|
|
41
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface PenIconProps {
|
|
3
|
-
size?: number;
|
|
4
|
-
className?: string;
|
|
5
|
-
color?: "primary" | "secondary" | "accent";
|
|
6
|
-
}
|
|
7
|
-
export default function PenIcon({ size, className, color, }: PenIconProps): React.JSX.Element;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=PenIcon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PenIcon.d.ts","sourceRoot":"","sources":["../../src/components/PenIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;CAC5C;AAED,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,IAAS,EACT,SAAc,EACd,KAAmB,GACpB,EAAE,YAAY,qBA4Bd"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = PenIcon;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
function PenIcon({ size = 16, className = "", color = "secondary", }) {
|
|
9
|
-
const colors = {
|
|
10
|
-
primary: "#2F2F2F",
|
|
11
|
-
secondary: "#9B9B9B",
|
|
12
|
-
accent: "#1976D2",
|
|
13
|
-
};
|
|
14
|
-
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: colors[color], strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: `transition-colors duration-200 hover:stroke-[#1976D2] ${className}`, style: {
|
|
15
|
-
cursor: "pointer",
|
|
16
|
-
} },
|
|
17
|
-
react_1.default.createElement("path", { d: "M13 21h8" }),
|
|
18
|
-
react_1.default.createElement("path", { d: "m15 5 4 4" }),
|
|
19
|
-
react_1.default.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" })));
|
|
20
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface SettingsIconProps {
|
|
3
|
-
className?: string;
|
|
4
|
-
size?: number;
|
|
5
|
-
color?: "primary" | "secondary" | "accent";
|
|
6
|
-
}
|
|
7
|
-
export default function SettingsIcon({ className, size, color, }: SettingsIconProps): React.JSX.Element;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=SettingsIcon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsIcon.d.ts","sourceRoot":"","sources":["../../src/components/SettingsIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;CAC5C;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,SAAc,EACd,IAAS,EACT,KAAmB,GACpB,EAAE,iBAAiB,qBA6BnB"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = SettingsIcon;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
function SettingsIcon({ className = "", size = 16, color = "secondary", }) {
|
|
9
|
-
const colorMap = {
|
|
10
|
-
primary: "#2F2F2F",
|
|
11
|
-
secondary: "#9B9B9B",
|
|
12
|
-
accent: "#1976D2",
|
|
13
|
-
};
|
|
14
|
-
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: colorMap[color], strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: `settings-icon ${className}`, style: {
|
|
15
|
-
transition: "stroke 0.15s ease-in-out",
|
|
16
|
-
} },
|
|
17
|
-
react_1.default.createElement("path", { d: "M14 17H5" }),
|
|
18
|
-
react_1.default.createElement("path", { d: "M19 7h-9" }),
|
|
19
|
-
react_1.default.createElement("circle", { cx: "17", cy: "17", r: "3" }),
|
|
20
|
-
react_1.default.createElement("circle", { cx: "7", cy: "7", r: "3" })));
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AdvancedTab.d.ts","sourceRoot":"","sources":["../../../src/components/SettingsModal/AdvancedTab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,gBAAgB;IACxB,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,GAAG,CAAC;CACb;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,OAAO,GAChB,EAAE,gBAAgB,qBAYlB"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AdvancedTab = AdvancedTab;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
function AdvancedTab({ block: _block, editor: _editor, }) {
|
|
9
|
-
return (react_1.default.createElement("div", { className: "space-y-6" },
|
|
10
|
-
react_1.default.createElement("div", null,
|
|
11
|
-
react_1.default.createElement("h2", { className: "text-2xl font-semibold" }, "Advanced"),
|
|
12
|
-
react_1.default.createElement("p", { className: "text-muted-foreground mt-1" }, "Advanced configuration options")),
|
|
13
|
-
react_1.default.createElement("p", { className: "text-muted-foreground" }, "Advanced settings coming soon...")));
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DomainPreview.d.ts","sourceRoot":"","sources":["../../../src/components/SettingsModal/DomainPreview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,kBAAkB;IAC1B,aAAa,EAAE,GAAG,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,EAAE,aAAa,EAAE,EAAE,kBAAkB,4BA6BlE"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DomainPreview = DomainPreview;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const card_1 = require("../ui/card");
|
|
9
|
-
function DomainPreview({ domainProfile }) {
|
|
10
|
-
if (!domainProfile) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
return (react_1.default.createElement(card_1.Card, { className: "border-0 shadow-sm rounded-xl" },
|
|
14
|
-
react_1.default.createElement(card_1.CardContent, { className: "p-4" },
|
|
15
|
-
react_1.default.createElement("div", { className: "flex items-start space-x-4" },
|
|
16
|
-
react_1.default.createElement("div", { className: "w-16 h-16 bg-muted rounded-lg flex items-center justify-center shrink-0" },
|
|
17
|
-
react_1.default.createElement("img", { src: domainProfile.image ??
|
|
18
|
-
"https://studio.ixo.earth/domain-profile-default.jpg", alt: domainProfile.name, className: "w-full h-full object-cover rounded-lg border-2 border-gray-200" })),
|
|
19
|
-
react_1.default.createElement("div", { className: "flex-1 min-w-0" },
|
|
20
|
-
react_1.default.createElement("h3", { className: "font-semibold text-lg" }, domainProfile.name),
|
|
21
|
-
react_1.default.createElement("p", { className: "text-muted-foreground text-sm" }, domainProfile.description))))));
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureASettings.d.ts","sourceRoot":"","sources":["../../../src/components/SettingsModal/FeatureASettings.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,qBAiDtD"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.FeatureASettings = FeatureASettings;
|
|
37
|
-
const react_1 = __importStar(require("react"));
|
|
38
|
-
const SettingsModal_1 = require("./SettingsModal");
|
|
39
|
-
const GeneralTab_1 = require("./GeneralTab");
|
|
40
|
-
const AdvancedTab_1 = require("./AdvancedTab");
|
|
41
|
-
const PreviewTab_1 = require("./PreviewTab");
|
|
42
|
-
function FeatureASettings({ block, editor }) {
|
|
43
|
-
const [domainValue, setDomainValue] = (0, react_1.useState)(block.props.did || "did:ixo:12123123123123123123");
|
|
44
|
-
const handleDidChange = (did) => {
|
|
45
|
-
setDomainValue(did);
|
|
46
|
-
editor.updateBlock(block, {
|
|
47
|
-
props: {
|
|
48
|
-
...block.props,
|
|
49
|
-
did,
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
const handleAddToPage = () => {
|
|
54
|
-
// Handle add to page logic here
|
|
55
|
-
console.log("Adding to page with DID:", domainValue);
|
|
56
|
-
};
|
|
57
|
-
return (react_1.default.createElement(SettingsModal_1.SettingsModal, { onAddToPage: handleAddToPage, tabs: [
|
|
58
|
-
{
|
|
59
|
-
id: "general",
|
|
60
|
-
label: "General",
|
|
61
|
-
content: (react_1.default.createElement(GeneralTab_1.GeneralTab, { block: block, editor: editor, domainValue: domainValue, onDomainChange: handleDidChange })),
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: "advanced",
|
|
65
|
-
label: "Advanced",
|
|
66
|
-
content: react_1.default.createElement(AdvancedTab_1.AdvancedTab, { block: block, editor: editor }),
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
id: "preview",
|
|
70
|
-
label: "Preview",
|
|
71
|
-
content: react_1.default.createElement(PreviewTab_1.PreviewTab, { block: block, editor: editor }),
|
|
72
|
-
},
|
|
73
|
-
] }));
|
|
74
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface GeneralTabProps {
|
|
3
|
-
block: any;
|
|
4
|
-
editor: any;
|
|
5
|
-
domainValue: string;
|
|
6
|
-
onDomainChange: (did: string) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare function GeneralTab({ block: _block, editor: _editor, domainValue: _domainValue, onDomainChange, }: GeneralTabProps): React.JSX.Element;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=GeneralTab.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GeneralTab.d.ts","sourceRoot":"","sources":["../../../src/components/SettingsModal/GeneralTab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,UAAU,eAAe;IACvB,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,GAAG,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,OAAO,EACf,WAAW,EAAE,YAAY,EACzB,cAAc,GACf,EAAE,eAAe,qBAwHjB"}
|