@docyrus/ui-pro-ai-assistant 0.5.4 → 0.5.6
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.js +196 -34
- package/dist/index.js.map +1 -1
- package/dist/tools/delete-record.d.ts +12 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5055,7 +5055,8 @@ async function fetchEnums(apiClient, dataSourceId, baseUrl) {
|
|
|
5055
5055
|
if (!res.success || !Array.isArray(res.data)) return null;
|
|
5056
5056
|
const byFieldId = /* @__PURE__ */ new Map();
|
|
5057
5057
|
for (const opt of res.data) {
|
|
5058
|
-
const
|
|
5058
|
+
const nestedField = opt.field;
|
|
5059
|
+
const fieldId = opt.fieldId || opt.field_id || opt.tenant_field_id || nestedField?.id;
|
|
5059
5060
|
if (!fieldId) continue;
|
|
5060
5061
|
let bucket = byFieldId.get(fieldId);
|
|
5061
5062
|
if (!bucket) {
|
|
@@ -10243,6 +10244,152 @@ function CreateRecord({
|
|
|
10243
10244
|
resultMessage && /* @__PURE__ */ jsx("div", { className: `text-xs font-medium ${resultError ? "text-destructive" : "text-green-600"}`, children: resultMessage })
|
|
10244
10245
|
] });
|
|
10245
10246
|
}
|
|
10247
|
+
function safeParseArray(value) {
|
|
10248
|
+
if (value == null) return null;
|
|
10249
|
+
if (Array.isArray(value)) return value.filter((id) => typeof id === "string");
|
|
10250
|
+
if (typeof value === "string") {
|
|
10251
|
+
try {
|
|
10252
|
+
const parsed = JSON.parse(value);
|
|
10253
|
+
return Array.isArray(parsed) ? parsed.filter((id) => typeof id === "string") : null;
|
|
10254
|
+
} catch {
|
|
10255
|
+
return null;
|
|
10256
|
+
}
|
|
10257
|
+
}
|
|
10258
|
+
return null;
|
|
10259
|
+
}
|
|
10260
|
+
function DeleteRecord({
|
|
10261
|
+
dataSourceId,
|
|
10262
|
+
recordId,
|
|
10263
|
+
recordIds,
|
|
10264
|
+
state,
|
|
10265
|
+
toolName = "deleteRecord",
|
|
10266
|
+
toolCallId,
|
|
10267
|
+
onToolAction
|
|
10268
|
+
}) {
|
|
10269
|
+
const apiClient = useApiClient();
|
|
10270
|
+
const [loading, setLoading] = useState(false);
|
|
10271
|
+
const [submitted, setSubmitted] = useState(false);
|
|
10272
|
+
const [resultMessage, setResultMessage] = useState("");
|
|
10273
|
+
const [resultError, setResultError] = useState(false);
|
|
10274
|
+
const { dataSource, loading: fieldsLoading } = useResolvedRecordFields(dataSourceId);
|
|
10275
|
+
const parsedRecordIds = useMemo(() => safeParseArray(recordIds), [recordIds]);
|
|
10276
|
+
const isBatch = parsedRecordIds != null && parsedRecordIds.length > 0;
|
|
10277
|
+
const recordCount = isBatch && parsedRecordIds ? parsedRecordIds.length : 1;
|
|
10278
|
+
const dataSourceName = dataSource?.name || "record";
|
|
10279
|
+
const emitResult = (input) => {
|
|
10280
|
+
onToolAction({
|
|
10281
|
+
tool: toolName,
|
|
10282
|
+
toolCallId,
|
|
10283
|
+
decision: "submit",
|
|
10284
|
+
input
|
|
10285
|
+
});
|
|
10286
|
+
};
|
|
10287
|
+
const handleApprove = async () => {
|
|
10288
|
+
if (!dataSource) {
|
|
10289
|
+
const message = "Data source metadata not available";
|
|
10290
|
+
setResultError(true);
|
|
10291
|
+
setResultMessage(message);
|
|
10292
|
+
emitResult({ success: false, error: message });
|
|
10293
|
+
return;
|
|
10294
|
+
}
|
|
10295
|
+
if (!isBatch && !recordId) {
|
|
10296
|
+
const message = "Either recordId or recordIds must be provided";
|
|
10297
|
+
setResultError(true);
|
|
10298
|
+
setResultMessage(message);
|
|
10299
|
+
emitResult({ success: false, error: message });
|
|
10300
|
+
return;
|
|
10301
|
+
}
|
|
10302
|
+
setLoading(true);
|
|
10303
|
+
setResultError(false);
|
|
10304
|
+
try {
|
|
10305
|
+
const { appSlug, dsSlug } = dataSource;
|
|
10306
|
+
const baseEndpoint = `/apps/${appSlug}/data-sources/${dsSlug}/items/`;
|
|
10307
|
+
const result = isBatch && parsedRecordIds ? await apiClient.deleteWithBody(baseEndpoint, { recordIds: parsedRecordIds }) : await apiClient.delete(`${baseEndpoint}${recordId}`);
|
|
10308
|
+
if (!result?.success) {
|
|
10309
|
+
throw new Error(
|
|
10310
|
+
typeof result?.error === "string" ? result.error : "Failed to delete record(s)"
|
|
10311
|
+
);
|
|
10312
|
+
}
|
|
10313
|
+
setSubmitted(true);
|
|
10314
|
+
setResultMessage(
|
|
10315
|
+
isBatch ? `${recordCount} record(s) deleted successfully` : "Record deleted successfully"
|
|
10316
|
+
);
|
|
10317
|
+
emitResult({
|
|
10318
|
+
success: true,
|
|
10319
|
+
data: result.data,
|
|
10320
|
+
count: isBatch ? recordCount : 1
|
|
10321
|
+
});
|
|
10322
|
+
} catch (error) {
|
|
10323
|
+
const message = error instanceof Error ? error.message : "Failed to delete record(s)";
|
|
10324
|
+
console.warn("[delete-record] delete failed", error);
|
|
10325
|
+
setResultError(true);
|
|
10326
|
+
setResultMessage(message);
|
|
10327
|
+
emitResult({ success: false, error: message });
|
|
10328
|
+
} finally {
|
|
10329
|
+
setLoading(false);
|
|
10330
|
+
}
|
|
10331
|
+
};
|
|
10332
|
+
const handleReject = () => {
|
|
10333
|
+
setSubmitted(true);
|
|
10334
|
+
setResultError(true);
|
|
10335
|
+
setResultMessage("Deletion cancelled by user");
|
|
10336
|
+
emitResult({ success: false, error: "User cancelled the deletion" });
|
|
10337
|
+
};
|
|
10338
|
+
const showActionButtons = state !== "output-available" && !submitted;
|
|
10339
|
+
return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4 space-y-3", children: [
|
|
10340
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
10341
|
+
/* @__PURE__ */ jsx(Trash2, { className: "size-5 text-rose-500" }),
|
|
10342
|
+
/* @__PURE__ */ jsx("h4", { className: "font-medium text-sm", children: isBatch ? `Delete ${recordCount} ${dataSourceName}` : `Delete ${dataSourceName}` })
|
|
10343
|
+
] }),
|
|
10344
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: isBatch ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10345
|
+
recordCount,
|
|
10346
|
+
" record(s) will be permanently deleted."
|
|
10347
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10348
|
+
"Record ",
|
|
10349
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono", children: recordId || "-" }),
|
|
10350
|
+
" will be permanently deleted."
|
|
10351
|
+
] }) }),
|
|
10352
|
+
fieldsLoading && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
10353
|
+
/* @__PURE__ */ jsx(Loader2, { className: "size-3.5 animate-spin" }),
|
|
10354
|
+
"Loading data source\u2026"
|
|
10355
|
+
] }),
|
|
10356
|
+
showActionButtons && /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
10357
|
+
/* @__PURE__ */ jsxs(
|
|
10358
|
+
Button,
|
|
10359
|
+
{
|
|
10360
|
+
variant: "destructive",
|
|
10361
|
+
size: "sm",
|
|
10362
|
+
disabled: loading || fieldsLoading,
|
|
10363
|
+
onClick: handleApprove,
|
|
10364
|
+
children: [
|
|
10365
|
+
loading ? /* @__PURE__ */ jsx(Loader2, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ jsx(Trash2, { className: "size-3.5" }),
|
|
10366
|
+
isBatch ? `Delete ${recordCount} Records` : "Delete Record"
|
|
10367
|
+
]
|
|
10368
|
+
}
|
|
10369
|
+
),
|
|
10370
|
+
/* @__PURE__ */ jsxs(
|
|
10371
|
+
Button,
|
|
10372
|
+
{
|
|
10373
|
+
variant: "outline",
|
|
10374
|
+
size: "sm",
|
|
10375
|
+
disabled: loading,
|
|
10376
|
+
onClick: handleReject,
|
|
10377
|
+
children: [
|
|
10378
|
+
/* @__PURE__ */ jsx(XCircle, { className: "size-3.5" }),
|
|
10379
|
+
"Cancel"
|
|
10380
|
+
]
|
|
10381
|
+
}
|
|
10382
|
+
)
|
|
10383
|
+
] }),
|
|
10384
|
+
resultMessage && /* @__PURE__ */ jsx(
|
|
10385
|
+
"div",
|
|
10386
|
+
{
|
|
10387
|
+
className: `text-xs font-medium ${resultError ? "text-destructive" : "text-emerald-600"}`,
|
|
10388
|
+
children: resultMessage
|
|
10389
|
+
}
|
|
10390
|
+
)
|
|
10391
|
+
] });
|
|
10392
|
+
}
|
|
10246
10393
|
function safeParse2(value) {
|
|
10247
10394
|
if (value == null) return null;
|
|
10248
10395
|
if (typeof value === "string") {
|
|
@@ -13881,6 +14028,20 @@ function GenerativeUITool({
|
|
|
13881
14028
|
}
|
|
13882
14029
|
) });
|
|
13883
14030
|
}
|
|
14031
|
+
if (toolName === "deleteRecord") {
|
|
14032
|
+
return /* @__PURE__ */ jsx("div", { className: "not-prose mb-4 w-full", children: /* @__PURE__ */ jsx(
|
|
14033
|
+
DeleteRecord,
|
|
14034
|
+
{
|
|
14035
|
+
dataSourceId: part.input?.dataSourceId,
|
|
14036
|
+
recordId: part.input?.recordId,
|
|
14037
|
+
recordIds: part.input?.recordIds,
|
|
14038
|
+
state: part.state,
|
|
14039
|
+
toolName,
|
|
14040
|
+
toolCallId: part.toolCallId,
|
|
14041
|
+
onToolAction
|
|
14042
|
+
}
|
|
14043
|
+
) });
|
|
14044
|
+
}
|
|
13884
14045
|
if (toolName === "showCreateRecordForm" || toolName === "showUpdateRecordForm" || toolName === "showRecordDetailsForm") {
|
|
13885
14046
|
const recordMode = toolName === "showCreateRecordForm" ? "add" : toolName === "showUpdateRecordForm" ? "edit" : "view";
|
|
13886
14047
|
const dataSourceId = part.input?.dataSourceId || part.output?.result?.dataSourceId;
|
|
@@ -14392,7 +14553,8 @@ var INTERACTIVE_GENERATIVE_TOOLS = /* @__PURE__ */ new Set([
|
|
|
14392
14553
|
"requestUserInput",
|
|
14393
14554
|
"createRecord",
|
|
14394
14555
|
"updateRecord",
|
|
14395
|
-
"viewRecord"
|
|
14556
|
+
"viewRecord",
|
|
14557
|
+
"deleteRecord"
|
|
14396
14558
|
]);
|
|
14397
14559
|
function CopyButton({ text }) {
|
|
14398
14560
|
const { t } = useAssistantTranslation();
|
|
@@ -17737,7 +17899,7 @@ var buttonVariants = cva(
|
|
|
17737
17899
|
}
|
|
17738
17900
|
}
|
|
17739
17901
|
);
|
|
17740
|
-
var
|
|
17902
|
+
var Button31 = withTooltip(({
|
|
17741
17903
|
active,
|
|
17742
17904
|
asChild = false,
|
|
17743
17905
|
children,
|
|
@@ -18345,7 +18507,7 @@ function AIMenu() {
|
|
|
18345
18507
|
}
|
|
18346
18508
|
),
|
|
18347
18509
|
/* @__PURE__ */ jsx(
|
|
18348
|
-
|
|
18510
|
+
Button31,
|
|
18349
18511
|
{
|
|
18350
18512
|
className: "no-focus-ring mt-1 shrink-0",
|
|
18351
18513
|
disabled: !isLoading && input.trim().length === 0,
|
|
@@ -19219,7 +19381,7 @@ function Comment(props) {
|
|
|
19219
19381
|
] }),
|
|
19220
19382
|
isMyComment && (hovering || dropdownOpen) && /* @__PURE__ */ jsxs("div", { className: "absolute top-0 right-0 flex space-x-1", children: [
|
|
19221
19383
|
index === 0 && /* @__PURE__ */ jsx(
|
|
19222
|
-
|
|
19384
|
+
Button31,
|
|
19223
19385
|
{
|
|
19224
19386
|
className: "h-6 p-1 text-muted-foreground",
|
|
19225
19387
|
onClick: onResolveComment,
|
|
@@ -19268,7 +19430,7 @@ function Comment(props) {
|
|
|
19268
19430
|
),
|
|
19269
19431
|
isEditing && /* @__PURE__ */ jsxs("div", { className: "ml-auto flex shrink-0 gap-1", children: [
|
|
19270
19432
|
/* @__PURE__ */ jsx(
|
|
19271
|
-
|
|
19433
|
+
Button31,
|
|
19272
19434
|
{
|
|
19273
19435
|
className: "size-[28px]",
|
|
19274
19436
|
onClick: (e) => {
|
|
@@ -19281,7 +19443,7 @@ function Comment(props) {
|
|
|
19281
19443
|
}
|
|
19282
19444
|
),
|
|
19283
19445
|
/* @__PURE__ */ jsx(
|
|
19284
|
-
|
|
19446
|
+
Button31,
|
|
19285
19447
|
{
|
|
19286
19448
|
onClick: (e) => {
|
|
19287
19449
|
e.stopPropagation();
|
|
@@ -19349,7 +19511,7 @@ function CommentMoreDropdown(props) {
|
|
|
19349
19511
|
onOpenChange: setDropdownOpen,
|
|
19350
19512
|
open: dropdownOpen,
|
|
19351
19513
|
children: [
|
|
19352
|
-
/* @__PURE__ */ jsx(DropdownMenuTrigger3, { asChild: true, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(
|
|
19514
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger3, { asChild: true, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(Button31, { className: cn("h-6 p-1 text-muted-foreground"), variant: "ghost", children: /* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "size-4" }) }) }),
|
|
19353
19515
|
/* @__PURE__ */ jsx(
|
|
19354
19516
|
DropdownMenuContent3,
|
|
19355
19517
|
{
|
|
@@ -19521,7 +19683,7 @@ function CommentCreateForm({
|
|
|
19521
19683
|
}
|
|
19522
19684
|
),
|
|
19523
19685
|
/* @__PURE__ */ jsx(
|
|
19524
|
-
|
|
19686
|
+
Button31,
|
|
19525
19687
|
{
|
|
19526
19688
|
className: "absolute right-0 bottom-0 ml-auto shrink-0",
|
|
19527
19689
|
disabled: commentContent.trim().length === 0,
|
|
@@ -19855,7 +20017,7 @@ function BlockSuggestionCard({
|
|
|
19855
20017
|
)),
|
|
19856
20018
|
hovering && /* @__PURE__ */ jsxs("div", { className: "absolute top-4 right-4 flex gap-2", children: [
|
|
19857
20019
|
/* @__PURE__ */ jsx(
|
|
19858
|
-
|
|
20020
|
+
Button31,
|
|
19859
20021
|
{
|
|
19860
20022
|
variant: "ghost",
|
|
19861
20023
|
className: "size-6 p-1 text-muted-foreground",
|
|
@@ -19864,7 +20026,7 @@ function BlockSuggestionCard({
|
|
|
19864
20026
|
}
|
|
19865
20027
|
),
|
|
19866
20028
|
/* @__PURE__ */ jsx(
|
|
19867
|
-
|
|
20029
|
+
Button31,
|
|
19868
20030
|
{
|
|
19869
20031
|
variant: "ghost",
|
|
19870
20032
|
className: "size-6 p-1 text-muted-foreground",
|
|
@@ -20334,7 +20496,7 @@ var BlockCommentsContent = ({
|
|
|
20334
20496
|
}
|
|
20335
20497
|
),
|
|
20336
20498
|
totalCount > 0 && /* @__PURE__ */ jsx("div", { className: "relative left-0 size-0 select-none", children: /* @__PURE__ */ jsx(PopoverTrigger11, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
20337
|
-
|
|
20499
|
+
Button31,
|
|
20338
20500
|
{
|
|
20339
20501
|
className: "mt-1 ml-1 flex h-6 gap-1 px-1.5 py-0 text-muted-foreground/80 hover:text-muted-foreground/80 data-[active=true]:bg-muted",
|
|
20340
20502
|
contentEditable: false,
|
|
@@ -22250,7 +22412,7 @@ function BlockActionButton({
|
|
|
22250
22412
|
const editor = useEditorRef();
|
|
22251
22413
|
const element = useElement();
|
|
22252
22414
|
return /* @__PURE__ */ jsx(
|
|
22253
|
-
|
|
22415
|
+
Button31,
|
|
22254
22416
|
{
|
|
22255
22417
|
className: cn(
|
|
22256
22418
|
defaultStyles && "absolute top-1 right-1 opacity-0 transition-opacity group-hover:opacity-100",
|
|
@@ -22589,7 +22751,7 @@ function EmojiPickerSearchAndClear({
|
|
|
22589
22751
|
}
|
|
22590
22752
|
),
|
|
22591
22753
|
searchValue && /* @__PURE__ */ jsx(
|
|
22592
|
-
|
|
22754
|
+
Button31,
|
|
22593
22755
|
{
|
|
22594
22756
|
"aria-label": "Clear",
|
|
22595
22757
|
className: cn(
|
|
@@ -22678,7 +22840,7 @@ function EmojiPickerNavigation({
|
|
|
22678
22840
|
id: "emoji-nav",
|
|
22679
22841
|
children: /* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
|
|
22680
22842
|
emojiLibrary.getGrid().sections().map(({ id }) => /* @__PURE__ */ jsx(
|
|
22681
|
-
|
|
22843
|
+
Button31,
|
|
22682
22844
|
{
|
|
22683
22845
|
"aria-label": i18n.categories[id],
|
|
22684
22846
|
className: cn(
|
|
@@ -22840,7 +23002,7 @@ function CalloutElement(props) {
|
|
|
22840
23002
|
{
|
|
22841
23003
|
...emojiToolbarDropdownProps,
|
|
22842
23004
|
control: /* @__PURE__ */ jsx(
|
|
22843
|
-
|
|
23005
|
+
Button31,
|
|
22844
23006
|
{
|
|
22845
23007
|
className: "size-6 select-none p-1 text-[18px] hover:bg-muted-foreground/15",
|
|
22846
23008
|
contentEditable: false,
|
|
@@ -23079,7 +23241,7 @@ function CodeBlockElement(props) {
|
|
|
23079
23241
|
contentEditable: false,
|
|
23080
23242
|
children: [
|
|
23081
23243
|
/* @__PURE__ */ jsxs(
|
|
23082
|
-
|
|
23244
|
+
Button31,
|
|
23083
23245
|
{
|
|
23084
23246
|
className: "relative top-0 right-0 w-auto",
|
|
23085
23247
|
onClick: () => {
|
|
@@ -23124,7 +23286,7 @@ function CodeBlockCombobox({ className }) {
|
|
|
23124
23286
|
if (readOnly) return null;
|
|
23125
23287
|
return /* @__PURE__ */ jsxs(Popover11, { onOpenChange: setOpen, open, children: [
|
|
23126
23288
|
/* @__PURE__ */ jsx(PopoverTrigger11, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
23127
|
-
|
|
23289
|
+
Button31,
|
|
23128
23290
|
{
|
|
23129
23291
|
"aria-expanded": open,
|
|
23130
23292
|
className: cn(
|
|
@@ -23485,7 +23647,7 @@ function Draggable(props) {
|
|
|
23485
23647
|
),
|
|
23486
23648
|
children: [
|
|
23487
23649
|
/* @__PURE__ */ jsx(
|
|
23488
|
-
|
|
23650
|
+
Button31,
|
|
23489
23651
|
{
|
|
23490
23652
|
className: "absolute right-0 h-6 w-6 p-0",
|
|
23491
23653
|
"data-plate-prevent-deselect": true,
|
|
@@ -23672,7 +23834,7 @@ var DraggableInsertHandle = () => {
|
|
|
23672
23834
|
const editor = useEditorRef();
|
|
23673
23835
|
const element = useElement();
|
|
23674
23836
|
return /* @__PURE__ */ jsx(
|
|
23675
|
-
|
|
23837
|
+
Button31,
|
|
23676
23838
|
{
|
|
23677
23839
|
className: "size-6 shrink-0 p-1",
|
|
23678
23840
|
onClick: (event) => {
|
|
@@ -24903,7 +25065,7 @@ function EquationPopoverContent({
|
|
|
24903
25065
|
...props
|
|
24904
25066
|
}
|
|
24905
25067
|
),
|
|
24906
|
-
/* @__PURE__ */ jsxs(
|
|
25068
|
+
/* @__PURE__ */ jsxs(Button31, { className: "px-3", onClick: onClose, variant: "brand", children: [
|
|
24907
25069
|
"Done ",
|
|
24908
25070
|
/* @__PURE__ */ jsx(CornerDownLeftIcon, { className: "size-3.5" })
|
|
24909
25071
|
] })
|
|
@@ -25781,7 +25943,7 @@ function MediaPlaceholderPopover({ children }) {
|
|
|
25781
25943
|
/* @__PURE__ */ jsx(TabsTrigger, { value: "password", children: "Embed link" })
|
|
25782
25944
|
] }),
|
|
25783
25945
|
/* @__PURE__ */ jsxs(TabsContent, { className: "w-[300px] px-3 py-2", value: "account", children: [
|
|
25784
|
-
/* @__PURE__ */ jsx(
|
|
25946
|
+
/* @__PURE__ */ jsx(Button31, { className: "w-full", onClick: openFilePicker, variant: "brand", children: currentMedia.buttonText }),
|
|
25785
25947
|
/* @__PURE__ */ jsx("div", { className: "mt-3 text-muted-foreground text-xs", children: "The maximum size per file is 5MB" })
|
|
25786
25948
|
] }),
|
|
25787
25949
|
/* @__PURE__ */ jsxs(
|
|
@@ -25799,7 +25961,7 @@ function MediaPlaceholderPopover({ children }) {
|
|
|
25799
25961
|
}
|
|
25800
25962
|
),
|
|
25801
25963
|
/* @__PURE__ */ jsx(
|
|
25802
|
-
|
|
25964
|
+
Button31,
|
|
25803
25965
|
{
|
|
25804
25966
|
className: "mt-2 w-full max-w-[300px]",
|
|
25805
25967
|
onClick: () => onEmbed(embedValue),
|
|
@@ -25919,12 +26081,12 @@ function ImagePreview() {
|
|
|
25919
26081
|
onClick: (e) => e.stopPropagation(),
|
|
25920
26082
|
children: [
|
|
25921
26083
|
!prevDisabled && !nextDisabled && /* @__PURE__ */ jsxs("div", { className: "flex rounded-sm bg-black/70", children: [
|
|
25922
|
-
/* @__PURE__ */ jsx(
|
|
25923
|
-
/* @__PURE__ */ jsx(
|
|
26084
|
+
/* @__PURE__ */ jsx(Button31, { ...prevProps, disabled: prevDisabled, children: /* @__PURE__ */ jsx(ArrowLeftIcon, { className: "size-5" }) }),
|
|
26085
|
+
/* @__PURE__ */ jsx(Button31, { ...nextProps, disabled: nextDisabled, children: /* @__PURE__ */ jsx(ArrowRightIcon, { className: "size-5" }) })
|
|
25924
26086
|
] }),
|
|
25925
26087
|
currentPreview && /* @__PURE__ */ jsxs("div", { className: "flex rounded-sm bg-black/70", children: [
|
|
25926
26088
|
/* @__PURE__ */ jsx(
|
|
25927
|
-
|
|
26089
|
+
Button31,
|
|
25928
26090
|
{
|
|
25929
26091
|
...zommOutProps,
|
|
25930
26092
|
disabled: zoomOutDisabled,
|
|
@@ -25937,7 +26099,7 @@ function ImagePreview() {
|
|
|
25937
26099
|
/* @__PURE__ */ jsx("div", { children: "%" })
|
|
25938
26100
|
] }),
|
|
25939
26101
|
/* @__PURE__ */ jsx(
|
|
25940
|
-
|
|
26102
|
+
Button31,
|
|
25941
26103
|
{
|
|
25942
26104
|
...zoomInProps,
|
|
25943
26105
|
disabled: zoomInDisabled,
|
|
@@ -25946,7 +26108,7 @@ function ImagePreview() {
|
|
|
25946
26108
|
}
|
|
25947
26109
|
),
|
|
25948
26110
|
/* @__PURE__ */ jsx(
|
|
25949
|
-
|
|
26111
|
+
Button31,
|
|
25950
26112
|
{
|
|
25951
26113
|
onClick: () => {
|
|
25952
26114
|
void downloadFile(currentPreview.url, currentPreview.id);
|
|
@@ -25955,7 +26117,7 @@ function ImagePreview() {
|
|
|
25955
26117
|
children: /* @__PURE__ */ jsx(CircleArrowDown, { className: "size-4" })
|
|
25956
26118
|
}
|
|
25957
26119
|
),
|
|
25958
|
-
/* @__PURE__ */ jsx(
|
|
26120
|
+
/* @__PURE__ */ jsx(Button31, { ...closeProps, tooltip: "Close", children: /* @__PURE__ */ jsx(Minimize2, { className: "size-4" }) })
|
|
25959
26121
|
] })
|
|
25960
26122
|
]
|
|
25961
26123
|
}
|
|
@@ -26595,7 +26757,7 @@ var TableElement = withHOC(
|
|
|
26595
26757
|
"group-has-[tr:last-child:hover]/table:opacity-100 max-sm:group-has-[tr[data-selected]:last-child]/table:opacity-100"
|
|
26596
26758
|
),
|
|
26597
26759
|
children: /* @__PURE__ */ jsx(
|
|
26598
|
-
|
|
26760
|
+
Button31,
|
|
26599
26761
|
{
|
|
26600
26762
|
className: "flex h-4 w-full grow items-center justify-center bg-muted",
|
|
26601
26763
|
onClick: () => tf.insert.tableRow({ at: editor.api.findPath(element) }),
|
|
@@ -26617,7 +26779,7 @@ var TableElement = withHOC(
|
|
|
26617
26779
|
"group-has-[td:last-child:hover,th:last-child:hover]/table:opacity-100 max-sm:group-has-[td[data-selected]:last-child,th[data-selected]:last-child]/table:opacity-100"
|
|
26618
26780
|
),
|
|
26619
26781
|
children: /* @__PURE__ */ jsx(
|
|
26620
|
-
|
|
26782
|
+
Button31,
|
|
26621
26783
|
{
|
|
26622
26784
|
className: "flex h-full w-4 grow items-center justify-center bg-muted",
|
|
26623
26785
|
onClick: () => tf.insert.tableColumn({
|
|
@@ -26641,7 +26803,7 @@ var TableElement = withHOC(
|
|
|
26641
26803
|
"group-has-[td:last-child:hover,th:last-child:hover]/table:group-has-[tr:last-child:hover]/table:opacity-100 max-sm:group-has-[td[data-selected]:last-child,th[data-selected]:last-child]/table:group-has-[tr[data-selected]:last-child]/table:opacity-100"
|
|
26642
26804
|
),
|
|
26643
26805
|
children: /* @__PURE__ */ jsx(
|
|
26644
|
-
|
|
26806
|
+
Button31,
|
|
26645
26807
|
{
|
|
26646
26808
|
className: "flex size-4 items-center justify-center rounded-full bg-muted",
|
|
26647
26809
|
onClick: () => {
|
|
@@ -26847,7 +27009,7 @@ function TocElement(props) {
|
|
|
26847
27009
|
const { headingList } = state;
|
|
26848
27010
|
return /* @__PURE__ */ jsxs(PlateElement, { ...props, className: "my-1", children: [
|
|
26849
27011
|
/* @__PURE__ */ jsx("div", { contentEditable: false, children: headingList.length > 0 ? headingList.map((item) => /* @__PURE__ */ jsx(
|
|
26850
|
-
|
|
27012
|
+
Button31,
|
|
26851
27013
|
{
|
|
26852
27014
|
"aria-current": true,
|
|
26853
27015
|
className: headingItemVariants({ depth: item.depth }),
|
|
@@ -27949,7 +28111,7 @@ function TocElementStatic(props) {
|
|
|
27949
28111
|
const headingList = getHeadingList(editor);
|
|
27950
28112
|
return /* @__PURE__ */ jsxs(SlateElement, { ...props, className: "mb-1 p-0", children: [
|
|
27951
28113
|
/* @__PURE__ */ jsx("div", { children: headingList.length > 0 ? headingList.map((item) => /* @__PURE__ */ jsx(
|
|
27952
|
-
|
|
28114
|
+
Button31,
|
|
27953
28115
|
{
|
|
27954
28116
|
className: headingItemVariants2({ depth: item.depth }),
|
|
27955
28117
|
variant: "ghost",
|