@sanity/vision 6.24.0 → 6.25.0-next.114

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.
@@ -1,8 +1,8 @@
1
- import { useEffect, useRef } from "react";
2
1
  import { c } from "react/compiler-runtime";
2
+ import { FileDiff } from "@pierre/diffs";
3
3
  import { useTheme_v2 } from "@sanity/ui";
4
+ import { useEffect, useRef } from "react";
4
5
  import { jsx } from "react/jsx-runtime";
5
- import { FileDiff } from "@pierre/diffs";
6
6
  /**
7
7
  * Line diff of two texts, rendered by `@pierre/diffs` (Shiki highlighting in a shadow root).
8
8
  * Only loaded through `lazy()` once a history entry's changes are expanded.
@@ -58,4 +58,4 @@ function CodeDiff(t0) {
58
58
  }
59
59
  export { CodeDiff as default };
60
60
 
61
- //# sourceMappingURL=CodeDiff-MkS3Q87A.js.map
61
+ //# sourceMappingURL=CodeDiff-DifKYT2A.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodeDiff-MkS3Q87A.js","names":["{previous, next, lang}: CodeDiffProps","{name: `diff.${lang}`, contents: previous, lang}","`diff.${lang}`","useMemo<FileContents>(\n () => ({name: `diff.${lang}`, contents: previous, lang}),\n [lang, previous],\n )","{name: `diff.${lang}`, contents: next, lang}","useMemo<FileContents>(\n () => ({name: `diff.${lang}`, contents: next, lang}),\n [lang, next],\n )","() => {\n const wrapper = wrapperRef.current\n if (!wrapper) return undefined\n const diff = new FileDiff({\n diffStyle: 'unified',\n // Thrown from `render` in this effect, a failure reaches the History panel's error\n // boundary and its Retry, rather than being drawn as a stack trace inside the diff\n disableErrorHandling: true,\n disableFileHeader: true,\n lineDiffType: 'word',\n overflow: 'wrap',\n themeType,\n })\n diff.render({containerWrapper: wrapper, newFile, oldFile})\n return () => diff.cleanUp()\n }","[newFile, oldFile, themeType]","<div ref={wrapperRef} style={style} />","family","`${codeSize.fontSize}px`","`${codeSize.lineHeight}px`","useThemeV2","_jsx"],"sources":["../src/redesign/components/response/CodeDiff.tsx"],"sourcesContent":["import {type FileContents, FileDiff} from '@pierre/diffs'\nimport {useTheme_v2 as useThemeV2} from '@sanity/ui'\nimport {type CSSProperties, useEffect, useMemo, useRef} from 'react'\n\n/** The custom properties `@pierre/diffs` styles its markup with */\ninterface DiffsStyle extends CSSProperties {\n '--diffs-font-family': string\n '--diffs-font-size': string\n '--diffs-line-height': string\n}\n\nexport interface CodeDiffProps {\n previous: string\n next: string\n lang: 'json' | 'text'\n}\n\n/**\n * Line diff of two texts, rendered by `@pierre/diffs` (Shiki highlighting in a shadow root).\n * Only loaded through `lazy()` once a history entry's changes are expanded.\n */\nexport default function CodeDiff({previous, next, lang}: CodeDiffProps) {\n const {color, font} = useThemeV2()\n const codeSize = font.code.sizes[1]\n const wrapperRef = useRef<HTMLDivElement>(null)\n const oldFile = useMemo<FileContents>(\n () => ({name: `diff.${lang}`, contents: previous, lang}),\n [lang, previous],\n )\n const newFile = useMemo<FileContents>(\n () => ({name: `diff.${lang}`, contents: next, lang}),\n [lang, next],\n )\n const themeType = color._dark ? 'dark' : 'light'\n\n // The library's React components keep their container and hydrate whatever markup a previous\n // instance left in it, so after StrictMode detaches and re-attaches their ref they render\n // nothing. An instance per effect run with a container of its own (removed on clean up) has no\n // such markup to find\n useEffect(() => {\n const wrapper = wrapperRef.current\n if (!wrapper) return undefined\n const diff = new FileDiff({\n diffStyle: 'unified',\n // Thrown from `render` in this effect, a failure reaches the History panel's error\n // boundary and its Retry, rather than being drawn as a stack trace inside the diff\n disableErrorHandling: true,\n disableFileHeader: true,\n lineDiffType: 'word',\n overflow: 'wrap',\n themeType,\n })\n diff.render({containerWrapper: wrapper, newFile, oldFile})\n return () => diff.cleanUp()\n }, [newFile, oldFile, themeType])\n\n const style: DiffsStyle = {\n '--diffs-font-family': font.code.family,\n '--diffs-font-size': `${codeSize.fontSize}px`,\n '--diffs-line-height': `${codeSize.lineHeight}px`,\n }\n\n return <div ref={wrapperRef} style={style} />\n}\n"],"mappings":";;;;;;;;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EAHzB,IAAM,QAAoB;GACxB,uBAAuB,KAAK,KAAK;GACjC,qBAAqBD;GACrB,uBAAuBC;EACzB;EAEO,KAAAE,oBAAC,OAAD;GAAK,KAAK;GAAmB;EAAQ,CAAA,GALTJ,EAAAA,MAAAA,KAAL,KAAK,QACZC,EAAAA,MAAAA,IACEC,EAAAA,MAAAA,I;;CAGzB,OAAOH;AACT"}
1
+ {"version":3,"file":"CodeDiff-DifKYT2A.js","names":["{previous, next, lang}: CodeDiffProps","{name: `diff.${lang}`, contents: previous, lang}","`diff.${lang}`","useMemo<FileContents>(\n () => ({name: `diff.${lang}`, contents: previous, lang}),\n [lang, previous],\n )","{name: `diff.${lang}`, contents: next, lang}","useMemo<FileContents>(\n () => ({name: `diff.${lang}`, contents: next, lang}),\n [lang, next],\n )","() => {\n const wrapper = wrapperRef.current\n if (!wrapper) return undefined\n const diff = new FileDiff({\n diffStyle: 'unified',\n // Thrown from `render` in this effect, a failure reaches the History panel's error\n // boundary and its Retry, rather than being drawn as a stack trace inside the diff\n disableErrorHandling: true,\n disableFileHeader: true,\n lineDiffType: 'word',\n overflow: 'wrap',\n themeType,\n })\n diff.render({containerWrapper: wrapper, newFile, oldFile})\n return () => diff.cleanUp()\n }","[newFile, oldFile, themeType]","<div ref={wrapperRef} style={style} />","family","`${codeSize.fontSize}px`","`${codeSize.lineHeight}px`","useThemeV2","_jsx"],"sources":["../src/redesign/components/response/CodeDiff.tsx"],"sourcesContent":["import {type FileContents, FileDiff} from '@pierre/diffs'\nimport {useTheme_v2 as useThemeV2} from '@sanity/ui'\nimport {type CSSProperties, useEffect, useMemo, useRef} from 'react'\n\n/** The custom properties `@pierre/diffs` styles its markup with */\ninterface DiffsStyle extends CSSProperties {\n '--diffs-font-family': string\n '--diffs-font-size': string\n '--diffs-line-height': string\n}\n\nexport interface CodeDiffProps {\n previous: string\n next: string\n lang: 'json' | 'text'\n}\n\n/**\n * Line diff of two texts, rendered by `@pierre/diffs` (Shiki highlighting in a shadow root).\n * Only loaded through `lazy()` once a history entry's changes are expanded.\n */\nexport default function CodeDiff({previous, next, lang}: CodeDiffProps) {\n const {color, font} = useThemeV2()\n const codeSize = font.code.sizes[1]\n const wrapperRef = useRef<HTMLDivElement>(null)\n const oldFile = useMemo<FileContents>(\n () => ({name: `diff.${lang}`, contents: previous, lang}),\n [lang, previous],\n )\n const newFile = useMemo<FileContents>(\n () => ({name: `diff.${lang}`, contents: next, lang}),\n [lang, next],\n )\n const themeType = color._dark ? 'dark' : 'light'\n\n // The library's React components keep their container and hydrate whatever markup a previous\n // instance left in it, so after StrictMode detaches and re-attaches their ref they render\n // nothing. An instance per effect run with a container of its own (removed on clean up) has no\n // such markup to find\n useEffect(() => {\n const wrapper = wrapperRef.current\n if (!wrapper) return undefined\n const diff = new FileDiff({\n diffStyle: 'unified',\n // Thrown from `render` in this effect, a failure reaches the History panel's error\n // boundary and its Retry, rather than being drawn as a stack trace inside the diff\n disableErrorHandling: true,\n disableFileHeader: true,\n lineDiffType: 'word',\n overflow: 'wrap',\n themeType,\n })\n diff.render({containerWrapper: wrapper, newFile, oldFile})\n return () => diff.cleanUp()\n }, [newFile, oldFile, themeType])\n\n const style: DiffsStyle = {\n '--diffs-font-family': font.code.family,\n '--diffs-font-size': `${codeSize.fontSize}px`,\n '--diffs-line-height': `${codeSize.lineHeight}px`,\n }\n\n return <div ref={wrapperRef} style={style} />\n}\n"],"mappings":";;;;;;;;;AAqBA,SAAwB,SAAA,IAAgD;C,eAAvC,EAAC,UAAU,MAAM,SAAjBA,IACzB,EAAC,OAAO,SAAQY,YAAW,GAC3B,WAAW,KAAK,KAAK,MAAM,IAC3B,aAAa,OAAuB,IAAI,GAE9B,KAAA,QAAQ,QAAfX;CAA2C,EAAA,OAAA,QAAA,EAAA,OAAV,YAAA,EAAA,OAA1BC,MAAP,KAAA;EAAC,MAAMA;EAAgB,UAAU;EAAU;CAAI,GAAJ,EAAA,KAAA,MAAV,EAAA,KAAA,UAA1BA,EAAAA,KAAAA,I;CADhB,IAAM,UAAUC,IAKA,KAAA,QAAQ,QAAfC;CAAuC,EAAA,OAAA,QAAA,EAAA,OAAN,QAAA,EAAA,OAA1BF,MAAP,KAAA;EAAC,MAAMA;EAAgB,UAAU;EAAM;CAAI,GAAJ,EAAA,KAAA,MAAN,EAAA,KAAA,MAA1BA,EAAAA,KAAAA,I;CADhB,IAAM,UAAUG,IAIV,YAAY,MAAM,QAAQ,SAAS,SAM/BC,IAePC;CAFuC,EAAA,OAAA,WAAA,EAAA,OAAS,WAAA,EAAA,QAF/C,aAXM,WAAM;EACd,IAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,IAAM,OAAO,IAAI,SAAS;GACxB,WAAW;GAGX,sBAAsB;GACtB,mBAAmB;GACnB,cAAc;GACd,UAAU;GACV;EACF,CAAC;EAED,OADA,KAAK,OAAO;GAAC,kBAAkB;GAAS;GAAS;EAAO,CAAC,SAC5C,KAAK,QAAQ;CAC5B,GAAG,KAAA;EAAC;EAAS;EAAS;CAAS,GAFW,EAAA,KAAA,SAAS,EAAA,KAAA,SAF/C,EAAA,MAAA,W,oDAXJ,UAAUD,IAePC,EAA6B;CAIT,IAAA,KAAA,GAAG,SAAS,SAAS,KACnB,KAAA,GAAG,SAAS,WAAW,KAGzCC;CAL4BC,IAAAA,EAAAA,QAAAA,KAAL,KAAK,UAAA,EAAA,QACZC,MAAAA,EAAAA,QACEC,IAAAA;EAHzB,IAAM,QAAoB;GACxB,uBAAuB,KAAK,KAAK;GACjC,qBAAqBD;GACrB,uBAAuBC;EACzB;EAEO,KAAAE,oBAAC,OAAD;GAAK,KAAK;GAAmB;EAAQ,CAAA,GALTJ,EAAAA,MAAAA,KAAL,KAAK,QACZC,EAAAA,MAAAA,IACEC,EAAAA,MAAAA,I;;CAGzB,OAAOH;AACT"}
@@ -1,14 +1,12 @@
1
- import { t as visionLocaleNamespace } from "./i18n-CaGatdZX.js";
2
- import { Component, Fragment, Suspense, createContext, lazy, use, useEffect, useImperativeHandle, useRef, useState, useSyncExternalStore } from "react";
3
- import { ContextMenuButton, RELEASES_STUDIO_CLIENT_OPTIONS, Translate, UserAvatar, VARIANTS_STUDIO_CLIENT_OPTIONS, getDefaultVariant, getReleaseIdFromReleaseDocumentId, getVariantTitle, isCardinalityOneRelease, sortReleases, useActiveReleases, useClient, useCurrentUser, useDataset, useDateTimeFormat, usePerspective, useScheduledDraftsEnabled, useTranslation, useWorkspace } from "sanity";
4
- import { IntentLink } from "sanity/router";
5
1
  import { c } from "react/compiler-runtime";
2
+ import { ContextMenuButton, RELEASES_STUDIO_CLIENT_OPTIONS, Translate, UserAvatar, VARIANTS_STUDIO_CLIENT_OPTIONS, getDefaultVariant, getReleaseIdFromReleaseDocumentId, getVariantTitle, isCardinalityOneRelease, sortReleases, useActiveReleases, useClient, useCurrentUser, useDataset, useDateTimeFormat, usePerspective, useScheduledDraftsEnabled, useTranslation, useWorkspace } from "sanity";
6
3
  import { SplitPane } from "@rexxars/react-split-pane";
7
4
  import { ChevronLeftIcon } from "@sanity/icons/ChevronLeft";
8
5
  import { ChevronRightIcon } from "@sanity/icons/ChevronRight";
9
6
  import { Badge, Button, Card, Dialog, Heading, Hotkeys, Inline, Label, Select, Spinner, Stack, Tab, TabList, TextInput, rem, useClickOutsideEvent, useTheme, useTheme_v2 } from "@sanity/ui";
10
7
  import { useToast } from "@sanity/ui/toast";
11
8
  import { isHotkey } from "is-hotkey-esm";
9
+ import { Component, Fragment, Suspense, createContext, lazy, use, useEffect, useImperativeHandle, useRef, useState, useSyncExternalStore } from "react";
12
10
  import { Box, Container, Flex, Grid, Icon, Link, Text, VStack } from "ui5";
13
11
  import { useEffectEvent } from "use-effect-event";
14
12
  import { closeBrackets } from "@codemirror/autocomplete";
@@ -23,6 +21,7 @@ import CodeMirror, { EditorSelection as EditorSelection$1 } from "@uiw/react-cod
23
21
  import { tags } from "@lezer/highlight";
24
22
  import { hues } from "@sanity/color";
25
23
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
24
+ import { t as visionLocaleNamespace } from "./i18n-CH5kDMvo.js";
26
25
  import { useTelemetry } from "@sanity/telemetry/react";
27
26
  import { defineEvent } from "@sanity/telemetry";
28
27
  import { ErrorOutlineIcon } from "@sanity/icons/ErrorOutline";
@@ -51,6 +50,7 @@ import { isHttpError } from "@sanity/client";
51
50
  import { JsonInspector } from "@rexxars/react-json-inspector";
52
51
  import { LinkIcon } from "@sanity/icons/Link";
53
52
  import LRU from "quick-lru";
53
+ import { IntentLink } from "sanity/router";
54
54
  import { DocumentSheetIcon } from "@sanity/icons/DocumentSheet";
55
55
  import { useObservablePromise } from "react-rx";
56
56
  import { catchError, map, of } from "rxjs";
@@ -3583,7 +3583,7 @@ function createRetryableLazy(load) {
3583
3583
  };
3584
3584
  }
