autumnnote 1.15.0 โ†’ 2.0.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 (51) hide show
  1. package/README.md +53 -2
  2. package/dist/autumnnote.cjs +21 -21
  3. package/dist/autumnnote.css +1 -1
  4. package/dist/autumnnote.es.js +1470 -5884
  5. package/dist/autumnnote.es.js.map +1 -1
  6. package/dist/autumnnote.min.js +61 -0
  7. package/dist/autumnnote.umd.js +21 -21
  8. package/dist/autumnnote.umd.js.map +1 -1
  9. package/dist/emoji-data-BDQX5kh-.js +2331 -0
  10. package/dist/emoji-data-BDQX5kh-.js.map +1 -0
  11. package/package.json +9 -5
  12. package/src/js/Context.js +216 -17
  13. package/src/js/editing/History.js +38 -6
  14. package/src/js/i18n/all.js +27 -0
  15. package/src/js/i18n/de.js +15 -0
  16. package/src/js/i18n/en.js +15 -0
  17. package/src/js/i18n/es.js +15 -0
  18. package/src/js/i18n/fr.js +15 -0
  19. package/src/js/i18n/index.js +45 -19
  20. package/src/js/i18n/ja.js +15 -0
  21. package/src/js/i18n/ko.js +15 -0
  22. package/src/js/i18n/vi.js +15 -0
  23. package/src/js/i18n/zh.js +15 -0
  24. package/src/js/index.js +24 -2
  25. package/src/js/index.umd.js +5 -0
  26. package/src/js/module/BaseMediaTooltip.js +142 -0
  27. package/src/js/module/BaseResizer.js +312 -0
  28. package/src/js/module/Clipboard.js +20 -6
  29. package/src/js/module/Editor.js +15 -1
  30. package/src/js/module/EmojiDialog.js +41 -494
  31. package/src/js/module/ImageDialog.js +34 -6
  32. package/src/js/module/ImageResizer.js +23 -241
  33. package/src/js/module/ImageTooltip.js +16 -111
  34. package/src/js/module/MarkdownShortcuts.js +2 -2
  35. package/src/js/module/SlashMenu.js +376 -0
  36. package/src/js/module/Statusbar.js +3 -9
  37. package/src/js/module/VideoResizer.js +38 -239
  38. package/src/js/module/VideoTooltip.js +27 -114
  39. package/src/js/module/emoji-data.js +496 -0
  40. package/src/js/settings.js +27 -0
  41. package/src/styles/autumnnote.scss +49 -0
  42. package/types/i18n/all.d.ts +14 -0
  43. package/types/i18n/de.d.ts +4 -0
  44. package/types/i18n/en.d.ts +4 -0
  45. package/types/i18n/es.d.ts +4 -0
  46. package/types/i18n/fr.d.ts +4 -0
  47. package/types/i18n/ja.d.ts +4 -0
  48. package/types/i18n/ko.d.ts +4 -0
  49. package/types/i18n/vi.d.ts +4 -0
  50. package/types/i18n/zh.d.ts +4 -0
  51. package/types/index.d.ts +113 -4
@@ -6,495 +6,28 @@
6
6
  import { createElement, on, makeDraggable } from '../core/dom.js';
7
7
  import { BaseDialog } from './BaseDialog.js';
8
8
 
