autumnnote 1.5.0 → 1.6.1

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 (53) hide show
  1. package/README.md +10 -8
  2. package/dist/autumnnote.css +324 -4
  3. package/dist/autumnnote.es.js +943 -526
  4. package/dist/autumnnote.es.js.map +1 -1
  5. package/dist/autumnnote.umd.js +935 -519
  6. package/dist/autumnnote.umd.js.map +1 -1
  7. package/package.json +21 -3
  8. package/src/js/Context.js +23 -16
  9. package/src/js/core/detectLang.js +98 -0
  10. package/src/js/core/dom.js +67 -11
  11. package/src/js/core/env.js +1 -1
  12. package/src/js/core/func.js +1 -1
  13. package/src/js/core/lists.js +1 -1
  14. package/src/js/core/markdown.js +32 -31
  15. package/src/js/core/range.js +8 -8
  16. package/src/js/editing/History.js +10 -10
  17. package/src/js/editing/Style.js +44 -44
  18. package/src/js/editing/Table.js +5 -7
  19. package/src/js/editing/Typing.js +19 -19
  20. package/src/js/i18n/en.js +2 -0
  21. package/src/js/i18n/vi.js +2 -0
  22. package/src/js/index.js +3 -2
  23. package/src/js/module/AutoSaveRestore.js +2 -4
  24. package/src/js/module/BubbleToolbar.js +51 -34
  25. package/src/js/module/Buttons.js +20 -18
  26. package/src/js/module/Clipboard.js +16 -17
  27. package/src/js/module/CodeTooltip.js +48 -24
  28. package/src/js/module/Codeview.js +5 -7
  29. package/src/js/module/ContextMenu.js +37 -37
  30. package/src/js/module/Editor.js +77 -26
  31. package/src/js/module/EmojiDialog.js +24 -18
  32. package/src/js/module/FindReplace.js +93 -66
  33. package/src/js/module/Fullscreen.js +1 -1
  34. package/src/js/module/IconDialog.js +39 -35
  35. package/src/js/module/ImageCropOverlay.js +13 -13
  36. package/src/js/module/ImageDialog.js +19 -13
  37. package/src/js/module/ImageResizer.js +5 -5
  38. package/src/js/module/ImageTooltip.js +20 -16
  39. package/src/js/module/LinkDialog.js +20 -14
  40. package/src/js/module/LinkTooltip.js +15 -12
  41. package/src/js/module/MarkdownShortcuts.js +11 -14
  42. package/src/js/module/Mention.js +11 -13
  43. package/src/js/module/Placeholder.js +1 -1
  44. package/src/js/module/ShortcutsDialog.js +2 -4
  45. package/src/js/module/Statusbar.js +5 -7
  46. package/src/js/module/TableTooltip.js +196 -36
  47. package/src/js/module/Toolbar.js +35 -34
  48. package/src/js/module/VideoDialog.js +16 -10
  49. package/src/js/module/VideoResizer.js +7 -9
  50. package/src/js/module/VideoTooltip.js +15 -10
  51. package/src/js/renderer.js +5 -3
  52. package/src/js/settings.js +53 -36
  53. package/src/styles/autumnnote.scss +332 -7
@@ -62,14 +62,12 @@
62
62
  // Prevent images from being dragged out.
63
63
  img {
64
64
  -webkit-user-drag: none;
65
- user-drag: none;
66
65
  }
67
66
 
68
67
  // Prevent video wrapper itself from being dragged, but keep pointer-events
69
68
  // active so the video shield works and the iframe is visible/interactive.
70
69
  .an-video-wrapper {
71
70
  -webkit-user-drag: none;
72
- user-drag: none;
73
71
  }
74
72
 
75
73
  // D-3: In read-only mode, disable the video shield so clicks reach the
@@ -652,6 +650,31 @@
652
650
  letter-spacing: 0.02em;
653
651
  }
654
652
 
653
+ // Color-strip variant for the cell shade button (mirrors .an-bubble-btn--color)
654
+ .an-link-tooltip-btn--shade {
655
+ flex-direction: column;
656
+ gap: 1px;
657
+ padding: 4px 0 3px;
658
+ height: auto;
659
+
660
+ .an-bubble-btn-svg {
661
+ display: flex;
662
+ align-items: center;
663
+ justify-content: center;
664
+ line-height: 0;
665
+ svg { display: block; }
666
+ }
667
+
668
+ .an-link-tooltip-color-strip {
669
+ display: block;
670
+ width: 13px;
671
+ height: 3px;
672
+ border-radius: 1px;
673
+ pointer-events: none;
674
+ background: transparent;
675
+ }
676
+ }
677
+
655
678
  // Active state for toggle buttons in tooltips (e.g. Select Cells)
