@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.js
CHANGED
|
@@ -733,7 +733,7 @@ function asStudioInstruction(instruction, run, validation) {
|
|
|
733
733
|
});
|
|
734
734
|
return {
|
|
735
735
|
...instruction,
|
|
736
|
-
tasks: run.filter(task => task.instructionKey === instruction._key).filter(task => task.started && /* @__PURE__ */new Date().getTime() - new Date(task.started).getTime() < maxHistoryVisibilityMs),
|
|
736
|
+
tasks: run.filter(task => task.instructionKey === instruction._key).filter(task => task.started && ( /* @__PURE__ */new Date()).getTime() - new Date(task.started).getTime() < maxHistoryVisibilityMs),
|
|
737
737
|
validation: errors.filter(marker => fieldRefs.map(r => r.path).filter(p => !!p).find(path => sanity.pathToString(marker.path) === path))
|
|
738
738
|
};
|
|
739
739
|
}
|
|
@@ -815,13 +815,13 @@ function InstructionTaskHistoryButton(props) {
|
|
|
815
815
|
const statusDocId = assistTasksStatusId(documentId);
|
|
816
816
|
const basePath = "".concat(sanity.typed("tasks"), '[_key=="').concat(taskKey, '"]');
|
|
817
817
|
client.patch(statusDocId).set({
|
|
818
|
-
["".concat(basePath, ".").concat(sanity.typed("ended"))]: /* @__PURE__ */new Date().toISOString(),
|
|
818
|
+
["".concat(basePath, ".").concat(sanity.typed("ended"))]: ( /* @__PURE__ */new Date()).toISOString(),
|
|
819
819
|
["".concat(basePath, ".").concat(sanity.typed("reason"))]: sanity.typed("aborted")
|
|
820
820
|
}).commit().catch(console.error);
|
|
821
821
|
}, [client, documentId]);
|
|
822
822
|
const titledTasks = react.useMemo(() => {
|
|
823
823
|
var _a2;
|
|
824
|
-
const t = (_a2 = tasks == null ? void 0 : tasks.filter(task => task.started && /* @__PURE__ */new Date().getTime() - new Date(task.started).getTime() < maxHistoryVisibilityMs).map(task => {
|
|
824
|
+
const t = (_a2 = tasks == null ? void 0 : tasks.filter(task => task.started && ( /* @__PURE__ */new Date()).getTime() - new Date(task.started).getTime() < maxHistoryVisibilityMs).map(task => {
|
|
825
825
|
var _a3;
|
|
826
826
|
const instruction = instructions == null ? void 0 : instructions.find(i => i._key === task.instructionKey);
|
|
827
827
|
return {
|
|
@@ -888,11 +888,10 @@ const TaskStatusButton = react.forwardRef(function TaskStatusButton2(props, ref)
|
|
|
888
888
|
mode: "bleed",
|
|
889
889
|
onClick,
|
|
890
890
|
tone: hasErrors ? "critical" : void 0,
|
|
891
|
-
fontSize: 1,
|
|
892
891
|
disabled,
|
|
893
892
|
ref,
|
|
894
893
|
selected,
|
|
895
|
-
|
|
894
|
+
tooltipProps: TASK_STATUS_BUTTON_TOOLTIP_PROPS
|
|
896
895
|
});
|
|
897
896
|
});
|
|
898
897
|
function TaskList(props) {
|
|
@@ -2174,7 +2173,7 @@ function useAssistPresence(path, showFocusWithin) {
|
|
|
2174
2173
|
const activePresence = (_b = (_a = tasks == null ? void 0 : tasks.filter(task => !task.ended)) == null ? void 0 : _a.flatMap(task => {
|
|
2175
2174
|
var _a2;
|
|
2176
2175
|
return (_a2 = task.presence) != null ? _a2 : [];
|
|
2177
|
-
})) == null ? void 0 : _b.filter(p => p.started && /* @__PURE__ */new Date().getTime() - new Date(p.started).getTime() < maxHistoryVisibilityMs).filter(presence => {
|
|
2176
|
+
})) == null ? void 0 : _b.filter(p => p.started && ( /* @__PURE__ */new Date()).getTime() - new Date(p.started).getTime() < maxHistoryVisibilityMs).filter(presence => {
|
|
2178
2177
|
if (!presence.path || !path.length) {
|
|
2179
2178
|
return false;
|
|
2180
2179
|
}
|
|
@@ -2208,7 +2207,7 @@ function aiPresence(presence, path, title) {
|
|
|
2208
2207
|
},
|
|
2209
2208
|
path,
|
|
2210
2209
|
sessionId: "not-available",
|
|
2211
|
-
lastActiveAt: (_a = presence == null ? void 0 : presence.started) != null ? _a : /* @__PURE__ */new Date().toISOString()
|
|
2210
|
+
lastActiveAt: (_a = presence == null ? void 0 : presence.started) != null ? _a : ( /* @__PURE__ */new Date()).toISOString()
|
|
2212
2211
|
};
|
|
2213
2212
|
}
|
|
2214
2213
|
var __freeze$3 = Object.freeze;
|
|
@@ -2235,47 +2234,47 @@ const FadeInContent = react.forwardRef(function FadeInContent2(_ref9, ref) {
|
|
|
2235
2234
|
const purple = {
|
|
2236
2235
|
"50": {
|
|
2237
2236
|
title: "Purple 50",
|
|
2238
|
-
hex: "#
|
|
2237
|
+
hex: "#f8f5ff"
|
|
2239
2238
|
},
|
|
2240
2239
|
"100": {
|
|
2241
2240
|
title: "Purple 100",
|
|
2242
|
-
hex: "#
|
|
2241
|
+
hex: "#f1ebff"
|
|
2243
2242
|
},
|
|
2244
2243
|
"200": {
|
|
2245
2244
|
title: "Purple 200",
|
|
2246
|
-
hex: "#
|
|
2245
|
+
hex: "#ece1fe"
|
|
2247
2246
|
},
|
|
2248
2247
|
"300": {
|
|
2249
2248
|
title: "Purple 300",
|
|
2250
|
-
hex: "#
|
|
2249
|
+
hex: "#ccb1fc"
|
|
2251
2250
|
},
|
|
2252
2251
|
"400": {
|
|
2253
2252
|
title: "Purple 400",
|
|
2254
|
-
hex: "#
|
|
2253
|
+
hex: "#b087f7"
|
|
2255
2254
|
},
|
|
2256
2255
|
"500": {
|
|
2257
2256
|
title: "Purple 500",
|
|
2258
|
-
hex: "#
|
|
2257
|
+
hex: "#8f57ef"
|
|
2259
2258
|
},
|
|
2260
2259
|
"600": {
|
|
2261
2260
|
title: "Purple 600",
|
|
2262
|
-
hex: "#
|
|
2261
|
+
hex: "#721fe5"
|
|
2263
2262
|
},
|
|
2264
2263
|
"700": {
|
|
2265
2264
|
title: "Purple 700",
|
|
2266
|
-
hex: "#
|
|
2265
|
+
hex: "#4c1a9e"
|
|
2267
2266
|
},
|
|
2268
2267
|
"800": {
|
|
2269
2268
|
title: "Purple 800",
|
|
2270
|
-
hex: "#
|
|
2269
|
+
hex: "#2f1862"
|
|
2271
2270
|
},
|
|
2272
2271
|
"900": {
|
|
2273
2272
|
title: "Purple 900",
|
|
2274
|
-
hex: "#
|
|
2273
|
+
hex: "#23173f"
|
|
2275
2274
|
},
|
|
2276
2275
|
"950": {
|
|
2277
2276
|
title: "Purple 950",
|
|
2278
|
-
hex: "#
|
|
2277
|
+
hex: "#181128"
|
|
2279
2278
|
}
|
|
2280
2279
|
};
|
|
2281
2280
|
var __freeze$2 = Object.freeze;
|
|
@@ -2326,7 +2325,11 @@ function AssistAvatar(props) {
|
|
|
2326
2325
|
style: {
|
|
2327
2326
|
color: "inherit"
|
|
2328
2327
|
},
|
|
2329
|
-
children: /* @__PURE__ */jsxRuntime.jsx(icons.SparklesIcon, {
|
|
2328
|
+
children: /* @__PURE__ */jsxRuntime.jsx(icons.SparklesIcon, {
|
|
2329
|
+
style: {
|
|
2330
|
+
color: "inherit"
|
|
2331
|
+
}
|
|
2332
|
+
})
|
|
2330
2333
|
})
|
|
2331
2334
|
})]
|
|
2332
2335
|
});
|
|
@@ -2972,7 +2975,6 @@ function AssistConnectorsOverlay(props) {
|
|
|
2972
2975
|
zIndex: 150
|
|
2973
2976
|
// zIndex,
|
|
2974
2977
|
},
|
|
2975
|
-
|
|
2976
2978
|
children: connectors.map(connector => /* @__PURE__ */jsxRuntime.jsx(ConnectorPath, {
|
|
2977
2979
|
from: connector.from,
|
|
2978
2980
|
options,
|
|
@@ -3755,7 +3757,7 @@ function whatwgRNG() {
|
|
|
3755
3757
|
getRandomValues(rnds8);
|
|
3756
3758
|
return rnds8;
|
|
3757
3759
|
}
|
|
3758
|
-
const getByteHexTable = (() => {
|
|
3760
|
+
const getByteHexTable = /* @__PURE__ */(() => {
|
|
3759
3761
|
let table;
|
|
3760
3762
|
return () => {
|
|
3761
3763
|
if (table) {
|
|
@@ -3987,7 +3989,6 @@ const prompt = sanity.defineType({
|
|
|
3987
3989
|
type: userInput.name,
|
|
3988
3990
|
}),*/]
|
|
3989
3991
|
});
|
|
3990
|
-
|
|
3991
3992
|
const instruction = sanity.defineType({
|
|
3992
3993
|
type: "object",
|
|
3993
3994
|
name: instructionTypeName,
|
|
@@ -4716,11 +4717,11 @@ function AssistDocumentPresence(props) {
|
|
|
4716
4717
|
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 => {
|
|
4717
4718
|
var _a2;
|
|
4718
4719
|
return (_a2 = run.presence) != null ? _a2 : [];
|
|
4719
|
-
}).find(f => f.started && /* @__PURE__ */new Date().getTime() - new Date(f.started).getTime() < 3e4);
|
|
4720
|
+
}).find(f => f.started && ( /* @__PURE__ */new Date()).getTime() - new Date(f.started).getTime() < 3e4);
|
|
4720
4721
|
if (anyPresence2) {
|
|
4721
4722
|
return aiPresence(anyPresence2, []);
|
|
4722
4723
|
}
|
|
4723
|
-
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);
|
|
4724
|
+
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);
|
|
4724
4725
|
return anyRun ? aiPresence({
|
|
4725
4726
|
started: anyRun.started,
|
|
4726
4727
|
path: documentRootKey,
|