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.
- package/README.md +53 -2
- package/dist/autumnnote.cjs +21 -21
- package/dist/autumnnote.css +1 -1
- package/dist/autumnnote.es.js +1470 -5884
- package/dist/autumnnote.es.js.map +1 -1
- package/dist/autumnnote.min.js +61 -0
- package/dist/autumnnote.umd.js +21 -21
- package/dist/autumnnote.umd.js.map +1 -1
- package/dist/emoji-data-BDQX5kh-.js +2331 -0
- package/dist/emoji-data-BDQX5kh-.js.map +1 -0
- package/package.json +9 -5
- package/src/js/Context.js +216 -17
- package/src/js/editing/History.js +38 -6
- package/src/js/i18n/all.js +27 -0
- package/src/js/i18n/de.js +15 -0
- package/src/js/i18n/en.js +15 -0
- package/src/js/i18n/es.js +15 -0
- package/src/js/i18n/fr.js +15 -0
- package/src/js/i18n/index.js +45 -19
- package/src/js/i18n/ja.js +15 -0
- package/src/js/i18n/ko.js +15 -0
- package/src/js/i18n/vi.js +15 -0
- package/src/js/i18n/zh.js +15 -0
- package/src/js/index.js +24 -2
- package/src/js/index.umd.js +5 -0
- package/src/js/module/BaseMediaTooltip.js +142 -0
- package/src/js/module/BaseResizer.js +312 -0
- package/src/js/module/Clipboard.js +20 -6
- package/src/js/module/Editor.js +15 -1
- package/src/js/module/EmojiDialog.js +41 -494
- package/src/js/module/ImageDialog.js +34 -6
- package/src/js/module/ImageResizer.js +23 -241
- package/src/js/module/ImageTooltip.js +16 -111
- package/src/js/module/MarkdownShortcuts.js +2 -2
- package/src/js/module/SlashMenu.js +376 -0
- package/src/js/module/Statusbar.js +3 -9
- package/src/js/module/VideoResizer.js +38 -239
- package/src/js/module/VideoTooltip.js +27 -114
- package/src/js/module/emoji-data.js +496 -0
- package/src/js/settings.js +27 -0
- package/src/styles/autumnnote.scss +49 -0
- package/types/i18n/all.d.ts +14 -0
- package/types/i18n/de.d.ts +4 -0
- package/types/i18n/en.d.ts +4 -0
- package/types/i18n/es.d.ts +4 -0
- package/types/i18n/fr.d.ts +4 -0
- package/types/i18n/ja.d.ts +4 -0
- package/types/i18n/ko.d.ts +4 -0
- package/types/i18n/vi.d.ts +4 -0
- package/types/i18n/zh.d.ts +4 -0
- 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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
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
|
-
|
|
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
|
-
|
|
522
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
}
|