@open-slide/core 1.19.1 → 2.0.0-beta.0

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 (86) hide show
  1. package/dist/{build-CaV_vhIw.js → build-CfAxF6Dm.js} +2 -5
  2. package/dist/cli/bin.d.ts +1 -1
  3. package/dist/cli/bin.js +139 -13
  4. package/dist/{config-CDHB8Oow.d.ts → config-AtA2Bqtn.d.ts} +4 -4
  5. package/dist/{config-GA6NMgs_.js → config-C_VI2EpT.js} +545 -776
  6. package/dist/{design-cpzS8aud.js → design-Cpqx7SJs.js} +1 -2
  7. package/dist/{dev-D57ui2yV.js → dev-BChELmc-.js} +4 -7
  8. package/dist/index.d.ts +7 -37
  9. package/dist/index.js +51 -54
  10. package/dist/locale/index.d.ts +2 -8
  11. package/dist/locale/index.js +13 -3
  12. package/dist/{preview-D40Zw_o0.js → preview-CcCQa268.js} +3 -7
  13. package/dist/{types-8HghULIe.d.ts → types-BzPSOxe-.d.ts} +5 -9
  14. package/dist/vite/index.d.ts +1 -4
  15. package/dist/vite/index.js +2 -4
  16. package/dist/{format-74A3B6zu.js → zh-tw-BxZ_pYqe.js} +13 -49
  17. package/package.json +12 -12
  18. package/skills/create-slide/SKILL.md +4 -1
  19. package/skills/slide-authoring/SKILL.md +25 -2
  20. package/src/app/app.tsx +1 -3
  21. package/src/app/assets/open-slide.png +0 -0
  22. package/src/app/components/asset-view.tsx +8 -16
  23. package/src/app/components/command/home-command-menu.tsx +6 -6
  24. package/src/app/components/export-progress-toast.tsx +80 -0
  25. package/src/app/components/history-provider.tsx +1 -5
  26. package/src/app/components/image-placeholder.tsx +4 -12
  27. package/src/app/components/inspector/asset-picker-dialog.tsx +6 -16
  28. package/src/app/components/inspector/image-crop-dialog.tsx +1 -4
  29. package/src/app/components/inspector/inline-text-editor.tsx +798 -0
  30. package/src/app/components/inspector/inspect-overlay.tsx +30 -72
  31. package/src/app/components/inspector/inspector-panel.tsx +17 -49
  32. package/src/app/components/inspector/inspector-provider.tsx +53 -36
  33. package/src/app/components/notes-drawer.tsx +2 -5
  34. package/src/app/components/overview-grid.tsx +5 -4
  35. package/src/app/components/panel/panel-shell.tsx +1 -3
  36. package/src/app/components/player.tsx +5 -6
  37. package/src/app/components/present/control-bar.tsx +4 -4
  38. package/src/app/components/present/jump-input.tsx +3 -2
  39. package/src/app/components/present/use-presenter-channel.ts +0 -1
  40. package/src/app/components/sidebar/folder-item.tsx +39 -16
  41. package/src/app/components/sidebar/sidebar-footer.tsx +7 -1
  42. package/src/app/components/sidebar/sidebar.tsx +91 -64
  43. package/src/app/components/slide-canvas.tsx +2 -6
  44. package/src/app/components/slide-transition-layer.tsx +48 -76
  45. package/src/app/components/style-panel/design-provider.tsx +1 -14
  46. package/src/app/components/style-panel/use-design.ts +1 -28
  47. package/src/app/components/themes/theme-detail.tsx +4 -4
  48. package/src/app/components/themes/themes-gallery.tsx +11 -6
  49. package/src/app/components/thumbnail-rail.tsx +7 -12
  50. package/src/app/lib/assets.ts +6 -7
  51. package/src/app/lib/dom.ts +42 -0
  52. package/src/app/lib/export-html.ts +10 -25
  53. package/src/app/lib/export-pdf.ts +11 -28
  54. package/src/app/lib/export-pptx.ts +6 -36
  55. package/src/app/lib/folders.ts +51 -46
  56. package/src/app/lib/inspector/inline-text.ts +31 -0
  57. package/src/app/lib/inspector/pick-target.ts +38 -0
  58. package/src/app/lib/inspector/use-comments.ts +1 -1
  59. package/src/app/lib/keys.ts +18 -0
  60. package/src/app/lib/last-home-location.ts +18 -0
  61. package/src/app/lib/print-ready.ts +2 -4
  62. package/src/app/lib/slides.ts +7 -4
  63. package/src/app/lib/text-diff.ts +19 -0
  64. package/src/app/lib/use-click-page-navigation.ts +2 -6
  65. package/src/app/lib/use-is-mobile.ts +2 -14
  66. package/src/app/lib/use-media-query.ts +20 -0
  67. package/src/app/lib/use-prefers-reduced-motion.ts +5 -13
  68. package/src/app/lib/use-slide-module.ts +1 -1
  69. package/src/app/lib/use-wheel-page-navigation.ts +1 -1
  70. package/src/app/lib/utils.test.ts +25 -1
  71. package/src/app/lib/utils.ts +8 -0
  72. package/src/app/routes/home-shell.tsx +71 -64
  73. package/src/app/routes/home.tsx +41 -52
  74. package/src/app/routes/presenter.tsx +10 -20
  75. package/src/app/routes/slide.tsx +84 -71
  76. package/src/app/routes/themes.tsx +7 -8
  77. package/src/app/styles.css +33 -44
  78. package/src/locale/en.ts +2 -7
  79. package/src/locale/ja.ts +2 -7
  80. package/src/locale/types.ts +2 -7
  81. package/src/locale/zh-cn.ts +2 -7
  82. package/src/locale/zh-tw.ts +2 -7
  83. package/dist/sync-BCJDRIqo.js +0 -139
  84. package/dist/sync-j9_QPovT.js +0 -3
  85. package/src/app/components/pdf-progress-toast.tsx +0 -36
  86. package/src/app/components/pptx-progress-toast.tsx +0 -36
