@open-aippt/core 1.13.2

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.
Files changed (142) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +98 -0
  3. package/bin.js +2 -0
  4. package/dist/build-DxTqmvsO.js +17 -0
  5. package/dist/cli/bin.d.ts +1 -0
  6. package/dist/cli/bin.js +86 -0
  7. package/dist/config-CjzqjrEA.js +4280 -0
  8. package/dist/config-DIC-yVPp.d.ts +23 -0
  9. package/dist/design-cpzS8aud.js +35 -0
  10. package/dist/dev-BYuTeJbA.js +20 -0
  11. package/dist/format-BCeKbTOM.js +1605 -0
  12. package/dist/index.d.ts +134 -0
  13. package/dist/index.js +467 -0
  14. package/dist/locale/index.d.ts +24 -0
  15. package/dist/locale/index.js +3 -0
  16. package/dist/preview-DlQvnJPq.js +18 -0
  17. package/dist/sync-BPZ0m27m.js +139 -0
  18. package/dist/sync-EsYusbbL.js +3 -0
  19. package/dist/types-CHmFPIG_.d.ts +430 -0
  20. package/dist/vite/index.d.ts +14 -0
  21. package/dist/vite/index.js +4 -0
  22. package/env.d.ts +59 -0
  23. package/package.json +103 -0
  24. package/skills/apply-comments/SKILL.md +83 -0
  25. package/skills/create-slide/SKILL.md +91 -0
  26. package/skills/create-theme/SKILL.md +250 -0
  27. package/skills/current-slide/SKILL.md +110 -0
  28. package/skills/slide-authoring/SKILL.md +625 -0
  29. package/src/app/app.tsx +47 -0
  30. package/src/app/components/asset-view.tsx +966 -0
  31. package/src/app/components/history-provider.tsx +120 -0
  32. package/src/app/components/image-placeholder.tsx +243 -0
  33. package/src/app/components/inspector/asset-picker-dialog.tsx +196 -0
  34. package/src/app/components/inspector/comment-widget.tsx +93 -0
  35. package/src/app/components/inspector/image-crop-dialog.tsx +212 -0
  36. package/src/app/components/inspector/inspect-overlay.tsx +387 -0
  37. package/src/app/components/inspector/inspector-panel.tsx +1115 -0
  38. package/src/app/components/inspector/inspector-provider.tsx +1218 -0
  39. package/src/app/components/inspector/save-bar.tsx +48 -0
  40. package/src/app/components/language-toggle.tsx +39 -0
  41. package/src/app/components/notes-drawer.tsx +120 -0
  42. package/src/app/components/overview-grid.tsx +363 -0
  43. package/src/app/components/panel/panel-fields.tsx +60 -0
  44. package/src/app/components/panel/panel-shell.tsx +80 -0
  45. package/src/app/components/panel/save-card.tsx +142 -0
  46. package/src/app/components/pdf-progress-toast.tsx +32 -0
  47. package/src/app/components/player.tsx +466 -0
  48. package/src/app/components/pptx-progress-toast.tsx +32 -0
  49. package/src/app/components/present/blackout-overlay.tsx +18 -0
  50. package/src/app/components/present/control-bar.tsx +315 -0
  51. package/src/app/components/present/help-overlay.tsx +57 -0
  52. package/src/app/components/present/jump-input.tsx +74 -0
  53. package/src/app/components/present/laser-pointer.tsx +39 -0
  54. package/src/app/components/present/progress-bar.tsx +26 -0
  55. package/src/app/components/present/use-idle.ts +46 -0
  56. package/src/app/components/present/use-pointer-near-bottom.ts +34 -0
  57. package/src/app/components/present/use-presenter-channel.ts +66 -0
  58. package/src/app/components/present/use-touch-swipe.ts +66 -0
  59. package/src/app/components/shared-element.tsx +48 -0
  60. package/src/app/components/sidebar/folder-item.tsx +258 -0
  61. package/src/app/components/sidebar/icon-picker.tsx +61 -0
  62. package/src/app/components/sidebar/mobile-pill.tsx +34 -0
  63. package/src/app/components/sidebar/sidebar-footer.tsx +105 -0
  64. package/src/app/components/sidebar/sidebar.tsx +284 -0
  65. package/src/app/components/slide-canvas.tsx +102 -0
  66. package/src/app/components/slide-transition-layer.tsx +844 -0
  67. package/src/app/components/style-panel/design-provider.tsx +148 -0
  68. package/src/app/components/style-panel/style-panel.tsx +349 -0
  69. package/src/app/components/style-panel/use-design.ts +112 -0
  70. package/src/app/components/theme-toggle.tsx +59 -0
  71. package/src/app/components/themes/theme-detail.tsx +305 -0
  72. package/src/app/components/themes/themes-gallery.tsx +149 -0
  73. package/src/app/components/thumbnail-rail.tsx +805 -0
  74. package/src/app/components/ui/badge.tsx +45 -0
  75. package/src/app/components/ui/button.tsx +99 -0
  76. package/src/app/components/ui/card.tsx +92 -0
  77. package/src/app/components/ui/context-menu.tsx +237 -0
  78. package/src/app/components/ui/dialog.tsx +157 -0
  79. package/src/app/components/ui/dropdown-menu.tsx +245 -0
  80. package/src/app/components/ui/input.tsx +25 -0
  81. package/src/app/components/ui/label.tsx +24 -0
  82. package/src/app/components/ui/popover.tsx +75 -0
  83. package/src/app/components/ui/progress.tsx +31 -0
  84. package/src/app/components/ui/scroll-area.tsx +53 -0
  85. package/src/app/components/ui/select.tsx +196 -0
  86. package/src/app/components/ui/separator.tsx +28 -0
  87. package/src/app/components/ui/slider.tsx +61 -0
  88. package/src/app/components/ui/sonner.tsx +48 -0
  89. package/src/app/components/ui/tabs.tsx +79 -0
  90. package/src/app/components/ui/textarea.tsx +22 -0
  91. package/src/app/components/ui/toggle-group.tsx +83 -0
  92. package/src/app/components/ui/toggle.tsx +45 -0
  93. package/src/app/components/ui/tooltip.tsx +58 -0
  94. package/src/app/favicon.ico +0 -0
  95. package/src/app/index.html +13 -0
  96. package/src/app/lib/assets.ts +242 -0
  97. package/src/app/lib/design-presets.ts +94 -0
  98. package/src/app/lib/design.ts +58 -0
  99. package/src/app/lib/export-html.ts +326 -0
  100. package/src/app/lib/export-pdf.ts +298 -0
  101. package/src/app/lib/export-pptx.ts +284 -0
  102. package/src/app/lib/folders.ts +239 -0
  103. package/src/app/lib/inspector/fiber.test.ts +154 -0
  104. package/src/app/lib/inspector/fiber.ts +85 -0
  105. package/src/app/lib/inspector/use-comments.ts +74 -0
  106. package/src/app/lib/inspector/use-editor.ts +73 -0
  107. package/src/app/lib/inspector/use-notes.ts +134 -0
  108. package/src/app/lib/locale-store.ts +67 -0
  109. package/src/app/lib/page-context.tsx +38 -0
  110. package/src/app/lib/print-ready.test.ts +32 -0
  111. package/src/app/lib/print-ready.ts +51 -0
  112. package/src/app/lib/sdk.test.ts +13 -0
  113. package/src/app/lib/sdk.ts +37 -0
  114. package/src/app/lib/slides.ts +26 -0
  115. package/src/app/lib/step-context.tsx +261 -0
  116. package/src/app/lib/themes.ts +22 -0
  117. package/src/app/lib/transition.ts +30 -0
  118. package/src/app/lib/use-agent-socket.ts +18 -0
  119. package/src/app/lib/use-click-page-navigation.ts +60 -0
  120. package/src/app/lib/use-is-mobile.ts +21 -0
  121. package/src/app/lib/use-locale.ts +8 -0
  122. package/src/app/lib/use-prefers-reduced-motion.ts +19 -0
  123. package/src/app/lib/use-slide-module.ts +48 -0
  124. package/src/app/lib/use-wheel-page-navigation.ts +99 -0
  125. package/src/app/lib/utils.test.ts +25 -0
  126. package/src/app/lib/utils.ts +6 -0
  127. package/src/app/main.tsx +14 -0
  128. package/src/app/routes/assets.tsx +9 -0
  129. package/src/app/routes/home-shell.tsx +213 -0
  130. package/src/app/routes/home.tsx +807 -0
  131. package/src/app/routes/presenter.tsx +418 -0
  132. package/src/app/routes/slide.tsx +1108 -0
  133. package/src/app/routes/themes.tsx +34 -0
  134. package/src/app/styles.css +429 -0
  135. package/src/app/virtual.d.ts +51 -0
  136. package/src/locale/en.ts +416 -0
  137. package/src/locale/format.ts +12 -0
  138. package/src/locale/index.ts +6 -0
  139. package/src/locale/ja.ts +422 -0
  140. package/src/locale/types.ts +443 -0
  141. package/src/locale/zh-cn.ts +414 -0
  142. package/src/locale/zh-tw.ts +414 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 aibabelx
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,98 @@
1
+ # @open-aippt/core
2
+
3
+ Runtime and CLI for [open-aippt](https://github.com/aibabelx/open-aippt) — a React-based slide framework where you write slides and the framework handles the Vite/React stack, layout, navigation, hot reload, and fullscreen play mode.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add @open-aippt/core
9
+ ```
10
+
11
+ Most users get this installed automatically by running `npx @open-aippt/cli init`. Use this package directly only if you're wiring up an existing workspace by hand.
12
+
13
+ ## What's inside
14
+
15
+ - **Runtime** — home page, slide viewer, thumbnail rail, keyboard navigation, and fullscreen presenter mode. Every slide renders into a fixed **1920×1080** canvas; the framework scales it.
16
+ - **Vite plugin** — discovers `slides/<id>/index.{tsx,jsx,ts,js}`, exposes them via virtual modules, and reloads when slides are added or removed.
17
+ - **CLI** — `open-aippt dev | build | preview` so workspaces never need to touch Vite, React, or tsconfig directly.
18
+
19
+ ## CLI
20
+
21
+ Once installed, the `open-aippt` bin is available in the workspace:
22
+
23
+ | Command | Description |
24
+ | --- | --- |
25
+ | `open-aippt dev` | Start the dev server. Flags: `-p, --port <port>`, `--host [host]`, `--open`. |
26
+ | `open-aippt build` | Build a static site. Flags: `--out-dir <dir>` (defaults to `dist`). |
27
+ | `open-aippt preview` | Preview the production build. Flags: `-p, --port <port>`, `--host [host]`, `--open`. |
28
+
29
+ ## Config
30
+
31
+ Create `open-aippt.config.ts` in the workspace root (all fields optional):
32
+
33
+ ```ts
34
+ import type { OpenAipptConfig } from '@open-aippt/core';
35
+
36
+ const openAipptConfig: OpenAipptConfig = {
37
+ slidesDir: 'slides',
38
+ port: 5173,
39
+ };
40
+
41
+ export default openAipptConfig;
42
+ ```
43
+
44
+ ### Hosting under a subpath
45
+
46
+ Set `base` to deploy the built site under a sub-directory (intranet folders, GitHub Pages project sites, reverse proxies). Use a leading and trailing slash:
47
+
48
+ ```ts
49
+ const openAipptConfig: OpenAipptConfig = {
50
+ base: '/my-slides/',
51
+ };
52
+ ```
53
+
54
+ The value is passed straight to Vite's `base` and to React Router's `basename`, so client-side navigation matches the deployed path.
55
+
56
+ ## Authoring slides
57
+
58
+ Slides live under `slides/<kebab-case-id>/index.tsx` and default-export an array of `Page` components:
59
+
60
+ ```tsx
61
+ import type { Page } from '@open-aippt/core';
62
+
63
+ const Cover: Page = () => (
64
+ <div className="flex h-full w-full items-center justify-center">
65
+ <h1 className="text-[120px] font-bold">Hello, open-aippt</h1>
66
+ </div>
67
+ );
68
+
69
+ const pages: Page[] = [Cover];
70
+ export default pages;
71
+
72
+ export const meta = { title: 'Hello' };
73
+ ```
74
+
75
+ ## Exports
76
+
77
+ ```ts
78
+ import {
79
+ CANVAS_WIDTH, // 1920
80
+ CANVAS_HEIGHT, // 1080
81
+ unstable_SharedElement, // match or fade objects across pages for shared element transitions
82
+ type Page,
83
+ type SlideMeta,
84
+ type SlideModule,
85
+ type SlideTransition,
86
+ type OpenAipptConfig,
87
+ } from '@open-aippt/core';
88
+ ```
89
+
90
+ The Vite plugin is exposed under a subpath for advanced setups:
91
+
92
+ ```ts
93
+ import { createViteConfig } from '@open-aippt/core/vite';
94
+ ```
95
+
96
+ ## License
97
+
98
+ MIT
package/bin.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import './dist/cli/bin.js';
@@ -0,0 +1,17 @@
1
+ import "./design-cpzS8aud.js";
2
+ import { createViteConfig } from "./config-CjzqjrEA.js";
3
+ import path from "node:path";
4
+ import { build as build$1, mergeConfig } from "vite";
5
+
6
+ //#region src/cli/build.ts
7
+ async function build(opts = {}) {
8
+ const base = await createViteConfig({
9
+ userCwd: process.cwd(),
10
+ mode: "build"
11
+ });
12
+ const config = mergeConfig(base, { build: { ...opts.outDir !== void 0 ? { outDir: path.resolve(process.cwd(), opts.outDir) } : {} } });
13
+ await build$1(config);
14
+ }
15
+
16
+ //#endregion
17
+ export { build };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env node
2
+ import { detectSkillsDrift, syncSkills } from "../sync-BPZ0m27m.js";
3
+ import chalk from "chalk";
4
+ import { readFile } from "node:fs/promises";
5
+ import path from "node:path";
6
+ import * as readline from "node:readline/promises";
7
+ import { fileURLToPath } from "node:url";
8
+ import { Command, Option } from "commander";
9
+
10
+ //#region src/cli/run.ts
11
+ async function readVersion() {
12
+ const here = path.dirname(fileURLToPath(import.meta.url));
13
+ const pkgPath = path.resolve(here, "..", "..", "package.json");
14
+ const raw = await readFile(pkgPath, "utf8");
15
+ return JSON.parse(raw).version;
16
+ }
17
+ function parsePort(value) {
18
+ const n = Number(value);
19
+ if (!Number.isInteger(n) || n < 0 || n > 65535) throw new Error(`Invalid port: ${value}`);
20
+ return n;
21
+ }
22
+ async function runSkillsDriftCheck(skillsDir) {
23
+ if (process.env.OPEN_AIPPT_SKIP_SKILLS_CHECK === "1") return;
24
+ let drift;
25
+ try {
26
+ drift = await detectSkillsDrift(skillsDir);
27
+ } catch {
28
+ return;
29
+ }
30
+ const stale = drift.filter((d) => d.status !== "unchanged");
31
+ if (stale.length === 0) return;
32
+ const names = stale.map((d) => d.name).join(", ");
33
+ const interactive = Boolean(process.stdin.isTTY && process.stdout.isTTY);
34
+ if (!interactive) {
35
+ process.stderr.write(`${chalk.yellow("!")} Skills out of date (${names}). Run \`open-aippt sync:skills\` to update.\n`);
36
+ return;
37
+ }
38
+ const rl = readline.createInterface({
39
+ input: process.stdin,
40
+ output: process.stdout
41
+ });
42
+ try {
43
+ const answer = (await rl.question(`${chalk.yellow("!")} Skills out of date: ${chalk.bold(names)}. Sync now? ${chalk.dim("(Y/n) ")}`)).trim().toLowerCase();
44
+ if (answer === "" || answer === "y" || answer === "yes") await syncSkills(skillsDir);
45
+ else process.stdout.write(chalk.dim("Skipped. Run `open-aippt sync:skills` later to update.\n"));
46
+ } finally {
47
+ rl.close();
48
+ }
49
+ }
50
+ function resolveBuiltinSkillsDir() {
51
+ const here = path.dirname(fileURLToPath(import.meta.url));
52
+ return path.resolve(here, "..", "..", "skills");
53
+ }
54
+ async function run(argv) {
55
+ const version = await readVersion();
56
+ const program = new Command();
57
+ program.name("open-aippt").description("Author slides — we handle the Vite/React stack.").version(version, "-v, --version", "print version").helpOption("-h, --help", "show help").showHelpAfterError(chalk.dim("(run `open-aippt --help` for usage)"));
58
+ program.command("dev").description("Start the dev server").addOption(new Option("-p, --port <port>", "port to listen on").argParser(parsePort)).addOption(new Option("--host [host]", "expose on the network (optional host)")).option("--open", "open the browser on start").option("--no-skills-check", "skip the built-in skills drift check").action(async (flags) => {
59
+ if (flags.skillsCheck !== false) await runSkillsDriftCheck(resolveBuiltinSkillsDir());
60
+ const { dev } = await import("../dev-BYuTeJbA.js");
61
+ await dev(flags);
62
+ });
63
+ program.command("build").description("Build a static site").option("--out-dir <dir>", "output directory (defaults to `dist`)").action(async (flags) => {
64
+ const { build } = await import("../build-DxTqmvsO.js");
65
+ await build(flags);
66
+ });
67
+ program.command("preview").description("Preview the production build").addOption(new Option("-p, --port <port>", "port to listen on").argParser(parsePort)).addOption(new Option("--host [host]", "expose on the network (optional host)")).option("--open", "open the browser on start").action(async (flags) => {
68
+ const { preview } = await import("../preview-DlQvnJPq.js");
69
+ await preview(flags);
70
+ });
71
+ program.command("sync:skills").description("Sync built-in skills from @open-aippt/core into this workspace").option("--dry-run", "show what would change without writing").action(async (flags) => {
72
+ const { syncSkills: syncSkills$1 } = await import("../sync-EsYusbbL.js");
73
+ await syncSkills$1(resolveBuiltinSkillsDir(), flags);
74
+ });
75
+ await program.parseAsync(argv, { from: "user" });
76
+ }
77
+
78
+ //#endregion
79
+ //#region src/cli/bin.ts
80
+ run(process.argv.slice(2)).catch((err) => {
81
+ const message = err instanceof Error ? err.message : String(err);
82
+ process.stderr.write(`${chalk.red("error:")} ${message}\n`);
83
+ process.exit(1);
84
+ });
85
+
86
+ //#endregion