656
679
  .an-link-tooltip-btn--active {
657
680
  background: rgba(#3b82f6, 0.12) !important;
@@ -726,6 +749,58 @@
726
749
  }
727
750
  }
728
751
 
752
+ // =============================================================================
753
+ // Cell shade popover
754
+
755
+ .an-cell-shade-popover {
756
+ position: fixed;
757
+ z-index: 1200;
758
+ background: $an-bg;
759
+ border: 1px solid $an-border;
760
+ border-radius: 8px;
761
+ padding: 10px 10px 6px;
762
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
763
+ min-width: 166px;
764
+
765
+ .an-size-popover-title {
766
+ font-size: 11px;
767
+ font-weight: 600;
768
+ color: $an-muted;
769
+ text-transform: uppercase;
770
+ letter-spacing: 0.5px;
771
+ margin-bottom: 8px;
772
+ }
773
+
774
+ .an-shade-no-color {
775
+ display: inline-flex;
776
+ align-items: center;
777
+ gap: 4px;
778
+ padding: 3px 8px;
779
+ font-size: 12px;
780
+ color: $an-muted;
781
+ background: transparent;
782
+ border: 1px solid $an-border;
783
+ border-radius: $an-radius-sm;
784
+ cursor: pointer;
785
+ font-family: inherit;
786
+
787
+ &:hover {
788
+ background: $an-bg-btn-hover;
789
+ color: $an-text;
790
+ }
791
+ }
792
+
793
+ .an-shade-color-input {
794
+ width: 24px;
795
+ height: 24px;
796
+ padding: 0;
797
+ border: 1px solid $an-border;
798
+ border-radius: $an-radius-sm;
799
+ cursor: pointer;
800
+ background: transparent;
801
+ }
802
+ }
803
+
729
804
  // =============================================================================
730
805
  // Codeview textarea
731
806
  // =============================================================================
@@ -819,8 +894,29 @@
819
894
  gap: 10px;
820
895
  }
821
896
 
897
+ .an-dialog-header {
898
+ display: flex;
899
+ align-items: center;
900
+ gap: 12px;
901
+ margin-bottom: 4px;
902
+ }
903
+
904
+ .an-dialog-icon {
905
+ display: flex;
906
+ align-items: center;
907
+ justify-content: center;
908
+ width: 38px;
909
+ height: 38px;
910
+ flex-shrink: 0;
911
+ border-radius: 10px;
912
+ background: rgba($an-primary, 0.1);
913
+ color: $an-primary;
914
+
915
+ svg { display: block; stroke: currentColor; }
916
+ }
917
+
822
918
  .an-dialog-title {
823
- margin: 0 0 4px;
919
+ margin: 0;
824
920
  font-size: 16px;
825
921
  font-weight: 600;
826
922
  color: $an-text;
@@ -871,6 +967,114 @@
871
967
  }
872
968
  }
873
969
 
