Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"connected-next-router/react-redux": "8.0.7",
"react-beautiful-dnd/react-redux": "8.0.7",
"express": "4.20.0",
"@prismicio/types-internal": "3.11.2"
"@prismicio/types-internal": "3.11.2",
"defu": "^6.1.5"
},
"workspaces": [
"playwright",
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-next/src/hooks/slice-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const createComponentFile = async ({
<br />
<strong>You can edit this slice directly in your code editor.</strong>
{/**
* 💡 Use the Prismic MCP server with your code editor
* 📚 Docs: https://prismic.io/docs/ai#code-with-prismics-mcp-server
* 💡 Use your own AI agent with the Prismic CLI
* 📚 Docs: https://prismic.io/docs/ai#create-slices
*/}`;

if (data.componentContents) {
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-nuxt/src/hooks/slice-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const createComponentFile = async ({
<br />
<strong>You can edit this slice directly in your code editor.</strong>
<!--
💡 Use the Prismic MCP server with your code editor
📚 Docs: https://prismic.io/docs/ai#code-with-prismics-mcp-server
💡 Use your own AI agent with the Prismic CLI
📚 Docs: https://prismic.io/docs/ai#create-slices
-->`;

if (data.componentContents) {
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-nuxt2/src/hooks/slice-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const createComponentFile = async ({
<br />
<strong>You can edit this slice directly in your code editor.</strong>
<!--
💡 Use the Prismic MCP server with your code editor
📚 Docs: https://prismic.io/docs/ai#code-with-prismics-mcp-server
💡 Use your own AI agent with the Prismic CLI
📚 Docs: https://prismic.io/docs/ai#create-slices
-->
</section>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Placeholder component for {slice.slice_type} (variation: {slice.variation}) slic
<br />
<strong>You can edit this slice directly in your code editor.</strong>
<!--
💡 Use the Prismic MCP server with your code editor
📚 Docs: https://prismic.io/docs/ai#code-with-prismics-mcp-server
💡 Use your own AI agent with the Prismic CLI
📚 Docs: https://prismic.io/docs/ai#create-slices
-->
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ exports[`Svelte <=4 syntax > component file has correct contents 1`] = `
<br />
<strong>You can edit this slice directly in your code editor.</strong>
<!--
💡 Use the Prismic MCP server with your code editor
📚 Docs: https://prismic.io/docs/ai#code-with-prismics-mcp-server
💡 Use your own AI agent with the Prismic CLI
📚 Docs: https://prismic.io/docs/ai#create-slices
-->
</section>
"
Expand All @@ -38,8 +38,8 @@ exports[`Svelte <=4 syntax > component file is correctly typed when TypeScript i
<br />
<strong>You can edit this slice directly in your code editor.</strong>
<!--
💡 Use the Prismic MCP server with your code editor
📚 Docs: https://prismic.io/docs/ai#code-with-prismics-mcp-server
💡 Use your own AI agent with the Prismic CLI
📚 Docs: https://prismic.io/docs/ai#create-slices
-->
</section>
"
Expand All @@ -63,8 +63,8 @@ exports[`component file has correct contents 1`] = `
<br />
<strong>You can edit this slice directly in your code editor.</strong>
<!--
💡 Use the Prismic MCP server with your code editor
📚 Docs: https://prismic.io/docs/ai#code-with-prismics-mcp-server
💡 Use your own AI agent with the Prismic CLI
📚 Docs: https://prismic.io/docs/ai#create-slices
-->
</section>
"
Expand All @@ -89,8 +89,8 @@ exports[`component file is correctly typed when TypeScript is enabled 1`] = `
<br />
<strong>You can edit this slice directly in your code editor.</strong>
<!--
💡 Use the Prismic MCP server with your code editor
📚 Docs: https://prismic.io/docs/ai#code-with-prismics-mcp-server
💡 Use your own AI agent with the Prismic CLI
📚 Docs: https://prismic.io/docs/ai#create-slices
-->
</section>
"
Expand Down
10 changes: 5 additions & 5 deletions packages/manager/src/managers/telemetry/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const SegmentEventType = {
"slice-generation:plugin-installation-clicked",
navigation_documentationLinkClicked: "navigation:documentation-link-clicked",
sidebar_link_clicked: "sidebar:link-clicked",
mcp_promo_link_clicked: "mcp:promo-link-clicked",
ai_promo_link_clicked: "ai:promo-link-clicked",
Comment thread
jomifepe marked this conversation as resolved.
info_banner_dismissed: "info-banner:dismissed",
info_banner_button_clicked: "info-banner:button-clicked",
slice_library_opened: "slice-library:opened",
Expand Down Expand Up @@ -129,7 +129,7 @@ export const HumanSegmentEventType = {
[SegmentEventType.navigation_documentationLinkClicked]:
"SliceMachine Documentation Link Clicked",
[SegmentEventType.sidebar_link_clicked]: "Sidebar Link Clicked",
[SegmentEventType.mcp_promo_link_clicked]: "MCP Promo Link Clicked",
[SegmentEventType.ai_promo_link_clicked]: "AI Promo Link Clicked",
[SegmentEventType.info_banner_dismissed]:
"SliceMachine Info Banner Dismissed",
[SegmentEventType.info_banner_button_clicked]:
Expand Down Expand Up @@ -506,8 +506,8 @@ type SidebarLinkClicked = SegmentEvent<
}
>;

type McpPromoLinkClicked = SegmentEvent<
typeof SegmentEventType.mcp_promo_link_clicked,
type AiPromoLinkClicked = SegmentEvent<
typeof SegmentEventType.ai_promo_link_clicked,
{
source: string;
target: string;
Expand Down Expand Up @@ -629,7 +629,7 @@ export type SegmentEvents =
| SliceGenerationPluginInstallationClicked
| NavigationDocumentationLinkClicked
| SidebarLinkClicked
| McpPromoLinkClicked
| AiPromoLinkClicked
| InfoBannerDismissed
| InfoBannerButtonClicked
| SliceLibraryOpened
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"dependencies": {
"@prismicio/client": "7.17.0",
"common-tags": "^1.8.2",
"defu": "^6.1.2",
"defu": "^6.1.5",
"dotenv": "16.3.1",
"fp-ts": "^2.13.1",
"fs-extra": "11.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,16 @@ export function Navigation() {
/>

<NavigationItem
title="Prismic MCP"
href="https://prismic.io/docs/ai#code-with-prismics-mcp-server"
title="Prismic with AI"
href="https://prismic.io/docs/ai"
target="_blank"
Icon={CodeIcon}
RightElement={<Badge title="New" color="indigo" />}
tooltip="Connect Prismic MCP to your editor (like Cursor) for AI-powered coding."
tooltip="Learn how to use Prismic with AI for modeling and coding slices."
onClick={() => {
void telemetry.track({
event: "sidebar:link-clicked",
link_name: "prismic_mcp",
link_name: "prismic_ai",
source: "slice_machine_sidebar",
});
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Button } from "@prismicio/editor-ui";

import { telemetry } from "@/apiClient";

export const McpPromoLink = () => {
export const AIPromoLink = () => {
return (
<Button
asChild
Expand All @@ -12,17 +12,14 @@ export const McpPromoLink = () => {
sx={{ alignSelf: "center" }}
onClick={() => {
void telemetry.track({
event: "mcp:promo-link-clicked",
event: "ai:promo-link-clicked",
source: "slice_editor",
target: "docs",
});
}}
>
<a
href="https://prismic.io/docs/ai#code-with-prismics-mcp-server"
target="_blank"
>
Boost your workflow in Cursor with Prismic MCP
Comment thread
jomifepe marked this conversation as resolved.
<a href="https://prismic.io/docs/ai" target="_blank">
Boost your workflow with Prismic AI modeling
</a>
</Button>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { type FC } from "react";

import { BreadcrumbItem } from "@/components/Breadcrumb";
import { AutoSaveStatusIndicator } from "@/features/autoSave/AutoSaveStatusIndicator";
import { AIPromoLink } from "@/features/slices/sliceBuilder/AIPromoLink";
import { FloatingBackButton } from "@/features/slices/sliceBuilder/FloatingBackButton";
import { McpPromoLink } from "@/features/slices/sliceBuilder/McpPromoLink";
import { useSliceState } from "@/features/slices/sliceBuilder/SliceBuilderProvider";
import {
AppLayout,
Expand Down Expand Up @@ -36,7 +36,7 @@ export const SliceBuilder: FC = () => {
<BreadcrumbItem active>{slice.model.name}</BreadcrumbItem>
</AppLayoutBreadcrumb>
<AppLayoutActions>
<McpPromoLink />
<AIPromoLink />
<AutoSaveStatusIndicator status={actionQueueStatus} />
<SimulatorButton disabled={actionQueueStatus !== "done"} />
</AppLayoutActions>
Expand Down
6 changes: 3 additions & 3 deletions playwright/pages/components/Menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class Menu {
readonly slicesLink: Locator;
readonly changesLink: Locator;
readonly documentationLink: Locator;
readonly prismicMcpLink: Locator;
readonly prismicAiLink: Locator;
readonly changelogLink: Locator;
readonly appVersion: Locator;
readonly updatesAvailableTitle: Locator;
Expand Down Expand Up @@ -59,8 +59,8 @@ export class Menu {
exact: true,
});

this.prismicMcpLink = this.menu.getByRole("link", {
name: "Prismic MCP",
this.prismicAiLink = this.menu.getByRole("link", {
name: "Prismic with AI",
});
this.changelogLink = this.menu.getByRole("link", {
name: "Changelog",
Expand Down
10 changes: 4 additions & 6 deletions playwright/tests/common/navigation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,17 @@ test('I can open Prismic documentation by clicking the "Documentation" link', as
await expect(newTab).toHaveURL("https://prismic.io/docs/nextjs");
});

test('I can open Prismic MCP documentation by clicking the "Prismic MCP" link', async ({
test('I can open Prismic AI documentation by clicking the "Prismic with AI" link', async ({
sliceMachinePage,
}) => {
await sliceMachinePage.gotoDefaultPage();
await expect(sliceMachinePage.menu.prismicMcpLink).toBeVisible();
await expect(sliceMachinePage.menu.prismicAiLink).toBeVisible();

const newTabPromise = sliceMachinePage.page.waitForEvent("popup");
await sliceMachinePage.menu.prismicMcpLink.click();
await sliceMachinePage.menu.prismicAiLink.click();

const newTab = await newTabPromise;
await newTab.waitForLoadState();

await expect(newTab).toHaveURL(
"https://prismic.io/docs/ai#code-with-prismics-mcp-server",
);
await expect(newTab).toHaveURL("https://prismic.io/docs/ai");
});
24 changes: 5 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11072,7 +11072,7 @@ __metadata:
"@typescript-eslint/parser": 5.55.0
"@vitest/coverage-v8": 0.32.0
common-tags: ^1.8.2
defu: ^6.1.2
defu: ^6.1.5
depcheck: 1.4.3
dotenv: 16.3.1
eslint: 8.37.0
Expand Down Expand Up @@ -19196,24 +19196,10 @@ __metadata:
languageName: node
linkType: hard

"defu@npm:^5.0.0":
version: 5.0.1
resolution: "defu@npm:5.0.1"
checksum: f65556c2e8aa7789080f04c1d52fd7188d8258d9bc7f673e5bedc6be33eb6150f41844ac96aec99c798e47eb9beb97dae03c24edd73d3ddc643e4c7c72124606
languageName: node
linkType: hard

"defu@npm:^6.0.0, defu@npm:^6.1.1, defu@npm:^6.1.2":
version: 6.1.2
resolution: "defu@npm:6.1.2"
checksum: 2ec0ff8414d5a1ab2b8c7e9a79bbad6d97d23ea7ebf5dcf80c3c7ffd9715c30f84a3cc47b917379ea756b3db0dc4701ce6400e493a1ae1688dffcd0f884233b2
languageName: node
linkType: hard

"defu@npm:^6.1.4":
version: 6.1.4
resolution: "defu@npm:6.1.4"
checksum: 40e3af6338f195ac1564f53d1887fa2d0429ac7e8c081204bc4d29191180059d3952b5f4e08fe5df8d59eb873aa26e9c88b56d4fac699673d4a372c93620b229
"defu@npm:^6.1.5":
version: 6.1.7
resolution: "defu@npm:6.1.7"
checksum: aeca3fc4a1e9f5a99c8b2cd3efa478dbbda1b344e3facfbe750e8b10d8ec48ede08560108f58363e9b8b8687d9ccb68faf0ba24833e267a0f1c0518c89fdabfe
languageName: node
linkType: hard

Expand Down
Loading