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