@alpaca-editor/core 1.0.4057 → 1.0.4061
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/components/ui/badge.js.map +1 -1
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/tooltip.js +2 -2
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/config/config.js +7 -3
- package/dist/config/config.js.map +1 -1
- package/dist/config/types.d.ts +1 -0
- package/dist/editor/FieldListField.js +3 -2
- package/dist/editor/FieldListField.js.map +1 -1
- package/dist/editor/ai/AgentTerminal.js +0 -3
- package/dist/editor/ai/AgentTerminal.js.map +1 -1
- package/dist/editor/client/EditorClient.js +20 -6
- package/dist/editor/client/EditorClient.js.map +1 -1
- package/dist/editor/client/fieldModificationStore.d.ts +1 -0
- package/dist/editor/client/fieldModificationStore.js +19 -18
- package/dist/editor/client/fieldModificationStore.js.map +1 -1
- package/dist/editor/client/operations.js +1 -2
- package/dist/editor/client/operations.js.map +1 -1
- package/dist/editor/control-center/IndexOverview.js +278 -18
- package/dist/editor/control-center/IndexOverview.js.map +1 -1
- package/dist/editor/control-center/Status.js +1 -1
- package/dist/editor/control-center/Status.js.map +1 -1
- package/dist/editor/field-types/CheckboxEditor.js +1 -1
- package/dist/editor/field-types/CheckboxEditor.js.map +1 -1
- package/dist/editor/media-selector/AiImageSearch.js +2 -1
- package/dist/editor/media-selector/AiImageSearch.js.map +1 -1
- package/dist/editor/media-selector/TreeSelector.js +1 -1
- package/dist/editor/media-selector/TreeSelector.js.map +1 -1
- package/dist/editor/menubar/PageSelector.js +1 -1
- package/dist/editor/menubar/PageSelector.js.map +1 -1
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js +1 -1
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js.map +1 -1
- package/dist/editor/reviews/Comment.d.ts +5 -1
- package/dist/editor/reviews/Comment.js +64 -92
- package/dist/editor/reviews/Comment.js.map +1 -1
- package/dist/editor/reviews/CommentDisplayPopover.js +55 -49
- package/dist/editor/reviews/CommentDisplayPopover.js.map +1 -1
- package/dist/editor/reviews/CommentEditor.d.ts +20 -0
- package/dist/editor/reviews/CommentEditor.js +57 -0
- package/dist/editor/reviews/CommentEditor.js.map +1 -0
- package/dist/editor/reviews/CommentPopover.js +34 -43
- package/dist/editor/reviews/CommentPopover.js.map +1 -1
- package/dist/editor/reviews/CommentView.d.ts +19 -0
- package/dist/editor/reviews/CommentView.js +46 -0
- package/dist/editor/reviews/CommentView.js.map +1 -0
- package/dist/editor/reviews/Comments.js +28 -1
- package/dist/editor/reviews/Comments.js.map +1 -1
- package/dist/editor/reviews/SuggestionDisplayPopover.js +1 -1
- package/dist/editor/reviews/SuggestionDisplayPopover.js.map +1 -1
- package/dist/editor/services/aiService.d.ts +0 -8
- package/dist/editor/services/aiService.js +1 -24
- package/dist/editor/services/aiService.js.map +1 -1
- package/dist/editor/services/indexService.d.ts +12 -6
- package/dist/editor/services/indexService.js +33 -11
- package/dist/editor/services/indexService.js.map +1 -1
- package/dist/editor/services/reviewsService.d.ts +5 -1
- package/dist/editor/services/reviewsService.js +15 -0
- package/dist/editor/services/reviewsService.js.map +1 -1
- package/dist/editor/services/searchService.d.ts +17 -0
- package/dist/editor/services/searchService.js +25 -0
- package/dist/editor/services/searchService.js.map +1 -0
- package/dist/editor/sidebar/ViewSelector.js +7 -6
- package/dist/editor/sidebar/ViewSelector.js.map +1 -1
- package/dist/editor/ui/CenteredMessage.js +1 -1
- package/dist/editor/ui/CenteredMessage.js.map +1 -1
- package/dist/editor/ui/ItemSearch.js +1 -1
- package/dist/editor/ui/ItemSearch.js.map +1 -1
- package/dist/editor/ui/SimpleToolbar.js +1 -1
- package/dist/editor/ui/SimpleToolbar.js.map +1 -1
- package/dist/editor/ui/Spinner.d.ts +2 -1
- package/dist/editor/ui/Spinner.js +3 -2
- package/dist/editor/ui/Spinner.js.map +1 -1
- package/dist/editor/utils/keyboardNavigation.js +3 -1
- package/dist/editor/utils/keyboardNavigation.js.map +1 -1
- package/dist/page-wizard/steps/ImagesStep.js +2 -1
- package/dist/page-wizard/steps/ImagesStep.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/styles.css +76 -12
- package/dist/types.d.ts +61 -19
- package/package.json +1 -1
- package/src/components/ui/badge.tsx +1 -1
- package/src/components/ui/button.tsx +1 -1
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/tooltip.tsx +5 -3
- package/src/config/config.tsx +9 -3
- package/src/config/types.ts +1 -0
- package/src/editor/FieldListField.tsx +51 -32
- package/src/editor/ai/AgentTerminal.tsx +0 -6
- package/src/editor/client/EditorClient.tsx +47 -15
- package/src/editor/client/fieldModificationStore.ts +19 -19
- package/src/editor/client/operations.ts +1 -3
- package/src/editor/control-center/IndexOverview.tsx +590 -36
- package/src/editor/control-center/Status.tsx +1 -1
- package/src/editor/field-types/CheckboxEditor.tsx +1 -0
- package/src/editor/media-selector/AiImageSearch.tsx +2 -1
- package/src/editor/media-selector/TreeSelector.tsx +1 -1
- package/src/editor/menubar/PageSelector.tsx +1 -1
- package/src/editor/page-editor-chrome/useInlineAICompletion.tsx +1 -1
- package/src/editor/reviews/Comment.tsx +105 -244
- package/src/editor/reviews/CommentDisplayPopover.tsx +90 -219
- package/src/editor/reviews/CommentEditor.tsx +153 -0
- package/src/editor/reviews/CommentPopover.tsx +42 -70
- package/src/editor/reviews/CommentView.tsx +229 -0
- package/src/editor/reviews/Comments.tsx +33 -1
- package/src/editor/reviews/SuggestionDisplayPopover.tsx +1 -1
- package/src/editor/services/aiService.ts +1 -39
- package/src/editor/services/indexService.ts +58 -12
- package/src/editor/services/reviewsService.ts +34 -1
- package/src/editor/services/searchService.ts +45 -0
- package/src/editor/sidebar/ViewSelector.tsx +40 -27
- package/src/editor/ui/CenteredMessage.tsx +1 -1
- package/src/editor/ui/ItemSearch.tsx +1 -1
- package/src/editor/ui/SimpleToolbar.tsx +1 -1
- package/src/editor/ui/Spinner.tsx +8 -1
- package/src/editor/utils/keyboardNavigation.ts +3 -1
- package/src/page-wizard/steps/ImagesStep.tsx +2 -1
- package/src/revision.ts +2 -2
- package/src/types.ts +74 -20
- package/dist/editor/control-center/IndexSettings.d.ts +0 -5
- package/dist/editor/control-center/IndexSettings.js +0 -104
- package/dist/editor/control-center/IndexSettings.js.map +0 -1
- package/src/editor/control-center/IndexSettings.tsx +0 -266
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState, useMemo, useCallback } from "react";
|
|
2
2
|
import { classNames } from "primereact/utils";
|
|
3
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
4
|
|
|
4
5
|
import { useEditContext } from "../client/editContext";
|
|
5
6
|
import { cn } from "../../lib/utils";
|
|
@@ -126,7 +127,7 @@ function ViewSelectorComponent() {
|
|
|
126
127
|
);
|
|
127
128
|
|
|
128
129
|
return (
|
|
129
|
-
<TooltipProvider>
|
|
130
|
+
<TooltipProvider delayDuration={500} skipDelayDuration={0}>
|
|
130
131
|
{/* Visible views (pinned + selected) */}
|
|
131
132
|
{visibleViews
|
|
132
133
|
.filter((x) => x.icon)
|
|
@@ -164,7 +165,7 @@ function ViewSelectorComponent() {
|
|
|
164
165
|
{/* Three dots menu for non-selected views */}
|
|
165
166
|
{views.length > 0 && (
|
|
166
167
|
<Popover open={isPopoverOpen} onOpenChange={setIsPopoverOpen}>
|
|
167
|
-
<Tooltip>
|
|
168
|
+
<Tooltip delayDuration={500}>
|
|
168
169
|
<TooltipTrigger asChild>
|
|
169
170
|
<PopoverTrigger asChild>
|
|
170
171
|
<Button
|
|
@@ -186,6 +187,7 @@ function ViewSelectorComponent() {
|
|
|
186
187
|
className="w-56 p-2"
|
|
187
188
|
side={contextValues.isMobile ? "bottom" : "right"}
|
|
188
189
|
align="start"
|
|
190
|
+
onOpenAutoFocus={(e) => e.preventDefault()}
|
|
189
191
|
>
|
|
190
192
|
<div className="space-y-1">
|
|
191
193
|
<div className="px-2 py-1 text-xs font-medium tracking-wider text-gray-600 uppercase">
|
|
@@ -206,30 +208,41 @@ function ViewSelectorComponent() {
|
|
|
206
208
|
{renderViewIcon(view, "w-4 h-4")}
|
|
207
209
|
<span className="text-sm">{view.title || view.name}</span>
|
|
208
210
|
</div>
|
|
209
|
-
<
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
211
|
+
<TooltipPrimitive.Provider
|
|
212
|
+
delayDuration={1000}
|
|
213
|
+
skipDelayDuration={0}
|
|
214
|
+
>
|
|
215
|
+
<TooltipPrimitive.Root>
|
|
216
|
+
<TooltipPrimitive.Trigger asChild>
|
|
217
|
+
<Button
|
|
218
|
+
variant="ghost"
|
|
219
|
+
size="icon"
|
|
220
|
+
className={cn(
|
|
221
|
+
"h-6 w-6 transition-opacity",
|
|
222
|
+
isPinned
|
|
223
|
+
? "opacity-100"
|
|
224
|
+
: "opacity-0 group-hover:opacity-100",
|
|
225
|
+
)}
|
|
226
|
+
onClick={(e) => handlePinClick(e, view.name)}
|
|
227
|
+
>
|
|
228
|
+
{isPinned ? (
|
|
229
|
+
<DrawingPinFilledIcon className="h-3 w-3" />
|
|
230
|
+
) : (
|
|
231
|
+
<DrawingPinIcon className="h-3 w-3" />
|
|
232
|
+
)}
|
|
233
|
+
</Button>
|
|
234
|
+
</TooltipPrimitive.Trigger>
|
|
235
|
+
<TooltipPrimitive.Portal>
|
|
236
|
+
<TooltipPrimitive.Content
|
|
237
|
+
className="bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance"
|
|
238
|
+
sideOffset={0}
|
|
239
|
+
>
|
|
240
|
+
{isPinned ? "Unpin view" : "Pin view"}
|
|
241
|
+
<TooltipPrimitive.Arrow className="bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
|
|
242
|
+
</TooltipPrimitive.Content>
|
|
243
|
+
</TooltipPrimitive.Portal>
|
|
244
|
+
</TooltipPrimitive.Root>
|
|
245
|
+
</TooltipPrimitive.Provider>
|
|
233
246
|
</div>
|
|
234
247
|
);
|
|
235
248
|
})}
|
|
@@ -239,7 +252,7 @@ function ViewSelectorComponent() {
|
|
|
239
252
|
)}
|
|
240
253
|
|
|
241
254
|
{/* Toggle for showing view names */}
|
|
242
|
-
<Tooltip>
|
|
255
|
+
<Tooltip delayDuration={500}>
|
|
243
256
|
<TooltipTrigger asChild>
|
|
244
257
|
<Button
|
|
245
258
|
variant="ghost"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export function CenteredMessage({ children }: { children: React.ReactNode }) {
|
|
2
2
|
return (
|
|
3
|
-
<div className="flex
|
|
3
|
+
<div className="flex h-full items-center justify-center text-xs text-gray-500">
|
|
4
4
|
{children}
|
|
5
5
|
</div>
|
|
6
6
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from "react";
|
|
2
2
|
import { useEditContext } from "../client/editContext";
|
|
3
|
-
import { executeSearch } from "../services/
|
|
3
|
+
import { executeSearch } from "../services/searchService";
|
|
4
4
|
import { toast } from "sonner";
|
|
5
5
|
import { useDebouncedCallback } from "use-debounce";
|
|
6
6
|
import { ProgressSpinner } from "primereact/progressspinner";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export function SimpleToolbar({ children }: { children: React.ReactNode }) {
|
|
2
2
|
return (
|
|
3
|
-
<div className="
|
|
3
|
+
<div className="border-gray-3 flex items-center gap-2 border-b p-2 text-sm text-gray-500">
|
|
4
4
|
{children}
|
|
5
5
|
</div>
|
|
6
6
|
);
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils";
|
|
2
|
+
|
|
1
3
|
export function Spinner({
|
|
2
4
|
size = "4xl",
|
|
5
|
+
className,
|
|
3
6
|
}: {
|
|
4
7
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl";
|
|
8
|
+
className?: string;
|
|
5
9
|
}) {
|
|
6
10
|
return (
|
|
7
11
|
<i
|
|
8
|
-
className={
|
|
12
|
+
className={cn(
|
|
13
|
+
`pi pi-spin pi-spinner text-${size} text-theme-secondary/40`,
|
|
14
|
+
className,
|
|
15
|
+
)}
|
|
9
16
|
></i>
|
|
10
17
|
);
|
|
11
18
|
}
|
|
@@ -50,7 +50,9 @@ export function useKeyboardNavigation(deps: KeyboardNavigationDependencies) {
|
|
|
50
50
|
}
|
|
51
51
|
if (event.ctrlKey && event.key === "F11") {
|
|
52
52
|
event.preventDefault();
|
|
53
|
-
|
|
53
|
+
if (!configuration.forceFullscreen) {
|
|
54
|
+
pageViewContext.setFullscreen(false);
|
|
55
|
+
}
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
// History Navigation (Alt + Arrow keys, Alt + Shift + Arrow keys for favorites only)
|
|
@@ -3,7 +3,8 @@ import { useEffect, useState } from "react";
|
|
|
3
3
|
import { ScrollingContentTree } from "../../editor/ScrollingContentTree";
|
|
4
4
|
import { ItemTreeNodeData } from "../../editor/services/contentService";
|
|
5
5
|
import { useEditContext } from "../../editor/client/editContext";
|
|
6
|
-
import { executePrompt
|
|
6
|
+
import { executePrompt } from "../../editor/services/aiService";
|
|
7
|
+
import { executeSearch } from "../../editor/services/searchService";
|
|
7
8
|
import { createWizardAiContext } from "../service";
|
|
8
9
|
import { ActionButton } from "../../components/ActionButton";
|
|
9
10
|
import { classNames } from "primereact/utils";
|
package/src/revision.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = "1.0.
|
|
2
|
-
export const buildDate = "2025-08-22
|
|
1
|
+
export const version = "1.0.4061";
|
|
2
|
+
export const buildDate = "2025-08-22 14:39:56";
|
package/src/types.ts
CHANGED
|
@@ -255,26 +255,59 @@ export type LanguagesAndVersions = {
|
|
|
255
255
|
};
|
|
256
256
|
|
|
257
257
|
export type IndexStatus = {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
258
|
+
numberOfIndexedItems: number;
|
|
259
|
+
rebuilding: boolean;
|
|
260
|
+
batches: EmbeddingBatch[];
|
|
261
|
+
latestEmbeddedItems?: LatestEmbeddedItem[];
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export type EmbeddingBatch = {
|
|
265
|
+
id: string;
|
|
266
|
+
status: string;
|
|
267
|
+
numberOfItems: number;
|
|
268
|
+
created: string;
|
|
269
|
+
errorMessage?: string;
|
|
270
|
+
firstErrors?: string[];
|
|
271
|
+
errorCount?: number;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
export type LatestEmbeddedItem = {
|
|
275
|
+
itemId: string;
|
|
276
|
+
name?: string;
|
|
277
|
+
path?: string;
|
|
278
|
+
created: string;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
export type StagingStatus = {
|
|
282
|
+
fileCount: number;
|
|
283
|
+
fileIds: string[];
|
|
284
|
+
estimatedInputTokens: number;
|
|
285
|
+
estimatedCost: number;
|
|
286
|
+
estimatedBatchCost?: number;
|
|
287
|
+
estimatedDirectCost?: number;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
export type CollectAndUploadResult = {
|
|
291
|
+
uploadedFileIds: string[];
|
|
292
|
+
estimatedInputTokens: number;
|
|
293
|
+
estimatedCost: number;
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
export type SubmitStagedResult = {
|
|
297
|
+
submittedBatchIds: string[];
|
|
298
|
+
submittedCount: number;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
export type ImportStatus = {
|
|
302
|
+
isImporting: boolean;
|
|
303
|
+
status: string;
|
|
304
|
+
startedAt?: string;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
export type CentroidsStatus = {
|
|
308
|
+
isPopulating: boolean;
|
|
309
|
+
status: string;
|
|
310
|
+
startedAt?: string;
|
|
278
311
|
};
|
|
279
312
|
|
|
280
313
|
export type Error = {
|
|
@@ -282,6 +315,15 @@ export type Error = {
|
|
|
282
315
|
details: string;
|
|
283
316
|
};
|
|
284
317
|
|
|
318
|
+
export type CommentRelatedItem = {
|
|
319
|
+
itemId: string;
|
|
320
|
+
created: string;
|
|
321
|
+
createdBy: string;
|
|
322
|
+
itemName?: string;
|
|
323
|
+
itemPath?: string;
|
|
324
|
+
templateName?: string;
|
|
325
|
+
};
|
|
326
|
+
|
|
285
327
|
export type Comment = {
|
|
286
328
|
id: string;
|
|
287
329
|
isNew: boolean;
|
|
@@ -303,6 +345,18 @@ export type Comment = {
|
|
|
303
345
|
resolvedBy?: string;
|
|
304
346
|
resolvedDate?: string;
|
|
305
347
|
position: number;
|
|
348
|
+
|
|
349
|
+
// Legacy field - kept for backward compatibility during migration
|
|
350
|
+
/** @deprecated Use relatedItems instead. This field will be removed in a future version. */
|
|
351
|
+
tags?: string;
|
|
352
|
+
|
|
353
|
+
// New relational structure for item references
|
|
354
|
+
relatedItems?: CommentRelatedItem[];
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
export type CommentTag = {
|
|
358
|
+
label: string;
|
|
359
|
+
color: string;
|
|
306
360
|
};
|
|
307
361
|
|
|
308
362
|
export type Reviewer = {
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState, useCallback } from "react";
|
|
3
|
-
import { getIndexStatus, rebuildIndex, setupIndex, setupRebuildJob, } from "../services/indexService";
|
|
4
|
-
import { Button } from "primereact/button";
|
|
5
|
-
import { Spinner } from "../ui/Spinner";
|
|
6
|
-
import { useEditContext } from "../client/editContext";
|
|
7
|
-
import { ProgressSpinner } from "primereact/progressspinner";
|
|
8
|
-
export function IndexSettings({ index }) {
|
|
9
|
-
const editContext = useEditContext();
|
|
10
|
-
const [indexStatus, setIndexStatus] = useState(undefined);
|
|
11
|
-
const [settingsItem, setSettingsItem] = useState(undefined);
|
|
12
|
-
const [rebuildJobItem, setRebuildJobItem] = useState(undefined);
|
|
13
|
-
const fetchStatus = useCallback(() => {
|
|
14
|
-
getIndexStatus(index.name).then(async (result) => {
|
|
15
|
-
setIndexStatus(result);
|
|
16
|
-
if (result?.settingsItemId) {
|
|
17
|
-
const settingsItem = await editContext?.itemsRepository.getItem({
|
|
18
|
-
id: result.settingsItemId,
|
|
19
|
-
language: "en",
|
|
20
|
-
version: 0,
|
|
21
|
-
});
|
|
22
|
-
setSettingsItem(settingsItem);
|
|
23
|
-
if (result.rebuildJobItemId) {
|
|
24
|
-
const rebuildJobItem = await editContext?.itemsRepository.getItem({
|
|
25
|
-
id: result.rebuildJobItemId,
|
|
26
|
-
language: "en",
|
|
27
|
-
version: 0,
|
|
28
|
-
});
|
|
29
|
-
setRebuildJobItem(rebuildJobItem);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
setRebuildJobItem(undefined);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
setSettingsItem(undefined);
|
|
37
|
-
setRebuildJobItem(undefined);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}, [index]);
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
let interval;
|
|
43
|
-
if (indexStatus?.isRunning) {
|
|
44
|
-
interval = setInterval(() => {
|
|
45
|
-
fetchStatus();
|
|
46
|
-
}, 1000);
|
|
47
|
-
}
|
|
48
|
-
return () => {
|
|
49
|
-
if (interval) {
|
|
50
|
-
clearInterval(interval);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}, [indexStatus?.isRunning, fetchStatus]);
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
fetchStatus();
|
|
56
|
-
}, [fetchStatus]);
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
setIndexStatus(undefined);
|
|
59
|
-
}, [index]);
|
|
60
|
-
if (!indexStatus) {
|
|
61
|
-
return (_jsxs("div", { className: "flex flex-col h-full justify-center items-center gap-2 text-gray-500", children: [_jsx(Spinner, {}), "Loading..."] }));
|
|
62
|
-
}
|
|
63
|
-
async function setupIndexAndRefresh(index) {
|
|
64
|
-
await setupIndex(index);
|
|
65
|
-
setIndexStatus(undefined);
|
|
66
|
-
fetchStatus();
|
|
67
|
-
}
|
|
68
|
-
async function setupRebuildJobAndRefresh(index) {
|
|
69
|
-
await setupRebuildJob(index);
|
|
70
|
-
setIndexStatus(undefined);
|
|
71
|
-
fetchStatus();
|
|
72
|
-
}
|
|
73
|
-
async function rebuildIndexAndRefresh(index) {
|
|
74
|
-
await rebuildIndex(index);
|
|
75
|
-
setTimeout(() => {
|
|
76
|
-
fetchStatus();
|
|
77
|
-
}, 1000);
|
|
78
|
-
}
|
|
79
|
-
return (_jsxs("div", { className: "flex flex-col px-2 py-1 h-full", children: [_jsx("div", { className: "flex flex-row items-center border-b p-1 mb-3", children: _jsx("div", { className: "", children: index.name }) }), _jsxs("div", { className: "ml-2", children: [settingsItem && (_jsxs(_Fragment, { children: [_jsx(IndexProp, { headline: "Settings", children: _jsx("a", { className: "cursor-pointer underline", onClick: () => {
|
|
80
|
-
if (indexStatus.settingsItemId) {
|
|
81
|
-
editContext?.loadItem(indexStatus.settingsItemId);
|
|
82
|
-
editContext?.switchView("content-editor");
|
|
83
|
-
}
|
|
84
|
-
}, children: settingsItem.path }) }), _jsx(IndexProp, { headline: "Service", children: indexStatus.serviceUrl }), _jsx(IndexProp, { headline: "Name", children: indexStatus.name }), _jsxs(IndexProp, { headline: "Rebuild Job", children: [rebuildJobItem && (_jsxs(_Fragment, { children: [_jsx("a", { className: "cursor-pointer underline", onClick: () => {
|
|
85
|
-
if (indexStatus.rebuildJobItemId) {
|
|
86
|
-
editContext?.loadItem(indexStatus.rebuildJobItemId);
|
|
87
|
-
editContext?.switchView("content-editor");
|
|
88
|
-
}
|
|
89
|
-
}, children: rebuildJobItem.path }), indexStatus.canRebuild && !indexStatus.isRunning && (_jsx("div", { className: "my-2", children: _jsx(Button, { label: "Rebuild Index", onClick: () => {
|
|
90
|
-
rebuildIndexAndRefresh(index.name);
|
|
91
|
-
} }) })), indexStatus.isRunning && (_jsxs("div", { className: "my-2 flex flex-row items-center justify-start", children: [_jsxs("div", { className: "mr-2", style: { width: "20px" }, children: [_jsx(ProgressSpinner, { style: { width: "20px", height: "20px" } }), " "] }), "Rebuilding... ", indexStatus.rebuildCount.toLocaleString(), " ", "items, ", indexStatus.rebuildTokensCount.toLocaleString(), " ", "tokens"] }))] })), !rebuildJobItem && (_jsxs(_Fragment, { children: [_jsx("div", { className: "text-sm text-gray-500 mb-2", children: "No rebuild job found for this index" }), _jsx(Button, { label: "Setup Rebuild Job", onClick: () => {
|
|
92
|
-
setupRebuildJobAndRefresh(index.name);
|
|
93
|
-
} })] }))] }), _jsx(IndexProp, { headline: "Last Rebuild", children: indexStatus.lastRebuildStartDateTime
|
|
94
|
-
? new Date(indexStatus.lastRebuildStartDateTime).toLocaleString()
|
|
95
|
-
: "Never" }), indexStatus.exists && (_jsx(_Fragment, { children: _jsx(IndexProp, { headline: "Index Status", children: Object.entries(indexStatus.languages).map(([language, { numberOfItems, lastUpdated, status }]) => (_jsxs("div", { className: "flex items-center gap-2 text-xs", children: [_jsxs("div", { className: "font-bold", children: [language, ":"] }), _jsx("span", { className: `text-gray-500 ml-2 ${status === "Available"
|
|
96
|
-
? "text-green-500"
|
|
97
|
-
: "text-yellow-500"}`, children: status }), _jsxs("span", { className: "text-gray-500", children: ["Items: ", numberOfItems.toLocaleString(), " "] }), _jsxs("span", { className: "text-gray-500", children: ["Last updated: ", new Date(lastUpdated).toLocaleString()] })] }, language))) }) })), indexStatus.errors?.length > 0 && (_jsxs("div", { children: [_jsx("div", { children: "Errors:" }), indexStatus.errors.map((error, index) => (_jsxs("div", { className: "mt-2 p-2 bg-red-100 rounded-md text-red-800 border border-red-300 ", children: [_jsx("div", { className: "font-bold", children: error.message }), _jsx("div", { className: "text-sm", children: error.details })] }, index)))] }))] })), !indexStatus?.exists && (_jsxs("div", { children: [_jsx("div", { className: "text-sm text-gray-500 mb-2", children: "Index does not exist" }), _jsx(Button, { label: "Setup index", onClick: () => {
|
|
98
|
-
setupIndexAndRefresh(index.name);
|
|
99
|
-
} })] })), " "] })] }));
|
|
100
|
-
}
|
|
101
|
-
function IndexProp({ headline, children, }) {
|
|
102
|
-
return (_jsxs("div", { className: "mb-2", children: [_jsx("div", { className: "font-bold text-sm", children: headline }), _jsx("div", { className: "text-sm", children: children })] }));
|
|
103
|
-
}
|
|
104
|
-
//# sourceMappingURL=IndexSettings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IndexSettings.js","sourceRoot":"","sources":["../../../src/editor/control-center/IndexSettings.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAa,MAAM,OAAO,CAAC;AACpE,OAAO,EACL,cAAc,EACd,YAAY,EACZ,UAAU,EACV,eAAe,GAChB,MAAM,0BAA0B,CAA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