@open-slide/core 1.8.0 → 1.9.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.
- package/dist/{build-CCZDC8eF.js → build-ZM7IfDO-.js} +1 -1
- package/dist/cli/bin.js +3 -3
- package/dist/{config-C7sZtiY2.js → config-BAZeaz2P.js} +248 -232
- package/dist/{config-D1bANimZ.d.ts → config-D_5nlXFU.d.ts} +6 -1
- package/dist/{dev-kLS_4CAI.js → dev-BQkNTG_t.js} +1 -1
- package/dist/format-CYOb2cAQ.js +1573 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +38 -4
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +1 -1135
- package/dist/{preview-DUkOjOx8.js → preview-D8hUtbRA.js} +1 -1
- package/dist/{types-Bvk1pM70.d.ts → types-AalTbxMj.d.ts} +17 -0
- package/dist/vite/index.d.ts +2 -2
- package/dist/vite/index.js +1 -1
- package/package.json +2 -1
- package/src/app/components/language-toggle.tsx +39 -0
- package/src/app/components/pptx-progress-toast.tsx +32 -0
- package/src/app/components/sidebar/sidebar-footer.tsx +51 -0
- package/src/app/components/sidebar/sidebar.tsx +8 -1
- package/src/app/lib/design-presets.ts +1 -1
- package/src/app/lib/export-pptx.ts +284 -0
- package/src/app/lib/locale-store.ts +67 -0
- package/src/app/lib/use-locale.ts +4 -16
- package/src/app/routes/slide.tsx +68 -0
- package/src/app/virtual.d.ts +1 -0
- package/src/locale/en.ts +19 -0
- package/src/locale/ja.ts +20 -0
- package/src/locale/types.ts +19 -0
- package/src/locale/zh-cn.ts +18 -0
- package/src/locale/zh-tw.ts +18 -0
- package/dist/en-hyGpmL1O.js +0 -375
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Locale, Plural } from "./types-
|
|
2
|
-
import { OpenSlideConfig } from "./config-
|
|
1
|
+
import { Locale, Plural } from "./types-AalTbxMj.js";
|
|
2
|
+
import { OpenSlideConfig } from "./config-D_5nlXFU.js";
|
|
3
3
|
import { CSSProperties, ComponentType, HTMLAttributes } from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/app/components/image-placeholder.d.ts
|
|
7
7
|
type ImagePlaceholderProps = {
|
|
@@ -18,7 +18,7 @@ declare function ImagePlaceholder({
|
|
|
18
18
|
style,
|
|
19
19
|
className,
|
|
20
20
|
...rest
|
|
21
|
-
}: ImagePlaceholderProps):
|
|
21
|
+
}: ImagePlaceholderProps): react_jsx_runtime1.JSX.Element;
|
|
22
22
|
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/app/lib/design.d.ts
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { en } from "./
|
|
1
|
+
import { en, ja, zhCN, zhTW } from "./format-CYOb2cAQ.js";
|
|
2
2
|
import { cssVarsToString, defaultDesign, designToCssVars } from "./design-cpzS8aud.js";
|
|
3
|
-
import { createContext, useContext, useRef, useState } from "react";
|
|
3
|
+
import { createContext, useContext, useRef, useState, useSyncExternalStore } from "react";
|
|
4
4
|
import { toast } from "sonner";
|
|
5
5
|
import config from "virtual:open-slide/config";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -79,11 +79,45 @@ function renamedCopy(file, taken) {
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/app/lib/locale-store.ts
|
|
84
|
+
const LOCALES = {
|
|
85
|
+
en,
|
|
86
|
+
"zh-TW": zhTW,
|
|
87
|
+
"zh-CN": zhCN,
|
|
88
|
+
ja
|
|
89
|
+
};
|
|
90
|
+
const STORAGE_KEY = "open-slide:locale";
|
|
91
|
+
const configLocale = config.locale;
|
|
92
|
+
function isLocaleId(value) {
|
|
93
|
+
return value === "en" || value === "zh-TW" || value === "zh-CN" || value === "ja";
|
|
94
|
+
}
|
|
95
|
+
function readStored() {
|
|
96
|
+
try {
|
|
97
|
+
const stored = localStorage.getItem(STORAGE_KEY);
|
|
98
|
+
if (isLocaleId(stored)) return LOCALES[stored];
|
|
99
|
+
} catch {}
|
|
100
|
+
return configLocale ?? en;
|
|
101
|
+
}
|
|
102
|
+
let current = readStored();
|
|
103
|
+
const listeners = new Set();
|
|
104
|
+
function subscribe(listener) {
|
|
105
|
+
listeners.add(listener);
|
|
106
|
+
return () => {
|
|
107
|
+
listeners.delete(listener);
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function getSnapshot() {
|
|
111
|
+
return current;
|
|
112
|
+
}
|
|
113
|
+
function useLocaleValue() {
|
|
114
|
+
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
115
|
+
}
|
|
116
|
+
|
|
82
117
|
//#endregion
|
|
83
118
|
//#region src/app/lib/use-locale.ts
|
|
84
|
-
const resolved = config.locale ?? en;
|
|
85
119
|
function useLocale() {
|
|
86
|
-
return
|
|
120
|
+
return useLocaleValue();
|
|
87
121
|
}
|
|
88
122
|
|
|
89
123
|
//#endregion
|
package/dist/locale/index.d.ts
CHANGED