@powerhousedao/powerhouse-vetra-packages 6.2.3 → 6.3.0-dev.1

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 (95) hide show
  1. package/dist/browser/document-models/index.js +1 -1
  2. package/dist/browser/documents-cxt8RRxe.js +18 -0
  3. package/dist/browser/documents-cxt8RRxe.js.map +1 -0
  4. package/dist/browser/editor-DXAJ8Mqb.js +2293 -0
  5. package/dist/browser/editor-DXAJ8Mqb.js.map +1 -0
  6. package/dist/browser/{editor-CiR6XQBO.js → editor-Dmpkd8pQ.js} +3 -3
  7. package/dist/browser/{editor-CiR6XQBO.js.map → editor-Dmpkd8pQ.js.map} +1 -1
  8. package/dist/browser/editors/document-model-editor/module.js +1 -1
  9. package/dist/browser/editors/document-model-editor/module.js.map +1 -1
  10. package/dist/browser/editors/generic-drive-explorer/index.js +4 -340
  11. package/dist/browser/editors/generic-drive-explorer/index.js.map +1 -1
  12. package/dist/browser/editors/generic-drive-explorer/module.js +1 -1
  13. package/dist/browser/folder-view-CwIU4XEe.js +237 -0
  14. package/dist/browser/folder-view-CwIU4XEe.js.map +1 -0
  15. package/dist/browser/graphql-editor-CGxwONKl.js +103 -0
  16. package/dist/browser/graphql-editor-CGxwONKl.js.map +1 -0
  17. package/dist/browser/hooks-D15NCia0.js +126 -0
  18. package/dist/browser/hooks-D15NCia0.js.map +1 -0
  19. package/dist/browser/index.js +5 -805
  20. package/dist/browser/index.js.map +1 -1
  21. package/dist/browser/json-editor--jgLEwP2.js +55 -0
  22. package/dist/browser/json-editor--jgLEwP2.js.map +1 -0
  23. package/dist/browser/schema-context-CC_WFs1x.js +73 -0
  24. package/dist/browser/schema-context-CC_WFs1x.js.map +1 -0
  25. package/dist/browser/state-schemas-DSY44MOd.js +307 -0
  26. package/dist/browser/state-schemas-DSY44MOd.js.map +1 -0
  27. package/dist/node/bundle-mjs-Cuu3DEfT.mjs +3140 -0
  28. package/dist/node/bundle-mjs-Cuu3DEfT.mjs.map +1 -0
  29. package/dist/node/{graphql-Dp4j7rmx.mjs → documents-DH2fyf7U.mjs} +32 -3
  30. package/dist/node/documents-DH2fyf7U.mjs.map +1 -0
  31. package/dist/node/{editor-96sMeumV.mjs → editor-BcvUeBW7.mjs} +2902 -2738
  32. package/dist/node/editor-BcvUeBW7.mjs.map +1 -0
  33. package/dist/node/editor-DJCghViS.mjs +983 -0
  34. package/dist/node/editor-DJCghViS.mjs.map +1 -0
  35. package/dist/node/editors/index.mjs +23 -2
  36. package/dist/node/editors/index.mjs.map +1 -0
  37. package/dist/node/{graphql-editor-CBJXEY_C.mjs → graphql-editor-u9NStKLL.mjs} +5078 -26
  38. package/dist/node/graphql-editor-u9NStKLL.mjs.map +1 -0
  39. package/dist/{browser/hooks-eQxBX7g4.js → node/hooks-BiLz75cj.mjs} +2 -2
  40. package/dist/node/{hooks-C2b46djt.mjs.map → hooks-BiLz75cj.mjs.map} +1 -1
  41. package/dist/node/index.mjs +12 -189
  42. package/dist/node/index.mjs.map +1 -1
  43. package/dist/{browser/json-editor-DfRD-pfk.js → node/json-editor-BfcrckeT.mjs} +3 -3
  44. package/dist/node/{json-editor-DaqHARBD.mjs.map → json-editor-BfcrckeT.mjs.map} +1 -1
  45. package/dist/node/{schema-context-CojjnSE6.mjs → schema-context-r0MTQnRC.mjs} +6 -4
  46. package/dist/node/schema-context-r0MTQnRC.mjs.map +1 -0
  47. package/dist/node/{state-schemas-BHuo0GPl.mjs → state-schemas-o3PZdBW2.mjs} +427 -54
  48. package/dist/node/state-schemas-o3PZdBW2.mjs.map +1 -0
  49. package/package.json +21 -19
  50. package/style.css +2 -0
  51. package/dist/browser/assets/entry-D62sYiFV.js +0 -318
  52. package/dist/browser/assets/projection-entry-BGcu_9-p.js +0 -446
  53. package/dist/browser/documents-CRzouuNR.js +0 -6067
  54. package/dist/browser/documents-CRzouuNR.js.map +0 -1
  55. package/dist/browser/editor-C7KBR_ar.js +0 -4676
  56. package/dist/browser/editor-C7KBR_ar.js.map +0 -1
  57. package/dist/browser/folder-view-DSgXN79D.js +0 -4409
  58. package/dist/browser/folder-view-DSgXN79D.js.map +0 -1
  59. package/dist/browser/graphql-editor-Cgi5UOrF.js +0 -11708
  60. package/dist/browser/graphql-editor-Cgi5UOrF.js.map +0 -1
  61. package/dist/browser/hooks-eQxBX7g4.js.map +0 -1
  62. package/dist/browser/json-editor-DfRD-pfk.js.map +0 -1
  63. package/dist/browser/parser-DtbeHA3H.js +0 -2554
  64. package/dist/browser/parser-DtbeHA3H.js.map +0 -1
  65. package/dist/browser/rolldown-runtime-DC62tzP2.js +0 -33
  66. package/dist/browser/src-CrUksCLW-B2dkRdgq.js +0 -5254
  67. package/dist/browser/src-CrUksCLW-B2dkRdgq.js.map +0 -1
  68. package/dist/browser/state-schemas-B5Bk_l1s.js +0 -696
  69. package/dist/browser/state-schemas-B5Bk_l1s.js.map +0 -1
  70. package/dist/browser/tslib.es6-Cno80yFJ.js +0 -32
  71. package/dist/browser/tslib.es6-Cno80yFJ.js.map +0 -1
  72. package/dist/node/documents-D70S9PZL.mjs +0 -17
  73. package/dist/node/documents-D70S9PZL.mjs.map +0 -1
  74. package/dist/node/editor-96sMeumV.mjs.map +0 -1
  75. package/dist/node/editor-wqvKwcO5.mjs +0 -24
  76. package/dist/node/editor-wqvKwcO5.mjs.map +0 -1
  77. package/dist/node/editors/document-model-editor/index.mjs +0 -1
  78. package/dist/node/editors/document-model-editor/module.mjs +0 -14
  79. package/dist/node/editors/document-model-editor/module.mjs.map +0 -1
  80. package/dist/node/editors/generic-drive-explorer/index.mjs +0 -461
  81. package/dist/node/editors/generic-drive-explorer/index.mjs.map +0 -1
  82. package/dist/node/editors/generic-drive-explorer/module.mjs +0 -14
  83. package/dist/node/editors/generic-drive-explorer/module.mjs.map +0 -1
  84. package/dist/node/folder-view-ktfv2Cvw.mjs +0 -4409
  85. package/dist/node/folder-view-ktfv2Cvw.mjs.map +0 -1
  86. package/dist/node/graphql-Dp4j7rmx.mjs.map +0 -1
  87. package/dist/node/graphql-editor-CBJXEY_C.mjs.map +0 -1
  88. package/dist/node/hooks-C2b46djt.mjs +0 -24593
  89. package/dist/node/json-editor-DaqHARBD.mjs +0 -153
  90. package/dist/node/schema-context-CojjnSE6.mjs.map +0 -1
  91. package/dist/node/src-CrUksCLW-TvF37aMo.mjs +0 -5935
  92. package/dist/node/src-CrUksCLW-TvF37aMo.mjs.map +0 -1
  93. package/dist/node/state-schemas-BHuo0GPl.mjs.map +0 -1
  94. package/dist/node/tslib.es6-VORZjfk3.mjs +0 -583
  95. package/dist/node/tslib.es6-VORZjfk3.mjs.map +0 -1