9
- // ---------------------------------------------------------------------------
10
- // Emoji catalogue
11
- // ---------------------------------------------------------------------------
12
-
13
- const EMOJI_CATS = [
14
- { id: 'smileys', label: 'Smileys' },
15
- { id: 'people', label: 'People' },
16
- { id: 'animals', label: 'Animals' },
17
- { id: 'food', label: 'Food' },
18
- { id: 'travel', label: 'Travel' },
19
- { id: 'objects', label: 'Objects' },
20
- { id: 'symbols', label: 'Symbols' },
21
- ];
22
-
23
- // [emoji_char, search_keywords, category]
24
- const EMOJI_LIST = [
25
- // Smileys & Emotions
26
- ['๐Ÿ˜€', 'grin smile happy face', 'smileys'],
27
- ['๐Ÿ˜ƒ', 'happy smile big eyes', 'smileys'],
28
- ['๐Ÿ˜„', 'grinning smile laugh', 'smileys'],
29
- ['๐Ÿ˜', 'beaming smile grin', 'smileys'],
30
- ['๐Ÿ˜†', 'laughing lol', 'smileys'],
31
- ['๐Ÿ˜…', 'sweat grin awkward', 'smileys'],
32
- ['๐Ÿคฃ', 'rolling laugh rofl', 'smileys'],
33
- ['๐Ÿ˜‚', 'tears laugh cry joy', 'smileys'],
34
- ['๐Ÿ™‚', 'slight smile', 'smileys'],
35
- ['๐Ÿ™ƒ', 'upside down smile', 'smileys'],
36
- ['๐Ÿ˜‰', 'wink', 'smileys'],
37
- ['๐Ÿ˜Š', 'blush smile happy', 'smileys'],
38
- ['๐Ÿ˜‡', 'innocent halo angel', 'smileys'],
39
- ['๐Ÿฅฐ', 'hearts love adore', 'smileys'],
40
- ['๐Ÿ˜', 'heart eyes love', 'smileys'],
41
- ['๐Ÿคฉ', 'star eyes excited wow', 'smileys'],
42
- ['๐Ÿ˜˜', 'kiss blow love', 'smileys'],
43
- ['๐Ÿ˜‹', 'yum delicious tongue', 'smileys'],
44
- ['๐Ÿ˜›', 'tongue stuck out', 'smileys'],
45
- ['๐Ÿ˜œ', 'wink tongue crazy', 'smileys'],
46
- ['๐Ÿคช', 'zany crazy wild', 'smileys'],
47
- ['๐Ÿ˜', 'squint tongue', 'smileys'],
48
- ['๐Ÿค‘', 'money mouth', 'smileys'],
49
- ['๐Ÿค—', 'hugging hug', 'smileys'],
50
- ['๐Ÿค”', 'thinking hmm', 'smileys'],
51
- ['๐Ÿคจ', 'raised eyebrow', 'smileys'],
52
- ['๐Ÿ˜', 'neutral face', 'smileys'],
53
- ['๐Ÿ˜ถ', 'no mouth', 'smileys'],
54
- ['๐Ÿ˜', 'smirk', 'smileys'],
55
- ['๐Ÿ˜’', 'unamused', 'smileys'],
56
- ['๐Ÿ™„', 'roll eyes', 'smileys'],
57
- ['๐Ÿ˜ฌ', 'grimace', 'smileys'],
58
- ['๐Ÿ˜”', 'pensive sad', 'smileys'],
59
- ['๐Ÿ˜ช', 'sleepy tired', 'smileys'],
60
- ['๐Ÿ˜ด', 'sleeping zzz', 'smileys'],
61
- ['๐Ÿคค', 'drool', 'smileys'],
62
- ['๐Ÿ˜ท', 'mask sick', 'smileys'],
63
- ['๐Ÿค’', 'sick thermometer', 'smileys'],
64
- ['๐Ÿค•', 'hurt bandage', 'smileys'],
65
- ['๐Ÿคข', 'nausea sick', 'smileys'],
66
- ['๐Ÿคฎ', 'vomit sick', 'smileys'],
67
- ['๐Ÿคง', 'sneeze cold', 'smileys'],
68
- ['๐Ÿฅต', 'hot sweat', 'smileys'],
69
- ['๐Ÿฅถ', 'cold freeze', 'smileys'],
70
- ['๐Ÿ˜ต', 'dizzy dead', 'smileys'],
71
- ['๐Ÿคฏ', 'mind blown', 'smileys'],
72
- ['๐Ÿค ', 'cowboy hat', 'smileys'],
73
- ['๐Ÿฅณ', 'party celebrate', 'smileys'],
74
- ['๐Ÿ˜Ž', 'cool sunglasses', 'smileys'],
75
- ['๐Ÿค“', 'nerd glasses', 'smileys'],
76
- ['๐Ÿง', 'monocle curious', 'smileys'],
77
- ['๐Ÿ˜•', 'confused', 'smileys'],
78
- ['๐Ÿ˜Ÿ', 'worried', 'smileys'],
79
- ['๐Ÿ™', 'frown sad', 'smileys'],
80
- ['โ˜น๏ธ', 'sad frown', 'smileys'],
81
- ['๐Ÿ˜ฎ', 'surprised open mouth', 'smileys'],
82
- ['๐Ÿ˜ฒ', 'astonished', 'smileys'],
83
- ['๐Ÿฅบ', 'pleading begging puppy eyes', 'smileys'],
84
- ['๐Ÿ˜ข', 'cry sad tear', 'smileys'],
85
- ['๐Ÿ˜ญ', 'sob cry loudly', 'smileys'],
86
- ['๐Ÿ˜ฑ', 'scream horror fear', 'smileys'],
87
- ['๐Ÿ˜ก', 'angry red pouting', 'smileys'],
88
- ['๐Ÿ˜ ', 'angry mad', 'smileys'],
89
- ['๐Ÿคฌ', 'cursing swear', 'smileys'],
90
- ['๐Ÿ˜ˆ', 'devil evil smile', 'smileys'],
91
- ['๐Ÿ‘ฟ', 'devil angry evil', 'smileys'],
92
- ['๐Ÿ’€', 'skull death', 'smileys'],
93
- ['โ˜ ๏ธ', 'skull crossbones', 'smileys'],
94
- ['๐Ÿ’ฉ', 'poop', 'smileys'],
95
- ['๐Ÿคก', 'clown', 'smileys'],
96
- ['๐Ÿ‘ป', 'ghost boo', 'smileys'],
97
- ['๐Ÿ‘ฝ', 'alien ufo', 'smileys'],
98
- ['๐Ÿค–', 'robot', 'smileys'],
99
-
100
- // People & Body
101
- ['๐Ÿ‘‹', 'wave hello hi hand', 'people'],
102
- ['๐Ÿคš', 'raised back hand', 'people'],
103
- ['โœ‹', 'raised hand stop', 'people'],
104
- ['๐Ÿ––', 'vulcan salute spock', 'people'],
105
- ['๐Ÿ‘Œ', 'ok perfect fine', 'people'],
106
- ['โœŒ๏ธ', 'peace victory fingers', 'people'],
107
- ['๐Ÿคž', 'fingers crossed luck', 'people'],
108
- ['๐ŸคŸ', 'love you gesture', 'people'],
109
- ['๐Ÿค˜', 'sign of horns rock', 'people'],
110
- ['๐Ÿค™', 'call me hand', 'people'],
111
- ['๐Ÿ‘ˆ', 'point left', 'people'],
112
- ['๐Ÿ‘‰', 'point right', 'people'],
113
- ['๐Ÿ‘†', 'point up', 'people'],
114
- ['๐Ÿ‘‡', 'point down', 'people'],
115
- ['โ˜๏ธ', 'index pointing up', 'people'],
116
- ['๐Ÿ‘', 'thumbs up like good', 'people'],
117
- ['๐Ÿ‘Ž', 'thumbs down dislike bad', 'people'],
118
- ['โœŠ', 'raised fist punch', 'people'],
119
- ['๐Ÿ‘Š', 'oncoming fist punch', 'people'],
120
- ['๐Ÿ‘', 'clap applause', 'people'],
121
- ['๐Ÿ™Œ', 'celebrate raise hands', 'people'],
122
- ['๐Ÿค', 'handshake deal', 'people'],
123
- ['๐Ÿ™', 'pray hope please thanks', 'people'],
124
- ['๐Ÿ’…', 'nail polish', 'people'],
125
- ['๐Ÿ’ช', 'flexed bicep strong muscle', 'people'],
126
- ['๐Ÿ‘€', 'eyes look see', 'people'],
127
- ['๐Ÿ‘๏ธ', 'eye', 'people'],
128
- ['๐Ÿ‘…', 'tongue', 'people'],
129
- ['๐Ÿ‘ถ', 'baby', 'people'],
130
- ['๐Ÿง’', 'child', 'people'],
131
- ['๐Ÿ‘ฆ', 'boy', 'people'],
132
- ['๐Ÿ‘ง', 'girl', 'people'],
133
- ['๐Ÿง‘', 'person adult', 'people'],
134
- ['๐Ÿ‘จ', 'man', 'people'],
135
- ['๐Ÿ‘ฉ', 'woman', 'people'],
136
- ['๐Ÿง”', 'beard man', 'people'],
137
- ['๐Ÿง“', 'older person', 'people'],
138
- ['๐Ÿ‘ด', 'old man', 'people'],
139
- ['๐Ÿ‘ต', 'old woman', 'people'],
140
- ['โค๏ธ', 'heart love red', 'people'],
141
- ['๐Ÿงก', 'orange heart love', 'people'],
142
- ['๐Ÿ’›', 'yellow heart love', 'people'],
143
- ['๐Ÿ’š', 'green heart love', 'people'],
144
- ['๐Ÿ’™', 'blue heart love', 'people'],
145
- ['๐Ÿ’œ', 'purple heart love', 'people'],
146
- ['๐Ÿ–ค', 'black heart', 'people'],
147
- ['๐Ÿค', 'white heart', 'people'],
148
- ['๐ŸคŽ', 'brown heart', 'people'],
149
- ['๐Ÿ’”', 'broken heart', 'people'],
150
- ['โฃ๏ธ', 'exclamation heart', 'people'],
151
- ['๐Ÿ’•', 'two hearts love', 'people'],
152
- ['๐Ÿ’ž', 'revolving hearts', 'people'],
153
- ['๐Ÿ’“', 'beating heart', 'people'],
154
- ['๐Ÿ’—', 'growing heart', 'people'],
155
- ['๐Ÿ’–', 'sparkling heart', 'people'],
156
- ['๐Ÿ’˜', 'heart arrow', 'people'],
157
- ['๐Ÿ’', 'heart ribbon', 'people'],
158
- ['๐Ÿ’ฌ', 'speech bubble comment chat', 'people'],
159
- ['๐Ÿ’ญ', 'thought bubble', 'people'],
160
- ['๐Ÿ’ฏ', '100 hundred percent perfect', 'people'],
161
- ['๐Ÿ’ข', 'anger symbol mad', 'people'],
162
- ['๐Ÿ’ค', 'zzz sleep', 'people'],
163
-
164
- // Animals & Nature
165
- ['๐Ÿถ', 'dog puppy', 'animals'],
166
- ['๐Ÿฑ', 'cat kitten', 'animals'],
167
- ['๐Ÿญ', 'mouse', 'animals'],
168
- ['๐Ÿน', 'hamster', 'animals'],
169
- ['๐Ÿฐ', 'rabbit bunny', 'animals'],
170
- ['๐ŸฆŠ', 'fox', 'animals'],
171
- ['๐Ÿป', 'bear', 'animals'],
172
- ['๐Ÿผ', 'panda', 'animals'],
173
- ['๐Ÿจ', 'koala', 'animals'],
174
- ['๐Ÿฏ', 'tiger', 'animals'],
175
- ['๐Ÿฆ', 'lion', 'animals'],
176
- ['๐Ÿฎ', 'cow', 'animals'],
177
- ['๐Ÿท', 'pig', 'animals'],
178
- ['๐Ÿธ', 'frog', 'animals'],
179
- ['๐Ÿต', 'monkey', 'animals'],
180
- ['๐Ÿ™ˆ', 'see no evil monkey', 'animals'],
181
- ['๐Ÿ™‰', 'hear no evil monkey', 'animals'],
182
- ['๐Ÿ™Š', 'speak no evil monkey', 'animals'],
183
- ['๐Ÿ”', 'chicken hen', 'animals'],
184
- ['๐Ÿง', 'penguin', 'animals'],
185
- ['๐Ÿฆ', 'bird', 'animals'],
186
- ['๐Ÿฆ†', 'duck', 'animals'],
187
- ['๐Ÿฆ…', 'eagle', 'animals'],
188
- ['๐Ÿฆ‰', 'owl', 'animals'],
189
- ['๐Ÿฆ‡', 'bat', 'animals'],
190
- ['๐Ÿบ', 'wolf', 'animals'],
191
- ['๐Ÿด', 'horse', 'animals'],
192
- ['๐Ÿฆ„', 'unicorn', 'animals'],
193
- ['๐Ÿ', 'bee', 'animals'],
194
- ['๐Ÿฆ‹', 'butterfly', 'animals'],
195
- ['๐ŸŒ', 'snail', 'animals'],
196
- ['๐Ÿž', 'ladybug', 'animals'],
197
- ['๐Ÿข', 'turtle', 'animals'],
198
- ['๐Ÿ', 'snake', 'animals'],
199
- ['๐ŸฆŽ', 'lizard', 'animals'],
200
- ['๐ŸŠ', 'crocodile', 'animals'],
201
- ['๐ŸŸ', 'fish', 'animals'],
202
- ['๐Ÿ ', 'tropical fish', 'animals'],
203
- ['๐Ÿฆˆ', 'shark', 'animals'],
204
- ['๐Ÿฌ', 'dolphin', 'animals'],
205
- ['๐Ÿณ', 'whale', 'animals'],
206
- ['๐Ÿ™', 'octopus', 'animals'],
207
- ['๐Ÿฆ‘', 'squid', 'animals'],
208
- ['๐Ÿฆ€', 'crab', 'animals'],
209
- ['๐ŸŒธ', 'cherry blossom flower', 'animals'],
210
- ['๐ŸŒบ', 'hibiscus flower', 'animals'],
211
- ['๐ŸŒป', 'sunflower', 'animals'],
212
- ['๐ŸŒน', 'rose flower', 'animals'],
213
- ['๐ŸŒท', 'tulip flower', 'animals'],
214
- ['๐Ÿ€', 'four leaf clover luck', 'animals'],
215
- ['๐ŸŒฟ', 'herb leaf green', 'animals'],
216
- ['๐ŸŒฑ', 'seedling sprout', 'animals'],
217
- ['๐ŸŒฒ', 'evergreen tree pine', 'animals'],
218
- ['๐ŸŒณ', 'deciduous tree', 'animals'],
219
- ['๐ŸŒด', 'palm tree', 'animals'],
220
- ['๐Ÿ„', 'mushroom', 'animals'],
221
- ['๐ŸŒพ', 'sheaf wheat', 'animals'],
222
- ['๐Ÿพ', 'paw prints animal', 'animals'],
223
-
224
- // Food & Drink
225
- ['๐ŸŽ', 'apple red', 'food'],
226
- ['๐ŸŠ', 'orange tangerine', 'food'],
227
- ['๐Ÿ‹', 'lemon yellow', 'food'],
228
- ['๐Ÿ‡', 'grapes', 'food'],
229
- ['๐Ÿ“', 'strawberry', 'food'],
230
- ['๐Ÿซ', 'blueberry', 'food'],
231
- ['๐Ÿ’', 'cherry', 'food'],
232
- ['๐Ÿ‘', 'peach', 'food'],
233
- ['๐Ÿฅญ', 'mango', 'food'],
234
- ['๐Ÿ', 'pineapple', 'food'],
235
- ['๐Ÿฅฅ', 'coconut', 'food'],
236
- ['๐Ÿฅ', 'kiwi', 'food'],
237
- ['๐Ÿ…', 'tomato', 'food'],
238
- ['๐Ÿฅ‘', 'avocado', 'food'],
239
- ['๐Ÿ†', 'eggplant aubergine', 'food'],
240
- ['๐Ÿฅ•', 'carrot', 'food'],
241
- ['๐ŸŒฝ', 'corn', 'food'],
242
- ['๐Ÿฅฆ', 'broccoli', 'food'],
243
- ['๐Ÿฅฌ', 'leafy green', 'food'],
244
- ['๐Ÿง„', 'garlic', 'food'],
245
- ['๐Ÿฅœ', 'peanut nut', 'food'],
246
- ['๐Ÿž', 'bread loaf', 'food'],
247
- ['๐Ÿฅ', 'croissant', 'food'],
248
- ['๐Ÿง€', 'cheese', 'food'],
249
- ['๐Ÿณ', 'egg fry cooking', 'food'],
250
- ['๐Ÿฅš', 'egg', 'food'],
251
- ['๐Ÿฅž', 'pancake', 'food'],
252
- ['๐Ÿง‡', 'waffle', 'food'],
253
- ['๐Ÿฅ“', 'bacon', 'food'],
254
- ['๐Ÿฅฉ', 'meat steak', 'food'],
255
- ['๐Ÿ—', 'chicken leg', 'food'],
256
- ['๐ŸŒญ', 'hotdog', 'food'],
257
- ['๐Ÿ”', 'burger hamburger', 'food'],
258
- ['๐ŸŸ', 'fries french', 'food'],
259
- ['๐Ÿ•', 'pizza', 'food'],
260
- ['๐ŸŒฎ', 'taco', 'food'],
261
- ['๐ŸŒฏ', 'burrito wrap', 'food'],
262
- ['๐Ÿœ', 'noodles ramen', 'food'],
263
- ['๐Ÿ', 'spaghetti pasta', 'food'],
264
- ['๐Ÿฃ', 'sushi', 'food'],
265
- ['๐Ÿฑ', 'bento box', 'food'],
266
- ['๐Ÿฆ', 'ice cream soft serve', 'food'],
267
- ['๐Ÿฉ', 'donut', 'food'],
268
- ['๐Ÿช', 'cookie', 'food'],
269
- ['๐ŸŽ‚', 'birthday cake', 'food'],
270
- ['๐Ÿฐ', 'cake slice', 'food'],
271
- ['๐Ÿง', 'cupcake', 'food'],
272
- ['๐Ÿซ', 'chocolate', 'food'],
273
- ['๐Ÿฌ', 'candy', 'food'],
274
- ['๐Ÿญ', 'lollipop', 'food'],
275
- ['โ˜•', 'coffee hot', 'food'],
276
- ['๐Ÿต', 'tea hot', 'food'],
277
- ['๐Ÿง‹', 'bubble tea boba', 'food'],
278
- ['๐Ÿฅค', 'cup straw drink', 'food'],
279
- ['๐Ÿท', 'wine red', 'food'],
280
- ['๐Ÿธ', 'cocktail martini', 'food'],
281
- ['๐Ÿบ', 'beer mug', 'food'],
282
- ['๐Ÿป', 'clinking beer mugs', 'food'],
283
- ['๐Ÿฅ‚', 'champagne toast celebrate', 'food'],
284
- ['๐Ÿงƒ', 'juice box', 'food'],
285
- ['๐ŸงŠ', 'ice cube', 'food'],
286
-
287
- // Travel & Places
288
- ['๐Ÿš€', 'rocket space', 'travel'],
289
- ['๐Ÿ›ธ', 'ufo flying saucer', 'travel'],
290
- ['โœˆ๏ธ', 'airplane plane fly', 'travel'],
291
- ['๐Ÿš', 'helicopter', 'travel'],
292
- ['๐Ÿš‚', 'train locomotive', 'travel'],
293
- ['๐Ÿš„', 'bullet train fast', 'travel'],
294
- ['๐Ÿš‡', 'subway metro', 'travel'],
295
- ['๐ŸšŒ', 'bus', 'travel'],
296
- ['๐Ÿš‘', 'ambulance', 'travel'],
297
- ['๐Ÿš’', 'fire truck', 'travel'],
298
- ['๐Ÿš“', 'police car', 'travel'],
299
- ['๐Ÿš•', 'taxi cab', 'travel'],
300
- ['๐Ÿš—', 'car automobile red', 'travel'],
301
- ['๐Ÿš™', 'suv car', 'travel'],
302
- ['๐Ÿšš', 'truck delivery', 'travel'],
303
- ['๐Ÿšœ', 'tractor farm', 'travel'],
304
- ['๐ŸŽ๏ธ', 'racing car fast', 'travel'],
305
- ['๐Ÿ๏ธ', 'motorcycle', 'travel'],
306
- ['๐Ÿšฒ', 'bicycle bike', 'travel'],
307
- ['๐Ÿ›ด', 'scooter kick', 'travel'],
308
- ['โ›ต', 'sailboat boat', 'travel'],
309
- ['๐Ÿšข', 'ship cruise', 'travel'],
310
- ['๐Ÿ ', 'house home', 'travel'],
311
- ['๐Ÿข', 'office building', 'travel'],
312
- ['๐Ÿฅ', 'hospital', 'travel'],
313
- ['๐Ÿฆ', 'bank', 'travel'],
314
- ['๐Ÿช', 'store shop convenience', 'travel'],
315
- ['๐Ÿซ', 'school', 'travel'],
316
- ['๐Ÿฐ', 'castle european', 'travel'],
317
- ['๐Ÿฏ', 'japanese castle', 'travel'],
318
- ['๐Ÿ—ผ', 'tokyo tower', 'travel'],
319
- ['๐Ÿ—ฝ', 'statue liberty new york', 'travel'],
320
- ['โ›ช', 'church', 'travel'],
321
- ['๐Ÿ•Œ', 'mosque', 'travel'],
322
- ['โ›ฉ๏ธ', 'shinto shrine', 'travel'],
323
- ['โ›ฒ', 'fountain', 'travel'],
324
- ['โ›บ', 'tent camping', 'travel'],
325
- ['๐ŸŒ', 'fog foggy bridge', 'travel'],
326
- ['๐ŸŒƒ', 'night city stars', 'travel'],
327
- ['๐Ÿ™๏ธ', 'cityscape city buildings', 'travel'],
328
- ['๐ŸŒ…', 'sunrise morning', 'travel'],
329
- ['๐ŸŒˆ', 'rainbow colorful', 'travel'],
330
- ['โ›ฐ๏ธ', 'mountain', 'travel'],
331
- ['๐Ÿ”๏ธ', 'snow mountain', 'travel'],
332
- ['๐Ÿ—ป', 'mount fuji', 'travel'],
333
- ['๐Ÿ•๏ธ', 'camping tent', 'travel'],
334
- ['๐Ÿ—บ๏ธ', 'world map', 'travel'],
335
- ['๐Ÿงญ', 'compass navigation', 'travel'],
336
- ['๐ŸŒ', 'earth europe africa globe', 'travel'],
337
- ['๐ŸŒŽ', 'earth americas globe', 'travel'],
338
- ['๐ŸŒ', 'earth asia globe', 'travel'],
339
- ['๐ŸŒ', 'globe internet web', 'travel'],
340
-
341
- // Objects
342
- ['๐Ÿ’Ž', 'diamond gem jewel', 'objects'],
343
- ['๐Ÿ’', 'ring engagement', 'objects'],
344
- ['๐Ÿ‘‘', 'crown royal king queen', 'objects'],
345
- ['๐ŸŽฉ', 'top hat magic', 'objects'],
346
- ['๐Ÿ’ผ', 'briefcase work business', 'objects'],
347
- ['๐Ÿ‘œ', 'handbag purse', 'objects'],
348
- ['๐ŸŽ’', 'backpack bag school', 'objects'],
349
- ['๐Ÿ‘“', 'glasses eyewear', 'objects'],
350
- ['๐Ÿ•ถ๏ธ', 'sunglasses cool', 'objects'],
351
- ['๐Ÿ’ก', 'light bulb idea', 'objects'],
352
- ['๐Ÿ”ฆ', 'flashlight torch', 'objects'],
353
- ['๐Ÿ•ฏ๏ธ', 'candle light', 'objects'],
354
- ['๐Ÿ”‹', 'battery charge', 'objects'],
355
- ['๐Ÿ’ป', 'laptop computer', 'objects'],
356
- ['๐Ÿ–ฅ๏ธ', 'desktop monitor computer', 'objects'],
357
- ['๐Ÿ“ฑ', 'phone mobile cell', 'objects'],
358
- ['โŒจ๏ธ', 'keyboard type', 'objects'],
359
- ['๐Ÿ–ฑ๏ธ', 'mouse computer click', 'objects'],
360
- ['๐Ÿ“บ', 'television tv', 'objects'],
361
- ['๐Ÿ“ท', 'camera photo', 'objects'],
362
- ['๐Ÿ“น', 'video camera', 'objects'],
363
- ['๐ŸŽฅ', 'movie camera film', 'objects'],
364
- ['โ˜Ž๏ธ', 'telephone phone', 'objects'],
365
- ['โฐ', 'alarm clock wake', 'objects'],
366
- ['โŒš', 'watch time', 'objects'],
367
- ['๐Ÿ”‘', 'key', 'objects'],
368
- ['๐Ÿ—๏ธ', 'old key', 'objects'],
369
- ['๐Ÿ”’', 'lock closed', 'objects'],
370
- ['๐Ÿ”“', 'unlock open', 'objects'],
371
- ['๐Ÿ”จ', 'hammer tool', 'objects'],
372
- ['๐Ÿ”ง', 'wrench tool', 'objects'],
373
- ['๐Ÿ”ฉ', 'bolt nut', 'objects'],
374
- ['โš™๏ธ', 'gear setting', 'objects'],
375
- ['๐Ÿงฒ', 'magnet attract', 'objects'],
376
- ['๐Ÿ“š', 'books stack library', 'objects'],
377
- ['๐Ÿ“–', 'book open read', 'objects'],
378
- ['๐Ÿ“', 'memo write note', 'objects'],
379
- ['โœ๏ธ', 'pencil write edit', 'objects'],
380
- ['๐Ÿ“Œ', 'pushpin tack', 'objects'],
381
- ['๐Ÿ“Ž', 'paperclip attach', 'objects'],
382
- ['๐Ÿ“Š', 'bar chart graph', 'objects'],
383
- ['๐Ÿ“ˆ', 'chart up growth trend', 'objects'],
384
- ['๐Ÿ“‰', 'chart down loss decline', 'objects'],
385
- ['๐Ÿ“…', 'calendar date', 'objects'],
386
- ['๐Ÿ“ฆ', 'package box', 'objects'],
387
- ['๐Ÿ“ซ', 'mailbox closed', 'objects'],
388
- ['๐Ÿ“ง', 'email envelope', 'objects'],
389
- ['๐ŸŽ', 'gift present', 'objects'],
390
- ['๐ŸŽ€', 'ribbon bow', 'objects'],
391
- ['๐ŸŽ‰', 'party celebrate confetti', 'objects'],
392
- ['๐ŸŽŠ', 'confetti celebrate', 'objects'],
393
- ['๐Ÿ”ฎ', 'crystal ball magic fortune', 'objects'],
394
- ['๐Ÿช„', 'magic wand', 'objects'],
395
- ['๐ŸŽฏ', 'target bullseye dart', 'objects'],
396
- ['๐ŸŽฒ', 'dice game board', 'objects'],
397
- ['๐ŸŽฎ', 'video game controller', 'objects'],
398
- ['๐ŸŽญ', 'theater masks drama', 'objects'],
399
- ['๐ŸŽจ', 'art palette paint', 'objects'],
400
- ['๐ŸŽฌ', 'clapper film movie', 'objects'],
401
- ['๐ŸŽค', 'microphone sing karaoke', 'objects'],
402
- ['๐ŸŽง', 'headphones music listen', 'objects'],
403
- ['๐ŸŽต', 'music note', 'objects'],
404
- ['๐ŸŽถ', 'music notes', 'objects'],
405
- ['๐ŸŽธ', 'guitar electric', 'objects'],
406
- ['๐ŸŽน', 'piano keyboard music', 'objects'],
407
- ['๐Ÿฅ', 'drum percussion', 'objects'],
408
- ['๐ŸŽท', 'saxophone jazz', 'objects'],
409
- ['๐ŸŽบ', 'trumpet', 'objects'],
410
- ['๐ŸŽป', 'violin', 'objects'],
411
- ['โšฝ', 'soccer ball football', 'objects'],
412
- ['๐Ÿ€', 'basketball', 'objects'],
413
- ['๐Ÿˆ', 'american football', 'objects'],
414
- ['โšพ', 'baseball', 'objects'],
415
- ['๐ŸŽพ', 'tennis', 'objects'],
416
- ['๐Ÿ', 'volleyball', 'objects'],
417
- ['๐Ÿ†', 'trophy winner award', 'objects'],
418
- ['๐Ÿฅ‡', 'gold medal first', 'objects'],
419
- ['๐Ÿ…', 'sports medal', 'objects'],
9
+ /**
10
+ * Resolved emoji catalogue, shared by every editor instance on the page.
11
+ * @type {{ EMOJI_CATS: Array, EMOJI_LIST: Array }|null}
12
+ */
13
+ let _emojiData = null;
14
+ /** @type {Promise<{ EMOJI_CATS: Array, EMOJI_LIST: Array }>|null} */
15
+ let _emojiDataPromise = null;
420
16
 
421
- // Symbols
422
- ['โœ…', 'check green done success', 'symbols'],
423
- ['โŒ', 'cross x no cancel', 'symbols'],
424
- ['โญ•', 'circle red', 'symbols'],
425
- ['โ›”', 'no entry stop', 'symbols'],
426
- ['๐Ÿšซ', 'prohibited no banned', 'symbols'],
427
- ['โš ๏ธ', 'warning caution danger', 'symbols'],
428
- ['โ—', 'exclamation red important', 'symbols'],
429
- ['โ“', 'question mark', 'symbols'],
430
- ['โ€ผ๏ธ', 'double exclamation', 'symbols'],
431
- ['๐Ÿ’ฏ', '100 hundred percent perfect', 'symbols'],
432
- ['๐Ÿ”ด', 'red circle dot', 'symbols'],
433
- ['๐ŸŸ ', 'orange circle', 'symbols'],
434
- ['๐ŸŸก', 'yellow circle', 'symbols'],
435
- ['๐ŸŸข', 'green circle', 'symbols'],
436
- ['๐Ÿ”ต', 'blue circle', 'symbols'],
437
- ['๐ŸŸฃ', 'purple circle', 'symbols'],
438
- ['โšซ', 'black circle', 'symbols'],
439
- ['โšช', 'white circle', 'symbols'],
440
- ['๐ŸŸค', 'brown circle', 'symbols'],
441
- ['๐Ÿ”บ', 'red triangle up', 'symbols'],
442
- ['๐Ÿ”ป', 'red triangle down', 'symbols'],
443
- ['๐Ÿ”ท', 'blue diamond large', 'symbols'],
444
- ['๐Ÿ”ถ', 'orange diamond large', 'symbols'],
445
- ['๐Ÿ”น', 'blue diamond small', 'symbols'],
446
- ['๐Ÿ”ธ', 'orange diamond small', 'symbols'],
447
- ['โญ', 'star yellow', 'symbols'],
448
- ['๐ŸŒŸ', 'glowing star shine', 'symbols'],
449
- ['โœจ', 'sparkles shine', 'symbols'],
450
- ['๐Ÿ’ซ', 'dizzy star spin', 'symbols'],
451
- ['โšก', 'lightning bolt energy power', 'symbols'],
452
- ['๐Ÿ”ฅ', 'fire hot flame', 'symbols'],
453
- ['๐Ÿ’ฅ', 'explosion boom', 'symbols'],
454
- ['โ„๏ธ', 'snowflake cold ice winter', 'symbols'],
455
- ['๐ŸŒŠ', 'wave water ocean sea', 'symbols'],
456
- ['๐Ÿ’จ', 'wind blow dash', 'symbols'],
457
- ['๐ŸŒ€', 'cyclone tornado spiral', 'symbols'],
458
- ['โ™ป๏ธ', 'recycle loop green', 'symbols'],
459
- ['โœ”๏ธ', 'check tick done', 'symbols'],
460
- ['โž•', 'plus add', 'symbols'],
461
- ['โž–', 'minus subtract', 'symbols'],
462
- ['โž—', 'divide division', 'symbols'],
463
- ['โœ–๏ธ', 'multiply times cross', 'symbols'],
464
- ['โ–ถ๏ธ', 'play button right', 'symbols'],
465
- ['โธ๏ธ', 'pause', 'symbols'],
466
- ['โน๏ธ', 'stop square', 'symbols'],
467
- ['โฉ', 'fast forward', 'symbols'],
468
- ['โช', 'rewind fast backward', 'symbols'],
469
- ['๐Ÿ””', 'bell notification', 'symbols'],
470
- ['๐Ÿ”•', 'bell slash mute', 'symbols'],
471
- ['๐Ÿ”Š', 'speaker volume high', 'symbols'],
472
- ['๐Ÿ”‡', 'mute silent no sound', 'symbols'],
473
- ['๐Ÿ“ข', 'loudspeaker announcement', 'symbols'],
474
- ['๐Ÿ“ฃ', 'megaphone cheer', 'symbols'],
475
- ['๐Ÿณ๏ธ', 'white flag', 'symbols'],
476
- ['๐Ÿด', 'black flag', 'symbols'],
477
- ['๐Ÿšฉ', 'red flag', 'symbols'],
478
- ['๐Ÿ', 'checkered flag finish race', 'symbols'],
479
- ['๐Ÿ†•', 'new badge', 'symbols'],
480
- ['๐Ÿ†“', 'free badge', 'symbols'],
481
- ['๐Ÿ†’', 'cool badge', 'symbols'],
482
- ['๐Ÿ”', 'top arrow', 'symbols'],
483
- ['๐Ÿ”™', 'back arrow', 'symbols'],
484
- ['โ„น๏ธ', 'information info', 'symbols'],
485
- ['๐Ÿ“', 'pin location map', 'symbols'],
486
- ['๐Ÿ”—', 'link chain', 'symbols'],
487
- ['ยฉ๏ธ', 'copyright', 'symbols'],
488
- ['ยฎ๏ธ', 'registered trademark', 'symbols'],
489
- ['โ„ข๏ธ', 'trademark', 'symbols'],
490
- ['#๏ธโƒฃ', 'hash number', 'symbols'],
491
- ['0๏ธโƒฃ', 'zero number', 'symbols'],
492
- ['1๏ธโƒฃ', 'one number', 'symbols'],
493
- ['2๏ธโƒฃ', 'two number', 'symbols'],
494
- ['3๏ธโƒฃ', 'three number', 'symbols'],
495
- ['4๏ธโƒฃ', 'four number', 'symbols'],
496
- ['5๏ธโƒฃ', 'five number', 'symbols'],
497
- ];
17
+ /**
18
+ * Loads the emoji catalogue on first use. The table is ~25 KB (โ‰ˆ6 KB gzip),
19
+ * so it is split into its own chunk rather than shipped to every consumer โ€”
20
+ * including those whose toolbar never shows an emoji button.
21
+ * @returns {Promise<{ EMOJI_CATS: Array, EMOJI_LIST: Array }>}
22
+ */
23
+ function loadEmojiData() {
24
+ if (_emojiData) return Promise.resolve(_emojiData);
25
+ _emojiDataPromise ??= import('./emoji-data.js').then((mod) => {
26
+ _emojiData = { EMOJI_CATS: mod.EMOJI_CATS, EMOJI_LIST: mod.EMOJI_LIST };
27
+ return _emojiData;
28
+ });
29
+ return _emojiDataPromise;
30
+ }
498
31
 
