@sanity/block-insert-picker
1.0.41.0.5
dist/index.js~
dist/index.jsModified+12−9
Index: package/dist/index.js
===================================================================
--- package/dist/index.js
+++ package/dist/index.js
@@ -1,7 +1,10 @@
+import "@sanity/ui/styles.css";
import { c } from "react/compiler-runtime";
import { useEditor } from "@portabletext/editor";
-import { Box, Card, Flex, Hotkeys, Popover, Stack, Text, useToast } from "@sanity/ui";
+import { Box, Card, Flex, Hotkeys, Stack, Text } from "@sanity/ui";
+import { Popover } from "@sanity/ui/popover";
+import { useToast } from "@sanity/ui/toast";
import { useContext, useEffect, useId, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
import { useFormCallbacks, useResolveInitialValueForType, useSchema } from "sanity";
import { defineBehavior, effect, forward, raise } from "@portabletext/editor/behaviors";
import { blockOffsetsToSelection, getTextBlockText, isTextBlock } from "@portabletext/editor/utils";
@@ -507,18 +510,18 @@
matchText: match.text
}),
_key: keyGenerator(),
_type: config.blockType
- };
+ }, at = blockOffsetsToSelection({
+ offsets: {
+ anchor: match.targetOffsets.anchor,
+ focus: match.targetOffsets.focus
+ },
+ snapshot
+ }) ?? match.selection;
return [
raise({
- at: blockOffsetsToSelection({
- offsets: {
- anchor: match.targetOffsets.anchor,
- focus: match.targetOffsets.focus
- },
- snapshot
- }) ?? match.selection,
+ at,
type: "delete.text"
}),
raise({
block,