@lemonppt/renderer 0.2.0 → 0.2.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.
- package/dist/client/client-render.js +65 -5401
- package/dist/client/editor-script.js +3355 -0
- package/dist/client/theme-echarts.js +65 -25
- package/dist/client-render.d.ts +1 -7
- package/dist/client-render.d.ts.map +1 -1
- package/dist/client-render.js +1 -11
- package/dist/client-render.js.map +1 -1
- package/dist/editor-script.d.ts +1 -1
- package/dist/editor-script.d.ts.map +1 -1
- package/dist/editor-script.js +80 -77
- package/dist/editor-script.js.map +1 -1
- package/dist/export-pdf.js +1 -1
- package/dist/export-pdf.js.map +1 -1
- package/dist/export-pptx.d.ts +1132 -2
- package/dist/export-pptx.d.ts.map +1 -1
- package/dist/export-pptx.js +1208 -19525
- package/dist/export-pptx.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/render-editor-data.d.ts +21 -0
- package/dist/render-editor-data.d.ts.map +1 -0
- package/dist/render-editor-data.js +1068 -0
- package/dist/render-editor-data.js.map +1 -0
- package/dist/render.d.ts +0 -2
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +7 -323
- package/dist/render.js.map +1 -1
- package/dist/theme01-pptx.d.ts +12 -0
- package/dist/theme01-pptx.d.ts.map +1 -0
- package/dist/theme01-pptx.js +2954 -0
- package/dist/theme01-pptx.js.map +1 -0
- package/dist/theme02-pptx.d.ts +5 -0
- package/dist/theme02-pptx.d.ts.map +1 -0
- package/dist/theme02-pptx.js +1063 -0
- package/dist/theme02-pptx.js.map +1 -0
- package/dist/theme03-pptx.d.ts +5 -0
- package/dist/theme03-pptx.d.ts.map +1 -0
- package/dist/theme03-pptx.js +3279 -0
- package/dist/theme03-pptx.js.map +1 -0
- package/dist/theme04-pptx.d.ts +6 -0
- package/dist/theme04-pptx.d.ts.map +1 -0
- package/dist/theme04-pptx.js +5496 -0
- package/dist/theme04-pptx.js.map +1 -0
- package/dist/theme05-pptx.d.ts +5 -0
- package/dist/theme05-pptx.d.ts.map +1 -0
- package/dist/theme05-pptx.js +3152 -0
- package/dist/theme05-pptx.js.map +1 -0
- package/dist/theme06-pptx.d.ts +124 -0
- package/dist/theme06-pptx.d.ts.map +1 -0
- package/dist/theme06-pptx.js +8154 -0
- package/dist/theme06-pptx.js.map +1 -0
- package/dist/theme07-pptx.d.ts +49 -0
- package/dist/theme07-pptx.d.ts.map +1 -0
- package/dist/theme07-pptx.js +2579 -0
- package/dist/theme07-pptx.js.map +1 -0
- package/dist/theme08-pptx.d.ts +19 -0
- package/dist/theme08-pptx.d.ts.map +1 -0
- package/dist/theme08-pptx.js +1411 -0
- package/dist/theme08-pptx.js.map +1 -0
- package/dist/theme09-pptx.d.ts +18 -0
- package/dist/theme09-pptx.d.ts.map +1 -0
- package/dist/theme09-pptx.js +1513 -0
- package/dist/theme09-pptx.js.map +1 -0
- package/dist/theme10-pptx.d.ts +18 -0
- package/dist/theme10-pptx.d.ts.map +1 -0
- package/dist/theme10-pptx.js +2889 -0
- package/dist/theme10-pptx.js.map +1 -0
- package/package.json +7 -6
- package/templates/editor.html +580 -0
- package/templates/editor.js +222 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-script.d.ts","sourceRoot":"","sources":["../src/editor-script.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"editor-script.d.ts","sourceRoot":"","sources":["../src/editor-script.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,isuJA2xGxB,CAAC"}
|
package/dist/editor-script.js
CHANGED
|
@@ -3,25 +3,6 @@
|
|
|
3
3
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
4
|
export const editorScript = `
|
|
5
5
|
(function () {
|
|
6
|
-
// #region debug-point logging-helper
|
|
7
|
-
const __dbgUrl = 'http://127.0.0.1:7777/event';
|
|
8
|
-
const __dbgSession = 'add-slide-null-regression';
|
|
9
|
-
function __dbg(hypothesisId, location, msg, data) {
|
|
10
|
-
try {
|
|
11
|
-
fetch(__dbgUrl, {
|
|
12
|
-
method: 'POST',
|
|
13
|
-
body: JSON.stringify({ sessionId: __dbgSession, runId: 'pre-fix', hypothesisId, location, msg: '[DEBUG] ' + msg, data: data || {}, ts: Date.now() })
|
|
14
|
-
}).catch(function () {});
|
|
15
|
-
} catch (e) {}
|
|
16
|
-
}
|
|
17
|
-
window.addEventListener('error', (e) => {
|
|
18
|
-
__dbg('ERR', 'window.onerror', e.message, { filename: e.filename, lineno: e.lineno, colno: e.colno, stack: e.error && e.error.stack });
|
|
19
|
-
});
|
|
20
|
-
window.addEventListener('unhandledrejection', (e) => {
|
|
21
|
-
__dbg('ERR', 'window.unhandledrejection', String(e.reason), { stack: e.reason && e.reason.stack });
|
|
22
|
-
});
|
|
23
|
-
// #endregion
|
|
24
|
-
|
|
25
6
|
// 用 jQuery 为所有带 data-scrollbar 的容器添加自定义滚动条样式类
|
|
26
7
|
if (typeof jQuery !== 'undefined') {
|
|
27
8
|
jQuery(function ($) {
|
|
@@ -29,17 +10,20 @@ export const editorScript = `
|
|
|
29
10
|
});
|
|
30
11
|
}
|
|
31
12
|
|
|
32
|
-
const STORAGE_KEY = 'lemonppt:editor:v2:' + (window.__lemonPPT_goal?.randomSeed || window.__lemonPPT_goal?.title || 'default');
|
|
33
13
|
const MIGRATION_KEY = 'lemonppt:editor:migration:showInsight:v1';
|
|
34
14
|
const MAX_HISTORY = 50;
|
|
35
15
|
|
|
36
16
|
let goal = window.__lemonPPT_goal;
|
|
37
17
|
if (!goal) return;
|
|
38
18
|
|
|
19
|
+
function getStorageKey() {
|
|
20
|
+
return 'lemonppt:editor:v2:' + (goal.theme || 'theme01') + ':' + (goal.randomSeed || goal.title || 'default');
|
|
21
|
+
}
|
|
22
|
+
|
|
39
23
|
// 优先从 localStorage 恢复
|
|
40
24
|
let needsDomRebuild = false;
|
|
41
25
|
try {
|
|
42
|
-
const saved = localStorage.getItem(
|
|
26
|
+
const saved = localStorage.getItem(getStorageKey());
|
|
43
27
|
if (saved) {
|
|
44
28
|
const parsed = JSON.parse(saved);
|
|
45
29
|
if (parsed && parsed.slides) {
|
|
@@ -145,7 +129,7 @@ export const editorScript = `
|
|
|
145
129
|
autoSaveTimer = setTimeout(() => {
|
|
146
130
|
autoSaveTimer = null;
|
|
147
131
|
try {
|
|
148
|
-
localStorage.setItem(
|
|
132
|
+
localStorage.setItem(getStorageKey(), JSON.stringify(goal));
|
|
149
133
|
} catch (err) {
|
|
150
134
|
console.warn('自动保存失败', err);
|
|
151
135
|
}
|
|
@@ -467,11 +451,32 @@ export const editorScript = `
|
|
|
467
451
|
if (undoBtn) undoBtn.addEventListener('click', undo);
|
|
468
452
|
if (redoBtn) redoBtn.addEventListener('click', redo);
|
|
469
453
|
|
|
454
|
+
const saveDeckBtn = document.getElementById('lp-save-deck');
|
|
455
|
+
if (saveDeckBtn) {
|
|
456
|
+
saveDeckBtn.addEventListener('click', () => {
|
|
457
|
+
try {
|
|
458
|
+
localStorage.setItem(getStorageKey(), JSON.stringify(goal));
|
|
459
|
+
const original = saveDeckBtn.textContent;
|
|
460
|
+
saveDeckBtn.textContent = '已保存';
|
|
461
|
+
saveDeckBtn.disabled = true;
|
|
462
|
+
setTimeout(() => {
|
|
463
|
+
saveDeckBtn.textContent = original;
|
|
464
|
+
saveDeckBtn.disabled = false;
|
|
465
|
+
}, 1200);
|
|
466
|
+
} catch (err) {
|
|
467
|
+
console.warn('手动保存失败', err);
|
|
468
|
+
alert('保存失败,请检查浏览器存储权限。');
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
|
|
470
473
|
function syncAppearanceFromGoal() {
|
|
471
474
|
const t = goal.theme || 'theme01';
|
|
472
|
-
if (t === 'theme04' || t === 'theme05' || t === 'theme06') {
|
|
473
|
-
const scheme = goal.colorScheme || (t === 'theme05' ? 'coral' : t === 'theme06' ? 'volt' : 'green');
|
|
474
|
-
const
|
|
475
|
+
if (t === 'theme04' || t === 'theme05' || t === 'theme06' || t === 'theme07' || t === 'theme08' || t === 'theme09' || t === 'theme10') {
|
|
476
|
+
const scheme = goal.colorScheme || (t === 'theme05' ? 'coral' : t === 'theme06' ? 'volt' : t === 'theme07' ? 'cold-white' : t === 'theme08' ? 'obsidian-gold' : t === 'theme09' ? 'ink-editorial' : t === 'theme10' ? 'gold-index' : 'green');
|
|
477
|
+
const rawAppearance = goal.appearance || (t === 'theme07' ? 'light' : t === 'theme08' || t === 'theme09' || t === 'theme10' ? 'primary' : 'dark');
|
|
478
|
+
/* theme08 / theme09 归一化:light→muted / dark→primary */
|
|
479
|
+
const appearance = (t === 'theme08' || t === 'theme09') ? ((rawAppearance === 'light' || rawAppearance === 'muted') ? 'muted' : 'primary') : rawAppearance;
|
|
475
480
|
document.documentElement.setAttribute('data-theme', scheme);
|
|
476
481
|
document.documentElement.setAttribute('data-appearance', appearance);
|
|
477
482
|
} else if (t === 'theme03') {
|
|
@@ -491,11 +496,14 @@ export const editorScript = `
|
|
|
491
496
|
if (!appearanceValue && !themeValue) return;
|
|
492
497
|
|
|
493
498
|
let active = false;
|
|
494
|
-
if (t === 'theme04' || t === 'theme05' || t === 'theme06') {
|
|
499
|
+
if (t === 'theme04' || t === 'theme05' || t === 'theme06' || t === 'theme07' || t === 'theme08' || t === 'theme09' || t === 'theme10') {
|
|
495
500
|
if (themeValue) {
|
|
496
|
-
active = themeValue === (goal.colorScheme || (t === 'theme05' ? 'coral' : t === 'theme06' ? 'volt' : 'green'));
|
|
501
|
+
active = themeValue === (goal.colorScheme || (t === 'theme05' ? 'coral' : t === 'theme06' ? 'volt' : t === 'theme07' ? 'cold-white' : t === 'theme08' ? 'obsidian-gold' : t === 'theme09' ? 'ink-editorial' : t === 'theme10' ? 'gold-index' : 'green'));
|
|
497
502
|
} else if (appearanceValue) {
|
|
498
|
-
|
|
503
|
+
const rawGoal = goal.appearance || (t === 'theme07' ? 'light' : t === 'theme08' || t === 'theme09' || t === 'theme10' ? 'primary' : 'dark');
|
|
504
|
+
const normGoal = (t === 'theme08' || t === 'theme09') ? ((rawGoal === 'light' || rawGoal === 'muted') ? 'muted' : 'primary') : rawGoal;
|
|
505
|
+
const normBtn = (t === 'theme08' || t === 'theme09') ? ((appearanceValue === 'light' || appearanceValue === 'muted') ? 'muted' : 'primary') : appearanceValue;
|
|
506
|
+
active = normBtn === normGoal;
|
|
499
507
|
}
|
|
500
508
|
} else if (t === 'theme03') {
|
|
501
509
|
active = appearanceValue === (goal.appearance || 'dark');
|
|
@@ -510,8 +518,11 @@ export const editorScript = `
|
|
|
510
518
|
function applyAppearanceClientSide(newMode) {
|
|
511
519
|
const t = goal.theme || 'theme01';
|
|
512
520
|
|
|
513
|
-
if (t === 'theme04' || t === 'theme05' || t === 'theme06') {
|
|
514
|
-
|
|
521
|
+
if (t === 'theme04' || t === 'theme05' || t === 'theme06' || t === 'theme07' || t === 'theme08' || t === 'theme09' || t === 'theme10') {
|
|
522
|
+
/* theme08 / theme09 归一化:light→muted / dark→primary */
|
|
523
|
+
const normMode = (t === 'theme08' || t === 'theme09') ? ((newMode === 'light' || newMode === 'muted') ? 'muted' : 'primary') : newMode;
|
|
524
|
+
const curNorm = (t === 'theme08' || t === 'theme09') ? ((goal.appearance === 'light' || goal.appearance === 'muted') ? 'muted' : 'primary') : goal.appearance;
|
|
525
|
+
if (normMode === curNorm) return;
|
|
515
526
|
recordHistory();
|
|
516
527
|
goal.appearance = newMode;
|
|
517
528
|
autoSave();
|
|
@@ -1546,18 +1557,12 @@ export const editorScript = `
|
|
|
1546
1557
|
}
|
|
1547
1558
|
|
|
1548
1559
|
function confirmAddSlide() {
|
|
1549
|
-
// #region debug-point C:add-slide
|
|
1550
|
-
__dbg('C', 'editor-script.ts:confirmAddSlide', 'start', { selectedLayoutId, selectedRole, slidesLength: goal.slides.length });
|
|
1551
|
-
// #endregion
|
|
1552
1560
|
if (!selectedLayoutId) return;
|
|
1553
1561
|
const newSlide = createDefaultSlide(selectedLayoutId, selectedRole || selectedLayoutId.split('_')[0]);
|
|
1554
1562
|
recordHistory();
|
|
1555
1563
|
goal.slides.push(newSlide);
|
|
1556
1564
|
selectedSlideIdx = goal.slides.length - 1;
|
|
1557
1565
|
// current 会在 rebuildSlidesAndThumbnails 中同步,避免在 DOM 重建前访问越界
|
|
1558
|
-
// #region debug-point C:add-slide
|
|
1559
|
-
__dbg('C', 'editor-script.ts:confirmAddSlide', 'pushed', { newIndex: selectedSlideIdx, newSlideLayout: newSlide.layout, newSlideProps: JSON.parse(JSON.stringify(newSlide.props)) });
|
|
1560
|
-
// #endregion
|
|
1561
1566
|
autoSave();
|
|
1562
1567
|
closeAddSlideModal();
|
|
1563
1568
|
reloadEditor();
|
|
@@ -1632,31 +1637,11 @@ export const editorScript = `
|
|
|
1632
1637
|
}
|
|
1633
1638
|
|
|
1634
1639
|
function updateClasses() {
|
|
1635
|
-
// #region debug-point B:update-classes
|
|
1636
|
-
const activeBefore = Array.from(slides).map((s, i) => ({ i, active: s.classList.contains('active'), prev: s.classList.contains('prev') }));
|
|
1637
|
-
slides.forEach((slide, index) => {
|
|
1638
|
-
slide.classList.remove('active', 'prev', 'enter', 'leave');
|
|
1639
|
-
if (index === current) slide.classList.add('active');
|
|
1640
|
-
else if (index < current) slide.classList.add('prev');
|
|
1641
|
-
});
|
|
1642
|
-
const activeAfter = Array.from(slides).map((s, i) => ({ i, active: s.classList.contains('active'), prev: s.classList.contains('prev'), layout: s.dataset.layout }));
|
|
1643
|
-
const computed = Array.from(slides).map((s, i) => {
|
|
1644
|
-
const st = window.getComputedStyle(s);
|
|
1645
|
-
return { i, opacity: st.opacity, transform: st.transform, zIndex: st.zIndex, display: st.display, visibility: st.visibility };
|
|
1646
|
-
});
|
|
1647
|
-
__dbg('B', 'editor-script.ts:updateClasses', 'classes updated', { current, activeBefore, activeAfter, computed });
|
|
1648
|
-
// #endregion
|
|
1649
1640
|
updateEditorUI();
|
|
1650
1641
|
}
|
|
1651
1642
|
|
|
1652
1643
|
function goTo(index) {
|
|
1653
|
-
// #region debug-point A:goto-entry
|
|
1654
|
-
__dbg('A', 'editor-script.ts:goTo', 'goTo called', { from: current, to: index, slidesLength: slides.length, isTransitioning, deckExists: !!deck });
|
|
1655
|
-
// #endregion
|
|
1656
1644
|
if (index === current || index < 0 || index >= slides.length || isTransitioning) {
|
|
1657
|
-
// #region debug-point A:goto-bail
|
|
1658
|
-
__dbg('A', 'editor-script.ts:goTo', 'goTo bailed', { reason: index === current ? 'same' : index < 0 ? 'negative' : index >= slides.length ? 'overflow' : 'transitioning', current, index, slidesLength: slides.length });
|
|
1659
|
-
// #endregion
|
|
1660
1645
|
return;
|
|
1661
1646
|
}
|
|
1662
1647
|
const leaving = slides[current];
|
|
@@ -2250,9 +2235,6 @@ export const editorScript = `
|
|
|
2250
2235
|
// 静态文件模式下,增删幻灯片后不再使用 document.write 重写整页(会中断 CSS/资源加载),
|
|
2251
2236
|
// 而是直接在现有 DOM 中重建 slide 容器和缩略图,并复用 React root 重新渲染内容。
|
|
2252
2237
|
function rebuildSlidesAndThumbnails() {
|
|
2253
|
-
// #region debug-point D:rebuild
|
|
2254
|
-
__dbg('D', 'editor-script.ts:rebuildSlidesAndThumbnails', 'start', { current, selectedSlideIdx, slidesLength: goal.slides.length });
|
|
2255
|
-
// #endregion
|
|
2256
2238
|
if (!deck) return;
|
|
2257
2239
|
if (typeof window.__lemonPPT_renderSlideHtml !== 'function') return;
|
|
2258
2240
|
|
|
@@ -2324,16 +2306,10 @@ export const editorScript = `
|
|
|
2324
2306
|
}
|
|
2325
2307
|
|
|
2326
2308
|
refreshSlidesAndThumbnails();
|
|
2327
|
-
// #region debug-point D:rebuild
|
|
2328
|
-
__dbg('D', 'editor-script.ts:rebuildSlidesAndThumbnails', 'refreshed', { current, slidesLength: slides.length, thumbnailsLength: thumbnails.length });
|
|
2329
|
-
// #endregion
|
|
2330
2309
|
attachThumbnailListeners();
|
|
2331
2310
|
updateClasses();
|
|
2332
2311
|
renderAllSlidesToRoot();
|
|
2333
2312
|
initThumbnailVirtualScroll();
|
|
2334
|
-
// #region debug-point D:rebuild
|
|
2335
|
-
__dbg('D', 'editor-script.ts:rebuildSlidesAndThumbnails', 'done', { current, slidesLength: slides.length });
|
|
2336
|
-
// #endregion
|
|
2337
2313
|
}
|
|
2338
2314
|
|
|
2339
2315
|
function refreshCurrentSlide() {
|
|
@@ -3240,14 +3216,8 @@ export const editorScript = `
|
|
|
3240
3216
|
if (typeof window.__lemonPPT_renderSlideToRoot !== 'function') return;
|
|
3241
3217
|
const slide = goal.slides[index];
|
|
3242
3218
|
if (!slide || !wrapper) {
|
|
3243
|
-
// #region debug-point C:render-missing
|
|
3244
|
-
__dbg('C', 'editor-script.ts:renderSlideToRootByIndex', 'missing slide or wrapper', { index, hasSlide: !!slide, hasWrapper: !!wrapper });
|
|
3245
|
-
// #endregion
|
|
3246
3219
|
return;
|
|
3247
3220
|
}
|
|
3248
|
-
// #region debug-point C:render-start
|
|
3249
|
-
__dbg('C', 'editor-script.ts:renderSlideToRootByIndex', 'rendering slide', { index, layout: slide.layout, wrapperChildren: wrapper.childNodes.length });
|
|
3250
|
-
// #endregion
|
|
3251
3221
|
window.__lemonPPT_renderSlideToRoot(wrapper, slide, { slideIdx: index, editable: true, theme: goal.theme });
|
|
3252
3222
|
initEditableElements(wrapper);
|
|
3253
3223
|
}
|
|
@@ -3284,15 +3254,9 @@ export const editorScript = `
|
|
|
3284
3254
|
// 预创建所有 slide 的 React root 并渲染,使切页和非 active slide 更新都无需重新构建 DOM
|
|
3285
3255
|
function renderAllSlidesToRoot() {
|
|
3286
3256
|
if (typeof window.__lemonPPT_renderSlideToRoot !== 'function') {
|
|
3287
|
-
// #region debug-point C:render-all-noop
|
|
3288
|
-
__dbg('C', 'editor-script.ts:renderAllSlidesToRoot', 'renderSlideToRoot not available', {});
|
|
3289
|
-
// #endregion
|
|
3290
3257
|
return;
|
|
3291
3258
|
}
|
|
3292
3259
|
const wrappers = document.querySelectorAll('.lp-slide-wrapper');
|
|
3293
|
-
// #region debug-point C:render-all-start
|
|
3294
|
-
__dbg('C', 'editor-script.ts:renderAllSlidesToRoot', 'rendering all slides', { wrapperCount: wrappers.length, goalSlideCount: goal.slides.length });
|
|
3295
|
-
// #endregion
|
|
3296
3260
|
wrappers.forEach((wrapper, index) => {
|
|
3297
3261
|
renderSlideToRootByIndex(index, wrapper);
|
|
3298
3262
|
});
|
|
@@ -3352,6 +3316,45 @@ export const editorScript = `
|
|
|
3352
3316
|
// 预创建并渲染所有 slide 的 React root,使切页与后续更新都走 React reconcile
|
|
3353
3317
|
renderAllSlidesToRoot();
|
|
3354
3318
|
}
|
|
3319
|
+
|
|
3320
|
+
// 暴露给 editor.js:无刷新切换主题时重置内部状态
|
|
3321
|
+
window.__lemonPPT_applyTheme = function(newGoal, newSlidesMarkup) {
|
|
3322
|
+
try {
|
|
3323
|
+
const oldKey = 'lemonppt:editor:v2:' + (goal.theme || 'theme01') + ':' + (goal.randomSeed || goal.title || 'default');
|
|
3324
|
+
localStorage.setItem(oldKey, JSON.stringify(goal));
|
|
3325
|
+
} catch (err) {
|
|
3326
|
+
console.warn('切换主题前保存失败', err);
|
|
3327
|
+
}
|
|
3328
|
+
goal = newGoal;
|
|
3329
|
+
window.__lemonPPT_goal = goal;
|
|
3330
|
+
|
|
3331
|
+
// 尝试恢复当前主题的本地编辑状态
|
|
3332
|
+
try {
|
|
3333
|
+
const newKey = 'lemonppt:editor:v2:' + (goal.theme || 'theme01') + ':' + (goal.randomSeed || goal.title || 'default');
|
|
3334
|
+
const saved = localStorage.getItem(newKey);
|
|
3335
|
+
if (saved) {
|
|
3336
|
+
const parsed = JSON.parse(saved);
|
|
3337
|
+
if (parsed && Array.isArray(parsed.slides)) {
|
|
3338
|
+
goal = parsed;
|
|
3339
|
+
window.__lemonPPT_goal = goal;
|
|
3340
|
+
}
|
|
3341
|
+
}
|
|
3342
|
+
} catch (err) {
|
|
3343
|
+
console.warn('切换主题后恢复失败', err);
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3346
|
+
const slidesContainer = document.getElementById('lp-slides');
|
|
3347
|
+
if (slidesContainer) {
|
|
3348
|
+
slidesContainer.innerHTML = newSlidesMarkup;
|
|
3349
|
+
}
|
|
3350
|
+
current = 0;
|
|
3351
|
+
selectedSlideIdx = 0;
|
|
3352
|
+
rebuildSlidesAndThumbnails();
|
|
3353
|
+
selectSlide(current);
|
|
3354
|
+
syncAppearanceFromGoal();
|
|
3355
|
+
autoSave();
|
|
3356
|
+
updateUndoRedoButtons();
|
|
3357
|
+
};
|
|
3355
3358
|
})();
|
|
3356
3359
|
`;
|
|
3357
3360
|
//# sourceMappingURL=editor-script.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-script.js","sourceRoot":"","sources":["../src/editor-script.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,gCAAgC;AAChC,6CAA6C;AAE7C,MAAM,CAAC,MAAM,YAAY,GAAG
|
|
1
|
+
{"version":3,"file":"editor-script.js","sourceRoot":"","sources":["../src/editor-script.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,gCAAgC;AAChC,6CAA6C;AAE7C,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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f(goal, options) {
|
|
|
40
40
|
const browser = await chromium.launch();
|
|
41
41
|
const page = await browser.newPage();
|
|
42
42
|
try {
|
|
43
|
-
await page.goto('file://' + tempHtml, { waitUntil: '
|
|
43
|
+
await page.goto('file://' + tempHtml, { waitUntil: 'domcontentloaded' });
|
|
44
44
|
await page.evaluate(() => document.fonts.ready);
|
|
45
45
|
// 显式等待并执行 ECharts 初始化,确保异步图表渲染完成后再生成 PDF。
|
|
46
46
|
await page.evaluate(async () => {
|
package/dist/export-pdf.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-pdf.js","sourceRoot":"","sources":["../src/export-pdf.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,gCAAgC;AAChC,6CAA6C;AAG7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAiBzC,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAc,EAAE,OAAyB;IAC7E,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,IAAI,EAAE,MAAM,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC;IAExD,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,SAAS,CAAC;IAEtC,kCAAkC;IAClC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,IAA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