@@ -1,13 +1,212 @@
1
- import { t as require_graphql } from "./graphql-Dp4j7rmx.mjs";
2
- import { a as Presence, c as Primitive, d as createContextScope, f as useComposedRefs, l as createSlot, m as twMerge, o as useId$1, p as composeEventHandlers, s as useCallbackRef, u as useControllableState } from "./src-CrUksCLW-TvF37aMo.mjs";
3
- import { r as typeDefsDoc } from "./documents-D70S9PZL.mjs";
4
- import { n as safeParseSdl, r as useSchemaContext } from "./schema-context-CojjnSE6.mjs";
5
- import { a as makeInitialSchemaDoc, c as validateStateObject, i as StateValidationError, n as Button, o as makeMinimalObjectForStateType, r as ensureValidStateSchemaName, s as makeStateSchemaNameForScope } from "./editor-96sMeumV.mjs";
1
+ import { i as typeDefsDoc, o as require_graphql } from "./documents-DH2fyf7U.mjs";
2
+ import { n as safeParseSdl, r as useSchemaContext } from "./schema-context-r0MTQnRC.mjs";
3
+ import { t as twMerge } from "./bundle-mjs-Cuu3DEfT.mjs";
4
+ import { a as ensureValidStateSchemaName, c as makeMinimalObjectForStateType, i as Button, l as makeStateSchemaNameForScope, n as composeRefs, o as StateValidationError, r as useComposedRefs, s as makeInitialSchemaDoc, u as validateStateObject } from "./editor-BcvUeBW7.mjs";
6
5
  import * as React$1 from "react";
