@athenaintel/react 0.10.31 → 0.10.32
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.cjs +157 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +157 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1177,15 +1177,27 @@ const createConfigUtils = (config2) => ({
|
|
|
1177
1177
|
cache: createLruCache(config2.cacheSize),
|
|
1178
1178
|
parseClassName: createParseClassName(config2),
|
|
1179
1179
|
sortModifiers: createSortModifiers(config2),
|
|
1180
|
+
postfixLookupClassGroupIds: createPostfixLookupClassGroupIds(config2),
|
|
1180
1181
|
...createClassGroupUtils(config2)
|
|
1181
1182
|
});
|
|
1183
|
+
const createPostfixLookupClassGroupIds = (config2) => {
|
|
1184
|
+
const lookup = /* @__PURE__ */ Object.create(null);
|
|
1185
|
+
const classGroupIds = config2.postfixLookupClassGroups;
|
|
1186
|
+
if (classGroupIds) {
|
|
1187
|
+
for (let i = 0; i < classGroupIds.length; i++) {
|
|
1188
|
+
lookup[classGroupIds[i]] = true;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
return lookup;
|
|
1192
|
+
};
|
|
1182
1193
|
const SPLIT_CLASSES_REGEX = /\s+/;
|
|
1183
1194
|
const mergeClassList = (classList, configUtils) => {
|
|
1184
1195
|
const {
|
|
1185
1196
|
parseClassName,
|
|
1186
1197
|
getClassGroupId,
|
|
1187
1198
|
getConflictingClassGroupIds,
|
|
1188
|
-
sortModifiers
|
|
1199
|
+
sortModifiers,
|
|
1200
|
+
postfixLookupClassGroupIds
|
|
1189
1201
|
} = configUtils;
|
|
1190
1202
|
const classGroupsInConflict = [];
|
|
1191
1203
|
const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
|
|
@@ -1204,7 +1216,18 @@ const mergeClassList = (classList, configUtils) => {
|
|
|
1204
1216
|
continue;
|
|
1205
1217
|
}
|
|
1206
1218
|
let hasPostfixModifier = !!maybePostfixModifierPosition;
|
|
1207
|
-
let classGroupId
|
|
1219
|
+
let classGroupId;
|
|
1220
|
+
if (hasPostfixModifier) {
|
|
1221
|
+
const baseClassNameWithoutPostfix = baseClassName.substring(0, maybePostfixModifierPosition);
|
|
1222
|
+
classGroupId = getClassGroupId(baseClassNameWithoutPostfix);
|
|
1223
|
+
const classGroupIdWithPostfix = classGroupId && postfixLookupClassGroupIds[classGroupId] ? getClassGroupId(baseClassName) : void 0;
|
|
1224
|
+
if (classGroupIdWithPostfix && classGroupIdWithPostfix !== classGroupId) {
|
|
1225
|
+
classGroupId = classGroupIdWithPostfix;
|
|
1226
|
+
hasPostfixModifier = false;
|
|
1227
|
+
}
|
|
1228
|
+
} else {
|
|
1229
|
+
classGroupId = getClassGroupId(baseClassName);
|
|
1230
|
+
}
|
|
1208
1231
|
if (!classGroupId) {
|
|
1209
1232
|
if (!hasPostfixModifier) {
|
|
1210
1233
|
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
@@ -1319,6 +1342,7 @@ const isNever = () => false;
|
|
|
1319
1342
|
const isShadow = (value) => shadowRegex.test(value);
|
|
1320
1343
|
const isImage = (value) => imageRegex.test(value);
|
|
1321
1344
|
const isAnyNonArbitrary = (value) => !isArbitraryValue(value) && !isArbitraryVariable(value);
|
|
1345
|
+
const isNamedContainerQuery = (value) => value.startsWith("@container") && (value[10] === "/" && value[11] !== void 0 || value[11] === "s" && value[16] !== void 0 && value.startsWith("-size/", 10) || value[11] === "n" && value[18] !== void 0 && value.startsWith("-normal/", 10));
|
|
1322
1346
|
const isArbitrarySize = (value) => getIsArbitraryValue(value, isLabelSize, isNever);
|
|
1323
1347
|
const isArbitraryValue = (value) => arbitraryValueRegex.test(value);
|
|
1324
1348
|
const isArbitraryLength = (value) => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
|
|
@@ -1497,6 +1521,18 @@ const getDefaultConfig = () => {
|
|
|
1497
1521
|
* @deprecated since Tailwind CSS v4.0.0
|
|
1498
1522
|
*/
|
|
1499
1523
|
container: ["container"],
|
|
1524
|
+
/**
|
|
1525
|
+
* Container Type
|
|
1526
|
+
* @see https://tailwindcss.com/docs/responsive-design#container-queries
|
|
1527
|
+
*/
|
|
1528
|
+
"container-type": [{
|
|
1529
|
+
"@container": ["", "normal", "size", isArbitraryVariable, isArbitraryValue]
|
|
1530
|
+
}],
|
|
1531
|
+
/**
|
|
1532
|
+
* Container Name
|
|
1533
|
+
* @see https://tailwindcss.com/docs/responsive-design#named-containers
|
|
1534
|
+
*/
|
|
1535
|
+
"container-named": [isNamedContainerQuery],
|
|
1500
1536
|
/**
|
|
1501
1537
|
* Columns
|
|
1502
1538
|
* @see https://tailwindcss.com/docs/columns
|
|
@@ -2440,6 +2476,13 @@ const getDefaultConfig = () => {
|
|
|
2440
2476
|
indent: [{
|
|
2441
2477
|
indent: scaleUnambiguousSpacing()
|
|
2442
2478
|
}],
|
|
2479
|
+
/**
|
|
2480
|
+
* Tab Size
|
|
2481
|
+
* @see https://tailwindcss.com/docs/tab-size
|
|
2482
|
+
*/
|
|
2483
|
+
"tab-size": [{
|
|
2484
|
+
tab: [isInteger, isArbitraryVariable, isArbitraryValue]
|
|
2485
|
+
}],
|
|
2443
2486
|
/**
|
|
2444
2487
|
* Vertical Alignment
|
|
2445
2488
|
* @see https://tailwindcss.com/docs/vertical-align
|
|
@@ -3665,6 +3708,13 @@ const getDefaultConfig = () => {
|
|
|
3665
3708
|
* @see https://tailwindcss.com/docs/translate
|
|
3666
3709
|
*/
|
|
3667
3710
|
"translate-none": ["translate-none"],
|
|
3711
|
+
/**
|
|
3712
|
+
* Zoom
|
|
3713
|
+
* @see https://tailwindcss.com/docs/zoom
|
|
3714
|
+
*/
|
|
3715
|
+
zoom: [{
|
|
3716
|
+
zoom: [isInteger, isArbitraryVariable, isArbitraryValue]
|
|
3717
|
+
}],
|
|
3668
3718
|
// ---------------------
|
|
3669
3719
|
// --- Interactivity ---
|
|
3670
3720
|
// ---------------------
|
|
@@ -3731,6 +3781,34 @@ const getDefaultConfig = () => {
|
|
|
3731
3781
|
"scroll-behavior": [{
|
|
3732
3782
|
scroll: ["auto", "smooth"]
|
|
3733
3783
|
}],
|
|
3784
|
+
/**
|
|
3785
|
+
* Scrollbar Thumb Color
|
|
3786
|
+
* @see https://tailwindcss.com/docs/scrollbar-color
|
|
3787
|
+
*/
|
|
3788
|
+
"scrollbar-thumb-color": [{
|
|
3789
|
+
"scrollbar-thumb": scaleColor()
|
|
3790
|
+
}],
|
|
3791
|
+
/**
|
|
3792
|
+
* Scrollbar Track Color
|
|
3793
|
+
* @see https://tailwindcss.com/docs/scrollbar-color
|
|
3794
|
+
*/
|
|
3795
|
+
"scrollbar-track-color": [{
|
|
3796
|
+
"scrollbar-track": scaleColor()
|
|
3797
|
+
}],
|
|
3798
|
+
/**
|
|
3799
|
+
* Scrollbar Gutter
|
|
3800
|
+
* @see https://tailwindcss.com/docs/scrollbar-gutter
|
|
3801
|
+
*/
|
|
3802
|
+
"scrollbar-gutter": [{
|
|
3803
|
+
"scrollbar-gutter": ["auto", "stable", "both"]
|
|
3804
|
+
}],
|
|
3805
|
+
/**
|
|
3806
|
+
* Scrollbar Width
|
|
3807
|
+
* @see https://tailwindcss.com/docs/scrollbar-width
|
|
3808
|
+
*/
|
|
3809
|
+
"scrollbar-w": [{
|
|
3810
|
+
scrollbar: ["auto", "thin", "none"]
|
|
3811
|
+
}],
|
|
3734
3812
|
/**
|
|
3735
3813
|
* Scroll Margin
|
|
3736
3814
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
@@ -3989,6 +4067,7 @@ const getDefaultConfig = () => {
|
|
|
3989
4067
|
}]
|
|
3990
4068
|
},
|
|
3991
4069
|
conflictingClassGroups: {
|
|
4070
|
+
"container-named": ["container-type"],
|
|
3992
4071
|
overflow: ["overflow-x", "overflow-y"],
|
|
3993
4072
|
overscroll: ["overscroll-x", "overscroll-y"],
|
|
3994
4073
|
inset: ["inset-x", "inset-y", "inset-bs", "inset-be", "start", "end", "top", "right", "bottom", "left"],
|
|
@@ -4041,6 +4120,7 @@ const getDefaultConfig = () => {
|
|
|
4041
4120
|
conflictingClassGroupModifiers: {
|
|
4042
4121
|
"font-size": ["leading"]
|
|
4043
4122
|
},
|
|
4123
|
+
postfixLookupClassGroups: ["container-type"],
|
|
4044
4124
|
orderSensitiveModifiers: ["*", "**", "after", "backdrop", "before", "details-content", "file", "first-letter", "first-line", "marker", "placeholder", "selection"]
|
|
4045
4125
|
};
|
|
4046
4126
|
};
|
|
@@ -13687,6 +13767,7 @@ const DEFAULT_AUTO_OPEN_TOOLS = {
|
|
|
13687
13767
|
create_document_from_markdown: openOnResult("document"),
|
|
13688
13768
|
create_new_sheet: openOnResult("spreadsheet"),
|
|
13689
13769
|
create_powerpoint_deck: openOnResult("presentation"),
|
|
13770
|
+
create_presentation_pptx_studio: openOnResult("presentation"),
|
|
13690
13771
|
create_new_notebook: openOnResult("notebook"),
|
|
13691
13772
|
// Open / read existing assets
|
|
13692
13773
|
open_asset_in_workspace: openFromArgs("unknown"),
|
|
@@ -52571,6 +52652,51 @@ function normalizeContentResult(result) {
|
|
|
52571
52652
|
}
|
|
52572
52653
|
return [];
|
|
52573
52654
|
}
|
|
52655
|
+
function useFreshPresignedUrl({
|
|
52656
|
+
s3Key,
|
|
52657
|
+
fallbackUrl
|
|
52658
|
+
}) {
|
|
52659
|
+
const [freshUrl, setFreshUrl] = React.useState(null);
|
|
52660
|
+
const config2 = useAthenaConfig();
|
|
52661
|
+
const configRef = React.useRef(config2);
|
|
52662
|
+
configRef.current = config2;
|
|
52663
|
+
React.useEffect(() => {
|
|
52664
|
+
setFreshUrl(null);
|
|
52665
|
+
if (!s3Key) return;
|
|
52666
|
+
let cancelled = false;
|
|
52667
|
+
(async () => {
|
|
52668
|
+
try {
|
|
52669
|
+
const { backendUrl, token, apiKey } = configRef.current;
|
|
52670
|
+
const baseUrl = backendUrl.replace(/\/api\/assistant-ui\/?$/, "");
|
|
52671
|
+
const url = `${baseUrl}/api/asset/fetch-attachment-presigned-url`;
|
|
52672
|
+
const headers = {
|
|
52673
|
+
"Content-Type": "application/json"
|
|
52674
|
+
};
|
|
52675
|
+
if (token) {
|
|
52676
|
+
headers["Authorization"] = `Bearer ${token}`;
|
|
52677
|
+
} else if (apiKey) {
|
|
52678
|
+
headers["X-API-KEY"] = apiKey;
|
|
52679
|
+
}
|
|
52680
|
+
const resp = await fetch(url, {
|
|
52681
|
+
method: "POST",
|
|
52682
|
+
headers,
|
|
52683
|
+
body: JSON.stringify({ s3_key: s3Key })
|
|
52684
|
+
});
|
|
52685
|
+
if (!cancelled && resp.ok) {
|
|
52686
|
+
const data = await resp.json();
|
|
52687
|
+
if (!cancelled && data.presigned_url) {
|
|
52688
|
+
setFreshUrl(data.presigned_url);
|
|
52689
|
+
}
|
|
52690
|
+
}
|
|
52691
|
+
} catch {
|
|
52692
|
+
}
|
|
52693
|
+
})();
|
|
52694
|
+
return () => {
|
|
52695
|
+
cancelled = true;
|
|
52696
|
+
};
|
|
52697
|
+
}, [s3Key]);
|
|
52698
|
+
return freshUrl ?? fallbackUrl;
|
|
52699
|
+
}
|
|
52574
52700
|
function getSlideScreenshotResult(result) {
|
|
52575
52701
|
let text2 = null;
|
|
52576
52702
|
let imageUrl = null;
|
|
@@ -52610,10 +52736,11 @@ const CaptureSlideScreenshotToolUIImpl = ({
|
|
|
52610
52736
|
const typedArgs = args;
|
|
52611
52737
|
const assetId = getStringField(typedArgs, ["asset_id", "assetId"]);
|
|
52612
52738
|
const slideNumber = getNumberField(typedArgs, ["slide_number", "slideNumber"]) ?? void 0;
|
|
52613
|
-
const { text: text2, imageUrl, mediaType } = React.useMemo(
|
|
52739
|
+
const { text: text2, imageUrl, mediaType, s3Key } = React.useMemo(
|
|
52614
52740
|
() => getSlideScreenshotResult(result),
|
|
52615
52741
|
[result]
|
|
52616
52742
|
);
|
|
52743
|
+
const freshImageUrl = useFreshPresignedUrl({ s3Key, fallbackUrl: imageUrl });
|
|
52617
52744
|
const isRunning = (status == null ? void 0 : status.type) === "running";
|
|
52618
52745
|
const isComplete = (status == null ? void 0 : status.type) === "complete" || !status;
|
|
52619
52746
|
const isCancelled = (status == null ? void 0 : status.type) === "incomplete" && status.reason === "cancelled";
|
|
@@ -52645,11 +52772,11 @@ const CaptureSlideScreenshotToolUIImpl = ({
|
|
|
52645
52772
|
result,
|
|
52646
52773
|
error: errorMsg,
|
|
52647
52774
|
children: [
|
|
52648
|
-
isComplete && !isCancelled &&
|
|
52775
|
+
isComplete && !isCancelled && freshImageUrl && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-border/40 p-3", children: [
|
|
52649
52776
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden rounded-lg border border-border/50 bg-muted/20", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
52650
52777
|
"img",
|
|
52651
52778
|
{
|
|
52652
|
-
src:
|
|
52779
|
+
src: freshImageUrl,
|
|
52653
52780
|
alt: slideNumber ? `Slide ${slideNumber} screenshot` : "Slide screenshot",
|
|
52654
52781
|
className: "aspect-video w-full object-contain",
|
|
52655
52782
|
loading: "lazy"
|
|
@@ -52670,10 +52797,10 @@ const CaptureSlideScreenshotToolUIImpl = ({
|
|
|
52670
52797
|
]
|
|
52671
52798
|
}
|
|
52672
52799
|
),
|
|
52673
|
-
|
|
52800
|
+
freshImageUrl && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
52674
52801
|
"a",
|
|
52675
52802
|
{
|
|
52676
|
-
href:
|
|
52803
|
+
href: freshImageUrl,
|
|
52677
52804
|
target: "_blank",
|
|
52678
52805
|
rel: "noreferrer",
|
|
52679
52806
|
className: "flex items-center gap-1.5 rounded-md border border-border/60 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",
|
|
@@ -52703,6 +52830,7 @@ const TOOL_UI_REGISTRY = {
|
|
|
52703
52830
|
create_document_from_markdown: CreateDocumentToolUI,
|
|
52704
52831
|
create_new_sheet: CreateSheetToolUI,
|
|
52705
52832
|
create_powerpoint_deck: CreatePresentationToolUI,
|
|
52833
|
+
create_presentation_pptx_studio: CreatePresentationToolUI,
|
|
52706
52834
|
create_new_notebook: CreateNotebookToolUI,
|
|
52707
52835
|
// Studio SDK nested PTC tools
|
|
52708
52836
|
CreateWorkbook: StudioCreateWorkbookToolUI,
|
|
@@ -52912,6 +53040,7 @@ const TOOL_STATUS_LABELS = {
|
|
|
52912
53040
|
run_sql_query_tool: { running: "Running database query", complete: "Query complete" },
|
|
52913
53041
|
// Presentation
|
|
52914
53042
|
create_powerpoint_deck: { running: "Creating presentation", complete: "Created presentation" },
|
|
53043
|
+
create_presentation_pptx_studio: { running: "Creating presentation", complete: "Created presentation" },
|
|
52915
53044
|
execute_presentation_code: { running: "Updating presentation", complete: "Updated presentation" },
|
|
52916
53045
|
capture_slide_screenshot: { running: "Capturing slide", complete: "Slide captured" },
|
|
52917
53046
|
// Notebook
|
|
@@ -52962,13 +53091,14 @@ const DEFAULT_TOOL_TO_TOOLKIT = {
|
|
|
52962
53091
|
AddSheet: "Spreadsheet",
|
|
52963
53092
|
OpenWorkbook: "Spreadsheet",
|
|
52964
53093
|
// Presentation
|
|
52965
|
-
create_powerpoint_deck: "Presentation
|
|
52966
|
-
|
|
52967
|
-
|
|
53094
|
+
create_powerpoint_deck: "Presentation",
|
|
53095
|
+
create_presentation_pptx_studio: "Presentation",
|
|
53096
|
+
execute_presentation_code: "Presentation",
|
|
53097
|
+
capture_slide_screenshot: "Presentation",
|
|
52968
53098
|
// Studio presentation PTC
|
|
52969
|
-
CreatePresentation: "Presentation
|
|
52970
|
-
OpenPresentation: "Presentation
|
|
52971
|
-
AddSlide: "Presentation
|
|
53099
|
+
CreatePresentation: "Presentation",
|
|
53100
|
+
OpenPresentation: "Presentation",
|
|
53101
|
+
AddSlide: "Presentation",
|
|
52972
53102
|
// Notebook
|
|
52973
53103
|
create_new_notebook: "Notebook",
|
|
52974
53104
|
run_notebook_cell: "Notebook",
|
|
@@ -53549,8 +53679,12 @@ const Toolkits = {
|
|
|
53549
53679
|
NOTEBOOK: "notebook_toolkit",
|
|
53550
53680
|
/** Presentation slide editing. */
|
|
53551
53681
|
PRESENTATION: "presentation_toolkit",
|
|
53682
|
+
/** Presentation slide editing (OnlyOffice, deprecated). */
|
|
53683
|
+
PRESENTATION_ONLYOFFICE: "presentation_onlyoffice_toolkit",
|
|
53552
53684
|
/** PowerPoint presentation creation from templates. */
|
|
53553
53685
|
POWERPOINT: "powerpoint_deck_toolkit",
|
|
53686
|
+
/** PowerPoint presentation creation from templates (pptx-studio). */
|
|
53687
|
+
PRESENTATION_PPTX_STUDIO: "presentation_pptx_studio_toolkit",
|
|
53554
53688
|
/** Workspace file management (Olympus Drive). */
|
|
53555
53689
|
DRIVE: "olympus_drive_toolkit",
|
|
53556
53690
|
/** Python code execution. */
|
|
@@ -53655,11 +53789,21 @@ const TOOLKIT_DISPLAY_INFO = {
|
|
|
53655
53789
|
description: "Edit presentation slides.",
|
|
53656
53790
|
icon: "Presentation"
|
|
53657
53791
|
},
|
|
53792
|
+
[Toolkits.PRESENTATION_ONLYOFFICE]: {
|
|
53793
|
+
name: "Presentation v0 (deprecated)",
|
|
53794
|
+
description: "Edit presentation slides (OnlyOffice, deprecated).",
|
|
53795
|
+
icon: "Presentation"
|
|
53796
|
+
},
|
|
53658
53797
|
[Toolkits.POWERPOINT]: {
|
|
53659
53798
|
name: "PowerPoint",
|
|
53660
53799
|
description: "Create PowerPoint decks from templates.",
|
|
53661
53800
|
icon: "Presentation"
|
|
53662
53801
|
},
|
|
53802
|
+
[Toolkits.PRESENTATION_PPTX_STUDIO]: {
|
|
53803
|
+
name: "Presentation",
|
|
53804
|
+
description: "Create PowerPoint presentations from templates (pptx-studio).",
|
|
53805
|
+
icon: "Presentation"
|
|
53806
|
+
},
|
|
53663
53807
|
[Toolkits.DRIVE]: {
|
|
53664
53808
|
name: "Olympus Drive",
|
|
53665
53809
|
description: "Find and manage workspace files.",
|