autumnnote 2.0.0 → 2.2.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 (64) hide show
  1. package/README.md +72 -5
  2. package/dist/autumnnote.cjs +20 -20
  3. package/dist/autumnnote.css +1 -1
  4. package/dist/autumnnote.es.js +661 -798
  5. package/dist/autumnnote.es.js.map +1 -1
  6. package/dist/autumnnote.min.js +20 -20
  7. package/dist/autumnnote.umd.js +20 -20
  8. package/dist/autumnnote.umd.js.map +1 -1
  9. package/dist/icon-data-V0Xqv-wX.js +255 -0
  10. package/dist/icon-data-V0Xqv-wX.js.map +1 -0
  11. package/package.json +13 -4
  12. package/types/index.d.ts +8 -0
  13. package/src/js/Context.js +0 -854
  14. package/src/js/core/detectLang.js +0 -98
  15. package/src/js/core/dom.js +0 -372
  16. package/src/js/core/env.js +0 -25
  17. package/src/js/core/key.js +0 -66
  18. package/src/js/core/lists.js +0 -121
  19. package/src/js/core/markdown.js +0 -695
  20. package/src/js/core/range.js +0 -194
  21. package/src/js/core/sanitise.js +0 -231
  22. package/src/js/editing/History.js +0 -266
  23. package/src/js/editing/Style.js +0 -812
  24. package/src/js/editing/Table.js +0 -105
  25. package/src/js/editing/Typing.js +0 -397
  26. package/src/js/index.js +0 -193
  27. package/src/js/index.umd.js +0 -17
  28. package/src/js/module/AutoSaveRestore.js +0 -125
  29. package/src/js/module/BaseDialog.js +0 -133
  30. package/src/js/module/BaseMediaTooltip.js +0 -142
  31. package/src/js/module/BaseResizer.js +0 -312
  32. package/src/js/module/BubbleToolbar.js +0 -483
  33. package/src/js/module/Buttons.js +0 -399
  34. package/src/js/module/Clipboard.js +0 -579
  35. package/src/js/module/CodeTooltip.js +0 -493
  36. package/src/js/module/Codeview.js +0 -125
  37. package/src/js/module/ContextMenu.js +0 -621
  38. package/src/js/module/Editor.js +0 -747
  39. package/src/js/module/EmojiDialog.js +0 -254
  40. package/src/js/module/FindReplace.js +0 -512
  41. package/src/js/module/Fullscreen.js +0 -80
  42. package/src/js/module/IconDialog.js +0 -618
  43. package/src/js/module/ImageCropOverlay.js +0 -586
  44. package/src/js/module/ImageDialog.js +0 -193
  45. package/src/js/module/ImageResizer.js +0 -42
  46. package/src/js/module/ImageTooltip.js +0 -285
  47. package/src/js/module/LinkDialog.js +0 -145
  48. package/src/js/module/LinkTooltip.js +0 -250
  49. package/src/js/module/MarkdownShortcuts.js +0 -250
  50. package/src/js/module/Mention.js +0 -365
  51. package/src/js/module/Placeholder.js +0 -51
  52. package/src/js/module/ShortcutsDialog.js +0 -111
  53. package/src/js/module/SlashMenu.js +0 -376
  54. package/src/js/module/Statusbar.js +0 -246
  55. package/src/js/module/TableTooltip.js +0 -1521
  56. package/src/js/module/Toolbar.js +0 -750
  57. package/src/js/module/VideoDialog.js +0 -193
  58. package/src/js/module/VideoResizer.js +0 -66
  59. package/src/js/module/VideoTooltip.js +0 -248
  60. package/src/js/module/emoji-data.js +0 -496
  61. package/src/js/renderer.js +0 -120
  62. package/src/js/settings.js +0 -214
  63. package/src/styles/_variables.scss +0 -48
  64. package/src/styles/autumnnote.scss +0 -2866
