@sanity/assist 6.1.19 → 6.1.20

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.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import "@sanity/ui/styles.css";
2
2
  import { CurrentUser, DocumentFieldActionDivider, DocumentFieldActionGroup, DocumentFieldActionItem, ObjectSchemaType, Path, SanityClient, SanityDocumentLike, SchemaType } from "sanity";
3
- import { SanityClient as SanityClient$1 } from "@sanity/client";
4
- import { AgentActionPath } from "@sanity/client/stega";
3
+ import { AgentActionPath, SanityClient as SanityClient$1 } from "@sanity/client";
5
4
  import { PortableTextBlock, PortableTextMarkDefinition, PortableTextSpan } from "@portabletext/types";
6
5
  interface AssistConfig {
7
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/assistTypes.ts","../src/fieldActions/customFieldActions.tsx","../src/translate/types.ts","../src/types.ts","../src/plugin.tsx","../src/schemas/serialize/SchemTypeTool.tsx","../src/schemas/typeDefExtensions.ts","../src/translate/paths.ts","../src/fieldActions/useUserInput.ts","../src/helpers/typeUtils.ts"],"mappings":";;;;;UAEiB;;;;;;;;;;;;;;;;;;EAkBf,kBAAkB,SAAS,0BAA0B;;;;;;;;;;;;;;;;EAiBrD;;;;;;;;;;;;;EAcA;;UAGe;EACf,MAAM;EACN,iBAAiB;;UAGF;;;;;;;;;;EAUf;;;;;;;;;;;EAYA;;UCvDe;EACf,MAAM;EACN;EACA;;UAGe;;;;;EAKf;;;;;;;;;;;;;;;;;;EAkBA;;;;;EAMA,oBAAoB;;;;;;;EAQpB,wBAAwB;;;;;;EAOxB,2BAA2B;;;;;;;;;;;;;;;;;;;;;;EAuB3B;;;;;;;;;;;;;;;;;;;;;EAsBA,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;EA0BN,YAAY;;;;;;;;;EAUZ,mBAAmB;;KAGT,wBACR,wBACA,yBACA;KAEQ,wBAAwB,KACl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BCvCH,kCAAc,IAAA;UCXb;EACf;;IAEE;;;;;IAMA;;;;YAKQ,qBAAqB;YACrB,qBAAqB;YACrB,uBAAuB;YACvB,qCAAqC;YACrC,oBAAoB;YACpB,wBAAwB;YACxB,wBAAwB;YACxB,oBAAoB;YACpB,wBAAwB;YACxB;IACR,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAmCT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgCA;QAGM;;;;;;;QAOA;;;;YAIA,sBAAsB;YACtB,sBAAsB;YACtB;IACR;;MAEE;;;;;MAMA;;;YAGM,oBAAoB;YACpB,sBAAsB;YACtB,oBAAoB;YACpB,mBAAmB;YACnB,qBAAqB;;cCUpB,wBAAwB;KCrIzB,gBAAgB;;;;EAI1B;;;;EAIA,QAAQ;MACJ,QAAQ;;;;UAKG;;;;EAIf;;;;EAIA;;;;EAIA;;KAGU;;;;EAIV,OAAO;;;;EAKP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+Dc,gBAAgB;;;;;;;iBC3FhB,OAAO,YAAY,YAAY"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/assistTypes.ts","../src/fieldActions/customFieldActions.tsx","../src/translate/types.ts","../src/types.ts","../src/plugin.tsx","../src/schemas/serialize/SchemTypeTool.tsx","../src/schemas/typeDefExtensions.ts","../src/translate/paths.ts","../src/fieldActions/useUserInput.ts","../src/helpers/typeUtils.ts"],"mappings":";;;;UAEiB;;;;;;;;;;;;;;;;;;EAkBf,kBAAkB,SAAS,0BAA0B;;;;;;;;;;;;;;;;EAiBrD;;;;;;;;;;;;;EAcA;;UAGe;EACf,MAAM;EACN,iBAAiB;;UAGF;;;;;;;;;;EAUf;;;;;;;;;;;EAYA;;UCvDe;EACf,MAAM;EACN;EACA;;UAGe;;;;;EAKf;;;;;;;;;;;;;;;;;;EAkBA;;;;;EAMA,oBAAoB;;;;;;;E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DY;EACf,cAAc;EACd;EAEA;;UAGe;EACf,cAAc;EACd;EAEA;EAEA;;UCpMe;EACf,YAAY;;;;EAKZ,SAAS;EAET;IACE;;;;IAIA,mBAAmB,OAAO,4BAA4B;;;;;EAMxD,qBAAqB,eAAe,mBAAiB;;;;EAKrD,YAAY,eAAe;;cAGhB,yBAAM,cAAA;iBCvCH,kCAAc,IAAA;UCXb;EACf;;IAEE;;;;;IAMA;;;;YAKQ,qBAAqB;YACrB,qBAAqB;YACrB,uBAAuB;YACvB,qCAAqC;YACrC,oBAAoB;YACpB,wBAAwB;YACxB,wBAAwB;YACxB,oBAAoB;YACpB,wBAAwB;YACxB;IACR,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAmCT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgCA;QAGM;;;;;;;QAOA;;;;YAIA,sBAAsB;YACtB,sBAAsB;YACtB;IACR;;MAEE;;;;;MAMA;;;YAGM,oBAAoB;YACpB,sBAAsB;YACtB,oBAAoB;YACpB,mBAAmB;YACnB,qBAAqB;;cCUpB,wBAAwB;KCrIzB,gBAAgB;;;;EAI1B;;;;EAIA,QAAQ;MACJ,QAAQ;;;;UAKG;;;;EAIf;;;;EAIA;;;;EAIA;;KAGU;;;;EAIV,OAAO;;;;EAKP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+Dc,gBAAgB;;;;;;;iBC3FhB,OAAO,YAAY,YAAY"}
package/dist/index.js CHANGED
@@ -887,26 +887,28 @@ function RunInstructionProvider(props) {
887
887
  }, $[4] = resolveUserInput, $[5] = t2);
