@powerhousedao/vetra 6.1.0-dev.13 → 6.1.0-dev.15

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.
@@ -4,6 +4,7 @@ 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
@@ -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: `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 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`,
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: `mr-2 size-4 rounded-sm border-gray-300 text-blue-600 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed" : ""}`
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-C7Bq7QAH.js.map
200
+ //# sourceMappingURL=editor-BQxk6LrL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-BQxk6LrL.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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WAAU;eAAjD,CACE,oBAAC,SAAD;MACE,IAAG;MACH,MAAK;MACL,SAAS;MACT,WAAW,MAAM,oBAAoB,EAAE,OAAO,QAAQ;MACtD,UAAU;MACV,WAAW,QACT,wIACA,aAAa,uBAAuB,GACrC;MACD,CAAA,EACF,oBAAC,QAAD;MAAM,WAAU;gBAAwD;MAEjE,CAAA,CACD;;IACJ,CAAA,CACF,EAAA,CAAA;GAGL,CAAC,cACA,oBAAC,OAAD,EAAA,UACE,oBAAC,UAAD;IACE,SAAS;IACT,UAAU,CAAC,QAAQ,MAAM;IACzB,WAAU;cACX;IAEQ,CAAA,EACL,CAAA;GAEJ;;;;;AC5QV,MAAa,eAAuC,EAClD,2BAA2B,OAC5B;;;ACCD,SAAwB,SAAS;AAC/B,8BAA6B,aAAa;AAE1C,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,iBAAD,EAAmB,CAAA,EACnB,oBAAC,eAAD,EAAiB,CAAA,CACb"}
@@ -4,6 +4,7 @@ import { t as useDebounce } from "./hooks-Btogj1f0.js";
4
4
  import { r as useSelectedSubgraphModuleDocument } from "./useVetraDocument-BQKyels4.js";
5
5
  import { useSetPHDocumentEditorConfig } 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/subgraph-editor/components/SubgraphEditorForm.tsx
