From 2a063a51be01febe80f3aaebf28d58bc9f195fe2 Mon Sep 17 00:00:00 2001 From: tajniak81 <13187254+tajniak81@users.noreply.github.com> Date: Tue, 17 Nov 2026 08:47:47 +0100 Subject: [PATCH] Add Turn into to the text toolbar, page icons from the sidebar, and steadier block handles Turn into: the selection toolbar starts with the block's kind ("Heading 1") and opens the list of kinds it can become, with a tick on the current one. In a list it turns the whole list, as the block menu did; the grip menu no longer has it. Page icons: an editor clicks a page's icon in the sidebar tree to pick an emoji from groups, recent picks or a search by name (any pasted emoji works too), or to remove it. The emoji now stands in for the page glyph rather than sitting before the title. Strings in all five languages. Block handles: the link and grip buttons stay on the block the cursor is in, which is highlighted while the editor has focus, sit centred on the block's height, and no longer vanish crossing the gap from the text. The sidebar shows the Docwell logo above the workspace switcher. Co-Authored-By: Claude Opus 5.5 --- Packages/editor/src/DocwellEditor.vue | 59 ++++- Packages/editor/src/blocklinks.ts | 84 +++++-- Packages/editor/src/blockmenu.ts | 115 +++++++--- Packages/editor/src/blocks.test.ts | 27 ++- Packages/editor/src/editor.css | 10 +- Packages/ui/src/DwTreeItem.vue | 3 +- Web-App/frontend/src/components/AppLayout.vue | 11 +- .../frontend/src/components/EmojiPicker.vue | 207 ++++++++++++++++++ .../frontend/src/components/PageTreeNode.vue | 46 +++- Web-App/frontend/src/lib/emoji.ts | 80 +++++++ Web-App/frontend/src/locales/de.json | 18 ++ Web-App/frontend/src/locales/en.json | 18 ++ Web-App/frontend/src/locales/es.json | 18 ++ Web-App/frontend/src/locales/fr.json | 18 ++ Web-App/frontend/src/locales/pl.json | 18 ++ Web-App/frontend/src/stores/spaces.ts | 16 ++ 16 files changed, 688 insertions(+), 60 deletions(-) create mode 100644 Web-App/frontend/src/components/EmojiPicker.vue create mode 100644 Web-App/frontend/src/lib/emoji.ts diff --git a/Packages/editor/src/DocwellEditor.vue b/Packages/editor/src/DocwellEditor.vue index 45614fa..a19806a 100644 --- a/Packages/editor/src/DocwellEditor.vue +++ b/Packages/editor/src/DocwellEditor.vue @@ -8,6 +8,7 @@ import { DwButton, DwIcon, type IconName } from "@docwell/ui"; import { computed, nextTick, onBeforeUnmount, ref, watch } from "vue"; import { aiActions, type AiAction, type AiHost } from "./ai"; import { copyBlockLink } from "./blocklinks"; +import { currentConversion, turnIntoActions, turnIntoTarget, type BlockAction } from "./blockmenu"; import { palette, type PaletteColor } from "./colors"; import { docwellExtensions, type CollabUser } from "./extensions"; import { findKey } from "./find"; @@ -174,8 +175,23 @@ onBeforeUnmount(() => editor.value?.destroy()); // The selection toolbar: formatting for editors, Comment for anyone allowed. type Tool = { id: string; icon: IconName; label: string; active: () => boolean; run: () => void }; /** The colour or alignment choices open under the toolbar, if any. */ -const panel = ref<"color" | "align" | "ai" | null>(null); -const togglePanel = (p: "color" | "align" | "ai") => (panel.value = panel.value === p ? null : p); +const panel = ref<"turn" | "color" | "align" | "ai" | null>(null); +const togglePanel = (p: "turn" | "color" | "align" | "ai") => (panel.value = panel.value === p ? null : p); + +/** "Turn into" for the block the selection is in: what it is now and what it can become. Null where it has no say. */ +function turnInto(e: Editor): { current: string | null; label: string; actions: BlockAction[] } | null { + const pos = turnIntoTarget(e); + if (pos < 0) return null; + const actions = turnIntoActions(e, pos, labels.value); + if (!actions.length) return null; + const current = currentConversion(e, pos); + const label = (current && labels.value.slash[current]?.label) || labels.value.blockMenu.turnInto; + return { current, label, actions }; +} +function turn(a: BlockAction) { + a.run?.(); + panel.value = null; +} const alignment = (e: Editor) => String(e.getAttributes("paragraph").textAlign ?? e.getAttributes("heading").textAlign ?? "left"); @@ -648,6 +664,22 @@ defineExpose({ editor, openFind }); >
+
    = { + smileys: `๐Ÿ˜€ grinning smile happy|๐Ÿ˜ƒ smiley happy|๐Ÿ˜„ smile laugh|๐Ÿ˜ grin beam|๐Ÿ˜† laughing|๐Ÿ˜… sweat smile|๐Ÿคฃ rofl rolling laugh|๐Ÿ˜‚ joy tears laugh|๐Ÿ™‚ slight smile|๐Ÿ™ƒ upside down|๐Ÿ˜‰ wink|๐Ÿ˜Š blush happy|๐Ÿ˜‡ innocent halo angel|๐Ÿฅฐ love hearts|๐Ÿ˜ heart eyes love|๐Ÿคฉ star struck|๐Ÿ˜˜ kiss blow|๐Ÿ˜‹ yum tasty|๐Ÿ˜› tongue|๐Ÿ˜œ wink tongue|๐Ÿคช zany crazy|๐Ÿค‘ money|๐Ÿค— hug|๐Ÿคญ oops giggle|๐Ÿคซ shush quiet|๐Ÿค” thinking|๐Ÿค zipper mouth|๐Ÿ˜ neutral|๐Ÿ˜‘ expressionless|๐Ÿ˜ถ no mouth|๐Ÿ˜ smirk|๐Ÿ˜’ unamused|๐Ÿ™„ eye roll|๐Ÿ˜ฌ grimace|๐Ÿ˜Œ relieved|๐Ÿ˜” pensive sad|๐Ÿ˜ช sleepy|๐Ÿ˜ด sleeping|๐Ÿ˜ท mask sick|๐Ÿค’ thermometer ill|๐Ÿคฏ mind blown exploding|๐Ÿฅณ party celebrate|๐Ÿ˜Ž cool sunglasses|๐Ÿค“ nerd geek|๐Ÿง monocle|๐Ÿ˜• confused|๐Ÿ˜Ÿ worried|๐Ÿ˜ฎ surprised open mouth|๐Ÿ˜ฒ astonished|๐Ÿ˜ณ flushed|๐Ÿฅบ pleading|๐Ÿ˜ข cry tear|๐Ÿ˜ญ sob crying|๐Ÿ˜ฑ scream fear|๐Ÿ˜ค triumph steam|๐Ÿ˜ก angry rage|๐Ÿคฌ cursing|๐Ÿ˜ˆ devil|๐Ÿ’€ skull dead|๐Ÿ’ฉ poop|๐Ÿคก clown|๐Ÿ‘ป ghost|๐Ÿ‘ฝ alien|๐Ÿค– robot|๐Ÿ˜บ cat smile|โค๏ธ heart love red`, + people: `๐Ÿ‘‹ wave hello hi|๐Ÿคš raised back hand|โœ‹ hand stop|๐Ÿ‘Œ ok okay|โœŒ๏ธ victory peace|๐Ÿคž crossed fingers luck|๐ŸคŸ love you|๐Ÿค˜ rock horns|๐Ÿ‘ˆ point left|๐Ÿ‘‰ point right|๐Ÿ‘† point up|๐Ÿ‘‡ point down|โ˜๏ธ index up|๐Ÿ‘ thumbs up like yes|๐Ÿ‘Ž thumbs down no|โœŠ fist|๐Ÿ‘Š punch|๐Ÿ‘ clap applause|๐Ÿ™Œ raised hands hooray|๐Ÿค handshake deal|๐Ÿ™ pray thanks please|โœ๏ธ writing|๐Ÿ’ช muscle strong|๐Ÿง  brain|๐Ÿ‘€ eyes look|๐Ÿ‘๏ธ eye|๐Ÿ‘ค person user|๐Ÿ‘ฅ people users team|๐Ÿง‘โ€๐Ÿ’ป developer coder technologist|๐Ÿง‘โ€๐Ÿซ teacher|๐Ÿง‘โ€๐ŸŽ“ student|๐Ÿง‘โ€๐Ÿ”ฌ scientist|๐Ÿง‘โ€๐ŸŽจ artist|๐Ÿง‘โ€๐Ÿณ cook chef|๐Ÿง‘โ€๐Ÿ”ง mechanic|๐Ÿง‘โ€โš•๏ธ doctor health|๐Ÿง‘โ€๐Ÿ’ผ office worker business|๐Ÿ•ต๏ธ detective|๐Ÿ‘ท construction worker|๐Ÿฆธ superhero|๐Ÿง™ wizard mage|๐Ÿƒ running|๐Ÿšถ walking|๐Ÿง˜ yoga meditation|๐Ÿ‘ช family|๐Ÿ‘ถ baby`, + nature: `๐Ÿถ dog puppy|๐Ÿฑ cat kitten|๐Ÿญ mouse|๐Ÿฐ rabbit bunny|๐ŸฆŠ fox|๐Ÿป bear|๐Ÿผ panda|๐Ÿจ koala|๐Ÿฏ tiger|๐Ÿฆ lion|๐Ÿฎ cow|๐Ÿท pig|๐Ÿธ frog|๐Ÿต monkey|๐Ÿ” chicken|๐Ÿง penguin|๐Ÿฆ bird|๐Ÿฆ‰ owl|๐Ÿฆ„ unicorn|๐Ÿ bee|๐Ÿ› bug|๐Ÿฆ‹ butterfly|๐Ÿข turtle|๐Ÿ snake|๐Ÿ™ octopus|๐Ÿฌ dolphin|๐Ÿณ whale|๐ŸŸ fish|๐Ÿฆˆ shark|๐ŸŒต cactus|๐ŸŽ„ christmas tree|๐ŸŒฒ evergreen tree|๐ŸŒณ tree|๐ŸŒด palm|๐ŸŒฑ seedling sprout|๐ŸŒฟ herb|๐Ÿ€ clover luck|๐Ÿ maple leaf|๐Ÿ‚ fallen leaves autumn|๐ŸŒท tulip|๐ŸŒน rose|๐ŸŒป sunflower|๐ŸŒธ blossom|๐Ÿ’ bouquet flowers|๐Ÿ„ mushroom|๐ŸŒ earth world globe|๐ŸŒ™ moon night|โญ star|๐ŸŒŸ glowing star|โœจ sparkles|โšก lightning zap|๐Ÿ”ฅ fire hot|๐ŸŒˆ rainbow|โ˜€๏ธ sun|โ›… cloud sun|โ˜๏ธ cloud|๐ŸŒง๏ธ rain|โ„๏ธ snow snowflake|๐Ÿ’ง droplet water|๐ŸŒŠ wave ocean sea`, + food: `๐Ÿ green apple|๐ŸŽ apple red|๐Ÿ pear|๐ŸŠ orange|๐Ÿ‹ lemon|๐ŸŒ banana|๐Ÿ‰ watermelon|๐Ÿ‡ grapes|๐Ÿ“ strawberry|๐Ÿซ blueberries|๐Ÿ’ cherries|๐Ÿ‘ peach|๐Ÿฅญ mango|๐Ÿ pineapple|๐Ÿฅฅ coconut|๐Ÿฅ kiwi|๐Ÿ… tomato|๐Ÿฅ‘ avocado|๐Ÿฅฆ broccoli|๐Ÿฅ• carrot|๐ŸŒฝ corn|๐ŸŒถ๏ธ pepper hot|๐Ÿฅ” potato|๐Ÿž bread|๐Ÿฅ croissant|๐Ÿง€ cheese|๐Ÿฅš egg|๐Ÿณ cooking|๐Ÿฅž pancakes|๐Ÿฅ“ bacon|๐Ÿ” burger|๐ŸŸ fries|๐Ÿ• pizza|๐ŸŒญ hot dog|๐ŸŒฎ taco|๐ŸŒฏ burrito|๐Ÿฅ— salad|๐Ÿ pasta spaghetti|๐Ÿœ ramen noodles|๐Ÿฃ sushi|๐Ÿฑ bento|๐Ÿฆ ice cream|๐Ÿฉ doughnut|๐Ÿช cookie|๐ŸŽ‚ birthday cake|๐Ÿฐ cake|๐Ÿง cupcake|๐Ÿซ chocolate|๐Ÿฌ candy|๐Ÿฟ popcorn|โ˜• coffee|๐Ÿต tea|๐Ÿงƒ juice|๐Ÿฅค drink|๐Ÿบ beer|๐Ÿท wine|๐Ÿธ cocktail|๐Ÿฅ‚ cheers champagne|๐Ÿฝ๏ธ dinner plate`, + activity: `โšฝ soccer football|๐Ÿ€ basketball|๐Ÿˆ american football|โšพ baseball|๐ŸŽพ tennis|๐Ÿ volleyball|๐Ÿ‰ rugby|๐ŸŽฑ billiards|๐Ÿ“ ping pong|๐Ÿธ badminton|๐Ÿฅ… goal|โ›ณ golf|๐Ÿน archery|๐ŸŽฃ fishing|๐ŸฅŠ boxing|๐ŸŽฝ running shirt|โ›ธ๏ธ ice skate|๐ŸŽฟ ski|๐Ÿ‚ snowboard|๐Ÿ‹๏ธ weights gym|๐Ÿšด cycling bike|๐Ÿ† trophy win|๐Ÿฅ‡ gold medal first|๐Ÿฅˆ silver medal|๐Ÿฅ‰ bronze medal|๐Ÿ… medal|๐ŸŽ–๏ธ military medal|๐ŸŽซ ticket|๐ŸŽช circus|๐ŸŽญ theatre drama|๐ŸŽจ art palette paint|๐ŸŽฌ movie clapper film|๐ŸŽค microphone sing|๐ŸŽง headphones music|๐ŸŽผ score|๐ŸŽน piano|๐Ÿฅ drum|๐ŸŽท saxophone|๐ŸŽบ trumpet|๐ŸŽธ guitar|๐ŸŽป violin|๐ŸŽฒ dice game|โ™Ÿ๏ธ chess|๐ŸŽฏ target goal dart|๐ŸŽณ bowling|๐ŸŽฎ video game|๐Ÿงฉ puzzle|๐ŸŽ‰ party popper tada|๐ŸŽŠ confetti|๐ŸŽˆ balloon|๐ŸŽ gift present`, + travel: `๐Ÿš— car|๐Ÿš• taxi|๐ŸšŒ bus|๐ŸšŽ trolleybus|๐ŸŽ๏ธ race car|๐Ÿš“ police car|๐Ÿš‘ ambulance|๐Ÿš’ fire engine|๐Ÿšš truck delivery|๐Ÿšœ tractor|๐Ÿ›ต scooter|๐Ÿšฒ bicycle|๐Ÿ›ด kick scooter|๐Ÿš‚ train locomotive|๐Ÿš† train|๐Ÿš‡ metro subway|โœˆ๏ธ airplane flight|๐Ÿ›ซ departure|๐Ÿ›ฌ arrival|๐Ÿš€ rocket launch|๐Ÿ›ธ ufo|๐Ÿš helicopter|โ›ต sailboat|๐Ÿšค speedboat|๐Ÿšข ship|โš“ anchor|๐Ÿ—บ๏ธ map|๐Ÿงญ compass|๐Ÿ”๏ธ mountain snow|โ›ฐ๏ธ mountain|๐ŸŒ‹ volcano|๐Ÿ•๏ธ camping|๐Ÿ–๏ธ beach|๐Ÿ๏ธ island|๐Ÿ  house home|๐Ÿก garden home|๐Ÿข office building|๐Ÿฌ department store|๐Ÿญ factory|๐Ÿฅ hospital|๐Ÿฆ bank|๐Ÿจ hotel|๐Ÿช shop store|๐Ÿซ school|๐Ÿ›๏ธ classical building|โ›ช church|๐Ÿฐ castle|๐Ÿ—ผ tower|๐Ÿ—ฝ statue liberty|โ›ฒ fountain|๐ŸŒ† city|๐ŸŒƒ night city|๐ŸŒ‰ bridge|๐ŸŽก ferris wheel|๐ŸŽข roller coaster|๐Ÿšฆ traffic light|๐Ÿšง construction|โ›ฝ fuel`, + objects: `๐Ÿ“„ page document|๐Ÿ“ƒ curl page|๐Ÿ“‘ bookmark tabs|๐Ÿ“ memo note write|๐Ÿ“‹ clipboard|๐Ÿ“Œ pushpin pin|๐Ÿ“ location pin|๐Ÿ“Ž paperclip|๐Ÿ–‡๏ธ paperclips|๐Ÿ“ ruler|๐Ÿ“ triangle ruler|โœ‚๏ธ scissors|๐Ÿ—‚๏ธ dividers index|๐Ÿ“ folder|๐Ÿ“‚ open folder|๐Ÿ—ƒ๏ธ card box|๐Ÿ—„๏ธ cabinet|๐Ÿ—‘๏ธ trash wastebasket|๐Ÿ“… calendar date|๐Ÿ“† tear off calendar|๐Ÿ—“๏ธ spiral calendar|๐Ÿ“‡ card index|๐Ÿ“ˆ chart up growth|๐Ÿ“‰ chart down|๐Ÿ“Š bar chart stats|๐Ÿ“’ ledger|๐Ÿ““ notebook|๐Ÿ“” notebook decorative|๐Ÿ“• book closed|๐Ÿ“— green book|๐Ÿ“˜ blue book|๐Ÿ“™ orange book|๐Ÿ“š books library|๐Ÿ“– open book read|๐Ÿ”– bookmark|๐Ÿท๏ธ label tag|๐Ÿ’ผ briefcase work|๐Ÿ’ป laptop computer|๐Ÿ–ฅ๏ธ desktop computer|โŒจ๏ธ keyboard|๐Ÿ–ฑ๏ธ mouse computer|๐Ÿ“ฑ phone mobile|โ˜Ž๏ธ telephone|๐Ÿ“ž receiver call|๐Ÿ“  fax|๐Ÿ”‹ battery|๐Ÿ”Œ plug|๐Ÿ’ก bulb idea|๐Ÿ”ฆ flashlight|๐Ÿ•ฏ๏ธ candle|๐Ÿ’ฐ money bag|๐Ÿ’ณ card credit|๐Ÿงพ receipt|โœ‰๏ธ envelope mail|๐Ÿ“ง email|๐Ÿ“จ incoming mail|๐Ÿ“ฆ package box|๐Ÿ“ฎ postbox|๐Ÿ”’ lock locked|๐Ÿ”“ unlocked|๐Ÿ”‘ key|๐Ÿ—๏ธ old key|๐Ÿ”จ hammer|๐Ÿ› ๏ธ tools|๐Ÿ”ง wrench|๐Ÿ”ฉ nut bolt|โš™๏ธ gear settings|๐Ÿงฐ toolbox|๐Ÿงฒ magnet|๐Ÿงช test tube|๐Ÿ”ฌ microscope|๐Ÿ”ญ telescope|๐Ÿ“ก satellite|๐Ÿ’Š pill|๐Ÿฉบ stethoscope|๐Ÿ›’ cart shopping|๐ŸŽ“ graduation cap|๐Ÿ‘‘ crown|๐Ÿ’Ž gem diamond|โฐ alarm clock|โณ hourglass|โŒ› hourglass done|๐Ÿ• clock time|๐Ÿ“ท camera photo|๐ŸŽฅ video camera|๐Ÿ“บ television tv|๐Ÿ“ป radio|๐Ÿ”” bell notification|๐Ÿ“ฃ megaphone announce|๐Ÿ“ข loudspeaker|๐Ÿ” search magnifier|๐Ÿงญ compass direction`, + symbols: `โœ… check done yes|โ˜‘๏ธ ballot check|โœ”๏ธ check mark|โŒ cross no|โŽ cross button|โž• plus add|โž– minus|โž— divide|โœ–๏ธ multiply|โ“ question|โ” white question|โ— exclamation important|โ€ผ๏ธ double exclamation|โš ๏ธ warning|๐Ÿšซ prohibited|โ›” no entry|๐Ÿ›‘ stop|๐Ÿ’ฏ hundred|๐Ÿ”ด red circle|๐ŸŸ  orange circle|๐ŸŸก yellow circle|๐ŸŸข green circle|๐Ÿ”ต blue circle|๐ŸŸฃ purple circle|โšซ black circle|โšช white circle|๐ŸŸฅ red square|๐ŸŸง orange square|๐ŸŸจ yellow square|๐ŸŸฉ green square|๐ŸŸฆ blue square|๐ŸŸช purple square|โฌ› black square|โฌœ white square|๐Ÿ”ถ orange diamond|๐Ÿ”ท blue diamond|โ™ป๏ธ recycle|โš›๏ธ atom|โ˜ฎ๏ธ peace|โ˜ฏ๏ธ yin yang|โ™พ๏ธ infinity|๐Ÿ’ฒ dollar|๐Ÿ’ฑ exchange|ยฉ๏ธ copyright|ยฎ๏ธ registered|โ„ข๏ธ trademark|๐Ÿ” top|๐Ÿ”œ soon|๐Ÿ†• new|๐Ÿ†“ free|๐Ÿ†— ok|๐Ÿ†™ up|๐Ÿ†’ cool|โ„น๏ธ info information|๐Ÿ”ค abc letters|๐Ÿ”ข numbers|#๏ธโƒฃ hash|โžก๏ธ right arrow|โฌ…๏ธ left arrow|โฌ†๏ธ up arrow|โฌ‡๏ธ down arrow|๐Ÿ”„ refresh sync|๐Ÿ” repeat|โ–ถ๏ธ play|โธ๏ธ pause|โน๏ธ stop|โฉ fast forward|๐Ÿ’ฌ speech chat comment|๐Ÿ’ญ thought|๐Ÿ—ฏ๏ธ anger bubble|๐Ÿ’ค sleep zzz|๐Ÿ’ฅ boom collision|๐Ÿ’ซ dizzy|๐ŸŽต music note|๐Ÿ”— link|๐Ÿ finish flag|๐Ÿšฉ red flag|๐Ÿณ๏ธ white flag|๐Ÿด black flag|๐Ÿ’œ purple heart|๐Ÿ’™ blue heart|๐Ÿ’š green heart|๐Ÿ’› yellow heart|๐Ÿงก orange heart|๐Ÿ–ค black heart|๐Ÿ’” broken heart`, +}; + +export const emojiGroups = Object.keys(raw) as EmojiGroup[]; + +export const emojiByGroup: Record = Object.fromEntries( + emojiGroups.map((g) => [ + g, + raw[g].split("|").map((entry) => { + const [char = "", ...words] = entry.trim().split(" "); + return { char, words: words.join(" ") }; + }), + ]), +) as Record; + +/** The emoji whose words start with every word of the query, in group order. */ +export function searchEmoji(query: string): Emoji[] { + const terms = query.toLowerCase().split(/\s+/).filter(Boolean); + if (!terms.length) return []; + const seen = new Set(); + const out: Emoji[] = []; + for (const g of emojiGroups) { + for (const e of emojiByGroup[g]) { + if (seen.has(e.char)) continue; + const words = e.words.split(" "); + if (terms.every((t) => words.some((w) => w.startsWith(t)))) { + seen.add(e.char); + out.push(e); + } + } + } + return out; +} + +/** Text that is itself an icon: a few characters with no letters or digits, as the server keeps at most 32 bytes. */ +export function typedEmoji(text: string): string | null { + const t = text.trim(); + if (!t || /[\p{L}\p{N}]/u.test(t) || new TextEncoder().encode(t).length > 32) return null; + return /\p{Extended_Pictographic}/u.test(t) ? t : null; +} + +const recentKey = "docwell.recentEmoji"; + +/** The emoji this browser picked last, newest first. */ +export function recentEmoji(): string[] { + try { + const list = JSON.parse(localStorage.getItem(recentKey) ?? "[]"); + return Array.isArray(list) ? list.filter((x) => typeof x === "string").slice(0, 16) : []; + } catch { + return []; + } +} + +export function rememberEmoji(char: string) { + try { + localStorage.setItem(recentKey, JSON.stringify([char, ...recentEmoji().filter((c) => c !== char)].slice(0, 16))); + } catch { + // Private windows may refuse storage; the picker works without it. + } +} diff --git a/Web-App/frontend/src/locales/de.json b/Web-App/frontend/src/locales/de.json index efe6780..eefd9ec 100644 --- a/Web-App/frontend/src/locales/de.json +++ b/Web-App/frontend/src/locales/de.json @@ -1700,5 +1700,23 @@ "comment_created": "jemand kommentiert", "comment_resolved": "ein Kommentar erledigt wird" } + }, + "emoji": { + "title": "Seitensymbol", + "changeIcon": "Symbol รคndern", + "search": "Emoji suchen oder einfรผgen", + "remove": "Entfernen", + "recent": "Zuletzt verwendet", + "none": "Kein Emoji gefunden", + "groups": { + "smileys": "Smileys", + "people": "Menschen", + "nature": "Natur", + "food": "Essen und Trinken", + "activity": "Aktivitรคten", + "travel": "Reisen und Orte", + "objects": "Objekte", + "symbols": "Symbole" + } } } diff --git a/Web-App/frontend/src/locales/en.json b/Web-App/frontend/src/locales/en.json index f49742a..037733e 100644 --- a/Web-App/frontend/src/locales/en.json +++ b/Web-App/frontend/src/locales/en.json @@ -1700,5 +1700,23 @@ "comment_created": "someone comments", "comment_resolved": "a comment is resolved" } + }, + "emoji": { + "title": "Page icon", + "changeIcon": "Change icon", + "search": "Search emoji or paste one", + "remove": "Remove", + "recent": "Recently used", + "none": "No emoji found", + "groups": { + "smileys": "Smileys", + "people": "People", + "nature": "Nature", + "food": "Food and drink", + "activity": "Activities", + "travel": "Travel and places", + "objects": "Objects", + "symbols": "Symbols" + } } } diff --git a/Web-App/frontend/src/locales/es.json b/Web-App/frontend/src/locales/es.json index a7410ff..71c3964 100644 --- a/Web-App/frontend/src/locales/es.json +++ b/Web-App/frontend/src/locales/es.json @@ -1700,5 +1700,23 @@ "comment_created": "alguien comenta", "comment_resolved": "se resuelve un comentario" } + }, + "emoji": { + "title": "Icono de la pรกgina", + "changeIcon": "Cambiar icono", + "search": "Busca un emoji o pรฉgalo", + "remove": "Quitar", + "recent": "Usados recientemente", + "none": "No se encontrรณ ningรบn emoji", + "groups": { + "smileys": "Caras", + "people": "Personas", + "nature": "Naturaleza", + "food": "Comida y bebida", + "activity": "Actividades", + "travel": "Viajes y lugares", + "objects": "Objetos", + "symbols": "Sรญmbolos" + } } } diff --git a/Web-App/frontend/src/locales/fr.json b/Web-App/frontend/src/locales/fr.json index ae3f15a..2835b88 100644 --- a/Web-App/frontend/src/locales/fr.json +++ b/Web-App/frontend/src/locales/fr.json @@ -1700,5 +1700,23 @@ "comment_created": "quelquโ€™un commente", "comment_resolved": "un commentaire est rรฉsolu" } + }, + "emoji": { + "title": "Icรดne de la page", + "changeIcon": "Changer lโ€™icรดne", + "search": "Chercher un emoji ou en coller un", + "remove": "Retirer", + "recent": "Utilisรฉs rรฉcemment", + "none": "Aucun emoji trouvรฉ", + "groups": { + "smileys": "Smileys", + "people": "Personnes", + "nature": "Nature", + "food": "Nourriture et boissons", + "activity": "Activitรฉs", + "travel": "Voyages et lieux", + "objects": "Objets", + "symbols": "Symboles" + } } } diff --git a/Web-App/frontend/src/locales/pl.json b/Web-App/frontend/src/locales/pl.json index 85f594f..4c7b2f3 100644 --- a/Web-App/frontend/src/locales/pl.json +++ b/Web-App/frontend/src/locales/pl.json @@ -1700,5 +1700,23 @@ "comment_created": "ktoล› komentuje", "comment_resolved": "komentarz jest rozwiฤ…zany" } + }, + "emoji": { + "title": "Ikona strony", + "changeIcon": "Zmieล„ ikonฤ™", + "search": "Szukaj emoji lub wklej", + "remove": "Usuล„", + "recent": "Ostatnio uลผywane", + "none": "Nie znaleziono emoji", + "groups": { + "smileys": "Buลบki", + "people": "Ludzie", + "nature": "Przyroda", + "food": "Jedzenie i napoje", + "activity": "Aktywnoล›ci", + "travel": "Podrรณลผe i miejsca", + "objects": "Przedmioty", + "symbols": "Symbole" + } } } diff --git a/Web-App/frontend/src/stores/spaces.ts b/Web-App/frontend/src/stores/spaces.ts index e869c70..9b60166 100644 --- a/Web-App/frontend/src/stores/spaces.ts +++ b/Web-App/frontend/src/stores/spaces.ts @@ -138,6 +138,21 @@ export const useSpacesStore = defineStore("spaces", () => { if (node) node.title = title; } + /** Sets a page's icon ("" removes it) and mirrors it into the sidebar. */ + async function setIcon(spaceId: string, id: string, icon: string) { + const node = trees.value[spaceId]?.find((n) => n.id === id); + const before = node?.icon; + if (node) node.icon = icon; + try { + const saved = await api.pages.update(id, { icon }); + if (node) node.icon = saved.icon; + return saved; + } catch (e) { + if (node) node.icon = before ?? ""; + throw e; + } + } + async function trash(spaceId: string, id: string) { await api.pages.trash(id); await loadTree(spaceId); @@ -163,6 +178,7 @@ export const useSpacesStore = defineStore("spaces", () => { createPage, move, setTitle, + setIcon, trash, }; });