@sanity/assist 1.2.15 → 1.2.16
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.esm.js +25 -24
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +25 -24
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/_lib/form/DocumentForm.tsx +1 -1
- package/src/assistInspector/InstructionTaskHistoryButton.tsx +2 -3
- package/src/presence/AssistAvatar.tsx +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -720,7 +720,7 @@ function asStudioInstruction(instruction, run, validation) {
|
|
|
720
720
|
});
|
|
721
721
|
return {
|
|
722
722
|
...instruction,
|
|
723
|
-
tasks: run.filter(task => task.instructionKey === instruction._key).filter(task => task.started && /* @__PURE__ */new Date().getTime() - new Date(task.started).getTime() < maxHistoryVisibilityMs),
|
|
723
|
+
tasks: run.filter(task => task.instructionKey === instruction._key).filter(task => task.started && ( /* @__PURE__ */new Date()).getTime() - new Date(task.started).getTime() < maxHistoryVisibilityMs),
|
|
724
724
|
validation: errors.filter(marker => fieldRefs.map(r => r.path).filter(p => !!p).find(path => pathToString(marker.path) === path))
|
|
725
725
|
};
|
|
726
726
|
}
|
|
@@ -802,13 +802,13 @@ function InstructionTaskHistoryButton(props) {
|
|
|
802
802
|
const statusDocId = assistTasksStatusId(documentId);
|
|
803
803
|
const basePath = "".concat(typed("tasks"), '[_key=="').concat(taskKey, '"]');
|
|
804
804
|
client.patch(statusDocId).set({
|
|
805
|
-
["".concat(basePath, ".").concat(typed("ended"))]: /* @__PURE__ */new Date().toISOString(),
|
|
805
|
+
["".concat(basePath, ".").concat(typed("ended"))]: ( /* @__PURE__ */new Date()).toISOString(),
|
|
806
806
|
["".concat(basePath, ".").concat(typed("reason"))]: typed("aborted")
|
|
807
807
|
}).commit().catch(console.error);
|
|
808
808
|
}, [client, documentId]);
|
|
809
809
|
const titledTasks = useMemo(() => {
|
|
810
810
|
var _a2;
|
|
811
|
-
const t = (_a2 = tasks == null ? void 0 : tasks.filter(task => task.started && /* @__PURE__ */new Date().getTime() - new Date(task.started).getTime() < maxHistoryVisibilityMs).map(task => {
|
|
811
|
+
const t = (_a2 = tasks == null ? void 0 : tasks.filter(task => task.started && ( /* @__PURE__ */new Date()).getTime() - new Date(task.started).getTime() < maxHistoryVisibilityMs).map(task => {
|
|
812
812
|
var _a3;
|
|
813
813
|
const instruction = instructions == null ? void 0 : instructions.find(i => i._key === task.instructionKey);
|
|
814
814
|
return {
|
|
@@ -875,11 +875,10 @@ const TaskStatusButton = forwardRef(function TaskStatusButton2(props, ref) {
|
|
|
875
875
|
mode: "bleed",
|
|
876
876
|
onClick,
|
|
877
877
|
tone: hasErrors ? "critical" : void 0,
|
|
878
|
-
fontSize: 1,
|
|
879
878
|
disabled,
|
|
880
879
|
ref,
|
|
881
880
|
selected,
|
|
882
|
-
|
|
881
|
+
tooltipProps: TASK_STATUS_BUTTON_TOOLTIP_PROPS
|
|
883
882
|
});
|
|
884
883
|
});
|
|
885
884
|
function TaskList(props) {
|
|
@@ -2161,7 +2160,7 @@ function useAssistPresence(path, showFocusWithin) {
|
|
|
2161
2160
|
const activePresence = (_b = (_a = tasks == null ? void 0 : tasks.filter(task => !task.ended)) == null ? void 0 : _a.flatMap(task => {
|
|
2162
2161
|
var _a2;
|
|
2163
2162
|
return (_a2 = task.presence) != null ? _a2 : [];
|
|
2164
|
-
})) == null ? void 0 : _b.filter(p => p.started && /* @__PURE__ */new Date().getTime() - new Date(p.started).getTime() < maxHistoryVisibilityMs).filter(presence => {
|
|
2163
|
+
})) == null ? void 0 : _b.filter(p => p.started && ( /* @__PURE__ */new Date()).getTime() - new Date(p.started).getTime() < maxHistoryVisibilityMs).filter(presence => {
|
|
2165
2164
|
if (!presence.path || !path.length) {
|
|
2166
2165
|
return false;
|
|
2167
2166
|
}
|
|
@@ -2195,7 +2194,7 @@ function aiPresence(presence, path, title) {
|
|
|
2195
2194
|
},
|
|
2196
2195
|
path,
|
|
2197
2196
|
sessionId: "not-available",
|
|
2198
|
-
lastActiveAt: (_a = presence == null ? void 0 : presence.started) != null ? _a : /* @__PURE__ */new Date().toISOString()
|
|
2197
|
+
lastActiveAt: (_a = presence == null ? void 0 : presence.started) != null ? _a : ( /* @__PURE__ */new Date()).toISOString()
|
|
2199
2198
|
};
|
|
2200
2199
|
}
|
|
2201
2200
|
var __freeze$3 = Object.freeze;
|
|
@@ -2222,47 +2221,47 @@ const FadeInContent = forwardRef(function FadeInContent2(_ref9, ref) {
|
|
|
2222
2221
|
const purple = {
|
|
2223
2222
|
"50": {
|
|
2224
2223
|
title: "Purple 50",
|
|
2225
|
-
hex: "#
|
|
2224
|
+
hex: "#f8f5ff"
|
|
2226
2225
|
},
|
|
2227
2226
|
"100": {
|
|
2228
2227
|
title: "Purple 100",
|
|
2229
|
-
hex: "#
|
|
2228
|
+
hex: "#f1ebff"
|
|
2230
2229
|
},
|
|
2231
2230
|
"200": {
|
|
2232
2231
|
title: "Purple 200",
|
|
2233
|
-
hex: "#
|
|
2232
|
+
hex: "#ece1fe"
|
|
2234
2233
|
},
|
|
2235
2234
|
"300": {
|
|
2236
2235
|
title: "Purple 300",
|
|
2237
|
-
hex: "#
|
|
2236
|
+
hex: "#ccb1fc"
|
|
2238
2237
|
},
|
|
2239
2238
|
"400": {
|
|
2240
2239
|
title: "Purple 400",
|
|
2241
|
-
hex: "#
|
|
2240
|
+
hex: "#b087f7"
|
|
2242
2241
|
},
|
|
2243
2242
|
"500": {
|
|
2244
2243
|
title: "Purple 500",
|
|
2245
|
-
hex: "#
|
|
2244
|
+
hex: "#8f57ef"
|
|
2246
2245
|
},
|
|
2247
2246
|
"600": {
|
|
2248
2247
|
title: "Purple 600",
|
|
2249
|
-
hex: "#
|
|
2248
|
+
hex: "#721fe5"
|
|
2250
2249
|
},
|
|
2251
2250
|
"700": {
|
|
2252
2251
|
title: "Purple 700",
|
|
2253
|
-
hex: "#
|
|
2252
|
+
hex: "#4c1a9e"
|
|
2254
2253
|
},
|
|
2255
2254
|
"800": {
|
|
2256
2255
|
title: "Purple 800",
|
|
2257
|
-
hex: "#
|
|
2256
|
+
hex: "#2f1862"
|
|
2258
2257
|
},
|
|
2259
2258
|
"900": {
|
|
2260
2259
|
title: "Purple 900",
|
|
2261
|
-
hex: "#
|
|
2260
|
+
hex: "#23173f"
|
|
2262
2261
|
},
|
|
2263
2262
|
"950": {
|
|
2264
2263
|
title: "Purple 950",
|
|
2265
|
-
hex: "#
|
|
2264
|
+
hex: "#181128"
|
|
2266
2265
|
}
|
|
2267
2266
|
};
|
|
2268
2267
|
var __freeze$2 = Object.freeze;
|
|
@@ -2313,7 +2312,11 @@ function AssistAvatar(props) {
|
|
|
2313
2312
|
style: {
|
|
2314
2313
|
color: "inherit"
|
|
2315
2314
|
},
|
|
2316
|
-
children: /* @__PURE__ */jsx(SparklesIcon, {
|
|
2315
|
+
children: /* @__PURE__ */jsx(SparklesIcon, {
|
|
2316
|
+
style: {
|
|
2317
|
+
color: "inherit"
|
|
2318
|
+
}
|
|
2319
|
+
})
|
|
2317
2320
|
})
|
|
2318
2321
|
})]
|
|
2319
2322
|
});
|
|
@@ -2959,7 +2962,6 @@ function AssistConnectorsOverlay(props) {
|
|
|
2959
2962
|
zIndex: 150
|
|
2960
2963
|
// zIndex,
|
|
2961
2964
|
},
|
|
2962
|
-
|
|
2963
2965
|
children: connectors.map(connector => /* @__PURE__ */jsx(ConnectorPath, {
|
|
2964
2966
|
from: connector.from,
|
|
2965
2967
|
options,
|
|
@@ -3742,7 +3744,7 @@ function whatwgRNG() {
|
|
|
3742
3744
|
getRandomValues(rnds8);
|
|
3743
3745
|
return rnds8;
|
|
3744
3746
|
}
|
|
3745
|
-
const getByteHexTable = (() => {
|
|
3747
|
+
const getByteHexTable = /* @__PURE__ */(() => {
|
|
3746
3748
|
let table;
|
|
3747
3749
|
return () => {
|
|
3748
3750
|
if (table) {
|
|
@@ -3974,7 +3976,6 @@ const prompt = defineType({
|
|
|
3974
3976
|
type: userInput.name,
|
|
3975
3977
|
}),*/]
|
|
3976
3978
|
});
|
|
3977
|
-
|
|
3978
3979
|
const instruction = defineType({
|
|
3979
3980
|
type: "object",
|
|
3980
3981
|
name: instructionTypeName,
|
|
@@ -4703,11 +4704,11 @@ function AssistDocumentPresence(props) {
|
|
|
4703
4704
|
const anyPresence2 = (_b = (_a = assistDocument == null ? void 0 : assistDocument.tasks) == null ? void 0 : _a.filter(run => !run.ended && !run.reason)) == null ? void 0 : _b.flatMap(run => {
|
|
4704
4705
|
var _a2;
|
|
4705
4706
|
return (_a2 = run.presence) != null ? _a2 : [];
|
|
4706
|
-
}).find(f => f.started && /* @__PURE__ */new Date().getTime() - new Date(f.started).getTime() < 3e4);
|
|
4707
|
+
}).find(f => f.started && ( /* @__PURE__ */new Date()).getTime() - new Date(f.started).getTime() < 3e4);
|
|
4707
4708
|
if (anyPresence2) {
|
|
4708
4709
|
return aiPresence(anyPresence2, []);
|
|
4709
4710
|
}
|
|
4710
|
-
const anyRun = (_d = (_c = assistDocument == null ? void 0 : assistDocument.tasks) == null ? void 0 : _c.filter(run => !run.ended && !run.reason)) == null ? void 0 : _d.find(f => f.started && /* @__PURE__ */new Date().getTime() - new Date(f.started).getTime() < 3e4);
|
|
4711
|
+
const anyRun = (_d = (_c = assistDocument == null ? void 0 : assistDocument.tasks) == null ? void 0 : _c.filter(run => !run.ended && !run.reason)) == null ? void 0 : _d.find(f => f.started && ( /* @__PURE__ */new Date()).getTime() - new Date(f.started).getTime() < 3e4);
|
|
4711
4712
|
return anyRun ? aiPresence({
|
|
4712
4713
|
started: anyRun.started,
|
|
4713
4714
|
path: documentRootKey,
|