@powerhousedao/vetra 6.1.0-dev.2 → 6.1.0-dev.21
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/dist/{app-module-D_cAVvt0.js → app-module-dG7ug7Cm.js} +3 -3
- package/dist/{app-module-D_cAVvt0.js.map → app-module-dG7ug7Cm.js.map} +1 -1
- package/dist/codegen/index.d.ts +4 -4
- package/dist/codegen/index.js +11 -11
- package/dist/codegen/index.js.map +1 -1
- package/dist/{connect-BRlVKs1s.js → connect-Bbz4cL8F.js} +1 -1
- package/dist/{connect-BRlVKs1s.js.map → connect-Bbz4cL8F.js.map} +1 -1
- package/dist/{document-editor-1NFr9t3a.js → document-editor-5gSBaTUM.js} +3 -3
- package/dist/{document-editor-1NFr9t3a.js.map → document-editor-5gSBaTUM.js.map} +1 -1
- package/dist/document-models/app-module/index.d.ts +1 -1
- package/dist/document-models/app-module/index.js +4 -4
- package/dist/document-models/document-editor/index.d.ts +1 -1
- package/dist/document-models/document-editor/index.js +4 -4
- package/dist/document-models/index.d.ts +5 -5
- package/dist/document-models/index.js +5 -5
- package/dist/document-models/processor-module/index.d.ts +1 -1
- package/dist/document-models/processor-module/index.js +4 -4
- package/dist/document-models/subgraph-module/index.d.ts +1 -1
- package/dist/document-models/subgraph-module/index.js +4 -4
- package/dist/document-models/vetra-package/index.d.ts +1 -1
- package/dist/document-models/vetra-package/index.js +2 -2
- package/dist/{editor-CJAn9WTA.js → editor-BamOOi9L.js} +13 -12
- package/dist/editor-BamOOi9L.js.map +1 -0
- package/dist/{editor-WWMGVelM.js → editor-CM9tpwzR.js} +18 -16
- package/dist/editor-CM9tpwzR.js.map +1 -0
- package/dist/{editor-BwbJ65NZ.js → editor-D-QqGEkw.js} +18 -17
- package/dist/editor-D-QqGEkw.js.map +1 -0
- package/dist/{editor-CLERZjRS.js → editor-Dz3cXtzn.js} +83 -83
- package/dist/editor-Dz3cXtzn.js.map +1 -0
- package/dist/{editor-DabfMxkF.js → editor-je4HFt2f.js} +38 -38
- package/dist/editor-je4HFt2f.js.map +1 -0
- package/dist/{editor-DWufJcmG.js → editor-rYCWiter.js} +9 -8
- package/dist/editor-rYCWiter.js.map +1 -0
- package/dist/editors/components/index.d.ts.map +1 -1
- package/dist/editors/components/index.js +2 -1
- package/dist/editors/components/index.js.map +1 -1
- package/dist/editors/index.js +1 -1
- package/dist/{factory-Bd_0OaF8.js → factory-BkA-IvkR.js} +2 -2
- package/dist/{factory-Bd_0OaF8.js.map → factory-BkA-IvkR.js.map} +1 -1
- package/dist/factory-DcPyqWkY.js +54 -0
- package/dist/factory-DcPyqWkY.js.map +1 -0
- package/dist/{index-ClaOdn_F.d.ts → index-6u5B5ORH.d.ts} +1 -1
- package/dist/{index-ClaOdn_F.d.ts.map → index-6u5B5ORH.d.ts.map} +1 -1
- package/dist/{index-BPoF8P3O.d.ts → index-BL4jGAtJ.d.ts} +1 -1
- package/dist/{index-BPoF8P3O.d.ts.map → index-BL4jGAtJ.d.ts.map} +1 -1
- package/dist/{index-C4s0aLv3.d.ts → index-BzDZOr5P.d.ts} +1 -1
- package/dist/{index-C4s0aLv3.d.ts.map → index-BzDZOr5P.d.ts.map} +1 -1
- package/dist/{index-BoGed4Fa.d.ts → index-DE_s19VI.d.ts} +1 -1
- package/dist/{index-BoGed4Fa.d.ts.map → index-DE_s19VI.d.ts.map} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -6
- package/dist/{module-dDKBr6QY.js → module-1hr_ne9w.js} +13 -16
- package/dist/module-1hr_ne9w.js.map +1 -0
- package/dist/{module-x2Liyk0-.js → module-C0jUPu9F.js} +2 -2
- package/dist/{module-x2Liyk0-.js.map → module-C0jUPu9F.js.map} +1 -1
- package/dist/{module-pK0hpO6c.js → module-CRq_lUkG.js} +2 -2
- package/dist/{module-pK0hpO6c.js.map → module-CRq_lUkG.js.map} +1 -1
- package/dist/{module-ryHOwQp-.js → module-DP3bVbak.js} +2 -2
- package/dist/{module-ryHOwQp-.js.map → module-DP3bVbak.js.map} +1 -1
- package/dist/{module-jWN6gsmi.js → module-DvO77TZz.js} +7 -7
- package/dist/{module-jWN6gsmi.js.map → module-DvO77TZz.js.map} +1 -1
- package/dist/{module-DPyV2vUY.js → module-mtR8W4L4.js} +2 -2
- package/dist/{module-DPyV2vUY.js.map → module-mtR8W4L4.js.map} +1 -1
- package/dist/{module-Drla4Vmn.d.ts → module-rS5YXFpM.d.ts} +1 -1
- package/dist/{module-Drla4Vmn.d.ts.map → module-rS5YXFpM.d.ts.map} +1 -1
- package/dist/{ph-factories-CJXfT_Z1.js → ph-factories-BKH_LPa8.js} +2 -2
- package/dist/{ph-factories-CJXfT_Z1.js.map → ph-factories-BKH_LPa8.js.map} +1 -1
- package/dist/{ph-factories-Bn_HTUfT.js → ph-factories-BL1-hdeG.js} +2 -2
- package/dist/{ph-factories-Bn_HTUfT.js.map → ph-factories-BL1-hdeG.js.map} +1 -1
- package/dist/{ph-factories-B6PSPkPQ.js → ph-factories-Dvy-HW6C.js} +2 -2
- package/dist/{ph-factories-B6PSPkPQ.js.map → ph-factories-Dvy-HW6C.js.map} +1 -1
- package/dist/{ph-factories-B0_E6LY6.js → ph-factories-qCTFKODg.js} +2 -2
- package/dist/{ph-factories-B0_E6LY6.js.map → ph-factories-qCTFKODg.js.map} +1 -1
- package/dist/{factory-CEzh-u5J.js → processor-BfQ_DU7u.js} +7 -52
- package/dist/processor-BfQ_DU7u.js.map +1 -0
- package/dist/{processor-module-B7IAItXQ.js → processor-module-NP3ktbdr.js} +3 -3
- package/dist/{processor-module-B7IAItXQ.js.map → processor-module-NP3ktbdr.js.map} +1 -1
- package/dist/processors/codegen/index.d.ts.map +1 -1
- package/dist/processors/codegen/index.js +2 -1
- package/dist/processors/index.js +1 -1
- package/dist/processors/vetra-read-model/index.js +1 -1
- package/dist/{subgraph-module-CfzSZTNC.js → subgraph-module-B_5B8e3I.js} +3 -3
- package/dist/{subgraph-module-CfzSZTNC.js.map → subgraph-module-B_5B8e3I.js.map} +1 -1
- package/dist/switchboard-C_BapCdk.js +8 -0
- package/dist/{switchboard-CIUZkhea.js.map → switchboard-C_BapCdk.js.map} +1 -1
- package/dist/{useVetraDocument-BQKyels4.js → useVetraDocument-tpjMF571.js} +1 -1
- package/dist/{useVetraDocument-BQKyels4.js.map → useVetraDocument-tpjMF571.js.map} +1 -1
- package/dist/{utils-BRx88WW3.js → utils-B4KdjDnp.js} +9 -12
- package/dist/utils-B4KdjDnp.js.map +1 -0
- package/dist/{utils-CWO5kDus.js → utils-BiV3cs9Y.js} +5 -8
- package/dist/utils-BiV3cs9Y.js.map +1 -0
- package/dist/{utils-Byjf33qt.js → utils-CkWB3DRk.js} +8 -11
- package/dist/utils-CkWB3DRk.js.map +1 -0
- package/dist/{utils-CnZc-0E4.js → utils-D0ejTHeY.js} +7 -10
- package/dist/utils-D0ejTHeY.js.map +1 -0
- package/dist/{vetra-package-BgTjv343.js → vetra-package-Ds8CruJz.js} +2 -2
- package/dist/{vetra-package-BgTjv343.js.map → vetra-package-Ds8CruJz.js.map} +1 -1
- package/package.json +15 -12
- package/style.css +12 -0
- package/dist/editor-BwbJ65NZ.js.map +0 -1
- package/dist/editor-CJAn9WTA.js.map +0 -1
- package/dist/editor-CLERZjRS.js.map +0 -1
- package/dist/editor-DWufJcmG.js.map +0 -1
- package/dist/editor-DabfMxkF.js.map +0 -1
- package/dist/editor-WWMGVelM.js.map +0 -1
- package/dist/factory-CEzh-u5J.js.map +0 -1
- package/dist/module-dDKBr6QY.js.map +0 -1
- package/dist/style.css +0 -1038
- package/dist/switchboard-CIUZkhea.js +0 -8
- package/dist/utils-BRx88WW3.js.map +0 -1
- package/dist/utils-Byjf33qt.js.map +0 -1
- package/dist/utils-CWO5kDus.js.map +0 -1
- package/dist/utils-CnZc-0E4.js.map +0 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { _ as setEditorName, g as removeDocumentType, m as addDocumentType, v as setEditorStatus } from "./utils-
|
|
2
|
-
import { s as useSelectedDocumentEditorDocument } from "./document-editor-
|
|
1
|
+
import { _ as setEditorName, g as removeDocumentType, m as addDocumentType, v as setEditorStatus } from "./utils-D0ejTHeY.js";
|
|
2
|
+
import { s as useSelectedDocumentEditorDocument } from "./document-editor-5gSBaTUM.js";
|
|
3
3
|
import { StatusPill } from "./editors/components/index.js";
|
|
4
4
|
import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-Btogj1f0.js";
|
|
5
5
|
import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
|
|
6
6
|
import { Suspense, useCallback, useEffect, useState } from "react";
|
|
7
|
+
import { twMerge } from "tailwind-merge";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { DocumentToolbar } from "@powerhousedao/design-system/connect";
|
|
9
10
|
//#region editors/document-editor/components/DocumentEditorForm.tsx
|
|
10
11
|
function DocumentTypeSelectUI(props) {
|
|
11
12
|
return /* @__PURE__ */ jsxs("select", {
|
|
12
13
|
id: "supported-document-types",
|
|
13
|
-
className: "w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none",
|
|
14
|
+
className: "w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100",
|
|
14
15
|
...props,
|
|
15
16
|
children: [/* @__PURE__ */ jsx("option", {
|
|
16
17
|
value: "",
|
|
@@ -73,7 +74,7 @@ const DocumentEditorForm = ({ editorName: initialEditorName = "", documentTypes:
|
|
|
73
74
|
/* @__PURE__ */ jsxs("div", {
|
|
74
75
|
className: "flex items-center justify-between",
|
|
75
76
|
children: [/* @__PURE__ */ jsx("h2", {
|
|
76
|
-
className: "text-lg font-medium text-gray-900",
|
|
77
|
+
className: "text-lg font-medium text-gray-900 dark:text-slate-50",
|
|
77
78
|
children: "Editor Configuration"
|
|
78
79
|
}), /* @__PURE__ */ jsx(StatusPill, {
|
|
79
80
|
status: status === "CONFIRMED" ? "confirmed" : "draft",
|
|
@@ -82,7 +83,7 @@ const DocumentEditorForm = ({ editorName: initialEditorName = "", documentTypes:
|
|
|
82
83
|
}),
|
|
83
84
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
84
85
|
htmlFor: "editor-name",
|
|
85
|
-
className: "mb-2 block text-sm font-medium text-gray-700",
|
|
86
|
+
className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
|
|
86
87
|
children: "Editor Name"
|
|
87
88
|
}), /* @__PURE__ */ jsx("input", {
|
|
88
89
|
id: "editor-name",
|
|
@@ -90,11 +91,11 @@ const DocumentEditorForm = ({ editorName: initialEditorName = "", documentTypes:
|
|
|
90
91
|
value: editorName,
|
|
91
92
|
onChange: (e) => setEditorName(e.target.value),
|
|
92
93
|
disabled: isReadOnly,
|
|
93
|
-
className:
|
|
94
|
+
className: twMerge("w-full rounded-md border border-gray-300 px-3 py-2 placeholder:text-gray-700 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-200", isReadOnly ? "cursor-not-allowed bg-gray-100 dark:bg-slate-700" : "")
|
|
94
95
|
})] }),
|
|
95
96
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
96
97
|
htmlFor: "supported-document-types",
|
|
97
|
-
className: "mb-2 block text-sm font-medium text-gray-700",
|
|
98
|
+
className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
|
|
98
99
|
children: "Supported Document Types"
|
|
99
100
|
}), /* @__PURE__ */ jsxs("div", {
|
|
100
101
|
className: "space-y-2",
|
|
@@ -111,14 +112,14 @@ const DocumentEditorForm = ({ editorName: initialEditorName = "", documentTypes:
|
|
|
111
112
|
children: documentTypes.map((type) => /* @__PURE__ */ jsxs("div", {
|
|
112
113
|
className: "flex items-center py-1",
|
|
113
114
|
children: [/* @__PURE__ */ jsx("span", {
|
|
114
|
-
className: "text-sm text-gray-700",
|
|
115
|
+
className: "text-sm text-gray-700 dark:text-slate-200",
|
|
115
116
|
children: type.documentType
|
|
116
117
|
}), !isReadOnly && /* @__PURE__ */ jsx("button", {
|
|
117
118
|
onClick: () => {
|
|
118
119
|
setDocumentTypes([]);
|
|
119
120
|
onRemoveDocumentType?.({ id: type.id });
|
|
120
121
|
},
|
|
121
|
-
className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none",
|
|
122
|
+
className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none dark:text-slate-500 dark:hover:text-slate-300",
|
|
122
123
|
children: "×"
|
|
123
124
|
})]
|
|
124
125
|
}, type.id))
|
|
@@ -127,7 +128,7 @@ const DocumentEditorForm = ({ editorName: initialEditorName = "", documentTypes:
|
|
|
127
128
|
!isReadOnly && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("button", {
|
|
128
129
|
onClick: handleConfirm,
|
|
129
130
|
disabled: !editorName.trim() || documentTypes.length === 0,
|
|
130
|
-
className: "rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300",
|
|
131
|
+
className: "rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300 dark:bg-blue-300 dark:text-slate-900 dark:hover:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-100",
|
|
131
132
|
children: "Confirm"
|
|
132
133
|
}) })
|
|
133
134
|
]
|
|
@@ -156,7 +157,7 @@ function Editor() {
|
|
|
156
157
|
dispatch(setEditorStatus({ status: "CONFIRMED" }));
|
|
157
158
|
}, [dispatch]);
|
|
158
159
|
return /* @__PURE__ */ jsxs("div", {
|
|
159
|
-
className: "bg-gray-50 p-6",
|
|
160
|
+
className: "bg-gray-50 p-6 dark:bg-slate-800",
|
|
160
161
|
children: [/* @__PURE__ */ jsx(DocumentToolbar, {}), /* @__PURE__ */ jsx(DocumentEditorForm, {
|
|
161
162
|
status: document.state.global.status,
|
|
162
163
|
editorName: document.state.global.name ?? "",
|
|
@@ -171,4 +172,4 @@ function Editor() {
|
|
|
171
172
|
//#endregion
|
|
172
173
|
export { Editor as default };
|
|
173
174
|
|
|
174
|
-
//# sourceMappingURL=editor-
|
|
175
|
+
//# sourceMappingURL=editor-BamOOi9L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-BamOOi9L.js","names":[],"sources":["../editors/document-editor/components/DocumentEditorForm.tsx","../editors/document-editor/config.ts","../editors/document-editor/editor.tsx"],"sourcesContent":["import { Suspense, useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport type {\n AddDocumentTypeInput,\n DocumentTypeItem,\n RemoveDocumentTypeInput,\n} from \"../../../document-models/document-editor/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useAvailableDocumentTypes, useDebounce } from \"../../hooks/index.js\";\n\nexport interface DocumentEditorFormProps {\n editorName?: string;\n documentTypes?: DocumentTypeItem[];\n status?: string;\n onEditorNameChange?: (name: string) => void;\n onAddDocumentType?: (input: AddDocumentTypeInput) => void;\n onRemoveDocumentType?: (input: RemoveDocumentTypeInput) => void;\n onConfirm?: () => void;\n}\n\nfunction DocumentTypeSelectUI(\n props: React.SelectHTMLAttributes<HTMLSelectElement>,\n) {\n return (\n <select\n id=\"supported-document-types\"\n className=\"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\"\n {...props}\n >\n <option value=\"\">Select a document type</option>\n {props.children}\n </select>\n );\n}\n\nfunction DocumentTypeSelect({\n documentTypes,\n setDocumentTypes,\n onAddDocumentType,\n onRemoveDocumentType,\n}: {\n setDocumentTypes: (documentTypes: DocumentTypeItem[]) => void;\n} & Pick<\n DocumentEditorFormProps,\n \"documentTypes\" | \"onAddDocumentType\" | \"onRemoveDocumentType\"\n>) {\n // Get available document types from the hook (vetra drive only for document editor)\n const availableDocumentTypes = useAvailableDocumentTypes(true);\n const [selectedDocumentType, setSelectedDocumentType] = useState(\"\");\n\n return (\n <DocumentTypeSelectUI\n value={selectedDocumentType}\n onChange={(e) => {\n const selectedValue = e.target.value;\n if (selectedValue) {\n // Remove existing document type if any\n\n const existingType = documentTypes?.at(0);\n if (existingType) {\n onRemoveDocumentType?.({ id: existingType.id });\n }\n\n // Add the new document type\n const newTypeInput: AddDocumentTypeInput = {\n id: Date.now().toString(), // Generate a unique ID\n documentType: selectedValue,\n };\n const newType: DocumentTypeItem = {\n id: newTypeInput.id,\n documentType: newTypeInput.documentType,\n };\n setDocumentTypes([newType]); // Replace with single item array\n onAddDocumentType?.(newTypeInput);\n }\n setSelectedDocumentType(\"\");\n }}\n >\n {availableDocumentTypes.map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n </DocumentTypeSelectUI>\n );\n}\n\nexport const DocumentEditorForm: React.FC<DocumentEditorFormProps> = ({\n editorName: initialEditorName = \"\",\n documentTypes: initialDocumentTypes = [],\n status = \"DRAFT\",\n onEditorNameChange,\n onAddDocumentType,\n onRemoveDocumentType,\n onConfirm,\n}) => {\n const [editorName, setEditorName] = useState(initialEditorName);\n const [documentTypes, setDocumentTypes] =\n useState<DocumentTypeItem[]>(initialDocumentTypes);\n const [isConfirmed, setIsConfirmed] = useState(false);\n\n // Use the debounce hook for name changes\n useDebounce(editorName, onEditorNameChange, 300);\n\n // Update local state when initial values change\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setEditorName(initialEditorName);\n }, [initialEditorName]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setDocumentTypes(initialDocumentTypes);\n }, [initialDocumentTypes]);\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (editorName.trim() && documentTypes.length > 0) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm?.();\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-gray-900 dark:text-slate-50\">\n Editor Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* Editor Name Field */}\n <div>\n <label\n htmlFor=\"editor-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Editor Name\n </label>\n <input\n id=\"editor-name\"\n type=\"text\"\n value={editorName}\n onChange={(e) => setEditorName(e.target.value)}\n disabled={isReadOnly}\n className={twMerge(\n \"w-full rounded-md border border-gray-300 px-3 py-2 placeholder:text-gray-700 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-200\",\n isReadOnly\n ? \"cursor-not-allowed bg-gray-100 dark:bg-slate-700\"\n : \"\",\n )}\n />\n </div>\n\n {/* Supported Document Types Field */}\n <div>\n <label\n htmlFor=\"supported-document-types\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Supported Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <Suspense fallback={<DocumentTypeSelectUI />}>\n <DocumentTypeSelect\n documentTypes={documentTypes}\n setDocumentTypes={setDocumentTypes}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n />\n </Suspense>\n )}\n <div className=\"space-y-1\">\n {documentTypes.map((type) => (\n <div key={type.id} className=\"flex items-center py-1\">\n <span className=\"text-sm text-gray-700 dark:text-slate-200\">\n {type.documentType}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => {\n setDocumentTypes([]);\n onRemoveDocumentType?.({ id: type.id });\n }}\n className=\"ml-2 text-gray-400 hover:text-gray-600 focus:outline-none dark:text-slate-500 dark:hover:text-slate-300\"\n >\n ×\n </button>\n )}\n </div>\n ))}\n </div>\n </div>\n </div>\n\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!editorName.trim() || documentTypes.length === 0}\n className=\"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300 dark:bg-blue-300 dark:text-slate-900 dark:hover:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-100\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { useCallback } from \"react\";\nimport { useSelectedDocumentEditorDocument } from \"../../document-models/document-editor/index.js\";\nimport {\n addDocumentType,\n removeDocumentType,\n setEditorName,\n setEditorStatus,\n type AddDocumentTypeInput,\n type RemoveDocumentTypeInput,\n} from \"../../document-models/document-editor/index.js\";\nimport { DocumentEditorForm } from \"./components/DocumentEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedDocumentEditorDocument();\n\n const onEditorNameChange = useCallback(\n (name: string) => {\n if (!document.state.global.name && !name) return;\n if (name === document.state.global.name) return;\n\n dispatch(setEditorName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onAddDocumentType = useCallback(\n (input: AddDocumentTypeInput) => {\n dispatch(addDocumentType(input));\n },\n [dispatch],\n );\n\n const onRemoveDocumentType = useCallback(\n (input: RemoveDocumentTypeInput) => {\n dispatch(removeDocumentType(input));\n },\n [dispatch],\n );\n\n const onConfirm = useCallback(() => {\n dispatch(setEditorStatus({ status: \"CONFIRMED\" }));\n }, [dispatch]);\n\n return (\n <div className=\"bg-gray-50 p-6 dark:bg-slate-800\">\n <DocumentToolbar />\n <DocumentEditorForm\n status={document.state.global.status}\n editorName={document.state.global.name ?? \"\"}\n documentTypes={document.state.global.documentTypes}\n onEditorNameChange={onEditorNameChange}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n onConfirm={onConfirm}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAoBA,SAAS,qBACP,OACA;AACA,QACE,qBAAC,UAAD;EACE,IAAG;EACH,WAAU;EACV,GAAI;YAHN,CAKE,oBAAC,UAAD;GAAQ,OAAM;aAAG;GAA+B,CAAA,EAC/C,MAAM,SACA;;;AAIb,SAAS,mBAAmB,EAC1B,eACA,kBACA,mBACA,wBAMC;CAED,MAAM,yBAAyB,0BAA0B,KAAK;CAC9D,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,GAAG;AAEpE,QACE,oBAAC,sBAAD;EACE,OAAO;EACP,WAAW,MAAM;GACf,MAAM,gBAAgB,EAAE,OAAO;AAC/B,OAAI,eAAe;IAGjB,MAAM,eAAe,eAAe,GAAG,EAAE;AACzC,QAAI,aACF,wBAAuB,EAAE,IAAI,aAAa,IAAI,CAAC;IAIjD,MAAM,eAAqC;KACzC,IAAI,KAAK,KAAK,CAAC,UAAU;KACzB,cAAc;KACf;AAKD,qBAAiB,CAJiB;KAChC,IAAI,aAAa;KACjB,cAAc,aAAa;KAC5B,C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CAAC,SAAS,CACX;CAED,MAAM,uBAAuB,aAC1B,UAAmC;AAClC,WAAS,mBAAmB,MAAM,CAAC;IAErC,CAAC,SAAS,CACX;CAED,MAAM,YAAY,kBAAkB;AAClC,WAAS,gBAAgB,EAAE,QAAQ,aAAa,CAAC,CAAC;IACjD,CAAC,SAAS,CAAC;AAEd,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,iBAAD,EAAmB,CAAA,EACnB,oBAAC,oBAAD;GACE,QAAQ,SAAS,MAAM,OAAO;GAC9B,YAAY,SAAS,MAAM,OAAO,QAAQ;GAC1C,eAAe,SAAS,MAAM,OAAO;GACjB;GACD;GACG;GACX;GACX,CAAA,CACE"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { _ as removeDocumentType, b as setProcessorStatus, h as addProcessorApp, m as addDocumentType, v as removeProcessorApp, x as setProcessorType, y as setProcessorName } from "./utils-
|
|
1
|
+
import { _ as removeDocumentType, b as setProcessorStatus, h as addProcessorApp, m as addDocumentType, v as removeProcessorApp, x as setProcessorType, y as setProcessorName } from "./utils-CkWB3DRk.js";
|
|
2
2
|
import { StatusPill } from "./editors/components/index.js";
|
|
3
3
|
import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-Btogj1f0.js";
|
|
4
|
-
import { n as useSelectedProcessorModuleDocument } from "./useVetraDocument-
|
|
4
|
+
import { n as useSelectedProcessorModuleDocument } from "./useVetraDocument-tpjMF571.js";
|
|
5
5
|
import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
|
|
6
6
|
import { PROCESSOR_APPS } from "@powerhousedao/shared/processors";
|
|
7
7
|
import { useCallback, useEffect, useState } from "react";
|
|
8
|
+
import { twMerge } from "tailwind-merge";
|
|
8
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
import { DocumentToolbar } from "@powerhousedao/design-system/connect";
|
|
10
11
|
//#region editors/processor-editor/components/ProcessorEditorForm.tsx
|
|
@@ -51,7 +52,7 @@ const ProcessorEditorForm = ({ processorName: initialProcessorName = "", process
|
|
|
51
52
|
/* @__PURE__ */ jsxs("div", {
|
|
52
53
|
className: "flex items-center justify-between",
|
|
53
54
|
children: [/* @__PURE__ */ jsx("h2", {
|
|
54
|
-
className: "text-lg font-medium text-gray-900",
|
|
55
|
+
className: "text-lg font-medium text-gray-900 dark:text-slate-50",
|
|
55
56
|
children: "Processor Configuration"
|
|
56
57
|
}), /* @__PURE__ */ jsx(StatusPill, {
|
|
57
58
|
status: status === "CONFIRMED" ? "confirmed" : "draft",
|
|
@@ -60,7 +61,7 @@ const ProcessorEditorForm = ({ processorName: initialProcessorName = "", process
|
|
|
60
61
|
}),
|
|
61
62
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
62
63
|
htmlFor: "processor-name",
|
|
63
|
-
className: "mb-2 block text-sm font-medium text-gray-700",
|
|
64
|
+
className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
|
|
64
65
|
children: "Processor Name"
|
|
65
66
|
}), /* @__PURE__ */ jsx("input", {
|
|
66
67
|
id: "processor-name",
|
|
@@ -68,19 +69,19 @@ const ProcessorEditorForm = ({ processorName: initialProcessorName = "", process
|
|
|
68
69
|
value: processorName,
|
|
69
70
|
onChange: (e) => setProcessorName(e.target.value),
|
|
70
71
|
disabled: isReadOnly,
|
|
71
|
-
className:
|
|
72
|
+
className: twMerge("w-full rounded-md border border-gray-300 px-3 py-2 placeholder:text-gray-700 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-200", isReadOnly ? "cursor-not-allowed bg-gray-100 dark:bg-slate-700" : ""),
|
|
72
73
|
placeholder: "Enter processor name"
|
|
73
74
|
})] }),
|
|
74
75
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
75
76
|
htmlFor: "processor-type",
|
|
76
|
-
className: "mb-2 block text-sm font-medium text-gray-700",
|
|
77
|
+
className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
|
|
77
78
|
children: "Type"
|
|
78
79
|
}), /* @__PURE__ */ jsxs("select", {
|
|
79
80
|
id: "processor-type",
|
|
80
81
|
value: processorType,
|
|
81
82
|
onChange: (e) => setProcessorType(e.target.value),
|
|
82
83
|
disabled: isReadOnly,
|
|
83
|
-
className:
|
|
84
|
+
className: twMerge("w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100", isReadOnly ? "cursor-not-allowed bg-gray-100 dark:bg-slate-700" : ""),
|
|
84
85
|
children: [
|
|
85
86
|
/* @__PURE__ */ jsx("option", {
|
|
86
87
|
value: "",
|
|
@@ -98,7 +99,7 @@ const ProcessorEditorForm = ({ processorName: initialProcessorName = "", process
|
|
|
98
99
|
})] }),
|
|
99
100
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
100
101
|
htmlFor: "document-types",
|
|
101
|
-
className: "mb-2 block text-sm font-medium text-gray-700",
|
|
102
|
+
className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
|
|
102
103
|
children: "Document Types"
|
|
103
104
|
}), /* @__PURE__ */ jsxs("div", {
|
|
104
105
|
className: "space-y-2",
|
|
@@ -118,7 +119,7 @@ const ProcessorEditorForm = ({ processorName: initialProcessorName = "", process
|
|
|
118
119
|
}
|
|
119
120
|
setSelectedDocumentType("");
|
|
120
121
|
},
|
|
121
|
-
className: "w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none",
|
|
122
|
+
className: "w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100",
|
|
122
123
|
children: [/* @__PURE__ */ jsx("option", {
|
|
123
124
|
value: "",
|
|
124
125
|
children: "Select a document type to add"
|
|
@@ -131,11 +132,11 @@ const ProcessorEditorForm = ({ processorName: initialProcessorName = "", process
|
|
|
131
132
|
children: documentTypes.map((type) => /* @__PURE__ */ jsxs("div", {
|
|
132
133
|
className: "flex items-center py-1",
|
|
133
134
|
children: [/* @__PURE__ */ jsx("span", {
|
|
134
|
-
className: "text-sm text-gray-700",
|
|
135
|
+
className: "text-sm text-gray-700 dark:text-slate-200",
|
|
135
136
|
children: type.documentType
|
|
136
137
|
}), !isReadOnly && /* @__PURE__ */ jsx("button", {
|
|
137
138
|
onClick: () => handleRemoveDocumentType(type.id),
|
|
138
|
-
className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none",
|
|
139
|
+
className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none dark:text-slate-500 dark:hover:text-slate-300",
|
|
139
140
|
children: "×"
|
|
140
141
|
})]
|
|
141
142
|
}, type.id))
|
|
@@ -143,7 +144,7 @@ const ProcessorEditorForm = ({ processorName: initialProcessorName = "", process
|
|
|
143
144
|
})] }),
|
|
144
145
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
145
146
|
htmlFor: "processor-apps",
|
|
146
|
-
className: "mb-2 block text-sm font-medium text-gray-700",
|
|
147
|
+
className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
|
|
147
148
|
children: "Processor Apps"
|
|
148
149
|
}), /* @__PURE__ */ jsxs("div", {
|
|
149
150
|
className: "space-y-2",
|
|
@@ -165,12 +166,13 @@ const ProcessorEditorForm = ({ processorName: initialProcessorName = "", process
|
|
|
165
166
|
}
|
|
166
167
|
}), /* @__PURE__ */ jsx("label", {
|
|
167
168
|
htmlFor: processorApp,
|
|
169
|
+
className: "text-gray-700 dark:text-slate-200",
|
|
168
170
|
children: processorApp
|
|
169
171
|
})]
|
|
170
172
|
}, processorApp)) }), /* @__PURE__ */ jsx("div", {
|
|
171
173
|
className: "space-y-1",
|
|
172
174
|
children: isReadOnly && processorApps.map((processorApp) => /* @__PURE__ */ jsx("span", {
|
|
173
|
-
className: "text-sm text-gray-700",
|
|
175
|
+
className: "text-sm text-gray-700 dark:text-slate-200",
|
|
174
176
|
children: processorApp
|
|
175
177
|
}, processorApp))
|
|
176
178
|
})]
|
|
@@ -178,7 +180,7 @@ const ProcessorEditorForm = ({ processorName: initialProcessorName = "", process
|
|
|
178
180
|
!isReadOnly && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("button", {
|
|
179
181
|
onClick: handleConfirm,
|
|
180
182
|
disabled: !canConfirm,
|
|
181
|
-
className: "rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300",
|
|
183
|
+
className: "rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300 dark:bg-blue-300 dark:text-slate-900 dark:hover:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-100",
|
|
182
184
|
children: "Confirm"
|
|
183
185
|
}) })
|
|
184
186
|
]
|
|
@@ -219,7 +221,7 @@ function Editor() {
|
|
|
219
221
|
dispatch(removeProcessorApp({ processorApp }));
|
|
220
222
|
}, [dispatch]);
|
|
221
223
|
return /* @__PURE__ */ jsxs("div", {
|
|
222
|
-
className: "bg-gray-50 p-6",
|
|
224
|
+
className: "bg-gray-50 p-6 dark:bg-slate-800",
|
|
223
225
|
children: [/* @__PURE__ */ jsx(DocumentToolbar, {}), /* @__PURE__ */ jsx(ProcessorEditorForm, {
|
|
224
226
|
onNameChange,
|
|
225
227
|
onTypeChange,
|
|
@@ -239,4 +241,4 @@ function Editor() {
|
|
|
239
241
|
//#endregion
|
|
240
242
|
export { Editor as default };
|
|
241
243
|
|
|
242
|
-
//# sourceMappingURL=editor-
|
|
244
|
+
//# sourceMappingURL=editor-CM9tpwzR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-CM9tpwzR.js","names":[],"sources":["../editors/processor-editor/components/ProcessorEditorForm.tsx","../editors/processor-editor/config.ts","../editors/processor-editor/editor.tsx"],"sourcesContent":["import {\n PROCESSOR_APPS,\n type ProcessorApp,\n type ProcessorApps,\n} from \"@powerhousedao/shared/processors\";\nimport { useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport type { DocumentTypeItem } from \"../../../document-models/processor-module/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useAvailableDocumentTypes, useDebounce } from \"../../hooks/index.js\";\n\nexport interface ProcessorEditorFormProps {\n processorName?: string;\n processorType?: string;\n documentTypes?: DocumentTypeItem[];\n processorApps?: ProcessorApps;\n status?: string;\n onNameChange?: (name: string) => void;\n onTypeChange?: (type: string) => void;\n onAddDocumentType?: (id: string, documentType: string) => void;\n onRemoveDocumentType?: (id: string) => void;\n onAddProcessorApp?: (processorApp: ProcessorApp) => void;\n onRemoveProcessorApp?: (processorApp: ProcessorApp) => void;\n onConfirm?: () => void;\n}\n\nexport const ProcessorEditorForm: React.FC<ProcessorEditorFormProps> = ({\n processorName: initialProcessorName = \"\",\n processorType: initialProcessorType = \"\",\n documentTypes: initialDocumentTypes = [],\n processorApps: initialProcessorApps = [],\n status = \"DRAFT\",\n onNameChange,\n onTypeChange,\n onAddDocumentType,\n onRemoveDocumentType,\n onAddProcessorApp,\n onRemoveProcessorApp,\n onConfirm,\n}) => {\n const [processorName, setProcessorName] = useState(initialProcessorName);\n const [processorType, setProcessorType] = useState(initialProcessorType);\n const [documentTypes, setDocumentTypes] =\n useState<DocumentTypeItem[]>(initialDocumentTypes);\n const [selectedDocumentType, setSelectedDocumentType] = useState(\"\");\n const [processorApps, setProcessorApps] = useState(initialProcessorApps);\n const [isConfirmed, setIsConfirmed] = useState(false);\n\n // Get available document types from the hook (combines reactor and vetra drive)\n const availableDocumentTypes = useAvailableDocumentTypes();\n\n // Use the debounce hook for name and type changes\n useDebounce(processorName, onNameChange, 300);\n useDebounce(processorType, onTypeChange, 300);\n\n // Update local state when initial values change\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setProcessorName(initialProcessorName);\n }, [initialProcessorName]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setProcessorType(initialProcessorType);\n }, [initialProcessorType]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setDocumentTypes(initialDocumentTypes);\n }, [initialDocumentTypes]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setProcessorApps(initialProcessorApps);\n }, [initialProcessorApps]);\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (\n processorName.trim() &&\n processorType &&\n documentTypes.length > 0 &&\n processorApps.length > 0\n ) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm?.();\n }\n };\n\n const handleRemoveDocumentType = (id: string) => {\n setDocumentTypes(documentTypes.filter((dt) => dt.id !== id));\n onRemoveDocumentType?.(id);\n };\n\n const canConfirm =\n !!processorName.trim() &&\n !!processorType &&\n documentTypes.length > 0 &&\n processorApps.length > 0;\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-gray-900 dark:text-slate-50\">\n Processor Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* Processor Name Field */}\n <div>\n <label\n htmlFor=\"processor-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Processor Name\n </label>\n <input\n id=\"processor-name\"\n type=\"text\"\n value={processorName}\n onChange={(e) => setProcessorName(e.target.value)}\n disabled={isReadOnly}\n className={twMerge(\n \"w-full rounded-md border border-gray-300 px-3 py-2 placeholder:text-gray-700 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-200\",\n isReadOnly\n ? \"cursor-not-allowed bg-gray-100 dark:bg-slate-700\"\n : \"\",\n )}\n placeholder=\"Enter processor name\"\n />\n </div>\n\n {/* Processor Type Dropdown */}\n <div>\n <label\n htmlFor=\"processor-type\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Type\n </label>\n <select\n id=\"processor-type\"\n value={processorType}\n onChange={(e) => setProcessorType(e.target.value)}\n disabled={isReadOnly}\n className={twMerge(\n \"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\",\n isReadOnly\n ? \"cursor-not-allowed bg-gray-100 dark:bg-slate-700\"\n : \"\",\n )}\n >\n <option value=\"\">Select type...</option>\n <option value=\"analytics\">Analytics</option>\n <option value=\"relational\">Relational Database</option>\n </select>\n </div>\n\n {/* Document Types Field */}\n <div>\n <label\n htmlFor=\"document-types\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && availableDocumentTypes.length > 0 && (\n <select\n id=\"document-types\"\n value={selectedDocumentType}\n onChange={(e) => {\n const selectedValue = e.target.value;\n if (\n selectedValue &&\n !documentTypes.some((dt) => dt.documentType === selectedValue)\n ) {\n const id = Date.now().toString();\n const newType: DocumentTypeItem = {\n id,\n documentType: selectedValue,\n };\n setDocumentTypes([...documentTypes, newType]);\n onAddDocumentType?.(id, selectedValue);\n }\n setSelectedDocumentType(\"\");\n }}\n className=\"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\"\n >\n <option value=\"\">Select a document type to add</option>\n {availableDocumentTypes\n .filter(\n (docType) =>\n !documentTypes.some((dt) => dt.documentType === docType),\n )\n .map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n </select>\n )}\n <div className=\"space-y-1\">\n {documentTypes.map((type) => (\n <div key={type.id} className=\"flex items-center py-1\">\n <span className=\"text-sm text-gray-700 dark:text-slate-200\">\n {type.documentType}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => handleRemoveDocumentType(type.id)}\n className=\"ml-2 text-gray-400 hover:text-gray-600 focus:outline-none dark:text-slate-500 dark:hover:text-slate-300\"\n >\n ×\n </button>\n )}\n </div>\n ))}\n </div>\n </div>\n </div>\n {/* Processor Apps Field */}\n <div>\n <label\n htmlFor=\"processor-apps\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Processor Apps\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <>\n {PROCESSOR_APPS.map((processorApp) => (\n <div key={processorApp} className=\"flex gap-1\">\n <input\n type=\"checkbox\"\n name={processorApp}\n id={processorApp}\n checked={processorApps.includes(processorApp)}\n onChange={(event) => {\n const isChecked = event.target.checked;\n if (isChecked) {\n setProcessorApps((processorApps) => [\n ...new Set([...processorApps, processorApp]),\n ]);\n onAddProcessorApp?.(processorApp);\n } else {\n if (processorApps.length > 1) {\n setProcessorApps((processorApps) =>\n processorApps.filter((p) => p !== processorApp),\n );\n onRemoveProcessorApp?.(processorApp);\n }\n }\n }}\n />\n <label\n htmlFor={processorApp}\n className=\"text-gray-700 dark:text-slate-200\"\n >\n {processorApp}\n </label>\n </div>\n ))}\n </>\n )}\n <div className=\"space-y-1\">\n {isReadOnly &&\n processorApps.map((processorApp) => (\n <span\n key={processorApp}\n className=\"text-sm text-gray-700 dark:text-slate-200\"\n >\n {processorApp}\n </span>\n ))}\n </div>\n </div>\n </div>\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!canConfirm}\n className=\"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300 dark:bg-blue-300 dark:text-slate-900 dark:hover:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-100\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport type {\n ProcessorApp,\n ProcessorApps,\n} from \"@powerhousedao/shared/processors\";\nimport { useCallback } from \"react\";\nimport {\n addDocumentType,\n addProcessorApp,\n removeDocumentType,\n removeProcessorApp,\n setProcessorName,\n setProcessorStatus,\n setProcessorType,\n} from \"../../document-models/processor-module/index.js\";\nimport { useSelectedProcessorModuleDocument } from \"../hooks/useVetraDocument.js\";\nimport { ProcessorEditorForm } from \"./components/ProcessorEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedProcessorModuleDocument();\n\n const onConfirm = useCallback(() => {\n // Dispatch all actions at once\n dispatch([setProcessorStatus({ status: \"CONFIRMED\" })]);\n }, [dispatch]);\n\n const onNameChange = useCallback(\n (name: string) => {\n if (name === document.state.global.name) return;\n dispatch(setProcessorName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onTypeChange = useCallback(\n (type: string) => {\n if (type === document.state.global.type) return;\n dispatch(setProcessorType({ type }));\n },\n [document.state.global.type, dispatch],\n );\n\n const onAddDocumentType = useCallback(\n (id: string, documentType: string) => {\n dispatch(addDocumentType({ id, documentType }));\n },\n [dispatch],\n );\n\n const onRemoveDocumentType = useCallback(\n (id: string) => {\n dispatch(removeDocumentType({ id }));\n },\n [dispatch],\n );\n\n const onAddProcessorApp = useCallback(\n (processorApp: ProcessorApp) => {\n dispatch(addProcessorApp({ processorApp }));\n },\n [dispatch],\n );\n\n const onRemoveProcessorApp = useCallback(\n (processorApp: ProcessorApp) => {\n dispatch(removeProcessorApp({ processorApp }));\n },\n [dispatch],\n );\n\n return (\n <div className=\"bg-gray-50 p-6 dark:bg-slate-800\">\n <DocumentToolbar />\n <ProcessorEditorForm\n onNameChange={onNameChange}\n onTypeChange={onTypeChange}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n onAddProcessorApp={onAddProcessorApp}\n onRemoveProcessorApp={onRemoveProcessorApp}\n status={document.state.global.status}\n processorName={document.state.global.name ?? \"\"}\n processorType={document.state.global.type ?? \"\"}\n documentTypes={document.state.global.documentTypes ?? []}\n processorApps={document.state.global.processorApps as ProcessorApps}\n onConfirm={onConfirm}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AA0BA,MAAa,uBAA2D,EACtE,eAAe,uBAAuB,IACtC,eAAe,uBAAuB,IACtC,eAAe,uBAAuB,EAAE,EACxC,eAAe,uBAAuB,EAAE,EACxC,SAAS,SACT,cACA,cACA,mBACA,sBACA,mBACA,sBACA,gBACI;CACJ,MAAM,CAAC,eAAe,oBAAoB,SAAS,qBAAqB;CACxE,MAAM,CAAC,eAAe,oBAAoB,SAAS,qBAAqB;CACxE,MAAM,CAAC,eAAe,oBACpB,SAA6B,qBAAqB;CACpD,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,GAAG;CACpE,MAAM,CAAC,eAAe,oBAAoB,SAAS,qBAAq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,SAAS,MAAM,OAAO,QAAQ;GAC7C,eAAe,SAAS,MAAM,OAAO,iBAAiB,EAAE;GACxD,eAAe,SAAS,MAAM,OAAO;GAC1B;GACX,CAAA,CACE"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { b as setAppStatus, g as addDocumentType, h as setDragAndDropEnabled, v as removeDocumentType, x as setDocumentTypes, y as setAppName } from "./utils-
|
|
2
|
-
import { s as useSelectedAppModuleDocument } from "./app-module-
|
|
1
|
+
import { b as setAppStatus, g as addDocumentType, h as setDragAndDropEnabled, v as removeDocumentType, x as setDocumentTypes, y as setAppName } from "./utils-B4KdjDnp.js";
|
|
2
|
+
import { s as useSelectedAppModuleDocument } from "./app-module-dG7ug7Cm.js";
|
|
3
3
|
import { StatusPill } from "./editors/components/index.js";
|
|
4
4
|
import { t as useDebounce } from "./hooks-Btogj1f0.js";
|
|
5
5
|
import { useDocumentTypesInSelectedDrive, useSetPHDocumentEditorConfig, useSupportedDocumentTypesInReactor } from "@powerhousedao/reactor-browser";
|
|
6
6
|
import { useCallback, useEffect, useState } from "react";
|
|
7
|
+
import { twMerge } from "tailwind-merge";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { DocumentToolbar } from "@powerhousedao/design-system/connect";
|
|
9
10
|
//#region editors/app-editor/components/AppEditorForm.tsx
|
|
@@ -25,7 +26,7 @@ const AppEditorForm = () => {
|
|
|
25
26
|
if (name === documentName) return;
|
|
26
27
|
console.log("onNameChange", name);
|
|
27
28
|
dispatch(setAppName({ name }));
|
|
28
|
-
}, [documentName]), 300);
|
|
29
|
+
}, [documentName, dispatch]), 300);
|
|
29
30
|
const onConfirm = () => {
|
|
30
31
|
dispatch(setAppStatus({ status: "CONFIRMED" }));
|
|
31
32
|
};
|
|
@@ -78,7 +79,7 @@ const AppEditorForm = () => {
|
|
|
78
79
|
/* @__PURE__ */ jsxs("div", {
|
|
79
80
|
className: "flex items-center justify-between",
|
|
80
81
|
children: [/* @__PURE__ */ jsx("h2", {
|
|
81
|
-
className: "text-lg font-medium text-gray-900",
|
|
82
|
+
className: "text-lg font-medium text-gray-900 dark:text-slate-50",
|
|
82
83
|
children: "App Configuration"
|
|
83
84
|
}), /* @__PURE__ */ jsx(StatusPill, {
|
|
84
85
|
status: status === "CONFIRMED" ? "confirmed" : "draft",
|
|
@@ -87,7 +88,7 @@ const AppEditorForm = () => {
|
|
|
87
88
|
}),
|
|
88
89
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
89
90
|
htmlFor: "app-name",
|
|
90
|
-
className: "mb-2 block text-sm font-medium text-gray-700",
|
|
91
|
+
className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
|
|
91
92
|
children: "App Name"
|
|
92
93
|
}), /* @__PURE__ */ jsx("input", {
|
|
93
94
|
id: "app-name",
|
|
@@ -95,18 +96,18 @@ const AppEditorForm = () => {
|
|
|
95
96
|
value: appName,
|
|
96
97
|
onChange: (e) => handleSetAppName(e.target.value),
|
|
97
98
|
disabled: isReadOnly,
|
|
98
|
-
className:
|
|
99
|
+
className: twMerge("w-full rounded-md border border-gray-300 px-3 py-2 text-gray-50 placeholder:text-gray-400 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-400", isReadOnly ? "cursor-not-allowed bg-gray-100 dark:bg-slate-700" : ""),
|
|
99
100
|
placeholder: "Enter app name"
|
|
100
101
|
})] }),
|
|
101
102
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
102
103
|
htmlFor: "document-types",
|
|
103
|
-
className: "mb-2 block text-sm font-medium text-gray-700",
|
|
104
|
+
className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
|
|
104
105
|
children: "Document Types"
|
|
105
106
|
}), /* @__PURE__ */ jsxs("div", {
|
|
106
107
|
className: "space-y-2",
|
|
107
108
|
children: [!isReadOnly && /* @__PURE__ */ jsxs("select", {
|
|
108
109
|
onChange: (e) => handleDocumentTypeSelection(e.target.value),
|
|
109
|
-
className: "w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none",
|
|
110
|
+
className: "w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100",
|
|
110
111
|
children: [
|
|
111
112
|
/* @__PURE__ */ jsx("option", { children: "Select a document type to add" }),
|
|
112
113
|
/* @__PURE__ */ jsx("option", { children: "--- Vetra drive document types ---" }),
|
|
@@ -138,21 +139,21 @@ const AppEditorForm = () => {
|
|
|
138
139
|
children: selectedDocumentTypes.length > 0 ? selectedDocumentTypes.map((type) => /* @__PURE__ */ jsxs("div", {
|
|
139
140
|
className: "flex items-center py-1",
|
|
140
141
|
children: [/* @__PURE__ */ jsx("span", {
|
|
141
|
-
className: "text-sm text-gray-700",
|
|
142
|
+
className: "text-sm text-gray-700 dark:text-slate-200",
|
|
142
143
|
children: type
|
|
143
144
|
}), !isReadOnly && /* @__PURE__ */ jsx("button", {
|
|
144
145
|
onClick: () => handleRemoveDocumentType(type),
|
|
145
|
-
className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none",
|
|
146
|
+
className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none dark:text-slate-500 dark:hover:text-slate-300",
|
|
146
147
|
children: "×"
|
|
147
148
|
})]
|
|
148
149
|
}, type)) : /* @__PURE__ */ jsx("span", {
|
|
149
|
-
className: "text-sm text-gray-700",
|
|
150
|
+
className: "text-sm text-gray-700 dark:text-slate-200",
|
|
150
151
|
children: "All documents (*)"
|
|
151
152
|
})
|
|
152
153
|
})]
|
|
153
154
|
})] }),
|
|
154
155
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
|
|
155
|
-
className: "mb-4 text-base font-medium text-gray-900",
|
|
156
|
+
className: "mb-4 text-base font-medium text-gray-900 dark:text-slate-50",
|
|
156
157
|
children: "Drag and Drop Settings"
|
|
157
158
|
}), /* @__PURE__ */ jsx("div", {
|
|
158
159
|
className: "mb-4",
|
|
@@ -165,9 +166,9 @@ const AppEditorForm = () => {
|
|
|
165
166
|
checked: isDragAndDropEnabled,
|
|
166
167
|
onChange: (e) => onDragAndDropToggle(e.target.checked),
|
|
167
168
|
disabled: isReadOnly,
|
|
168
|
-
className:
|
|
169
|
+
className: twMerge("mr-2 size-4 rounded-sm border-gray-300 text-blue-600 focus:ring-blue-500 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100", isReadOnly ? "cursor-not-allowed" : "")
|
|
169
170
|
}), /* @__PURE__ */ jsx("span", {
|
|
170
|
-
className: "text-sm font-medium text-gray-700",
|
|
171
|
+
className: "text-sm font-medium text-gray-700 dark:text-slate-200",
|
|
171
172
|
children: "Enable drag and drop"
|
|
172
173
|
})]
|
|
173
174
|
})
|
|
@@ -175,7 +176,7 @@ const AppEditorForm = () => {
|
|
|
175
176
|
!isReadOnly && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("button", {
|
|
176
177
|
onClick: handleConfirm,
|
|
177
178
|
disabled: !appName.trim(),
|
|
178
|
-
className: "rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300",
|
|
179
|
+
className: "rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300 dark:bg-blue-300 dark:text-slate-900 dark:hover:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-100",
|
|
179
180
|
children: "Confirm"
|
|
180
181
|
}) })
|
|
181
182
|
]
|
|
@@ -189,11 +190,11 @@ const editorConfig = { isExternalControlsEnabled: false };
|
|
|
189
190
|
function Editor() {
|
|
190
191
|
useSetPHDocumentEditorConfig(editorConfig);
|
|
191
192
|
return /* @__PURE__ */ jsxs("div", {
|
|
192
|
-
className: "bg-gray-50 p-6",
|
|
193
|
+
className: "bg-gray-50 p-6 dark:bg-slate-800",
|
|
193
194
|
children: [/* @__PURE__ */ jsx(DocumentToolbar, {}), /* @__PURE__ */ jsx(AppEditorForm, {})]
|
|
194
195
|
});
|
|
195
196
|
}
|
|
196
197
|
//#endregion
|
|
197
198
|
export { Editor as default };
|
|
198
199
|
|
|
199
|
-
//# sourceMappingURL=editor-
|
|
200
|
+
//# sourceMappingURL=editor-D-QqGEkw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-D-QqGEkw.js","names":[],"sources":["../editors/app-editor/components/AppEditorForm.tsx","../editors/app-editor/config.ts","../editors/app-editor/editor.tsx"],"sourcesContent":["import {\n useDocumentTypesInSelectedDrive,\n useSupportedDocumentTypesInReactor,\n} from \"@powerhousedao/reactor-browser\";\nimport {\n addDocumentType,\n removeDocumentType,\n setAppName,\n setAppStatus,\n setDocumentTypes,\n setDragAndDropEnabled,\n} from \"@powerhousedao/vetra/document-models/app-module\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { useSelectedAppModuleDocument } from \"../../../document-models/app-module/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useDebounce } from \"../../hooks/index.js\";\n\nconst ALL_IN_DRIVE = \"all-in-drive\";\nconst ALL_IN_REACTOR = \"all-in-reactor\";\nconst ALLOW_ANY = \"allow-any\";\n\nexport const AppEditorForm = () => {\n const [document, dispatch] = useSelectedAppModuleDocument();\n const documentName = document.state.global.name;\n const status = document.state.global.status;\n const isDragAndDropEnabled = document.state.global.isDragAndDropEnabled;\n const allowedDocumentTypes = document.state.global.allowedDocumentTypes;\n const [appName, handleSetAppName] = useState(documentName);\n const [isConfirmed, setIsConfirmed] = useState(status === \"CONFIRMED\");\n const documentTypesInSelectedDrive = useDocumentTypesInSelectedDrive();\n const supportedDocumentTypesInReactor = useSupportedDocumentTypesInReactor();\n const [selectedDocumentTypes, setSelectedDocumentTypes] = useState(\n allowedDocumentTypes ?? [],\n );\n\n // Use the debounce hook for name changes\n\n const onNameChange = useCallback(\n (name: string) => {\n if (name === documentName) return;\n console.log(\"onNameChange\", name);\n dispatch(setAppName({ name }));\n },\n [documentName, dispatch],\n );\n\n useDebounce(appName, onNameChange, 300);\n\n const onConfirm = () => {\n dispatch(setAppStatus({ status: \"CONFIRMED\" }));\n };\n\n const onDragAndDropToggle = (enabled: boolean) => {\n if (enabled === isDragAndDropEnabled) return;\n dispatch(setDragAndDropEnabled({ enabled }));\n };\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (appName.trim()) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm();\n }\n };\n\n const handleAddDocumentType = (documentType: string) => {\n if (!documentType || selectedDocumentTypes.includes(documentType)) return;\n setSelectedDocumentTypes([...selectedDocumentTypes, documentType]);\n dispatch(addDocumentType({ documentType }));\n };\n\n const handleRemoveDocumentType = (documentType: string) => {\n setSelectedDocumentTypes(\n selectedDocumentTypes.filter((dt) => dt !== documentType),\n );\n dispatch(removeDocumentType({ documentType }));\n };\n\n const handleAddAllDocumentTypesInDrive = () => {\n const newDocumentTypes = [\n ...new Set([\n ...selectedDocumentTypes,\n ...(documentTypesInSelectedDrive ?? []),\n ]),\n ];\n setSelectedDocumentTypes(newDocumentTypes);\n dispatch(setDocumentTypes({ documentTypes: newDocumentTypes }));\n };\n\n const handleAddAllDocumentTypesInReactor = () => {\n const newDocumentTypes = [\n ...new Set([\n ...selectedDocumentTypes,\n ...(supportedDocumentTypesInReactor ?? []),\n ]),\n ];\n setSelectedDocumentTypes(newDocumentTypes);\n dispatch(setDocumentTypes({ documentTypes: newDocumentTypes }));\n };\n\n const handleAllowAnyDocumentType = () => {\n setSelectedDocumentTypes([]);\n dispatch(setDocumentTypes({ documentTypes: [] }));\n };\n\n const handleDocumentTypeSelection = (selectedValue: string) => {\n if (selectedValue === ALL_IN_DRIVE) {\n handleAddAllDocumentTypesInDrive();\n } else if (selectedValue === ALL_IN_REACTOR) {\n handleAddAllDocumentTypesInReactor();\n } else if (selectedValue === ALLOW_ANY) {\n handleAllowAnyDocumentType();\n } else {\n handleAddDocumentType(selectedValue);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-gray-900 dark:text-slate-50\">\n App Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* App Name Field */}\n <div>\n <label\n htmlFor=\"app-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n App Name\n </label>\n <input\n id=\"app-name\"\n type=\"text\"\n value={appName}\n onChange={(e) => handleSetAppName(e.target.value)}\n disabled={isReadOnly}\n className={twMerge(\n \"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-50 placeholder:text-gray-400 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-400\",\n isReadOnly\n ? \"cursor-not-allowed bg-gray-100 dark:bg-slate-700\"\n : \"\",\n )}\n placeholder=\"Enter app name\"\n />\n </div>\n\n {/* Document Types Field */}\n <div>\n <label\n htmlFor=\"document-types\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <select\n onChange={(e) => handleDocumentTypeSelection(e.target.value)}\n className=\"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\"\n >\n <option>Select a document type to add</option>\n <option>--- Vetra drive document types ---</option>\n <option value={ALL_IN_DRIVE}>\n Add all document types in Vetra drive\n </option>\n {documentTypesInSelectedDrive\n ?.filter((dt) => !selectedDocumentTypes.includes(dt))\n .map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n <option>--- Reactor document types ---</option>\n <option value={ALL_IN_REACTOR}>\n Add all document types in Reactor\n </option>\n {supportedDocumentTypesInReactor\n ?.filter((dt) => !selectedDocumentTypes.includes(dt))\n .map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n <option>--- Allow any document type ---</option>\n <option value={ALLOW_ANY}>Allow any document type</option>\n </select>\n )}\n <div className=\"space-y-1\">\n {selectedDocumentTypes.length > 0 ? (\n selectedDocumentTypes.map((type) => (\n <div key={type} className=\"flex items-center py-1\">\n <span className=\"text-sm text-gray-700 dark:text-slate-200\">\n {type}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => handleRemoveDocumentType(type)}\n className=\"ml-2 text-gray-400 hover:text-gray-600 focus:outline-none dark:text-slate-500 dark:hover:text-slate-300\"\n >\n ×\n </button>\n )}\n </div>\n ))\n ) : (\n <span className=\"text-sm text-gray-700 dark:text-slate-200\">\n All documents (*)\n </span>\n )}\n </div>\n </div>\n </div>\n\n {/* Drag and Drop Settings */}\n <div>\n <h3 className=\"mb-4 text-base font-medium text-gray-900 dark:text-slate-50\">\n Drag and Drop Settings\n </h3>\n\n {/* Enable/Disable Switch */}\n <div className=\"mb-4\">\n <label htmlFor=\"drag-and-drop-enabled\" className=\"flex items-center\">\n <input\n id=\"drag-and-drop-enabled\"\n type=\"checkbox\"\n checked={isDragAndDropEnabled}\n onChange={(e) => onDragAndDropToggle(e.target.checked)}\n disabled={isReadOnly}\n className={twMerge(\n \"mr-2 size-4 rounded-sm border-gray-300 text-blue-600 focus:ring-blue-500 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\",\n isReadOnly ? \"cursor-not-allowed\" : \"\",\n )}\n />\n <span className=\"text-sm font-medium text-gray-700 dark:text-slate-200\">\n Enable drag and drop\n </span>\n </label>\n </div>\n </div>\n\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!appName.trim()}\n className=\"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300 dark:bg-blue-300 dark:text-slate-900 dark:hover:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-100\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { AppEditorForm } from \"./components/AppEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n\n return (\n <div className=\"bg-gray-50 p-6 dark:bg-slate-800\">\n <DocumentToolbar />\n <AppEditorForm />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAkBA,MAAM,eAAe;AACrB,MAAM,iBAAiB;AACvB,MAAM,YAAY;AAElB,MAAa,sBAAsB;CACjC,MAAM,CAAC,UAAU,YAAY,8BAA8B;CAC3D,MAAM,eAAe,SAAS,MAAM,OAAO;CAC3C,MAAM,SAAS,SAAS,MAAM,OAAO;CACrC,MAAM,uBAAuB,SAAS,MAAM,OAAO;CACnD,MAAM,uBAAuB,SAAS,MAAM,OAA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