@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.js
CHANGED
|
@@ -3636,8 +3636,7 @@ const InlineBlockValueContext = react.createContext(void 0);
|
|
|
3636
3636
|
function AssistInlineFormBlock(props) {
|
|
3637
3637
|
return /* @__PURE__ */jsxRuntime.jsx(InlineBlockValueContext.Provider, {
|
|
3638
3638
|
value: props.value,
|
|
3639
|
-
children: /* @__PURE__ */jsxRuntime.jsx(
|
|
3640
|
-
flex: 1,
|
|
3639
|
+
children: /* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
3641
3640
|
children: props.renderDefault(props)
|
|
3642
3641
|
})
|
|
3643
3642
|
});
|
|
@@ -4230,7 +4229,40 @@ const documentInstructionStatus = sanity.defineType({
|
|
|
4230
4229
|
}]
|
|
4231
4230
|
})]
|
|
4232
4231
|
});
|
|
4233
|
-
|
|
4232
|
+
function excludeComments(type) {
|
|
4233
|
+
var _a, _b, _c;
|
|
4234
|
+
const existingRender = (_a = type == null ? void 0 : type.components) == null ? void 0 : _a.field;
|
|
4235
|
+
return {
|
|
4236
|
+
...type,
|
|
4237
|
+
...("components" in type ? {
|
|
4238
|
+
components: {
|
|
4239
|
+
...type.components,
|
|
4240
|
+
field: props => {
|
|
4241
|
+
const newProps = {
|
|
4242
|
+
...props,
|
|
4243
|
+
...{
|
|
4244
|
+
__internal_comments: void 0
|
|
4245
|
+
}
|
|
4246
|
+
};
|
|
4247
|
+
if (typeof existingRender === "function") {
|
|
4248
|
+
return existingRender(newProps);
|
|
4249
|
+
}
|
|
4250
|
+
return props.renderDefault(newProps);
|
|
4251
|
+
}
|
|
4252
|
+
}
|
|
4253
|
+
} : {}),
|
|
4254
|
+
...("fields" in type ? {
|
|
4255
|
+
// recursively disable comments in fields
|
|
4256
|
+
fields: (_b = type.fields) == null ? void 0 : _b.map(field => excludeComments(field))
|
|
4257
|
+
} : {}),
|
|
4258
|
+
...("of" in type ? {
|
|
4259
|
+
// recursively disable comments in array items
|
|
4260
|
+
of: (_c = type.of) == null ? void 0 : _c.map(arrayItemType => excludeComments(arrayItemType))
|
|
4261
|
+
} : {})
|
|
4262
|
+
};
|
|
4263
|
+
}
|
|
4264
|
+
const instructionForm = [fieldInstructions, instruction, fieldReference, prompt, userInput, promptContext].map(excludeComments);
|
|
4265
|
+
const schemaTypes = [...instructionForm, assistDocumentSchema, documentInstructionStatus, instructionTask, contextDocumentSchema];
|
|
4234
4266
|
function useAssistSupported(path, schemaType) {
|
|
4235
4267
|
return react.useMemo(() => isAssistSupported(schemaType), [schemaType]);
|
|
4236
4268
|
}
|