@sanity/assist 1.2.11 → 1.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -3623,8 +3623,7 @@ const InlineBlockValueContext = createContext(void 0);
3623
3623
  function AssistInlineFormBlock(props) {
3624
3624
  return /* @__PURE__ */jsx(InlineBlockValueContext.Provider, {
3625
3625
  value: props.value,
3626
- children: /* @__PURE__ */jsx(Box, {
3627
- flex: 1,
3626
+ children: /* @__PURE__ */jsx(Fragment, {
3628
3627
  children: props.renderDefault(props)
3629
3628
  })
3630
3629
  });
@@ -4217,7 +4216,40 @@ const documentInstructionStatus = defineType({
4217
4216
  }]
4218
4217
  })]
4219
4218
  });
4220
- const schemaTypes = [fieldInstructions, assistDocumentSchema, prompt, fieldReference, instruction, documentInstructionStatus, instructionTask, contextDocumentSchema, userInput, promptContext];
4219
+ function excludeComments(type) {
4220
+ var _a, _b, _c;
4221
+ const existingRender = (_a = type == null ? void 0 : type.components) == null ? void 0 : _a.field;
4222
+ return {
4223
+ ...type,
4224
+ ...("components" in type ? {
4225
+ components: {
4226
+ ...type.components,
4227
+ field: props => {
4228
+ const newProps = {
4229
+ ...props,
4230
+ ...{
4231
+ __internal_comments: void 0
4232
+ }
4233
+ };
4234
+ if (typeof existingRender === "function") {
4235
+ return existingRender(newProps);
4236
+ }
4237
+ return props.renderDefault(newProps);
4238
+ }
4239
+ }
4240
+ } : {}),
4241
+ ...("fields" in type ? {
4242
+ // recursively disable comments in fields
4243
+ fields: (_b = type.fields) == null ? void 0 : _b.map(field => excludeComments(field))
4244
+ } : {}),
4245
+ ...("of" in type ? {
4246
+ // recursively disable comments in array items
4247
+ of: (_c = type.of) == null ? void 0 : _c.map(arrayItemType => excludeComments(arrayItemType))
4248
+ } : {})
4249
+ };
4250
+ }
4251
+ const instructionForm = [fieldInstructions, instruction, fieldReference, prompt, userInput, promptContext].map(excludeComments);
4252
+ const schemaTypes = [...instructionForm, assistDocumentSchema, documentInstructionStatus, instructionTask, contextDocumentSchema];
4221
4253
  function useAssistSupported(path, schemaType) {
4222
4254
  return useMemo(() => isAssistSupported(schemaType), [schemaType]);
4223
4255
  }