@powerhousedao/vetra 6.0.0-dev.248 → 6.0.0-dev.249
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/editor-Bsu4yikl.js +2 -0
- package/dist/{editor-BwBHWEmR.js → editor-CGNcK2z0.js} +5 -5
- package/dist/editor-CGNcK2z0.js.map +1 -0
- package/dist/{editor-Bm0GwtcN.js → editor-CdzYJozI.js} +3 -3
- package/dist/editor-CdzYJozI.js.map +1 -0
- package/dist/{editor-ouUpfWQx.js → editor-CgkzQJ4g.js} +10 -10
- package/dist/editor-CgkzQJ4g.js.map +1 -0
- package/dist/{editor-CwC9mpEu.js → editor-D4FHn5u4.js} +10 -10
- package/dist/editor-D4FHn5u4.js.map +1 -0
- package/dist/{editor-CQwD5q6a.js → editor-DqkJ0B4G.js} +4 -4
- package/dist/editor-DqkJ0B4G.js.map +1 -0
- package/dist/{editor-9B-mf9yE.js → editor-ddcGG42r.js} +6 -6
- package/dist/editor-ddcGG42r.js.map +1 -0
- package/dist/editors/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{module-DWvO3WCv.js → module-BW12i5H3.js} +7 -7
- package/dist/{module-DWvO3WCv.js.map → module-BW12i5H3.js.map} +1 -1
- package/dist/style.css +7 -8
- package/package.json +8 -12
- package/dist/editor-9B-mf9yE.js.map +0 -1
- package/dist/editor-Bm0GwtcN.js.map +0 -1
- package/dist/editor-BwBHWEmR.js.map +0 -1
- package/dist/editor-CD3KcVf6.js +0 -2
- package/dist/editor-CQwD5q6a.js.map +0 -1
- package/dist/editor-CwC9mpEu.js.map +0 -1
- package/dist/editor-ouUpfWQx.js.map +0 -1
|
@@ -68,7 +68,7 @@ const ProcessorEditorForm = ({ processorName: initialProcessorName = "", process
|
|
|
68
68
|
value: processorName,
|
|
69
69
|
onChange: (e) => setProcessorName(e.target.value),
|
|
70
70
|
disabled: isReadOnly,
|
|
71
|
-
className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:
|
|
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
72
|
placeholder: "Enter processor name"
|
|
73
73
|
})] }),
|
|
74
74
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
@@ -80,7 +80,7 @@ const ProcessorEditorForm = ({ processorName: initialProcessorName = "", process
|
|
|
80
80
|
value: processorType,
|
|
81
81
|
onChange: (e) => setProcessorType(e.target.value),
|
|
82
82
|
disabled: isReadOnly,
|
|
83
|
-
className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:
|
|
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
84
|
children: [
|
|
85
85
|
/* @__PURE__ */ jsx("option", {
|
|
86
86
|
value: "",
|
|
@@ -118,7 +118,7 @@ const ProcessorEditorForm = ({ processorName: initialProcessorName = "", process
|
|
|
118
118
|
}
|
|
119
119
|
setSelectedDocumentType("");
|
|
120
120
|
},
|
|
121
|
-
className: "w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:
|
|
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
122
|
children: [/* @__PURE__ */ jsx("option", {
|
|
123
123
|
value: "",
|
|
124
124
|
children: "Select a document type to add"
|
|
@@ -178,7 +178,7 @@ const ProcessorEditorForm = ({ processorName: initialProcessorName = "", process
|
|
|
178
178
|
!isReadOnly && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("button", {
|
|
179
179
|
onClick: handleConfirm,
|
|
180
180
|
disabled: !canConfirm,
|
|
181
|
-
className: "rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:
|
|
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",
|
|
182
182
|
children: "Confirm"
|
|
183
183
|
}) })
|
|
184
184
|
]
|
|
@@ -239,4 +239,4 @@ function Editor() {
|
|
|
239
239
|
//#endregion
|
|
240
240
|
export { Editor as default };
|
|
241
241
|
|
|
242
|
-
//# sourceMappingURL=editor-
|
|
242
|
+
//# sourceMappingURL=editor-CGNcK2z0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-CGNcK2z0.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 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\">\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\"\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={`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 ${\n isReadOnly ? \"cursor-not-allowed bg-gray-100\" : \"\"\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\"\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={`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 ${\n isReadOnly ? \"cursor-not-allowed bg-gray-100\" : \"\"\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\"\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 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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\">\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\"\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\"\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 htmlFor={processorApp}>{processorApp}</label>\n </div>\n ))}\n </>\n )}\n <div className=\"space-y-1\">\n {isReadOnly &&\n processorApps.map((processorApp) => (\n <span key={processorApp} className=\"text-sm text-gray-700\">\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\"\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\">\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":";;;;;;;;;;AAyBA,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,qBAAqB;CACxE,MAAM,CAAC,aAAa,kBAAkB,SAAS,MAAM;CAGrD,MAAM,yBAAyB,2BAA2B;AAG1D,aAAY,eAAe,cAAc,IAAI;AAC7C,aAAY,eAAe,cAAc,IAAI;AAG7C,iBAAgB;AAEd,mBAAiB,qB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"", status = "
|
|
|
47
47
|
value: subgraphName,
|
|
48
48
|
onChange: (e) => setSubgraphName(e.target.value),
|
|
49
49
|
disabled: isReadOnly,
|
|
50
|
-
className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:
|
|
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
51
|
placeholder: "Enter subgraph name"
|
|
52
52
|
})] }),
|
|
53
53
|
!isReadOnly && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("button", {
|
|
54
54
|
onClick: handleConfirm,
|
|
55
55
|
disabled: !subgraphName.trim(),
|
|
56
|
-
className: "rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:
|
|
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
57
|
children: "Confirm"
|
|
58
58
|
}) })
|
|
59
59
|
]
|
|
@@ -87,4 +87,4 @@ function Editor() {
|
|
|
87
87
|
//#endregion
|
|
88
88
|
export { Editor as default };
|
|
89
89
|
|
|
90
|
-
//# sourceMappingURL=editor-
|
|
90
|
+
//# sourceMappingURL=editor-CdzYJozI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-CdzYJozI.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 { 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\">\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\"\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={`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 ${\n isReadOnly ? \"cursor-not-allowed bg-gray-100\" : \"\"\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\"\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\">\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":";;;;;;;;;AAWA,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,oBAAo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AS,CAAC;AAEd,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,iBAAD,EAAmB,CAAA,EACnB,oBAAC,oBAAD;GACE,cAAc,SAAS,MAAM,OAAO,QAAQ;GAC5C,QAAQ,SAAS,MAAM,OAAO;GAChB;GACH;GACX,CAAA,CACE"}
|
|
@@ -37,7 +37,7 @@ const MetaForm = (props) => {
|
|
|
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:
|
|
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"
|
|
41
41
|
})] }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
42
42
|
htmlFor: "package-description",
|
|
43
43
|
className: "mb-2 block text-sm font-medium text-gray-700",
|
|
@@ -47,7 +47,7 @@ const MetaForm = (props) => {
|
|
|
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:
|
|
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"
|
|
51
51
|
})] })]
|
|
52
52
|
}),
|
|
53
53
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -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:
|
|
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",
|
|
69
69
|
children: [
|
|
70
70
|
/* @__PURE__ */ jsx("option", {
|
|
71
71
|
value: "",
|
|
@@ -110,7 +110,7 @@ const MetaForm = (props) => {
|
|
|
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:
|
|
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"
|
|
114
114
|
})] }),
|
|
115
115
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
116
116
|
htmlFor: "package-publisher-url",
|
|
@@ -121,7 +121,7 @@ const MetaForm = (props) => {
|
|
|
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:
|
|
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"
|
|
125
125
|
})] }),
|
|
126
126
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
127
127
|
htmlFor: "package-keywords",
|
|
@@ -147,11 +147,11 @@ 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:
|
|
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"
|
|
151
151
|
}), /* @__PURE__ */ jsx("div", {
|
|
152
152
|
className: "flex min-h-[80px] flex-wrap gap-2 rounded-md border border-gray-300 p-3",
|
|
153
153
|
children: keywords.map((keyword) => /* @__PURE__ */ jsxs("span", {
|
|
154
|
-
className: "inline-flex items-center rounded 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",
|
|
155
155
|
children: [keyword.label, /* @__PURE__ */ jsx("button", {
|
|
156
156
|
onClick: () => {
|
|
157
157
|
setKeywords(keywords.filter((k) => k.id !== keyword.id));
|
|
@@ -177,7 +177,7 @@ const MetaForm = (props) => {
|
|
|
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:
|
|
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"
|
|
181
181
|
})] }),
|
|
182
182
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
183
183
|
htmlFor: "package-npm",
|
|
@@ -188,7 +188,7 @@ const MetaForm = (props) => {
|
|
|
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:
|
|
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"
|
|
192
192
|
})] }),
|
|
193
193
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
194
194
|
htmlFor: "package-version",
|
|
@@ -304,4 +304,4 @@ function Editor(props) {
|
|
|
304
304
|
//#endregion
|
|
305
305
|
export { Editor as t };
|
|
306
306
|
|
|
307
|
-
//# sourceMappingURL=editor-
|
|
307
|
+
//# sourceMappingURL=editor-CgkzQJ4g.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-CgkzQJ4g.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 { useDebounce } from \"../../hooks/index.js\";\nimport type { Keyword } from \"../../../document-models/vetra-package/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\"\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 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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\"\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\"\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\"\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 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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\"\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 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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\"\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 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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\"\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 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\n />\n <div className=\"flex min-h-[80px] flex-wrap gap-2 rounded-md border border-gray-300 p-3\">\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\"\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\"\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\"\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 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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\"\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 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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\"\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\"\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\"\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\"\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\"\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\"\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],\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],\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],\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],\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],\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],\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],\n );\n\n const onAddKeyword = useCallback((keyword: { id: string; label: string }) => {\n dispatch(addPackageKeyword(keyword));\n }, []);\n\n const onRemoveKeyword = useCallback((id: string) => {\n dispatch(removePackageKeyword({ id }));\n }, []);\n\n return (\n <div className=\"bg-gray-50 p-6\">\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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rC,EAAE,CAAC;AAEN,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACG,kBAAkB,oBAAC,iBAAD,EAAmB,CAAA,EACtC,oBAAC,UAAD;GACE,MAAM,SAAS,MAAM,OAAO,QAAQ;GACpC,aAAa,SAAS,MAAM,OAAO,eAAe;GAClD,UAAU,SAAS,MAAM,OAAO,YAAY;GAC5C,WAAW,SAAS,MAAM,OAAO,OAAO,QAAQ;GAChD,cAAc,SAAS,MAAM,OAAO,OAAO,WAAW;GACtD,kBAAkB,SAAS,MAAM,OAAO,aAAa;GACrD,YAAY,SAAS,MAAM,OAAO,UAAU;GAC5C,UAAU,SAAS,MAAM,OAAO;GAClB;GACO;GACH;GACC;GACG;GACI;GACN;GACN;GACG;GACjB,CAAA,CACE"}
|
|
@@ -68,7 +68,7 @@ const DriveInfoItem = ({ label, value }) => {
|
|
|
68
68
|
};
|
|
69
69
|
return /* @__PURE__ */ jsxs("button", {
|
|
70
70
|
"aria-label": `Copy ${label}`,
|
|
71
|
-
className: "flex h-8 items-center gap-1
|
|
71
|
+
className: "flex h-8 items-center gap-1 rounded-lg bg-slate-50 pr-2 pl-1 text-xs whitespace-nowrap text-stone-300",
|
|
72
72
|
onClick: handleCopy,
|
|
73
73
|
children: [
|
|
74
74
|
/* @__PURE__ */ jsx(LinkIcon, {
|
|
@@ -133,12 +133,12 @@ const ShareMenuItem = ({ label, url }) => {
|
|
|
133
133
|
value: url,
|
|
134
134
|
className: "w-[300px] truncate rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs text-gray-800 underline outline-none"
|
|
135
135
|
}), showTooltip && /* @__PURE__ */ jsx("div", {
|
|
136
|
-
className: "absolute left-0
|
|
136
|
+
className: "absolute top-full left-0 z-20 mt-1 max-w-md rounded-lg bg-gray-800 px-3 py-2 text-xs break-all text-white shadow-lg",
|
|
137
137
|
children: url
|
|
138
138
|
})]
|
|
139
139
|
}), /* @__PURE__ */ jsx("button", {
|
|
140
140
|
"aria-label": "Copy URL",
|
|
141
|
-
className: "rounded p-1 transition-colors hover:bg-gray-100",
|
|
141
|
+
className: "rounded-sm p-1 transition-colors hover:bg-gray-100",
|
|
142
142
|
onClick: handleCopy,
|
|
143
143
|
children: /* @__PURE__ */ jsx(CopyIcon, {
|
|
144
144
|
width: 16,
|
|
@@ -358,7 +358,7 @@ const DriveHeader = ({ driveId, driveName, driveUrl }) => {
|
|
|
358
358
|
children: /* @__PURE__ */ jsx(InfoIcon, { className: "text-gray-500" })
|
|
359
359
|
}), isInfoMenuOpen && /* @__PURE__ */ jsxs("div", {
|
|
360
360
|
role: "menu",
|
|
361
|
-
className: "absolute left-0
|
|
361
|
+
className: "absolute top-full left-0 z-10 mt-2 flex flex-col items-start gap-2 rounded-lg bg-white p-3 shadow-lg",
|
|
362
362
|
children: [/* @__PURE__ */ jsx(DriveInfoItem, {
|
|
363
363
|
label: "Name",
|
|
364
364
|
value: driveName
|
|
@@ -383,7 +383,7 @@ const DriveHeader = ({ driveId, driveName, driveUrl }) => {
|
|
|
383
383
|
})
|
|
384
384
|
}), isShareMenuOpen && /* @__PURE__ */ jsxs("div", {
|
|
385
385
|
role: "menu",
|
|
386
|
-
className: "absolute left-0
|
|
386
|
+
className: "absolute top-full left-0 z-10 mt-2 flex w-max flex-col gap-4 rounded-lg bg-white p-4 shadow-lg",
|
|
387
387
|
children: [/* @__PURE__ */ jsx(ShareMenuItem, {
|
|
388
388
|
label: "Copy the Drive URL",
|
|
389
389
|
url: driveUrl
|
|
@@ -518,7 +518,7 @@ const ModuleAccordion = ({ title, count, onAdd, children, defaultOpen = false, c
|
|
|
518
518
|
e.stopPropagation();
|
|
519
519
|
onAdd?.();
|
|
520
520
|
},
|
|
521
|
-
className: "rounded p-1 transition-colors hover:bg-gray-200",
|
|
521
|
+
className: "rounded-sm p-1 transition-colors hover:bg-gray-200",
|
|
522
522
|
children: /* @__PURE__ */ jsx(PlusIcon, {
|
|
523
523
|
width: 16,
|
|
524
524
|
height: 16,
|
|
@@ -1358,7 +1358,7 @@ const ModuleItem = ({ fileNode, onClick, onDelete, className = "" }) => {
|
|
|
1358
1358
|
className: cn("group flex w-full cursor-pointer items-center gap-3 rounded-md bg-zinc-100 p-1 text-left transition-colors hover:bg-zinc-200", className),
|
|
1359
1359
|
children: [
|
|
1360
1360
|
/* @__PURE__ */ jsx("div", {
|
|
1361
|
-
className: "
|
|
1361
|
+
className: "shrink-0",
|
|
1362
1362
|
children: /* @__PURE__ */ jsx(IconComponent, {})
|
|
1363
1363
|
}),
|
|
1364
1364
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -1399,7 +1399,7 @@ const NewModuleItem = ({ title, subtitle, onClick, className = "" }) => {
|
|
|
1399
1399
|
onClick,
|
|
1400
1400
|
className: `flex w-full items-center gap-3 rounded-md bg-zinc-100 p-1 text-left transition-colors hover:bg-zinc-200 ${className}`,
|
|
1401
1401
|
children: [/* @__PURE__ */ jsx("div", {
|
|
1402
|
-
className: "
|
|
1402
|
+
className: "shrink-0",
|
|
1403
1403
|
children: /* @__PURE__ */ jsx(AddNewIcon, {})
|
|
1404
1404
|
}), /* @__PURE__ */ jsxs("div", {
|
|
1405
1405
|
className: "min-w-0 flex-1",
|
|
@@ -1657,7 +1657,7 @@ const PackageInformationSection = ({ className, packageDocumentId, onAddPackageD
|
|
|
1657
1657
|
e.stopPropagation();
|
|
1658
1658
|
onOpenPackageDocument();
|
|
1659
1659
|
},
|
|
1660
|
-
className: "flex items-center justify-center rounded p-1 text-gray-600 transition-colors hover:bg-zinc-200 hover:text-gray-800",
|
|
1660
|
+
className: "flex items-center justify-center rounded-sm p-1 text-gray-600 transition-colors hover:bg-zinc-200 hover:text-gray-800",
|
|
1661
1661
|
"aria-label": "Open package document",
|
|
1662
1662
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
1663
1663
|
name: "Moved",
|
|
@@ -1769,4 +1769,4 @@ function Editor(props) {
|
|
|
1769
1769
|
//#endregion
|
|
1770
1770
|
export { BaseEditor, Editor as default };
|
|
1771
1771
|
|
|
1772
|
-
//# sourceMappingURL=editor-
|
|
1772
|
+
//# sourceMappingURL=editor-D4FHn5u4.js.map
|