888
888
  let close = t2, t3;
889
889
  $[6] !== close || $[7] !== inputs || $[8] !== resolveUserInput || $[9] !== runInstructionRequest || $[10] !== runRequest ? (t3 = () => {
890
- if (runRequest) if ("instruction" in runRequest) {
891
- let { instruction: instruction_0, userInputBlocks: _, ...request_0 } = runRequest;
892
- runInstructionRequest({
893
- ...request_0,
894
- instructionKey: instruction_0._key,
895
- userTexts: Object.entries(inputs).map(_temp3$4)
896
- });
897
- } else {
898
- let userInputs = Object.values(inputs).map((input_0, i_0) => {
899
- let userInputBlock = runRequest.userInputBlocks[i_0];
900
- return {
901
- input: {
902
- id: userInputBlock._key,
903
- title: userInputBlock.message ?? "",
904
- description: userInputBlock.description
905
- },
906
- result: input_0
907
- };
908
- });
909
- resolveUserInput?.(userInputs), setResolveUserInput(void 0);
890
+ if (runRequest) {
891
+ if ("instruction" in runRequest) {
892
+ let { instruction: instruction_0, userInputBlocks: _, ...request_0 } = runRequest;
893
+ runInstructionRequest({
894
+ ...request_0,
895
+ instructionKey: instruction_0._key,
896
+ userTexts: Object.entries(inputs).map(_temp3$4)
897
+ });
898
+ } else {
899
+ let userInputs = Object.values(inputs).map((input_0, i_0) => {
900
+ let userInputBlock = runRequest.userInputBlocks[i_0];
901
+ return {
902
+ input: {
903
+ id: userInputBlock._key,
904
+ title: userInputBlock.message ?? "",
905
+ description: userInputBlock.description
906
+ },
907
+ result: input_0
908
+ };
909
+ });
910
+ resolveUserInput?.(userInputs), setResolveUserInput(void 0);
911
+ }
910
912
  }
911
913
  close();
912
914
  }, $[6] = close, $[7] = inputs, $[8] = resolveUserInput, $[9] = runInstructionRequest, $[10] = runRequest, $[11] = t3) : t3 = $[11];
@@ -2129,10 +2131,10 @@ function isolatePathParams(nextParams, hostParams) {
2129
2131
  }
2130
2132
  const EMPTY_PANE_PARAMS = {}, CardWithShadowBelow = styled(Card).withConfig({
2131
2133
  displayName: "CardWithShadowBelow",
2132
- componentId: "sc-1m9tjp-0"
2134
+ componentId: "sc-56ewtn-0"
2133
2135
  })`position:relative;&:after{content:'';display:block;position:absolute;left:0;right:0;bottom:-1px;border-bottom:1px solid var(--card-border-color);opacity:0.5;z-index:100;}`, CardWithShadowAbove = styled(Card).withConfig({
2134
2136
  displayName: "CardWithShadowAbove",
2135
- componentId: "sc-1m9tjp-1"
2137
+ componentId: "sc-56ewtn-1"
2136
2138
  })`position:relative;&:after{content:'';display:block;position:absolute;left:0;right:0;top:-1px;border-top:1px solid var(--card-border-color);opacity:0.5;z-index:100;}`;
2137
2139
  function AssistInspectorWrapper(props) {
2138
2140
  let $ = c(43), context = useAiAssistanceConfig();
@@ -4353,12 +4355,13 @@ function ObjectOutputInput(t0) {
4353
4355
  useEmptySelectAllValue(value, fields, onChange);
4354
4356
  let t2;
4355
4357
  $[5] !== fields || $[6] !== onChange || $[7] !== value?.length ? (t2 = (checked, selectedValue) => {
4356
- if (checked) if (value?.length) onChange(PatchEvent.from(unset([{ _key: selectedValue }])));
4357
- else {
4358
- let items = fields.filter((f) => f.name !== selectedValue).map(_temp2$1);
4359
- onChange(PatchEvent.from([setIfMissing([]), insert(items, "after", [-1])]));
4360
- }
4361
- else {
4358
+ if (checked) {
4359
+ if (value?.length) onChange(PatchEvent.from(unset([{ _key: selectedValue }])));
4360
+ else {
4361
+ let items = fields.filter((f) => f.name !== selectedValue).map(_temp2$1);
4362
+ onChange(PatchEvent.from([setIfMissing([]), insert(items, "after", [-1])]));
4363
+ }
4364
+ } else {
4362
4365
  let patchValue = {
4363
4366
  _key: selectedValue,
4364
4367
  _type: "sanity.assist.output.field",
@@ -4406,12 +4409,13 @@ function ArrayOutputInput(t0) {
4406
4409
  useEmptySelectAllValue(value, ofItems, onChange);
4407
4410
  let t2;
4408
4411
  $[5] !== ofItems || $[6] !== onChange || $[7] !== value?.length ? (t2 = (checked, selectedValue) => {
4409
- if (checked) if (value?.length) onChange(PatchEvent.from(unset([{ _key: selectedValue }])));
4410
- else {
4411
- let items = ofItems.filter((f) => f.name !== selectedValue).map(_temp4);
4412
- onChange(PatchEvent.from([setIfMissing([]), insert(items, "after", [-1])]));
4413
- }
4414
- else {
4412
+ if (checked) {
4413
+ if (value?.length) onChange(PatchEvent.from(unset([{ _key: selectedValue }])));
4414
+ else {
4415
+ let items = ofItems.filter((f) => f.name !== selectedValue).map(_temp4);
4416
+ onChange(PatchEvent.from([setIfMissing([]), insert(items, "after", [-1])]));
4417
+ }
4418
+ } else {
4415
4419
  let patchValue = {
4416
4420
  _key: selectedValue,
4417
4421
  _type: "sanity.assist.output.type",