@agent-native/core 0.157.3 → 0.157.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/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/analytics/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +40 -1
- package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/assets/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/brain/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/calendar/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +3 -1
- package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/chat/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/clips/.agents/skills/meetings/SKILL.md +7 -7
- package/corpus/templates/clips/actions/approve-recording-access-request.ts +147 -0
- package/corpus/templates/clips/actions/request-recording-access.ts +121 -23
- package/corpus/templates/clips/actions/view-screen.ts +1 -1
- package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +34 -53
- package/corpus/templates/clips/app/components/player/request-access-dialog.tsx +104 -0
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +36 -45
- package/corpus/templates/clips/app/components/sharing/share-ui.tsx +3 -6
- package/corpus/templates/clips/app/i18n/en-US.ts +26 -1
- package/corpus/templates/clips/app/lib/public-meeting.ts +1 -1
- package/corpus/templates/clips/app/routes/access-request.approve.tsx +250 -0
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +9 -32
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +123 -37
- package/corpus/templates/clips/app/routes/share.meeting.$meetingId.tsx +41 -1
- package/corpus/templates/clips/server/lib/calendar-event-meetings.ts +1 -0
- package/corpus/templates/clips/server/lib/emails.ts +40 -11
- package/corpus/templates/clips/shared/recording-link.ts +32 -1
- package/corpus/templates/clips/shared/share-attribution.ts +13 -0
- package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/content/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/content/app/components/editor/DocumentBlockFields.tsx +22 -10
- package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +2 -1
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +245 -9
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +185 -134
- package/corpus/templates/content/app/components/editor/extensions/ImageBlock.tsx +61 -45
- package/corpus/templates/content/app/components/editor/extensions/ImageNode.ts +6 -0
- package/corpus/templates/content/app/components/editor/image-upload.ts +137 -5
- package/corpus/templates/content/app/global.css +8 -0
- package/corpus/templates/content/changelog/2026-08-12-image-uploads-now-confirm-the-image-can-be-displayed-before-.md +6 -0
- package/corpus/templates/content/changelog/2026-08-14-images-fill-the-page-width-by-default-and-remain-visible-whe.md +6 -0
- package/corpus/templates/content/changelog/2026-08-14-images-inserted-from-the-slash-command-stay-saved-after-uplo.md +6 -0
- package/corpus/templates/content/changelog/2026-08-14-svg-files-can-be-selected-reliably-from-the-image-picker.md +6 -0
- package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/crm/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/design/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/dispatch/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/factory/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/forms/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/macros/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/mail/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +6 -1
- package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/plan/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +25 -30
- package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/slides/.agents/skills/sharing/SKILL.md +21 -0
- package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +2 -1
- package/corpus/templates/slides/app/components/editor/ShareDialog.tsx +124 -180
- package/corpus/templates/slides/app/components/onboarding/FirstDeckOnboardingFlow.tsx +1 -0
- package/corpus/templates/slides/app/global.css +99 -3
- package/corpus/templates/slides/app/i18n/en-US.ts +1 -0
- package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/tasks/.agents/skills/sharing/SKILL.md +21 -0
- package/dist/chat-threads/schema.d.ts +1 -1
- package/dist/cli/code-agent-executor.js +318 -0
- package/dist/client/AgentPanel.d.ts +13 -1
- package/dist/client/AgentPanel.js +41 -3
- package/dist/client/AssistantChat.d.ts +9 -1
- package/dist/client/AssistantChat.js +26 -13
- package/dist/client/MultiTabAssistantChat.js +18 -5
- package/dist/client/agent-chat.d.ts +8 -0
- package/dist/client/agent-chat.js +15 -0
- package/dist/client/app-chat-sidebar.d.ts +23 -0
- package/dist/client/app-chat-sidebar.js +53 -0
- package/dist/client/app-providers.js +31 -2
- package/dist/client/frame-protocol.d.ts +20 -2
- package/dist/client/hooks/index.d.ts +1 -0
- package/dist/client/hooks/index.js +1 -0
- package/dist/client/sharing/AgentShareSection.d.ts +8 -0
- package/dist/client/sharing/AgentShareSection.js +50 -0
- package/dist/client/sharing/ShareButton.js +2 -1
- package/dist/client/sharing/ShareDialog.d.ts +2 -2
- package/dist/client/sharing/ShareDialog.js +21 -29
- package/dist/client/sharing/index.d.ts +1 -0
- package/dist/client/sharing/index.js +1 -0
- package/dist/client/sharing/useShareButtonController.d.ts +1 -0
- package/dist/client/sharing/useShareDialogController.d.ts +3 -0
- package/dist/client/sharing/useShareDialogController.js +2 -1
- package/dist/client/theme.d.ts +21 -0
- package/dist/client/theme.js +60 -0
- package/dist/client/ui/index.d.ts +1 -1
- package/dist/client/ui/index.js +1 -1
- package/dist/client/use-session.js +23 -0
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/dashboard-storage/schema.d.ts +1 -1
- package/dist/data-programs/schema.d.ts +1 -1
- package/dist/extensions/schema.d.ts +1 -1
- package/dist/localization/core-messages/ar-SA.js +6 -0
- package/dist/localization/core-messages/de-DE.js +6 -0
- package/dist/localization/core-messages/en-US.d.ts +6 -0
- package/dist/localization/core-messages/en-US.js +6 -0
- package/dist/localization/core-messages/es-ES.js +6 -0
- package/dist/localization/core-messages/fr-FR.js +6 -0
- package/dist/localization/core-messages/hi-IN.js +6 -0
- package/dist/localization/core-messages/ja-JP.js +6 -0
- package/dist/localization/core-messages/ko-KR.js +6 -0
- package/dist/localization/core-messages/pt-BR.js +6 -0
- package/dist/localization/core-messages/zh-CN.js +6 -0
- package/dist/localization/core-messages/zh-TW.js +6 -0
- package/dist/localization/core-messages.d.ts +6 -0
- package/dist/localization/default-messages.d.ts +1 -0
- package/dist/localization/default-messages.js +1 -0
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
- package/dist/provider-api/actions/provider-api.d.ts +14 -14
- package/dist/server/auth.js +8 -5
- package/dist/server/identity-sso-store.d.ts +6 -1
- package/dist/server/identity-sso-store.js +57 -14
- package/dist/server/identity-sso.d.ts +7 -8
- package/dist/server/identity-sso.js +15 -12
- package/dist/sharing/actions/list-resource-shares.d.ts +2 -0
- package/dist/sharing/actions/list-resource-shares.js +1 -0
- package/dist/sharing/schema.d.ts +1 -1
- package/dist/sharing/schema.js +4 -1
- package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/chat/.agents/skills/sharing/SKILL.md +21 -0
- package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/default/.agents/skills/sharing/SKILL.md +21 -0
- package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/workspace-core/.agents/skills/sharing/SKILL.md +21 -0
- package/docs/content/actions-access-control.mdx +226 -0
- package/docs/content/actions-advanced.mdx +152 -0
- package/docs/content/actions-defining.mdx +275 -0
- package/docs/content/actions-other-surfaces.mdx +167 -0
- package/docs/content/actions-overview.mdx +214 -0
- package/docs/content/actions-run-context.mdx +180 -0
- package/docs/content/agent-surfaces.mdx +1 -1
- package/docs/content/agent-teams.mdx +1 -1
- package/docs/content/agent-web-surfaces.mdx +1 -1
- package/docs/content/audit-log.mdx +1 -1
- package/docs/content/automation-connectors.mdx +1 -1
- package/docs/content/automations.mdx +1 -1
- package/docs/content/blueprint-installer.mdx +1 -1
- package/docs/content/cli-adapters.mdx +1 -1
- package/docs/content/client-agent-chat.mdx +1 -1
- package/docs/content/client-data.mdx +2 -2
- package/docs/content/client-overview.mdx +2 -2
- package/docs/content/components.mdx +1 -1
- package/docs/content/cross-app-sso.mdx +24 -17
- package/docs/content/data-programs.mdx +2 -2
- package/docs/content/database.mdx +1 -1
- package/docs/content/deployment.mdx +1 -1
- package/docs/content/docs-components.mdx +14 -3
- package/docs/content/drop-in-agent.mdx +2 -2
- package/docs/content/durable-resume.mdx +1 -1
- package/docs/content/evals.mdx +1 -1
- package/docs/content/extensions.mdx +1 -1
- package/docs/content/external-agents-catalog.mdx +2 -2
- package/docs/content/external-agents.mdx +1 -1
- package/docs/content/generative-ui.mdx +1 -1
- package/docs/content/getting-started.mdx +1 -1
- package/docs/content/http-api.mdx +4 -4
- package/docs/content/human-approval.mdx +1 -1
- package/docs/content/key-concepts.mdx +1 -1
- package/docs/content/mcp-apps.mdx +1 -1
- package/docs/content/mcp-clients.mdx +1 -1
- package/docs/content/mcp-protocol.mdx +1 -1
- package/docs/content/native-chat-ui.mdx +1 -1
- package/docs/content/observability.mdx +1 -1
- package/docs/content/organizations-teams-permissions.mdx +1 -1
- package/docs/content/processors.mdx +1 -1
- package/docs/content/pure-agent-apps.mdx +1 -1
- package/docs/content/recurring-jobs.mdx +1 -1
- package/docs/content/server-database.mdx +1 -1
- package/docs/content/server-overview.mdx +3 -3
- package/docs/content/server-routes.mdx +2 -2
- package/docs/content/template-analytics-developers.mdx +1 -1
- package/docs/content/template-assets-developers.mdx +1 -1
- package/docs/content/template-brain-developers.mdx +1 -1
- package/docs/content/template-calendar-developers.mdx +1 -1
- package/docs/content/template-chat-first-edits.mdx +1 -1
- package/docs/content/template-chat.mdx +1 -1
- package/docs/content/template-content-developers.mdx +1 -1
- package/docs/content/template-forms-developers.mdx +1 -1
- package/docs/content/template-forms.mdx +1 -1
- package/docs/content/template-mail-developers.mdx +2 -2
- package/docs/content/toolkit-org-team.mdx +1 -1
- package/docs/content/tracking.mdx +1 -1
- package/docs/content/what-is-agent-native.mdx +1 -1
- package/package.json +2 -2
- package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/chat/.agents/skills/sharing/SKILL.md +21 -0
- package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/default/.agents/skills/sharing/SKILL.md +21 -0
- package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +21 -0
- package/docs/content/actions.mdx +0 -750
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from "@agent-native/core/client/agent-chat";
|
|
9
9
|
import { track } from "@agent-native/core/client/analytics";
|
|
10
10
|
import { appPath, agentNativePath } from "@agent-native/core/client/api-path";
|
|
11
|
+
import { writeClipboardText } from "@agent-native/core/client/clipboard";
|
|
11
12
|
import { emailToColor, emailToName } from "@agent-native/core/client/collab";
|
|
12
13
|
import { PromptComposer } from "@agent-native/core/client/composer";
|
|
13
14
|
import { useActionQuery, useSession } from "@agent-native/core/client/hooks";
|
|
@@ -33,7 +34,7 @@ import {
|
|
|
33
34
|
useSetPageTitle,
|
|
34
35
|
} from "@agent-native/toolkit/app-shell";
|
|
35
36
|
import { type RichMarkdownCollabUser } from "@agent-native/toolkit/editor";
|
|
36
|
-
import { ShareTrigger } from "@agent-native/toolkit/sharing";
|
|
37
|
+
import { ShareCopyRow, ShareTrigger } from "@agent-native/toolkit/sharing";
|
|
37
38
|
import {
|
|
38
39
|
SOURCE_AUTHOR_COMMENT_MENTION_EMAIL,
|
|
39
40
|
extractCommentMentions,
|
|
@@ -6192,11 +6193,18 @@ function PlanShareControl({
|
|
|
6192
6193
|
}, []);
|
|
6193
6194
|
|
|
6194
6195
|
const copyPublishedUrl = useCallback(
|
|
6195
|
-
(url: string) => {
|
|
6196
|
-
|
|
6197
|
-
(
|
|
6198
|
-
|
|
6199
|
-
|
|
6196
|
+
async (url: string) => {
|
|
6197
|
+
try {
|
|
6198
|
+
if (!(await writeClipboardText(url))) {
|
|
6199
|
+
toast.error(t("plansPage.share.copyFailed"));
|
|
6200
|
+
return false;
|
|
6201
|
+
}
|
|
6202
|
+
toast.success(t("plansPage.share.linkCopied"));
|
|
6203
|
+
return true;
|
|
6204
|
+
} catch {
|
|
6205
|
+
toast.error(t("plansPage.share.copyFailed"));
|
|
6206
|
+
return false;
|
|
6207
|
+
}
|
|
6200
6208
|
},
|
|
6201
6209
|
[t],
|
|
6202
6210
|
);
|
|
@@ -6334,22 +6342,16 @@ function PlanShareControl({
|
|
|
6334
6342
|
</div>
|
|
6335
6343
|
) : effectivePublishedUrl ? (
|
|
6336
6344
|
<div className="space-y-3">
|
|
6337
|
-
<
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6345
|
+
<ShareCopyRow
|
|
6346
|
+
value={effectivePublishedUrl}
|
|
6347
|
+
label={t("plansPage.share.linkLabel", { noun: Noun })}
|
|
6348
|
+
description={t("plansPage.share.hostedCopy", { noun })}
|
|
6349
|
+
copyLabel={t("plansPage.loggedOut.copy")}
|
|
6350
|
+
copiedLabel={t("plansPage.loggedOut.copied")}
|
|
6351
|
+
onCopy={copyPublishedUrl}
|
|
6352
|
+
className="rounded-md border border-border bg-muted/35 px-2.5 py-2"
|
|
6353
|
+
/>
|
|
6343
6354
|
<div className="flex flex-wrap items-center justify-end gap-2">
|
|
6344
|
-
<Button
|
|
6345
|
-
type="button"
|
|
6346
|
-
size="sm"
|
|
6347
|
-
variant="ghost"
|
|
6348
|
-
onClick={() => copyPublishedUrl(effectivePublishedUrl)}
|
|
6349
|
-
>
|
|
6350
|
-
<IconCopy className="size-3.5" />
|
|
6351
|
-
{t("plansPage.loggedOut.copy")}
|
|
6352
|
-
</Button>
|
|
6353
6355
|
<Button
|
|
6354
6356
|
type="button"
|
|
6355
6357
|
size="sm"
|
|
@@ -6363,10 +6365,7 @@ function PlanShareControl({
|
|
|
6363
6365
|
{t("plansPage.share.updating")}
|
|
6364
6366
|
</>
|
|
6365
6367
|
) : (
|
|
6366
|
-
|
|
6367
|
-
<IconRefresh className="size-3.5" />
|
|
6368
|
-
{t("plansPage.share.updateLink")}
|
|
6369
|
-
</>
|
|
6368
|
+
t("plansPage.share.updateLink")
|
|
6370
6369
|
)}
|
|
6371
6370
|
</Button>
|
|
6372
6371
|
<Button type="button" size="sm" asChild>
|
|
@@ -6375,7 +6374,6 @@ function PlanShareControl({
|
|
|
6375
6374
|
target="_blank"
|
|
6376
6375
|
rel="noreferrer"
|
|
6377
6376
|
>
|
|
6378
|
-
<IconExternalLink className="size-3.5" />
|
|
6379
6377
|
{t("plansPage.share.openHostedPlan")}
|
|
6380
6378
|
</a>
|
|
6381
6379
|
</Button>
|
|
@@ -6394,10 +6392,7 @@ function PlanShareControl({
|
|
|
6394
6392
|
{t("plansPage.share.creatingLink")}
|
|
6395
6393
|
</>
|
|
6396
6394
|
) : (
|
|
6397
|
-
|
|
6398
|
-
<IconLink className="size-4" />
|
|
6399
|
-
{t("plansPage.share.createShareableLink")}
|
|
6400
|
-
</>
|
|
6395
|
+
t("plansPage.share.createShareableLink")
|
|
6401
6396
|
)}
|
|
6402
6397
|
</Button>
|
|
6403
6398
|
)}
|
|
@@ -182,6 +182,11 @@ in the moment of agent use.
|
|
|
182
182
|
five-item sidebar preview and a footer row with New chat followed by an
|
|
183
183
|
ellipsis disclosure up to fifteen. Apps inject routing, labels, and domain
|
|
184
184
|
actions.
|
|
185
|
+
- **Data grid kit**: provider-agnostic spreadsheet mechanics belong in
|
|
186
|
+
`@agent-native/toolkit/data-grid`. Apps provide rows, typed columns, editor
|
|
187
|
+
slots, selection and width state, persistence callbacks, and product-level
|
|
188
|
+
row/body slots. Keep database models, access checks, grouping, drag/drop,
|
|
189
|
+
and domain actions in the app adapter.
|
|
185
190
|
- **Agent page kit**: the full-page `/agent` surface (`AgentTabsPage` from
|
|
186
191
|
`@agent-native/core/client`) with Context, Files, Connections, Jobs, and
|
|
187
192
|
Access tabs plus a Personal/Organization scope toggle. The canonical home
|
|
@@ -184,6 +184,27 @@ import { ShareButton } from "@agent-native/core/client/sharing";
|
|
|
184
184
|
|
|
185
185
|
For list views, show `<VisibilityBadge visibility={row.visibility} />` next to each resource.
|
|
186
186
|
|
|
187
|
+
## Standard share surface
|
|
188
|
+
|
|
189
|
+
All app share popovers should use the same compact surface contract:
|
|
190
|
+
|
|
191
|
+
- Use the text-only `ShareTrigger` from `@agent-native/toolkit/sharing`.
|
|
192
|
+
- Render ordinary links with `ShareCopyRow`, which exposes a Copy action without
|
|
193
|
+
printing the raw URL.
|
|
194
|
+
- Keep general access and individual people access in the standard Core sharing
|
|
195
|
+
flow. The people flow supports email invites, roles, notifications, and
|
|
196
|
+
removal through the shared share actions.
|
|
197
|
+
- Add `ShareAgentsSection` only when the resource has a real agent-readable
|
|
198
|
+
link or prompt. Keep it collapsed by default and supply domain-specific
|
|
199
|
+
content through the shared section shell.
|
|
200
|
+
- App-specific tabs or controls may remain when they represent a real domain
|
|
201
|
+
action (for example, an embed-code editor), but they should retain the same
|
|
202
|
+
trigger, copy-row, access, and spacing language.
|
|
203
|
+
|
|
204
|
+
`ShareDisclosureSection` is the toolkit-owned shell for optional expandable
|
|
205
|
+
share details; use its `ShareAgentsSection` or `SharePeopleSection` wrappers
|
|
206
|
+
instead of creating another collapsible share panel in a template.
|
|
207
|
+
|
|
187
208
|
## Actions available everywhere
|
|
188
209
|
|
|
189
210
|
The framework auto-mounts these actions in every template — no per-template boilerplate:
|
|
@@ -816,7 +816,8 @@ export function SlideInner({
|
|
|
816
816
|
</div>
|
|
817
817
|
);
|
|
818
818
|
|
|
819
|
-
// Slides with fmd-slide
|
|
819
|
+
// Slides with fmd-slide markup carry their layout in the raw HTML contract;
|
|
820
|
+
// render them as-is so supported semantic classes and inline styles survive.
|
|
820
821
|
const content = typeof slide.content === "string" ? slide.content : "";
|
|
821
822
|
const isRawHtml =
|
|
822
823
|
content.includes('class="fmd-slide"') ||
|
|
@@ -1,211 +1,155 @@
|
|
|
1
|
-
import { appBasePath } from "@agent-native/core/client/api-path";
|
|
1
|
+
import { appBasePath, appPath } from "@agent-native/core/client/api-path";
|
|
2
|
+
import { writeClipboardText } from "@agent-native/core/client/clipboard";
|
|
2
3
|
import { useT } from "@agent-native/core/client/i18n";
|
|
4
|
+
import { ShareDialog as CoreShareDialog } from "@agent-native/core/client/sharing";
|
|
5
|
+
import { ShareCopyRow } from "@agent-native/toolkit/sharing";
|
|
3
6
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
cloneElement,
|
|
8
|
+
isValidElement,
|
|
9
|
+
useCallback,
|
|
10
|
+
useState,
|
|
11
|
+
type MouseEvent,
|
|
12
|
+
type ReactElement,
|
|
13
|
+
type ReactNode,
|
|
14
|
+
} from "react";
|
|
15
|
+
import { toast } from "sonner";
|
|
12
16
|
|
|
13
17
|
import { CloudUpgrade } from "@/components/CloudUpgrade";
|
|
14
|
-
import {
|
|
15
|
-
Popover,
|
|
16
|
-
PopoverTrigger,
|
|
17
|
-
PopoverContent,
|
|
18
|
-
} from "@/components/ui/popover";
|
|
19
|
-
import {
|
|
20
|
-
Tooltip,
|
|
21
|
-
TooltipContent,
|
|
22
|
-
TooltipTrigger,
|
|
23
|
-
} from "@/components/ui/tooltip";
|
|
24
18
|
import type { Deck } from "@/context/DeckContext";
|
|
25
19
|
import { useDbStatus } from "@/hooks/use-db-status";
|
|
20
|
+
import { getDeckShareLinkOrder } from "@/lib/deck-share-links";
|
|
26
21
|
|
|
27
22
|
interface ShareDialogProps {
|
|
28
23
|
deck: Deck;
|
|
29
|
-
/** Trigger element rendered as the
|
|
24
|
+
/** Trigger element rendered as the dialog anchor (usually the Share button). */
|
|
30
25
|
children: ReactNode;
|
|
31
26
|
}
|
|
32
27
|
|
|
28
|
+
function getShareUrls(deckId: string) {
|
|
29
|
+
const origin = typeof window === "undefined" ? "" : window.location.origin;
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
editor:
|
|
33
|
+
typeof window === "undefined"
|
|
34
|
+
? `/deck/${deckId}`
|
|
35
|
+
: `${origin}${appPath(`/deck/${deckId}`)}`,
|
|
36
|
+
presentation:
|
|
37
|
+
typeof window === "undefined"
|
|
38
|
+
? `/p/${deckId}`
|
|
39
|
+
: `${origin}${appPath(`/p/${deckId}`)}`,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
33
43
|
export default function ShareDialog({ deck, children }: ShareDialogProps) {
|
|
34
44
|
const t = useT();
|
|
35
|
-
const [open, setOpen] = useState(false);
|
|
36
|
-
const [shareUrl, setShareUrl] = useState<string | null>(null);
|
|
37
|
-
const [loading, setLoading] = useState(false);
|
|
38
|
-
const [copied, setCopied] = useState(false);
|
|
39
|
-
const [error, setError] = useState("");
|
|
40
45
|
const { isLocal } = useDbStatus();
|
|
41
|
-
const [
|
|
46
|
+
const [open, setOpen] = useState(false);
|
|
47
|
+
const [shareLink, setShareLink] = useState<{
|
|
48
|
+
deckId: string;
|
|
49
|
+
token: string;
|
|
50
|
+
} | null>(null);
|
|
51
|
+
const [creatingLink, setCreatingLink] = useState(false);
|
|
52
|
+
|
|
53
|
+
const shareUrls = getShareUrls(deck.id);
|
|
54
|
+
const shareLinkOrder = getDeckShareLinkOrder(deck.visibility);
|
|
55
|
+
const shareToken =
|
|
56
|
+
shareLink?.deckId === deck.id ? shareLink.token : undefined;
|
|
57
|
+
const primaryShareLink = shareToken
|
|
58
|
+
? `${typeof window === "undefined" ? "" : window.location.origin}${appPath(`/share/${shareToken}`)}`
|
|
59
|
+
: undefined;
|
|
60
|
+
const secondaryShareLink = shareUrls[shareLinkOrder.secondary];
|
|
42
61
|
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
62
|
+
const openShareDialog = useCallback(async () => {
|
|
63
|
+
if (isLocal) {
|
|
64
|
+
setOpen(true);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (shareToken) {
|
|
68
|
+
setOpen(true);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (creatingLink) return;
|
|
46
72
|
|
|
73
|
+
setCreatingLink(true);
|
|
47
74
|
try {
|
|
48
|
-
const
|
|
75
|
+
const response = await fetch(`${appBasePath()}/api/share`, {
|
|
49
76
|
method: "POST",
|
|
50
77
|
headers: { "Content-Type": "application/json" },
|
|
51
78
|
body: JSON.stringify({ deck }),
|
|
52
79
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
80
|
+
let payload: { error?: unknown; shareToken?: unknown };
|
|
81
|
+
try {
|
|
82
|
+
payload = (await response.json()) as {
|
|
83
|
+
error?: unknown;
|
|
84
|
+
shareToken?: unknown;
|
|
85
|
+
};
|
|
86
|
+
} catch {
|
|
87
|
+
throw new Error(t("share.createFailed"));
|
|
57
88
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
89
|
+
if (!response.ok) {
|
|
90
|
+
throw new Error(
|
|
91
|
+
typeof payload.error === "string"
|
|
92
|
+
? payload.error
|
|
93
|
+
: t("share.createFailed"),
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
if (typeof payload.shareToken !== "string" || !payload.shareToken) {
|
|
97
|
+
throw new Error(t("share.createFailed"));
|
|
98
|
+
}
|
|
99
|
+
setShareLink({ deckId: deck.id, token: payload.shareToken });
|
|
100
|
+
setOpen(true);
|
|
101
|
+
} catch (error) {
|
|
102
|
+
toast.error(
|
|
103
|
+
error instanceof Error ? error.message : t("share.createFailed"),
|
|
104
|
+
);
|
|
64
105
|
} finally {
|
|
65
|
-
|
|
106
|
+
setCreatingLink(false);
|
|
66
107
|
}
|
|
67
|
-
};
|
|
108
|
+
}, [creatingLink, deck, isLocal, shareToken, t]);
|
|
68
109
|
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
110
|
+
const trigger = isValidElement(children)
|
|
111
|
+
? (() => {
|
|
112
|
+
const triggerElement = children as ReactElement<{
|
|
113
|
+
onClick?: (event: MouseEvent) => void;
|
|
114
|
+
}>;
|
|
115
|
+
return cloneElement(triggerElement, {
|
|
116
|
+
onClick: (event) => {
|
|
117
|
+
triggerElement.props.onClick?.(event);
|
|
118
|
+
if (!event.defaultPrevented) void openShareDialog();
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
})()
|
|
122
|
+
: children;
|
|
75
123
|
|
|
76
124
|
return (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
125
|
+
<>
|
|
126
|
+
{trigger}
|
|
127
|
+
{open && isLocal ? (
|
|
128
|
+
<CloudUpgrade
|
|
129
|
+
title={t("share.title")}
|
|
130
|
+
description={t("share.cloudUpgradeDescription")}
|
|
131
|
+
onClose={() => setOpen(false)}
|
|
132
|
+
/>
|
|
133
|
+
) : null}
|
|
134
|
+
<CoreShareDialog
|
|
135
|
+
open={open && !isLocal}
|
|
136
|
+
onClose={() => setOpen(false)}
|
|
137
|
+
resourceType="deck"
|
|
138
|
+
resourceId={deck.id}
|
|
139
|
+
resourceTitle={deck.title}
|
|
140
|
+
shareUrl={primaryShareLink}
|
|
141
|
+
linkTabExtras={
|
|
142
|
+
<ShareCopyRow
|
|
143
|
+
label={t("editorToolbar.presentationLink")}
|
|
144
|
+
description={t("editorToolbar.presentationLinkDescription")}
|
|
145
|
+
value={secondaryShareLink}
|
|
146
|
+
copyLabel={t("share.copyLink")}
|
|
147
|
+
copiedLabel={t("share.copied")}
|
|
148
|
+
onCopy={(value) => writeClipboardText(value)}
|
|
149
|
+
className="mt-3"
|
|
100
150
|
/>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<div className="text-foreground flex items-center gap-2 text-sm font-semibold">
|
|
105
|
-
<IconShare2 className="w-4 h-4 text-[#609FF8]" />
|
|
106
|
-
{t("share.title")}
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
|
|
110
|
-
<div className="space-y-4">
|
|
111
|
-
{!shareUrl ? (
|
|
112
|
-
<>
|
|
113
|
-
<details className="group rounded-md border border-border bg-muted/30">
|
|
114
|
-
<summary className="flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2.5 text-sm font-medium [&::-webkit-details-marker]:hidden">
|
|
115
|
-
{t("share.whatGetsShared")}
|
|
116
|
-
<IconChevronDown className="size-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180" />
|
|
117
|
-
</summary>
|
|
118
|
-
<div className="space-y-3 border-t border-border px-3 py-3 text-xs text-muted-foreground">
|
|
119
|
-
<ul className="space-y-1">
|
|
120
|
-
<li>
|
|
121
|
-
{t("share.slideContent", {
|
|
122
|
-
count: deck.slides.length,
|
|
123
|
-
})}
|
|
124
|
-
</li>
|
|
125
|
-
<li>{t("share.presentationView")}</li>
|
|
126
|
-
</ul>
|
|
127
|
-
<div>
|
|
128
|
-
<h4 className="mb-1 font-medium text-foreground/90">
|
|
129
|
-
{t("share.whatStaysPrivate")}
|
|
130
|
-
</h4>
|
|
131
|
-
<ul className="space-y-1">
|
|
132
|
-
<li>{t("share.speakerNotes")}</li>
|
|
133
|
-
<li>{t("share.otherPresentations")}</li>
|
|
134
|
-
<li>{t("share.editingAccess")}</li>
|
|
135
|
-
</ul>
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
</details>
|
|
139
|
-
|
|
140
|
-
{error && (
|
|
141
|
-
<p className="text-xs text-red-400 bg-red-400/10 px-3 py-2 rounded-lg">
|
|
142
|
-
{error}
|
|
143
|
-
</p>
|
|
144
|
-
)}
|
|
145
|
-
|
|
146
|
-
<button
|
|
147
|
-
onClick={handleShare}
|
|
148
|
-
disabled={loading}
|
|
149
|
-
className="w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg bg-[#609FF8] hover:bg-[#7AB2FA] disabled:opacity-50 text-black text-sm font-medium transition-colors"
|
|
150
|
-
>
|
|
151
|
-
{loading ? (
|
|
152
|
-
<>
|
|
153
|
-
<IconLoader2 className="w-4 h-4 animate-spin" />
|
|
154
|
-
{t("share.creatingLink")}
|
|
155
|
-
</>
|
|
156
|
-
) : (
|
|
157
|
-
<>
|
|
158
|
-
<IconShare2 className="w-4 h-4" />
|
|
159
|
-
{t("share.createShareLink")}
|
|
160
|
-
</>
|
|
161
|
-
)}
|
|
162
|
-
</button>
|
|
163
|
-
</>
|
|
164
|
-
) : (
|
|
165
|
-
<>
|
|
166
|
-
<div className="flex items-center gap-2">
|
|
167
|
-
<input
|
|
168
|
-
readOnly
|
|
169
|
-
value={shareUrl}
|
|
170
|
-
className="flex-1 bg-accent/50 border border-border rounded-lg px-3 py-2 text-sm text-foreground/90 outline-none"
|
|
171
|
-
/>
|
|
172
|
-
<Tooltip>
|
|
173
|
-
<TooltipTrigger asChild>
|
|
174
|
-
<button
|
|
175
|
-
onClick={handleCopy}
|
|
176
|
-
className="flex-shrink-0 p-2 rounded-lg bg-accent hover:bg-accent border border-border transition-colors"
|
|
177
|
-
aria-label={t("share.copyLink")}
|
|
178
|
-
>
|
|
179
|
-
{copied ? (
|
|
180
|
-
<IconCheck className="w-4 h-4 text-green-400" />
|
|
181
|
-
) : (
|
|
182
|
-
<IconCopy className="w-4 h-4 text-muted-foreground" />
|
|
183
|
-
)}
|
|
184
|
-
</button>
|
|
185
|
-
</TooltipTrigger>
|
|
186
|
-
<TooltipContent>{t("share.copyLink")}</TooltipContent>
|
|
187
|
-
</Tooltip>
|
|
188
|
-
</div>
|
|
189
|
-
|
|
190
|
-
<a
|
|
191
|
-
href={shareUrl}
|
|
192
|
-
target="_blank"
|
|
193
|
-
rel="noopener noreferrer"
|
|
194
|
-
className="flex items-center justify-center gap-2 w-full px-4 py-2 rounded-lg bg-accent hover:bg-accent border border-border text-foreground/70 text-sm transition-colors"
|
|
195
|
-
>
|
|
196
|
-
<IconExternalLink className="w-3.5 h-3.5" />
|
|
197
|
-
{t("share.openSharedLink")}
|
|
198
|
-
</a>
|
|
199
|
-
|
|
200
|
-
<p className="sr-only text-[11px] text-muted-foreground/70 text-center">
|
|
201
|
-
{t("share.anyoneWithLink")}
|
|
202
|
-
</p>
|
|
203
|
-
</>
|
|
204
|
-
)}
|
|
205
|
-
</div>
|
|
206
|
-
</>
|
|
207
|
-
)}
|
|
208
|
-
</PopoverContent>
|
|
209
|
-
</Popover>
|
|
151
|
+
}
|
|
152
|
+
/>
|
|
153
|
+
</>
|
|
210
154
|
);
|
|
211
155
|
}
|
|
@@ -446,6 +446,7 @@ export function FirstDeckOnboardingFlow({
|
|
|
446
446
|
className="mt-8"
|
|
447
447
|
autoFocus
|
|
448
448
|
attachmentsEnabled
|
|
449
|
+
voiceEnabled
|
|
449
450
|
maxDocumentAttachmentBytes={MAX_REFERENCE_FILE_BYTES}
|
|
450
451
|
documentAttachmentLimitLabel="Slides reference files"
|
|
451
452
|
disabled={uploading}
|
|
@@ -435,11 +435,107 @@ button[title="Open agent sidebar"] {
|
|
|
435
435
|
height: 100%;
|
|
436
436
|
display: flex;
|
|
437
437
|
flex-direction: column;
|
|
438
|
-
|
|
438
|
+
color: var(--ds-text, #ffffff);
|
|
439
|
+
background: var(--ds-bg, #0b0b0d);
|
|
440
|
+
font-family: var(--ds-body-font, "Poppins", sans-serif);
|
|
439
441
|
box-sizing: border-box;
|
|
440
442
|
overflow: hidden;
|
|
441
443
|
}
|
|
442
444
|
|
|
445
|
+
/* Semantic slide markup is persisted by the agent. Keep the classes useful
|
|
446
|
+
when a later edit omits inline styles, while leaving explicit inline values
|
|
447
|
+
authoritative through the normal CSS cascade. */
|
|
448
|
+
.fmd-slide.fmd-slide--title {
|
|
449
|
+
justify-content: center;
|
|
450
|
+
align-items: flex-start;
|
|
451
|
+
gap: 24px;
|
|
452
|
+
padding: 80px 110px;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.fmd-slide.fmd-slide--content,
|
|
456
|
+
.fmd-slide.fmd-slide--two-column {
|
|
457
|
+
justify-content: flex-start;
|
|
458
|
+
gap: 24px;
|
|
459
|
+
padding: 64px 80px;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.fmd-slide.fmd-slide--statement {
|
|
463
|
+
align-items: center;
|
|
464
|
+
justify-content: center;
|
|
465
|
+
gap: 24px;
|
|
466
|
+
padding: 64px 80px;
|
|
467
|
+
text-align: center;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.fmd-slide.fmd-slide--title h1,
|
|
471
|
+
.fmd-slide.fmd-slide--content h1,
|
|
472
|
+
.fmd-slide.fmd-slide--content h2,
|
|
473
|
+
.fmd-slide.fmd-slide--two-column h1,
|
|
474
|
+
.fmd-slide.fmd-slide--two-column h2,
|
|
475
|
+
.fmd-slide.fmd-slide--statement h1,
|
|
476
|
+
.fmd-slide.fmd-slide--statement h2 {
|
|
477
|
+
color: var(--ds-text, #ffffff);
|
|
478
|
+
font-family: var(
|
|
479
|
+
--ds-heading-font,
|
|
480
|
+
var(--ds-body-font, "Poppins", sans-serif)
|
|
481
|
+
);
|
|
482
|
+
font-weight: 700;
|
|
483
|
+
letter-spacing: -0.03em;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.fmd-slide.fmd-slide--title h1 {
|
|
487
|
+
font-size: 46px;
|
|
488
|
+
line-height: 1.1;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.fmd-slide.fmd-slide--content h1,
|
|
492
|
+
.fmd-slide.fmd-slide--two-column h1,
|
|
493
|
+
.fmd-slide.fmd-slide--statement h1 {
|
|
494
|
+
font-size: 38px;
|
|
495
|
+
line-height: 1.15;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.fmd-slide.fmd-slide--content h2,
|
|
499
|
+
.fmd-slide.fmd-slide--two-column h2 {
|
|
500
|
+
font-size: 30px;
|
|
501
|
+
line-height: 1.2;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.fmd-slide.fmd-slide--statement h2 {
|
|
505
|
+
font-size: 42px;
|
|
506
|
+
line-height: 1.15;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.fmd-slide .fmd-subtitle,
|
|
510
|
+
.fmd-slide .fmd-muted {
|
|
511
|
+
color: var(--ds-text-muted, rgba(255, 255, 255, 0.7));
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.fmd-slide .fmd-subtitle {
|
|
515
|
+
font-size: 22px;
|
|
516
|
+
line-height: 1.4;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.fmd-slide .fmd-columns {
|
|
520
|
+
display: grid;
|
|
521
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
522
|
+
gap: 32px;
|
|
523
|
+
width: 100%;
|
|
524
|
+
min-height: 0;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
.fmd-slide .fmd-callout {
|
|
528
|
+
padding: 20px 24px;
|
|
529
|
+
border: 1px solid var(--ds-accent, rgba(255, 255, 255, 0.2));
|
|
530
|
+
border-radius: var(--ds-radius, 12px);
|
|
531
|
+
background: rgba(255, 255, 255, 0.05);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.fmd-slide .fmd-accent,
|
|
535
|
+
.fmd-slide .fmd-cyan {
|
|
536
|
+
color: var(--ds-accent, #00e5ff);
|
|
537
|
+
}
|
|
538
|
+
|
|
443
539
|
.fmd-autofit-scale {
|
|
444
540
|
transform: translate(var(--fmd-fit-x, 0px), var(--fmd-fit-y, 0px))
|
|
445
541
|
scale(var(--fmd-fit-scale, 1));
|
|
@@ -461,7 +557,7 @@ button[title="Open agent sidebar"] {
|
|
|
461
557
|
|
|
462
558
|
/* Section label - cyan uppercase */
|
|
463
559
|
.fmd-label {
|
|
464
|
-
color: #00e5ff;
|
|
560
|
+
color: var(--ds-accent, #00e5ff);
|
|
465
561
|
font-size: 11px;
|
|
466
562
|
font-weight: 600;
|
|
467
563
|
letter-spacing: 3px;
|
|
@@ -471,7 +567,7 @@ button[title="Open agent sidebar"] {
|
|
|
471
567
|
|
|
472
568
|
/* Cyan accent color */
|
|
473
569
|
.fmd-cyan {
|
|
474
|
-
color: #00e5ff
|
|
570
|
+
color: var(--ds-accent, #00e5ff);
|
|
475
571
|
}
|
|
476
572
|
|
|
477
573
|
/* Large stat numbers */
|
|
@@ -295,6 +295,7 @@ const messages = {
|
|
|
295
295
|
creatingLink: "Creating link...",
|
|
296
296
|
createShareLink: "Create Share Link",
|
|
297
297
|
copyLink: "Copy link",
|
|
298
|
+
copied: "Copied",
|
|
298
299
|
openSharedLink: "Open shared link",
|
|
299
300
|
anyoneWithLink: "Anyone with this link can view this presentation.",
|
|
300
301
|
},
|
|
@@ -182,6 +182,11 @@ in the moment of agent use.
|
|
|
182
182
|
five-item sidebar preview and a footer row with New chat followed by an
|
|
183
183
|
ellipsis disclosure up to fifteen. Apps inject routing, labels, and domain
|
|
184
184
|
actions.
|
|
185
|
+
- **Data grid kit**: provider-agnostic spreadsheet mechanics belong in
|
|
186
|
+
`@agent-native/toolkit/data-grid`. Apps provide rows, typed columns, editor
|
|
187
|
+
slots, selection and width state, persistence callbacks, and product-level
|
|
188
|
+
row/body slots. Keep database models, access checks, grouping, drag/drop,
|
|
189
|
+
and domain actions in the app adapter.
|
|
185
190
|
- **Agent page kit**: the full-page `/agent` surface (`AgentTabsPage` from
|
|
186
191
|
`@agent-native/core/client`) with Context, Files, Connections, Jobs, and
|
|
187
192
|
Access tabs plus a Personal/Organization scope toggle. The canonical home
|