970
+ // =============================================================================
971
+ // Find & Replace — floating panel
972
+ // =============================================================================
973
+
974
+ .an-fr-dialog {
975
+ // Override centered-modal defaults: floating panel, no backdrop
976
+ background: transparent;
977
+ pointer-events: none;
978
+ align-items: flex-start;
979
+ justify-content: flex-end;
980
+ padding: 56px 16px 0 0;
981
+
982
+ .an-fr-box {
983
+ pointer-events: auto;
984
+ width: 360px;
985
+ padding: 14px 16px 16px;
986
+ gap: 8px;
987
+ }
988
+ }
989
+
990
+ .an-fr-header {
991
+ display: flex;
992
+ align-items: center;
993
+ justify-content: space-between;
994
+ margin-bottom: 2px;
995
+
996
+ .an-dialog-title { margin: 0; font-size: 14px; }
997
+ }
998
+
999
+ // Compact search bar: input + toggle buttons + counter in one row
1000
+ .an-fr-search-bar {
1001
+ display: flex;
1002
+ align-items: center;
1003
+ gap: 4px;
1004
+
1005
+ .an-fr-input {
1006
+ flex: 1;
1007
+ min-width: 0;
1008
+ padding: 6px 8px;
1009
+ font-size: 13px;
1010
+ }
1011
+ }
1012
+
1013
+ // Replace row
1014
+ .an-fr-replace-row {
1015
+ display: flex;
1016
+ align-items: center;
1017
+ gap: 6px;
1018
+
1019
+ .an-fr-input {
1020
+ flex: 1;
1021
+ min-width: 0;
1022
+ padding: 6px 8px;
1023
+ font-size: 13px;
1024
+ }
1025
+
1026
+ .an-fr-replace-btn {
1027
+ flex-shrink: 0;
1028
+ padding: 5px 10px;
1029
+ font-size: 12px;
1030
+ white-space: nowrap;
1031
+ }
1032
+ }
1033
+
1034
+ // Icon buttons (Aa, ↑, ↓)
1035
+ .an-fr-icon-btn {
1036
+ display: flex;
1037
+ align-items: center;
1038
+ justify-content: center;
1039
+ flex-shrink: 0;
1040
+ width: 28px;
1041
+ height: 28px;
1042
+ padding: 0;
1043
+ font-size: 12px;
1044
+ font-weight: 600;
1045
+ font-family: inherit;
1046
+ border: 1px solid transparent;
1047
+ border-radius: $an-radius-sm;
1048
+ background: transparent;
1049
+ color: $an-muted;
1050
+ cursor: pointer;
1051
+
1052
+ svg { display: block; stroke: currentColor; }
1053
+
1054
+ &:hover {
1055
+ background: $an-bg-btn-hover;
1056
+ color: $an-text;
1057
+ border-color: $an-border;
1058
+ }
1059
+
1060
+ &.an-fr-icon-btn--active {
1061
+ background: rgba($an-primary, 0.1);
1062
+ color: $an-primary;
1063
+ border-color: rgba($an-primary, 0.3);
1064
+ }
1065
+ }
1066
+
1067
+ .an-fr-counter {
1068
+ font-size: 11px;
1069
+ color: $an-muted;
1070
+ white-space: nowrap;
1071
+ min-width: 36px;
1072
+ text-align: right;
1073
+ flex-shrink: 0;
1074
+ }
1075
+
1076
+ // =============================================================================
1077
+
874
1078
  .an-input {
875
1079
  width: 100%;
876
1080
  padding: 7px 10px;
@@ -1217,7 +1421,6 @@ $an-video-accent: #8b5cf6; // violet-500
1217
1421
  // .an-video-selected is applied by VideoResizer for JS state tracking.
1218
1422
  // Visual selection is handled entirely by the .an-video-resizer overlay,
1219
1423
  // so no CSS outline is needed here (two visible frames would appear otherwise).
1220
- .an-video-selected {}
1221
1424
 
1222
1425
  // ---------------------------------------------------------------------------
1223
1426
  // Icon dialog
@@ -1242,6 +1445,28 @@ $an-video-accent: #8b5cf6; // violet-500
1242
1445
  }
1243
1446
  }
1244
1447
 