499
32
  // ---------------------------------------------------------------------------
500
33
  // Dialog class
@@ -516,12 +49,26 @@ export class EmojiDialog extends BaseDialog {
516
49
  // Public API
517
50
  // ---------------------------------------------------------------------------
518
51
 
519
- show() {
52
+ /**
53
+ * Opens the picker, fetching the emoji catalogue chunk on first call.
54
+ * Awaiting is optional โ€” the dialog opens on its own once data arrives.
55
+ * @returns {Promise<void>}
56
+ */
57
+ async show() {
58
+ // Capture the caret before awaiting: the selection must be read while the
59
+ // click that opened the dialog is still the current interaction.
60
+ this._saveRange();
61
+
520
62
  if (!this._dialog) {
521
- this._dialog = this._buildDialog();
522
- document.body.appendChild(this._dialog);
63
+ const { EMOJI_CATS, EMOJI_LIST } = await loadEmojiData();
64
+ // A second show() may have won the race while this one awaited.
65
+ if (!this._dialog) {
66
+ this._cats = EMOJI_CATS;
67
+ this._list = EMOJI_LIST;
68
+ this._dialog = this._buildDialog();
69
+ document.body.appendChild(this._dialog);
70
+ }
523
71
  }
524
- this._saveRange();
525
72
  this._activeCat = 'all';
526
73
  this._searchInput.value = '';
527
74
  this._updateCatTabs();
@@ -569,7 +116,7 @@ export class EmojiDialog extends BaseDialog {
569
116
  const allTab = createElement('button', { type: 'button', class: 'an-icon-cat active', 'data-cat': 'all' });
570
117
  allTab.textContent = L.all;
571
118
  catBar.appendChild(allTab);
572
- EMOJI_CATS.forEach(({ id, label }) => {
119
+ this._cats.forEach(({ id, label }) => {
573
120
  const tab = createElement('button', { type: 'button', class: 'an-icon-cat', 'data-cat': id });
574
121
  tab.textContent = L.categories?.[id] || label;
575
122
  catBar.appendChild(tab);
@@ -578,7 +125,7 @@ export class EmojiDialog extends BaseDialog {
578
125
 
579
126
  // Emoji grid โ€” one button per emoji, click = immediate insert
580
127
  const grid = createElement('div', { class: 'an-emoji-grid' });
581
- EMOJI_LIST.forEach(([char, keywords, cat]) => {
128
+ this._list.forEach(([char, keywords, cat]) => {
582
129
  const cell = createElement('button', {
583
130
  type: 'button',
584
131
  class: 'an-emoji-cell',
@@ -13,7 +13,11 @@ export class ImageDialog extends BaseDialog {
13
13
  // Public API
14
14
  // ---------------------------------------------------------------------------
15
15
 
16
- show() {
16
+ /**
17
+ * @param {{ beforeInsert?: () => void }} [hooks]
18
+ */
19
+ show({ beforeInsert } = {}) {
20
+ this._beforeInsert = typeof beforeInsert === 'function' ? beforeInsert : null;
17
21
  this._saveRange();
18
22
  this._urlInput.value = '';
19
23
  this._altInput.value = '';
@@ -137,11 +141,23 @@ export class ImageDialog extends BaseDialog {
137
141
  return;
138
142
  }
139
143
 
140
- const reader = new FileReader();
141
- reader.onload = (e) => {
142
- this._urlInput.value = /** @type {string} */ (e.target.result);
143
- };
144
- reader.readAsDataURL(file);
144
+ // Resize/compress via Clipboard's shared canvas pipeline so a file chosen
145
+ // through this dialog gets the same treatment as a pasted/dropped image
146
+ // instead of embedding the original (potentially multi-MB) file untouched.
147
+ this.context.invoke('clipboard.compressAndRegister', file).then((blobUrl) => {
148
+ if (this.context._alive === false) return;
149
+ this._urlInput.value = blobUrl;
150
+ }).catch((err) => {
151
+ if (this.context._alive === false) return;
152
+ // Compression failed (e.g. canvas unavailable) โ€” fall back to embedding
153
+ // the original file directly.
154
+ console.warn('[AutumnNote] ImageDialog: image compression failed, using original file.', err);
155
+ const reader = new FileReader();
156
+ reader.onload = (e) => {
157
+ this._urlInput.value = /** @type {string} */ (e.target.result);
158
+ };
159
+ reader.readAsDataURL(file);
160
+ });
145
161
  }
146
162
 
147
163
  _onInsert() {
@@ -159,7 +175,19 @@ export class ImageDialog extends BaseDialog {
159
175
  this._savedRange.select();
160
176
  }
161
177
 
178
+ // Let callers make a deferred DOM change only after the user commits the
179
+ // dialog. SlashMenu uses this to keep "/image" intact when the dialog is
180
+ // cancelled and remove it atomically immediately before image insertion.
181
+ const beforeInsert = this._beforeInsert;
182
+ this._beforeInsert = null;
183
+ beforeInsert?.();
184
+
162
185
  this.context.invoke('editor.insertImage', src, alt, align);
163
186
  this._close();
164
187
  }
188
+
189
+ _close() {
190
+ this._beforeInsert = null;
191
+ super._close();
192
+ }
165
193
  }