7
6
  import React, { Suspense, lazy, useCallback, useEffect, useMemo, useRef, useState } from "react";
8
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
- //#region ../../node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@19.2.3_@types+react@19.2.14__@types+r_b94f5365b88697a700662930c56ccffc/node_modules/@radix-ui/react-collection/dist/index.mjs
8
+ import "@powerhousedao/design-system/connect";
9
+ import "react-dom";
10
+ //#region editors/document-model-editor/components/state-error.tsx
10
11
  var import_graphql = require_graphql();
12
+ function StateValidationErrorMessage({ error }) {
13
+ const { payload } = error;
14
+ switch (payload.kind) {
15
+ case "MISSING": return /* @__PURE__ */ jsxs("span", { children: [
16
+ "Field ",
17
+ /* @__PURE__ */ jsx("strong", { children: payload.field }),
18
+ " is missing."
19
+ ] });
20
+ case "MISSING_OPTIONAL": return /* @__PURE__ */ jsxs("span", { children: [
21
+ "Optional field ",
22
+ /* @__PURE__ */ jsx("strong", { children: payload.field }),
23
+ " is not defined."
24
+ ] });
25
+ case "UNKNOWN_FIELD": return /* @__PURE__ */ jsxs("span", { children: [
26
+ "Field ",
27
+ /* @__PURE__ */ jsx("strong", { children: payload.field }),
28
+ " is not a known field."
29
+ ] });
30
+ case "NON_NULL": return /* @__PURE__ */ jsxs("span", { children: [
31
+ "Field ",
32
+ /* @__PURE__ */ jsx("strong", { children: payload.field }),
33
+ " cannot be null."
34
+ ] });
35
+ case "TYPE": return /* @__PURE__ */ jsxs("span", { children: [
36
+ "Field ",
37
+ /* @__PURE__ */ jsx("strong", { children: payload.field }),
38
+ payload.expectedType ? /* @__PURE__ */ jsxs(Fragment, { children: [
39
+ " ",
40
+ "must be a",
41
+ " ",
42
+ /* @__PURE__ */ jsx("strong", { children: payload.expectedType.replace(/!/g, "") }),
43
+ "."
44
+ ] }) : /* @__PURE__ */ jsx(Fragment, { children: " has an invalid value." })
45
+ ] });
46
+ case "RECURSIVE_TYPE": return /* @__PURE__ */ jsxs("span", { children: [
47
+ "Field ",
48
+ /* @__PURE__ */ jsx("strong", { children: payload.typeName }),
49
+ " has a recursive type. It must be optional."
50
+ ] });
51
+ default: return /* @__PURE__ */ jsx("span", { children: "Invalid value." });
52
+ }
53
+ }
54
+ typeof window !== "undefined" && window.document && window.document.createElement;
55
+ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
56
+ return function handleEvent(event) {
57
+ originalEventHandler?.(event);
58
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler?.(event);
59
+ };
60
+ }
61
+ //#endregion
62
+ //#region ../../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-context/dist/index.mjs
63
+ function createContextScope(scopeName, createContextScopeDeps = []) {
64
+ let defaultContexts = [];
65
+ function createContext3(rootComponentName, defaultContext) {
66
+ const BaseContext = React$1.createContext(defaultContext);
67
+ const index = defaultContexts.length;
68
+ defaultContexts = [...defaultContexts, defaultContext];
69
+ const Provider = (props) => {
70
+ const { scope, children, ...context } = props;
71
+ const Context = scope?.[scopeName]?.[index] || BaseContext;
72
+ const value = React$1.useMemo(() => context, Object.values(context));
73
+ return /* @__PURE__ */ jsx(Context.Provider, {
74
+ value,
75
+ children
76
+ });
77
+ };
78
+ Provider.displayName = rootComponentName + "Provider";
79
+ function useContext2(consumerName, scope) {
80
+ const Context = scope?.[scopeName]?.[index] || BaseContext;
81
+ const context = React$1.useContext(Context);
82
+ if (context) return context;
83
+ if (defaultContext !== void 0) return defaultContext;
84
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
85
+ }
86
+ return [Provider, useContext2];
87
+ }
88
+ const createScope = () => {
89
+ const scopeContexts = defaultContexts.map((defaultContext) => {
90
+ return React$1.createContext(defaultContext);
91
+ });
92
+ return function useScope(scope) {
93
+ const contexts = scope?.[scopeName] || scopeContexts;
94
+ return React$1.useMemo(() => ({ [`__scope${scopeName}`]: {
95
+ ...scope,
96
+ [scopeName]: contexts
97
+ } }), [scope, contexts]);
98
+ };
99
+ };
100
+ createScope.scopeName = scopeName;
101
+ return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
102
+ }
103
+ function composeContextScopes(...scopes) {
104
+ const baseScope = scopes[0];
105
+ if (scopes.length === 1) return baseScope;
106
+ const createScope = () => {
107
+ const scopeHooks = scopes.map((createScope2) => ({
108
+ useScope: createScope2(),
109
+ scopeName: createScope2.scopeName
110
+ }));
111
+ return function useComposedScopes(overrideScopes) {
112
+ const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
113
+ const currentScope = useScope(overrideScopes)[`__scope${scopeName}`];
114
+ return {
115
+ ...nextScopes2,
116
+ ...currentScope
117
+ };
118
+ }, {});
119
+ return React$1.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
120
+ };
121
+ };
122
+ createScope.scopeName = baseScope.scopeName;
123
+ return createScope;
124
+ }
125
+ //#endregion
126
+ //#region ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-slot/dist/index.mjs
127
+ // @__NO_SIDE_EFFECTS__
128
+ function createSlot(ownerName) {
129
+ const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
130
+ const Slot2 = React$1.forwardRef((props, forwardedRef) => {
131
+ const { children, ...slotProps } = props;
132
+ const childrenArray = React$1.Children.toArray(children);
133
+ const slottable = childrenArray.find(isSlottable);
134
+ if (slottable) {
135
+ const newElement = slottable.props.children;
136
+ const newChildren = childrenArray.map((child) => {
137
+ if (child === slottable) {
138
+ if (React$1.Children.count(newElement) > 1) return React$1.Children.only(null);
139
+ return React$1.isValidElement(newElement) ? newElement.props.children : null;
140
+ } else return child;
141
+ });
142
+ return /* @__PURE__ */ jsx(SlotClone, {
143
+ ...slotProps,
144
+ ref: forwardedRef,
145
+ children: React$1.isValidElement(newElement) ? React$1.cloneElement(newElement, void 0, newChildren) : null
146
+ });
147
+ }
148
+ return /* @__PURE__ */ jsx(SlotClone, {
149
+ ...slotProps,
150
+ ref: forwardedRef,
151
+ children
152
+ });
153
+ });
154
+ Slot2.displayName = `${ownerName}.Slot`;
155
+ return Slot2;
156
+ }
157
+ // @__NO_SIDE_EFFECTS__
158
+ function createSlotClone(ownerName) {
159
+ const SlotClone = React$1.forwardRef((props, forwardedRef) => {
160
+ const { children, ...slotProps } = props;
161
+ if (React$1.isValidElement(children)) {
162
+ const childrenRef = getElementRef$1(children);
163
+ const props2 = mergeProps(slotProps, children.props);
164
+ if (children.type !== React$1.Fragment) props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
165
+ return React$1.cloneElement(children, props2);
166
+ }
167
+ return React$1.Children.count(children) > 1 ? React$1.Children.only(null) : null;
168
+ });
169
+ SlotClone.displayName = `${ownerName}.SlotClone`;
170
+ return SlotClone;
171
+ }
172
+ var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
173
+ function isSlottable(child) {
174
+ return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
175
+ }
176
+ function mergeProps(slotProps, childProps) {
177
+ const overrideProps = { ...childProps };
178
+ for (const propName in childProps) {
179
+ const slotPropValue = slotProps[propName];
180
+ const childPropValue = childProps[propName];
181
+ if (/^on[A-Z]/.test(propName)) {
182
+ if (slotPropValue && childPropValue) overrideProps[propName] = (...args) => {
183
+ const result = childPropValue(...args);
184
+ slotPropValue(...args);
185
+ return result;
186
+ };
187
+ else if (slotPropValue) overrideProps[propName] = slotPropValue;
188
+ } else if (propName === "style") overrideProps[propName] = {
189
+ ...slotPropValue,
190
+ ...childPropValue
191
+ };
192
+ else if (propName === "className") overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
193
+ }
194
+ return {
195
+ ...slotProps,
196
+ ...overrideProps
197
+ };
198
+ }
199
+ function getElementRef$1(element) {
200
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
201
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
202
+ if (mayWarn) return element.ref;
203
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
204
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
205
+ if (mayWarn) return element.props.ref;
206
+ return element.props.ref || element.ref;
207
+ }
208
+ //#endregion
209
+ //#region ../../node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@19.2.3_@types+react@19.2.14__@types+r_b94f5365b88697a700662930c56ccffc/node_modules/@radix-ui/react-collection/dist/index.mjs
11
210
  function createCollection(name) {
12
211
  const PROVIDER_NAME = name + "CollectionProvider";
13
212
  const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);
