@sanity/vision 6.9.1-next.7 → 6.9.1-next.9

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,5 +1,5 @@
1
1
  import { t as visionLocaleNamespace } from "./i18n-DWd7qwtK.js";
2
- import { Component, Fragment, Suspense, forwardRef, use, useEffect, useImperativeHandle, useRef, useState } from "react";
2
+ import { Component, Fragment, Suspense, use, useEffect, useImperativeHandle, useRef, useState } from "react";
3
3
  import { ContextMenuButton, Translate, UserAvatar, getReleaseIdFromReleaseDocumentId, isCardinalityOneRelease, sortReleases, useActiveReleases, useClient, useCurrentUser, useDataset, useDateTimeFormat, useKeyValueStore, usePerspective, useScheduledDraftsEnabled, useTranslation, useWorkspace } from "sanity";
4
4
  import { IntentLink } from "sanity/router";
5
5
  import { c } from "react/compiler-runtime";
@@ -239,9 +239,9 @@ function EditorRoot(t0) {
239
239
  children
240
240
  }), $[10] = children, $[11] = t7, $[12] = t8) : t8 = $[12], t8;
241
241
  }
242
- const VisionCodeMirror = forwardRef((props, ref) => {
243
- let $ = c(8), [initialValue] = useState(props.initialValue), theme = useCodemirrorTheme(useTheme()), codeMirrorRef = useRef(null), t0;
244
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = (newContent) => {
242
+ function VisionCodeMirror(t0) {
243
+ let $ = c(8), { ref, onChange, initialValue: initialValueProp, extensions } = t0, [initialValue] = useState(initialValueProp), theme = useCodemirrorTheme(useTheme()), codeMirrorRef = useRef(null), t1;
244
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = (newContent) => {
245
245
  let editorView = codeMirrorRef.current?.view;
246
246
  if (!editorView) return;
247
247
  let currentDoc = editorView.state.doc.toString();
@@ -253,20 +253,19 @@ const VisionCodeMirror = forwardRef((props, ref) => {
253
253
  },
254
254
  selection: EditorSelection.cursor(newContent.length)
255
255
  });
256
- }, $[0] = t0) : t0 = $[0];
257
- let resetEditorContent = t0, t1, t2;
258
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ({ resetEditorContent }), t2 = [resetEditorContent], $[1] = t1, $[2] = t2) : (t1 = $[1], t2 = $[2]), useImperativeHandle(ref, t1, t2);
259
- let t3;
260
- return $[3] !== initialValue || $[4] !== props.extensions || $[5] !== props.onChange || $[6] !== theme ? (t3 = /* @__PURE__ */ jsx(EditorRoot, { children: /* @__PURE__ */ jsx(CodeMirror, {
256
+ }, $[0] = t1) : t1 = $[0];
257
+ let resetEditorContent = t1, t2, t3;
258
+ $[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ({ resetEditorContent }), t3 = [resetEditorContent], $[1] = t2, $[2] = t3) : (t2 = $[1], t3 = $[2]), useImperativeHandle(ref, t2, t3);
259
+ let t4;
260
+ return $[3] !== extensions || $[4] !== initialValue || $[5] !== onChange || $[6] !== theme ? (t4 = /* @__PURE__ */ jsx(EditorRoot, { children: /* @__PURE__ */ jsx(CodeMirror, {
261
261
  ref: codeMirrorRef,
262
262
  basicSetup: !1,
263
263
  theme,
264
- extensions: props.extensions,
264
+ extensions,
265
265
  value: initialValue,
266
- onChange: props.onChange
267
- }) }), $[3] = initialValue, $[4] = props.extensions, $[5] = props.onChange, $[6] = theme, $[7] = t3) : t3 = $[7], t3;
268
- });
269
- VisionCodeMirror.displayName = "VisionCodeMirror";
266
+ onChange
267
+ }) }), $[3] = extensions, $[4] = initialValue, $[5] = onChange, $[6] = theme, $[7] = t4) : t4 = $[7], t4;
268
+ }
270
269
  const SUPPORTED_PERSPECTIVES = [
271
270
  "pinnedRelease",
272
271
  "scheduledDrafts",
@@ -380,14 +379,16 @@ function tryParseParams(val, t) {
380
379
  }
381
380
  }
382
381
  var controlsContainer = "ior2o0m", downloadsCard = "ior2o0j", header = "ior2o03", inputBackgroundContainer = "ior2o07", inputBackgroundContainerLeft = "ior2o08", inputContainer = "ior2o09", queryCopyLink = "ior2o06", queryRecallPaneContainer = "ior2o01", queryRecallPaneWrapper = "ior2o02", result = "ior2o0e", resultContainer = "ior2o0c", resultContainerInvalid = "ior2o0d", resultFooter = "ior2o0f", resultInnerContainer = "ior2o0b", resultOuterContainer = "ior2o0a", root = "ior2o00", saveResultLabel = "ior2o0l", saveResultSpanGapVar = "var(--ior2o0k)", splitpaneContainer = "ior2o05", styledLabel = "ior2o04", timingsCard = "ior2o0g", timingsTextContainer = "ior2o0i", timingsTextMinHeightVar = "var(--ior2o0h)";
383
- const Root = forwardRef(function Root(props, ref) {
384
- let $ = c(3), t0;
385
- return $[0] !== props || $[1] !== ref ? (t0 = /* @__PURE__ */ jsx(Flex, {
382
+ function Root(t0) {
383
+ let $ = c(6), props, ref;
384
+ $[0] === t0 ? (props = $[1], ref = $[2]) : ({ref, ...props} = t0, $[0] = t0, $[1] = props, $[2] = ref);
385
+ let t1;
386
+ return $[3] !== props || $[4] !== ref ? (t1 = /* @__PURE__ */ jsx(Flex, {
386
387
  ...props,
387
388
  ref,
388
389
  className: root
389
- }), $[0] = props, $[1] = ref, $[2] = t0) : t0 = $[2], t0;
390
- });
390
+ }), $[3] = props, $[4] = ref, $[5] = t1) : t1 = $[5], t1;
391
+ }
391
392
  function Header(props) {
392
393
  let $ = c(2), t0;
393
394
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Card, {
@@ -2768,4 +2769,4 @@ function SanityVision(props) {
2768
2769
  }
2769
2770
  export { SanityVision as default };
2770
2771
 
2771
- //# sourceMappingURL=SanityVision-CQ0yUM4l.js.map
2772
+ //# sourceMappingURL=SanityVision-DgxlA77B.js.map