@powerhousedao/powerhouse-vetra-packages 6.1.0-dev.2 → 6.1.0-dev.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/dist/browser/assets/entry-Bzani6_n.js +313 -0
  2. package/dist/browser/assets/projection-entry-Bpu-8SnI.js +406 -0
  3. package/dist/browser/{dist-DOMEWT3x.js → connect-ZnLjvmRt.js} +13013 -10302
  4. package/dist/browser/connect-ZnLjvmRt.js.map +1 -0
  5. package/dist/browser/dist-C1nRM9t2.js +3768 -0
  6. package/dist/browser/dist-C1nRM9t2.js.map +1 -0
  7. package/dist/browser/{schemas-Bqem6NRm.js → dist-CXoKspdx.js} +131 -2
  8. package/dist/browser/dist-CXoKspdx.js.map +1 -0
  9. package/dist/browser/dist-D8H48e8N.js +2692 -0
  10. package/dist/browser/dist-D8H48e8N.js.map +1 -0
  11. package/dist/browser/{dist-CC1E3l2O.js → dist-DLFI75Zd.js} +37 -9
  12. package/dist/browser/dist-DLFI75Zd.js.map +1 -0
  13. package/dist/browser/{dist-DQgJ8n4d.js → document-drive-oqv68jDU.js} +432 -290
  14. package/dist/browser/document-drive-oqv68jDU.js.map +1 -0
  15. package/dist/browser/document-models/index.js +1 -1
  16. package/dist/browser/{documents-Bpu0aSLb.js → documents-D4ek7Ubv.js} +3 -3
  17. package/dist/browser/{documents-Bpu0aSLb.js.map → documents-D4ek7Ubv.js.map} +1 -1
  18. package/dist/browser/{editor-B3yz7YdR.js → editor-CoTq6fqT.js} +32 -31
  19. package/dist/browser/editor-CoTq6fqT.js.map +1 -0
  20. package/dist/browser/{editor-Dm_73jiz.js → editor-DC3bigBu.js} +5 -5
  21. package/dist/browser/{editor-Dm_73jiz.js.map → editor-DC3bigBu.js.map} +1 -1
  22. package/dist/browser/editors/document-model-editor/module.js +1 -1
  23. package/dist/browser/editors/generic-drive-explorer/index.js +6 -6
  24. package/dist/browser/editors/generic-drive-explorer/index.js.map +1 -1
  25. package/dist/browser/editors/generic-drive-explorer/module.js +1 -1
  26. package/dist/browser/{folder-view-H2ov-zId.js → folder-view-DmYBf2pP.js} +13 -12
  27. package/dist/browser/folder-view-DmYBf2pP.js.map +1 -0
  28. package/dist/browser/{graphql-editor-CnaQ3XWx.js → graphql-editor-CiGd_Li7.js} +15 -7
  29. package/dist/browser/{graphql-editor-CnaQ3XWx.js.map → graphql-editor-CiGd_Li7.js.map} +1 -1
  30. package/dist/{node/hooks-Lbsf6g-v.mjs → browser/hooks-CORHBNHb.js} +6 -4
  31. package/dist/browser/{hooks-Beny0xpe.js.map → hooks-CORHBNHb.js.map} +1 -1
  32. package/dist/browser/index.js +2 -2
  33. package/dist/{node/json-editor-CVGgDVh2.mjs → browser/json-editor-sEqd5piI.js} +12 -4
  34. package/dist/browser/json-editor-sEqd5piI.js.map +1 -0
  35. package/dist/browser/{style-DYS_RFSN.js → linting-Dn6pXRkK.js} +7 -14
  36. package/dist/browser/linting-Dn6pXRkK.js.map +1 -0
  37. package/dist/browser/{parser-B0sh99Kk.js → parser-CkF6Qt8V.js} +1 -1
  38. package/dist/browser/{parser-B0sh99Kk.js.map → parser-CkF6Qt8V.js.map} +1 -1
  39. package/dist/browser/{schema-context-C0GpuR27.js → schema-context-DY-GEGnY.js} +4 -4
  40. package/dist/browser/schema-context-DY-GEGnY.js.map +1 -0
  41. package/dist/browser/state-schemas-DJmzG_M8.js +308 -0
  42. package/dist/browser/state-schemas-DJmzG_M8.js.map +1 -0
  43. package/dist/node/{dist-1kPMPFPD.mjs → connect-BLC4PXD9.mjs} +13953 -11229
  44. package/dist/node/connect-BLC4PXD9.mjs.map +1 -0
  45. package/dist/node/dist-BeZaEP6S.mjs +2692 -0
  46. package/dist/node/dist-BeZaEP6S.mjs.map +1 -0
  47. package/dist/node/dist-Bm05eoTg.mjs +3769 -0
  48. package/dist/node/dist-Bm05eoTg.mjs.map +1 -0
  49. package/dist/node/{tslib.es6-DwVpIYUS.mjs → dist-Cn3iExnV.mjs} +489 -3
  50. package/dist/node/dist-Cn3iExnV.mjs.map +1 -0
  51. package/dist/node/{schemas-Cb8uEF9u.mjs → dist-fA4EItr0.mjs} +131 -2
  52. package/dist/node/dist-fA4EItr0.mjs.map +1 -0
  53. package/dist/node/{dist-Bz4SgEHs.mjs → document-drive-sM33juXr.mjs} +432 -290
  54. package/dist/node/document-drive-sM33juXr.mjs.map +1 -0
  55. package/dist/node/document-models/index.mjs +1 -1
  56. package/dist/node/{documents-BWJpUm9f.mjs → documents-BFBPmyw1.mjs} +3 -3
  57. package/dist/node/{documents-BWJpUm9f.mjs.map → documents-BFBPmyw1.mjs.map} +1 -1
  58. package/dist/node/{editor-W8QOlGXD.mjs → editor-BFBa9nsO.mjs} +32 -31
  59. package/dist/node/editor-BFBa9nsO.mjs.map +1 -0
  60. package/dist/node/{editor-BaXuDsby.mjs → editor-BrS98lEH.mjs} +5 -5
  61. package/dist/node/{editor-BaXuDsby.mjs.map → editor-BrS98lEH.mjs.map} +1 -1
  62. package/dist/node/editors/document-model-editor/module.mjs +1 -1
  63. package/dist/node/editors/generic-drive-explorer/index.mjs +6 -6
  64. package/dist/node/editors/generic-drive-explorer/index.mjs.map +1 -1
  65. package/dist/node/editors/generic-drive-explorer/module.mjs +1 -1
  66. package/dist/node/{folder-view-B0FNXbc0.mjs → folder-view-DHph3Yuu.mjs} +13 -12
  67. package/dist/node/folder-view-DHph3Yuu.mjs.map +1 -0
  68. package/dist/node/{graphql-Du2phcBf.mjs → graphql-DskHmkMe.mjs} +2 -2
  69. package/dist/node/{graphql-Du2phcBf.mjs.map → graphql-DskHmkMe.mjs.map} +1 -1
  70. package/dist/node/{graphql-editor-D1koK5kR.mjs → graphql-editor-CPq7oIbf.mjs} +14 -6
  71. package/dist/node/{graphql-editor-D1koK5kR.mjs.map → graphql-editor-CPq7oIbf.mjs.map} +1 -1
  72. package/dist/{browser/hooks-Beny0xpe.js → node/hooks-DJrjfVaS.mjs} +6 -4
  73. package/dist/node/{hooks-Lbsf6g-v.mjs.map → hooks-DJrjfVaS.mjs.map} +1 -1
  74. package/dist/node/index.mjs +2 -2
  75. package/dist/{browser/json-editor-h3cffF6X.js → node/json-editor-L32CP7TS.mjs} +12 -4
  76. package/dist/node/json-editor-L32CP7TS.mjs.map +1 -0
  77. package/dist/node/{style-CxHkfyna.mjs → linting-Dx50GuLN.mjs} +7 -14
  78. package/dist/node/linting-Dx50GuLN.mjs.map +1 -0
  79. package/dist/node/{schema-context-mLgEY1Hh.mjs → schema-context-CX5ml_9t.mjs} +4 -4
  80. package/dist/node/schema-context-CX5ml_9t.mjs.map +1 -0
  81. package/dist/node/state-schemas-XTTjQZOe.mjs +309 -0
  82. package/dist/node/state-schemas-XTTjQZOe.mjs.map +1 -0
  83. package/package.json +10 -10
  84. package/style.css +1 -0
  85. package/dist/browser/connect-CKdlDSUw.js +0 -9460
  86. package/dist/browser/connect-CKdlDSUw.js.map +0 -1
  87. package/dist/browser/dist-BXygvBtd.js +0 -132
  88. package/dist/browser/dist-BXygvBtd.js.map +0 -1
  89. package/dist/browser/dist-CC1E3l2O.js.map +0 -1
  90. package/dist/browser/dist-DOMEWT3x.js.map +0 -1
  91. package/dist/browser/dist-DQgJ8n4d.js.map +0 -1
  92. package/dist/browser/editor-B3yz7YdR.js.map +0 -1
  93. package/dist/browser/folder-view-H2ov-zId.js.map +0 -1
  94. package/dist/browser/json-editor-h3cffF6X.js.map +0 -1
  95. package/dist/browser/schema-context-C0GpuR27.js.map +0 -1
  96. package/dist/browser/schemas-Bqem6NRm.js.map +0 -1
  97. package/dist/browser/state-schemas-C5NPeV6-.js +0 -674
  98. package/dist/browser/state-schemas-C5NPeV6-.js.map +0 -1
  99. package/dist/browser/style-DYS_RFSN.js.map +0 -1
  100. package/dist/browser/tslib.es6-DRuVAsR8.js +0 -32
  101. package/dist/browser/tslib.es6-DRuVAsR8.js.map +0 -1
  102. package/dist/node/connect-SGvLzr5K.mjs +0 -9475
  103. package/dist/node/connect-SGvLzr5K.mjs.map +0 -1
  104. package/dist/node/dist-1kPMPFPD.mjs.map +0 -1
  105. package/dist/node/dist-BQTIepWC.mjs +0 -132
  106. package/dist/node/dist-BQTIepWC.mjs.map +0 -1
  107. package/dist/node/dist-Bz4SgEHs.mjs.map +0 -1
  108. package/dist/node/dist-Cay1iRRr.mjs +0 -491
  109. package/dist/node/dist-Cay1iRRr.mjs.map +0 -1
  110. package/dist/node/editor-W8QOlGXD.mjs.map +0 -1
  111. package/dist/node/folder-view-B0FNXbc0.mjs.map +0 -1
  112. package/dist/node/json-editor-CVGgDVh2.mjs.map +0 -1
  113. package/dist/node/schema-context-mLgEY1Hh.mjs.map +0 -1
  114. package/dist/node/schemas-Cb8uEF9u.mjs.map +0 -1
  115. package/dist/node/state-schemas-DAthoEEk.mjs +0 -675
  116. package/dist/node/state-schemas-DAthoEEk.mjs.map +0 -1
  117. package/dist/node/style-CxHkfyna.mjs.map +0 -1
  118. package/dist/node/tslib.es6-DwVpIYUS.mjs.map +0 -1
  119. package/dist/style.css +0 -906