@@ -28,7 +227,7 @@ function createCollection(name) {
28
227
  };
29
228
  CollectionProvider.displayName = PROVIDER_NAME;
30
229
  const COLLECTION_SLOT_NAME = name + "CollectionSlot";
31
- const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
230
+ const CollectionSlotImpl = /* @__PURE__ */ createSlot(COLLECTION_SLOT_NAME);
32
231
  const CollectionSlot = React.forwardRef((props, forwardedRef) => {
33
232
  const { scope, children } = props;
34
233
  const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
@@ -41,7 +240,7 @@ function createCollection(name) {
41
240
  CollectionSlot.displayName = COLLECTION_SLOT_NAME;
42
241
  const ITEM_SLOT_NAME = name + "CollectionItemSlot";
43
242
  const ITEM_DATA_ATTR = "data-radix-collection-item";
44
- const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
243
+ const CollectionItemSlotImpl = /* @__PURE__ */ createSlot(ITEM_SLOT_NAME);
45
244
  const CollectionItemSlot = React.forwardRef((props, forwardedRef) => {
46
245
  const { scope, children, ...itemData } = props;
47
246
  const ref = React.useRef(null);
@@ -81,6 +280,118 @@ function createCollection(name) {
81
280
  ];
82
281
  }
83
282
  //#endregion
283
+ //#region ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
284
+ var useLayoutEffect2 = globalThis?.document ? React$1.useLayoutEffect : () => {};
285
+ //#endregion
286
+ //#region ../../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-id/dist/index.mjs
287
+ var useReactId = React$1[" useId ".trim().toString()] || (() => void 0);
288
+ var count = 0;
289
+ function useId$1(deterministicId) {
290
+ const [id, setId] = React$1.useState(useReactId());
291
+ useLayoutEffect2(() => {
292
+ if (!deterministicId) setId((reactId) => reactId ?? String(count++));
293
+ }, [deterministicId]);
294
+ return deterministicId || (id ? `radix-${id}` : "");
295
+ }
296
+ //#endregion
297
+ //#region ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.2.3_@types+react@19.2.14__@types+re_0935c7b95cefcdb4f10a34e92035e5e3/node_modules/@radix-ui/react-primitive/dist/index.mjs
298
+ var Primitive = [
299
+ "a",
300
+ "button",
301
+ "div",
302
+ "form",
303
+ "h2",
304
+ "h3",
305
+ "img",
306
+ "input",
307
+ "label",
308
+ "li",
309
+ "nav",
310
+ "ol",
311
+ "p",
312
+ "select",
313
+ "span",
314
+ "svg",
315
+ "ul"
316
+ ].reduce((primitive, node) => {
317
+ const Slot = /* @__PURE__ */ createSlot(`Primitive.${node}`);
318
+ const Node = React$1.forwardRef((props, forwardedRef) => {
319
+ const { asChild, ...primitiveProps } = props;
320
+ const Comp = asChild ? Slot : node;
321
+ if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
322
+ return /* @__PURE__ */ jsx(Comp, {
323
+ ...primitiveProps,
324
+ ref: forwardedRef
325
+ });
326
+ });
327
+ Node.displayName = `Primitive.${node}`;
328
+ return {
329
+ ...primitive,
330
+ [node]: Node
331
+ };
332
+ }, {});
333
+ //#endregion
334
+ //#region ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.1_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
335
+ function useCallbackRef(callback) {
336
+ const callbackRef = React$1.useRef(callback);
337
+ React$1.useEffect(() => {
338
+ callbackRef.current = callback;
339
+ });
340
+ return React$1.useMemo(() => (...args) => callbackRef.current?.(...args), []);
341
+ }
342
+ //#endregion
343
+ //#region ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
344
+ var useInsertionEffect = React$1[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
345
+ function useControllableState({ prop, defaultProp, onChange = () => {}, caller }) {
346
+ const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
347
+ defaultProp,
348
+ onChange
349
+ });
350
+ const isControlled = prop !== void 0;
351
+ const value = isControlled ? prop : uncontrolledProp;
352
+ {
353
+ const isControlledRef = React$1.useRef(prop !== void 0);
354
+ React$1.useEffect(() => {
355
+ const wasControlled = isControlledRef.current;
356
+ if (wasControlled !== isControlled) console.warn(`${caller} is changing from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`);
357
+ isControlledRef.current = isControlled;
358
+ }, [isControlled, caller]);
359
+ }
360
+ return [value, React$1.useCallback((nextValue) => {
361
+ if (isControlled) {
362
+ const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
363
+ if (value2 !== prop) onChangeRef.current?.(value2);
364
+ } else setUncontrolledProp(nextValue);
365
+ }, [
366
+ isControlled,
367
+ prop,
368
+ setUncontrolledProp,
369
+ onChangeRef
370
+ ])];
371
+ }
372
+ function useUncontrolledState({ defaultProp, onChange }) {
373
+ const [value, setValue] = React$1.useState(defaultProp);
374
+ const prevValueRef = React$1.useRef(value);
375
+ const onChangeRef = React$1.useRef(onChange);
376
+ useInsertionEffect(() => {
377
+ onChangeRef.current = onChange;
378
+ }, [onChange]);
379
+ React$1.useEffect(() => {
380
+ if (prevValueRef.current !== value) {
381
+ onChangeRef.current?.(value);
382
+ prevValueRef.current = value;
383
+ }
384
+ }, [value, prevValueRef]);
385
+ return [
386
+ value,
387
+ setValue,
388
+ onChangeRef
389
+ ];
390
+ }
391
+ function isFunction(value) {
392
+ return typeof value === "function";
393
+ }
394
+ //#endregion
84
395
  //#region ../../node_modules/.pnpm/@radix-ui+react-direction@1.1.1_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-direction/dist/index.mjs
85
396
  var DirectionContext = React$1.createContext(void 0);
86
397
  function useDirection(localDir) {
@@ -272,48 +583,103 @@ function wrapArray(array, startIndex) {
272
583
  var Root = RovingFocusGroup;
273
584
  var Item = RovingFocusGroupItem;
274
585
  //#endregion
275
- //#region editors/document-model-editor/components/state-error.tsx
276
- function StateValidationErrorMessage({ error }) {
277
- const { payload } = error;
278
- switch (payload.kind) {
279
- case "MISSING": return /* @__PURE__ */ jsxs("span", { children: [
280
- "Field ",
281
- /* @__PURE__ */ jsx("strong", { children: payload.field }),
282
- " is missing."
283
- ] });
284
- case "MISSING_OPTIONAL": return /* @__PURE__ */ jsxs("span", { children: [
285
- "Optional field ",
286
- /* @__PURE__ */ jsx("strong", { children: payload.field }),
287
- " is not defined."
288
- ] });
289
- case "UNKNOWN_FIELD": return /* @__PURE__ */ jsxs("span", { children: [
290
- "Field ",
291
- /* @__PURE__ */ jsx("strong", { children: payload.field }),
292
- " is not a known field."
293
- ] });
294
- case "NON_NULL": return /* @__PURE__ */ jsxs("span", { children: [
295
- "Field ",
296
- /* @__PURE__ */ jsx("strong", { children: payload.field }),
297
- " cannot be null."
298
- ] });
299
- case "TYPE": return /* @__PURE__ */ jsxs("span", { children: [
300
- "Field ",
301
- /* @__PURE__ */ jsx("strong", { children: payload.field }),
302
- payload.expectedType ? /* @__PURE__ */ jsxs(Fragment, { children: [
303
- " ",
304
- "must be a",
305
- " ",
306
- /* @__PURE__ */ jsx("strong", { children: payload.expectedType.replace(/!/g, "") }),
307
- "."
308
- ] }) : /* @__PURE__ */ jsx(Fragment, { children: " has an invalid value." })
309
- ] });
310
- case "RECURSIVE_TYPE": return /* @__PURE__ */ jsxs("span", { children: [
311
- "Field ",
312
- /* @__PURE__ */ jsx("strong", { children: payload.typeName }),
313
- " has a recursive type. It must be optional."
314
- ] });
315
- default: return /* @__PURE__ */ jsx("span", { children: "Invalid value." });
316
- }
586
+ //#region ../../node_modules/.pnpm/@radix-ui+react-presence@1.1.5_@types+react-dom@19.2.3_@types+react@19.2.14__@types+rea_abbc8bcf75333b39bfe32b13ef7abc0e/node_modules/@radix-ui/react-presence/dist/index.mjs
587
+ function useStateMachine(initialState, machine) {
588
+ return React$1.useReducer((state, event) => {
589
+ return machine[state][event] ?? state;
590
+ }, initialState);
591
+ }
592
+ var Presence = (props) => {
593
+ const { present, children } = props;
594
+ const presence = usePresence(present);
595
+ const child = typeof children === "function" ? children({ present: presence.isPresent }) : React$1.Children.only(children);
596
+ const ref = useComposedRefs(presence.ref, getElementRef(child));
597
+ return typeof children === "function" || presence.isPresent ? React$1.cloneElement(child, { ref }) : null;
598
+ };
599
+ Presence.displayName = "Presence";
600
+ function usePresence(present) {
601
+ const [node, setNode] = React$1.useState();
602
+ const stylesRef = React$1.useRef(null);
603
+ const prevPresentRef = React$1.useRef(present);
604
+ const prevAnimationNameRef = React$1.useRef("none");
605
+ const [state, send] = useStateMachine(present ? "mounted" : "unmounted", {
606
+ mounted: {
607
+ UNMOUNT: "unmounted",
608
+ ANIMATION_OUT: "unmountSuspended"
609
+ },
610
+ unmountSuspended: {
611
+ MOUNT: "mounted",
612
+ ANIMATION_END: "unmounted"
613
+ },
614
+ unmounted: { MOUNT: "mounted" }
615
+ });
616
+ React$1.useEffect(() => {
617
+ const currentAnimationName = getAnimationName(stylesRef.current);
618
+ prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
619
+ }, [state]);
620
+ useLayoutEffect2(() => {
621
+ const styles = stylesRef.current;
622
+ const wasPresent = prevPresentRef.current;
623
+ if (wasPresent !== present) {
624
+ const prevAnimationName = prevAnimationNameRef.current;
625
+ const currentAnimationName = getAnimationName(styles);
626
+ if (present) send("MOUNT");
627
+ else if (currentAnimationName === "none" || styles?.display === "none") send("UNMOUNT");
628
+ else if (wasPresent && prevAnimationName !== currentAnimationName) send("ANIMATION_OUT");
629
+ else send("UNMOUNT");
630
+ prevPresentRef.current = present;
631
+ }
632
+ }, [present, send]);
633
+ useLayoutEffect2(() => {
634
+ if (node) {
635
+ let timeoutId;
636
+ const ownerWindow = node.ownerDocument.defaultView ?? window;
637
+ const handleAnimationEnd = (event) => {
638
+ const isCurrentAnimation = getAnimationName(stylesRef.current).includes(CSS.escape(event.animationName));
639
+ if (event.target === node && isCurrentAnimation) {
640
+ send("ANIMATION_END");
641
+ if (!prevPresentRef.current) {
642
+ const currentFillMode = node.style.animationFillMode;
643
+ node.style.animationFillMode = "forwards";
644
+ timeoutId = ownerWindow.setTimeout(() => {
645
+ if (node.style.animationFillMode === "forwards") node.style.animationFillMode = currentFillMode;
646
+ });
647
+ }
648
+ }
649
+ };
650
+ const handleAnimationStart = (event) => {
651
+ if (event.target === node) prevAnimationNameRef.current = getAnimationName(stylesRef.current);
652
+ };
653
+ node.addEventListener("animationstart", handleAnimationStart);
654
+ node.addEventListener("animationcancel", handleAnimationEnd);
655
+ node.addEventListener("animationend", handleAnimationEnd);
656
+ return () => {
657
+ ownerWindow.clearTimeout(timeoutId);
658
+ node.removeEventListener("animationstart", handleAnimationStart);
659
+ node.removeEventListener("animationcancel", handleAnimationEnd);
660
+ node.removeEventListener("animationend", handleAnimationEnd);
661
+ };
662
+ } else send("ANIMATION_END");
663
+ }, [node, send]);
664
+ return {
665
+ isPresent: ["mounted", "unmountSuspended"].includes(state),
666
+ ref: React$1.useCallback((node2) => {
667
+ stylesRef.current = node2 ? getComputedStyle(node2) : null;
668
+ setNode(node2);
669
+ }, [])
670
+ };
671
+ }
672
+ function getAnimationName(styles) {
673
+ return styles?.animationName || "none";
674
+ }
675
+ function getElementRef(element) {
676
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
677
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
678
+ if (mayWarn) return element.ref;
679
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
680
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
681
+ if (mayWarn) return element.props.ref;
682
+ return element.props.ref || element.ref;
317
683
  }
318
684
  //#endregion
319
685
  //#region ../../node_modules/.pnpm/@radix-ui+react-tabs@1.1.13_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react@_08684373bbac196273bdefb5472f93a8/node_modules/@radix-ui/react-tabs/dist/index.mjs
@@ -472,8 +838,8 @@ const TabsContent = React$1.forwardRef(({ className, ...props }, ref) => /* @__P
472
838
  TabsContent.displayName = Content.displayName;
473
839
  //#endregion
474
840
  //#region editors/document-model-editor/components/state-schemas.tsx
475
- const GraphqlEditor = lazy(() => import("./graphql-editor-CBJXEY_C.mjs"));
476
- const JSONEditor = lazy(() => import("./json-editor-DaqHARBD.mjs"));
841
+ const GraphqlEditor = lazy(() => import("./graphql-editor-u9NStKLL.mjs"));
842
+ const JSONEditor = lazy(() => import("./json-editor-BfcrckeT.mjs"));
477
843
  function StateEditor({ modelName, stateSchema, initialValue, setStateSchema, setInitialState, scope }) {
478
844
  const { sharedSchema: sharedSchemaSdl, error: sharedSchemaError } = useSchemaContext();
479
845
  const [showStandardLib, setShowStandardLib] = useState(false);
@@ -495,6 +861,12 @@ function StateEditor({ modelName, stateSchema, initialValue, setStateSchema, set
495
861
  const handleSchemaUpdate = useCallback((newDoc) => setStateSchema(newDoc, scope), [setStateSchema, scope]);
496
862
  const handleInitialStateUpdate = useCallback((newDoc) => setInitialState(newDoc, scope), [setInitialState, scope]);
497
863
  const hasSyncedRef = useRef(false);
864
+ const [openedWith] = useState(() => ({
865
+ sharedSchemaSdl,
866
+ initialValue,
867
+ modelName
868
+ }));
869
+ const editedSinceOpen = sharedSchemaSdl !== openedWith.sharedSchemaSdl || initialValue !== openedWith.initialValue || modelName !== openedWith.modelName;
498
870
  const { initialValueErrors, fixedState } = useMemo(() => {
499
871
  const existingValue = initialValue || "{}";
500
872
  const sharedSchemaDocumentNode = safeParseSdl(sharedSchemaSdl);
@@ -513,7 +885,7 @@ function StateEditor({ modelName, stateSchema, initialValue, setStateSchema, set
513
885
  fixedState: null
514
886
  };
515
887
  const errors = validateStateObject(sharedSchemaDocumentNode, stateTypeDefinitionNode, existingValue);
516
- if (errors.length && syncWithSchema) {
888
+ if (errors.length && syncWithSchema && editedSinceOpen) {
517
889
  const computedFixedState = makeMinimalObjectForStateType({
518
890
  sharedSchemaDocumentNode,
519
891
  stateTypeDefinitionNode,
@@ -532,6 +904,7 @@ function StateEditor({ modelName, stateSchema, initialValue, setStateSchema, set
532
904
  sharedSchemaSdl,
533
905
  initialValue,
534
906
  syncWithSchema,
907
+ editedSinceOpen,
535
908
  scope,
536
909
  modelName
537
910
  ]);
@@ -695,4 +1068,4 @@ function StateSchemas({ modelName, globalStateSchema, localStateSchema, globalSt
695
1068
  //#endregion
696
1069
  export { StateSchemas as default };
697
1070
 
698
- //# sourceMappingURL=state-schemas-BHuo0GPl.mjs.map
1071
+ //# sourceMappingURL=state-schemas-o3PZdBW2.mjs.map