@lemonppt/renderer 1.0.1 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemonppt/renderer",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -32,9 +32,9 @@
32
32
  "pptxgenjs": "3.12.0",
33
33
  "react": "^18.3.1",
34
34
  "react-dom": "^18.3.1",
35
- "@lemonppt/core": "1.0.1",
36
- "@lemonppt/templates": "1.0.1",
37
- "@lemonppt/themes": "1.0.1"
35
+ "@lemonppt/core": "1.0.2",
36
+ "@lemonppt/themes": "1.0.2",
37
+ "@lemonppt/templates": "1.0.2"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/node": "^20.0.0",
@@ -480,6 +480,399 @@
480
480
  min-height: 80px;
481
481
  resize: vertical;
482
482
  }
483
+ .lp-selected {
484
+ outline: 2px solid var(--lp-accent, #3b82f6) !important;
485
+ outline-offset: 2px !important;
486
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--lp-accent, #3b82f6) 20%, transparent);
487
+ }
488
+ .lp-editor-zoom-bar {
489
+ position: absolute;
490
+ bottom: 16px;
491
+ left: 50%;
492
+ transform: translateX(-50%);
493
+ z-index: 10;
494
+ display: flex;
495
+ align-items: center;
496
+ gap: 8px;
497
+ background: #1e1e1e;
498
+ border: 1px solid #333;
499
+ border-radius: 8px;
500
+ padding: 6px 10px;
501
+ font-size: 12px;
502
+ color: #bbb;
503
+ }
504
+ .lp-editor-zoom-bar button {
505
+ background: #2a2a2a;
506
+ border: 1px solid #444;
507
+ color: #e5e5e5;
508
+ border-radius: 4px;
509
+ padding: 4px 8px;
510
+ cursor: pointer;
511
+ }
512
+ .lp-editor-zoom-bar button:hover {
513
+ background: #333;
514
+ }
515
+ .lp-editor-zoom-bar input[type="range"] {
516
+ width: 100px;
517
+ }
518
+ .lp-property-section {
519
+ margin-bottom: 18px;
520
+ padding-bottom: 14px;
521
+ border-bottom: 1px solid #333;
522
+ }
523
+ .lp-property-section:last-child {
524
+ border-bottom: none;
525
+ }
526
+ .lp-property-section-title {
527
+ font-size: 12px;
528
+ font-weight: 600;
529
+ color: #fff;
530
+ margin-bottom: 10px;
531
+ text-transform: uppercase;
532
+ letter-spacing: 0.05em;
533
+ }
534
+ .lp-property-section-header {
535
+ display: flex;
536
+ align-items: center;
537
+ justify-content: space-between;
538
+ margin-bottom: 10px;
539
+ }
540
+ .lp-property-section-header .lp-property-section-title {
541
+ margin-bottom: 0;
542
+ }
543
+ .lp-property-help {
544
+ font-size: 12px;
545
+ color: #888;
546
+ margin-bottom: 10px;
547
+ line-height: 1.4;
548
+ }
549
+ .lp-property-field {
550
+ margin-bottom: 12px;
551
+ }
552
+ .lp-property-field:last-child {
553
+ margin-bottom: 0;
554
+ }
555
+ .lp-property-toggle {
556
+ display: flex;
557
+ align-items: center;
558
+ justify-content: space-between;
559
+ cursor: pointer;
560
+ }
561
+ .lp-property-toggle-track {
562
+ width: 46px;
563
+ height: 24px;
564
+ background: #444;
565
+ border-radius: 12px;
566
+ position: relative;
567
+ transition: background 0.25s ease;
568
+ box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
569
+ }
570
+ .lp-property-toggle input:checked + .lp-property-toggle-track {
571
+ background: #34d399;
572
+ }
573
+ .lp-property-toggle-thumb {
574
+ position: absolute;
575
+ top: 2px;
576
+ left: 2px;
577
+ width: 20px;
578
+ height: 20px;
579
+ background: #fff;
580
+ border-radius: 50%;
581
+ transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
582
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
583
+ }
584
+ .lp-property-toggle input:checked + .lp-property-toggle-track .lp-property-toggle-thumb {
585
+ transform: translateX(22px);
586
+ }
587
+ .lp-property-toggle input {
588
+ position: absolute;
589
+ opacity: 0;
590
+ width: 0;
591
+ height: 0;
592
+ }
593
+ .lp-property-segmented {
594
+ display: flex;
595
+ background: #2a2a2a;
596
+ border: 1px solid #444;
597
+ border-radius: 6px;
598
+ overflow: hidden;
599
+ }
600
+ .lp-property-segmented button {
601
+ flex: 1;
602
+ background: transparent;
603
+ border: none;
604
+ border-right: 1px solid #444;
605
+ color: #bbb;
606
+ padding: 6px 0;
607
+ font-size: 12px;
608
+ cursor: pointer;
609
+ }
610
+ .lp-property-segmented button:last-child {
611
+ border-right: none;
612
+ }
613
+ .lp-property-segmented button.active {
614
+ background: #3b82f6;
615
+ color: #fff;
616
+ }
617
+ .lp-property-color-grid {
618
+ display: grid;
619
+ grid-template-columns: repeat(5, 1fr);
620
+ gap: 8px;
621
+ }
622
+ .lp-property-color-btn {
623
+ width: 100%;
624
+ aspect-ratio: 1;
625
+ border-radius: 50%;
626
+ border: 2px solid transparent;
627
+ cursor: pointer;
628
+ }
629
+ .lp-property-color-btn.active {
630
+ border-color: #fff;
631
+ }
632
+ .lp-property-range {
633
+ width: 100%;
634
+ }
635
+ .lp-property-slider-wrap {
636
+ margin-bottom: 16px;
637
+ }
638
+ .lp-property-slider-label {
639
+ font-size: 12px;
640
+ color: #bbb;
641
+ }
642
+ .lp-property-slider-value {
643
+ font-size: 13px;
644
+ font-weight: 700;
645
+ color: #fff;
646
+ min-width: 26px;
647
+ text-align: center;
648
+ padding: 2px 8px;
649
+ background: linear-gradient(135deg, rgba(91,155,213,0.9), rgba(139,92,246,0.9));
650
+ border-radius: 999px;
651
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
652
+ }
653
+ .lp-property-slider-ruler {
654
+ position: relative;
655
+ padding: 18px 18px 10px;
656
+ background: rgba(255, 255, 255, 0.04);
657
+ border: 1px solid rgba(255, 255, 255, 0.08);
658
+ border-radius: 14px;
659
+ cursor: pointer;
660
+ transition: background 0.2s ease, border-color 0.2s ease;
661
+ }
662
+ .lp-property-slider-ruler:hover {
663
+ background: rgba(255, 255, 255, 0.07);
664
+ border-color: rgba(255, 255, 255, 0.14);
665
+ }
666
+ .lp-property-slider-ruler::before {
667
+ content: '';
668
+ position: absolute;
669
+ top: 22px;
670
+ left: 18px;
671
+ right: 18px;
672
+ height: 2px;
673
+ background: rgba(255, 255, 255, 0.12);
674
+ border-radius: 1px;
675
+ pointer-events: none;
676
+ }
677
+ .lp-property-slider {
678
+ width: 100%;
679
+ -webkit-appearance: none;
680
+ appearance: none;
681
+ height: 8px;
682
+ background: rgba(255, 255, 255, 0.14);
683
+ border-radius: 4px;
684
+ outline: none;
685
+ display: block;
686
+ margin: 0;
687
+ cursor: pointer;
688
+ transition: box-shadow 0.2s ease;
689
+ }
690
+ .lp-property-slider:hover {
691
+ box-shadow: 0 0 0 4px rgba(91, 155, 213, 0.12);
692
+ }
693
+ .lp-property-slider::-webkit-slider-thumb {
694
+ -webkit-appearance: none;
695
+ appearance: none;
696
+ width: 24px;
697
+ height: 24px;
698
+ background: #fff;
699
+ border-radius: 50%;
700
+ cursor: grab;
701
+ border: 4px solid #5b9bd5;
702
+ box-shadow: 0 0 0 4px rgba(91, 155, 213, 0.2), 0 4px 12px rgba(0, 0, 0, 0.35);
703
+ margin-top: -8px;
704
+ transition: transform 0.15s ease, box-shadow 0.2s ease;
705
+ }
706
+ .lp-property-slider::-webkit-slider-thumb:hover {
707
+ transform: scale(1.12);
708
+ box-shadow: 0 0 0 6px rgba(91, 155, 213, 0.28), 0 6px 16px rgba(0, 0, 0, 0.4);
709
+ }
710
+ .lp-property-slider:active::-webkit-slider-thumb {
711
+ cursor: grabbing;
712
+ transform: scale(1.05);
713
+ border-color: #8b5cf6;
714
+ }
715
+ .lp-property-slider::-webkit-slider-runnable-track {
716
+ height: 8px;
717
+ border-radius: 4px;
718
+ }
719
+ .lp-property-slider::-moz-range-thumb {
720
+ width: 24px;
721
+ height: 24px;
722
+ background: #fff;
723
+ border-radius: 50%;
724
+ cursor: grab;
725
+ border: 4px solid #5b9bd5;
726
+ box-shadow: 0 0 0 4px rgba(91, 155, 213, 0.2), 0 4px 12px rgba(0, 0, 0, 0.35);
727
+ transition: transform 0.15s ease, box-shadow 0.2s ease;
728
+ }
729
+ .lp-property-slider::-moz-range-thumb:hover {
730
+ transform: scale(1.12);
731
+ box-shadow: 0 0 0 6px rgba(91, 155, 213, 0.28), 0 6px 16px rgba(0, 0, 0, 0.4);
732
+ }
733
+ .lp-property-slider:active::-moz-range-thumb {
734
+ cursor: grabbing;
735
+ transform: scale(1.05);
736
+ border-color: #8b5cf6;
737
+ }
738
+ .lp-property-slider::-moz-range-track {
739
+ height: 8px;
740
+ border-radius: 4px;
741
+ }
742
+ .lp-property-slider-scale {
743
+ position: relative;
744
+ height: 34px;
745
+ margin-top: 10px;
746
+ margin-left: 0;
747
+ margin-right: 0;
748
+ }
749
+ .lp-property-slider-tick {
750
+ position: absolute;
751
+ top: 0;
752
+ transform: translateX(-50%);
753
+ display: flex;
754
+ flex-direction: column;
755
+ align-items: center;
756
+ gap: 5px;
757
+ cursor: pointer;
758
+ padding: 0 6px;
759
+ transition: transform 0.15s ease;
760
+ min-width: 20px;
761
+ }
762
+ .lp-property-slider-tick:hover {
763
+ transform: translateX(-50%) scale(1.15);
764
+ }
765
+ .lp-property-slider-tick::before {
766
+ content: '';
767
+ width: 2px;
768
+ height: 12px;
769
+ background: rgba(255, 255, 255, 0.65);
770
+ border-radius: 1px;
771
+ transition: background 0.2s ease, height 0.15s ease;
772
+ }
773
+ .lp-property-slider-tick:hover::before {
774
+ background: #fff;
775
+ height: 16px;
776
+ }
777
+ .lp-property-slider-tick-label {
778
+ font-size: 12px;
779
+ font-weight: 700;
780
+ color: rgba(255, 255, 255, 0.85);
781
+ line-height: 1;
782
+ transition: color 0.2s ease;
783
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
784
+ white-space: nowrap;
785
+ }
786
+ .lp-property-slider-tick:hover .lp-property-slider-tick-label {
787
+ color: #fff;
788
+ }
789
+ .lp-property-array {
790
+ display: flex;
791
+ flex-direction: column;
792
+ gap: 8px;
793
+ }
794
+ .lp-property-array-item {
795
+ background: #252525;
796
+ border-bottom: 1px solid #383838;
797
+ border-radius: 8px;
798
+ padding: 10px 10px 20px 10px;
799
+ }
800
+ .lp-property-array-item-header {
801
+ display: flex;
802
+ align-items: center;
803
+ justify-content: space-between;
804
+ font-family: var(--lp-font-mono, ui-monospace, monospace);
805
+ font-size: 11px;
806
+ font-weight: 700;
807
+ color: var(--lp-accent, #888);
808
+ margin-bottom: 8px;
809
+ letter-spacing: 0.04em;
810
+ }
811
+ .lp-property-array-header {
812
+ display: flex;
813
+ align-items: center;
814
+ justify-content: space-between;
815
+ font-size: 12px;
816
+ color: #aaa;
817
+ line-height: 1;
818
+ }
819
+ .lp-property-array-header .lp-property-btn-sm {
820
+ width: auto;
821
+ margin-left: auto;
822
+ }
823
+ .lp-property-btn {
824
+ width: 100%;
825
+ padding: 8px;
826
+ background: #2a2a2a;
827
+ border: 1px solid #444;
828
+ border-radius: 6px;
829
+ color: #e5e5e5;
830
+ font-size: 13px;
831
+ cursor: pointer;
832
+ }
833
+ .lp-property-btn:hover {
834
+ background: #333;
835
+ }
836
+ .lp-property-btn:disabled {
837
+ opacity: 0.5;
838
+ cursor: not-allowed;
839
+ }
840
+ .lp-property-btn-primary {
841
+ background: #3b82f6;
842
+ border-color: #3b82f6;
843
+ color: #fff;
844
+ }
845
+ .lp-property-btn-primary:hover:not(:disabled) {
846
+ background: #2563eb;
847
+ }
848
+ .lp-property-btn-danger {
849
+ border-color: transparent;
850
+ background: transparent;
851
+ color: #ef4444;
852
+ width: 22px;
853
+ height: 22px;
854
+ padding: 0;
855
+ display: inline-flex;
856
+ align-items: center;
857
+ justify-content: center;
858
+ border-radius: 4px;
859
+ font-size: 16px;
860
+ line-height: 1;
861
+ }
862
+ .lp-property-btn-danger:hover:not(:disabled) {
863
+ background: rgba(239, 68, 68, 0.12);
864
+ }
865
+ .lp-property-btn-sm {
866
+ padding: 4px 8px;
867
+ font-size: 12px;
868
+ }
869
+ .lp-property-empty-state {
870
+ color: #888;
871
+ font-size: 13px;
872
+ line-height: 1.5;
873
+ text-align: center;
874
+ padding: 20px 0;
875
+ }
483
876
  .lp-add-slide-modal-overlay {
484
877
  position: fixed;
485
878
  inset: 0;
@@ -186,6 +186,9 @@
186
186
 
187
187
  // 首次加载需要注入 editor-script,后续直接复用已初始化的实例
188
188
  if (!editorScriptLoaded) {
189
+ // editor-script 依赖 client-render 的渲染函数与 ECharts 主题脚本
190
+ await loadScript(assetUrl('client-render.js'));
191
+ await loadScript(assetUrl('theme-echarts.js'));
189
192
  await loadScript(assetUrl('editor-script.js'));
190
193
  editorScriptLoaded = true;
191
194
  } else if (typeof window.__lemonPPT_applyTheme === 'function') {