<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Menu on Palmyra</title>
    <link>https://palmyra.dev/docs/api/frontend/base-components/menu/</link>
    <description>Recent content in Menu on Palmyra</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <atom:link href="https://palmyra.dev/docs/api/frontend/base-components/menu/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>AsyncTreeMenu</title>
      <link>https://palmyra.dev/docs/api/frontend/base-components/menu/async-tree-menu/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://palmyra.dev/docs/api/frontend/base-components/menu/async-tree-menu/</guid>
      <description>&lt;h1 id=&#34;asynctreemenu&#34;&gt;AsyncTreeMenu&lt;a class=&#34;anchor&#34; href=&#34;#asynctreemenu&#34;&gt;#&lt;/a&gt;&lt;/h1&gt;&#xA;&lt;p&gt;&lt;code&gt;@palmyralabs/rt-forms&lt;/code&gt; · &lt;code&gt;src/palmyra/menu/AsyncTreeMenu.tsx&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;a class=&#34;anchor&#34; href=&#34;#overview&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Sidebar tree menu. On mount it calls &lt;code&gt;store.getRoot()&lt;/code&gt; once against a Wire &lt;a href=&#34;https://palmyra.dev/docs/api/frontend/wire/tree-store/&#34;&gt;&lt;code&gt;TreeQueryStore&lt;/code&gt;&lt;/a&gt; to fetch the whole tree, converts the flat list into &lt;code&gt;react-accessible-treeview&lt;/code&gt; nodes, and renders a checkbox-less expandable sidebar.&lt;/p&gt;&#xA;&lt;p&gt;Selecting a leaf calls &lt;code&gt;useNavigate()&lt;/code&gt; from &lt;code&gt;react-router-dom&lt;/code&gt; with the leaf&amp;rsquo;s &lt;code&gt;metadata.code&lt;/code&gt; (or &lt;code&gt;metadata.target&lt;/code&gt; for non-leaf shortcut links). Expand state and the last selection are persisted to &lt;code&gt;localStorage&lt;/code&gt; under the keys &lt;code&gt;palmyra.rui.sidemenu.expanded&lt;/code&gt; and &lt;code&gt;palmyra.rui.sidemenu.expanded.selected&lt;/code&gt;, so the menu restores itself on page refresh.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AsyncTreeMenuEditor</title>
      <link>https://palmyra.dev/docs/api/frontend/base-components/menu/async-tree-menu-editor/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://palmyra.dev/docs/api/frontend/base-components/menu/async-tree-menu-editor/</guid>
      <description>&lt;h1 id=&#34;asynctreemenueditor&#34;&gt;AsyncTreeMenuEditor&lt;a class=&#34;anchor&#34; href=&#34;#asynctreemenueditor&#34;&gt;#&lt;/a&gt;&lt;/h1&gt;&#xA;&lt;p&gt;&lt;code&gt;@palmyralabs/rt-forms&lt;/code&gt; · &lt;code&gt;src/palmyra/menu/AsyncTreeMenuEditor.tsx&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;a class=&#34;anchor&#34; href=&#34;#overview&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Admin-side counterpart to &lt;a href=&#34;https://palmyra.dev/docs/api/frontend/base-components/menu/async-tree-menu/&#34;&gt;&lt;code&gt;AsyncTreeMenu&lt;/code&gt;&lt;/a&gt;. Renders the same tree with &lt;strong&gt;checkbox selection&lt;/strong&gt; so an administrator can edit which menu entries a given role/group can access.&lt;/p&gt;&#xA;&lt;p&gt;Internally it builds its own &lt;code&gt;TreeQueryStore&lt;/code&gt; from a factory (&lt;code&gt;storeFactory.getTreeStore&lt;/code&gt;), seeded with &lt;code&gt;endPointOptions: { groupId }&lt;/code&gt;, so the backend returns each node pre-marked with the group&amp;rsquo;s current &lt;code&gt;mask&lt;/code&gt; value. On mount, nodes with &lt;code&gt;mask == 2&lt;/code&gt; are selected by default; descendants inherit via &lt;code&gt;propagateSelect&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>IconProvider</title>
      <link>https://palmyra.dev/docs/api/frontend/base-components/menu/icon-provider/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://palmyra.dev/docs/api/frontend/base-components/menu/icon-provider/</guid>
      <description>&lt;h1 id=&#34;iconprovider&#34;&gt;IconProvider&lt;a class=&#34;anchor&#34; href=&#34;#iconprovider&#34;&gt;#&lt;/a&gt;&lt;/h1&gt;&#xA;&lt;p&gt;&lt;code&gt;@palmyralabs/rt-forms&lt;/code&gt; · &lt;code&gt;src/palmyra/menu/IconProvider.ts&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;a class=&#34;anchor&#34; href=&#34;#overview&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Pluggable icon resolver consumed by &lt;a href=&#34;https://palmyra.dev/docs/api/frontend/base-components/menu/async-tree-menu/&#34;&gt;&lt;code&gt;AsyncTreeMenu&lt;/code&gt;&lt;/a&gt;. Given a menu node&amp;rsquo;s &lt;code&gt;metadata.code&lt;/code&gt; (the same string that also acts as the router path), &lt;code&gt;getIcon&lt;/code&gt; returns a React icon component — or &lt;code&gt;undefined&lt;/code&gt; when nothing is mapped.&lt;/p&gt;&#xA;&lt;p&gt;The file ships two symbols:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;IconProvider&lt;/code&gt;&lt;/strong&gt; — the interface (&lt;code&gt;type&lt;/code&gt;-only export).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;SimpleIconProvider&lt;/code&gt;&lt;/strong&gt; — a default singleton backed by an empty map. Returns &lt;code&gt;undefined&lt;/code&gt; for every lookup unless you patch the map, so nodes render without icons.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;In practice you implement your own &lt;code&gt;IconProvider&lt;/code&gt; and pass it to &lt;code&gt;AsyncTreeMenu&lt;/code&gt; rather than extending the default.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