@@ -1,496 +0,0 @@
1
- /**
2
- * emoji-data.js — Emoji catalogue for EmojiDialog.
3
- *
4
- * Kept in its own module and pulled in with a dynamic import so the ~25 KB
5
- * table (≈6 KB gzip) becomes a separate chunk instead of riding along in the
6
- * main bundle for every consumer, including those whose toolbar has no emoji
7
- * button. The UMD/CDN build inlines it again, since script tags cannot fetch
8
- * chunks.
9
- */
10
-
11
- export const EMOJI_CATS = [
12
- { id: 'smileys', label: 'Smileys' },
13
- { id: 'people', label: 'People' },
14
- { id: 'animals', label: 'Animals' },
15
- { id: 'food', label: 'Food' },
16
- { id: 'travel', label: 'Travel' },
17
- { id: 'objects', label: 'Objects' },
18
- { id: 'symbols', label: 'Symbols' },
19
- ];
20
-
21
- // [emoji_char, search_keywords, category]
22
- export const EMOJI_LIST = [
23
- // Smileys & Emotions
24
- ['😀', 'grin smile happy face', 'smileys'],
25
- ['😃', 'happy smile big eyes', 'smileys'],
26
- ['😄', 'grinning smile laugh', 'smileys'],
27
- ['😁', 'beaming smile grin', 'smileys'],
28
- ['😆', 'laughing lol', 'smileys'],
29
- ['😅', 'sweat grin awkward', 'smileys'],
30
- ['🤣', 'rolling laugh rofl', 'smileys'],
31
- ['😂', 'tears laugh cry joy', 'smileys'],
32
- ['🙂', 'slight smile', 'smileys'],
33
- ['🙃', 'upside down smile', 'smileys'],
34
- ['😉', 'wink', 'smileys'],
35
- ['😊', 'blush smile happy', 'smileys'],
36
- ['😇', 'innocent halo angel', 'smileys'],
37
- ['🥰', 'hearts love adore', 'smileys'],
38
- ['😍', 'heart eyes love', 'smileys'],
39
- ['🤩', 'star eyes excited wow', 'smileys'],
40
- ['😘', 'kiss blow love', 'smileys'],
41
- ['😋', 'yum delicious tongue', 'smileys'],
42
- ['😛', 'tongue stuck out', 'smileys'],
43
- ['😜', 'wink tongue crazy', 'smileys'],
44
- ['🤪', 'zany crazy wild', 'smileys'],
45
- ['😝', 'squint tongue', 'smileys'],
46
- ['🤑', 'money mouth', 'smileys'],
47
- ['🤗', 'hugging hug', 'smileys'],
48
- ['🤔', 'thinking hmm', 'smileys'],
49
- ['🤨', 'raised eyebrow', 'smileys'],
50
- ['😐', 'neutral face', 'smileys'],
51
- ['😶', 'no mouth', 'smileys'],
52
- ['😏', 'smirk', 'smileys'],
53
- ['😒', 'unamused', 'smileys'],
54
- ['🙄', 'roll eyes', 'smileys'],
55
- ['😬', 'grimace', 'smileys'],
56
- ['😔', 'pensive sad', 'smileys'],
57
- ['😪', 'sleepy tired', 'smileys'],
58
- ['😴', 'sleeping zzz', 'smileys'],
59
- ['🤤', 'drool', 'smileys'],
60
- ['😷', 'mask sick', 'smileys'],
61
- ['🤒', 'sick thermometer', 'smileys'],
62
- ['🤕', 'hurt bandage', 'smileys'],
63
- ['🤢', 'nausea sick', 'smileys'],
64
- ['🤮', 'vomit sick', 'smileys'],
65
- ['🤧', 'sneeze cold', 'smileys'],
66
- ['🥵', 'hot sweat', 'smileys'],
67
- ['🥶', 'cold freeze', 'smileys'],
68
- ['😵', 'dizzy dead', 'smileys'],
69
- ['🤯', 'mind blown', 'smileys'],
70
- ['🤠', 'cowboy hat', 'smileys'],
71
- ['🥳', 'party celebrate', 'smileys'],
72
- ['😎', 'cool sunglasses', 'smileys'],
73
- ['🤓', 'nerd glasses', 'smileys'],
74
- ['🧐', 'monocle curious', 'smileys'],
75
- ['😕', 'confused', 'smileys'],
76
- ['😟', 'worried', 'smileys'],
77
- ['🙁', 'frown sad', 'smileys'],
78
- ['☹️', 'sad frown', 'smileys'],
79
- ['😮', 'surprised open mouth', 'smileys'],
80
- ['😲', 'astonished', 'smileys'],
81
- ['🥺', 'pleading begging puppy eyes', 'smileys'],
82
- ['😢', 'cry sad tear', 'smileys'],
83
- ['😭', 'sob cry loudly', 'smileys'],
84
- ['😱', 'scream horror fear', 'smileys'],
85
- ['😡', 'angry red pouting', 'smileys'],
86
- ['😠', 'angry mad', 'smileys'],
87
- ['🤬', 'cursing swear', 'smileys'],
88
- ['😈', 'devil evil smile', 'smileys'],
89
- ['👿', 'devil angry evil', 'smileys'],
90
- ['💀', 'skull death', 'smileys'],
91
- ['☠️', 'skull crossbones', 'smileys'],
92
- ['💩', 'poop', 'smileys'],
93
- ['🤡', 'clown', 'smileys'],
94
- ['👻', 'ghost boo', 'smileys'],
95
- ['👽', 'alien ufo', 'smileys'],
96
- ['🤖', 'robot', 'smileys'],
97
-
98
- // People & Body
99
- ['👋', 'wave hello hi hand', 'people'],
100
- ['🤚', 'raised back hand', 'people'],
101
- ['✋', 'raised hand stop', 'people'],
102
- ['🖖', 'vulcan salute spock', 'people'],
103
- ['👌', 'ok perfect fine', 'people'],
104
- ['✌️', 'peace victory fingers', 'people'],
105
- ['🤞', 'fingers crossed luck', 'people'],
106
- ['🤟', 'love you gesture', 'people'],
107
- ['🤘', 'sign of horns rock', 'people'],
108
- ['🤙', 'call me hand', 'people'],
109
- ['👈', 'point left', 'people'],
110
- ['👉', 'point right', 'people'],
111
- ['👆', 'point up', 'people'],
112
- ['👇', 'point down', 'people'],
113
- ['☝️', 'index pointing up', 'people'],
114
- ['👍', 'thumbs up like good', 'people'],
115
- ['👎', 'thumbs down dislike bad', 'people'],
116
- ['✊', 'raised fist punch', 'people'],
117
- ['👊', 'oncoming fist punch', 'people'],
118
- ['👏', 'clap applause', 'people'],
119
- ['🙌', 'celebrate raise hands', 'people'],
120
- ['🤝', 'handshake deal', 'people'],
121
- ['🙏', 'pray hope please thanks', 'people'],
122
- ['💅', 'nail polish', 'people'],
123
- ['💪', 'flexed bicep strong muscle', 'people'],
124
- ['👀', 'eyes look see', 'people'],
125
- ['👁️', 'eye', 'people'],
126
- ['👅', 'tongue', 'people'],
127
- ['👶', 'baby', 'people'],
128
- ['🧒', 'child', 'people'],
129
- ['👦', 'boy', 'people'],
130
- ['👧', 'girl', 'people'],
131
- ['🧑', 'person adult', 'people'],
132
- ['👨', 'man', 'people'],
133
- ['👩', 'woman', 'people'],
134
- ['🧔', 'beard man', 'people'],
135
- ['🧓', 'older person', 'people'],
136
- ['👴', 'old man', 'people'],
137
- ['👵', 'old woman', 'people'],
138
- ['❤️', 'heart love red', 'people'],
139
- ['🧡', 'orange heart love', 'people'],
140
- ['💛', 'yellow heart love', 'people'],
141
- ['💚', 'green heart love', 'people'],
142
- ['💙', 'blue heart love', 'people'],
143
- ['💜', 'purple heart love', 'people'],
144
- ['🖤', 'black heart', 'people'],
145
- ['🤍', 'white heart', 'people'],
146
- ['🤎', 'brown heart', 'people'],
147
- ['💔', 'broken heart', 'people'],
148
- ['❣️', 'exclamation heart', 'people'],
149
- ['💕', 'two hearts love', 'people'],
150
- ['💞', 'revolving hearts', 'people'],
151
- ['💓', 'beating heart', 'people'],
152
- ['💗', 'growing heart', 'people'],
153
- ['💖', 'sparkling heart', 'people'],
154
- ['💘', 'heart arrow', 'people'],
155
- ['💝', 'heart ribbon', 'people'],
156
- ['💬', 'speech bubble comment chat', 'people'],
157
- ['💭', 'thought bubble', 'people'],
158
- ['💯', '100 hundred percent perfect', 'people'],
159
- ['💢', 'anger symbol mad', 'people'],
160
- ['💤', 'zzz sleep', 'people'],
161
-
162
- // Animals & Nature
163
- ['🐶', 'dog puppy', 'animals'],
164
- ['🐱', 'cat kitten', 'animals'],
165
- ['🐭', 'mouse', 'animals'],
166
- ['🐹', 'hamster', 'animals'],
167
- ['🐰', 'rabbit bunny', 'animals'],
168
- ['🦊', 'fox', 'animals'],
169
- ['🐻', 'bear', 'animals'],
170
- ['🐼', 'panda', 'animals'],
171
- ['🐨', 'koala', 'animals'],
172
- ['🐯', 'tiger', 'animals'],
173
- ['🦁', 'lion', 'animals'],
174
- ['🐮', 'cow', 'animals'],
175
- ['🐷', 'pig', 'animals'],
176
- ['🐸', 'frog', 'animals'],
177
- ['🐵', 'monkey', 'animals'],
178
- ['🙈', 'see no evil monkey', 'animals'],
179
- ['🙉', 'hear no evil monkey', 'animals'],
180
- ['🙊', 'speak no evil monkey', 'animals'],
181
- ['🐔', 'chicken hen', 'animals'],
182
- ['🐧', 'penguin', 'animals'],
183
- ['🐦', 'bird', 'animals'],
184
- ['🦆', 'duck', 'animals'],
185
- ['🦅', 'eagle', 'animals'],
186
- ['🦉', 'owl', 'animals'],
187
- ['🦇', 'bat', 'animals'],
188
- ['🐺', 'wolf', 'animals'],
189
- ['🐴', 'horse', 'animals'],
190
- ['🦄', 'unicorn', 'animals'],
191
- ['🐝', 'bee', 'animals'],
192
- ['🦋', 'butterfly', 'animals'],
193
- ['🐌', 'snail', 'animals'],
194
- ['🐞', 'ladybug', 'animals'],
195
- ['🐢', 'turtle', 'animals'],
196
- ['🐍', 'snake', 'animals'],
197
- ['🦎', 'lizard', 'animals'],
198
- ['🐊', 'crocodile', 'animals'],
199
- ['🐟', 'fish', 'animals'],
200
- ['🐠', 'tropical fish', 'animals'],
201
- ['🦈', 'shark', 'animals'],
202
- ['🐬', 'dolphin', 'animals'],
203
- ['🐳', 'whale', 'animals'],
204
- ['🐙', 'octopus', 'animals'],
205
- ['🦑', 'squid', 'animals'],
206
- ['🦀', 'crab', 'animals'],
207
- ['🌸', 'cherry blossom flower', 'animals'],
208
- ['🌺', 'hibiscus flower', 'animals'],
209
- ['🌻', 'sunflower', 'animals'],
210
- ['🌹', 'rose flower', 'animals'],
211
- ['🌷', 'tulip flower', 'animals'],
212
- ['🍀', 'four leaf clover luck', 'animals'],
213
- ['🌿', 'herb leaf green', 'animals'],
214
- ['🌱', 'seedling sprout', 'animals'],
215
- ['🌲', 'evergreen tree pine', 'animals'],
216
- ['🌳', 'deciduous tree', 'animals'],
217
- ['🌴', 'palm tree', 'animals'],
218
- ['🍄', 'mushroom', 'animals'],
219
- ['🌾', 'sheaf wheat', 'animals'],
220
- ['🐾', 'paw prints animal', 'animals'],
221
-
222
- // Food & Drink
223
- ['🍎', 'apple red', 'food'],
224
- ['🍊', 'orange tangerine', 'food'],
225
- ['🍋', 'lemon yellow', 'food'],
226
- ['🍇', 'grapes', 'food'],
227
- ['🍓', 'strawberry', 'food'],
228
- ['🫐', 'blueberry', 'food'],
229
- ['🍒', 'cherry', 'food'],
230
- ['🍑', 'peach', 'food'],
231
- ['🥭', 'mango', 'food'],
232
- ['🍍', 'pineapple', 'food'],
233
- ['🥥', 'coconut', 'food'],
234
- ['🥝', 'kiwi', 'food'],
235
- ['🍅', 'tomato', 'food'],
236
- ['🥑', 'avocado', 'food'],
237
- ['🍆', 'eggplant aubergine', 'food'],
238
- ['🥕', 'carrot', 'food'],
239
- ['🌽', 'corn', 'food'],
240
- ['🥦', 'broccoli', 'food'],
241
- ['🥬', 'leafy green', 'food'],
242
- ['🧄', 'garlic', 'food'],
243
- ['🥜', 'peanut nut', 'food'],
244
- ['🍞', 'bread loaf', 'food'],
245
- ['🥐', 'croissant', 'food'],
246
- ['🧀', 'cheese', 'food'],
247
- ['🍳', 'egg fry cooking', 'food'],
248
- ['🥚', 'egg', 'food'],
249
- ['🥞', 'pancake', 'food'],
250
- ['🧇', 'waffle', 'food'],
251
- ['🥓', 'bacon', 'food'],
252
- ['🥩', 'meat steak', 'food'],
253
- ['🍗', 'chicken leg', 'food'],
254
- ['🌭', 'hotdog', 'food'],
255
- ['🍔', 'burger hamburger', 'food'],
256
- ['🍟', 'fries french', 'food'],
257
- ['🍕', 'pizza', 'food'],
258
- ['🌮', 'taco', 'food'],
259
- ['🌯', 'burrito wrap', 'food'],
260
- ['🍜', 'noodles ramen', 'food'],
261
- ['🍝', 'spaghetti pasta', 'food'],
262
- ['🍣', 'sushi', 'food'],
263
- ['🍱', 'bento box', 'food'],
264
- ['🍦', 'ice cream soft serve', 'food'],
265
- ['🍩', 'donut', 'food'],
266
- ['🍪', 'cookie', 'food'],
267
- ['🎂', 'birthday cake', 'food'],
268
- ['🍰', 'cake slice', 'food'],
269
- ['🧁', 'cupcake', 'food'],
270
- ['🍫', 'chocolate', 'food'],
271
- ['🍬', 'candy', 'food'],
272
- ['🍭', 'lollipop', 'food'],
273
- ['☕', 'coffee hot', 'food'],
274
- ['🍵', 'tea hot', 'food'],
275
- ['🧋', 'bubble tea boba', 'food'],
276
- ['🥤', 'cup straw drink', 'food'],
277
- ['🍷', 'wine red', 'food'],
278
- ['🍸', 'cocktail martini', 'food'],
279
- ['🍺', 'beer mug', 'food'],
280
- ['🍻', 'clinking beer mugs', 'food'],
281
- ['🥂', 'champagne toast celebrate', 'food'],
282
- ['🧃', 'juice box', 'food'],
283
- ['🧊', 'ice cube', 'food'],
284
-
285
- // Travel & Places
286
- ['🚀', 'rocket space', 'travel'],
287
- ['🛸', 'ufo flying saucer', 'travel'],
288
- ['✈️', 'airplane plane fly', 'travel'],
289
- ['🚁', 'helicopter', 'travel'],
290
- ['🚂', 'train locomotive', 'travel'],
291
- ['🚄', 'bullet train fast', 'travel'],
292
- ['🚇', 'subway metro', 'travel'],
293
- ['🚌', 'bus', 'travel'],
294
- ['🚑', 'ambulance', 'travel'],
295
- ['🚒', 'fire truck', 'travel'],
296
- ['🚓', 'police car', 'travel'],
297
- ['🚕', 'taxi cab', 'travel'],
298
- ['🚗', 'car automobile red', 'travel'],
299
- ['🚙', 'suv car', 'travel'],
300
- ['🚚', 'truck delivery', 'travel'],
301
- ['🚜', 'tractor farm', 'travel'],
302
- ['🏎️', 'racing car fast', 'travel'],
303
- ['🏍️', 'motorcycle', 'travel'],
304
- ['🚲', 'bicycle bike', 'travel'],
305
- ['🛴', 'scooter kick', 'travel'],
306
- ['⛵', 'sailboat boat', 'travel'],
307
- ['🚢', 'ship cruise', 'travel'],
308
- ['🏠', 'house home', 'travel'],
309
- ['🏢', 'office building', 'travel'],
310
- ['🏥', 'hospital', 'travel'],
311
- ['🏦', 'bank', 'travel'],
312
- ['🏪', 'store shop convenience', 'travel'],
313
- ['🏫', 'school', 'travel'],
314
- ['🏰', 'castle european', 'travel'],
315
- ['🏯', 'japanese castle', 'travel'],
316
- ['🗼', 'tokyo tower', 'travel'],
317
- ['🗽', 'statue liberty new york', 'travel'],
318
- ['⛪', 'church', 'travel'],
319
- ['🕌', 'mosque', 'travel'],
320
- ['⛩️', 'shinto shrine', 'travel'],
321
- ['⛲', 'fountain', 'travel'],
322
- ['⛺', 'tent camping', 'travel'],
323
- ['🌁', 'fog foggy bridge', 'travel'],
324
- ['🌃', 'night city stars', 'travel'],
325
- ['🏙️', 'cityscape city buildings', 'travel'],
326
- ['🌅', 'sunrise morning', 'travel'],
327
- ['🌈', 'rainbow colorful', 'travel'],
328
- ['⛰️', 'mountain', 'travel'],
329
- ['🏔️', 'snow mountain', 'travel'],
330
- ['🗻', 'mount fuji', 'travel'],
331
- ['🏕️', 'camping tent', 'travel'],
332
- ['🗺️', 'world map', 'travel'],
333
- ['🧭', 'compass navigation', 'travel'],
334
- ['🌍', 'earth europe africa globe', 'travel'],
335
- ['🌎', 'earth americas globe', 'travel'],
336
- ['🌏', 'earth asia globe', 'travel'],
337
- ['🌐', 'globe internet web', 'travel'],
338
-
339
- // Objects
340
- ['💎', 'diamond gem jewel', 'objects'],
341
- ['💍', 'ring engagement', 'objects'],
342
- ['👑', 'crown royal king queen', 'objects'],
343
- ['🎩', 'top hat magic', 'objects'],
344
- ['💼', 'briefcase work business', 'objects'],
345
- ['👜', 'handbag purse', 'objects'],
346
- ['🎒', 'backpack bag school', 'objects'],
347
- ['👓', 'glasses eyewear', 'objects'],
348
- ['🕶️', 'sunglasses cool', 'objects'],
349
- ['💡', 'light bulb idea', 'objects'],
350
- ['🔦', 'flashlight torch', 'objects'],
351
- ['🕯️', 'candle light', 'objects'],
352
- ['🔋', 'battery charge', 'objects'],
353
- ['💻', 'laptop computer', 'objects'],
354
- ['🖥️', 'desktop monitor computer', 'objects'],
355
- ['📱', 'phone mobile cell', 'objects'],
356
- ['⌨️', 'keyboard type', 'objects'],
357
- ['🖱️', 'mouse computer click', 'objects'],
358
- ['📺', 'television tv', 'objects'],
359
- ['📷', 'camera photo', 'objects'],
360
- ['📹', 'video camera', 'objects'],
361
- ['🎥', 'movie camera film', 'objects'],
362
- ['☎️', 'telephone phone', 'objects'],
363
- ['⏰', 'alarm clock wake', 'objects'],
364
- ['⌚', 'watch time', 'objects'],
365
- ['🔑', 'key', 'objects'],
366
- ['🗝️', 'old key', 'objects'],
367
- ['🔒', 'lock closed', 'objects'],
368
- ['🔓', 'unlock open', 'objects'],
369
- ['🔨', 'hammer tool', 'objects'],
370
- ['🔧', 'wrench tool', 'objects'],
371
- ['🔩', 'bolt nut', 'objects'],
372
- ['⚙️', 'gear setting', 'objects'],
373
- ['🧲', 'magnet attract', 'objects'],
374
- ['📚', 'books stack library', 'objects'],
375
- ['📖', 'book open read', 'objects'],
376
- ['📝', 'memo write note', 'objects'],
377
- ['✏️', 'pencil write edit', 'objects'],
378
- ['📌', 'pushpin tack', 'objects'],
379
- ['📎', 'paperclip attach', 'objects'],
380
- ['📊', 'bar chart graph', 'objects'],
381
- ['📈', 'chart up growth trend', 'objects'],
382
- ['📉', 'chart down loss decline', 'objects'],
383
- ['📅', 'calendar date', 'objects'],
384
- ['📦', 'package box', 'objects'],
385
- ['📫', 'mailbox closed', 'objects'],
386
- ['📧', 'email envelope', 'objects'],
387
- ['🎁', 'gift present', 'objects'],
388
- ['🎀', 'ribbon bow', 'objects'],
389
- ['🎉', 'party celebrate confetti', 'objects'],
390
- ['🎊', 'confetti celebrate', 'objects'],
391
- ['🔮', 'crystal ball magic fortune', 'objects'],
392
- ['🪄', 'magic wand', 'objects'],
393
- ['🎯', 'target bullseye dart', 'objects'],
394
- ['🎲', 'dice game board', 'objects'],
395
- ['🎮', 'video game controller', 'objects'],
396
- ['🎭', 'theater masks drama', 'objects'],
397
- ['🎨', 'art palette paint', 'objects'],
398
- ['🎬', 'clapper film movie', 'objects'],
399
- ['🎤', 'microphone sing karaoke', 'objects'],
400
- ['🎧', 'headphones music listen', 'objects'],
401
- ['🎵', 'music note', 'objects'],
402
- ['🎶', 'music notes', 'objects'],
403
- ['🎸', 'guitar electric', 'objects'],
404
- ['🎹', 'piano keyboard music', 'objects'],
405
- ['🥁', 'drum percussion', 'objects'],
406
- ['🎷', 'saxophone jazz', 'objects'],
407
- ['🎺', 'trumpet', 'objects'],
408
- ['🎻', 'violin', 'objects'],
409
- ['⚽', 'soccer ball football', 'objects'],
410
- ['🏀', 'basketball', 'objects'],
411
- ['🏈', 'american football', 'objects'],
412
- ['⚾', 'baseball', 'objects'],
413
- ['🎾', 'tennis', 'objects'],
414
- ['🏐', 'volleyball', 'objects'],
415
- ['🏆', 'trophy winner award', 'objects'],
416
- ['🥇', 'gold medal first', 'objects'],
417
- ['🏅', 'sports medal', 'objects'],
418
-
419
- // Symbols
420
- ['✅', 'check green done success', 'symbols'],
421
- ['❌', 'cross x no cancel', 'symbols'],
422
- ['⭕', 'circle red', 'symbols'],
423
- ['⛔', 'no entry stop', 'symbols'],
424
- ['🚫', 'prohibited no banned', 'symbols'],
425
- ['⚠️', 'warning caution danger', 'symbols'],
426
- ['❗', 'exclamation red important', 'symbols'],
427
- ['❓', 'question mark', 'symbols'],
428
- ['‼️', 'double exclamation', 'symbols'],
429
- ['💯', '100 hundred percent perfect', 'symbols'],
430
- ['🔴', 'red circle dot', 'symbols'],
431
- ['🟠', 'orange circle', 'symbols'],
432
- ['🟡', 'yellow circle', 'symbols'],
433
- ['🟢', 'green circle', 'symbols'],
434
- ['🔵', 'blue circle', 'symbols'],
435
- ['🟣', 'purple circle', 'symbols'],
436
- ['⚫', 'black circle', 'symbols'],
437
- ['⚪', 'white circle', 'symbols'],
438
- ['🟤', 'brown circle', 'symbols'],
439
- ['🔺', 'red triangle up', 'symbols'],
440
- ['🔻', 'red triangle down', 'symbols'],
441
- ['🔷', 'blue diamond large', 'symbols'],
442
- ['🔶', 'orange diamond large', 'symbols'],
443
- ['🔹', 'blue diamond small', 'symbols'],
444
- ['🔸', 'orange diamond small', 'symbols'],
445
- ['⭐', 'star yellow', 'symbols'],
446
- ['🌟', 'glowing star shine', 'symbols'],
447
- ['✨', 'sparkles shine', 'symbols'],
448
- ['💫', 'dizzy star spin', 'symbols'],
449
- ['⚡', 'lightning bolt energy power', 'symbols'],
450
- ['🔥', 'fire hot flame', 'symbols'],
451
- ['💥', 'explosion boom', 'symbols'],
452
- ['❄️', 'snowflake cold ice winter', 'symbols'],
453
- ['🌊', 'wave water ocean sea', 'symbols'],
454
- ['💨', 'wind blow dash', 'symbols'],
455
- ['🌀', 'cyclone tornado spiral', 'symbols'],
456
- ['♻️', 'recycle loop green', 'symbols'],
457
- ['✔️', 'check tick done', 'symbols'],
458
- ['➕', 'plus add', 'symbols'],
459
- ['➖', 'minus subtract', 'symbols'],
460
- ['➗', 'divide division', 'symbols'],
461
- ['✖️', 'multiply times cross', 'symbols'],
462
- ['▶️', 'play button right', 'symbols'],
463
- ['⏸️', 'pause', 'symbols'],
464
- ['⏹️', 'stop square', 'symbols'],
465
- ['⏩', 'fast forward', 'symbols'],
466
- ['⏪', 'rewind fast backward', 'symbols'],
467
- ['🔔', 'bell notification', 'symbols'],
468
- ['🔕', 'bell slash mute', 'symbols'],
469
- ['🔊', 'speaker volume high', 'symbols'],
470
- ['🔇', 'mute silent no sound', 'symbols'],
471
- ['📢', 'loudspeaker announcement', 'symbols'],
472
- ['📣', 'megaphone cheer', 'symbols'],
473
- ['🏳️', 'white flag', 'symbols'],
474
- ['🏴', 'black flag', 'symbols'],
475
- ['🚩', 'red flag', 'symbols'],
476
- ['🏁', 'checkered flag finish race', 'symbols'],
477
- ['🆕', 'new badge', 'symbols'],
478
- ['🆓', 'free badge', 'symbols'],
479
- ['🆒', 'cool badge', 'symbols'],
480
- ['🔝', 'top arrow', 'symbols'],
481
- ['🔙', 'back arrow', 'symbols'],
482
- ['ℹ️', 'information info', 'symbols'],
483
- ['📍', 'pin location map', 'symbols'],
484
- ['🔗', 'link chain', 'symbols'],
485
- ['©️', 'copyright', 'symbols'],
486
- ['®️', 'registered trademark', 'symbols'],
487
- ['™️', 'trademark', 'symbols'],
488
- ['#️⃣', 'hash number', 'symbols'],
489
- ['0️⃣', 'zero number', 'symbols'],
490
- ['1️⃣', 'one number', 'symbols'],
491
- ['2️⃣', 'two number', 'symbols'],
492
- ['3️⃣', 'three number', 'symbols'],
493
- ['4️⃣', 'four number', 'symbols'],
494
- ['5️⃣', 'five number', 'symbols'],
495
- ];
496
-
@@ -1,120 +0,0 @@
1
- /**
2
- * renderer.js - Builds the editor DOM structure
3
- * Inspired by Summernote's renderer.js
4
- */
5
-
6
- import { createElement } from './core/dom.js';
7
- import { sanitiseHTML } from './core/sanitise.js';
8
-
9
- /**
10
- * Renders the editor layout around the original element.
11
- *
12
- * Structure:
13
- * <div class="an-container">
14
- * <div class="an-toolbar">...</div>
15
- * <div class="an-editable" contenteditable="true">...</div>
16
- * <div class="an-statusbar">...</div>
17
- * </div>
18
- *
19
- * @param {HTMLElement} targetEl - the original element to replace/wrap
20
- * @param {import('./settings.js').AsnOptions} options
21
- * @returns {{ container: HTMLElement, editable: HTMLElement }}
22
- */
23
- export function renderLayout(targetEl, options) {
24
- const container = createElement('div', { class: 'an-container' });
25
-
26
- // Editable area
27
- const editable = createElement('div', {
28
- class: 'an-editable',
29
- contenteditable: options.readOnly ? 'false' : 'true',
30
- spellcheck: String(options.spellcheck !== false),
31
- 'aria-multiline': 'true',
32
- 'aria-label': 'Rich text editor',
33
- role: 'textbox',
34
- });
35
-
36
- // Restore auto-saved content when available; fall back to element content
37
- let initialContent = '';
38
- if (options.autoSave && options.autoSaveKey) {
39
- try { initialContent = localStorage.getItem(options.autoSaveKey) || ''; } catch (_) { void _; }
40
- }
41
- if (!initialContent) {
42
- initialContent = targetEl.tagName === 'TEXTAREA'
43
- ? ((/** @type {HTMLTextAreaElement} */ (targetEl)).value || '').trim()
44
- : (targetEl.innerHTML || '').trim();
45
- }
46
- editable.innerHTML = sanitiseHTML(initialContent, { allowIframes: true });
47
-
48
- // Apply default font family so the editable renders in the configured font
49
- const defaultFont = options.defaultFontFamily || options.fontFamilies?.[0];
50
- if (defaultFont) {
51
- editable.style.fontFamily = defaultFont;
52
- }
53
-
54
- // Apply default font size so the size dropdown shows the correct value on startup
55
- if (options.defaultFontSize) {
56
- editable.style.fontSize = options.defaultFontSize;
57
- }
58
-
59
- // Apply height options.
60
- // `height` sets the initial visible height (takes priority).
61
- // `minHeight` is the drag-resize floor — only applied when no explicit `height` is given.
62
- if (options.height) {
63
- editable.style.minHeight = `${options.height}px`;
64
- } else if (options.minHeight) {
65
- editable.style.minHeight = `${options.minHeight}px`;
66
- }
67
- if (options.maxHeight) {
68
- editable.style.maxHeight = `${options.maxHeight}px`;
69
- }
70
-
71
- container.appendChild(editable);
72
-
73
- // Apply theme — also add to body so floating elements (dialogs, tooltips,
74
- // popovers) appended to document.body inherit the CSS rules.
75
- if (options.theme === 'dark') {
76
- container.classList.add('an-theme-dark');
77
- document.body.classList.add('an-theme-dark');
78
- } else if (options.theme === 'auto') {
79
- container.classList.add('an-theme-auto');
80
- document.body.classList.add('an-theme-auto');
81
- }
82
-
83
- // Read-only mode
84
- if (options.readOnly) {
85
- container.classList.add('an-disabled');
86
- editable.querySelectorAll('ul.an-checklist input[type="checkbox"]').forEach((cb) => {
87
- cb.setAttribute('disabled', '');
88
- });
89
- }
90
-
91
- // Text direction
92
- if (options.direction === 'rtl') {
93
- editable.setAttribute('dir', 'rtl');
94
- container.classList.add('an-dir-rtl');
95
- }
96
-
97
- // Toolbar overflow
98
- if (options.toolbarOverflow === 'scroll') {
99
- container.classList.add('an-toolbar-overflow-scroll');
100
- }
101
-
102
- // Configure sticky toolbar
103
- if (options.stickyToolbar) {
104
- container.classList.add('an-sticky-toolbar');
105
- if (options.stickyToolbarOffset) {
106
- container.style.setProperty('--an-sticky-top', `${options.stickyToolbarOffset}px`);
107
- }
108
- }
109
-
110
- // Custom focus ring colour
111
- if (options.focusColor) {
112
- container.style.setProperty('--an-focus-color', options.focusColor);
113
- }
114
-
115
- // Hide the original element; keep it in DOM for form submission
116
- targetEl.style.display = 'none';
117
- targetEl.after(container);
118
-
119
- return { container, editable };
120
- }