@@ -1,10 +1,10 @@
1
- import { b as $ZodError, c as literal, f as string, h as url, p as union, u as object, v as parse, y as parseAsync } from "./schemas-Bqem6NRm.js";
2
- import { B as setOperationDescription, E as deleteOperationError, F as setModelExtension, H as setOperationName, I as setModelId, L as setModelName, M as setAuthorWebsite, N as setInitialState, P as setModelDescription, R as setModuleName, T as deleteOperation, U as setOperationSchema, V as setOperationErrorName, W as setStateSchema, Y as generateId, f as addModule, j as setAuthorName, m as addOperationError, p as addOperation, w as deleteModule } from "./dist-DQgJ8n4d.js";
3
- import { a as snakeCase, n as constantCase, r as pascalCase } from "./dist-BXygvBtd.js";
4
- import { a as compareStringsWithoutWhitespace, c as isEmptyOperationSchema, f as makeOperationInitialDoc, l as makeEmptyOperationSchema, m as renameSchemaType, n as ensureValidOperationSchemaInputName, o as handleModelNameChange, s as initializeModelSchema, t as cn, u as makeInitialSchemaDoc } from "./style-DYS_RFSN.js";
5
- import { T as composeRefs, g as cn$1 } from "./dist-DOMEWT3x.js";
6
- import { S as useSetPHDocumentEditorConfig, b as useSelectedDocumentOfType, c as FormProvider, d as set, f as useForm, l as appendErrors, p as useFormContext, r as DocumentToolbar, s as Controller, u as get, y as usePHToast } from "./connect-CKdlDSUw.js";
7
- import { t as SchemaContextProvider } from "./schema-context-C0GpuR27.js";
1
+ import { C as parse, T as $ZodError, _ as string, a as snakeCase, b as url, h as object, n as constantCase, p as literal, r as pascalCase, v as union, w as parseAsync } from "./dist-CXoKspdx.js";
2
+ import { B as setOperationDescription, E as deleteOperationError, F as setModelExtension, H as setOperationName, I as setModelId, L as setModelName, M as setAuthorWebsite, N as setInitialState, P as setModelDescription, R as setModuleName, T as deleteOperation, U as setOperationSchema, V as setOperationErrorName, W as setStateSchema, Y as generateId, f as addModule, j as setAuthorName, m as addOperationError, p as addOperation, w as deleteModule } from "./document-drive-oqv68jDU.js";
3
+ import { a as handleModelNameChange, c as makeEmptyOperationSchema, d as makeOperationInitialDoc, i as compareStringsWithoutWhitespace, l as makeInitialSchemaDoc, o as initializeModelSchema, p as renameSchemaType, s as isEmptyOperationSchema, t as ensureValidOperationSchemaInputName } from "./linting-Dn6pXRkK.js";
4
+ import { c as FormProvider, d as set, f as useForm, l as appendErrors, p as useFormContext, r as DocumentToolbar, s as Controller, u as get } from "./connect-ZnLjvmRt.js";
5
+ import { C as twMerge, y as composeRefs } from "./dist-D8H48e8N.js";
6
+ import { E as useSetPHDocumentEditorConfig, b as useSelectedDocumentOfType, y as usePHToast } from "./dist-C1nRM9t2.js";
7
+ import { t as SchemaContextProvider } from "./schema-context-DY-GEGnY.js";
8
8
  import * as React$1 from "react";
9
9
  import React, { Suspense, forwardRef, lazy, useCallback, useEffect, useId, useImperativeHandle, useRef, useState } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -206,7 +206,7 @@ function Divider({ className, size = "sm", margin = "md" }) {
206
206
  if (margin === "md") return "my-6";
207
207
  return "my-8";
208
208
  }
209
- return /* @__PURE__ */ jsx("div", { className: cn$1("bg-gray-200", getSize(), getMargin(), className) });
209
+ return /* @__PURE__ */ jsx("div", { className: twMerge("bg-gray-200 dark:bg-slate-600 dark:text-slate-100", getSize(), getMargin(), className) });
210
210
  }
211
211
  //#endregion
212
212
  //#region ../../node_modules/.pnpm/@hookform+resolvers@5.2.2_react-hook-form@7.71.2_react@19.2.6_/node_modules/@hookform/resolvers/dist/resolvers.mjs
@@ -429,7 +429,7 @@ var Root = Label$1;
429
429
  const labelVariants = cva("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
430
430
  const Label = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Root, {
431
431
  ref,
432
- className: cn(labelVariants(), className),
432
+ className: twMerge(labelVariants(), className),
433
433
  ...props
434
434
  }));
435
435
  Label.displayName = Root.displayName;
@@ -448,7 +448,7 @@ const FormItem = React$1.forwardRef(({ className, ...props }, ref) => {
448
448
  value: { id },
449
449
  children: /* @__PURE__ */ jsx("div", {
450
450
  ref,
451
- className: cn("", className),
451
+ className,
452
452
  ...props
453
453
  })
454
454
  });