1448
+ // Icon + title grouped together (used in emoji/icon/find dialogs)
1449
+ .an-dialog-title-group {
1450
+ display: flex;
1451
+ align-items: center;
1452
+ gap: 10px;
1453
+ }
1454
+
1455
+ // Small icon variant for dialogs with title-row layout
1456
+ .an-dialog-icon--sm {
1457
+ width: 32px;
1458
+ height: 32px;
1459
+ border-radius: 8px;
1460
+ background: rgba($an-primary, 0.1);
1461
+ color: $an-primary;
1462
+ display: flex;
1463
+ align-items: center;
1464
+ justify-content: center;
1465
+ flex-shrink: 0;
1466
+
1467
+ svg { display: block; stroke: currentColor; }
1468
+ }
1469
+
1245
1470
  .an-icon-close {
1246
1471
  display: flex;
1247
1472
  align-items: center;
@@ -1759,6 +1984,20 @@ $an-video-accent: #8b5cf6; // violet-500
1759
1984
 
1760
1985
  .an-dialog-title { color: #cdd6f4; }
1761
1986
 
1987
+ .an-dialog-icon,
1988
+ .an-dialog-icon--sm {
1989
+ background: rgba(#818cf8, 0.15);
1990
+ color: #818cf8;
1991
+ }
1992
+
1993
+ .an-fr-icon-btn {
1994
+ color: #a6adc8;
1995
+ &:hover { background: #313244; color: #cdd6f4; border-color: #45475a; }
1996
+ &.an-fr-icon-btn--active { background: rgba(#818cf8, 0.15); color: #818cf8; border-color: rgba(#818cf8, 0.3); }
1997
+ }
1998
+
1999
+ .an-fr-counter { color: #6c7086; }
2000
+
1762
2001
  .an-label { color: #cdd6f4; }
1763
2002
 
1764
2003
  .an-input {
@@ -1794,12 +2033,23 @@ $an-video-accent: #8b5cf6; // violet-500
1794
2033
 
1795
2034
  .an-color-popup,
1796
2035
  .an-table-picker-popup,
1797
- .an-size-popover {
2036
+ .an-size-popover,
2037
+ .an-cell-shade-popover {
1798
2038
  background: #24273a;
1799
2039
  border-color: #3f3f5f;
1800
2040
  color: #cdd6f4;
1801
2041
  }
1802
2042
 
2043
+ .an-cell-shade-popover .an-shade-no-color {
2044
+ border-color: #3f3f5f;
2045
+ color: #a6adc8;
2046
+
2047
+ &:hover {
2048
+ background: #313244;
2049
+ color: #cdd6f4;
2050
+ }
2051
+ }
2052
+
1803
2053
  .an-link-tooltip-btn--active {
1804
2054
  background: rgba(#6366f1, 0.2) !important;
1805
2055
  color: #818cf8 !important;
@@ -1821,6 +2071,17 @@ $an-video-accent: #8b5cf6; // violet-500
1821
2071
  }
1822
2072
  }
1823
2073
 
2074
+ // Color popup children
2075
+ .an-color-custom {
2076
+ border-top-color: #3f3f5f;
2077
+ color: #cdd6f4;
2078
+ }
2079
+
2080
+ .an-color-arrow:hover { border-left-color: #45475a; }
2081
+
2082
+ .an-table-label { color: #6c7086; }
2083
+ .an-context-table-grid-panel { border-top-color: #3f3f5f; }
2084
+
1824
2085
  .an-context-item { color: #cdd6f4; }
1825
2086
  .an-context-sep { background: #3f3f5f; }
1826
2087
 
@@ -1857,9 +2118,18 @@ $an-video-accent: #8b5cf6; // violet-500
1857
2118
  }
1858
2119
 
1859
2120
  .an-icon-cell {
1860
- color: #cdd6f4;
2121
+ color: #a6adc8;
2122
+
2123
+ i { color: #cdd6f4; }
2124
+
2125
+ &:hover { background: #2a2a3e; border-color: #45475a; }
1861
2126
 
1862
- &:hover { background: #2a2a3e; }
2127
+ &.active {
2128
+ background: rgba(#818cf8, 0.15);
2129
+ border-color: #818cf8;
2130
+ color: #818cf8;
2131
+ i { color: #818cf8; }
2132
+ }
1863
2133
  }
1864
2134
 
1865
2135
  .an-icon-close {
@@ -1870,6 +2140,61 @@ $an-video-accent: #8b5cf6; // violet-500
1870
2140
  color: #cdd6f4;
1871
2141
  }
1872
2142
  }
2143
+
2144
+ // Emoji dialog
2145
+ .an-emoji-box { background: #1e1e2e; border-color: #45475a; }
2146
+
2147
+ .an-emoji-cell {
2148
+ color: inherit;
2149
+ &:hover { background: #313244; }
2150
+ }
2151
+
2152
+ .an-emoji-grid {
2153
+ scrollbar-color: #45475a transparent;
2154
+ }
2155
+
2156
+ // Icon dialog
2157
+ .an-icon-box { background: #1e1e2e; border-color: #45475a; }
2158
+
2159
+ .an-icon-grid { background: #181825; border-color: #45475a; }
2160
+
2161
+ .an-icon-options {
2162
+ background: #181825;
2163
+ border-color: #45475a;
2164
+ }
2165
+
2166
+ .an-icon-preview {
2167
+ background: #181825;
2168
+ border-color: #45475a;
2169
+ color: #cdd6f4;
2170
+
2171
+ .an-icon-preview-empty { color: #6c7086; }
2172
+ }
2173
+
2174
+ .an-icon-option-select {
2175
+ background: #313244;
2176
+ border-color: #45475a;
2177
+ color: #cdd6f4;
2178
+ }
2179
+
2180
+ .an-icon-empty { color: #6c7086; }
2181
+
2182
+ // Bubble toolbar color picker
2183
+ .an-bubble-color-picker {
2184
+ background: #24273a;
2185
+ border-color: #3f3f5f;
2186
+
2187
+ .an-context-color-custom {
2188
+ border-color: #3f3f5f;
2189
+ color: #a6adc8;
2190
+ }
2191
+ }
2192
+
2193
+ // Table tooltip (extends link-tooltip dark rules)
2194
+ .an-table-tooltip { background: #24273a; border-color: #3f3f5f; }
2195
+
2196
+ // Find & Replace floating panel box
2197
+ .an-fr-box { background: #1e1e2e; border-color: #45475a; }
1873
2198
  }
1874
2199
 
1875
2200