@agent-native/core 0.189.0 → 0.190.0-nightly-20260925215540
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/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/analysis-workspace/SKILL.md +10 -0
- package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +1 -1
- package/corpus/templates/analytics/AGENTS.md +11 -22
- package/corpus/templates/analytics/actions/list-data-dictionary.ts +7 -9
- package/corpus/templates/analytics/actions/search-analytics-query-catalog.ts +1 -1
- package/corpus/templates/analytics/app/components/AnalyticsReviewArtifactPreview.tsx +201 -0
- package/corpus/templates/analytics/app/i18n/en-US.ts +2 -0
- package/corpus/templates/analytics/app/pages/Settings.tsx +50 -3
- package/corpus/templates/analytics/changelog/2026-09-25-first-run-onboarding-records-setup-choices-and-builder-conne.md +6 -0
- package/corpus/templates/analytics/changelog/2026-09-25-human-review-previews-analytics-dashboards-as-real-charts.md +6 -0
- package/corpus/templates/analytics/changelog/2026-09-25-org-admins-can-review-agent-runs-from-settings.md +6 -0
- package/corpus/templates/analytics/changelog/2026-09-25-proactive-query-context.md +6 -0
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +98 -2
- package/corpus/templates/analytics/server/lib/analytics-agent-context.ts +557 -0
- package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +217 -46
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +2 -2
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +39 -5
- package/corpus/templates/analytics/server/lib/data-dictionary-context.ts +4 -0
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +268 -2
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +44 -9
- package/corpus/templates/calendar/AGENTS.md +5 -0
- package/corpus/templates/calendar/CHANGELOG.md +6 -0
- package/corpus/templates/calendar/actions/get-event-rules-status.ts +47 -0
- package/corpus/templates/calendar/actions/list-events.ts +50 -4
- package/corpus/templates/calendar/actions/undo-calendar-event-rule.ts +229 -0
- package/corpus/templates/calendar/actions/update-settings.ts +8 -0
- package/corpus/templates/calendar/app/i18n/en-US.ts +27 -0
- package/corpus/templates/calendar/app/pages/Settings.tsx +196 -1
- package/corpus/templates/calendar/changelog/2026-09-25-calendar-feeds-with-the-same-url-keep-their-own-names-and-co.md +6 -0
- package/corpus/templates/calendar/changelog/2026-09-25-calendar-invitation-rules-surface-expired-connections-and-un.md +6 -0
- package/corpus/templates/calendar/changelog/2026-09-25-restore-locally-hidden-events-from-activity-after-disconnect.md +6 -0
- package/corpus/templates/calendar/server/lib/calendar-settings.ts +44 -10
- package/corpus/templates/calendar/server/lib/google-api.ts +15 -1
- package/corpus/templates/calendar/server/lib/google-calendar.ts +1 -1
- package/corpus/templates/calendar/server/plugins/event-rules.ts +628 -0
- package/corpus/templates/calendar/shared/api.ts +13 -0
- package/corpus/templates/calendar/shared/settings.ts +71 -1
- package/corpus/templates/clips/actions/create-recording.ts +83 -2
- package/corpus/templates/clips/actions/finalize-recording.ts +610 -110
- package/corpus/templates/clips/actions/get-recording-player-data.ts +6 -0
- package/corpus/templates/clips/actions/import-loom-recording.ts +2 -0
- package/corpus/templates/clips/actions/lib/create-recording-schema.ts +7 -0
- package/corpus/templates/clips/actions/lib/loom-import-job.ts +15 -1
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +126 -26
- package/corpus/templates/clips/app/hooks/use-drop-video-upload.ts +75 -15
- package/corpus/templates/clips/app/routes/_app.r.$recordingId.tsx +5 -1
- package/corpus/templates/clips/app/routes/record.tsx +134 -40
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +13 -1
- package/corpus/templates/clips/changelog/2026-09-25-signed-in-viewers-who-hit-an-unavailable-expired-or-private-.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/background.ts +3 -0
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +73 -16
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +188 -18
- package/corpus/templates/clips/desktop/src/lib/recording-request.ts +1 -0
- package/corpus/templates/clips/server/db/schema.ts +4 -0
- package/corpus/templates/clips/server/jobs/media-verification.ts +78 -4
- package/corpus/templates/clips/server/jobs/recording-failure-backfill.ts +142 -0
- package/corpus/templates/clips/server/lib/media-verification-state.ts +29 -0
- package/corpus/templates/clips/server/lib/post-finalize-dispatch.ts +2 -0
- package/corpus/templates/clips/server/lib/recording-failures.ts +111 -0
- package/corpus/templates/clips/server/lib/recordings.ts +6 -1
- package/corpus/templates/clips/server/lib/s3-upload-provider.ts +8 -3
- package/corpus/templates/clips/server/lib/upload-lease.ts +25 -6
- package/corpus/templates/clips/server/plugins/calendar-jobs.ts +2 -0
- package/corpus/templates/clips/server/plugins/db.ts +18 -0
- package/corpus/templates/clips/server/routes/api/_agent-native-background/post-finalize-worker.post.ts +48 -5
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/abort.post.ts +322 -31
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +223 -61
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/interrupt.post.ts +62 -4
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/reset-chunks.post.ts +74 -7
- package/corpus/templates/clips/shared/recording-core.ts +27 -0
- package/corpus/templates/design/actions/get-design.ts +35 -6
- package/corpus/templates/mail/.agents/skills/inbox-automations/SKILL.md +4 -0
- package/corpus/templates/mail/actions/consolidate-ai-filter-rules.ts +41 -0
- package/corpus/templates/mail/actions/get-ai-priority.ts +48 -8
- package/corpus/templates/mail/actions/record-ai-priority-feedback.ts +69 -0
- package/corpus/templates/mail/actions/update-mail-preferences.ts +2 -0
- package/corpus/templates/mail/app/components/email/EmailList.tsx +179 -32
- package/corpus/templates/mail/app/components/email/EmailListItem.tsx +97 -9
- package/corpus/templates/mail/app/components/email/EmailThread.tsx +55 -1
- package/corpus/templates/mail/app/components/email/ImportanceFeedbackMenu.tsx +52 -0
- package/corpus/templates/mail/app/components/email/compose-autocomplete.ts +2 -1
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +219 -188
- package/corpus/templates/mail/app/components/onboarding/AiInboxSetup.tsx +338 -0
- package/corpus/templates/mail/app/components/settings/AiFilterSection.tsx +597 -781
- package/corpus/templates/mail/app/components/settings/AiRulePromptField.tsx +37 -0
- package/corpus/templates/mail/app/global.css +42 -26
- package/corpus/templates/mail/app/hooks/use-ai-priority-feedback.ts +43 -0
- package/corpus/templates/mail/app/hooks/use-automations.ts +23 -0
- package/corpus/templates/mail/app/i18n/en-US.ts +58 -3
- package/corpus/templates/mail/app/pages/InboxPage.tsx +47 -10
- package/corpus/templates/mail/changelog/2026-09-25-editing-importance-rules-preserves-disabled-instructions-and.md +6 -0
- package/corpus/templates/mail/changelog/2026-09-25-handle-astral-unicode-letters-in-autocomplete-word-boundarie.md +6 -0
- package/corpus/templates/mail/changelog/2026-09-25-jev-priority-feedback-and-inbox-settings.md +6 -0
- package/corpus/templates/mail/changelog/2026-09-25-keep-existing-ai-filter-rules-intact-when-saving-a-prompt.md +6 -0
- package/corpus/templates/mail/server/lib/automation-engine.ts +21 -12
- package/corpus/templates/mail/server/lib/automations.ts +100 -1
- package/corpus/templates/mail/shared/types.ts +3 -0
- package/corpus/templates/plan/app/i18n/en-US.ts +6 -0
- package/corpus/templates/plan/app/lib/plan-invite-suggestion.ts +43 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +249 -4
- package/corpus/templates/slides/actions/create-deck.ts +11 -1
- package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +117 -1
- package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +373 -330
- package/corpus/templates/slides/app/components/design-system/builder-index-response.ts +36 -5
- package/corpus/templates/slides/app/components/editor/BlockBubbleMenu.tsx +21 -53
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +347 -671
- package/corpus/templates/slides/app/components/editor/bullet-editing.ts +55 -8
- package/corpus/templates/slides/app/components/editor/in-place-text-session.ts +2082 -0
- package/corpus/templates/slides/app/components/editor/list-editing.ts +174 -16
- package/corpus/templates/slides/app/components/editor/rich-text-selection.ts +497 -62
- package/corpus/templates/slides/app/components/editor/slide-text-targets.ts +102 -20
- package/corpus/templates/slides/app/context/DeckContext.tsx +9 -4
- package/corpus/templates/slides/app/global.css +7 -219
- package/corpus/templates/slides/app/i18n/en-US.ts +3 -0
- package/corpus/templates/slides/app/lib/sanitize-slide-html.ts +7 -0
- package/corpus/templates/slides/app/lib/slide-image-replacement.ts +203 -1
- package/corpus/templates/slides/app/lib/slide-source-map.ts +43 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +182 -4
- package/corpus/templates/slides/app/routes/settings.tsx +33 -2
- package/corpus/templates/slides/changelog/2026-09-25-improve-slides-design-system-setup-feedback.md +6 -0
- package/corpus/templates/slides/changelog/2026-09-25-org-admins-can-review-agent-runs-from-settings.md +6 -0
- package/corpus/templates/slides/changelog/2026-09-25-text-on-a-slide-is-now-edited-in-place-clicking-into-it-chan.md +6 -0
- package/corpus/templates/slides/package.json +0 -12
- package/corpus/templates/slides/scripts/edit-fidelity/README.md +4 -2
- package/corpus/templates/slides/scripts/edit-fidelity/run.ts +12 -3
- package/corpus/templates/slides/vite.config.ts +1 -10
- package/dist/agent/jev-tool-prefetch.d.ts +29 -3
- package/dist/agent/jev-tool-prefetch.js +161 -34
- package/dist/agent/production-agent.d.ts +11 -0
- package/dist/agent/production-agent.js +39 -8
- package/dist/app-config/runtime.d.ts +1 -0
- package/dist/app-config/runtime.js +4 -0
- package/dist/app-config/schema.d.ts +1 -0
- package/dist/client/AgentSidebar.d.ts +3 -1
- package/dist/client/AgentSidebar.js +8 -12
- package/dist/client/analytics/index.d.ts +1 -1
- package/dist/client/analytics/index.js +1 -1
- package/dist/client/analytics.d.ts +2 -0
- package/dist/client/analytics.js +9 -0
- package/dist/client/api-path.js +5 -2
- package/dist/client/chat/run-recovery.d.ts +0 -3
- package/dist/client/chat/run-recovery.js +13 -23
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/observability/ObservabilityDashboard.d.ts +3 -0
- package/dist/client/observability/ObservabilityDashboard.js +366 -71
- package/dist/client/observability/ObservabilityReviewSummaryButton.d.ts +4 -1
- package/dist/client/observability/ObservabilityReviewSummaryButton.js +13 -9
- package/dist/client/observability/OutputPreview.d.ts +9 -4
- package/dist/client/observability/OutputPreview.js +230 -52
- package/dist/client/onboarding/FirstRunOnboarding.js +67 -4
- package/dist/client/onboarding/use-onboarding.js +2 -0
- package/dist/client/sharing/ShareButton.d.ts +2 -0
- package/dist/client/sharing/ShareButton.js +1 -0
- package/dist/client/sharing/useShareButtonController.d.ts +1 -0
- package/dist/client/sharing/useShareButtonController.js +29 -8
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/deploy/build.js +9 -1
- package/dist/embeddings/index.d.ts +3 -1
- package/dist/embeddings/index.js +20 -10
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/jobs/sweep-hooks.d.ts +7 -0
- package/dist/jobs/sweep-hooks.js +28 -0
- package/dist/localization/default-messages.d.ts +1 -0
- package/dist/localization/default-messages.js +1 -0
- package/dist/notifications/routes.d.ts +6 -6
- package/dist/observability/actions/authorization.d.ts +1 -0
- package/dist/observability/actions/authorization.js +22 -0
- package/dist/observability/actions/get-observability-review-detail.d.ts +5 -0
- package/dist/observability/actions/get-observability-review-detail.js +10 -2
- package/dist/observability/actions/get-observability-review-summary-source.d.ts +2 -0
- package/dist/observability/actions/get-observability-review-summary-source.js +3 -2
- package/dist/observability/actions/save-observability-instruction-update.js +2 -1
- package/dist/observability/actions/save-observability-review-summary.js +21 -10
- package/dist/observability/migrations.js +25 -0
- package/dist/observability/reviews.d.ts +3 -1
- package/dist/observability/reviews.js +410 -53
- package/dist/observability/routes.d.ts +6 -6
- package/dist/observability/store.d.ts +15 -0
- package/dist/observability/store.js +131 -11
- package/dist/observability/types.d.ts +18 -0
- package/dist/org/handlers.d.ts +1 -1
- package/dist/org/index.d.ts +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +5 -5
- package/dist/provider-api/actions/provider-api.d.ts +8 -8
- package/dist/server/agent-chat/plugin-options.d.ts +4 -20
- package/dist/server/agent-chat/prompt-resources.d.ts +16 -0
- package/dist/server/agent-chat/prompt-resources.js +385 -22
- package/dist/server/agent-chat-plugin.d.ts +3 -1
- package/dist/server/agent-chat-plugin.js +149 -27
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-engine-ollama-models-route.d.ts +1 -1
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +3 -0
- package/dist/server/prompts/framework-core-compact.js +1 -1
- package/dist/server/prompts/framework-core.js +1 -1
- package/dist/server/request-context.d.ts +6 -3
- package/dist/settings/org-settings.d.ts +4 -2
- package/dist/settings/org-settings.js +3 -3
- package/dist/settings/store.d.ts +3 -1
- package/dist/settings/store.js +8 -3
- package/dist/styles/agent-native.css +5 -0
- package/dist/templates/default/app/i18n/ar-SA.ts +1 -0
- package/dist/templates/default/app/i18n/de-DE.ts +1 -0
- package/dist/templates/default/app/i18n/en-US.ts +1 -0
- package/dist/templates/default/app/i18n/es-ES.ts +1 -0
- package/dist/templates/default/app/i18n/fr-FR.ts +1 -0
- package/dist/templates/default/app/i18n/hi-IN.ts +1 -0
- package/dist/templates/default/app/i18n/ja-JP.ts +1 -0
- package/dist/templates/default/app/i18n/ko-KR.ts +1 -0
- package/dist/templates/default/app/i18n/pt-BR.ts +1 -0
- package/dist/templates/default/app/i18n/zh-CN.ts +1 -0
- package/dist/templates/default/app/i18n/zh-TW.ts +1 -0
- package/dist/tracking/registry.js +11 -4
- package/dist/vite/client.js +6 -0
- package/package.json +4 -3
- package/src/templates/default/app/i18n/ar-SA.ts +1 -0
- package/src/templates/default/app/i18n/de-DE.ts +1 -0
- package/src/templates/default/app/i18n/en-US.ts +1 -0
- package/src/templates/default/app/i18n/es-ES.ts +1 -0
- package/src/templates/default/app/i18n/fr-FR.ts +1 -0
- package/src/templates/default/app/i18n/hi-IN.ts +1 -0
- package/src/templates/default/app/i18n/ja-JP.ts +1 -0
- package/src/templates/default/app/i18n/ko-KR.ts +1 -0
- package/src/templates/default/app/i18n/pt-BR.ts +1 -0
- package/src/templates/default/app/i18n/zh-CN.ts +1 -0
- package/src/templates/default/app/i18n/zh-TW.ts +1 -0
- package/corpus/templates/slides/app/components/editor/SlideBubbleMenu.tsx +0 -488
- package/corpus/templates/slides/app/components/editor/SlideInlineEditor.tsx +0 -589
- package/corpus/templates/slides/app/components/editor/SlideRichTextEditor.tsx +0 -1347
- package/corpus/templates/slides/app/components/editor/SlideSlashMenu.tsx +0 -373
|
@@ -678,6 +678,7 @@ const messages = {
|
|
|
678
678
|
reviewFeedback: "Feedback",
|
|
679
679
|
reviewOutput: "Review output",
|
|
680
680
|
reviewPreview: "Preview output",
|
|
681
|
+
reviewPreviewUnavailable: "Preview unavailable",
|
|
681
682
|
closePreview: "Hide preview",
|
|
682
683
|
addFeedback: "Add feedback",
|
|
683
684
|
draftInstruction: "Draft instruction",
|
|
@@ -700,6 +700,7 @@ const messages = {
|
|
|
700
700
|
reviewFeedback: "Comentarios",
|
|
701
701
|
reviewOutput: "Revisar respuesta",
|
|
702
702
|
reviewPreview: "Vista previa de la respuesta",
|
|
703
|
+
reviewPreviewUnavailable: "Vista previa no disponible",
|
|
703
704
|
closePreview: "Ocultar vista previa",
|
|
704
705
|
addFeedback: "Añadir comentarios",
|
|
705
706
|
draftInstruction: "Borrador de instrucción",
|
|
@@ -697,6 +697,7 @@ const messages = {
|
|
|
697
697
|
reviewFeedback: "Avis",
|
|
698
698
|
reviewOutput: "Revoir la réponse",
|
|
699
699
|
reviewPreview: "Aperçu de la réponse",
|
|
700
|
+
reviewPreviewUnavailable: "Aperçu indisponible",
|
|
700
701
|
closePreview: "Masquer l'aperçu",
|
|
701
702
|
addFeedback: "Ajouter un commentaire",
|
|
702
703
|
draftInstruction: "Brouillon d'instruction",
|
|
@@ -670,6 +670,7 @@ const messages = {
|
|
|
670
670
|
reviewFeedback: "फ़ीडबैक",
|
|
671
671
|
reviewOutput: "उत्तर की समीक्षा",
|
|
672
672
|
reviewPreview: "उत्तर का पूर्वावलोकन",
|
|
673
|
+
reviewPreviewUnavailable: "पूर्वावलोकन उपलब्ध नहीं है",
|
|
673
674
|
closePreview: "पूर्वावलोकन छिपाएँ",
|
|
674
675
|
addFeedback: "फ़ीडबैक जोड़ें",
|
|
675
676
|
draftInstruction: "निर्देश का मसौदा",
|
|
@@ -693,6 +693,7 @@ const messages = {
|
|
|
693
693
|
reviewFeedback: "Feedback",
|
|
694
694
|
reviewOutput: "Revisar resposta",
|
|
695
695
|
reviewPreview: "Visualizar resposta",
|
|
696
|
+
reviewPreviewUnavailable: "Prévia indisponível",
|
|
696
697
|
closePreview: "Ocultar visualização",
|
|
697
698
|
addFeedback: "Adicionar feedback",
|
|
698
699
|
draftInstruction: "Rascunhar instrução",
|
|
@@ -1,488 +0,0 @@
|
|
|
1
|
-
import { useT } from "@agent-native/core/client/i18n";
|
|
2
|
-
import {
|
|
3
|
-
IconBold,
|
|
4
|
-
IconItalic,
|
|
5
|
-
IconStrikethrough,
|
|
6
|
-
IconCode,
|
|
7
|
-
IconLink,
|
|
8
|
-
IconH1,
|
|
9
|
-
IconH2,
|
|
10
|
-
IconH3,
|
|
11
|
-
IconList,
|
|
12
|
-
IconListNumbers,
|
|
13
|
-
IconMessageCircle,
|
|
14
|
-
IconPalette,
|
|
15
|
-
IconX,
|
|
16
|
-
IconPlus,
|
|
17
|
-
IconCheck,
|
|
18
|
-
IconPencil,
|
|
19
|
-
} from "@tabler/icons-react";
|
|
20
|
-
import type { Editor } from "@tiptap/react";
|
|
21
|
-
import { BubbleMenu } from "@tiptap/react/menus";
|
|
22
|
-
import { useState } from "react";
|
|
23
|
-
|
|
24
|
-
import {
|
|
25
|
-
Popover,
|
|
26
|
-
PopoverContent,
|
|
27
|
-
PopoverTrigger,
|
|
28
|
-
} from "@/components/ui/popover";
|
|
29
|
-
import {
|
|
30
|
-
Tooltip,
|
|
31
|
-
TooltipContent,
|
|
32
|
-
TooltipTrigger,
|
|
33
|
-
} from "@/components/ui/tooltip";
|
|
34
|
-
import { cn, shortcutLabel } from "@/lib/utils";
|
|
35
|
-
|
|
36
|
-
import { getBrandPalette, setBrandPalette } from "./style-clipboard";
|
|
37
|
-
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
-
type AnyIcon = React.ComponentType<any>;
|
|
40
|
-
|
|
41
|
-
interface ButtonItem {
|
|
42
|
-
type?: never;
|
|
43
|
-
icon: AnyIcon;
|
|
44
|
-
title: string;
|
|
45
|
-
action: () => void;
|
|
46
|
-
isActive: () => boolean;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
interface DividerItem {
|
|
50
|
-
type: "divider";
|
|
51
|
-
icon?: never;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface SlideBubbleMenuProps {
|
|
55
|
-
editor: Editor;
|
|
56
|
-
onComment?: (quotedText: string) => void;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** Hex color input with validation */
|
|
60
|
-
function HexInput({
|
|
61
|
-
onAdd,
|
|
62
|
-
onCancel,
|
|
63
|
-
}: {
|
|
64
|
-
onAdd: (hex: string) => void;
|
|
65
|
-
onCancel: () => void;
|
|
66
|
-
}) {
|
|
67
|
-
const [val, setVal] = useState("");
|
|
68
|
-
|
|
69
|
-
const isValid = /^#[0-9A-Fa-f]{6}$/.test(val);
|
|
70
|
-
|
|
71
|
-
return (
|
|
72
|
-
<div className="flex items-center gap-1 mt-1">
|
|
73
|
-
<div
|
|
74
|
-
className="w-4 h-4 rounded-sm flex-shrink-0 border border-border"
|
|
75
|
-
style={{ background: isValid ? val : "transparent" }}
|
|
76
|
-
/>
|
|
77
|
-
<input
|
|
78
|
-
type="text"
|
|
79
|
-
value={val}
|
|
80
|
-
onChange={(e) => setVal(e.target.value)}
|
|
81
|
-
onKeyDown={(e) => {
|
|
82
|
-
if (e.key === "Enter" && isValid) onAdd(val);
|
|
83
|
-
if (e.key === "Escape") onCancel();
|
|
84
|
-
}}
|
|
85
|
-
placeholder="#000000"
|
|
86
|
-
maxLength={7}
|
|
87
|
-
className="flex-1 bg-transparent text-foreground text-xs outline-none placeholder-muted-foreground/70 border-b border-border pb-0.5 w-20"
|
|
88
|
-
autoFocus
|
|
89
|
-
/>
|
|
90
|
-
{isValid && (
|
|
91
|
-
<button
|
|
92
|
-
onClick={() => onAdd(val)}
|
|
93
|
-
className="text-[#00E5FF] hover:text-foreground"
|
|
94
|
-
>
|
|
95
|
-
<IconCheck size={12} />
|
|
96
|
-
</button>
|
|
97
|
-
)}
|
|
98
|
-
<button
|
|
99
|
-
onClick={onCancel}
|
|
100
|
-
className="text-muted-foreground hover:text-foreground"
|
|
101
|
-
>
|
|
102
|
-
<IconX size={12} />
|
|
103
|
-
</button>
|
|
104
|
-
</div>
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/** Color palette popover for picking and managing brand colors */
|
|
109
|
-
function ColorPicker({
|
|
110
|
-
editor,
|
|
111
|
-
onClose,
|
|
112
|
-
}: {
|
|
113
|
-
editor: Editor;
|
|
114
|
-
onClose: () => void;
|
|
115
|
-
}) {
|
|
116
|
-
const t = useT();
|
|
117
|
-
const [palette, setPalette] = useState<string[]>(getBrandPalette);
|
|
118
|
-
const [editMode, setEditMode] = useState(false);
|
|
119
|
-
const [addingColor, setAddingColor] = useState(false);
|
|
120
|
-
const currentColor =
|
|
121
|
-
(editor.getAttributes("textStyle").color as string | undefined) ?? null;
|
|
122
|
-
|
|
123
|
-
const applyColor = (color: string) => {
|
|
124
|
-
editor.chain().focus().setColor(color).run();
|
|
125
|
-
onClose();
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const removeColor = () => {
|
|
129
|
-
editor.chain().focus().unsetColor().run();
|
|
130
|
-
onClose();
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
const addTopalette = (hex: string) => {
|
|
134
|
-
const next = palette.includes(hex) ? palette : [...palette, hex];
|
|
135
|
-
setPalette(next);
|
|
136
|
-
setBrandPalette(next);
|
|
137
|
-
setAddingColor(false);
|
|
138
|
-
applyColor(hex);
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
const removeFromPalette = (hex: string) => {
|
|
142
|
-
const next = palette.filter((c) => c !== hex);
|
|
143
|
-
setPalette(next);
|
|
144
|
-
setBrandPalette(next);
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
return (
|
|
148
|
-
<div className="w-[180px]">
|
|
149
|
-
<div className="flex items-center justify-between mb-2">
|
|
150
|
-
<span className="text-[10px] font-semibold text-muted-foreground uppercase tracking-wider">
|
|
151
|
-
{t("slideTextMenu.brandColors")}
|
|
152
|
-
</span>
|
|
153
|
-
<Tooltip>
|
|
154
|
-
<TooltipTrigger asChild>
|
|
155
|
-
<button
|
|
156
|
-
onClick={() => setEditMode((v) => !v)}
|
|
157
|
-
className={cn(
|
|
158
|
-
"p-0.5 rounded",
|
|
159
|
-
editMode
|
|
160
|
-
? "text-[#00E5FF]"
|
|
161
|
-
: "text-muted-foreground hover:text-foreground",
|
|
162
|
-
)}
|
|
163
|
-
>
|
|
164
|
-
<IconPencil size={11} />
|
|
165
|
-
</button>
|
|
166
|
-
</TooltipTrigger>
|
|
167
|
-
<TooltipContent>{t("slideTextMenu.editPalette")}</TooltipContent>
|
|
168
|
-
</Tooltip>
|
|
169
|
-
</div>
|
|
170
|
-
|
|
171
|
-
<div className="grid grid-cols-6 gap-1.5">
|
|
172
|
-
{palette.map((color) => (
|
|
173
|
-
<div key={color} className="relative group">
|
|
174
|
-
<Tooltip>
|
|
175
|
-
<TooltipTrigger asChild>
|
|
176
|
-
<button
|
|
177
|
-
onClick={() => (editMode ? undefined : applyColor(color))}
|
|
178
|
-
className={cn(
|
|
179
|
-
"w-6 h-6 rounded-md border transition-transform",
|
|
180
|
-
currentColor?.toLowerCase() === color.toLowerCase()
|
|
181
|
-
? "border-foreground scale-110"
|
|
182
|
-
: "border-border hover:scale-110",
|
|
183
|
-
)}
|
|
184
|
-
style={{ background: color }}
|
|
185
|
-
/>
|
|
186
|
-
</TooltipTrigger>
|
|
187
|
-
<TooltipContent>{color}</TooltipContent>
|
|
188
|
-
</Tooltip>
|
|
189
|
-
{editMode && (
|
|
190
|
-
<button
|
|
191
|
-
onClick={() => removeFromPalette(color)}
|
|
192
|
-
className="absolute -top-1 -right-1 w-3.5 h-3.5 rounded-full bg-popover border border-border flex items-center justify-center text-muted-foreground hover:text-foreground hover:border-foreground/50"
|
|
193
|
-
>
|
|
194
|
-
<IconX size={8} />
|
|
195
|
-
</button>
|
|
196
|
-
)}
|
|
197
|
-
</div>
|
|
198
|
-
))}
|
|
199
|
-
|
|
200
|
-
{/* Add color button */}
|
|
201
|
-
{!addingColor && (
|
|
202
|
-
<Tooltip>
|
|
203
|
-
<TooltipTrigger asChild>
|
|
204
|
-
<button
|
|
205
|
-
onClick={() => setAddingColor(true)}
|
|
206
|
-
className="w-6 h-6 rounded-md border border-dashed border-border flex items-center justify-center text-muted-foreground hover:text-foreground hover:border-foreground/40"
|
|
207
|
-
>
|
|
208
|
-
<IconPlus size={10} />
|
|
209
|
-
</button>
|
|
210
|
-
</TooltipTrigger>
|
|
211
|
-
<TooltipContent>{t("slideTextMenu.addColor")}</TooltipContent>
|
|
212
|
-
</Tooltip>
|
|
213
|
-
)}
|
|
214
|
-
</div>
|
|
215
|
-
|
|
216
|
-
{addingColor && (
|
|
217
|
-
<HexInput onAdd={addTopalette} onCancel={() => setAddingColor(false)} />
|
|
218
|
-
)}
|
|
219
|
-
|
|
220
|
-
<div className="mt-2 pt-2 border-t border-border">
|
|
221
|
-
<button
|
|
222
|
-
onClick={removeColor}
|
|
223
|
-
className="flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground w-full"
|
|
224
|
-
>
|
|
225
|
-
<IconX size={11} />
|
|
226
|
-
{t("slideTextMenu.removeColor")}
|
|
227
|
-
</button>
|
|
228
|
-
</div>
|
|
229
|
-
</div>
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
export function SlideBubbleMenu({ editor, onComment }: SlideBubbleMenuProps) {
|
|
234
|
-
const t = useT();
|
|
235
|
-
const [showLinkInput, setShowLinkInput] = useState(false);
|
|
236
|
-
const [linkUrl, setLinkUrl] = useState("");
|
|
237
|
-
const [colorOpen, setColorOpen] = useState(false);
|
|
238
|
-
|
|
239
|
-
const handleSetLink = () => {
|
|
240
|
-
if (linkUrl.trim()) {
|
|
241
|
-
editor
|
|
242
|
-
.chain()
|
|
243
|
-
.focus()
|
|
244
|
-
.extendMarkRange("link")
|
|
245
|
-
.setLink({ href: linkUrl.trim() })
|
|
246
|
-
.run();
|
|
247
|
-
} else {
|
|
248
|
-
editor.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
249
|
-
}
|
|
250
|
-
setShowLinkInput(false);
|
|
251
|
-
setLinkUrl("");
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
const toggleLink = () => {
|
|
255
|
-
if (editor.isActive("link")) {
|
|
256
|
-
editor.chain().focus().unsetLink().run();
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
const previousUrl = editor.getAttributes("link").href || "";
|
|
260
|
-
setLinkUrl(previousUrl);
|
|
261
|
-
setShowLinkInput(true);
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
const currentColor =
|
|
265
|
-
(editor.getAttributes("textStyle").color as string | undefined) ?? null;
|
|
266
|
-
|
|
267
|
-
const buttons: (ButtonItem | DividerItem)[] = [
|
|
268
|
-
{
|
|
269
|
-
icon: IconBold,
|
|
270
|
-
title: t("slideTextMenu.bold"),
|
|
271
|
-
action: () => editor.chain().focus().toggleBold().run(),
|
|
272
|
-
isActive: () => editor.isActive("bold"),
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
icon: IconItalic,
|
|
276
|
-
title: t("slideTextMenu.italic"),
|
|
277
|
-
action: () => editor.chain().focus().toggleItalic().run(),
|
|
278
|
-
isActive: () => editor.isActive("italic"),
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
icon: IconStrikethrough,
|
|
282
|
-
title: t("slideTextMenu.strikethrough"),
|
|
283
|
-
action: () => editor.chain().focus().toggleStrike().run(),
|
|
284
|
-
isActive: () => editor.isActive("strike"),
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
icon: IconCode,
|
|
288
|
-
title: t("slideTextMenu.code"),
|
|
289
|
-
action: () => editor.chain().focus().toggleCode().run(),
|
|
290
|
-
isActive: () => editor.isActive("code"),
|
|
291
|
-
},
|
|
292
|
-
{ type: "divider" },
|
|
293
|
-
{
|
|
294
|
-
icon: IconH1,
|
|
295
|
-
title: t("slideTextMenu.heading1"),
|
|
296
|
-
action: () => editor.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
297
|
-
isActive: () => editor.isActive("heading", { level: 1 }),
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
icon: IconH2,
|
|
301
|
-
title: t("slideTextMenu.heading2"),
|
|
302
|
-
action: () => editor.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
303
|
-
isActive: () => editor.isActive("heading", { level: 2 }),
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
icon: IconH3,
|
|
307
|
-
title: t("slideTextMenu.heading3"),
|
|
308
|
-
action: () => editor.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
309
|
-
isActive: () => editor.isActive("heading", { level: 3 }),
|
|
310
|
-
},
|
|
311
|
-
{ type: "divider" },
|
|
312
|
-
{
|
|
313
|
-
icon: IconList,
|
|
314
|
-
title: t("slideTextMenu.bulletList"),
|
|
315
|
-
action: () => editor.chain().focus().toggleBulletList().run(),
|
|
316
|
-
isActive: () => editor.isActive("bulletList"),
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
icon: IconListNumbers,
|
|
320
|
-
title: t("slideTextMenu.orderedList"),
|
|
321
|
-
action: () => editor.chain().focus().toggleOrderedList().run(),
|
|
322
|
-
isActive: () => editor.isActive("orderedList"),
|
|
323
|
-
},
|
|
324
|
-
{ type: "divider" },
|
|
325
|
-
{
|
|
326
|
-
icon: IconLink,
|
|
327
|
-
title: t("slideTextMenu.link"),
|
|
328
|
-
action: toggleLink,
|
|
329
|
-
isActive: () => editor.isActive("link"),
|
|
330
|
-
},
|
|
331
|
-
];
|
|
332
|
-
|
|
333
|
-
// Comment button — only when onComment is provided
|
|
334
|
-
const hasCommentBtn = !!onComment;
|
|
335
|
-
|
|
336
|
-
return (
|
|
337
|
-
<BubbleMenu editor={editor}>
|
|
338
|
-
<div
|
|
339
|
-
data-bubble-menu="true"
|
|
340
|
-
className="flex items-center gap-0.5 px-1.5 py-1 rounded-lg bg-popover border border-border shadow-xl"
|
|
341
|
-
>
|
|
342
|
-
{showLinkInput ? (
|
|
343
|
-
<div className="flex items-center gap-1.5 px-1">
|
|
344
|
-
<input
|
|
345
|
-
type="url"
|
|
346
|
-
value={linkUrl}
|
|
347
|
-
onChange={(e) => setLinkUrl(e.target.value)}
|
|
348
|
-
onKeyDown={(e) => {
|
|
349
|
-
if (e.key === "Enter") handleSetLink();
|
|
350
|
-
if (e.key === "Escape") {
|
|
351
|
-
setShowLinkInput(false);
|
|
352
|
-
setLinkUrl("");
|
|
353
|
-
}
|
|
354
|
-
}}
|
|
355
|
-
placeholder={t("slideTextMenu.pasteUrl")}
|
|
356
|
-
className="w-48 bg-transparent text-foreground text-sm outline-none placeholder-muted-foreground/70 border-b border-border pb-0.5"
|
|
357
|
-
autoFocus
|
|
358
|
-
/>
|
|
359
|
-
<button
|
|
360
|
-
onClick={handleSetLink}
|
|
361
|
-
className="text-xs text-[#609FF8] hover:text-[#7AB2FA] font-medium"
|
|
362
|
-
>
|
|
363
|
-
{t("slideTextMenu.apply")}
|
|
364
|
-
</button>
|
|
365
|
-
<button
|
|
366
|
-
onClick={() => {
|
|
367
|
-
setShowLinkInput(false);
|
|
368
|
-
setLinkUrl("");
|
|
369
|
-
}}
|
|
370
|
-
className="text-xs text-muted-foreground hover:text-foreground"
|
|
371
|
-
>
|
|
372
|
-
{t("slideTextMenu.cancel")}
|
|
373
|
-
</button>
|
|
374
|
-
</div>
|
|
375
|
-
) : (
|
|
376
|
-
<>
|
|
377
|
-
{buttons.map((item, i) => {
|
|
378
|
-
if (item.type === "divider") {
|
|
379
|
-
return <div key={i} className="w-px h-4 bg-border mx-0.5" />;
|
|
380
|
-
}
|
|
381
|
-
const btn = item as ButtonItem;
|
|
382
|
-
const Icon = btn.icon;
|
|
383
|
-
const active = btn.isActive();
|
|
384
|
-
return (
|
|
385
|
-
<Tooltip key={i}>
|
|
386
|
-
<TooltipTrigger asChild>
|
|
387
|
-
<button
|
|
388
|
-
onClick={btn.action}
|
|
389
|
-
className={cn(
|
|
390
|
-
"p-1.5 rounded",
|
|
391
|
-
active
|
|
392
|
-
? "bg-accent text-foreground"
|
|
393
|
-
: "text-foreground/80 hover:text-foreground hover:bg-accent",
|
|
394
|
-
)}
|
|
395
|
-
>
|
|
396
|
-
<Icon size={14} stroke={2} />
|
|
397
|
-
</button>
|
|
398
|
-
</TooltipTrigger>
|
|
399
|
-
<TooltipContent>{btn.title}</TooltipContent>
|
|
400
|
-
</Tooltip>
|
|
401
|
-
);
|
|
402
|
-
})}
|
|
403
|
-
|
|
404
|
-
{/* Color picker */}
|
|
405
|
-
<div className="w-px h-4 bg-border mx-0.5" />
|
|
406
|
-
<Popover open={colorOpen} onOpenChange={setColorOpen}>
|
|
407
|
-
<Tooltip>
|
|
408
|
-
<TooltipTrigger asChild>
|
|
409
|
-
<PopoverTrigger asChild>
|
|
410
|
-
<button
|
|
411
|
-
className={cn(
|
|
412
|
-
"p-1.5 rounded relative",
|
|
413
|
-
colorOpen
|
|
414
|
-
? "bg-accent text-foreground"
|
|
415
|
-
: "text-foreground/80 hover:text-foreground hover:bg-accent",
|
|
416
|
-
)}
|
|
417
|
-
>
|
|
418
|
-
<IconPalette size={14} stroke={2} />
|
|
419
|
-
{/* Color indicator underline */}
|
|
420
|
-
<div
|
|
421
|
-
className="absolute bottom-0.5 left-1.5 right-1.5 h-0.5 rounded-full"
|
|
422
|
-
style={{
|
|
423
|
-
background: currentColor ?? "transparent",
|
|
424
|
-
border: currentColor
|
|
425
|
-
? "none"
|
|
426
|
-
: "1px solid hsl(var(--border))",
|
|
427
|
-
}}
|
|
428
|
-
/>
|
|
429
|
-
</button>
|
|
430
|
-
</PopoverTrigger>
|
|
431
|
-
</TooltipTrigger>
|
|
432
|
-
<TooltipContent>{t("slideTextMenu.textColor")}</TooltipContent>
|
|
433
|
-
</Tooltip>
|
|
434
|
-
<PopoverContent
|
|
435
|
-
side="bottom"
|
|
436
|
-
align="end"
|
|
437
|
-
sideOffset={6}
|
|
438
|
-
className="bg-popover border-border text-foreground p-3 w-auto"
|
|
439
|
-
>
|
|
440
|
-
<ColorPicker
|
|
441
|
-
editor={editor}
|
|
442
|
-
onClose={() => setColorOpen(false)}
|
|
443
|
-
/>
|
|
444
|
-
<div className="mt-2 pt-2 border-t border-border flex gap-2 text-[10px] text-muted-foreground">
|
|
445
|
-
<span>
|
|
446
|
-
{t("slideTextMenu.copyStyleShortcut", {
|
|
447
|
-
shortcut: shortcutLabel("cmd+alt+c"),
|
|
448
|
-
})}
|
|
449
|
-
</span>
|
|
450
|
-
<span>
|
|
451
|
-
{t("slideTextMenu.pasteStyleShortcut", {
|
|
452
|
-
shortcut: shortcutLabel("cmd+alt+v"),
|
|
453
|
-
})}
|
|
454
|
-
</span>
|
|
455
|
-
</div>
|
|
456
|
-
</PopoverContent>
|
|
457
|
-
</Popover>
|
|
458
|
-
|
|
459
|
-
{hasCommentBtn && (
|
|
460
|
-
<>
|
|
461
|
-
<div className="w-px h-4 bg-border mx-0.5" />
|
|
462
|
-
<Tooltip>
|
|
463
|
-
<TooltipTrigger asChild>
|
|
464
|
-
<button
|
|
465
|
-
onClick={() => {
|
|
466
|
-
const { from, to } = editor.state.selection;
|
|
467
|
-
const quotedText = editor.state.doc.textBetween(
|
|
468
|
-
from,
|
|
469
|
-
to,
|
|
470
|
-
" ",
|
|
471
|
-
);
|
|
472
|
-
onComment!(quotedText);
|
|
473
|
-
}}
|
|
474
|
-
className="p-1.5 rounded text-foreground/80 hover:text-foreground hover:bg-accent"
|
|
475
|
-
>
|
|
476
|
-
<IconMessageCircle size={14} stroke={2} />
|
|
477
|
-
</button>
|
|
478
|
-
</TooltipTrigger>
|
|
479
|
-
<TooltipContent>{t("slideTextMenu.comment")}</TooltipContent>
|
|
480
|
-
</Tooltip>
|
|
481
|
-
</>
|
|
482
|
-
)}
|
|
483
|
-
</>
|
|
484
|
-
)}
|
|
485
|
-
</div>
|
|
486
|
-
</BubbleMenu>
|
|
487
|
-
);
|
|
488
|
-
}
|