3585
3585
  var SanityVision_exports = /* @__PURE__ */ __exportAll({ default: () => SanityVision });
3586
- const visionRedesign = createRetryableLazy(() => import("./VisionRedesign-Bbv4UYJV.js").then((module) => ({ default: module.VisionRedesign }))), VisionRedesignLoader = visionRedesign.Component;
3586
+ const visionRedesign = createRetryableLazy(() => import("./VisionRedesign-DxPHzD3J.js").then((module) => ({ default: module.VisionRedesign }))), VisionRedesignLoader = visionRedesign.Component;
3587
3587
  function SanityVision(props) {
3588
3588
  let $ = c(31), t0;
3589
3589
  $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { apiVersion: "1" }, $[0] = t0) : t0 = $[0];
@@ -3636,4 +3636,4 @@ function SanityVision(props) {
3636
3636
  }
3637
3637
  export { DEFAULT_API_VERSION as A, getActivePerspective as C, paramsExtensions as D, groqExtensions as E, prefixApiVersion as M, resultJsonExtensions as O, encodeQueryString as S, VisionCodeMirror as T, VISION_STORAGE_KEY_PREFIX as _, getAtKeypath as a, isPlainObject as b, DelayedSpinner as c, getJsonBlobUrl as d, SanityVision as default, useSavedQueries as f, validateApiVersion as g, parseQueryUrl as h, describeKeypath as i, VARIANTS_API_VERSION as j, API_VERSIONS as k, canEncodeCsv as l, isApiCdnHost as m, createRetryableLazy as n, QueryErrorDialog as o, parseParams as p, ResultView as r, isApiVersionBelow as s, SanityVision_exports as t, getCsvBlobUrl as u, getStorage as v, useVariantsEnabled as w, isVisionPasteTarget as x, onLocalStorageCleared as y };
3638
3638
 
3639
- //# sourceMappingURL=SanityVision-Byzvd4p6.js.map
3639
+ //# sourceMappingURL=SanityVision-DCqnoRwb.js.map