@sanity/assist 6.0.0 → 6.0.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.
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { pathToString, isVersionId, getVersionFromId, getPublishedId, useEditSta
|
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { useToast, useLayer, Dialog, Stack, Flex, Tooltip, Text, Button, TextArea, Card, Box, ErrorBoundary, focusFirstDescendant, Spinner, Container, Autocomplete, Breadcrumbs, useClickOutside, Popover, useGlobalKeyDown, useTheme, rgba, Checkbox, Radio, ThemeProvider, MenuButton, MenuItem, Menu, Switch, Label } from "@sanity/ui";
|
|
5
5
|
import { useDocumentPane, usePaneRouter, DocumentPaneProvider, DocumentInspectorHeader } from "sanity/structure";
|
|
6
|
-
import { useRef, useState, useEffect, createContext, useContext, useCallback, useId, forwardRef, useMemo,
|
|
6
|
+
import { useRef, useState, useEffect, createContext, useContext, useCallback, useId, forwardRef, useMemo, useReducer } from "react";
|
|
7
7
|
import { minutesToMilliseconds, isAfter, addSeconds, formatDistanceToNow } from "date-fns";
|
|
8
8
|
import { DocumentIcon, LinkIcon, ImageIcon, BlockContentIcon, OlistIcon, BlockquoteIcon, StringIcon, PlayIcon, SparklesIcon, SearchIcon, SyncIcon, ErrorOutlineIcon, CheckmarkCircleIcon, ClockIcon, CloseCircleIcon, ArrowRightIcon, RetryIcon, CloseIcon, icons, TranslateIcon, LockIcon, ControlsIcon, ArrowLeftIcon, TokenIcon, DocumentTextIcon, ThListIcon, CodeIcon, ComposeIcon } from "@sanity/icons";
|
|
9
9
|
import { extractWithPath } from "@sanity/mutator";
|
|
@@ -1757,7 +1757,7 @@ function _temp3$2(option) {
|
|
|
1757
1757
|
field: field_1
|
|
1758
1758
|
} = option;
|
|
1759
1759
|
return value ? isType(field_1.schemaType, "document") ? /* @__PURE__ */ jsx(Card, { as: "button", padding: 3, radius: 1, children: /* @__PURE__ */ jsx(Text, { size: 1, weight: "semibold", children: "The entire document" }) }) : /* @__PURE__ */ jsx(Card, { as: "button", padding: 3, radius: 1, children: /* @__PURE__ */ jsxs(Flex, { gap: 3, children: [
|
|
1760
|
-
/* @__PURE__ */ jsx(Text, { size: 1, children:
|
|
1760
|
+
/* @__PURE__ */ jsx(Text, { size: 1, children: /* @__PURE__ */ jsx(field_1.icon, {}) }),
|
|
1761
1761
|
/* @__PURE__ */ jsx(FieldTitle, { field: field_1 })
|
|
1762
1762
|
] }) }) : /* @__PURE__ */ jsx(Card, { as: "button", padding: 3, radius: 1, children: /* @__PURE__ */ jsx(Text, { accent: !0, size: 1, children: option.value }) });
|
|
1763
1763
|
}
|
|
@@ -1920,9 +1920,9 @@ function _temp$6(task) {
|
|
|
1920
1920
|
function TaskItem(props) {
|
|
1921
1921
|
const $ = c(32), {
|
|
1922
1922
|
task
|
|
1923
|
-
} = props, taskType = task.reason && TASK_CONFIG[task.reason], t0 = taskType && taskType?.tone;
|
|
1923
|
+
} = props, taskType = task.reason && TASK_CONFIG[task.reason], TaskIcon = taskType ? taskType.icon : null, t0 = taskType && taskType?.tone;
|
|
1924
1924
|
let t1;
|
|
1925
|
-
$[0] !==
|
|
1925
|
+
$[0] !== TaskIcon ? (t1 = TaskIcon && /* @__PURE__ */ jsx(TaskIcon, {}), $[0] = TaskIcon, $[1] = t1) : t1 = $[1];
|
|
1926
1926
|
let t2;
|
|
1927
1927
|
$[2] !== task.reason ? (t2 = !task.reason && /* @__PURE__ */ jsx(Spinner, {}), $[2] = task.reason, $[3] = t2) : t2 = $[3];
|
|
1928
1928
|
let t3;
|
|
@@ -4348,11 +4348,14 @@ const contextDocumentSchema = defineType({
|
|
|
4348
4348
|
},
|
|
4349
4349
|
components: {
|
|
4350
4350
|
input: InstructionInput,
|
|
4351
|
-
preview: (props) =>
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4351
|
+
preview: (props) => {
|
|
4352
|
+
const Icon = props.icon;
|
|
4353
|
+
return /* @__PURE__ */ jsxs(Flex, { gap: 3, align: "center", padding: 2, children: [
|
|
4354
|
+
Icon && /* @__PURE__ */ jsx(Box, { flex: "none", children: /* @__PURE__ */ jsx(Text, { size: 1, children: /* @__PURE__ */ jsx(Icon, {}) }) }),
|
|
4355
|
+
/* @__PURE__ */ jsx(Stack, { flex: 1, space: 2, children: /* @__PURE__ */ jsx(Text, { size: 1, textOverflow: "ellipsis", weight: "medium", children: getInstructionTitle(props) }) }),
|
|
4356
|
+
props.userId && /* @__PURE__ */ jsx(Text, { size: 1, children: /* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(Text, { size: 1, children: "Only visible to you" }), padding: 2, placement: "top", portal: !0, children: /* @__PURE__ */ jsx(LockIcon, {}) }) })
|
|
4357
|
+
] });
|
|
4358
|
+
}
|
|
4356
4359
|
},
|
|
4357
4360
|
fields: [defineField({
|
|
4358
4361
|
type: prompt.name,
|