@@ -458,7 +458,7 @@ const FormLabel = React$1.forwardRef(({ className, ...props }, ref) => {
458
458
  const { error, formItemId } = useFormField();
459
459
  return /* @__PURE__ */ jsx(Label, {
460
460
  ref,
461
- className: cn(error && "text-red-900", className),
461
+ className: twMerge(error && "text-red-900 dark:text-red-400", className),
462
462
  htmlFor: formItemId,
463
463
  ...props
464
464
  });
@@ -480,7 +480,7 @@ const FormDescription = React$1.forwardRef(({ className, ...props }, ref) => {
480
480
  return /* @__PURE__ */ jsx("p", {
481
481
  ref,
482
482
  id: formDescriptionId,
483
- className: cn("text-sm text-gray-600", className),
483
+ className: twMerge("text-sm text-gray-700 dark:text-slate-200", className),
484
484
  ...props
485
485
  });
486
486
  });
@@ -492,7 +492,7 @@ const FormMessage = React$1.forwardRef(({ className, children, ...props }, ref)
492
492
  return /* @__PURE__ */ jsx("p", {
493
493
  ref,
494
494
  id: formMessageId,
495
- className: cn("text-sm font-medium text-red-800", className),
495
+ className: twMerge("text-sm font-medium text-red-800 dark:text-red-100", className),
496
496
  ...props,
497
497
  children: body
498
498
  });
@@ -519,7 +519,7 @@ const Textarea = forwardRef(({ className, ...props }, ref) => {
519
519
  }));
520
520
  return /* @__PURE__ */ jsx("textarea", {
521
521
  ...props,
522
- className: cn("min-h-10 w-full resize-none rounded-md border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-800 placeholder:text-gray-600 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", className),
522
+ className: twMerge("min-h-10 w-full resize-none rounded-md border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-900 placeholder:text-gray-600 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-300", className),
523
523
  ref: textareaRef,
524
524
  onInput: handleInput
525
525
  });
@@ -562,7 +562,7 @@ const TextField = forwardRef(({ name, value, onSubmit, label, placeholder, uniqu
562
562
  try {
563
563
  await form.trigger();
564
564
  if (form.formState.isValid) await form.handleSubmit(handleSubmit)();
565
- } catch (e) {}
565
+ } catch (_e) {}
566
566
  }, [
567
567
  form,
568
568
  handleSubmit,
@@ -597,7 +597,7 @@ const TextField = forwardRef(({ name, value, onSubmit, label, placeholder, uniqu
597
597
  children: [
598
598
  !!label && /* @__PURE__ */ jsx(FormLabel, {
599
599
  htmlFor: name,
600
- className: "text-sm font-medium text-gray-700",
600
+ className: "text-sm font-medium text-gray-700 dark:text-slate-200",
601
601
  children: label
602
602
  }),
603
603
  /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Textarea, {
@@ -611,7 +611,7 @@ const TextField = forwardRef(({ name, value, onSubmit, label, placeholder, uniqu
611
611
  }
612
612
  },
613
613
  placeholder,
614
- onBlur: handleBlur,
614
+ onBlur: () => void handleBlur(),
615
615
  onChange: (e) => {
616
616
  field.onChange(e);
617
617
  handleChange(e);
@@ -685,10 +685,11 @@ function ModelNameForm(props) {
685
685
  name,
686
686
  globalStateSchema,
687
687
  localStateSchema,
688
- setStateSchema
688
+ setStateSchema,
689
+ setModelName
689
690
  ]),
690
691
  placeholder: "Model name",
691
- className: "border-none pl-0 text-xl font-bold text-gray-900",
692
+ className: "border-none pl-0 text-xl font-bold text-gray-900 dark:text-slate-50",
692
693
  required: true,
693
694
  focusOnMount: true
694
695
  });
@@ -768,7 +769,7 @@ function ModuleForm({ module, onAddModule, updateModuleName, modules = [] }) {
768
769
  name: "name",
769
770
  label: isEdit ? "Module name *" : "Add module *",
770
771
  value: module?.name,
771
- onSubmit: handleSubmit,
772
+ onSubmit: (name) => void handleSubmit(name),
772
773
  placeholder: "Add module",
773
774
  unique: moduleNames,
774
775
  shouldReset: !isEdit,
@@ -796,7 +797,7 @@ function OperationForm({ operation, module, focusOnMount, allOperationNames, onA
796
797
  name: "name",
797
798
  value: operation?.name,
798
799
  label: isEdit ? "Operation name *" : "Add operation *",
799
- onSubmit: handleSubmit,
800
+ onSubmit: (name) => void handleSubmit(name),
800
801
  onChange: handleChange,
801
802
  placeholder: "Add operation",
802
803
  required: !isEdit,
@@ -887,7 +888,7 @@ function OperationErrors({ operation, addOperationError, deleteOperationError, s
887
888
  }
888
889
  //#endregion
889
890
  //#region editors/document-model-editor/components/operation.tsx
890
- const GraphqlEditor = lazy(() => import("./graphql-editor-CnaQ3XWx.js"));
891
+ const GraphqlEditor = lazy(() => import("./graphql-editor-CiGd_Li7.js"));
891
892
  function Operation(props) {
892
893
  const { operation, module, allOperationNames, lastCreatedOperationId, onAddOperationAndInitialSchema, updateOperationName, deleteOperation, updateOperationSchema, setOperationDescription, addOperationError, deleteOperationError, setOperationErrorName, toggleNoInputRequired } = props;
893
894
  const noInputRequired = isEmptyOperationSchema(operation.schema);
@@ -929,9 +930,9 @@ function Operation(props) {
929
930
  type: "checkbox",
930
931
  checked: noInputRequired,
931
932
  onChange: (e) => handleToggleNoInput(e.target.checked),
932
- className: "size-4 rounded-sm border-gray-300"
933
+ className: "size-4 rounded-sm border-gray-300 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100"
933
934
  }), /* @__PURE__ */ jsx("span", {
934
- className: "text-sm text-gray-700",
935
+ className: "text-sm text-gray-700 dark:text-slate-200",
935
936
  children: "Operation with no inputs"
936
937
  })]
937
938
  }), !noInputRequired && /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(GraphqlEditor, {
@@ -943,7 +944,7 @@ function Operation(props) {
943
944
  /* @__PURE__ */ jsxs("div", {
944
945
  style: { gridArea: "errors" },
945
946
  children: [/* @__PURE__ */ jsx("h3", {
946
- className: "my-2 text-sm font-medium text-gray-700",
947
+ className: "my-2 text-sm font-medium text-gray-700 dark:text-slate-200",
947
948
  children: "Reducer Exceptions"
948
949
  }), /* @__PURE__ */ jsx(OperationErrors, {
949
950
  operation,
@@ -997,7 +998,7 @@ function Operations({ module, allOperations, shouldFocusNewOperation, updateOper
997
998
  function Module(props) {
998
999
  const { module, modules, allOperations, lastCreatedModuleId, onAddModule, updateModuleName, deleteModule, updateOperationName, deleteOperation, addOperationAndInitialSchema, updateOperationSchema, setOperationDescription, addOperationError, deleteOperationError, setOperationErrorName, toggleNoInputRequired } = props;
999
1000
  return /* @__PURE__ */ jsxs("div", {
1000
- className: "relative rounded-3xl bg-gray-100 p-6",
1001
+ className: "relative rounded-3xl bg-gray-100 p-6 dark:bg-slate-700",
1001
1002
  children: [/* @__PURE__ */ jsxs("div", {
1002
1003
  className: "mb-2 w-1/2 pr-6",
1003
1004
  children: [/* @__PURE__ */ jsx(ModuleForm, {
@@ -1008,7 +1009,7 @@ function Module(props) {
1008
1009
  }), !!module && /* @__PURE__ */ jsx("button", {
1009
1010
  "aria-label": "Delete module",
1010
1011
  tabIndex: -1,
1011
- className: "absolute top-1 right-1 p-2 text-gray-800 transition-colors hover:text-gray-500",
1012
+ className: "absolute top-1 right-1 p-2 text-gray-900 transition-colors hover:text-gray-500 dark:text-slate-100 dark:hover:text-slate-400",
1012
1013
  onClick: () => {
1013
1014
  deleteModule(module.id);
1014
1015
  },
@@ -1109,7 +1110,7 @@ function useSelectedDocumentModelDocument() {
1109
1110
  }
1110
1111
  //#endregion
1111
1112
  //#region editors/document-model-editor/editor.tsx
1112
- const StateSchemas = lazy(() => import("./state-schemas-C5NPeV6-.js"));
1113
+ const StateSchemas = lazy(() => import("./state-schemas-DJmzG_M8.js"));
1113
1114
  function Editor() {
1114
1115
  useSetPHDocumentEditorConfig(editorConfig);
1115
1116
  const toast = usePHToast();
@@ -1299,7 +1300,7 @@ function Editor() {
1299
1300
  }
1300
1301
  };
1301
1302
  return /* @__PURE__ */ jsxs("main", {
1302
- className: "min-h-dvh bg-gray-50 p-6",
1303
+ className: "min-h-dvh bg-gray-50 p-6 dark:bg-slate-800",
1303
1304
  children: [/* @__PURE__ */ jsx(DocumentToolbar, {}), /* @__PURE__ */ jsx(SchemaContextProvider, {
1304
1305
  globalStateSchemaSdl: globalStateSchema,
1305
1306
  localStateSchemaSdl: localStateSchema,
@@ -1339,7 +1340,7 @@ function Editor() {
1339
1340
  }) }),
1340
1341
  /* @__PURE__ */ jsx(Divider, {}),
1341
1342
  /* @__PURE__ */ jsxs("h3", {
1342
- className: "mb-6 text-lg capitalize",
1343
+ className: "mb-6 text-lg text-gray-900 capitalize dark:text-slate-100",
1343
1344
  children: [scope, " Operations"]
1344
1345
  }),
1345
1346
  /* @__PURE__ */ jsx(Modules, {
@@ -1370,4 +1371,4 @@ function Editor() {
1370
1371
  //#endregion
1371
1372
  export { Editor as default };
1372
1373
 
1373
- //# sourceMappingURL=editor-B3yz7YdR.js.map
1374
+ //# sourceMappingURL=editor-CoTq6fqT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-CoTq6fqT.js","names":["use","React","React","r","e","s","i","t","o","r","e","n.parse","n.parseAsync","n.$ZodError","z.string","z\n .string","z\n .object","z\n .union","z.url","z.literal","Label","React","React","LabelPrimitive.Root","React","zodResolver","z.object","z.object","z.string"],"sources":["../../../../node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-slot/dist/index.mjs","../../../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.4_@types+react-dom@19.2.3_@types+react@19.2.14__@types+re_c8c8fd2647f03197dbf56370d7498033/node_modules/@radix-ui/react-primitive/dist/index.mjs","../../../../node_modules/.pnpm/clsx@2.0.0/node_modules/clsx/dist/clsx.mjs","../../../../node_modules/.pnpm/class-variance-authority@0.7.0/node_modules/class-variance-authority/dist/index.mjs","../../editors/document-model-editor/components/divider.tsx","../../../../node_modules/.pnpm/@hookform+resolvers@5.2.2_react-hook-form@7.71.2_react@19.2.6_/node_modules/@hookform/resolvers/dist/resolvers.mjs","../../../../node_modules/.pnpm/@hookform+resolvers@5.2.2_react-hook-form@7.71.2_react@19.2.6_/node_modules/@hookform/resolvers/zod/dist/zod.mjs","../../editors/document-model-editor/schemas/inputs.ts","../../editors/document-model-editor/context/form-context.ts","../../editors/document-model-editor/hooks/useFormField.ts","../../../../node_modules/.pnpm/@radix-ui+react-label@2.1.8_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react@_8d35ec453e0b59eefe06771bb1432577/node_modules/@radix-ui/react-label/dist/index.mjs","../../editors/document-model-editor/components/label.tsx","../../editors/document-model-editor/components/form.tsx","../../editors/document-model-editor/components/text-area.tsx","../../editors/document-model-editor/components/text-field.tsx","../../editors/document-model-editor/components/model-metadata-form.tsx","../../editors/document-model-editor/components/module-form.tsx","../../editors/document-model-editor/components/operation-form.tsx","../../editors/document-model-editor/components/operation-description-form.tsx","../../editors/document-model-editor/components/operation-error-form.tsx","../../editors/document-model-editor/components/operation-errors.tsx","../../editors/document-model-editor/components/operation.tsx","../../editors/document-model-editor/components/operations.tsx","../../editors/document-model-editor/components/module.tsx","../../editors/document-model-editor/components/modules.tsx","../../editors/document-model-editor/config.ts","../../editors/document-model-editor/hooks/useDocumentModelDocument.ts","../../editors/document-model-editor/editor.tsx"],"sourcesContent":["// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nvar use = React[\" use \".trim().toString()];\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\nfunction isLazyComponent(element) {\n return element != null && typeof element === \"object\" && \"$$typeof\" in element && element.$$typeof === REACT_LAZY_TYPE && \"_payload\" in element && isPromiseLike(element._payload);\n}\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f);else for(t in e)e[t]&&(n&&(n+=\" \"),n+=t);return n}export function clsx(){for(var e,t,f=0,n=\"\";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? \"\".concat(value) : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>{\n return (props)=>{\n var ref;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants , defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (ref = config.compoundVariants) === null || ref === void 0 ? void 0 : ref.reduce((acc, param1)=>{\n let { class: cvClass , className: cvClassName , ...compoundVariantOptions } = param1;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n};\n\n\n//# sourceMappingURL=index.mjs.map","import { twMerge } from \"tailwind-merge\";\n\ntype Props = {\n className?: string;\n size?: \"sm\" | \"md\" | \"lg\";\n margin?: \"sm\" | \"md\" | \"lg\";\n};\nexport function Divider({ className, size = \"sm\", margin = \"md\" }: Props) {\n function getSize() {\n if (size === \"sm\") return \"h-px\";\n if (size === \"md\") return \"h-1\";\n return \"h-1.5\";\n }\n\n function getMargin() {\n if (margin === \"sm\") return \"my-4\";\n if (margin === \"md\") return \"my-6\";\n return \"my-8\";\n }\n\n const sizeClass = getSize();\n const marginClass = getMargin();\n return (\n <div\n className={twMerge(\n \"bg-gray-200 dark:bg-slate-600 dark:text-slate-100\",\n sizeClass,\n marginClass,\n className,\n )}\n />\n );\n}\n","import{get as e,set as t}from\"react-hook-form\";const r=(t,r,o)=>{if(t&&\"reportValidity\"in t){const s=e(o,r);t.setCustomValidity(s&&s.message||\"\"),t.reportValidity()}},o=(e,t)=>{for(const o in t.fields){const s=t.fields[o];s&&s.ref&&\"reportValidity\"in s.ref?r(s.ref,o,e):s&&s.refs&&s.refs.forEach(t=>r(t,o,e))}},s=(r,s)=>{s.shouldUseNativeValidation&&o(r,s);const n={};for(const o in r){const f=e(s.fields,o),c=Object.assign(r[o]||{},{ref:f&&f.ref});if(i(s.names||Object.keys(r),o)){const r=Object.assign({},e(n,o));t(r,\"root\",c),t(n,o,r)}else t(n,o,c)}return n},i=(e,t)=>{const r=n(t);return e.some(e=>n(e).match(`^${r}\\\\.\\\\d+`))};function n(e){return e.replace(/\\]|\\[/g,\"\")}export{s as toNestErrors,o as validateFieldsNatively};\n//# sourceMappingURL=resolvers.mjs.map\n","import{validateFieldsNatively as r,toNestErrors as e}from\"@hookform/resolvers\";import{appendErrors as o}from\"react-hook-form\";import*as n from\"zod/v4/core\";function t(r,e){try{var o=r()}catch(r){return e(r)}return o&&o.then?o.then(void 0,e):o}function s(r,e){for(var n={};r.length;){var t=r[0],s=t.code,i=t.message,a=t.path.join(\".\");if(!n[a])if(\"unionErrors\"in t){var u=t.unionErrors[0].errors[0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:s};if(\"unionErrors\"in t&&t.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),e){var c=n[a].types,f=c&&c[t.code];n[a]=o(a,e,n,s,f?[].concat(f,t.message):t.message)}r.shift()}return n}function i(r,e){for(var n={};r.length;){var t=r[0],s=t.code,i=t.message,a=t.path.join(\".\");if(!n[a])if(\"invalid_union\"===t.code&&t.errors.length>0){var u=t.errors[0][0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:s};if(\"invalid_union\"===t.code&&t.errors.forEach(function(e){return e.forEach(function(e){return r.push(e)})}),e){var c=n[a].types,f=c&&c[t.code];n[a]=o(a,e,n,s,f?[].concat(f,t.message):t.message)}r.shift()}return n}function a(o,a,u){if(void 0===u&&(u={}),function(r){return\"_def\"in r&&\"object\"==typeof r._def&&\"typeName\"in r._def}(o))return function(n,i,c){try{return Promise.resolve(t(function(){return Promise.resolve(o[\"sync\"===u.mode?\"parse\":\"parseAsync\"](n,a)).then(function(e){return c.shouldUseNativeValidation&&r({},c),{errors:{},values:u.raw?Object.assign({},n):e}})},function(r){if(function(r){return Array.isArray(null==r?void 0:r.issues)}(r))return{values:{},errors:e(s(r.errors,!c.shouldUseNativeValidation&&\"all\"===c.criteriaMode),c)};throw r}))}catch(r){return Promise.reject(r)}};if(function(r){return\"_zod\"in r&&\"object\"==typeof r._zod}(o))return function(s,c,f){try{return Promise.resolve(t(function(){return Promise.resolve((\"sync\"===u.mode?n.parse:n.parseAsync)(o,s,a)).then(function(e){return f.shouldUseNativeValidation&&r({},f),{errors:{},values:u.raw?Object.assign({},s):e}})},function(r){if(function(r){return r instanceof n.$ZodError}(r))return{values:{},errors:e(i(r.issues,!f.shouldUseNativeValidation&&\"all\"===f.criteriaMode),f)};throw r}))}catch(r){return Promise.reject(r)}};throw new Error(\"Invalid input: not a Zod schema\")}export{a as zodResolver};\n//# sourceMappingURL=zod.module.js.map\n","import { z } from \"zod\";\nimport { snakeCase, constantCase } from \"change-case\";\n\nconst isUppercase = (value: string) => !/\\p{Ll}/u.test(value);\nconst isLowercase = (value: string) => !/\\p{Lu}/u.test(value);\n\nconst whitespaceRegex = /\\s+/g;\n\nexport function containsSpaces(s: string) {\n return whitespaceRegex.test(s);\n}\n\nexport function replaceSpaces(s: string) {\n return s.replace(whitespaceRegex, \"_\");\n}\n\ntype SchemaOptions = {\n required?: boolean;\n allowEmpty?: boolean;\n unique?: string[];\n};\n\nexport function createNameSchema(options: SchemaOptions = {}) {\n const { required = false, allowEmpty = false, unique = [] } = options;\n\n const baseSchema = allowEmpty ? z.string() : z.string().min(1);\n\n const uniqueRefinement = baseSchema.refine(\n (value) => {\n if (!value && allowEmpty) return true;\n return !unique\n .map((n) => n.toLowerCase())\n .includes(value.replace(/^\\s+|\\s+$/g, \"_\").toLowerCase());\n },\n { message: \"Item with this name already exists\" },\n );\n\n if (!required) {\n return unique.length > 0\n ? z\n .string()\n .optional()\n .refine(\n (value) => {\n if (value === undefined) return true;\n if (!value && allowEmpty) return true;\n return !unique\n .map((n) => n.toLowerCase())\n .includes(value.replace(/^\\s+|\\s+$/g, \"_\").toLowerCase());\n },\n { message: \"Item with this name already exists\" },\n )\n : z.string().optional();\n }\n\n return unique.length > 0 ? uniqueRefinement : baseSchema;\n}\n\nexport function createConstantCaseSchema(options: SchemaOptions = {}) {\n return createNameSchema(options)\n .transform((value) => (value ? value.toUpperCase() : value))\n .refine((value) => !value || isUppercase(value), {\n message: \"Must be uppercase\",\n });\n}\n\nexport function createLowercaseSnakeCaseSchema(options: SchemaOptions = {}) {\n return createNameSchema(options)\n .transform((value) => (value ? value.toLowerCase() : value))\n .refine((value) => !value || isLowercase(value), {\n message: \"Must be lowercase\",\n });\n}\n\nexport function toLowercaseSnakeCase(\n value: string,\n options: SchemaOptions = {},\n) {\n return createLowercaseSnakeCaseSchema(options).parse(\n snakeCase(value),\n ) as LowercaseSnakeCase;\n}\n\nexport function toConstantCase(value: string, options: SchemaOptions = {}) {\n return createConstantCaseSchema(options).parse(\n constantCase(value),\n ) as ConstantCase;\n}\n\nexport type SnakeCase = `${string}_${string}`;\nexport type LowercaseSnakeCase = Lowercase<SnakeCase>;\nexport type ConstantCase = Uppercase<SnakeCase>;\nexport type Prettify<T> = {\n [K in keyof T]: T[K];\n} & {};\n\nexport const AuthorSchema = z\n .object({\n name: createNameSchema({ allowEmpty: true }),\n website: z\n .union([z.url(), z.literal(\"\")])\n .optional()\n .default(\"\"),\n })\n .default({\n name: \"\",\n website: \"\",\n });\n","import React from \"react\";\nimport type { FieldValues, FieldPath } from \"react-hook-form\";\n\nexport type FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName;\n};\n\nexport const FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue,\n);\n\nexport type FormItemContextValue = {\n id: string;\n};\n\nexport const FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue,\n);\n","import React from \"react\";\nimport { useFormContext } from \"react-hook-form\";\nimport { FormFieldContext, FormItemContext } from \"../context/form-context.js\";\n\nexport const useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n","\"use client\";\n\n// src/label.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Label\";\nvar Label = React.forwardRef((props, forwardedRef) => {\n return /* @__PURE__ */ jsx(\n Primitive.label,\n {\n ...props,\n ref: forwardedRef,\n onMouseDown: (event) => {\n const target = event.target;\n if (target.closest(\"button, input, select, textarea\")) return;\n props.onMouseDown?.(event);\n if (!event.defaultPrevented && event.detail > 1) event.preventDefault();\n }\n }\n );\n});\nLabel.displayName = NAME;\nvar Root = Label;\nexport {\n Label,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","import * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport { cva } from \"class-variance-authority\";\nimport { twMerge } from \"tailwind-merge\";\n\nconst labelVariants = cva(\n \"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n);\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={twMerge(labelVariants(), className)}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n","import * as React from \"react\";\nimport type * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport type { ControllerProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, FormProvider } from \"react-hook-form\";\nimport { FormFieldContext, FormItemContext } from \"../context/form-context.js\";\nimport { useFormField } from \"../hooks/useFormField.js\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Label } from \"./label.js\";\n\nconst Form = FormProvider;\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst FormItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={className} {...props} />\n </FormItemContext.Provider>\n );\n});\nFormItem.displayName = \"FormItem\";\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n ref={ref}\n className={twMerge(error && \"text-red-900 dark:text-red-400\", className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\nFormLabel.displayName = \"FormLabel\";\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } =\n useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n );\n});\nFormControl.displayName = \"FormControl\";\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={twMerge(\n \"text-sm text-gray-700 dark:text-slate-200\",\n className,\n )}\n {...props}\n />\n );\n});\nFormDescription.displayName = \"FormDescription\";\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={twMerge(\n \"text-sm font-medium text-red-800 dark:text-red-100\",\n className,\n )}\n {...props}\n >\n {body}\n </p>\n );\n});\nFormMessage.displayName = \"FormMessage\";\n\nexport {\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n};\n","import * as React from \"react\";\nimport { forwardRef, useImperativeHandle, useRef, useCallback } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}\n\nexport interface TextareaHandle {\n focus: () => void;\n element: HTMLTextAreaElement | null;\n}\n\nexport const Textarea = forwardRef<TextareaHandle, TextareaProps>(\n ({ className, ...props }, ref) => {\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n const adjustHeight = useCallback((textarea: HTMLTextAreaElement) => {\n textarea.style.height = \"auto\";\n const newHeight = Math.max(textarea.scrollHeight, textarea.offsetHeight);\n textarea.style.height = `${newHeight}px`;\n }, []);\n\n const handleInput = useCallback(\n (e: React.FormEvent<HTMLTextAreaElement>) => {\n adjustHeight(e.currentTarget);\n },\n [adjustHeight],\n );\n\n React.useEffect(() => {\n if (textareaRef.current) {\n adjustHeight(textareaRef.current);\n }\n }, [adjustHeight]);\n\n useImperativeHandle(ref, () => ({\n focus: () => textareaRef.current?.focus(),\n element: textareaRef.current,\n }));\n\n return (\n <textarea\n {...props}\n className={twMerge(\n \"min-h-10 w-full resize-none rounded-md border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-900 placeholder:text-gray-600 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-300\",\n className,\n )}\n ref={textareaRef}\n onInput={handleInput}\n />\n );\n },\n);\nTextarea.displayName = \"Textarea\";\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport type { FieldValues, Resolver } from \"react-hook-form\";\nimport { useForm } from \"react-hook-form\";\nimport { z } from \"zod\";\nimport { createNameSchema } from \"../schemas/inputs.js\";\nimport { compareStringsWithoutWhitespace } from \"../utils/helpers.js\";\nimport {\n Form,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from \"./form.js\";\nimport type { TextareaHandle } from \"./text-area.js\";\nimport { Textarea } from \"./text-area.js\";\n\ntype TextFieldProps = {\n name: string;\n value: string | null | undefined;\n onSubmit: (value: string) => void;\n label?: string;\n placeholder?: string;\n className?: string;\n rows?: number;\n focusOnMount?: boolean;\n required?: boolean;\n allowEmpty?: boolean;\n unique?: string[];\n shouldReset?: boolean;\n onChange?: (value: string) => void;\n};\n\ntype TextFieldHandle = {\n focus: () => void;\n};\n\nexport const TextField = forwardRef<TextFieldHandle, TextFieldProps>(\n (\n {\n name,\n value,\n onSubmit,\n label,\n placeholder,\n unique,\n className = \"\",\n rows = 1,\n focusOnMount = false,\n required = false,\n allowEmpty = false,\n shouldReset = false,\n onChange,\n },\n ref,\n ) => {\n const textareaRef = useRef<TextareaHandle | null>(null);\n const id = useId();\n useEffect(() => {\n if (focusOnMount && textareaRef.current) {\n textareaRef.current.focus();\n }\n }, [focusOnMount]);\n\n const fieldSchema = z.object({\n [name]: createNameSchema({ required, allowEmpty, unique }),\n });\n\n const form = useForm({\n resolver: zodResolver(\n fieldSchema as unknown as Parameters<typeof zodResolver>[0],\n ) as Resolver<FieldValues>,\n defaultValues: {\n [name]: value ?? \"\",\n },\n });\n\n const handleSubmit = useCallback(\n (values: FieldValues) => {\n const newValue = values[name] as string | undefined;\n if (newValue === undefined || value === newValue) return;\n onSubmit(newValue);\n if (shouldReset) form.reset({ [name]: \"\" });\n },\n [name, value, onSubmit, form, shouldReset],\n );\n\n const handleBlur = useCallback(async () => {\n const currentValue = (form.getValues()[name] as string | undefined) ?? \"\";\n\n if (value === null || value === undefined) {\n if (!currentValue || currentValue.trim() === \"\") return;\n }\n\n if (compareStringsWithoutWhitespace(currentValue, value ?? \"\")) return;\n\n try {\n await form.trigger(); // Trigger validation\n if (form.formState.isValid) {\n await form.handleSubmit(handleSubmit)();\n }\n } catch (_e) {\n // Allow blur to proceed even if validation fails\n }\n }, [form, handleSubmit, name, value]);\n\n const onEnterKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n (e.target as HTMLTextAreaElement).blur();\n }\n },\n [],\n );\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n const newValue = e.target.value;\n onChange?.(newValue);\n },\n [onChange],\n );\n\n useImperativeHandle(ref, () => ({\n focus: () => textareaRef.current?.focus(),\n }));\n\n useEffect(() => {\n form.reset({ [name]: value ?? \"\" });\n }, [form, name, value]);\n\n return (\n <Form {...form}>\n <FormField\n control={form.control}\n name={name}\n render={({ field }) => (\n <FormItem className=\"grid h-full grid-rows-[auto,1fr] gap-2 overflow-visible\">\n {!!label && (\n <FormLabel\n htmlFor={name}\n className=\"text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n {label}\n </FormLabel>\n )}\n <FormControl>\n <Textarea\n {...field}\n id={id}\n name={name}\n ref={(node) => {\n if (node) {\n field.ref(node.element);\n textareaRef.current = node;\n }\n }}\n placeholder={placeholder}\n onBlur={() => void handleBlur()}\n onChange={(e) => {\n field.onChange(e);\n handleChange(e);\n }}\n onKeyDown={onEnterKeyDown}\n rows={rows}\n className={className}\n />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n </Form>\n );\n },\n);\n\nTextField.displayName = \"TextField\";\n","import { useCallback } from \"react\";\nimport { z } from \"zod\";\nimport type { Scope } from \"../types/documents.js\";\nimport {\n handleModelNameChange,\n makeInitialSchemaDoc,\n renameSchemaType,\n} from \"../utils/helpers.js\";\nimport { TextField } from \"./text-field.js\";\n\nexport const MetadataFormSchema = z.object({\n name: z.string(),\n documentType: z.string(),\n extension: z.string().optional().default(\"\"),\n description: z.string(),\n authorName: z.string(),\n authorWebsite: z.string(),\n});\n\nexport type MetadataFormValues = z.infer<typeof MetadataFormSchema>;\n\ntype Props = MetadataFormValues & {\n globalStateSchema: string;\n localStateSchema: string;\n setModelName: (name: string) => void;\n setModelId: (id: string) => void;\n setModelExtension: (extension: string) => void;\n setModelDescription: (description: string) => void;\n setAuthorName: (authorName: string) => void;\n setAuthorWebsite: (authorWebsite: string) => void;\n setStateSchema: (schema: string, scope: Scope) => void;\n};\n\nexport default function ModelMetadata(props: Props) {\n return (\n <div>\n <ModelNameForm {...props} />\n <div className=\"flex h-full flex-col gap-4\">\n <div className=\"grid flex-1 grid-cols-3 items-start gap-4\">\n <div className=\"col-span-2 flex h-full flex-col gap-4\">\n <div className=\"shrink-0\">\n <DocumentTypeForm {...props} />\n </div>\n <div className=\"min-h-0 flex-1\">\n <DescriptionForm {...props} />\n </div>\n </div>\n <div className=\"col-span-1 flex flex-col gap-4\">\n <AuthorNameForm {...props} />\n <AuthorWebsiteForm {...props} />\n <ModelExtensionForm {...props} />\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nexport function ModelNameForm(props: Props) {\n const {\n name,\n globalStateSchema,\n localStateSchema,\n setModelName,\n setStateSchema,\n } = props;\n\n const onSubmit = useCallback(\n (newName: string) => {\n if (name === newName) {\n return;\n }\n setModelName(newName);\n\n const hasExistingSchema = !!globalStateSchema;\n\n if (!hasExistingSchema) {\n const initialSchemaDoc = makeInitialSchemaDoc(newName, \"global\");\n setStateSchema(initialSchemaDoc, \"global\");\n return;\n }\n const newSchema = renameSchemaType(\n globalStateSchema,\n name,\n newName,\n \"global\",\n );\n setStateSchema(newSchema, \"global\");\n\n if (localStateSchema) {\n const newLocalStateSchema = renameSchemaType(\n localStateSchema,\n name,\n newName,\n \"local\",\n );\n setStateSchema(newLocalStateSchema, \"local\");\n }\n handleModelNameChange({\n oldName: name,\n newName,\n globalStateSchema,\n localStateSchema,\n setStateSchema,\n });\n },\n [name, globalStateSchema, localStateSchema, setStateSchema, setModelName],\n );\n\n return (\n <TextField\n name=\"name\"\n value={name}\n onSubmit={onSubmit}\n placeholder=\"Model name\"\n className=\"border-none pl-0 text-xl font-bold text-gray-900 dark:text-slate-50\"\n required\n focusOnMount\n />\n );\n}\n\nexport function DocumentTypeForm(props: Props) {\n const { documentType, setModelId } = props;\n\n return (\n <TextField\n label=\"Document Type *\"\n name=\"powerhouse/document-model\"\n value={documentType}\n onSubmit={setModelId}\n placeholder=\"Document Type\"\n required\n />\n );\n}\n\nexport function ModelExtensionForm(props: Props) {\n const { extension, setModelExtension } = props;\n\n return (\n <TextField\n name=\"extension\"\n value={extension}\n onSubmit={setModelExtension}\n label=\"Model Extension\"\n placeholder=\"Example .phdm\"\n allowEmpty\n />\n );\n}\n\nexport function DescriptionForm(props: Props) {\n const { description, setModelDescription } = props;\n\n return (\n <TextField\n name=\"description\"\n label=\"Model Description\"\n value={description}\n onSubmit={setModelDescription}\n placeholder=\"Describe your document to others\"\n allowEmpty\n className=\"h-full\"\n />\n );\n}\n\nexport function AuthorNameForm(props: Props) {\n const { authorName, setAuthorName } = props;\n\n return (\n <TextField\n name=\"authorName\"\n value={authorName}\n onSubmit={setAuthorName}\n label=\"Author Name\"\n placeholder=\"Username or organisation\"\n allowEmpty\n />\n );\n}\n\nexport function AuthorWebsiteForm(props: Props) {\n const { authorWebsite, setAuthorWebsite } = props;\n\n return (\n <TextField\n name=\"authorWebsite\"\n value={authorWebsite}\n label=\"Website URL\"\n onSubmit={(newAuthorWebsite) => {\n if (!!authorWebsite && !newAuthorWebsite) return;\n setAuthorWebsite(newAuthorWebsite);\n }}\n placeholder=\"https://www.powerhouse.inc/\"\n allowEmpty\n />\n );\n}\n","import type { ModuleSpecification } from \"@powerhousedao/shared/document-model\";\nimport { toLowercaseSnakeCase } from \"../schemas/inputs.js\";\nimport { TextField } from \"./text-field.js\";\n\ntype Props = {\n modules?: ModuleSpecification[];\n module?: ModuleSpecification;\n onAddModule: (name: string) => Promise<string | undefined>;\n updateModuleName: (id: string, name: string) => void;\n};\n\nexport function ModuleForm({\n module,\n onAddModule,\n updateModuleName,\n modules = [],\n}: Props) {\n const isEdit = !!module;\n const moduleNames = modules.map((m) => m.name);\n\n const handleSubmit = async (name: string) => {\n const formattedName = toLowercaseSnakeCase(name);\n if (!formattedName.length) return;\n\n if (isEdit) {\n if (formattedName !== module.name) {\n updateModuleName(module.id, formattedName);\n }\n } else {\n await onAddModule(formattedName);\n }\n };\n\n return (\n <TextField\n key={module?.id ?? \"new\"}\n name=\"name\"\n label={isEdit ? \"Module name *\" : \"Add module *\"}\n value={module?.name}\n onSubmit={(name) => void handleSubmit(name)}\n placeholder=\"Add module\"\n unique={moduleNames}\n shouldReset={!isEdit}\n required\n />\n );\n}\n","import type { ModuleSpecification } from \"@powerhousedao/shared/document-model\";\nimport { toConstantCase } from \"../schemas/inputs.js\";\nimport { TextField } from \"./text-field.js\";\n\ntype Props = {\n module: ModuleSpecification;\n operation?: ModuleSpecification[\"operations\"][number];\n focusOnMount?: boolean;\n allOperationNames: string[];\n onAddOperationAndInitialSchema: (\n moduleId: string,\n name: string,\n ) => Promise<string | undefined>;\n updateOperationName: (id: string, name: string) => void;\n deleteOperation: (id: string) => void;\n};\n\nexport function OperationForm({\n operation,\n module,\n focusOnMount,\n allOperationNames,\n onAddOperationAndInitialSchema,\n updateOperationName,\n deleteOperation,\n}: Props) {\n const isEdit = !!operation;\n\n const handleSubmit = async (name: string) => {\n if (isEdit && name === \"\") {\n deleteOperation(operation.id);\n return;\n }\n\n const formattedName = toConstantCase(name);\n\n if (isEdit) {\n if (formattedName !== operation.name) {\n updateOperationName(operation.id, formattedName);\n }\n } else {\n await onAddOperationAndInitialSchema(module.id, formattedName);\n }\n };\n\n const handleChange = (value: string) => {\n if (isEdit && value === \"\") {\n deleteOperation(operation.id);\n }\n };\n\n return (\n <TextField\n name=\"name\"\n value={operation?.name}\n label={isEdit ? \"Operation name *\" : \"Add operation *\"}\n onSubmit={(name) => void handleSubmit(name)}\n onChange={handleChange}\n placeholder=\"Add operation\"\n required={!isEdit}\n allowEmpty={!isEdit}\n shouldReset={!isEdit}\n focusOnMount={focusOnMount}\n unique={allOperationNames}\n />\n );\n}\n","import type { ModuleSpecification } from \"@powerhousedao/shared/document-model\";\nimport { useEffect, useRef } from \"react\";\nimport { TextField } from \"./text-field.js\";\n\ntype Props = {\n operation: ModuleSpecification[\"operations\"][number];\n focusOnMount?: boolean;\n setOperationDescription: (id: string, description: string) => void;\n};\n\nexport function OperationDescriptionForm({\n operation,\n focusOnMount,\n setOperationDescription,\n}: Props) {\n const textFieldRef = useRef<{ focus: () => void } | null>(null);\n\n useEffect(() => {\n if (focusOnMount && textFieldRef.current) {\n textFieldRef.current.focus();\n }\n }, [focusOnMount]);\n\n return (\n <TextField\n ref={textFieldRef}\n name=\"description\"\n value={operation.description}\n onSubmit={(newDescription) =>\n setOperationDescription(operation.id, newDescription)\n }\n label=\"Operation description\"\n allowEmpty\n placeholder=\"Operation Description\"\n />\n );\n}\n","import type {\n ModuleSpecification,\n OperationErrorSpecification,\n} from \"@powerhousedao/shared/document-model\";\nimport { pascalCase } from \"change-case\";\nimport { useRef } from \"react\";\nimport { TextField } from \"./text-field.js\";\n\ntype Props = {\n operation: ModuleSpecification[\"operations\"][number];\n error?: OperationErrorSpecification;\n focusOnMount?: boolean;\n onSubmit?: () => void;\n onAddOperationError: (\n operationId: string,\n errorName: string,\n ) => Promise<string | undefined>;\n deleteOperationError: (id: string) => void;\n setOperationErrorName: (\n operationId: string,\n errorId: string,\n name: string,\n ) => void;\n};\n\nexport function OperationErrorForm({\n operation,\n error,\n focusOnMount,\n onSubmit,\n onAddOperationError,\n deleteOperationError,\n setOperationErrorName,\n}: Props) {\n const textFieldRef = useRef<{ focus: () => void } | null>(null);\n const isEdit = !!error;\n const allOperationErrorNames = operation.errors\n .map((o) => o.name)\n .filter((n) => n !== null);\n\n const handleSubmit = (name: string) => {\n if (isEdit && name === \"\") {\n deleteOperationError(error.id);\n return;\n }\n\n const formattedName = pascalCase(name);\n\n if (isEdit) {\n setOperationErrorName(operation.id, error.id, formattedName);\n } else {\n void onAddOperationError(operation.id, formattedName);\n }\n onSubmit?.();\n };\n\n const handleChange = (value: string) => {\n if (isEdit && value === \"\") {\n deleteOperationError(error.id);\n }\n };\n\n return (\n <TextField\n ref={textFieldRef}\n name=\"name\"\n value={error?.name}\n onSubmit={handleSubmit}\n onChange={handleChange}\n placeholder=\"Add exception\"\n required={!isEdit}\n allowEmpty={!isEdit}\n shouldReset={!isEdit}\n unique={allOperationErrorNames}\n focusOnMount={focusOnMount}\n />\n );\n}\n","import type { ModuleSpecification } from \"@powerhousedao/shared/document-model\";\nimport { useCallback, useId, useState } from \"react\";\nimport { OperationErrorForm } from \"./operation-error-form.js\";\n\ntype Props = {\n operation: ModuleSpecification[\"operations\"][number];\n addOperationError: (\n operationId: string,\n errorName: string,\n ) => Promise<string | undefined>;\n deleteOperationError: (id: string) => void;\n setOperationErrorName: (\n operationId: string,\n errorId: string,\n name: string,\n ) => void;\n};\n\nexport function OperationErrors({\n operation,\n addOperationError,\n deleteOperationError,\n setOperationErrorName,\n}: Props) {\n const addErrorFormId = useId();\n const [shouldFocusAddForm, setShouldFocusAddForm] = useState(false);\n\n const onAddOperationError = useCallback(\n async (operationId: string, error: string) => {\n const errorId = await addOperationError(operationId, error);\n if (errorId) {\n setShouldFocusAddForm(true);\n }\n return errorId;\n },\n [addOperationError, setShouldFocusAddForm],\n );\n\n const onAddOperationErrorSubmit = useCallback(\n () => setShouldFocusAddForm(false),\n [setShouldFocusAddForm],\n );\n\n return (\n <ul className=\"ml-4 list-disc\">\n {operation.errors.map((error) => (\n <li key={error.id}>\n <OperationErrorForm\n error={error}\n operation={operation}\n onAddOperationError={onAddOperationError}\n deleteOperationError={deleteOperationError}\n setOperationErrorName={setOperationErrorName}\n />\n </li>\n ))}\n <li>\n <OperationErrorForm\n operation={operation}\n onAddOperationError={onAddOperationError}\n deleteOperationError={deleteOperationError}\n setOperationErrorName={setOperationErrorName}\n key={`${addErrorFormId}-${shouldFocusAddForm}`}\n focusOnMount={shouldFocusAddForm}\n onSubmit={onAddOperationErrorSubmit}\n />\n </li>\n </ul>\n );\n}\n","import type { ModuleSpecification } from \"@powerhousedao/shared/document-model\";\nimport { lazy, Suspense, useCallback } from \"react\";\nimport type { DocumentActionHandlers } from \"../types/documents.js\";\nimport { isEmptyOperationSchema } from \"../utils/helpers.js\";\nimport { ensureValidOperationSchemaInputName } from \"../utils/linting.js\";\nimport { OperationDescriptionForm } from \"./operation-description-form.js\";\nimport { OperationErrors } from \"./operation-errors.js\";\nimport { OperationForm } from \"./operation-form.js\";\nconst GraphqlEditor = lazy(() => import(\"./code-editors/graphql-editor.js\"));\nexport type WrappedHandlers = DocumentActionHandlers & {\n addOperationAndInitialSchema: (\n moduleId: string,\n name: string,\n ) => Promise<string | undefined>;\n};\ntype Props = {\n lastCreatedOperationId: string | null;\n operation: ModuleSpecification[\"operations\"][number];\n module: ModuleSpecification;\n allOperationNames: string[];\n onAddOperationAndInitialSchema: (\n moduleId: string,\n name: string,\n ) => Promise<string | undefined>;\n updateOperationName: (id: string, name: string) => void;\n deleteOperation: (id: string) => void;\n updateOperationSchema: (id: string, newDoc: string) => void;\n setOperationDescription: (id: string, description: string) => void;\n addOperationError: (\n operationId: string,\n errorName: string,\n ) => Promise<string | undefined>;\n deleteOperationError: (id: string) => void;\n setOperationErrorName: (\n operationId: string,\n errorId: string,\n name: string,\n ) => void;\n toggleNoInputRequired: (id: string, noInputRequired: boolean) => void;\n};\nexport function Operation(props: Props) {\n const {\n operation,\n module,\n allOperationNames,\n lastCreatedOperationId,\n onAddOperationAndInitialSchema,\n updateOperationName,\n deleteOperation,\n updateOperationSchema,\n setOperationDescription,\n addOperationError,\n deleteOperationError,\n setOperationErrorName,\n toggleNoInputRequired,\n } = props;\n\n const noInputRequired = isEmptyOperationSchema(operation.schema);\n\n const handleToggleNoInput = useCallback(\n (checked: boolean) => toggleNoInputRequired(operation.id, checked),\n [operation.id, toggleNoInputRequired],\n );\n\n const handleUpdateDocument = useCallback(\n (newDoc: string) => updateOperationSchema(operation.id, newDoc),\n [operation.id, updateOperationSchema],\n );\n\n const customLinter = useCallback(\n (doc: string) =>\n operation.name\n ? ensureValidOperationSchemaInputName(doc, operation.name)\n : [],\n [operation.name],\n );\n\n return (\n <div\n className=\"mt-4 grid grid-cols-2 gap-x-12\"\n style={{\n gridTemplateAreas: `\n \"left editor\"\n \"errors editor\"\n `,\n gridTemplateRows: \"auto 1fr\",\n }}\n >\n <div className=\"flex flex-col gap-2\" style={{ gridArea: \"left\" }}>\n <OperationForm\n operation={operation}\n onAddOperationAndInitialSchema={onAddOperationAndInitialSchema}\n updateOperationName={updateOperationName}\n deleteOperation={deleteOperation}\n module={module}\n allOperationNames={allOperationNames}\n />\n <OperationDescriptionForm\n operation={operation}\n focusOnMount={operation.id === lastCreatedOperationId}\n setOperationDescription={setOperationDescription}\n />\n </div>\n\n <div className=\"relative top-8\" style={{ gridArea: \"editor\" }}>\n <label className=\"mb-2 flex cursor-pointer items-center gap-2\">\n <input\n type=\"checkbox\"\n checked={noInputRequired}\n onChange={(e) => handleToggleNoInput(e.target.checked)}\n className=\"size-4 rounded-sm border-gray-300 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\"\n />\n <span className=\"text-sm text-gray-700 dark:text-slate-200\">\n Operation with no inputs\n </span>\n </label>\n {!noInputRequired && (\n <Suspense>\n <GraphqlEditor\n doc={operation.schema ?? \"\"}\n updateDocumentInModel={handleUpdateDocument}\n customLinter={customLinter}\n />\n </Suspense>\n )}\n </div>\n\n <div style={{ gridArea: \"errors\" }}>\n <h3 className=\"my-2 text-sm font-medium text-gray-700 dark:text-slate-200\">\n Reducer Exceptions\n </h3>\n <OperationErrors\n operation={operation}\n addOperationError={addOperationError}\n deleteOperationError={deleteOperationError}\n setOperationErrorName={setOperationErrorName}\n />\n </div>\n </div>\n );\n}\n","import { OperationForm } from \"./operation-form.js\";\nimport type { ModuleSpecification } from \"@powerhousedao/shared/document-model\";\nimport { useCallback, useId, useState } from \"react\";\nimport { Operation } from \"./operation.js\";\n\ntype Props = {\n module: ModuleSpecification;\n allOperations: ModuleSpecification[\"operations\"];\n shouldFocusNewOperation: boolean;\n updateOperationName: (id: string, name: string) => void;\n deleteOperation: (id: string) => void;\n addOperationAndInitialSchema: (\n moduleId: string,\n name: string,\n ) => Promise<string | undefined>;\n updateOperationSchema: (id: string, newDoc: string) => void;\n setOperationDescription: (id: string, description: string) => void;\n addOperationError: (\n operationId: string,\n errorName: string,\n ) => Promise<string | undefined>;\n deleteOperationError: (id: string) => void;\n setOperationErrorName: (\n operationId: string,\n errorId: string,\n name: string,\n ) => void;\n toggleNoInputRequired: (id: string, noInputRequired: boolean) => void;\n};\nexport function Operations({\n module,\n allOperations,\n shouldFocusNewOperation,\n updateOperationName,\n deleteOperation,\n addOperationAndInitialSchema,\n addOperationError,\n deleteOperationError,\n setOperationErrorName,\n updateOperationSchema,\n setOperationDescription,\n toggleNoInputRequired,\n}: Props) {\n const [lastCreatedOperationId, setLastCreatedOperationId] = useState<\n string | null\n >(null);\n const addOperationFormId = useId();\n const allOperationNames = allOperations\n .map((o) => o.name)\n .filter((n) => n !== null);\n\n const onAddOperationAndInitialSchema = useCallback(\n async (moduleId: string, name: string) => {\n const operationId = await addOperationAndInitialSchema(moduleId, name);\n if (operationId) {\n setLastCreatedOperationId(operationId);\n }\n return operationId;\n },\n [addOperationAndInitialSchema, setLastCreatedOperationId],\n );\n\n return (\n <div>\n {module.operations.map((operation) => (\n <div key={operation.id}>\n <Operation\n operation={operation}\n module={module}\n lastCreatedOperationId={lastCreatedOperationId}\n allOperationNames={allOperationNames}\n addOperationError={addOperationError}\n deleteOperationError={deleteOperationError}\n setOperationErrorName={setOperationErrorName}\n onAddOperationAndInitialSchema={onAddOperationAndInitialSchema}\n updateOperationName={updateOperationName}\n deleteOperation={deleteOperation}\n updateOperationSchema={updateOperationSchema}\n setOperationDescription={setOperationDescription}\n toggleNoInputRequired={toggleNoInputRequired}\n />\n </div>\n ))}\n <div className=\"mt-6 w-1/2 pr-6\">\n <OperationForm\n key={addOperationFormId}\n onAddOperationAndInitialSchema={onAddOperationAndInitialSchema}\n updateOperationName={updateOperationName}\n deleteOperation={deleteOperation}\n module={module}\n allOperationNames={allOperationNames}\n focusOnMount={shouldFocusNewOperation}\n />\n </div>\n </div>\n );\n}\n","import type { ModuleSpecification as TModule } from \"@powerhousedao/shared/document-model\";\nimport { ModuleForm } from \"./module-form.js\";\nimport { Operations } from \"./operations.js\";\ntype Props = {\n module?: TModule;\n modules?: TModule[];\n allOperations: TModule[\"operations\"];\n lastCreatedModuleId: string | null;\n onAddModule: (name: string) => Promise<string | undefined>;\n updateModuleName: (id: string, name: string) => void;\n deleteModule: (id: string) => void;\n updateOperationName: (id: string, name: string) => void;\n deleteOperation: (id: string) => void;\n addOperationAndInitialSchema: (\n moduleId: string,\n name: string,\n ) => Promise<string | undefined>;\n updateOperationSchema: (id: string, newDoc: string) => void;\n setOperationDescription: (id: string, description: string) => void;\n addOperationError: (\n operationId: string,\n errorName: string,\n ) => Promise<string | undefined>;\n deleteOperationError: (id: string) => void;\n setOperationErrorName: (\n operationId: string,\n errorId: string,\n name: string,\n ) => void;\n toggleNoInputRequired: (id: string, noInputRequired: boolean) => void;\n};\nexport function Module(props: Props) {\n const {\n module,\n modules,\n allOperations,\n lastCreatedModuleId,\n onAddModule,\n updateModuleName,\n deleteModule,\n updateOperationName,\n deleteOperation,\n addOperationAndInitialSchema,\n updateOperationSchema,\n setOperationDescription,\n addOperationError,\n deleteOperationError,\n setOperationErrorName,\n toggleNoInputRequired,\n } = props;\n return (\n <div className=\"relative rounded-3xl bg-gray-100 p-6 dark:bg-slate-700\">\n <div className=\"mb-2 w-1/2 pr-6\">\n <ModuleForm\n modules={modules}\n module={module}\n onAddModule={onAddModule}\n updateModuleName={updateModuleName}\n />\n {!!module && (\n <button\n aria-label=\"Delete module\"\n tabIndex={-1}\n className=\"absolute top-1 right-1 p-2 text-gray-900 transition-colors hover:text-gray-500 dark:text-slate-100 dark:hover:text-slate-400\"\n onClick={() => {\n deleteModule(module.id);\n }}\n >\n <svg className=\"size-6\" viewBox=\"0 0 24 24\" fill=\"currentcolor\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n 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\"\n />\n </svg>\n </button>\n )}\n </div>\n {!!module && (\n <Operations\n module={module}\n allOperations={allOperations}\n shouldFocusNewOperation={module.id === lastCreatedModuleId}\n updateOperationName={updateOperationName}\n deleteOperation={deleteOperation}\n addOperationAndInitialSchema={addOperationAndInitialSchema}\n updateOperationSchema={updateOperationSchema}\n setOperationDescription={setOperationDescription}\n addOperationError={addOperationError}\n deleteOperationError={deleteOperationError}\n setOperationErrorName={setOperationErrorName}\n toggleNoInputRequired={toggleNoInputRequired}\n />\n )}\n </div>\n );\n}\n","import type { ModuleSpecification as TModule } from \"@powerhousedao/shared/document-model\";\nimport { useCallback, useRef, useState } from \"react\";\nimport { Module } from \"./module.js\";\n\ntype Props = {\n modules: TModule[];\n allOperations: TModule[\"operations\"];\n addModule: (name: string) => Promise<string | undefined>;\n updateModuleName: (id: string, name: string) => void;\n deleteModule: (id: string) => void;\n updateOperationName: (id: string, name: string) => void;\n deleteOperation: (id: string) => void;\n addOperationAndInitialSchema: (\n moduleId: string,\n name: string,\n ) => Promise<string | undefined>;\n updateOperationSchema: (id: string, newDoc: string) => void;\n setOperationDescription: (id: string, description: string) => void;\n addOperationError: (\n operationId: string,\n errorName: string,\n ) => Promise<string | undefined>;\n deleteOperationError: (id: string) => void;\n setOperationErrorName: (\n operationId: string,\n errorId: string,\n name: string,\n ) => void;\n toggleNoInputRequired: (id: string, noInputRequired: boolean) => void;\n};\nexport default function Modules({\n modules,\n allOperations,\n addModule,\n updateModuleName,\n deleteModule,\n updateOperationName,\n deleteOperation,\n addOperationAndInitialSchema,\n updateOperationSchema,\n setOperationDescription,\n addOperationError,\n deleteOperationError,\n setOperationErrorName,\n toggleNoInputRequired,\n}: Props) {\n const [lastCreatedModuleId, setLastCreatedModuleId] = useState<string | null>(\n null,\n );\n const focusTrapRef = useRef<HTMLDivElement>(null);\n\n const onAddModule = useCallback(\n async (name: string) => {\n const moduleId = await addModule(name);\n if (moduleId) {\n setLastCreatedModuleId(moduleId);\n focusTrapRef.current?.focus();\n }\n return moduleId;\n },\n [addModule, setLastCreatedModuleId],\n );\n\n return (\n <div className=\"flex flex-col gap-2\">\n {modules.map((module) => (\n <Module\n key={module.id}\n module={module}\n modules={modules}\n allOperations={allOperations}\n lastCreatedModuleId={lastCreatedModuleId}\n onAddModule={onAddModule}\n updateModuleName={updateModuleName}\n deleteModule={deleteModule}\n updateOperationName={updateOperationName}\n deleteOperation={deleteOperation}\n addOperationAndInitialSchema={addOperationAndInitialSchema}\n updateOperationSchema={updateOperationSchema}\n setOperationDescription={setOperationDescription}\n addOperationError={addOperationError}\n deleteOperationError={deleteOperationError}\n setOperationErrorName={setOperationErrorName}\n toggleNoInputRequired={toggleNoInputRequired}\n />\n ))}\n <Module\n key=\"add-module\"\n modules={modules}\n allOperations={allOperations}\n lastCreatedModuleId={lastCreatedModuleId}\n onAddModule={onAddModule}\n updateModuleName={updateModuleName}\n deleteModule={deleteModule}\n updateOperationName={updateOperationName}\n deleteOperation={deleteOperation}\n addOperationAndInitialSchema={addOperationAndInitialSchema}\n updateOperationSchema={updateOperationSchema}\n setOperationDescription={setOperationDescription}\n addOperationError={addOperationError}\n deleteOperationError={deleteOperationError}\n setOperationErrorName={setOperationErrorName}\n toggleNoInputRequired={toggleNoInputRequired}\n />\n {/* Focus trap to prevent tabbing out of the editor */}\n <div\n ref={focusTrapRef}\n tabIndex={0}\n className=\"size-0 overflow-hidden\"\n aria-hidden=\"true\"\n />\n </div>\n );\n}\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import {\n useDocumentOfType,\n useSelectedDocumentOfType,\n} from \"@powerhousedao/reactor-browser\";\nimport type {\n DocumentModelAction,\n DocumentModelDocument,\n} from \"@powerhousedao/shared/document-model\";\n\nexport function useDocumentModelDocument(\n documentId: string | undefined | null,\n): ReturnType<\n typeof useDocumentOfType<DocumentModelDocument, DocumentModelAction>\n> {\n return useDocumentOfType<DocumentModelDocument, DocumentModelAction>(\n documentId,\n \"powerhouse/document-model\",\n );\n}\n\nexport function useSelectedDocumentModelDocument(): ReturnType<\n typeof useSelectedDocumentOfType<DocumentModelDocument, DocumentModelAction>\n> {\n return useSelectedDocumentOfType<DocumentModelDocument, DocumentModelAction>(\n \"powerhouse/document-model\",\n );\n}\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport {\n usePHToast,\n useSetPHDocumentEditorConfig,\n} from \"@powerhousedao/reactor-browser\";\nimport { pascalCase } from \"change-case\";\nimport { generateId } from \"@powerhousedao/shared/document-model\";\nimport {\n addModule,\n addOperation,\n addOperationError,\n deleteModule,\n deleteOperation,\n deleteOperationError,\n setAuthorName,\n setAuthorWebsite,\n setInitialState,\n setModelDescription,\n setModelExtension,\n setModelId,\n setModelName,\n setModuleName,\n setOperationDescription,\n setOperationErrorName,\n setOperationName,\n setOperationSchema,\n setStateSchema,\n} from \"@powerhousedao/shared/document-model\";\nimport { lazy, Suspense, useEffect, useRef, useState } from \"react\";\nimport { Divider } from \"./components/divider.js\";\nimport ModelMetadata from \"./components/model-metadata-form.js\";\nimport Modules from \"./components/modules.js\";\nimport { editorConfig } from \"./config.js\";\nimport { SchemaContextProvider } from \"./context/schema-context.js\";\nimport { useSelectedDocumentModelDocument } from \"./hooks/useDocumentModelDocument.js\";\nimport type { Scope } from \"./types/documents.js\";\nimport {\n compareStringsWithoutWhitespace,\n initializeModelSchema,\n makeEmptyOperationSchema,\n makeOperationInitialDoc,\n} from \"./utils/helpers.js\";\nconst StateSchemas = lazy(() => import(\"./components/state-schemas.js\"));\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n const toast = usePHToast();\n const [document, dispatch] = useSelectedDocumentModelDocument();\n const [scope, setScope] = useState<Scope>(\"global\");\n const documentNodeName = document.header.name;\n const {\n name: modelName,\n id: documentType,\n extension,\n description,\n author: { name: authorName, website: authorWebsite },\n } = document.state.global;\n const {\n state: {\n global: {\n schema: globalStateSchema,\n initialValue: globalStateInitialValue,\n },\n local: { schema: localStateSchema, initialValue: localStateInitialValue },\n },\n modules,\n } = document.state.global.specifications[0];\n const operations = modules.flatMap((module) => module.operations);\n const shouldSetInitialName = useRef(\n !modelName && !!documentNodeName && operations.length === 0,\n );\n\n useEffect(() => {\n if (!shouldSetInitialName.current || !documentNodeName) return;\n\n const initialSchemaDoc = initializeModelSchema(documentNodeName);\n const actions = [\n setModelName({ name: documentNodeName }),\n setStateSchema({ schema: initialSchemaDoc, scope: \"global\" }),\n ];\n dispatch(actions);\n shouldSetInitialName.current = false;\n }, [documentNodeName, dispatch]);\n\n const operationSchemasSdl = operations\n .flatMap((operation) => operation.schema ?? [])\n .join(\"\\n\");\n\n const handleSetModelId = (id: string) => {\n if (compareStringsWithoutWhitespace(id, documentType)) return;\n dispatch([setModelId({ id })]);\n };\n\n const handleSetModelDescription = (newDescription: string) => {\n if (compareStringsWithoutWhitespace(newDescription, description)) return;\n dispatch(setModelDescription({ description: newDescription }));\n };\n\n const handleSetModelExtension = (newExtension: string) => {\n if (compareStringsWithoutWhitespace(newExtension, extension)) return;\n dispatch(setModelExtension({ extension: newExtension }));\n };\n\n const handleSetModelName = (newName: string) => {\n if (compareStringsWithoutWhitespace(newName, modelName)) return;\n dispatch(setModelName({ name: newName }));\n };\n\n const handleSetAuthorName = (newAuthorName: string) => {\n if (compareStringsWithoutWhitespace(newAuthorName, authorName)) return;\n dispatch(setAuthorName({ authorName: newAuthorName }));\n };\n\n const handleSetAuthorWebsite = (newAuthorWebsite: string) => {\n if (compareStringsWithoutWhitespace(newAuthorWebsite, authorWebsite ?? \"\"))\n return;\n dispatch(setAuthorWebsite({ authorWebsite: newAuthorWebsite }));\n };\n\n const handleSetStateSchema = (newSchema: string, scope: Scope) => {\n const oldSchema = scope === \"global\" ? globalStateSchema : localStateSchema;\n if (compareStringsWithoutWhitespace(newSchema, oldSchema)) return;\n dispatch(setStateSchema({ schema: newSchema, scope }));\n };\n\n const handleSetInitialState = (newInitialValue: string, scope: Scope) => {\n const oldInitialValue =\n scope === \"global\" ? globalStateInitialValue : localStateInitialValue;\n if (compareStringsWithoutWhitespace(newInitialValue, oldInitialValue))\n return;\n dispatch(setInitialState({ initialValue: newInitialValue, scope }));\n };\n\n const handleAddModule = (name: string): Promise<string | undefined> => {\n return new Promise((resolve) => {\n try {\n if (\n modules.some((module) =>\n compareStringsWithoutWhitespace(module.name, name),\n )\n ) {\n resolve(undefined);\n return;\n }\n const id = generateId();\n dispatch(addModule({ id, name }));\n resolve(id);\n } catch (error) {\n console.error(\"Failed to add module:\", error);\n resolve(undefined);\n }\n });\n };\n\n const handleSetModuleName = (id: string, name: string) => {\n if (\n modules.some((module) =>\n compareStringsWithoutWhitespace(module.name, name),\n )\n )\n return;\n dispatch(setModuleName({ id, name }));\n };\n\n const handleDeleteModule = (id: string) => {\n dispatch(deleteModule({ id }));\n };\n\n const handleAddOperation = (\n moduleId: string,\n name: string,\n ): Promise<string | undefined> => {\n return new Promise((resolve) => {\n const id = generateId();\n dispatch(\n addOperation({ id, moduleId, name, scope }),\n (errors) => {\n if (errors.length > 0) {\n if (toast) {\n toast(errors[0].message, { type: \"connect-warning\" });\n }\n resolve(undefined);\n } else {\n resolve(id);\n }\n },\n () => resolve(id),\n );\n });\n };\n\n const handleSetOperationName = (id: string, name: string) => {\n dispatch(setOperationName({ id, name }), (errors) => {\n if (errors.length > 0 && toast) {\n toast(errors[0].message, { type: \"connect-warning\" });\n }\n });\n };\n\n const handleSetOperationSchema = (id: string, newSchema: string) => {\n const operation = operations.find((operation) => operation.id === id);\n if (\n operation?.schema &&\n compareStringsWithoutWhitespace(newSchema, operation.schema)\n )\n return;\n dispatch(setOperationSchema({ id, schema: newSchema }));\n };\n\n const handleToggleNoInputRequired = (\n id: string,\n noInputRequired: boolean,\n ) => {\n const operation = operations.find((op) => op.id === id);\n if (!operation?.name) return;\n\n if (noInputRequired) {\n dispatch(\n setOperationSchema({\n id,\n schema: makeEmptyOperationSchema(operation.name),\n }),\n );\n } else {\n dispatch(\n setOperationSchema({\n id,\n schema: makeOperationInitialDoc(operation.name),\n }),\n );\n }\n };\n\n const handleSetOperationDescription = (\n id: string,\n newDescription: string,\n ) => {\n const operationDescription =\n operations.find((operation) => operation.id === id)?.description ?? \"\";\n if (compareStringsWithoutWhitespace(operationDescription, newDescription))\n return;\n dispatch(setOperationDescription({ id, description: newDescription }));\n };\n\n const handleDeleteOperation = (id: string) => {\n dispatch(deleteOperation({ id }));\n };\n\n const handleAddOperationError = (\n operationId: string,\n errorName: string,\n ): Promise<string | undefined> => {\n return new Promise((resolve) => {\n try {\n const operation = operations.find(\n (operation) => operation.id === operationId,\n );\n const operationErrorNames =\n operation?.errors.map((error) => error.name).filter(Boolean) ?? [];\n if (\n operationErrorNames.some((name) =>\n compareStringsWithoutWhitespace(name, errorName),\n )\n ) {\n resolve(undefined);\n return;\n }\n const id = generateId();\n const errorCode = pascalCase(errorName);\n dispatch(addOperationError({ id, operationId, errorName, errorCode }));\n resolve(id);\n } catch (error) {\n console.error(\"Failed to add operation error:\", error);\n resolve(undefined);\n }\n });\n };\n\n const handleDeleteOperationError = (id: string) => {\n dispatch(deleteOperationError({ id }));\n };\n\n const handleSetOperationErrorName = (\n operationId: string,\n errorId: string,\n errorName: string,\n ) => {\n const operation = operations.find(\n (operation) => operation.id === operationId,\n );\n const operationErrorNames =\n operation?.errors.map((error) => error.name).filter(Boolean) ?? [];\n if (\n operationErrorNames.some((name) =>\n compareStringsWithoutWhitespace(name, errorName),\n )\n )\n return;\n dispatch(setOperationErrorName({ id: errorId, errorName }));\n };\n\n const addOperationAndInitialSchema = async (\n moduleId: string,\n name: string,\n ): Promise<string | undefined> => {\n try {\n const id = await handleAddOperation(moduleId, name);\n if (!id) return undefined;\n try {\n handleSetOperationSchema(id, makeOperationInitialDoc(name));\n return id;\n } catch (error) {\n console.error(\"Failed to update operation schema:\", error);\n return undefined;\n }\n } catch (error) {\n console.error(\"Failed to add operation and schema:\", error);\n return undefined;\n }\n };\n\n return (\n <main className=\"min-h-dvh bg-gray-50 p-6 dark:bg-slate-800\">\n <DocumentToolbar />\n <SchemaContextProvider\n globalStateSchemaSdl={globalStateSchema}\n localStateSchemaSdl={localStateSchema}\n operationSchemasSdl={operationSchemasSdl}\n >\n <div className=\"mx-auto max-w-6xl px-4 pt-8\">\n <ModelMetadata\n name={modelName}\n documentType={documentType}\n extension={extension}\n description={description}\n authorName={authorName}\n authorWebsite={authorWebsite ?? \"\"}\n globalStateSchema={globalStateSchema}\n localStateSchema={localStateSchema}\n setModelId={handleSetModelId}\n setModelDescription={handleSetModelDescription}\n setModelExtension={handleSetModelExtension}\n setModelName={handleSetModelName}\n setAuthorName={handleSetAuthorName}\n setAuthorWebsite={handleSetAuthorWebsite}\n setStateSchema={handleSetStateSchema}\n />\n <Divider />\n <div>\n <Suspense>\n <StateSchemas\n modelName={modelName}\n globalStateSchema={globalStateSchema}\n globalStateInitialValue={globalStateInitialValue}\n localStateSchema={localStateSchema}\n localStateInitialValue={localStateInitialValue}\n setStateSchema={handleSetStateSchema}\n setInitialState={handleSetInitialState}\n currentScope={scope}\n onScopeChange={setScope}\n />\n </Suspense>\n <Divider />\n <h3 className=\"mb-6 text-lg text-gray-900 capitalize dark:text-slate-100\">\n {scope} Operations\n </h3>\n <Modules\n modules={modules.map((module) => ({\n ...module,\n operations: module.operations.filter(\n (op) => op.scope === scope,\n ),\n }))}\n allOperations={operations}\n addModule={handleAddModule}\n updateModuleName={handleSetModuleName}\n deleteModule={handleDeleteModule}\n updateOperationName={handleSetOperationName}\n updateOperationSchema={handleSetOperationSchema}\n setOperationDescription={handleSetOperationDescription}\n deleteOperation={handleDeleteOperation}\n addOperationError={handleAddOperationError}\n deleteOperationError={handleDeleteOperationError}\n setOperationErrorName={handleSetOperationErrorName}\n addOperationAndInitialSchema={addOperationAndInitialSchema}\n toggleNoInputRequired={handleToggleNoInputRequired}\n />\n </div>\n </div>\n </SchemaContextProvider>\n </main>\n );\n}\n"],"x_google_ignoreList":[0,1,2,3,5,6,10],"mappings":";;;;;;;;;;;;AAIA,IAAI,kBAAkB,OAAO,IAAI,aAAa;AAC9C,IAAIA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C,cAAD;OACa;OACQ;OACM;OACP;OACM;OACxB,gBAAgB;OAChB,iBAAiB;OACjB,cAAc;OACd,eAAe;OACf,CAAA,EACO,CAAA;MACX,oBAAC,SAAD,EAAW,CAAA;MACX,qBAAC,MAAD;OAAI,WAAU;iBAAd,CACG,OAAM,cACJ;;MACL,oBAAC,SAAD;OACE,SAAS,QAAQ,KAAK,YAAY;QAChC,GAAG;QACH,YAAY,OAAO,WAAW,QAC3B,OAAO,GAAG,UAAU,MACtB;QACF,EAAE;OACH,eAAe;OACf,WAAW;OACX,kBAAkB;OAClB,cAAc;OACd,qBAAqB;OACrB,uBAAuB;OACvB,yBAAyB;OACzB,iBAAiB;OACjB,mBAAmB;OACnB,sBAAsB;OACtB,uBAAuB;OACO;OAC9B,uBAAuB;OACvB,CAAA;MACE,EAAA,CAAA;KACF;;GACgB,CAAA,CACnB"}
@@ -1,7 +1,7 @@
1
- import "./dist-DQgJ8n4d.js";
2
- import "./dist-DOMEWT3x.js";
3
- import { t as Breadcrumbs, x as useSetPHAppConfig } from "./connect-CKdlDSUw.js";
4
- import { i as CreateDocument, n as DriveLayout, t as FolderView } from "./folder-view-H2ov-zId.js";
1
+ import "./document-drive-oqv68jDU.js";
2
+ import { t as Breadcrumbs } from "./connect-ZnLjvmRt.js";
3
+ import { T as useSetPHAppConfig } from "./dist-C1nRM9t2.js";
4
+ import { i as CreateDocument, n as DriveLayout, t as FolderView } from "./folder-view-DmYBf2pP.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region editors/generic-drive-explorer/config.ts
7
7
  const editorConfig = {
@@ -26,4 +26,4 @@ function Editor(props) {
26
26
  //#endregion
27
27
  export { Editor as default };
28
28
 
29
- //# sourceMappingURL=editor-Dm_73jiz.js.map
29
+ //# sourceMappingURL=editor-DC3bigBu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor-Dm_73jiz.js","names":[],"sources":["../../editors/generic-drive-explorer/config.ts","../../editors/generic-drive-explorer/editor.tsx"],"sourcesContent":["import type { PHAppConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHAppConfig = {\n allowedDocumentTypes: [],\n isDragAndDropEnabled: true,\n};\n","import { Breadcrumbs } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHAppConfig } from \"@powerhousedao/reactor-browser\";\nimport type { EditorProps } from \"@powerhousedao/shared/document-model\";\nimport { CreateDocument } from \"./components/create-document.js\";\nimport FolderView from \"./components/folder-view.js\";\nimport { DriveLayout } from \"./components/layout.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor(props: EditorProps) {\n useSetPHAppConfig(editorConfig);\n const { className, children } = props;\n const showDocumentEditor = !!children;\n\n return (\n <DriveLayout className={className}>\n {!showDocumentEditor && (\n <DriveLayout.Header>\n <Breadcrumbs />\n </DriveLayout.Header>\n )}\n {showDocumentEditor ? (\n children\n ) : (\n <DriveLayout.Content>\n <FolderView />\n </DriveLayout.Content>\n )}\n {!showDocumentEditor && (\n <DriveLayout.Footer>\n <CreateDocument />\n </DriveLayout.Footer>\n )}\n </DriveLayout>\n );\n}\n"],"mappings":";;;;;;AAEA,MAAa,eAA4B;CACvC,sBAAsB,EAAE;CACxB,sBAAsB;CACvB;;;ACGD,SAAwB,OAAO,OAAoB;AACjD,mBAAkB,aAAa;CAC/B,MAAM,EAAE,WAAW,aAAa;CAChC,MAAM,qBAAqB,CAAC,CAAC;AAE7B,QACE,qBAAC,aAAD;EAAwB;YAAxB;GACG,CAAC,sBACA,oBAAC,YAAY,QAAb,EAAA,UACE,oBAAC,aAAD,EAAe,CAAA,EACI,CAAA;GAEtB,qBACC,WAEA,oBAAC,YAAY,SAAb,EAAA,UACE,oBAAC,YAAD,EAAc,CAAA,EACM,CAAA;GAEvB,CAAC,sBACA,oBAAC,YAAY,QAAb,EAAA,UACE,oBAAC,gBAAD,EAAkB,CAAA,EACC,CAAA;GAEX"}
1
+ {"version":3,"file":"editor-DC3bigBu.js","names":[],"sources":["../../editors/generic-drive-explorer/config.ts","../../editors/generic-drive-explorer/editor.tsx"],"sourcesContent":["import type { PHAppConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHAppConfig = {\n allowedDocumentTypes: [],\n isDragAndDropEnabled: true,\n};\n","import { Breadcrumbs } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHAppConfig } from \"@powerhousedao/reactor-browser\";\nimport type { EditorProps } from \"@powerhousedao/shared/document-model\";\nimport { CreateDocument } from \"./components/create-document.js\";\nimport FolderView from \"./components/folder-view.js\";\nimport { DriveLayout } from \"./components/layout.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor(props: EditorProps) {\n useSetPHAppConfig(editorConfig);\n const { className, children } = props;\n const showDocumentEditor = !!children;\n\n return (\n <DriveLayout className={className}>\n {!showDocumentEditor && (\n <DriveLayout.Header>\n <Breadcrumbs />\n </DriveLayout.Header>\n )}\n {showDocumentEditor ? (\n children\n ) : (\n <DriveLayout.Content>\n <FolderView />\n </DriveLayout.Content>\n )}\n {!showDocumentEditor && (\n <DriveLayout.Footer>\n <CreateDocument />\n </DriveLayout.Footer>\n )}\n </DriveLayout>\n );\n}\n"],"mappings":";;;;;;AAEA,MAAa,eAA4B;CACvC,sBAAsB,EAAE;CACxB,sBAAsB;CACvB;;;ACGD,SAAwB,OAAO,OAAoB;AACjD,mBAAkB,aAAa;CAC/B,MAAM,EAAE,WAAW,aAAa;CAChC,MAAM,qBAAqB,CAAC,CAAC;AAE7B,QACE,qBAAC,aAAD;EAAwB;YAAxB;GACG,CAAC,sBACA,oBAAC,YAAY,QAAb,EAAA,UACE,oBAAC,aAAD,EAAe,CAAA,EACI,CAAA;GAEtB,qBACC,WAEA,oBAAC,YAAY,SAAb,EAAA,UACE,oBAAC,YAAD,EAAc,CAAA,EACM,CAAA;GAEvB,CAAC,sBACA,oBAAC,YAAY,QAAb,EAAA,UACE,oBAAC,gBAAD,EAAkB,CAAA,EACC,CAAA;GAEX"}
@@ -6,7 +6,7 @@ const DocumentModelEditor = {
6
6
  name: "Document Model Editor"
7
7
  },
8
8
  documentTypes: ["powerhouse/document-model"],
9
- Component: lazy(() => import("../../editor-B3yz7YdR.js"))
9
+ Component: lazy(() => import("../../editor-CoTq6fqT.js"))
10
10
  };
11
11
  //#endregion
12
12
  export { DocumentModelEditor };
@@ -1,9 +1,9 @@
1
- import { C as __require, x as __commonJSMin } from "../../schemas-Bqem6NRm.js";
2
- import "../../dist-DQgJ8n4d.js";
1
+ import { E as __commonJSMin, O as __require } from "../../dist-CXoKspdx.js";
2
+ import "../../document-drive-oqv68jDU.js";
3
3
  import { GenericDriveExplorer } from "./module.js";
4
- import { m as Icon } from "../../dist-DOMEWT3x.js";
5
- import { n as ConnectSearchBar } from "../../connect-CKdlDSUw.js";
6
- import { i as CreateDocument, n as DriveLayout, r as FileContentView, t as FolderView } from "../../folder-view-H2ov-zId.js";
4
+ import { g as Icon, n as ConnectSearchBar } from "../../connect-ZnLjvmRt.js";
5
+ import "../../dist-C1nRM9t2.js";
6
+ import { i as CreateDocument, n as DriveLayout, r as FileContentView, t as FolderView } from "../../folder-view-DmYBf2pP.js";
7
7
  import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
8
8
  import { jsx } from "react/jsx-runtime";
9
9
  //#region ../../node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.13_typescript@5.9.3__react-dom@19.2.6_react@19.2.6__react@19.2.6_typescript@5.9.3/node_modules/react-i18next/dist/es/utils.js
@@ -376,7 +376,7 @@ const SearchBar = () => {
376
376
  const { t } = useTranslation();
377
377
  const [value, setValue] = useState("");
378
378
  return /* @__PURE__ */ jsx(ConnectSearchBar, {
379
- className: "m-4 shrink-0 bg-gray-100",
379
+ className: "m-4 shrink-0 bg-gray-100 dark:bg-slate-700",
380
380
  placeholder: t("searchbar.placeholder"),
381
381
  filterLabel: t("searchbar.filterLabel"),
382
382
  filterItems: defaultFilterItems,