@@ -30,6 +30,5 @@ const defaultDesign = {
30
30
  },
31
31
  radius: 12
32
32
  };
33
-
34
33
  //#endregion
35
- export { cssVarsToString, defaultDesign, designToCssVars };
34
+ export { defaultDesign as n, designToCssVars as r, cssVarsToString as t };
@@ -1,14 +1,12 @@
1
- import "./design-cpzS8aud.js";
2
- import { DEV_SUPERVISED_ENV, RESTART_EXIT_CODE, createViteConfig } from "./config-GA6NMgs_.js";
1
+ import { n as DEV_SUPERVISED_ENV, t as createViteConfig } from "./config-C_VI2EpT.js";
3
2
  import chalk from "chalk";
4
3
  import path from "node:path";
5
4
  import { existsSync } from "node:fs";
6
5
  import { fork } from "node:child_process";
7
6
  import { createServer, mergeConfig } from "vite";
8
-
9
7
  //#region src/cli/dev.ts
10
8
  async function dev(opts = {}) {
11
- if (process.env[DEV_SUPERVISED_ENV] === "1") {
9
+ if (process.env["OPEN_SLIDE_DEV_SUPERVISED"] === "1") {
12
10
  await startServer(opts);
13
11
  return;
14
12
  }
@@ -61,7 +59,7 @@ function supervise(opts) {
61
59
  });
62
60
  child.on("exit", (code, signal) => {
63
61
  if (shuttingDown) process.exit(0);
64
- if (code === RESTART_EXIT_CODE) {
62
+ if (code === 52) {
65
63
  openBrowser = false;
66
64
  spawnChild();
67
65
  return;
@@ -89,6 +87,5 @@ function resolveDevEntry(userCwd) {
89
87
  if (existsSync(installed)) return installed;
90
88
  return process.argv[1];
91
89
  }
92
-
93
90
  //#endregion
94
- export { dev };
91
+ export { dev };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,6 @@
1
- import { Locale, Plural } from "./types-8HghULIe.js";
2
- import { OpenSlideConfig } from "./config-CDHB8Oow.js";
1
+ import { n as Plural, t as Locale } from "./types-BzPSOxe-.js";
2
+ import { t as OpenSlideConfig } from "./config-AtA2Bqtn.js";
3
3
  import { CSSProperties, ComponentType, HTMLAttributes, PropsWithChildren, ReactNode } from "react";
4
- import * as react_jsx_runtime0 from "react/jsx-runtime";
5
- import * as react_jsx_runtime1 from "react/jsx-runtime";
6
- import * as react_jsx_runtime4 from "react/jsx-runtime";
7
- import * as react_jsx_runtime5 from "react/jsx-runtime";
8
-
9
4
  //#region src/app/components/image-placeholder.d.ts
10
5
  type ImagePlaceholderProps = {
11
6
  hint: string;
@@ -14,15 +9,7 @@ type ImagePlaceholderProps = {
14
9
  style?: CSSProperties;
15
10
  className?: string;
16
11
  } & Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'style' | 'className'>;
17
- declare function ImagePlaceholder({
18
- hint,
19
- width,
20
- height,
21
- style,
22
- className,
23
- ...rest
24
- }: ImagePlaceholderProps): react_jsx_runtime0.JSX.Element;
25
-
12
+ declare function ImagePlaceholder({ hint, width, height, style, className, ...rest }: ImagePlaceholderProps): import("react").JSX.Element;
26
13
  //#endregion
27
14
  //#region src/app/components/morph-element.d.ts
28
15
  type MorphElementProps = {
@@ -31,13 +18,7 @@ type MorphElementProps = {
31
18
  className?: string;
32
19
  style?: CSSProperties;
33
20
  };
34
- declare function MorphElement({
35
- id,
36
- children,
37
- className,
38
- style
39
- }: MorphElementProps): react_jsx_runtime1.JSX.Element;
40
-
21
+ declare function MorphElement({ id, children, className, style }: MorphElementProps): import("react").JSX.Element;
41
22
  //#endregion
42
23
  //#region src/app/lib/design.d.ts
43
24
  type DesignPalette = {
@@ -62,14 +43,12 @@ type DesignSystem = {
62
43
  declare function designToCssVars(d: DesignSystem): Record<string, string>;
63
44
  declare function cssVarsToString(vars: Record<string, string>): string;
64
45
  declare const defaultDesign: DesignSystem;
65
-
66
46
  //#endregion
67
47
  //#region src/app/lib/page-context.d.ts
68
48
  declare function useSlidePageNumber(): {
69
49
  current: number;
70
50
  total: number;
71
51
  };
72
-
73
52
  //#endregion
74
53
  //#region src/app/lib/transition.d.ts
75
54
  type TransitionPhase = {
@@ -90,7 +69,6 @@ type MorphTransition = {
90
69
  easing?: string;
91
70
  delay?: number;
92
71
  };
93
-
94
72
  //#endregion
95
73
  //#region src/app/lib/sdk.d.ts
96
74
  type Page = ComponentType & {
@@ -111,25 +89,17 @@ type SlideModule = {
111
89
  };
112
90
  declare const CANVAS_WIDTH = 1920;
113
91
  declare const CANVAS_HEIGHT = 1080;
114
-
115
92
  //#endregion
116
93
  //#region src/app/lib/step-context.d.ts
117
94
  declare function useIsActivePage(): boolean;
118
95
  type StepsProps = PropsWithChildren;
119
- declare function Steps({
120
- children
121
- }: StepsProps): react_jsx_runtime4.JSX.Element;
96
+ declare function Steps({ children }: StepsProps): import("react").JSX.Element;
122
97
  type StepProps = PropsWithChildren<{
123
98
  duration?: number;
124
99
  }>;
125
100
  type InternalStepProps = StepProps & {
126
101
  _revealed?: boolean;
127
102
  };
128
- declare function Step({
129
- children,
130
- duration,
131
- _revealed
132
- }: InternalStepProps): react_jsx_runtime5.JSX.Element;
133
-
103
+ declare function Step({ children, duration, _revealed }: InternalStepProps): import("react").JSX.Element;
134
104
  //#endregion
135
- export { CANVAS_HEIGHT, CANVAS_WIDTH, DesignFonts, DesignPalette, DesignSystem, DesignTypeScale, ImagePlaceholder, ImagePlaceholderProps, Locale, MorphElement, MorphElementProps, MorphTransition, OpenSlideConfig, Page, Plural, SlideMeta, SlideModule, SlideTransition, Step, StepProps, Steps, StepsProps, TransitionPhase, cssVarsToString, defaultDesign, designToCssVars, useIsActivePage, useSlidePageNumber };
105
+ export { CANVAS_HEIGHT, CANVAS_WIDTH, type DesignFonts, type DesignPalette, type DesignSystem, type DesignTypeScale, ImagePlaceholder, type ImagePlaceholderProps, type Locale, MorphElement, type MorphElementProps, type MorphTransition, type OpenSlideConfig, type Page, type Plural, type SlideMeta, type SlideModule, type SlideTransition, Step, type StepProps, Steps, type StepsProps, type TransitionPhase, cssVarsToString, defaultDesign, designToCssVars, useIsActivePage, useSlidePageNumber };
package/dist/index.js CHANGED
@@ -1,16 +1,15 @@
1
- import { en, ja, zhCN, zhTW } from "./format-74A3B6zu.js";
2
- import { cssVarsToString, defaultDesign, designToCssVars } from "./design-cpzS8aud.js";
1
+ import { i as en, n as zhCN, r as ja, t as zhTW } from "./zh-tw-BxZ_pYqe.js";
2
+ import { n as defaultDesign, r as designToCssVars, t as cssVarsToString } from "./design-Cpqx7SJs.js";
3
3
  import { Children, cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
4
4
  import { toast } from "sonner";
5
+ import "virtual:open-slide/slides";
5
6
  import config from "virtual:open-slide/config";
6
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
-
8
8
  //#region src/app/lib/assets.ts
9
9
  async function listAssets(slideId) {
10
10
  const res = await fetch(`/__assets/${slideId}`);
11
11
  if (!res.ok) throw new Error(`GET /__assets/${slideId} ${res.status}`);
12
- const data = await res.json();
13
- return data.assets ?? [];
12
+ return (await res.json()).assets ?? [];
14
13
  }
15
14
  async function uploadAsset(slideId, file, opts = {}) {
16
15
  const qs = opts.overwrite ? "?overwrite=1" : "";
@@ -80,7 +79,6 @@ function renamedCopy(file, taken) {
80
79
  lastModified: file.lastModified
81
80
  });
82
81
  }
83
-
84
82
  //#endregion
85
83
  //#region src/app/lib/locale-store.ts
86
84
  const LOCALES = {
@@ -102,7 +100,7 @@ function readStored() {
102
100
  return configLocale ?? en;
103
101
  }
104
102
  let current = readStored();
105
- const listeners = new Set();
103
+ const listeners = /* @__PURE__ */ new Set();
106
104
  function subscribe(listener) {
107
105
  listeners.add(listener);
108
106
  return () => {
@@ -115,16 +113,22 @@ function getSnapshot() {
115
113
  function useLocaleValue() {
116
114
  return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
117
115
  }
118
-
119
116
  //#endregion
120
117
  //#region src/app/lib/use-locale.ts
121
118
  function useLocale() {
122
119
  return useLocaleValue();
123
120
  }
124
-
121
+ //#endregion
122
+ //#region src/app/lib/dom.ts
123
+ function dragHasFiles(e) {
124
+ const types = e.dataTransfer?.types;
125
+ if (!types) return false;
126
+ for (let i = 0; i < types.length; i++) if (types[i] === "Files") return true;
127
+ return false;
128
+ }
125
129
  //#endregion
126
130
  //#region src/app/components/image-placeholder.tsx
127
- function ImagePlaceholder({ hint, width, height, style, className,...rest }) {
131
+ function ImagePlaceholder({ hint, width, height, style, className, ...rest }) {
128
132
  const dims = width && height ? `${width} × ${height}` : null;
129
133
  const [dragActive, setDragActive] = useState(false);
130
134
  const [uploading, setUploading] = useState(false);
@@ -132,13 +136,13 @@ function ImagePlaceholder({ hint, width, height, style, className,...rest }) {
132
136
  const t = useLocale();
133
137
  const dndProps = import.meta.env.DEV ? {
134
138
  onDragEnter: (e) => {
135
- if (uploading || !hasImageFile(e)) return;
139
+ if (uploading || !dragHasFiles(e)) return;
136
140
  e.preventDefault();
137
141
  dragDepth.current += 1;
138
142
  setDragActive(true);
139
143
  },
140
144
  onDragOver: (e) => {
141
- if (uploading || !hasImageFile(e)) return;
145
+ if (uploading || !dragHasFiles(e)) return;
142
146
  e.preventDefault();
143
147
  e.dataTransfer.dropEffect = "copy";
144
148
  },
@@ -147,7 +151,7 @@ function ImagePlaceholder({ hint, width, height, style, className,...rest }) {
147
151
  if (dragDepth.current === 0) setDragActive(false);
148
152
  },
149
153
  onDrop: (e) => {
150
- if (uploading || !hasImageFile(e)) return;
154
+ if (uploading || !dragHasFiles(e)) return;
151
155
  e.preventDefault();
152
156
  dragDepth.current = 0;
153
157
  setDragActive(false);
@@ -270,12 +274,6 @@ function DropOverlay({ label }) {
270
274
  })
271
275
  });
272
276
  }
273
- function hasImageFile(e) {
274
- const types = e.dataTransfer?.types;
275
- if (!types) return false;
276
- for (let i = 0; i < types.length; i++) if (types[i] === "Files") return true;
277
- return false;
278
- }
279
277
  function pickImageFile(files) {
280
278
  for (let i = 0; i < files.length; i++) {
281
279
  const f = files[i];
@@ -332,7 +330,6 @@ function PlaceholderIcon() {
332
330
  ]
333
331
  });
334
332
  }
335
-
336
333
  //#endregion
337
334
  //#region src/app/components/morph-element.tsx
338
335
  function MorphElement({ id, children, className, style }) {
@@ -352,7 +349,6 @@ function MorphElement({ id, children, className, style }) {
352
349
  children
353
350
  });
354
351
  }
355
-
356
352
  //#endregion
357
353
  //#region src/app/lib/page-context.tsx
358
354
  const GLOBAL_KEY$1 = "__open_slide_page_context__";
@@ -367,29 +363,33 @@ function useSlidePageNumber() {
367
363
  total: ctx.total
368
364
  };
369
365
  }
370
-
371
366
  //#endregion
372
367
  //#region src/app/lib/sdk.ts
373
368
  const CANVAS_WIDTH = 1920;
374
369
  const CANVAS_HEIGHT = 1080;
375
-
376
370
  //#endregion
377
- //#region src/app/lib/use-prefers-reduced-motion.ts
378
- const QUERY = "(prefers-reduced-motion: reduce)";
379
- function usePrefersReducedMotion() {
380
- const [reduce, setReduce] = useState(() => {
381
- if (typeof window === "undefined") return false;
382
- return window.matchMedia(QUERY).matches;
383
- });
371
+ //#region src/app/lib/use-media-query.ts
372
+ function matchesMediaQuery(query) {
373
+ if (typeof window === "undefined") return false;
374
+ return window.matchMedia(query).matches;
375
+ }
376
+ function useMediaQuery(query) {
377
+ const [matches, setMatches] = useState(() => matchesMediaQuery(query));
384
378
  useEffect(() => {
385
- const mql = window.matchMedia(QUERY);
386
- const onChange = (e) => setReduce(e.matches);
379
+ const mql = window.matchMedia(query);
380
+ setMatches(mql.matches);
381
+ const onChange = (e) => setMatches(e.matches);
387
382
  mql.addEventListener("change", onChange);
388
383
  return () => mql.removeEventListener("change", onChange);
389
- }, []);
390
- return reduce;
384
+ }, [query]);
385
+ return matches;
386
+ }
387
+ //#endregion
388
+ //#region src/app/lib/use-prefers-reduced-motion.ts
389
+ const QUERY = "(prefers-reduced-motion: reduce)";
390
+ function usePrefersReducedMotion() {
391
+ return useMediaQuery(QUERY);
391
392
  }
392
-
393
393
  //#endregion
394
394
  //#region src/app/lib/step-context.tsx
395
395
  const GLOBAL_KEY = "__open_slide_step_host_context__";
@@ -414,25 +414,24 @@ function Steps({ children }) {
414
414
  useLayoutEffect(() => {
415
415
  if (!host) return;
416
416
  const id = idRef.current;
417
- const ctrl = {
418
- advance: () => {
419
- if (revealedRef.current >= stepCount) return false;
420
- applyRevealed(revealedRef.current + 1);
421
- host.reportRevealed(id, revealedRef.current);
422
- return true;
423
- },
424
- retreat: () => {
425
- if (revealedRef.current <= 0) return false;
426
- applyRevealed(revealedRef.current - 1);
427
- host.reportRevealed(id, revealedRef.current);
428
- return true;
429
- }
430
- };
431
417
  return host.register({
432
418
  id,
433
419
  stepCount,
434
420
  initialRevealed: revealedRef.current,
435
- controller: ctrl,
421
+ controller: {
422
+ advance: () => {
423
+ if (revealedRef.current >= stepCount) return false;
424
+ applyRevealed(revealedRef.current + 1);
425
+ host.reportRevealed(id, revealedRef.current);
426
+ return true;
427
+ },
428
+ retreat: () => {
429
+ if (revealedRef.current <= 0) return false;
430
+ applyRevealed(revealedRef.current - 1);
431
+ host.reportRevealed(id, revealedRef.current);
432
+ return true;
433
+ }
434
+ },
436
435
  setRevealed: applyRevealed
437
436
  });
438
437
  }, [
@@ -456,17 +455,15 @@ function Steps({ children }) {
456
455
  function Step({ children, duration = 180, _revealed }) {
457
456
  const reduceMotion = usePrefersReducedMotion();
458
457
  const revealed = _revealed ?? true;
459
- const ms = reduceMotion ? 0 : duration;
460
458
  return /* @__PURE__ */ jsx("div", {
461
459
  "data-osd-step": revealed ? "revealed" : "pending",
462
460
  style: {
463
461
  opacity: revealed ? 1 : 0,
464
462
  visibility: revealed ? "visible" : "hidden",
465
- transition: `opacity ${ms}ms cubic-bezier(0, 0, 0.2, 1)`
463
+ transition: `opacity ${reduceMotion ? 0 : duration}ms cubic-bezier(0, 0, 0.2, 1)`
466
464
  },
467
465
  children
468
466
  });
469
467
  }
470
-
471
468
  //#endregion
472
- export { CANVAS_HEIGHT, CANVAS_WIDTH, ImagePlaceholder, MorphElement, Step, Steps, cssVarsToString, defaultDesign, designToCssVars, useIsActivePage, useSlidePageNumber };
469
+ export { CANVAS_HEIGHT, CANVAS_WIDTH, ImagePlaceholder, MorphElement, Step, Steps, cssVarsToString, defaultDesign, designToCssVars, useIsActivePage, useSlidePageNumber };
@@ -1,24 +1,18 @@
1
- import { Locale, Plural } from "../types-8HghULIe.js";
2
-
1
+ import { n as Plural, t as Locale } from "../types-BzPSOxe-.js";
3
2
  //#region src/locale/en.d.ts
4
3
  declare const en: Locale;
5
-
6
4
  //#endregion
7
5
  //#region src/locale/format.d.ts
8
6
  declare function format(template: string, vars: Record<string, string | number>): string;
9
7
  declare function plural(count: number, forms: Plural): string;
10
-
11
8
  //#endregion
12
9
  //#region src/locale/ja.d.ts
13
10
  declare const ja: Locale;
14
-
15
11
  //#endregion
16
12
  //#region src/locale/zh-cn.d.ts
17
13
  declare const zhCN: Locale;
18
-
19
14
  //#endregion
20
15
  //#region src/locale/zh-tw.d.ts
21
16
  declare const zhTW: Locale;
22
-
23
17
  //#endregion
24
- export { Locale, Plural, en, format, ja, plural, zhCN, zhTW };
18
+ export { type Locale, type Plural, en, format, ja, plural, zhCN, zhTW };
@@ -1,3 +1,13 @@
1
- import { en, format, ja, plural, zhCN, zhTW } from "../format-74A3B6zu.js";
2
-
3
- export { en, format, ja, plural, zhCN, zhTW };
1
+ import { i as en, n as zhCN, r as ja, t as zhTW } from "../zh-tw-BxZ_pYqe.js";
2
+ //#region src/locale/format.ts
3
+ function format(template, vars) {
4
+ return template.replace(/\{(\w+)\}/g, (m, key) => {
5
+ const v = vars[key];
6
+ return v === void 0 ? m : String(v);
7
+ });
8
+ }
9
+ function plural(count, forms) {
10
+ return count === 1 ? forms.one : forms.other;
11
+ }
12
+ //#endregion
13
+ export { en, format, ja, plural, zhCN, zhTW };
@@ -1,7 +1,5 @@
1
- import "./design-cpzS8aud.js";
2
- import { createViteConfig } from "./config-GA6NMgs_.js";
1
+ import { t as createViteConfig } from "./config-C_VI2EpT.js";
3
2
  import { mergeConfig, preview as preview$1 } from "vite";
4
-
5
3
  //#region src/cli/preview.ts
6
4
  async function preview(opts = {}) {
7
5
  const base = await createViteConfig({ userCwd: process.cwd() });
@@ -10,9 +8,7 @@ async function preview(opts = {}) {
10
8
  ...opts.host !== void 0 ? { host: opts.host } : {},
11
9
  ...opts.open !== void 0 ? { open: opts.open } : {}
12
10
  } });
13
- const server = await preview$1(config);
14
- server.printUrls();
11
+ (await preview$1(config)).printUrls();
15
12
  }
16
-
17
13
  //#endregion
18
- export { preview };
14
+ export { preview };
@@ -19,16 +19,11 @@ type Locale = {
19
19
  loadFailed: string;
20
20
  failedToLoadSlide: string;
21
21
  home: string;
22
- backToHome: string;
23
- preview: string;
24
22
  add: string;
25
23
  done: string;
26
24
  tryAgain: string;
27
25
  undo: string;
28
26
  redo: string;
29
- light: string;
30
- dark: string;
31
- system: string;
32
27
  selected: string;
33
28
  };
34
29
  notFound: {
@@ -136,7 +131,6 @@ type Locale = {
136
131
  loadingAssetsEyebrow: string;
137
132
  emptyEyebrow: string;
138
133
  nothingToShow: string;
139
- emptyHintPrefix: string;
140
134
  emptyHintMust: string;
141
135
  emptyHintSuffix: string;
142
136
  };
@@ -245,7 +239,6 @@ type Locale = {
245
239
  cropFitCover: string;
246
240
  cropFitContain: string;
247
241
  cropApply: string;
248
- cropResetAria: string;
249
242
  leaveComment: string;
250
243
  commentPlaceholder: string;
251
244
  commentShortcutHint: string;
@@ -262,6 +255,8 @@ type Locale = {
262
255
  commentDeleteAria: string;
263
256
  /** Prefix for the toast shown when one or more buffered edits fail to write to disk. */
264
257
  saveFailed: string;
258
+ decreaseFontSize: string;
259
+ increaseFontSize: string;
265
260
  };
266
261
  stylePanel: {
267
262
  designTokens: string;
@@ -501,5 +496,6 @@ type Locale = {
501
496
  expandPromptAria: string;
502
497
  collapsePromptAria: string;
503
498
  };
504
- }; //#endregion
505
- export { Locale, Plural };
499
+ };
500
+ //#endregion
501
+ export { Plural as n, Locale as t };
@@ -1,7 +1,5 @@
1
- import "../types-8HghULIe.js";
2
- import { OpenSlideConfig } from "../config-CDHB8Oow.js";
1
+ import { t as OpenSlideConfig } from "../config-AtA2Bqtn.js";
3
2
  import { InlineConfig } from "vite";
4
-
5
3
  //#region src/vite/config.d.ts
6
4
  type CreateViteConfigOptions = {
7
5
  userCwd: string;
@@ -9,6 +7,5 @@ type CreateViteConfigOptions = {
9
7
  mode?: 'serve' | 'build';
10
8
  };
11
9
  declare function createViteConfig(opts: CreateViteConfigOptions): Promise<InlineConfig>;
12
-
13
10
  //#endregion
14
11
  export { createViteConfig };
@@ -1,4 +1,2 @@
1
- import "../design-cpzS8aud.js";
2
- import { createViteConfig } from "../config-GA6NMgs_.js";
3
-
4
- export { createViteConfig };
1
+ import { t as createViteConfig } from "../config-C_VI2EpT.js";
2
+ export { createViteConfig };