@@ -30,7 +31,7 @@ const SubgraphEditorForm = ({ subgraphName: initialSubgraphName = "", status = "
30
31
  /* @__PURE__ */ jsxs("div", {
31
32
  className: "flex items-center justify-between",
32
33
  children: [/* @__PURE__ */ jsx("h2", {
33
- className: "text-lg font-medium text-gray-900",
34
+ className: "text-lg font-medium text-gray-900 dark:text-slate-50",
34
35
  children: "Subgraph Configuration"
35
36
  }), /* @__PURE__ */ jsx(StatusPill, {
36
37
  status: status === "CONFIRMED" ? "confirmed" : "draft",
@@ -39,7 +40,7 @@ const SubgraphEditorForm = ({ subgraphName: initialSubgraphName = "", status = "
39
40
  }),
40
41
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
41
42
  htmlFor: "subgraph-name",
42
- className: "mb-2 block text-sm font-medium text-gray-700",
43
+ className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
43
44
  children: "Subgraph Name"
44
45
  }), /* @__PURE__ */ jsx("input", {
45
46
  id: "subgraph-name",
@@ -47,13 +48,13 @@ const SubgraphEditorForm = ({ subgraphName: initialSubgraphName = "", status = "
47
48
  value: subgraphName,
48
49
  onChange: (e) => setSubgraphName(e.target.value),
49
50
  disabled: isReadOnly,
50
- 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 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`,
51
+ 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" : ""),
51
52
  placeholder: "Enter subgraph name"
52
53
  })] }),
53
54
  !isReadOnly && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("button", {
54
55
  onClick: handleConfirm,
55
56
  disabled: !subgraphName.trim(),
56
- 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",
57
+ 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",
57
58
  children: "Confirm"
58
59
  }) })
59
60
  ]
@@ -75,7 +76,7 @@ function Editor() {
75
76
  dispatch(setSubgraphStatus({ status: "CONFIRMED" }));
76
77
  }, [dispatch]);
77
78
  return /* @__PURE__ */ jsxs("div", {
78
- className: "bg-gray-50 p-6",
79
+ className: "bg-gray-50 p-6 dark:bg-slate-800",
79
80
  children: [/* @__PURE__ */ jsx(DocumentToolbar, {}), /* @__PURE__ */ jsx(SubgraphEditorForm, {
80
81
  subgraphName: document.state.global.name ?? "",
81
82
  status: document.state.global.status,
@@ -87,4 +88,4 @@ function Editor() {
87
88
  //#endregion
88
89
  export { Editor as default };
89
90
 
90
- //# sourceMappingURL=editor-BA4wcz-O.js.map
91
+ //# sourceMappingURL=editor-ClvvgHg3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-ClvvgHg3.js","names":[],"sources":["../editors/subgraph-editor/components/SubgraphEditorForm.tsx","../editors/subgraph-editor/config.ts","../editors/subgraph-editor/editor.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useDebounce } from \"../../hooks/index.js\";\n\nexport interface SubgraphEditorFormProps {\n subgraphName?: string;\n status?: string;\n onNameChange?: (name: string) => void;\n onConfirm?: () => void;\n}\n\nexport const SubgraphEditorForm: React.FC<SubgraphEditorFormProps> = ({\n subgraphName: initialSubgraphName = \"\",\n status = \"DRAFT\",\n onNameChange,\n onConfirm,\n}) => {\n const [subgraphName, setSubgraphName] = useState(initialSubgraphName);\n const [isConfirmed, setIsConfirmed] = useState(false);\n\n // Use the debounce hook for name changes\n useDebounce(subgraphName, onNameChange, 300);\n\n // Update local state when initialSubgraphName changes\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setSubgraphName(initialSubgraphName);\n }, [initialSubgraphName]);\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 (subgraphName.trim()) {\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 Subgraph Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* Subgraph Name Field */}\n <div>\n <label\n htmlFor=\"subgraph-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Subgraph Name\n </label>\n <input\n id=\"subgraph-name\"\n type=\"text\"\n value={subgraphName}\n onChange={(e) => setSubgraphName(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 subgraph name\"\n />\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={!subgraphName.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 {\n setSubgraphName,\n setSubgraphStatus,\n} from \"@powerhousedao/vetra/document-models/subgraph-module\";\nimport { useCallback } from \"react\";\nimport { useSelectedSubgraphModuleDocument } from \"../hooks/useVetraDocument.js\";\nimport { SubgraphEditorForm } from \"./components/SubgraphEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedSubgraphModuleDocument();\n\n const onNameChange = useCallback(\n (name: string) => {\n if (name === document.state.global.name) return;\n dispatch(setSubgraphName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onConfirm = useCallback(() => {\n dispatch(setSubgraphStatus({ status: \"CONFIRMED\" }));\n }, [dispatch]);\n\n return (\n <div className=\"bg-gray-50 p-6 dark:bg-slate-800\">\n <DocumentToolbar />\n <SubgraphEditorForm\n subgraphName={document.state.global.name ?? \"\"}\n status={document.state.global.status}\n onNameChange={onNameChange}\n onConfirm={onConfirm}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAYA,MAAa,sBAAyD,EACpE,cAAc,sBAAsB,IACpC,SAAS,SACT,cACA,gBACI;CACJ,MAAM,CAAC,cAAc,mBAAmB,SAAS,oBAAoB;CACrE,MAAM,CAAC,aAAa,kBAAkB,SAAS,MAAM;AAGrD,aAAY,cAAc,cAAc,IAAI;AAG5C,iBAAgB;AAEd,kBAAgB,oBAAoB;IACnC,CAAC,oBAAoB,CAAC;AAGzB,iBAAgB;AACd,MAAI,WAAW,QAEb,gBAAe,MAAM;IAEtB,CAAC,OAAO,CAAC;CAGZ,MAAM,aAAa,eAAe,WAAW;CAE7C,MAAM,sBAAsB;AAC1B,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GAC5C,QAAQ,SAAS,MAAM,OAAO;GAChB;GACH;GACX,CAAA,CACE"}
@@ -30,24 +30,24 @@ const MetaForm = (props) => {
30
30
  className: "space-y-6",
31
31
  children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
32
32
  htmlFor: "package-name",
33
- className: "mb-2 block text-sm font-medium text-gray-700",
33
+ className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
34
34
  children: "Name"
35
35
  }), /* @__PURE__ */ jsx("input", {
36
36
  id: "package-name",
37
37
  type: "text",
38
38
  value: name,
39
39
  onChange: (e) => setName(e.target.value),
40
- 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"
40
+ className: "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"
41
41
  })] }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
42
42
  htmlFor: "package-description",
43
- className: "mb-2 block text-sm font-medium text-gray-700",
43
+ className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
44
44
  children: "Description"
45
45
  }), /* @__PURE__ */ jsx("textarea", {
46
46
  id: "package-description",
47
47
  rows: 6,
48
48
  value: description,
49
49
  onChange: (e) => setDescription(e.target.value),
50
- className: "w-full resize-none rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none"
50
+ className: "w-full resize-none rounded-md border border-gray-300 px-3 py-2 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"
51
51
  })] })]
52
52
  }),
53
53
  /* @__PURE__ */ jsxs("div", {
@@ -55,7 +55,7 @@ const MetaForm = (props) => {
55
55
  children: [
56
56
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
57
57
  htmlFor: "package-category",
58
- className: "mb-2 block text-sm font-medium text-gray-700",
58
+ className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
59
59
  children: "Category"
60
60
  }), /* @__PURE__ */ jsxs("select", {
61
61
  id: "package-category",
@@ -65,7 +65,7 @@ const MetaForm = (props) => {
65
65
  setCategory(newValue);
66
66
  onCategoryChange?.(newValue);
67
67
  },
68
- 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",
68
+ 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",
69
69
  children: [
70
70
  /* @__PURE__ */ jsx("option", {
71
71
  value: "",
@@ -103,29 +103,29 @@ const MetaForm = (props) => {
103
103
  })] }),
104
104
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
105
105
  htmlFor: "package-publisher",
106
- className: "mb-2 block text-sm font-medium text-gray-700",
106
+ className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
107
107
  children: "Publisher"
108
108
  }), /* @__PURE__ */ jsx("input", {
109
109
  id: "package-publisher",
110
110
  type: "text",
111
111
  value: publisher,
112
112
  onChange: (e) => setPublisher(e.target.value),
113
- 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"
113
+ className: "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"
114
114
  })] }),
115
115
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
116
116
  htmlFor: "package-publisher-url",
117
- className: "mb-2 block text-sm font-medium text-gray-700",
117
+ className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
118
118
  children: "Publisher URL"
119
119
  }), /* @__PURE__ */ jsx("input", {
120
120
  id: "package-publisher-url",
121
121
  type: "text",
122
122
  value: publisherUrl,
123
123
  onChange: (e) => setPublisherUrl(e.target.value),
124
- 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"
124
+ className: "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"
125
125
  })] }),
126
126
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
127
127
  htmlFor: "package-keywords",
128
- className: "mb-2 block text-sm font-medium text-gray-700",
128
+ className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
129
129
  children: "Keywords"
130
130
  }), /* @__PURE__ */ jsxs("div", {
131
131
  className: "space-y-2",
@@ -147,17 +147,17 @@ const MetaForm = (props) => {
147
147
  }
148
148
  },
149
149
  placeholder: "Type a keyword and press Enter",
150
- 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"
150
+ className: "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"
151
151
  }), /* @__PURE__ */ jsx("div", {
152
- className: "flex min-h-[80px] flex-wrap gap-2 rounded-md border border-gray-300 p-3",
152
+ className: "flex min-h-[80px] flex-wrap gap-2 rounded-md border border-gray-300 p-3 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100",
153
153
  children: keywords.map((keyword) => /* @__PURE__ */ jsxs("span", {
154
- className: "inline-flex items-center rounded-sm border border-blue-300 bg-blue-100 px-2 py-0.5 text-xs text-blue-800",
154
+ className: "inline-flex items-center rounded-sm border border-blue-300 bg-blue-100 px-2 py-0.5 text-xs text-blue-800 dark:border-blue-600 dark:bg-blue-800 dark:text-blue-100",
155
155
  children: [keyword.label, /* @__PURE__ */ jsx("button", {
156
156
  onClick: () => {
157
157
  setKeywords(keywords.filter((k) => k.id !== keyword.id));
158
158
  onRemoveKeyword?.(keyword.id);
159
159
  },
160
- className: "ml-1 text-blue-600 hover:text-blue-800 focus:outline-none",
160
+ className: "ml-1 text-blue-600 hover:text-blue-800 focus:outline-none dark:text-blue-100 dark:hover:text-blue-100",
161
161
  children: "×"
162
162
  })]
163
163
  }, keyword.id))
@@ -170,58 +170,58 @@ const MetaForm = (props) => {
170
170
  children: [
171
171
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
172
172
  htmlFor: "package-github",
173
- className: "mb-2 block text-sm font-medium text-gray-700",
173
+ className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
174
174
  children: "Github Repository"
175
175
  }), /* @__PURE__ */ jsx("input", {
176
176
  id: "package-github",
177
177
  type: "text",
178
178
  value: githubRepository,
179
179
  onChange: (e) => setGithubRepository(e.target.value),
180
- 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"
180
+ className: "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"
181
181
  })] }),
182
182
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
183
183
  htmlFor: "package-npm",
184
- className: "mb-2 block text-sm font-medium text-gray-700",
184
+ className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
185
185
  children: "NPM-package"
186
186
  }), /* @__PURE__ */ jsx("input", {
187
187
  id: "package-npm",
188
188
  type: "text",
189
189
  value: npmPackage,
190
190
  onChange: (e) => setNpmPackage(e.target.value),
191
- 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"
191
+ className: "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"
192
192
  })] }),
193
193
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
194
194
  htmlFor: "package-version",
195
- className: "mb-2 block text-sm font-medium text-gray-700",
195
+ className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
196
196
  children: "Version"
197
197
  }), /* @__PURE__ */ jsx("input", {
198
198
  id: "package-version",
199
199
  type: "text",
200
200
  placeholder: "1.0.0-dev",
201
201
  readOnly: true,
202
- className: "w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500"
202
+ className: "w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500 placeholder:text-gray-700 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-200"
203
203
  })] }),
204
204
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
205
205
  htmlFor: "package-license",
206
- className: "mb-2 block text-sm font-medium text-gray-700",
206
+ className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
207
207
  children: "License"
208
208
  }), /* @__PURE__ */ jsx("input", {
209
209
  id: "package-license",
210
210
  type: "text",
211
211
  placeholder: "AGPL-3.0-only",
212
212
  readOnly: true,
213
- className: "w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500"
213
+ className: "w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500 placeholder:text-gray-700 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-200"
214
214
  })] }),
215
215
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
216
216
  htmlFor: "package-install",
217
- className: "mb-2 block text-sm font-medium text-gray-700",
217
+ className: "mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200",
218
218
  children: "Install with:"
219
219
  }), /* @__PURE__ */ jsx("input", {
220
220
  id: "package-install",
221
221
  type: "text",
222
222
  placeholder: "@powerhousedao/todo-demo-package",
223
223
  readOnly: true,
224
- className: "w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500"
224
+ className: "w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500 placeholder:text-gray-700 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-200"
225
225
  })] })
226
226
  ]
227
227
  })
@@ -279,7 +279,7 @@ function Editor(props) {
279
279
  dispatch(removePackageKeyword({ id }));
280
280
  }, [dispatch]);
281
281
  return /* @__PURE__ */ jsxs("div", {
282
- className: "bg-gray-50 p-6",
282
+ className: "bg-gray-50 p-6 dark:bg-slate-800",
283
283
  children: [displayToolbar && /* @__PURE__ */ jsx(DocumentToolbar, {}), /* @__PURE__ */ jsx(MetaForm, {
284
284
  name: document.state.global.name ?? "",
285
285
  description: document.state.global.description ?? "",
@@ -304,4 +304,4 @@ function Editor(props) {
304
304
  //#endregion
305
305
  export { Editor as default };
306
306
 
307
- //# sourceMappingURL=editor-DoSkOXqJ.js.map
307
+ //# sourceMappingURL=editor-DLluDQKM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-DLluDQKM.js","names":[],"sources":["../editors/vetra-package/components/MetaForm.tsx","../editors/vetra-package/config.ts","../editors/vetra-package/editor.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport type { Keyword } from \"../../../document-models/vetra-package/index.js\";\nimport { useDebounce } from \"../../hooks/index.js\";\n\nexport interface MetaFormProps {\n name: string;\n description: string;\n category: string;\n publisher: string;\n publisherUrl: string;\n githubRepository: string;\n npmPackage: string;\n keywords: Keyword[];\n onNameChange?: (name: string) => void;\n onDescriptionChange?: (description: string) => void;\n onCategoryChange?: (category: string) => void;\n onPublisherChange?: (publisher: string) => void;\n onPublisherUrlChange?: (publisherUrl: string) => void;\n onGithubRepositoryChange?: (githubRepository: string) => void;\n onNpmPackageChange?: (npmPackage: string) => void;\n onAddKeyword?: (keyword: { id: string; label: string }) => void;\n onRemoveKeyword?: (id: string) => void;\n}\n\nexport const MetaForm: React.FC<MetaFormProps> = (props) => {\n const {\n name: initialName,\n description: initialDescription,\n category: initialCategory,\n publisher: initialPublisher,\n publisherUrl: initialPublisherUrl,\n githubRepository: initialGithubRepository,\n npmPackage: initialNpmPackage,\n keywords: initialKeywords,\n onNameChange,\n onDescriptionChange,\n onCategoryChange,\n onPublisherChange,\n onPublisherUrlChange,\n onGithubRepositoryChange,\n onNpmPackageChange,\n onAddKeyword,\n onRemoveKeyword,\n } = props;\n\n const [name, setName] = useState(initialName);\n const [description, setDescription] = useState(initialDescription);\n const [category, setCategory] = useState(initialCategory);\n const [publisher, setPublisher] = useState(initialPublisher);\n const [publisherUrl, setPublisherUrl] = useState(initialPublisherUrl);\n const [githubRepository, setGithubRepository] = useState(\n initialGithubRepository,\n );\n const [npmPackage, setNpmPackage] = useState(initialNpmPackage);\n\n // Keywords state\n const [keywords, setKeywords] = useState<Keyword[]>(initialKeywords);\n const [keywordInput, setKeywordInput] = useState(\"\");\n\n // Use the debounce hook with callbacks\n useDebounce(name, onNameChange, 300);\n useDebounce(description, onDescriptionChange, 300);\n useDebounce(publisher, onPublisherChange, 300);\n useDebounce(publisherUrl, onPublisherUrlChange, 300);\n useDebounce(githubRepository, onGithubRepositoryChange, 300);\n useDebounce(npmPackage, onNpmPackageChange, 300);\n\n return (\n <div className=\"grid grid-cols-1 gap-6 p-6 lg:grid-cols-3\">\n {/* Left Column */}\n <div className=\"space-y-6\">\n {/* Name Field */}\n <div>\n <label\n htmlFor=\"package-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Name\n </label>\n <input\n id=\"package-name\"\n type=\"text\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n className=\"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 />\n </div>\n\n {/* Description Field */}\n <div>\n <label\n htmlFor=\"package-description\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Description\n </label>\n <textarea\n id=\"package-description\"\n rows={6}\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n className=\"w-full resize-none rounded-md border border-gray-300 px-3 py-2 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 </div>\n </div>\n\n {/* Middle Column */}\n <div className=\"space-y-6\">\n {/* Category Field */}\n <div>\n <label\n htmlFor=\"package-category\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Category\n </label>\n <select\n id=\"package-category\"\n value={category}\n onChange={(e) => {\n const newValue = e.target.value;\n setCategory(newValue);\n onCategoryChange?.(newValue);\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=\"\">Not selected</option>\n <option value=\"Productivity\">Productivity</option>\n <option value=\"Governance\">Governance</option>\n <option value=\"Project Management\">Project Management</option>\n <option value=\"Finance\">Finance</option>\n <option value=\"Legal\">Legal</option>\n <option value=\"People & Culture\">People & Culture</option>\n <option value=\"Engineering\">Engineering</option>\n </select>\n </div>\n\n {/* Publisher Field */}\n <div>\n <label\n htmlFor=\"package-publisher\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Publisher\n </label>\n <input\n id=\"package-publisher\"\n type=\"text\"\n value={publisher}\n onChange={(e) => setPublisher(e.target.value)}\n className=\"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 />\n </div>\n\n {/* Publisher URL Field */}\n <div>\n <label\n htmlFor=\"package-publisher-url\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Publisher URL\n </label>\n <input\n id=\"package-publisher-url\"\n type=\"text\"\n value={publisherUrl}\n onChange={(e) => setPublisherUrl(e.target.value)}\n className=\"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 />\n </div>\n\n {/* Keywords Field */}\n <div>\n <label\n htmlFor=\"package-keywords\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Keywords\n </label>\n <div className=\"space-y-2\">\n <input\n id=\"package-keywords\"\n type=\"text\"\n value={keywordInput}\n onChange={(e) => setKeywordInput(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && keywordInput.trim()) {\n e.preventDefault();\n const newKeyword = {\n id: Date.now().toString(), // Generate a unique ID\n label: keywordInput.trim(),\n };\n setKeywords([...keywords, newKeyword]);\n onAddKeyword?.(newKeyword);\n setKeywordInput(\"\");\n }\n }}\n placeholder=\"Type a keyword and press Enter\"\n className=\"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 />\n <div className=\"flex min-h-[80px] flex-wrap gap-2 rounded-md border border-gray-300 p-3 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\">\n {keywords.map((keyword) => (\n <span\n key={keyword.id}\n className=\"inline-flex items-center rounded-sm border border-blue-300 bg-blue-100 px-2 py-0.5 text-xs text-blue-800 dark:border-blue-600 dark:bg-blue-800 dark:text-blue-100\"\n >\n {keyword.label}\n <button\n onClick={() => {\n setKeywords(keywords.filter((k) => k.id !== keyword.id));\n onRemoveKeyword?.(keyword.id);\n }}\n className=\"ml-1 text-blue-600 hover:text-blue-800 focus:outline-none dark:text-blue-100 dark:hover:text-blue-100\"\n >\n ×\n </button>\n </span>\n ))}\n </div>\n </div>\n </div>\n </div>\n\n {/* Right Column */}\n <div className=\"space-y-6\">\n {/* Github Repository Field */}\n <div>\n <label\n htmlFor=\"package-github\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Github Repository\n </label>\n <input\n id=\"package-github\"\n type=\"text\"\n value={githubRepository}\n onChange={(e) => setGithubRepository(e.target.value)}\n className=\"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 />\n </div>\n\n {/* NPM-package Field */}\n <div>\n <label\n htmlFor=\"package-npm\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n NPM-package\n </label>\n <input\n id=\"package-npm\"\n type=\"text\"\n value={npmPackage}\n onChange={(e) => setNpmPackage(e.target.value)}\n className=\"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 />\n </div>\n\n {/* Version Field */}\n <div>\n <label\n htmlFor=\"package-version\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Version\n </label>\n <input\n id=\"package-version\"\n type=\"text\"\n placeholder=\"1.0.0-dev\"\n readOnly\n className=\"w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500 placeholder:text-gray-700 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-200\"\n />\n </div>\n\n {/* License Field */}\n <div>\n <label\n htmlFor=\"package-license\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n License\n </label>\n <input\n id=\"package-license\"\n type=\"text\"\n placeholder=\"AGPL-3.0-only\"\n readOnly\n className=\"w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500 placeholder:text-gray-700 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-200\"\n />\n </div>\n\n {/* Install with Field */}\n <div>\n <label\n htmlFor=\"package-install\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Install with:\n </label>\n <input\n id=\"package-install\"\n type=\"text\"\n placeholder=\"@powerhousedao/todo-demo-package\"\n readOnly\n className=\"w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500 placeholder:text-gray-700 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-200\"\n />\n </div>\n </div>\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 {\n addPackageKeyword,\n removePackageKeyword,\n setPackageAuthorName,\n setPackageAuthorWebsite,\n setPackageCategory,\n setPackageDescription,\n setPackageGithubUrl,\n setPackageName,\n setPackageNpmUrl,\n} from \"../../document-models/vetra-package/index.js\";\nimport { useSelectedDriveVetraPackage } from \"../hooks/useVetraDocument.js\";\nimport { MetaForm } from \"./components/MetaForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport type EditorProps = {\n displayToolbar?: boolean;\n};\n\nexport default function Editor(props: EditorProps) {\n const { displayToolbar = true } = props;\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedDriveVetraPackage();\n\n const onNameChange = useCallback(\n (name: string) => {\n if (!document.state.global.name && !name) return;\n if (name === document.state.global.name) return;\n\n dispatch(setPackageName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onDescriptionChange = useCallback(\n (description: string) => {\n if (!document.state.global.description && !description) return;\n if (description === document.state.global.description) return;\n\n dispatch(setPackageDescription({ description }));\n },\n [document.state.global.description, dispatch],\n );\n\n const onCategoryChange = useCallback(\n (category: string) => {\n if (!document.state.global.category && !category) return;\n if (category === document.state.global.category) return;\n\n dispatch(setPackageCategory({ category }));\n },\n [document.state.global.category, dispatch],\n );\n\n const onPublisherChange = useCallback(\n (name: string) => {\n if (!document.state.global.author.name && !name) return;\n if (name === document.state.global.author.name) return;\n\n dispatch(setPackageAuthorName({ name }));\n },\n [document.state.global.author.name, dispatch],\n );\n\n const onPublisherUrlChange = useCallback(\n (website: string) => {\n if (!document.state.global.author.website && !website) return;\n if (website === document.state.global.author.website) return;\n\n dispatch(setPackageAuthorWebsite({ website }));\n },\n [document.state.global.author.website, dispatch],\n );\n\n const onGithubRepositoryChange = useCallback(\n (url: string) => {\n if (!document.state.global.githubUrl && !url) return;\n if (url === document.state.global.githubUrl) return;\n\n dispatch(setPackageGithubUrl({ url }));\n },\n [document.state.global.githubUrl, dispatch],\n );\n\n const onNpmPackageChange = useCallback(\n (url: string) => {\n if (!document.state.global.npmUrl && !url) return;\n if (url === document.state.global.npmUrl) return;\n\n dispatch(setPackageNpmUrl({ url }));\n },\n [document.state.global.npmUrl, dispatch],\n );\n\n const onAddKeyword = useCallback(\n (keyword: { id: string; label: string }) => {\n dispatch(addPackageKeyword(keyword));\n },\n [dispatch],\n );\n\n const onRemoveKeyword = useCallback(\n (id: string) => {\n dispatch(removePackageKeyword({ id }));\n },\n [dispatch],\n );\n\n return (\n <div className=\"bg-gray-50 p-6 dark:bg-slate-800\">\n {displayToolbar && <DocumentToolbar />}\n <MetaForm\n name={document.state.global.name ?? \"\"}\n description={document.state.global.description ?? \"\"}\n category={document.state.global.category ?? \"\"}\n publisher={document.state.global.author.name ?? \"\"}\n publisherUrl={document.state.global.author.website ?? \"\"}\n githubRepository={document.state.global.githubUrl ?? \"\"}\n npmPackage={document.state.global.npmUrl ?? \"\"}\n keywords={document.state.global.keywords}\n onNameChange={onNameChange}\n onDescriptionChange={onDescriptionChange}\n onCategoryChange={onCategoryChange}\n onPublisherChange={onPublisherChange}\n onPublisherUrlChange={onPublisherUrlChange}\n onGithubRepositoryChange={onGithubRepositoryChange}\n onNpmPackageChange={onNpmPackageChange}\n onAddKeyword={onAddKeyword}\n onRemoveKeyword={onRemoveKeyword}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAwBA,MAAa,YAAqC,UAAU;CAC1D,MAAM,EACJ,MAAM,aACN,aAAa,oBACb,UAAU,iBACV,WAAW,kBACX,cAAc,qBACd,kBAAkB,yBAClB,YAAY,mBACZ,UAAU,iBACV,cACA,qBACA,kBACA,mBACA,sBACA,0BACA,oBACA,cACA,oBACE;CAEJ,MAAM,CAAC,MAAM,WAAW,SAAS,YAAY;CAC7C,MAAM,CAAC,aAAa,kBAAkB,SAAS,mBAAmB;CAClE,MAAM,CAAC,UAAU,eAAe,SAAS,gBAAgB;CACzD,MAAM,CAAC,WAAW,gBAAgB,SAAS,iBAAiB;CAC5D,MAAM,CAAC,cAAc,mBAAmB,SAAS,oBAAoB;CACrE,MAAM,CAAC,kBAAkB,uBAAuB,SAC9C,wBACD;CACD,MAAM,CAAC,YAAY,iBAAiB,SAAS,kBAAkB;CAG/D,MAAM,CAAC,UAAU,eAAe,SAAoB,gBAAgB;CACpE,MAAM,CAAC,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,MAAM,OAAO,UAAU;GAC5C,UAAU,SAAS,MAAM,OAAO;GAClB;GACO;GACH;GACC;GACG;GACI;GACN;GACN;GACG;GACjB,CAAA,CACE"}
@@ -5,6 +5,7 @@ import { n as useSelectedProcessorModuleDocument } from "./useVetraDocument-BQKy
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: `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 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`,
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: `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 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`,
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-Blb3oLVi.js.map
244
+ //# sourceMappingURL=editor-Dw-NohMb.js.map