This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
// The example code tour of the template (in-app guides spec §7.3): defined next to the module it
|
||||
// explains, published to the deployment's environment by the deploy step, and run from memory with
|
||||
// `pnpm dev` (the fake platform). Its steps point at the `data-guide` anchors of ui/pages.tsx and
|
||||
// ui/note-form.tsx; `kit check` warns when one of them is removed.
|
||||
//
|
||||
// The audience is a trait the app sends (`role`, from the guides module): a viewer cannot add a note,
|
||||
// so the tour is for the members who can. The platform compares only the traits the project's guide
|
||||
// settings allow-list, so allow `role` there (console, Guides, Settings) before the tour shows.
|
||||
|
||||
import { defineGuide } from "@conusai-kit/guides"
|
||||
import { guideText } from "./messages.js"
|
||||
|
||||
const t = guideText.tour
|
||||
|
||||
export const firstNoteTour = defineGuide({
|
||||
key: "notes.first-note",
|
||||
schema_version: 1,
|
||||
kind: "tour",
|
||||
default_locale: "en",
|
||||
audience: { trait: { name: "role", in: ["owner", "admin", "member"] } },
|
||||
trigger: { page: "/:org/:workspace/:project/notes" },
|
||||
frequency: "once",
|
||||
steps: [
|
||||
{
|
||||
id: "new",
|
||||
type: "tooltip",
|
||||
target: { anchor: "notes.new-note" },
|
||||
title: t.newTitle,
|
||||
body: t.newBody,
|
||||
advance: { on: "next_button" },
|
||||
},
|
||||
{
|
||||
id: "title",
|
||||
type: "tooltip",
|
||||
target: { anchor: "notes.note-title" },
|
||||
title: t.titleTitle,
|
||||
body: t.titleBody,
|
||||
advance: { on: "next_button" },
|
||||
},
|
||||
{
|
||||
id: "list",
|
||||
type: "tooltip",
|
||||
target: { anchor: "notes.note-list" },
|
||||
title: t.listTitle,
|
||||
body: t.listBody,
|
||||
advance: { on: "next_button" },
|
||||
},
|
||||
{ id: "done", type: "modal", title: t.doneTitle, body: t.doneBody },
|
||||
],
|
||||
})
|
||||
Reference in New Issue
Block a user