@powerhousedao/powerhouse-vetra-packages 6.0.0-dev.100
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/LICENSE +661 -0
- package/dist/document-models/document-models.d.ts +3 -0
- package/dist/document-models/document-models.d.ts.map +1 -0
- package/dist/document-models/document-models.js +2 -0
- package/dist/document-models/document-models.js.map +1 -0
- package/dist/editors/document-model-editor/components/button.d.ts +2 -0
- package/dist/editors/document-model-editor/components/button.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/button.js +8 -0
- package/dist/editors/document-model-editor/components/button.js.map +1 -0
- package/dist/editors/document-model-editor/components/code-editors/constants.d.ts +3 -0
- package/dist/editors/document-model-editor/components/code-editors/constants.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/code-editors/constants.js +38 -0
- package/dist/editors/document-model-editor/components/code-editors/constants.js.map +1 -0
- package/dist/editors/document-model-editor/components/code-editors/factories.d.ts +4 -0
- package/dist/editors/document-model-editor/components/code-editors/factories.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/code-editors/factories.js +47 -0
- package/dist/editors/document-model-editor/components/code-editors/factories.js.map +1 -0
- package/dist/editors/document-model-editor/components/code-editors/graphql-editor.d.ts +10 -0
- package/dist/editors/document-model-editor/components/code-editors/graphql-editor.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/code-editors/graphql-editor.js +73 -0
- package/dist/editors/document-model-editor/components/code-editors/graphql-editor.js.map +1 -0
- package/dist/editors/document-model-editor/components/code-editors/hooks.d.ts +23 -0
- package/dist/editors/document-model-editor/components/code-editors/hooks.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/code-editors/hooks.js +59 -0
- package/dist/editors/document-model-editor/components/code-editors/hooks.js.map +1 -0
- package/dist/editors/document-model-editor/components/code-editors/json-editor.d.ts +8 -0
- package/dist/editors/document-model-editor/components/code-editors/json-editor.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/code-editors/json-editor.js +47 -0
- package/dist/editors/document-model-editor/components/code-editors/json-editor.js.map +1 -0
- package/dist/editors/document-model-editor/components/code-editors/linting.d.ts +6 -0
- package/dist/editors/document-model-editor/components/code-editors/linting.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/code-editors/linting.js +59 -0
- package/dist/editors/document-model-editor/components/code-editors/linting.js.map +1 -0
- package/dist/editors/document-model-editor/components/divider.d.ts +8 -0
- package/dist/editors/document-model-editor/components/divider.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/divider.js +22 -0
- package/dist/editors/document-model-editor/components/divider.js.map +1 -0
- package/dist/editors/document-model-editor/components/errors.d.ts +6 -0
- package/dist/editors/document-model-editor/components/errors.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/errors.js +5 -0
- package/dist/editors/document-model-editor/components/errors.js.map +1 -0
- package/dist/editors/document-model-editor/components/form.d.ts +12 -0
- package/dist/editors/document-model-editor/components/form.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/form.js +43 -0
- package/dist/editors/document-model-editor/components/form.js.map +1 -0
- package/dist/editors/document-model-editor/components/input.d.ts +6 -0
- package/dist/editors/document-model-editor/components/input.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/input.js +9 -0
- package/dist/editors/document-model-editor/components/input.js.map +1 -0
- package/dist/editors/document-model-editor/components/label.d.ts +6 -0
- package/dist/editors/document-model-editor/components/label.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/label.js +10 -0
- package/dist/editors/document-model-editor/components/label.js.map +1 -0
- package/dist/editors/document-model-editor/components/model-metadata-form.d.ts +31 -0
- package/dist/editors/document-model-editor/components/model-metadata-form.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/model-metadata-form.js +70 -0
- package/dist/editors/document-model-editor/components/model-metadata-form.js.map +1 -0
- package/dist/editors/document-model-editor/components/module-form.d.ts +10 -0
- package/dist/editors/document-model-editor/components/module-form.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/module-form.js +22 -0
- package/dist/editors/document-model-editor/components/module-form.js.map +1 -0
- package/dist/editors/document-model-editor/components/module.d.ts +22 -0
- package/dist/editors/document-model-editor/components/module.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/module.js +10 -0
- package/dist/editors/document-model-editor/components/module.js.map +1 -0
- package/dist/editors/document-model-editor/components/modules.d.ts +20 -0
- package/dist/editors/document-model-editor/components/modules.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/modules.js +17 -0
- package/dist/editors/document-model-editor/components/modules.js.map +1 -0
- package/dist/editors/document-model-editor/components/operation-description-form.d.ts +9 -0
- package/dist/editors/document-model-editor/components/operation-description-form.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/operation-description-form.js +13 -0
- package/dist/editors/document-model-editor/components/operation-description-form.js.map +1 -0
- package/dist/editors/document-model-editor/components/operation-error-form.d.ts +13 -0
- package/dist/editors/document-model-editor/components/operation-error-form.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/operation-error-form.js +40 -0
- package/dist/editors/document-model-editor/components/operation-error-form.js.map +1 -0
- package/dist/editors/document-model-editor/components/operation-errors.d.ts +10 -0
- package/dist/editors/document-model-editor/components/operation-errors.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/operation-errors.js +17 -0
- package/dist/editors/document-model-editor/components/operation-errors.js.map +1 -0
- package/dist/editors/document-model-editor/components/operation-form.d.ts +13 -0
- package/dist/editors/document-model-editor/components/operation-form.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/operation-form.js +37 -0
- package/dist/editors/document-model-editor/components/operation-form.js.map +1 -0
- package/dist/editors/document-model-editor/components/operation.d.ts +23 -0
- package/dist/editors/document-model-editor/components/operation.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/operation.js +25 -0
- package/dist/editors/document-model-editor/components/operation.js.map +1 -0
- package/dist/editors/document-model-editor/components/operations.d.ts +18 -0
- package/dist/editors/document-model-editor/components/operations.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/operations.js +20 -0
- package/dist/editors/document-model-editor/components/operations.js.map +1 -0
- package/dist/editors/document-model-editor/components/state-error.d.ts +5 -0
- package/dist/editors/document-model-editor/components/state-error.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/state-error.js +21 -0
- package/dist/editors/document-model-editor/components/state-error.js.map +1 -0
- package/dist/editors/document-model-editor/components/state-schemas.d.ts +15 -0
- package/dist/editors/document-model-editor/components/state-schemas.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/state-schemas.js +81 -0
- package/dist/editors/document-model-editor/components/state-schemas.js.map +1 -0
- package/dist/editors/document-model-editor/components/tabs.d.ts +8 -0
- package/dist/editors/document-model-editor/components/tabs.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/tabs.js +13 -0
- package/dist/editors/document-model-editor/components/tabs.js.map +1 -0
- package/dist/editors/document-model-editor/components/text-area.d.ts +9 -0
- package/dist/editors/document-model-editor/components/text-area.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/text-area.js +27 -0
- package/dist/editors/document-model-editor/components/text-area.js.map +1 -0
- package/dist/editors/document-model-editor/components/text-field.d.ts +21 -0
- package/dist/editors/document-model-editor/components/text-field.d.ts.map +1 -0
- package/dist/editors/document-model-editor/components/text-field.js +80 -0
- package/dist/editors/document-model-editor/components/text-field.js.map +1 -0
- package/dist/editors/document-model-editor/config.d.ts +3 -0
- package/dist/editors/document-model-editor/config.d.ts.map +1 -0
- package/dist/editors/document-model-editor/config.js +4 -0
- package/dist/editors/document-model-editor/config.js.map +1 -0
- package/dist/editors/document-model-editor/constants/documents.d.ts +13 -0
- package/dist/editors/document-model-editor/constants/documents.d.ts.map +1 -0
- package/dist/editors/document-model-editor/constants/documents.js +18 -0
- package/dist/editors/document-model-editor/constants/documents.js.map +1 -0
- package/dist/editors/document-model-editor/constants/graphql-kinds.d.ts +9 -0
- package/dist/editors/document-model-editor/constants/graphql-kinds.d.ts.map +1 -0
- package/dist/editors/document-model-editor/constants/graphql-kinds.js +13 -0
- package/dist/editors/document-model-editor/constants/graphql-kinds.js.map +1 -0
- package/dist/editors/document-model-editor/context/form-context.d.ts +11 -0
- package/dist/editors/document-model-editor/context/form-context.d.ts.map +1 -0
- package/dist/editors/document-model-editor/context/form-context.js +4 -0
- package/dist/editors/document-model-editor/context/form-context.js.map +1 -0
- package/dist/editors/document-model-editor/context/schema-context.d.ts +18 -0
- package/dist/editors/document-model-editor/context/schema-context.d.ts.map +1 -0
- package/dist/editors/document-model-editor/context/schema-context.js +129 -0
- package/dist/editors/document-model-editor/context/schema-context.js.map +1 -0
- package/dist/editors/document-model-editor/editor.d.ts +2 -0
- package/dist/editors/document-model-editor/editor.d.ts.map +1 -0
- package/dist/editors/document-model-editor/editor.js +217 -0
- package/dist/editors/document-model-editor/editor.js.map +1 -0
- package/dist/editors/document-model-editor/hooks/index.d.ts +3 -0
- package/dist/editors/document-model-editor/hooks/index.d.ts.map +1 -0
- package/dist/editors/document-model-editor/hooks/index.js +3 -0
- package/dist/editors/document-model-editor/hooks/index.js.map +1 -0
- package/dist/editors/document-model-editor/hooks/useDocumentModelDocument.d.ts +5 -0
- package/dist/editors/document-model-editor/hooks/useDocumentModelDocument.d.ts.map +1 -0
- package/dist/editors/document-model-editor/hooks/useDocumentModelDocument.js +8 -0
- package/dist/editors/document-model-editor/hooks/useDocumentModelDocument.js.map +1 -0
- package/dist/editors/document-model-editor/hooks/useFormField.d.ts +13 -0
- package/dist/editors/document-model-editor/hooks/useFormField.d.ts.map +1 -0
- package/dist/editors/document-model-editor/hooks/useFormField.js +22 -0
- package/dist/editors/document-model-editor/hooks/useFormField.js.map +1 -0
- package/dist/editors/document-model-editor/index.d.ts +2 -0
- package/dist/editors/document-model-editor/index.d.ts.map +1 -0
- package/dist/editors/document-model-editor/index.js +2 -0
- package/dist/editors/document-model-editor/index.js.map +1 -0
- package/dist/editors/document-model-editor/module.d.ts +3 -0
- package/dist/editors/document-model-editor/module.d.ts.map +1 -0
- package/dist/editors/document-model-editor/module.js +10 -0
- package/dist/editors/document-model-editor/module.js.map +1 -0
- package/dist/editors/document-model-editor/schemas/inputs.d.ts +31 -0
- package/dist/editors/document-model-editor/schemas/inputs.d.ts.map +1 -0
- package/dist/editors/document-model-editor/schemas/inputs.js +71 -0
- package/dist/editors/document-model-editor/schemas/inputs.js.map +1 -0
- package/dist/editors/document-model-editor/schemas/utils.d.ts +3 -0
- package/dist/editors/document-model-editor/schemas/utils.d.ts.map +1 -0
- package/dist/editors/document-model-editor/schemas/utils.js +3 -0
- package/dist/editors/document-model-editor/schemas/utils.js.map +1 -0
- package/dist/editors/document-model-editor/types/documents.d.ts +26 -0
- package/dist/editors/document-model-editor/types/documents.d.ts.map +1 -0
- package/dist/editors/document-model-editor/types/documents.js +2 -0
- package/dist/editors/document-model-editor/types/documents.js.map +1 -0
- package/dist/editors/document-model-editor/types.d.ts +2 -0
- package/dist/editors/document-model-editor/types.d.ts.map +1 -0
- package/dist/editors/document-model-editor/types.js +2 -0
- package/dist/editors/document-model-editor/types.js.map +1 -0
- package/dist/editors/document-model-editor/utils/helpers.d.ts +112 -0
- package/dist/editors/document-model-editor/utils/helpers.d.ts.map +1 -0
- package/dist/editors/document-model-editor/utils/helpers.js +920 -0
- package/dist/editors/document-model-editor/utils/helpers.js.map +1 -0
- package/dist/editors/document-model-editor/utils/helpers.test.d.ts +2 -0
- package/dist/editors/document-model-editor/utils/helpers.test.d.ts.map +1 -0
- package/dist/editors/document-model-editor/utils/helpers.test.js +805 -0
- package/dist/editors/document-model-editor/utils/helpers.test.js.map +1 -0
- package/dist/editors/document-model-editor/utils/linting.d.ts +7 -0
- package/dist/editors/document-model-editor/utils/linting.d.ts.map +1 -0
- package/dist/editors/document-model-editor/utils/linting.js +49 -0
- package/dist/editors/document-model-editor/utils/linting.js.map +1 -0
- package/dist/editors/document-model-editor/utils/style.d.ts +3 -0
- package/dist/editors/document-model-editor/utils/style.d.ts.map +1 -0
- package/dist/editors/document-model-editor/utils/style.js +6 -0
- package/dist/editors/document-model-editor/utils/style.js.map +1 -0
- package/dist/editors/editors.d.ts +3 -0
- package/dist/editors/editors.d.ts.map +1 -0
- package/dist/editors/editors.js +7 -0
- package/dist/editors/editors.js.map +1 -0
- package/dist/editors/generic-drive-explorer/components/create-document.d.ts +2 -0
- package/dist/editors/generic-drive-explorer/components/create-document.d.ts.map +1 -0
- package/dist/editors/generic-drive-explorer/components/create-document.js +19 -0
- package/dist/editors/generic-drive-explorer/components/create-document.js.map +1 -0
- package/dist/editors/generic-drive-explorer/components/file-content-view.d.ts +2 -0
- package/dist/editors/generic-drive-explorer/components/file-content-view.d.ts.map +1 -0
- package/dist/editors/generic-drive-explorer/components/file-content-view.js +77 -0
- package/dist/editors/generic-drive-explorer/components/file-content-view.js.map +1 -0
- package/dist/editors/generic-drive-explorer/components/folder-view.d.ts +5 -0
- package/dist/editors/generic-drive-explorer/components/folder-view.d.ts.map +1 -0
- package/dist/editors/generic-drive-explorer/components/folder-view.js +19 -0
- package/dist/editors/generic-drive-explorer/components/folder-view.js.map +1 -0
- package/dist/editors/generic-drive-explorer/components/index.d.ts +6 -0
- package/dist/editors/generic-drive-explorer/components/index.d.ts.map +1 -0
- package/dist/editors/generic-drive-explorer/components/index.js +6 -0
- package/dist/editors/generic-drive-explorer/components/index.js.map +1 -0
- package/dist/editors/generic-drive-explorer/components/layout.d.ts +12 -0
- package/dist/editors/generic-drive-explorer/components/layout.d.ts.map +1 -0
- package/dist/editors/generic-drive-explorer/components/layout.js +21 -0
- package/dist/editors/generic-drive-explorer/components/layout.js.map +1 -0
- package/dist/editors/generic-drive-explorer/components/search-bar.d.ts +2 -0
- package/dist/editors/generic-drive-explorer/components/search-bar.d.ts.map +1 -0
- package/dist/editors/generic-drive-explorer/components/search-bar.js +38 -0
- package/dist/editors/generic-drive-explorer/components/search-bar.js.map +1 -0
- package/dist/editors/generic-drive-explorer/config.d.ts +3 -0
- package/dist/editors/generic-drive-explorer/config.d.ts.map +1 -0
- package/dist/editors/generic-drive-explorer/config.js +5 -0
- package/dist/editors/generic-drive-explorer/config.js.map +1 -0
- package/dist/editors/generic-drive-explorer/editor.d.ts +3 -0
- package/dist/editors/generic-drive-explorer/editor.d.ts.map +1 -0
- package/dist/editors/generic-drive-explorer/editor.js +16 -0
- package/dist/editors/generic-drive-explorer/editor.js.map +1 -0
- package/dist/editors/generic-drive-explorer/index.d.ts +3 -0
- package/dist/editors/generic-drive-explorer/index.d.ts.map +1 -0
- package/dist/editors/generic-drive-explorer/index.js +3 -0
- package/dist/editors/generic-drive-explorer/index.js.map +1 -0
- package/dist/editors/generic-drive-explorer/module.d.ts +3 -0
- package/dist/editors/generic-drive-explorer/module.d.ts.map +1 -0
- package/dist/editors/generic-drive-explorer/module.js +10 -0
- package/dist/editors/generic-drive-explorer/module.js.map +1 -0
- package/dist/editors/generic-drive-explorer/utils/cn.d.ts +3 -0
- package/dist/editors/generic-drive-explorer/utils/cn.d.ts.map +1 -0
- package/dist/editors/generic-drive-explorer/utils/cn.js +6 -0
- package/dist/editors/generic-drive-explorer/utils/cn.js.map +1 -0
- package/dist/editors/generic-drive-explorer/utils/index.d.ts +3 -0
- package/dist/editors/generic-drive-explorer/utils/index.d.ts.map +1 -0
- package/dist/editors/generic-drive-explorer/utils/index.js +3 -0
- package/dist/editors/generic-drive-explorer/utils/index.js.map +1 -0
- package/dist/editors/generic-drive-explorer/utils/types.d.ts +8 -0
- package/dist/editors/generic-drive-explorer/utils/types.d.ts.map +1 -0
- package/dist/editors/generic-drive-explorer/utils/types.js +2 -0
- package/dist/editors/generic-drive-explorer/utils/types.js.map +1 -0
- package/dist/editors/index.d.ts +3 -0
- package/dist/editors/index.d.ts.map +1 -0
- package/dist/editors/index.js +3 -0
- package/dist/editors/index.js.map +1 -0
- package/dist/editors/style.css +909 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1 @@
|
|
|
1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B,CAAC;AAEhD,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAGlC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC3C,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,YAAY,EAAE,CAAC;IAChD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAEtD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,YACE,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,aAAa,EACjB,SAAS,EAAE,EAAE,CAAC,wCAAwC,EAAE,SAAS,CAAC,KAC9D,KAAK,YAER,IAAI,GACH,CACL,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,GACV,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
}
|
|
4
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
5
|
+
export { Input };
|
|
6
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;CAAG;AAElF,QAAA,MAAM,KAAK,qFAcV,CAAC;AAGF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../utils/style.js";
|
|
4
|
+
const Input = React.forwardRef(({ className, type, ...props }, ref) => {
|
|
5
|
+
return (_jsx("input", { type: type, className: cn("flex h-9 w-full rounded-md border border-gray-400 bg-transparent px-3 py-1 text-sm transition-colors hover:bg-gray-100 focus-visible:bg-gray-200 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", className), ref: ref, ...props }));
|
|
6
|
+
});
|
|
7
|
+
Input.displayName = "Input";
|
|
8
|
+
export { Input };
|
|
9
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/input.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAIvC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACrC,OAAO,CACL,gBACE,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CACX,6NAA6N,EAC7N,SAAS,CACV,EACD,GAAG,EAAE,GAAG,KACJ,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AACF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
import type { VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
5
|
+
export { Label };
|
|
6
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQ7D,QAAA,MAAM,KAAK,4PAUT,CAAC;AAGH,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "../utils/style.js";
|
|
6
|
+
const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
7
|
+
const Label = React.forwardRef(({ className, ...props }, ref) => (_jsx(LabelPrimitive.Root, { ref: ref, className: cn(labelVariants(), className), ...props })));
|
|
8
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
9
|
+
export { Label };
|
|
10
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/label.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAEvC,MAAM,aAAa,GAAG,GAAG,CACvB,4FAA4F,CAC7F,CAAC;AAEF,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAI5B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,cAAc,CAAC,IAAI,IAClB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,EAAE,SAAS,CAAC,KACrC,KAAK,GACT,CACH,CAAC,CAAC;AACH,KAAK,CAAC,WAAW,GAAG,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC;AAEpD,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { Scope } from "../types/documents.js";
|
|
3
|
+
export declare const MetadataFormSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
documentType: z.ZodString;
|
|
6
|
+
extension: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
7
|
+
description: z.ZodString;
|
|
8
|
+
authorName: z.ZodString;
|
|
9
|
+
authorWebsite: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type MetadataFormValues = z.infer<typeof MetadataFormSchema>;
|
|
12
|
+
type Props = MetadataFormValues & {
|
|
13
|
+
globalStateSchema: string;
|
|
14
|
+
localStateSchema: string;
|
|
15
|
+
setModelName: (name: string) => void;
|
|
16
|
+
setModelId: (id: string) => void;
|
|
17
|
+
setModelExtension: (extension: string) => void;
|
|
18
|
+
setModelDescription: (description: string) => void;
|
|
19
|
+
setAuthorName: (authorName: string) => void;
|
|
20
|
+
setAuthorWebsite: (authorWebsite: string) => void;
|
|
21
|
+
setStateSchema: (schema: string, scope: Scope) => void;
|
|
22
|
+
};
|
|
23
|
+
export default function ModelMetadata(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function ModelNameForm(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function DocumentTypeForm(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function ModelExtensionForm(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function DescriptionForm(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function AuthorNameForm(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare function AuthorWebsiteForm(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=model-metadata-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-metadata-form.d.ts","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/model-metadata-form.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAQnD,eAAO,MAAM,kBAAkB;;;;;;;iBAO7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,KAAK,KAAK,GAAG,kBAAkB,GAAG;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,mBAAmB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,gBAAgB,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,KAAK,2CAuBjD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,2CA8DzC;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,2CAa5C;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,2CAa9C;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,2CAc3C;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,2CAa1C;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,2CAgB7C"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { handleModelNameChange, makeInitialSchemaDoc, renameSchemaType, } from "../utils/helpers.js";
|
|
5
|
+
import { TextField } from "./text-field.js";
|
|
6
|
+
export const MetadataFormSchema = z.object({
|
|
7
|
+
name: z.string(),
|
|
8
|
+
documentType: z.string(),
|
|
9
|
+
extension: z.string().optional().default(""),
|
|
10
|
+
description: z.string(),
|
|
11
|
+
authorName: z.string(),
|
|
12
|
+
authorWebsite: z.string(),
|
|
13
|
+
});
|
|
14
|
+
export default function ModelMetadata(props) {
|
|
15
|
+
return (_jsxs("div", { children: [_jsx(ModelNameForm, { ...props }), _jsx("div", { className: "flex h-full flex-col gap-4", children: _jsxs("div", { className: "grid flex-1 grid-cols-3 items-start gap-4", children: [_jsxs("div", { className: "col-span-2 flex h-full flex-col gap-4", children: [_jsx("div", { className: "shrink-0", children: _jsx(DocumentTypeForm, { ...props }) }), _jsx("div", { className: "min-h-0 flex-1", children: _jsx(DescriptionForm, { ...props }) })] }), _jsxs("div", { className: "col-span-1 flex flex-col gap-4", children: [_jsx(AuthorNameForm, { ...props }), _jsx(AuthorWebsiteForm, { ...props }), _jsx(ModelExtensionForm, { ...props })] })] }) })] }));
|
|
16
|
+
}
|
|
17
|
+
export function ModelNameForm(props) {
|
|
18
|
+
const { name, globalStateSchema, localStateSchema, setModelName, setStateSchema, } = props;
|
|
19
|
+
const onSubmit = useCallback((newName) => {
|
|
20
|
+
if (name === newName) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
setModelName(newName);
|
|
24
|
+
const hasExistingSchema = !!globalStateSchema;
|
|
25
|
+
if (!hasExistingSchema) {
|
|
26
|
+
const initialSchemaDoc = makeInitialSchemaDoc(newName, "global");
|
|
27
|
+
setStateSchema(initialSchemaDoc, "global");
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const newSchema = renameSchemaType(globalStateSchema, name, newName, "global");
|
|
31
|
+
setStateSchema(newSchema, "global");
|
|
32
|
+
if (localStateSchema) {
|
|
33
|
+
const newLocalStateSchema = renameSchemaType(localStateSchema, name, newName, "local");
|
|
34
|
+
setStateSchema(newLocalStateSchema, "local");
|
|
35
|
+
}
|
|
36
|
+
handleModelNameChange({
|
|
37
|
+
oldName: name,
|
|
38
|
+
newName,
|
|
39
|
+
globalStateSchema,
|
|
40
|
+
localStateSchema,
|
|
41
|
+
setStateSchema,
|
|
42
|
+
});
|
|
43
|
+
}, [name, globalStateSchema, localStateSchema, setStateSchema]);
|
|
44
|
+
return (_jsx(TextField, { name: "name", value: name, onSubmit: onSubmit, placeholder: "Model name", className: "border-none pl-0 text-xl font-bold text-gray-900", required: true, focusOnMount: true }));
|
|
45
|
+
}
|
|
46
|
+
export function DocumentTypeForm(props) {
|
|
47
|
+
const { documentType, setModelId } = props;
|
|
48
|
+
return (_jsx(TextField, { label: "Document Type *", name: "powerhouse/document-model", value: documentType, onSubmit: setModelId, placeholder: "Document Type", required: true }));
|
|
49
|
+
}
|
|
50
|
+
export function ModelExtensionForm(props) {
|
|
51
|
+
const { extension, setModelExtension } = props;
|
|
52
|
+
return (_jsx(TextField, { name: "extension", value: extension, onSubmit: setModelExtension, label: "Model Extension", placeholder: "Example .phdm", allowEmpty: true }));
|
|
53
|
+
}
|
|
54
|
+
export function DescriptionForm(props) {
|
|
55
|
+
const { description, setModelDescription } = props;
|
|
56
|
+
return (_jsx(TextField, { name: "description", label: "Model Description", value: description, onSubmit: setModelDescription, placeholder: "Describe your document to others", allowEmpty: true, className: "h-full" }));
|
|
57
|
+
}
|
|
58
|
+
export function AuthorNameForm(props) {
|
|
59
|
+
const { authorName, setAuthorName } = props;
|
|
60
|
+
return (_jsx(TextField, { name: "authorName", value: authorName, onSubmit: setAuthorName, label: "Author Name", placeholder: "Username or organisation", allowEmpty: true }));
|
|
61
|
+
}
|
|
62
|
+
export function AuthorWebsiteForm(props) {
|
|
63
|
+
const { authorWebsite, setAuthorWebsite } = props;
|
|
64
|
+
return (_jsx(TextField, { name: "authorWebsite", value: authorWebsite, label: "Website URL", onSubmit: (newAuthorWebsite) => {
|
|
65
|
+
if (!!authorWebsite && !newAuthorWebsite)
|
|
66
|
+
return;
|
|
67
|
+
setAuthorWebsite(newAuthorWebsite);
|
|
68
|
+
}, placeholder: "https://www.powerhouse.inc/", allowEmpty: true }));
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=model-metadata-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-metadata-form.js","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/model-metadata-form.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CA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B;gBAAE,OAAO;YACjD,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;QACrC,CAAC,EACD,WAAW,EAAC,6BAA6B,EACzC,UAAU,SACV,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ModuleSpecification } from "document-model";
|
|
2
|
+
type Props = {
|
|
3
|
+
modules?: ModuleSpecification[];
|
|
4
|
+
module?: ModuleSpecification;
|
|
5
|
+
onAddModule: (name: string) => Promise<string | undefined>;
|
|
6
|
+
updateModuleName: (id: string, name: string) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function ModuleForm({ module, onAddModule, updateModuleName, modules, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=module-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-form.d.ts","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/module-form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAI1D,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC3D,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,OAAY,GACb,EAAE,KAAK,2CA8BP"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { toLowercaseSnakeCase } from "../schemas/inputs.js";
|
|
3
|
+
import { TextField } from "./text-field.js";
|
|
4
|
+
export function ModuleForm({ module, onAddModule, updateModuleName, modules = [], }) {
|
|
5
|
+
const isEdit = !!module;
|
|
6
|
+
const moduleNames = modules.map((m) => m.name);
|
|
7
|
+
const handleSubmit = async (name) => {
|
|
8
|
+
const formattedName = toLowercaseSnakeCase(name);
|
|
9
|
+
if (!formattedName.length)
|
|
10
|
+
return;
|
|
11
|
+
if (isEdit) {
|
|
12
|
+
if (formattedName !== module.name) {
|
|
13
|
+
updateModuleName(module.id, formattedName);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
await onAddModule(formattedName);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
return (_jsx(TextField, { name: "name", label: isEdit ? "Module name *" : "Add module *", value: module?.name, onSubmit: handleSubmit, placeholder: "Add module", unique: moduleNames, shouldReset: !isEdit, required: true }, module?.id ?? "new"));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=module-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-form.js","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/module-form.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAS5C,MAAM,UAAU,UAAU,CAAC,EACzB,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,OAAO,GAAG,EAAE,GACN;IACN,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACxB,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAE/C,MAAM,YAAY,GAAG,KAAK,EAAE,IAAY,EAAE,EAAE;QAC1C,MAAM,aAAa,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,aAAa,CAAC,MAAM;YAAE,OAAO;QAElC,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,aAAa,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC;gBAClC,gBAAgB,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,WAAW,CAAC,aAAa,CAAC,CAAC;QACnC,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,SAAS,IAER,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,cAAc,EAChD,KAAK,EAAE,MAAM,EAAE,IAAI,EACnB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAC,YAAY,EACxB,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,CAAC,MAAM,EACpB,QAAQ,UARH,MAAM,EAAE,EAAE,IAAI,KAAK,CASxB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ModuleSpecification as TModule } from "document-model";
|
|
2
|
+
type Props = {
|
|
3
|
+
module?: TModule;
|
|
4
|
+
modules?: TModule[];
|
|
5
|
+
allOperations: TModule["operations"];
|
|
6
|
+
lastCreatedModuleId: string | null;
|
|
7
|
+
onAddModule: (name: string) => Promise<string | undefined>;
|
|
8
|
+
updateModuleName: (id: string, name: string) => void;
|
|
9
|
+
deleteModule: (id: string) => void;
|
|
10
|
+
updateOperationName: (id: string, name: string) => void;
|
|
11
|
+
deleteOperation: (id: string) => void;
|
|
12
|
+
addOperationAndInitialSchema: (moduleId: string, name: string) => Promise<string | undefined>;
|
|
13
|
+
updateOperationSchema: (id: string, newDoc: string) => void;
|
|
14
|
+
setOperationDescription: (id: string, description: string) => void;
|
|
15
|
+
addOperationError: (operationId: string, errorName: string) => Promise<string | undefined>;
|
|
16
|
+
deleteOperationError: (id: string) => void;
|
|
17
|
+
setOperationErrorName: (operationId: string, errorId: string, name: string) => void;
|
|
18
|
+
toggleNoInputRequired: (id: string, noInputRequired: boolean) => void;
|
|
19
|
+
};
|
|
20
|
+
export declare function Module(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/module.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,IAAI,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGrE,KAAK,KAAK,GAAG;IACX,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACrC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC3D,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,4BAA4B,EAAE,CAC5B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACjC,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,uBAAuB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACnE,iBAAiB,EAAE,CACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACjC,oBAAoB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,qBAAqB,EAAE,CACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,KACT,IAAI,CAAC;IACV,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;CACvE,CAAC;AACF,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,2CAiElC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ModuleForm } from "./module-form.js";
|
|
3
|
+
import { Operations } from "./operations.js";
|
|
4
|
+
export function Module(props) {
|
|
5
|
+
const { module, modules, allOperations, lastCreatedModuleId, onAddModule, updateModuleName, deleteModule, updateOperationName, deleteOperation, addOperationAndInitialSchema, updateOperationSchema, setOperationDescription, addOperationError, deleteOperationError, setOperationErrorName, toggleNoInputRequired, } = props;
|
|
6
|
+
return (_jsxs("div", { className: "relative rounded-3xl bg-gray-100 p-6", children: [_jsxs("div", { className: "mb-2 w-1/2 pr-6", children: [_jsx(ModuleForm, { modules: modules, module: module, onAddModule: onAddModule, updateModuleName: updateModuleName }), !!module && (_jsx("button", { "aria-label": "Delete module", tabIndex: -1, className: "absolute right-1 top-1 p-2 text-gray-800 transition-colors hover:text-gray-500", onClick: () => {
|
|
7
|
+
deleteModule(module.id);
|
|
8
|
+
}, children: _jsx("svg", { className: "size-6", viewBox: "0 0 24 24", fill: "currentcolor", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M16.9993 8.51506L15.4844 7L11.9994 10.4852L8.51497 7.00057L7 8.51562L10.4844 12.0003L7.00056 15.4843L8.51552 16.9994L11.9994 13.5153L15.4838 17L16.9988 15.4849L13.5144 12.0003L16.9993 8.51506Z" }) }) }))] }), !!module && (_jsx(Operations, { module: module, allOperations: allOperations, shouldFocusNewOperation: module.id === lastCreatedModuleId, updateOperationName: updateOperationName, deleteOperation: deleteOperation, addOperationAndInitialSchema: addOperationAndInitialSchema, updateOperationSchema: updateOperationSchema, setOperationDescription: setOperationDescription, addOperationError: addOperationError, deleteOperationError: deleteOperationError, setOperationErrorName: setOperationErrorName, toggleNoInputRequired: toggleNoInputRequired }))] }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/module.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA6B7C,MAAM,UAAU,MAAM,CAAC,KAAY;IACjC,MAAM,EACJ,MAAM,EACN,OAAO,EACP,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,GAAG,KAAK,CAAC;IACV,OAAO,CACL,eAAK,SAAS,EAAC,sCAAsC,aACnD,eAAK,SAAS,EAAC,iBAAiB,aAC9B,KAAC,UAAU,IACT,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,GAClC,EACD,CAAC,CAAC,MAAM,IAAI,CACX,+BACa,eAAe,EAC1B,QAAQ,EAAE,CAAC,CAAC,EACZ,SAAS,EAAC,gFAAgF,EAC1F,OAAO,EAAE,GAAG,EAAE;4BACZ,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;wBAC1B,CAAC,YAED,cAAK,SAAS,EAAC,QAAQ,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,YAC7D,eACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,kMAAkM,GACpM,GACE,GACC,CACV,IACG,EACL,CAAC,CAAC,MAAM,IAAI,CACX,KAAC,UAAU,IACT,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,EAC5B,uBAAuB,EAAE,MAAM,CAAC,EAAE,KAAK,mBAAmB,EAC1D,mBAAmB,EAAE,mBAAmB,EACxC,eAAe,EAAE,eAAe,EAChC,4BAA4B,EAAE,4BAA4B,EAC1D,qBAAqB,EAAE,qBAAqB,EAC5C,uBAAuB,EAAE,uBAAuB,EAChD,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,oBAAoB,EAC1C,qBAAqB,EAAE,qBAAqB,EAC5C,qBAAqB,EAAE,qBAAqB,GAC5C,CACH,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ModuleSpecification as TModule } from "document-model";
|
|
2
|
+
type Props = {
|
|
3
|
+
modules: TModule[];
|
|
4
|
+
allOperations: TModule["operations"];
|
|
5
|
+
addModule: (name: string) => Promise<string | undefined>;
|
|
6
|
+
updateModuleName: (id: string, name: string) => void;
|
|
7
|
+
deleteModule: (id: string) => void;
|
|
8
|
+
updateOperationName: (id: string, name: string) => void;
|
|
9
|
+
deleteOperation: (id: string) => void;
|
|
10
|
+
addOperationAndInitialSchema: (moduleId: string, name: string) => Promise<string | undefined>;
|
|
11
|
+
updateOperationSchema: (id: string, newDoc: string) => void;
|
|
12
|
+
setOperationDescription: (id: string, description: string) => void;
|
|
13
|
+
addOperationError: (operationId: string, errorName: string) => Promise<string | undefined>;
|
|
14
|
+
deleteOperationError: (id: string) => void;
|
|
15
|
+
setOperationErrorName: (operationId: string, errorId: string, name: string) => void;
|
|
16
|
+
toggleNoInputRequired: (id: string, noInputRequired: boolean) => void;
|
|
17
|
+
};
|
|
18
|
+
export default function Modules({ modules, allOperations, addModule, updateModuleName, deleteModule, updateOperationName, deleteOperation, addOperationAndInitialSchema, updateOperationSchema, setOperationDescription, addOperationError, deleteOperationError, setOperationErrorName, toggleNoInputRequired, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=modules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/modules.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,IAAI,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAIrE,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACrC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACzD,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,4BAA4B,EAAE,CAC5B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACjC,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,uBAAuB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACnE,iBAAiB,EAAE,CACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACjC,oBAAoB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,qBAAqB,EAAE,CACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,KACT,IAAI,CAAC;IACV,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;CACvE,CAAC;AACF,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,OAAO,EACP,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,EAAE,KAAK,2CAoEP"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useRef, useState } from "react";
|
|
3
|
+
import { Module } from "./module.js";
|
|
4
|
+
export default function Modules({ modules, allOperations, addModule, updateModuleName, deleteModule, updateOperationName, deleteOperation, addOperationAndInitialSchema, updateOperationSchema, setOperationDescription, addOperationError, deleteOperationError, setOperationErrorName, toggleNoInputRequired, }) {
|
|
5
|
+
const [lastCreatedModuleId, setLastCreatedModuleId] = useState(null);
|
|
6
|
+
const focusTrapRef = useRef(null);
|
|
7
|
+
const onAddModule = useCallback(async (name) => {
|
|
8
|
+
const moduleId = await addModule(name);
|
|
9
|
+
if (moduleId) {
|
|
10
|
+
setLastCreatedModuleId(moduleId);
|
|
11
|
+
focusTrapRef.current?.focus();
|
|
12
|
+
}
|
|
13
|
+
return moduleId;
|
|
14
|
+
}, [addModule, setLastCreatedModuleId]);
|
|
15
|
+
return (_jsxs("div", { className: "flex flex-col gap-2", children: [modules.map((module) => (_jsx(Module, { module: module, modules: modules, allOperations: allOperations, lastCreatedModuleId: lastCreatedModuleId, onAddModule: onAddModule, updateModuleName: updateModuleName, deleteModule: deleteModule, updateOperationName: updateOperationName, deleteOperation: deleteOperation, addOperationAndInitialSchema: addOperationAndInitialSchema, updateOperationSchema: updateOperationSchema, setOperationDescription: setOperationDescription, addOperationError: addOperationError, deleteOperationError: deleteOperationError, setOperationErrorName: setOperationErrorName, toggleNoInputRequired: toggleNoInputRequired }, module.id))), _jsx(Module, { modules: modules, allOperations: allOperations, lastCreatedModuleId: lastCreatedModuleId, onAddModule: onAddModule, updateModuleName: updateModuleName, deleteModule: deleteModule, updateOperationName: updateOperationName, deleteOperation: deleteOperation, addOperationAndInitialSchema: addOperationAndInitialSchema, updateOperationSchema: updateOperationSchema, setOperationDescription: setOperationDescription, addOperationError: addOperationError, deleteOperationError: deleteOperationError, setOperationErrorName: setOperationErrorName, toggleNoInputRequired: toggleNoInputRequired }, "add-module"), _jsx("div", { ref: focusTrapRef, tabIndex: 0, className: "size-0 overflow-hidden", "aria-hidden": "true" })] }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=modules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/modules.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA4BrC,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,OAAO,EACP,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAu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EAAE,mBAAmB,EACxC,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,eAAe,EAAE,eAAe,EAChC,4BAA4B,EAAE,4BAA4B,EAC1D,qBAAqB,EAAE,qBAAqB,EAC5C,uBAAuB,EAAE,uBAAuB,EAChD,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,oBAAoB,EAC1C,qBAAqB,EAAE,qBAAqB,EAC5C,qBAAqB,EAAE,qBAAqB,IAfxC,YAAY,CAgBhB,EAEF,cACE,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAC,wBAAwB,iBACtB,MAAM,GAClB,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ModuleSpecification } from "document-model";
|
|
2
|
+
type Props = {
|
|
3
|
+
operation: ModuleSpecification["operations"][number];
|
|
4
|
+
focusOnMount?: boolean;
|
|
5
|
+
setOperationDescription: (id: string, description: string) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function OperationDescriptionForm({ operation, focusOnMount, setOperationDescription, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=operation-description-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-description-form.d.ts","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/operation-description-form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAI1D,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;IACrD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uBAAuB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CACpE,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,EACvC,SAAS,EACT,YAAY,EACZ,uBAAuB,GACxB,EAAE,KAAK,2CAsBP"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import { TextField } from "./text-field.js";
|
|
4
|
+
export function OperationDescriptionForm({ operation, focusOnMount, setOperationDescription, }) {
|
|
5
|
+
const textFieldRef = useRef(null);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (focusOnMount && textFieldRef.current) {
|
|
8
|
+
textFieldRef.current.focus();
|
|
9
|
+
}
|
|
10
|
+
}, [focusOnMount]);
|
|
11
|
+
return (_jsx(TextField, { ref: textFieldRef, name: "description", value: operation.description, onSubmit: (newDescription) => setOperationDescription(operation.id, newDescription), label: "Operation description", allowEmpty: true, placeholder: "Operation Description" }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=operation-description-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-description-form.js","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/operation-description-form.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,MAAM,UAAU,wBAAwB,CAAC,EACvC,SAAS,EACT,YAAY,EACZ,uBAAuB,GACjB;IACN,MAAM,YAAY,GAAG,MAAM,CAA+B,IAAI,CAAC,CAAC;IAEhE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,YAAY,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YACzC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QAC/B,CAAC;IACH,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,OAAO,CACL,KAAC,SAAS,IACR,GAAG,EAAE,YAAY,EACjB,IAAI,EAAC,aAAa,EAClB,KAAK,EAAE,SAAS,CAAC,WAAW,EAC5B,QAAQ,EAAE,CAAC,cAAc,EAAE,EAAE,CAC3B,uBAAuB,CAAC,SAAS,CAAC,EAAE,EAAE,cAAc,CAAC,EAEvD,KAAK,EAAC,uBAAuB,EAC7B,UAAU,QACV,WAAW,EAAC,uBAAuB,GACnC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { OperationErrorSpecification, ModuleSpecification } from "document-model";
|
|
2
|
+
type Props = {
|
|
3
|
+
operation: ModuleSpecification["operations"][number];
|
|
4
|
+
error?: OperationErrorSpecification;
|
|
5
|
+
focusOnMount?: boolean;
|
|
6
|
+
onSubmit?: () => void;
|
|
7
|
+
onAddOperationError: (operationId: string, errorName: string) => Promise<string | undefined>;
|
|
8
|
+
deleteOperationError: (id: string) => void;
|
|
9
|
+
setOperationErrorName: (operationId: string, errorId: string, name: string) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function OperationErrorForm({ operation, error, focusOnMount, onSubmit, onAddOperationError, deleteOperationError, setOperationErrorName, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=operation-error-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-error-form.d.ts","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/operation-error-form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,2BAA2B,EAC3B,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AAIxB,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;IACrD,KAAK,CAAC,EAAE,2BAA2B,CAAC;IACpC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,mBAAmB,EAAE,CACnB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACjC,oBAAoB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,qBAAqB,EAAE,CACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,KACT,IAAI,CAAC;CACX,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,GACtB,EAAE,KAAK,2CA0DP"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { pascalCase } from "change-case";
|
|
3
|
+
import { useCallback, useRef } from "react";
|
|
4
|
+
import { TextField } from "./text-field.js";
|
|
5
|
+
export function OperationErrorForm({ operation, error, focusOnMount, onSubmit, onAddOperationError, deleteOperationError, setOperationErrorName, }) {
|
|
6
|
+
const textFieldRef = useRef(null);
|
|
7
|
+
const isEdit = !!error;
|
|
8
|
+
const allOperationErrorNames = operation.errors
|
|
9
|
+
.map((o) => o.name)
|
|
10
|
+
.filter((n) => n !== null);
|
|
11
|
+
const handleSubmit = useCallback((name) => {
|
|
12
|
+
if (isEdit && name === "") {
|
|
13
|
+
deleteOperationError(error.id);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const formattedName = pascalCase(name);
|
|
17
|
+
if (isEdit) {
|
|
18
|
+
setOperationErrorName(operation.id, error.id, formattedName);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
onAddOperationError(operation.id, formattedName);
|
|
22
|
+
}
|
|
23
|
+
onSubmit?.();
|
|
24
|
+
}, [
|
|
25
|
+
isEdit,
|
|
26
|
+
error?.id,
|
|
27
|
+
operation.id,
|
|
28
|
+
deleteOperationError,
|
|
29
|
+
setOperationErrorName,
|
|
30
|
+
onAddOperationError,
|
|
31
|
+
onSubmit,
|
|
32
|
+
]);
|
|
33
|
+
const handleChange = useCallback((value) => {
|
|
34
|
+
if (isEdit && value === "") {
|
|
35
|
+
deleteOperationError(error.id);
|
|
36
|
+
}
|
|
37
|
+
}, [isEdit, error?.id, deleteOperationError]);
|
|
38
|
+
return (_jsx(TextField, { ref: textFieldRef, name: "name", value: error?.name, onSubmit: handleSubmit, onChange: handleChange, placeholder: "Add exception", required: !isEdit, allowEmpty: !isEdit, shouldReset: !isEdit, unique: allOperationErrorNames, focusOnMount: focusOnMount }));
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=operation-error-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-error-form.js","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/operation-error-form.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKzC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAmB5C,MAAM,UAAU,kBAAkB,CAAC,EACjC,SAAS,EACT,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,GACf;IACN,MAAM,YAAY,GAAG,MAAM,CAA+B,IAAI,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC;IACvB,MAAM,sBAAsB,GAAG,SAAS,CAAC,MAAM;SAC5C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;SAClB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;IAE7B,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,IAAY,EAAE,EAAE;QACf,IAAI,MAAM,IAAI,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-model";
|
|
2
|
+
type Props = {
|
|
3
|
+
operation: ModuleSpecification["operations"][number];
|
|
4
|
+
addOperationError: (operationId: string, errorName: string) => Promise<string | undefined>;
|
|
5
|
+
deleteOperationError: (id: string) => void;
|
|
6
|
+
setOperationErrorName: (operationId: string, errorId: string, name: string) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function OperationErrors({ operation, addOperationError, deleteOperationError, setOperationErrorName, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=operation-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-errors.d.ts","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/operation-errors.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAI1D,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;IACrD,iBAAiB,EAAE,CACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACjC,oBAAoB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,qBAAqB,EAAE,CACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,KACT,IAAI,CAAC;CACX,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,GACtB,EAAE,KAAK,2CA8CP"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useId, useState } from "react";
|
|
3
|
+
import { OperationErrorForm } from "./operation-error-form.js";
|
|
4
|
+
export function OperationErrors({ operation, addOperationError, deleteOperationError, setOperationErrorName, }) {
|
|
5
|
+
const addErrorFormId = useId();
|
|
6
|
+
const [shouldFocusAddForm, setShouldFocusAddForm] = useState(false);
|
|
7
|
+
const onAddOperationError = useCallback(async (operationId, error) => {
|
|
8
|
+
const errorId = await addOperationError(operationId, error);
|
|
9
|
+
if (errorId) {
|
|
10
|
+
setShouldFocusAddForm(true);
|
|
11
|
+
}
|
|
12
|
+
return errorId;
|
|
13
|
+
}, [addOperationError, setShouldFocusAddForm]);
|
|
14
|
+
const onAddOperationErrorSubmit = useCallback(() => setShouldFocusAddForm(false), [setShouldFocusAddForm]);
|
|
15
|
+
return (_jsxs("ul", { className: "ml-4 list-disc", children: [operation.errors.map((error) => (_jsx("li", { children: _jsx(OperationErrorForm, { error: error, operation: operation, onAddOperationError: onAddOperationError, deleteOperationError: deleteOperationError, setOperationErrorName: setOperationErrorName }) }, error.id))), _jsx("li", { children: _jsx(OperationErrorForm, { operation: operation, onAddOperationError: onAddOperationError, deleteOperationError: deleteOperationError, setOperationErrorName: setOperationErrorName, focusOnMount: shouldFocusAddForm, onSubmit: onAddOperationErrorSubmit }, `${addErrorFormId}-${shouldFocusAddForm}`) })] }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=operation-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-errors.js","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/operation-errors.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAgB/D,MAAM,UAAU,eAAe,CAAC,EAC9B,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,GACf;IACN,MAAM,cAAc,GAAG,KAAK,EAAE,CAAC;IAC/B,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpE,MAAM,mBAAmB,GAAG,WAAW,CACrC,KAAK,EAAE,WAAmB,EAAE,KAAa,EAAE,EAAE;QAC3C,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAC5D,IAAI,OAAO,EAAE,CAAC;YACZ,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,EACD,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAC3C,CAAC;IAEF,MAAM,yBAAyB,GAAG,WAAW,CAC3C,GAAG,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAClC,CAAC,qBAAqB,CAAC,CACxB,CAAC;IAEF,OAAO,CACL,cAAI,SAAS,EAAC,gBAAgB,aAC3B,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC/B,uBACE,KAAC,kBAAkB,IACjB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,oBAAoB,EAAE,oBAAoB,EAC1C,qBAAqB,EAAE,qBAAqB,GAC5C,IAPK,KAAK,CAAC,EAAE,CAQZ,CACN,CAAC,EACF,uBACE,KAAC,kBAAkB,IACjB,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,oBAAoB,EAAE,oBAAoB,EAC1C,qBAAqB,EAAE,qBAAqB,EAE5C,YAAY,EAAE,kBAAkB,EAChC,QAAQ,EAAE,yBAAyB,IAF9B,GAAG,cAAc,IAAI,kBAAkB,EAAE,CAG9C,GACC,IACF,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ModuleSpecification } from "document-model";
|
|
2
|
+
type Props = {
|
|
3
|
+
module: ModuleSpecification;
|
|
4
|
+
operation?: ModuleSpecification["operations"][number];
|
|
5
|
+
focusOnMount?: boolean;
|
|
6
|
+
allOperationNames: string[];
|
|
7
|
+
onAddOperationAndInitialSchema: (moduleId: string, name: string) => Promise<string | undefined>;
|
|
8
|
+
updateOperationName: (id: string, name: string) => void;
|
|
9
|
+
deleteOperation: (id: string) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function OperationForm({ operation, module, focusOnMount, allOperationNames, onAddOperationAndInitialSchema, updateOperationName, deleteOperation, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=operation-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-form.d.ts","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/operation-form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAK1D,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,mBAAmB,CAAC;IAC5B,SAAS,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;IACtD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,8BAA8B,EAAE,CAC9B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACjC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,8BAA8B,EAC9B,mBAAmB,EACnB,eAAe,GAChB,EAAE,KAAK,2CAuDP"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { toConstantCase } from "../schemas/inputs.js";
|
|
4
|
+
import { TextField } from "./text-field.js";
|
|
5
|
+
export function OperationForm({ operation, module, focusOnMount, allOperationNames, onAddOperationAndInitialSchema, updateOperationName, deleteOperation, }) {
|
|
6
|
+
const isEdit = !!operation;
|
|
7
|
+
const handleSubmit = useCallback(async (name) => {
|
|
8
|
+
if (isEdit && name === "") {
|
|
9
|
+
deleteOperation(operation.id);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const formattedName = toConstantCase(name);
|
|
13
|
+
if (isEdit) {
|
|
14
|
+
if (formattedName !== operation.name) {
|
|
15
|
+
updateOperationName(operation.id, formattedName);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
await onAddOperationAndInitialSchema(module.id, formattedName);
|
|
20
|
+
}
|
|
21
|
+
}, [
|
|
22
|
+
isEdit,
|
|
23
|
+
operation?.id,
|
|
24
|
+
operation?.name,
|
|
25
|
+
module.id,
|
|
26
|
+
deleteOperation,
|
|
27
|
+
updateOperationName,
|
|
28
|
+
onAddOperationAndInitialSchema,
|
|
29
|
+
]);
|
|
30
|
+
const handleChange = useCallback((value) => {
|
|
31
|
+
if (isEdit && value === "") {
|
|
32
|
+
deleteOperation(operation.id);
|
|
33
|
+
}
|
|
34
|
+
}, [isEdit, operation?.id, deleteOperation]);
|
|
35
|
+
return (_jsx(TextField, { name: "name", value: operation?.name, label: isEdit ? "Operation name *" : "Add operation *", onSubmit: handleSubmit, onChange: handleChange, placeholder: "Add operation", required: !isEdit, allowEmpty: !isEdit, shouldReset: !isEdit, focusOnMount: focusOnMount, unique: allOperationNames }));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=operation-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-form.js","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/operation-form.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,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,CACL,KAAC,SAAS,IACR,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,SAAS,EAAE,IAAI,EACtB,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,iBAAiB,EACtD,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAC,eAAe,EAC3B,QAAQ,EAAE,CAAC,MAAM,EACjB,UAAU,EAAE,CAAC,MAAM,EACnB,WAAW,EAAE,CAAC,MAAM,EACpB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,iBAAiB,GACzB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ModuleSpecification } from "document-model";
|
|
2
|
+
import type { DocumentActionHandlers } from "../types/documents.js";
|
|
3
|
+
export type WrappedHandlers = DocumentActionHandlers & {
|
|
4
|
+
addOperationAndInitialSchema: (moduleId: string, name: string) => Promise<string | undefined>;
|
|
5
|
+
};
|
|
6
|
+
type Props = {
|
|
7
|
+
lastCreatedOperationId: string | null;
|
|
8
|
+
operation: ModuleSpecification["operations"][number];
|
|
9
|
+
module: ModuleSpecification;
|
|
10
|
+
allOperationNames: string[];
|
|
11
|
+
onAddOperationAndInitialSchema: (moduleId: string, name: string) => Promise<string | undefined>;
|
|
12
|
+
updateOperationName: (id: string, name: string) => void;
|
|
13
|
+
deleteOperation: (id: string) => void;
|
|
14
|
+
updateOperationSchema: (id: string, newDoc: string) => void;
|
|
15
|
+
setOperationDescription: (id: string, description: string) => void;
|
|
16
|
+
addOperationError: (operationId: string, errorName: string) => Promise<string | undefined>;
|
|
17
|
+
deleteOperationError: (id: string) => void;
|
|
18
|
+
setOperationErrorName: (operationId: string, errorId: string, name: string) => void;
|
|
19
|
+
toggleNoInputRequired: (id: string, noInputRequired: boolean) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare function Operation(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../editors/document-model-editor/components/operation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAOpE,MAAM,MAAM,eAAe,GAAG,sBAAsB,GAAG;IACrD,4BAA4B,EAAE,CAC5B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAClC,CAAC;AACF,KAAK,KAAK,GAAG;IACX,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,SAAS,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;IACrD,MAAM,EAAE,mBAAmB,CAAC;IAC5B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,8BAA8B,EAAE,CAC9B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACjC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,uBAAuB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACnE,iBAAiB,EAAE,CACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACjC,oBAAoB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,qBAAqB,EAAE,CACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,KACT,IAAI,CAAC;IACV,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;CACvE,CAAC;AACF,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,2CAoGrC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { lazy, Suspense, useCallback } from "react";
|
|
3
|
+
import { isEmptyOperationSchema } from "../utils/helpers.js";
|
|
4
|
+
import { ensureValidOperationSchemaInputName } from "../utils/linting.js";
|
|
5
|
+
import { OperationDescriptionForm } from "./operation-description-form.js";
|
|
6
|
+
import { OperationErrors } from "./operation-errors.js";
|
|
7
|
+
import { OperationForm } from "./operation-form.js";
|
|
8
|
+
const GraphqlEditor = lazy(() => import("./code-editors/graphql-editor.js"));
|
|
9
|
+
export function Operation(props) {
|
|
10
|
+
const { operation, module, allOperationNames, lastCreatedOperationId, onAddOperationAndInitialSchema, updateOperationName, deleteOperation, updateOperationSchema, setOperationDescription, addOperationError, deleteOperationError, setOperationErrorName, toggleNoInputRequired, } = props;
|
|
11
|
+
const noInputRequired = isEmptyOperationSchema(operation.schema);
|
|
12
|
+
const handleToggleNoInput = useCallback((checked) => toggleNoInputRequired(operation.id, checked), [operation.id, toggleNoInputRequired]);
|
|
13
|
+
const handleUpdateDocument = useCallback((newDoc) => updateOperationSchema(operation.id, newDoc), [operation.id, updateOperationSchema]);
|
|
14
|
+
const customLinter = useCallback((doc) => operation.name
|
|
15
|
+
? ensureValidOperationSchemaInputName(doc, operation.name)
|
|
16
|
+
: [], [operation.name]);
|
|
17
|
+
return (_jsxs("div", { className: "mt-4 grid grid-cols-2 gap-x-12", style: {
|
|
18
|
+
gridTemplateAreas: `
|
|
19
|
+
"left editor"
|
|
20
|
+
"errors editor"
|
|
21
|
+
`,
|
|
22
|
+
gridTemplateRows: "auto 1fr",
|
|
23
|
+
}, children: [_jsxs("div", { className: "flex flex-col gap-2", style: { gridArea: "left" }, children: [_jsx(OperationForm, { operation: operation, onAddOperationAndInitialSchema: onAddOperationAndInitialSchema, updateOperationName: updateOperationName, deleteOperation: deleteOperation, module: module, allOperationNames: allOperationNames }), _jsx(OperationDescriptionForm, { operation: operation, focusOnMount: operation.id === lastCreatedOperationId, setOperationDescription: setOperationDescription })] }), _jsxs("div", { className: "relative top-8", style: { gridArea: "editor" }, children: [_jsxs("label", { className: "mb-2 flex cursor-pointer items-center gap-2", children: [_jsx("input", { type: "checkbox", checked: noInputRequired, onChange: (e) => handleToggleNoInput(e.target.checked), className: "h-4 w-4 rounded border-gray-300" }), _jsx("span", { className: "text-sm text-gray-700", children: "Operation with no inputs" })] }), !noInputRequired && (_jsx(Suspense, { children: _jsx(GraphqlEditor, { doc: operation.schema ?? "", updateDocumentInModel: handleUpdateDocument, customLinter: customLinter }) }))] }), _jsxs("div", { style: { gridArea: "errors" }, children: [_jsx("h3", { className: "my-2 text-sm font-medium text-gray-700", children: "Reducer Exceptions" }), _jsx(OperationErrors, { operation: operation, addOperationError: addOperationError, deleteOperationError: deleteOperationError, setOperationErrorName: setOperationErrorName })] })] }));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=operation.js.map
|