@sanity/assist
6.1.186.1.19
dist/index.js~
dist/index.jsModified+11−9
Index: package/dist/index.js
===================================================================
--- package/dist/index.js
+++ package/dist/index.js
@@ -3457,11 +3457,13 @@
children: customActions,
expanded: !0
}] : []) ?? [];
}, [
+ addSyntheticTask,
configActions,
fieldActions,
- pushToast
+ pushToast,
+ removeSyntheticTask
]);
}
function createSafeNode(args) {
let { node } = args;
@@ -4476,9 +4478,9 @@
}), $[16] = t3, $[17] = t6, $[18] = t7) : t7 = $[18], t7;
}
const PteMods = styled(Box).withConfig({
displayName: "PteMods",
- componentId: "sc-t797c-0"
+ componentId: "sc-lrz2c-0"
})`& [data-testid='pt-editor__toolbar-card'] > div > div:last-child{display:none;}& [data-testid='pt-editor']{min-height:300px;}& [data-testid='pt-editor'] .pt-inline-object *{max-width:400px;}`;
function PromptInput(props) {
let $ = c(5);
useOnlyInlineBlocks(props);
@@ -4508,22 +4510,22 @@
children: [t0, t1]
}) }), $[3] = t1, $[4] = t2), t2;
}
function useOnlyInlineBlocks(props) {
- let $ = c(3), t0;
- $[0] === props ? t0 = $[1] : (t0 = () => {
- let needsFix = !1, val = (props.value ?? []).map((block) => block._type === "block" ? block : (needsFix = !0, typed({
+ let $ = c(4), { value, onChange } = props, didRunRef = useRef(!1), t0, t1;
+ $[0] !== onChange || $[1] !== value ? (t0 = () => {
+ if (didRunRef.current) return;
+ didRunRef.current = !0;
+ let needsFix = !1, val = (value ?? []).map((block) => block._type === "block" ? block : (needsFix = !0, typed({
_key: randomKey(12),
_type: "block",
level: 0,
markDefs: [],
style: "normal",
children: [block]
})));
- needsFix && props.onChange(set(val));
- }, $[0] = props, $[1] = t0);
- let t1;
- $[2] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[2] = t1) : t1 = $[2], useEffect(t0, t1);
+ needsFix && onChange(set(val));
+ }, t1 = [onChange, value], $[0] = onChange, $[1] = value, $[2] = t0, $[3] = t1) : (t0 = $[2], t1 = $[3]), useEffect(t0, t1);
}
function InstructionsArrayField(props) {
return props.renderDefault({
...props,