collective.editablemenu 3.0.0__py3-none-any.whl

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 (70) hide show
  1. collective/editablemenu/Extensions/install.py +12 -0
  2. collective/editablemenu/__init__.py +7 -0
  3. collective/editablemenu/browser/__init__.py +0 -0
  4. collective/editablemenu/browser/configure.zcml +69 -0
  5. collective/editablemenu/browser/controlpanel.py +22 -0
  6. collective/editablemenu/browser/interfaces.py +16 -0
  7. collective/editablemenu/browser/menu_support_view.py +260 -0
  8. collective/editablemenu/browser/overrides/.gitkeep +0 -0
  9. collective/editablemenu/browser/static/delete_tab.png +0 -0
  10. collective/editablemenu/browser/static/dist/editablemenu.min.css +3 -0
  11. collective/editablemenu/browser/static/dist/editablemenu.min.css.map +1 -0
  12. collective/editablemenu/browser/static/dist/editablemenu.min.js +2 -0
  13. collective/editablemenu/browser/static/dist/editablemenu.min.js.map +1 -0
  14. collective/editablemenu/browser/static/dist/widget.min.css +3 -0
  15. collective/editablemenu/browser/static/dist/widget.min.css.map +1 -0
  16. collective/editablemenu/browser/static/dist/widget.min.js +3 -0
  17. collective/editablemenu/browser/static/dist/widget.min.js.LICENSE.txt +9 -0
  18. collective/editablemenu/browser/static/dist/widget.min.js.map +1 -0
  19. collective/editablemenu/browser/static/editablemenu.png +0 -0
  20. collective/editablemenu/browser/static/js/editablemenu.js +150 -0
  21. collective/editablemenu/browser/static/js/widget-react/App.js +218 -0
  22. collective/editablemenu/browser/static/js/widget-react/MenuItem.js +264 -0
  23. collective/editablemenu/browser/static/js/widget-react/NavBar.js +61 -0
  24. collective/editablemenu/browser/static/js/widget-react/SortableList.js +61 -0
  25. collective/editablemenu/browser/static/js/widget-react/index.js +16 -0
  26. collective/editablemenu/browser/static/js/widget.js +42 -0
  27. collective/editablemenu/browser/static/sass/editablemenu.scss +257 -0
  28. collective/editablemenu/browser/static/sass/widget.scss +266 -0
  29. collective/editablemenu/browser/templates/custom_sections.pt +40 -0
  30. collective/editablemenu/browser/templates/editable_menu_settings_widget.pt +49 -0
  31. collective/editablemenu/browser/templates/submenu_detail_view.pt +61 -0
  32. collective/editablemenu/browser/viewlets.py +16 -0
  33. collective/editablemenu/browser/widgets.py +71 -0
  34. collective/editablemenu/configure.zcml +71 -0
  35. collective/editablemenu/interfaces.py +7 -0
  36. collective/editablemenu/locales/collective.editablemenu.pot +72 -0
  37. collective/editablemenu/locales/it/LC_MESSAGES/collective.editablemenu.po +72 -0
  38. collective/editablemenu/locales/it/LC_MESSAGES/collective.editablemenu.widget.po +74 -0
  39. collective/editablemenu/locales/update.sh +12 -0
  40. collective/editablemenu/profiles/default/browserlayer.xml +6 -0
  41. collective/editablemenu/profiles/default/collectiveeditablemenu_default.txt +0 -0
  42. collective/editablemenu/profiles/default/controlpanel.xml +20 -0
  43. collective/editablemenu/profiles/default/metadata.xml +7 -0
  44. collective/editablemenu/profiles/default/registry.xml +26 -0
  45. collective/editablemenu/profiles/default/rolemap.xml +11 -0
  46. collective/editablemenu/profiles/from_1300_to_1400/collectiveeditablemenu_default.txt +0 -0
  47. collective/editablemenu/profiles/from_1300_to_1400/registry.xml +7 -0
  48. collective/editablemenu/profiles/from_1400_to_1410/jsregistry.xml +14 -0
  49. collective/editablemenu/profiles/to_2000/cssregistry.xml +6 -0
  50. collective/editablemenu/profiles/to_2000/jsregistry.xml +6 -0
  51. collective/editablemenu/profiles/to_3000/registry.xml +19 -0
  52. collective/editablemenu/profiles/uninstall/browserlayer.xml +7 -0
  53. collective/editablemenu/profiles/uninstall/collectiveeditablemenu_default.txt +0 -0
  54. collective/editablemenu/profiles/uninstall/controlpanel.xml +16 -0
  55. collective/editablemenu/profiles/uninstall/cssregistry.xml +8 -0
  56. collective/editablemenu/profiles/uninstall/jsregistry.xml +3 -0
  57. collective/editablemenu/profiles/uninstall/registry.xml +24 -0
  58. collective/editablemenu/setuphandlers.py +26 -0
  59. collective/editablemenu/testing.py +111 -0
  60. collective/editablemenu/tests/__init__.py +0 -0
  61. collective/editablemenu/tests/test_settings.py +203 -0
  62. collective/editablemenu/upgrades.py +104 -0
  63. collective/editablemenu/upgrades.zcml +52 -0
  64. collective.editablemenu-3.0.0-py3.11-nspkg.pth +1 -0
  65. collective_editablemenu-3.0.0.dist-info/METADATA +338 -0
  66. collective_editablemenu-3.0.0.dist-info/RECORD +70 -0
  67. collective_editablemenu-3.0.0.dist-info/WHEEL +5 -0
  68. collective_editablemenu-3.0.0.dist-info/entry_points.txt +2 -0
  69. collective_editablemenu-3.0.0.dist-info/namespace_packages.txt +1 -0
  70. collective_editablemenu-3.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,12 @@
1
+ from collective.editablemenu import logger
2
+
3
+
4
+ def uninstall(portal, reinstall=False):
5
+ if not reinstall:
6
+ # Don't want to delete all registry values if a Manager
7
+ # simply reinstall the product from ZMI
8
+ setup_tool = portal.portal_setup
9
+ setup_tool.runAllImportStepsFromProfile(
10
+ "profile-collective.editablemenu:uninstall"
11
+ )
12
+ logger.info("Uninstall done")
@@ -0,0 +1,7 @@
1
+ from zope.i18nmessageid import MessageFactory
2
+
3
+ import logging
4
+
5
+
6
+ _ = MessageFactory("collective.editablemenu")
7
+ logger = logging.getLogger("collective.editablemenu")
File without changes
@@ -0,0 +1,69 @@
1
+ <configure
2
+ xmlns="http://namespaces.zope.org/zope"
3
+ xmlns:browser="http://namespaces.zope.org/browser"
4
+ xmlns:plone="http://namespaces.plone.org/plone"
5
+ xmlns:z3c="http://namespaces.zope.org/z3c"
6
+ xmlns:zcml="http://namespaces.zope.org/zcml"
7
+ i18n_domain="collective.editablemenu"
8
+ >
9
+
10
+ <!-- Publish static files -->
11
+ <plone:static
12
+ directory="static"
13
+ name="collective.editablemenu"
14
+ type="plone"
15
+ />
16
+
17
+ <!-- VIEWLETS -->
18
+
19
+ <browser:viewlet
20
+ name="plone.global_sections"
21
+ manager="plone.app.layout.viewlets.interfaces.IMainNavigation"
22
+ class=".viewlets.CustomGlobalSectionsViewlet"
23
+ template="templates/custom_sections.pt"
24
+ permission="zope2.View"
25
+ layer="collective.editablemenu.interfaces.ICollectiveEditablemenuLayer"
26
+ />
27
+
28
+ <!-- VIEWS -->
29
+ <browser:page
30
+ name="editable-menu-settings"
31
+ for="Products.CMFPlone.interfaces.IPloneSiteRoot"
32
+ class=".controlpanel.EditableMenuSettingsView"
33
+ permission="collective.editablemenu.permissions.ManageSettings"
34
+ layer="collective.editablemenu.interfaces.ICollectiveEditablemenuLayer"
35
+ />
36
+
37
+ <browser:page
38
+ name="menu_support_view"
39
+ for="*"
40
+ class=".menu_support_view.MenuSupportView"
41
+ permission="zope2.View"
42
+ layer="collective.editablemenu.interfaces.ICollectiveEditablemenuLayer"
43
+ />
44
+
45
+ <browser:page
46
+ name="submenu_detail_view"
47
+ for="*"
48
+ class=".menu_support_view.SubMenuDetailView"
49
+ template="templates/submenu_detail_view.pt"
50
+ permission="zope2.View"
51
+ layer="collective.editablemenu.interfaces.ICollectiveEditablemenuLayer"
52
+ />
53
+
54
+ <!-- WIDGETS -->
55
+ <class class=".widgets.EditableMenuSettingsWidget">
56
+ <require
57
+ permission="zope.Public"
58
+ interface=".widgets.IEditableMenuSettingsWidget"
59
+ />
60
+ </class>
61
+
62
+ <z3c:widgetTemplate
63
+ widget=".widgets.IEditableMenuSettingsWidget"
64
+ template="templates/editable_menu_settings_widget.pt"
65
+ layer="z3c.form.interfaces.IFormLayer"
66
+ mode="input"
67
+ />
68
+
69
+ </configure>
@@ -0,0 +1,22 @@
1
+ from collective.editablemenu import _
2
+ from collective.editablemenu.browser.interfaces import IEditableMenuSettings
3
+ from plone.app.registry.browser import controlpanel
4
+ from Products.CMFPlone.resources import add_bundle_on_request
5
+
6
+
7
+ class EditableMenuSettingsEditForm(controlpanel.RegistryEditForm):
8
+ """Editablemenu settings form."""
9
+
10
+ schema = IEditableMenuSettings
11
+ id = "EditableMenuSettingsForm"
12
+ label = _("Editable Menu Settings")
13
+
14
+
15
+ class EditableMenuSettingsView(controlpanel.ControlPanelFormWrapper):
16
+ """Editablemenu settings control panel."""
17
+
18
+ form = EditableMenuSettingsEditForm
19
+
20
+ def __call__(self):
21
+ add_bundle_on_request(self.request, "editablemenu-widget-bundle")
22
+ return super().__call__()
@@ -0,0 +1,16 @@
1
+ from .widgets import EditableMenuSettingsFieldWidget
2
+ from collective.editablemenu import _
3
+ from plone.autoform import directives as form
4
+ from plone.supermodel import model
5
+ from zope import schema
6
+
7
+
8
+ class IEditableMenuSettings(model.Schema):
9
+ """Settings used in the control panel for cookiecosent: unified panel"""
10
+
11
+ form.widget(menu_tabs_json=EditableMenuSettingsFieldWidget)
12
+ menu_tabs_json = schema.Text(
13
+ title=_("config_tabs_label", "Menu configuration."),
14
+ required=False,
15
+ default='{"/":[]}',
16
+ )
@@ -0,0 +1,260 @@
1
+ from AccessControl import Unauthorized
2
+ from collective.editablemenu import logger
3
+ from collective.editablemenu.browser.interfaces import IEditableMenuSettings
4
+ from plone import api
5
+ from plone.api.exc import InvalidParameterError
6
+ from plone.memoize import view
7
+ from Products.CMFCore.Expression import Expression
8
+ from Products.CMFCore.Expression import getExprContext
9
+ from Products.CMFCore.interfaces import IFolderish
10
+ from Products.Five import BrowserView
11
+
12
+ import json
13
+ import six
14
+
15
+
16
+ class MenuSupportView(BrowserView):
17
+ """ """
18
+
19
+ @property
20
+ @view.memoize
21
+ def menu_settings(self):
22
+ try:
23
+ return api.portal.get_registry_record(
24
+ "menu_tabs_json", interface=IEditableMenuSettings
25
+ )
26
+ except (InvalidParameterError, KeyError):
27
+ return ""
28
+
29
+ @property
30
+ @view.memoize
31
+ def get_root_site(self):
32
+ return "".join(api.portal.get().getPhysicalPath())
33
+
34
+ @view.memoize
35
+ def find_path_title(self, path):
36
+ if not path:
37
+ return ""
38
+ if path == "/":
39
+ return api.portal.get().Title()
40
+ search_path = f"/{api.portal.get().getId()}{path}"
41
+ results = api.content.find(depth=0, path=search_path)
42
+ if len(results) > 0:
43
+ return results[0].Title
44
+ else:
45
+ return ""
46
+
47
+ def exclude_from_nav(self, item):
48
+ try:
49
+ # Archetypes
50
+ return item.exclude_from_nav()
51
+ except (TypeError, AttributeError):
52
+ # DX Item
53
+ return getattr(item, "exclude_from_nav", False)
54
+
55
+ def choose_site_menu_config(self, settings):
56
+ path = "/".join(self.context.getPhysicalPath())
57
+ root_path = self.get_root_site
58
+ if self.context.id == root_path:
59
+ path = "/"
60
+ else:
61
+ path = path.split(root_path)[1]
62
+
63
+ if not path:
64
+ return "/"
65
+ sites_path = list(settings.keys())
66
+ not_found = True
67
+ while not_found:
68
+ for site_path in sites_path:
69
+ if path == site_path:
70
+ return site_path
71
+ path = "/".join(path.split("/")[:-1])
72
+ if not path:
73
+ return "/"
74
+
75
+ def get_menu_tabs(self):
76
+ context = self.context.aq_inner
77
+ context_path = "/".join(context.getPhysicalPath())
78
+ if not self.menu_settings:
79
+ return []
80
+ settings = json.loads(self.menu_settings)
81
+ if not settings:
82
+ return []
83
+ results = []
84
+
85
+ candidate_site = self.choose_site_menu_config(settings)
86
+ site_tabs = settings.get(candidate_site, [])
87
+
88
+ for i, tab_settings in enumerate(site_tabs):
89
+ # evaluate condition
90
+ condition = tab_settings.get("condition", "")
91
+ expression = Expression(condition)
92
+ expression_context = getExprContext(self.context, self.context)
93
+ value = expression(expression_context)
94
+
95
+ if isinstance(value, str) and value.strip() == "":
96
+ value = True
97
+
98
+ if not value:
99
+ continue
100
+ tab_title = tab_settings.get("tab_title", "")
101
+ if six.PY2 and isinstance(tab_title, str):
102
+ tab_title = tab_title.encode("utf8")
103
+ if not tab_title:
104
+ continue
105
+
106
+ tab_dict = {"index": i}
107
+ # this text is used inside a link, so i can't use portal_transorms
108
+ # because it wraps all inside a <p> tag.
109
+ # I wrap every row inside a span, so they can be easily styled
110
+ rows = tab_title.replace("\r", "").split("\n")
111
+ rows = [f"<span>{x}</span>" for x in rows]
112
+ tab_dict["title"] = "".join(rows)
113
+
114
+ navigation_folder = self.get_navigation_folder(tab_settings)
115
+ # need to do something better
116
+ if navigation_folder == "__skip_this_folder__":
117
+ continue
118
+
119
+ if navigation_folder:
120
+ tab_dict["url"] = navigation_folder.absolute_url()
121
+ tab_dict["selected"] = context_path.startswith(
122
+ "/".join(navigation_folder.getPhysicalPath())
123
+ )
124
+ if tab_settings.get("simple_link", ""):
125
+ tab_dict["url"] = self.fixLink(tab_settings.get("simple_link"))
126
+ tab_dict["clickandgo"] = True
127
+ if tab_settings.get("intro_text", ""):
128
+ tab_dict["intro_text"] = tab_settings["intro_text"]
129
+ if tab_settings.get("section_link", ""):
130
+ tab_dict["section_link"] = tab_settings["section_link"]
131
+ results.append(tab_dict)
132
+ return results
133
+
134
+ def fixLink(self, link):
135
+ if link.startswith("http"):
136
+ return link
137
+ return "{}/{}".format(api.portal.get().absolute_url(), link.lstrip("/"))
138
+
139
+ @view.memoize
140
+ def get_object(self, folder_path):
141
+ if six.PY2 and isinstance(folder_path, str):
142
+ folder_path = folder_path.encode("utf8")
143
+ return api.content.get(path=folder_path)
144
+
145
+ def get_navigation_folder(self, tab_settings):
146
+ folder_path = tab_settings.get("navigation_folder", "")
147
+ if not folder_path:
148
+ return None
149
+ if not folder_path.startswith("/"):
150
+ folder_path = "/" + folder_path
151
+ try:
152
+ obj = self.get_object(folder_path)
153
+ except Unauthorized:
154
+ return "__skip_this_folder__"
155
+ # don't want to check for other exception! need to know if this menu
156
+ # breaks
157
+ return obj
158
+
159
+ @view.memoize
160
+ def get_folder(self, folder_path):
161
+ if six.PY2 and isinstance(folder_path, str):
162
+ folder_path = folder_path.encode("utf8")
163
+ try:
164
+ return api.content.get(path=folder_path)
165
+ except Unauthorized:
166
+ return None
167
+
168
+ def get_additional_columns(self, tab_settings):
169
+ """
170
+ return additional columns set in the settings,
171
+ except the items excluded from nav
172
+ """
173
+ folder_path = tab_settings.get("additional_columns", [])
174
+ if not folder_path:
175
+ return []
176
+ if not folder_path.startswith("/"):
177
+ folder_path = "/" + folder_path
178
+ folder = self.get_folder(folder_path)
179
+ if not folder:
180
+ return []
181
+ # return folder contents not excluded from navigation
182
+ return [x for x in folder.listFolderContents() if not self.exclude_from_nav(x)]
183
+
184
+
185
+ class SubMenuDetailView(MenuSupportView):
186
+ """ """
187
+
188
+ def get_menu_subitems(self, tab_id=None):
189
+ if tab_id is None:
190
+ tab_id = self.request.form.get("tab_id")
191
+ if tab_id is None:
192
+ return {}
193
+ settings = self.get_selected_tab(tab_id)
194
+ if not settings:
195
+ return {}
196
+ return {
197
+ "navigation_folder": self.get_navigation_folder(settings),
198
+ "dynamic_items": self.get_dynamic_items(settings),
199
+ "static_items": self.get_static_items(settings),
200
+ "intro_text": settings.get("intro_text", ""),
201
+ "section_link": settings.get("section_link", ""),
202
+ }
203
+
204
+ def get_selected_tab(self, tab_id):
205
+ if isinstance(tab_id, str):
206
+ try:
207
+ tab_id = int(tab_id)
208
+ except ValueError:
209
+ msg = "Invalid index number ({}). Unable to retrieve configuration.".format( # noqa
210
+ tab_id
211
+ )
212
+ logger.error(msg)
213
+ return None
214
+ settings = json.loads(self.menu_settings)
215
+ if not settings:
216
+ return None
217
+ try:
218
+ candidate_site = self.choose_site_menu_config(settings)
219
+ return settings[candidate_site][tab_id]
220
+ except IndexError:
221
+ logger.error(
222
+ "Index({}) not found in menu settings."
223
+ " Unable to retrieve configuration.".format(tab_id)
224
+ )
225
+ return None
226
+ return None
227
+
228
+ def get_dynamic_items(self, settings):
229
+ navigation_folder = self.get_navigation_folder(settings)
230
+ if not navigation_folder:
231
+ return []
232
+ results = []
233
+ context = self.context.aq_inner
234
+ context_path = "/".join(context.getPhysicalPath())
235
+ if IFolderish.providedBy(navigation_folder):
236
+ for item in navigation_folder.listFolderContents():
237
+ if not self.exclude_from_nav(item):
238
+ item_path = "/".join(item.getPhysicalPath())
239
+ result_dict = {
240
+ "title": item.Title(),
241
+ "description": item.Description() or item.Title(),
242
+ "url": item.absolute_url(),
243
+ "selected": context_path.startswith(item_path),
244
+ }
245
+ results.append(result_dict)
246
+ return results
247
+
248
+ def get_static_items(self, settings):
249
+ additional_columns = self.get_additional_columns(settings)
250
+ if not additional_columns:
251
+ return []
252
+ results = []
253
+ for item in additional_columns:
254
+ text = ""
255
+ text = getattr(item.aq_base, "text", None)
256
+ if text:
257
+ results.append(
258
+ {"id": item.getId(), "text": getattr(text, "output", text)}
259
+ )
260
+ return results
File without changes
@@ -0,0 +1,3 @@
1
+ :root{--editablemenu-submenu-border-top: none;--editablemenu-submenu-border-bottom: none;--editablemenu-submenu-box-shadow: none;--editablemenu-submenu-background: #f6f2ed;--editablemenu-submenu-active-item: var(--bs-link-hover-color);--editablemenu-submenu-link-color: var(--bs-link-color);--editablemenu-submenu-link-hover-color: var(--bs-link-hover-color);--editablemenu-submenu-link-hover-background: none;--editablemenu-submenu-link-decoration: none;--editablemenu-submenu-link-hover-decoration: underline;--editablemenu-submenu-item-border: none;--editablemenu-submenu-mobile-item-active: var(--bs-primary);--editablemenu-submenu-mobile-item-active-color: #fff}#portal-globalnav li a span:not(:last-of-type){display:block}#portal-globalnav-wrapper{position:relative}#mainnavigation ul#portal-globalnav>li{position:unset}#mainnavigation ul#portal-globalnav>li>a{color:var(--bs-navbar-color)}#mainnavigation ul#portal-globalnav>li>a:hover,#mainnavigation ul#portal-globalnav>li>a:active,#mainnavigation ul#portal-globalnav>li>a:focus{color:var(--bs-navbar-hover-color)}#mainnavigation ul#portal-globalnav>li.inPath>a,#mainnavigation ul#portal-globalnav>li.current>a{color:var(--bs-navbar-hover-color)}#mainnavigation ul#portal-globalnav>li #submenu-details{position:absolute;z-index:999;left:0;width:100%;padding:1em 5em;border-top:var(--editablemenu-submenu-border-top);border-bottom:var(--editablemenu-submenu-border-bottom);-webkit-box-shadow:var(--editablemenu-submenu-box-shadow);box-shadow:var(--editablemenu-submenu-box-shadow);background-color:var(--editablemenu-submenu-background)}#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDetailsContent{display:-webkit-box;display:-ms-flexbox;display:flex;gap:2rem}#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper{--bs-navbar-nav-link-padding-x: 0;-webkit-box-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-line-pack:stretch;align-content:stretch;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:space-evenly;-ms-flex-pack:space-evenly;justify-content:space-evenly;padding:0}#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper .staticItem,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper .staticItem{-webkit-box-flex:1;-ms-flex:1 1 25%;flex:1 1 25%;border:none;text-align:left;padding:0 2em}@media(max-width: 1199px){#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper .staticItem,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper .staticItem{-webkit-box-flex:1;-ms-flex:1 1 33.33%;flex:1 1 33.33%}}#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper .staticItem h3,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper .staticItem h3{font-size:1em}#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper .staticItem h3 a,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper .staticItem h3 a{padding:0;color:var(--bs-heading-color);text-align:left;font-weight:bold}#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper .staticItem h3 a:hover,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper .staticItem h3 a:focus,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper .staticItem h3 a:hover,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper .staticItem h3 a:focus{-webkit-text-decoration:var(--editablemenu-submenu-link-hover-decoration);text-decoration:var(--editablemenu-submenu-link-hover-decoration);background-color:var(--editablemenu-submenu-link-hover-background)}#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper ul,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper ul{padding:0;list-style-type:none;position:unset;visibility:visible;opacity:1;height:auto}#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper ul li,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper ul li{padding:.2em 0;border:none;background:none;text-align:left;letter-spacing:normal;color:var(--editablemenu-submenu-link-color)}#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper ul li.current,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper ul li.current{color:var(--editablemenu-submenu-active-item)}#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper ul li:hover,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper ul li:active,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper ul li:focus,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper ul li:hover,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper ul li:active,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper ul li:focus{color:var(--editablemenu-submenu-link-hover-color)}#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper ul li a,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper ul li a{display:inline;color:currentColor;-webkit-text-decoration:var(--editablemenu-submenu-link-decoration);text-decoration:var(--editablemenu-submenu-link-decoration)}#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper ul li a:hover,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper ul li a:active,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuStaticWrapper ul li a:focus,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper ul li a:hover,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper ul li a:active,#mainnavigation ul#portal-globalnav>li #submenu-details .submenuDynamicWrapper ul li a:focus{background-color:var(--editablemenu-submenu-link-hover-background);-webkit-text-decoration:var(--editablemenu-submenu-link-hover-decoration);text-decoration:var(--editablemenu-submenu-link-hover-decoration)}@media(max-width: 1199px){#mainnavigation{--editablemenu-submenu-item-border: 1px solid #e5e0db}#mainnavigation #offcanvasNavbar .offcanvas-header{padding:10px 20px}#mainnavigation #offcanvasNavbar .offcanvas-header.justify-content-end{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}#mainnavigation #offcanvasNavbar .offcanvas-header .btn-close{font-size:36px;margin:0;--bs-btn-close-opacity: 1}#mainnavigation #offcanvasNavbar .offcanvas-body #portal-globalnav{background-color:var(--editablemenu-submenu-background)}#mainnavigation #offcanvasNavbar ul{margin:0}#mainnavigation #offcanvasNavbar ul li{text-align:left;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;border-bottom:var(--editablemenu-submenu-item-border);border-right:none}#mainnavigation #offcanvasNavbar ul li a{text-align:left !important;display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;width:100%;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:15px 30px !important}#mainnavigation #offcanvasNavbar ul li.current,#mainnavigation #offcanvasNavbar ul li:hover,#mainnavigation #offcanvasNavbar ul li.current:hover :focus,#mainnavigation #offcanvasNavbar ul li.current:focus,#mainnavigation #offcanvasNavbar ul li.tabOpen{background-color:var(--editablemenu-submenu-mobile-item-active);border-bottom:unset}#mainnavigation #offcanvasNavbar ul li.current a,#mainnavigation #offcanvasNavbar ul li:hover a,#mainnavigation #offcanvasNavbar ul li.current:hover :focus a,#mainnavigation #offcanvasNavbar ul li.current:focus a,#mainnavigation #offcanvasNavbar ul li.tabOpen a{color:var(--editablemenu-submenu-mobile-item-active-color)}#mainnavigation #offcanvasNavbar ul li #submenu-details{--editablemenu-submenu-border-bottom: none;padding:0;position:unset}#mainnavigation #offcanvasNavbar ul li #submenu-details .submenuStaticWrapper{display:-webkit-box;display:-ms-flexbox;display:flex;padding:0}#mainnavigation #offcanvasNavbar ul li #submenu-details .submenuStaticWrapper .staticItem{border:none;text-align:left;padding:0;-webkit-box-flex:1;-ms-flex:1 1 100%;flex:1 1 100%;width:100%}#mainnavigation #offcanvasNavbar ul li #submenu-details .submenuStaticWrapper .staticItem h3{padding-left:0;padding-right:0;margin:0;border-bottom:var(--editablemenu-submenu-item-border)}#mainnavigation #offcanvasNavbar ul li #submenu-details .submenuStaticWrapper .staticItem ul li{border-bottom:var(--editablemenu-submenu-item-border);padding:0}#mainnavigation #offcanvasNavbar ul li #submenu-details .submenuStaticWrapper .staticItem ul li a{display:inline;padding:10px 2em !important}}
2
+
3
+ /*# sourceMappingURL=editablemenu.min.css.map*/
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editablemenu.min.css","mappings":"AAAA,MACI,wCACA,2CACA,wCACA,2CACA,+DACA,wDACA,oEACA,mDACA,6CACA,wDACA,yCACA,6DACA,sDAGJ,+CACI,cAEJ,0BACI,kBAII,uCACI,eACA,yCACI,6BACA,8IAGI,mCAMJ,iGACI,mCAIR,wDACI,kBACA,YACA,OACA,WACA,gBACA,kDACA,wDACA,4GACA,wDACA,+EACI,qDACA,SAEJ,6JAEI,kCAEA,qCACA,qDACA,qGACA,kCACA,iDACA,oEACA,sFACA,UAEA,qLACI,iDACA,YACA,gBACA,cAEA,0BANJ,qLAOQ,wDAGJ,2LACI,cAEA,+LACI,UACA,8BACA,gBACA,iBAEA,sZAEI,4IAGA,mEAQhB,mKACI,UACA,qBACA,eACA,mBACA,UACA,YAEA,yKACI,eACA,YACA,gBACA,gBACA,sBACA,6CAEA,yLACI,8CAGJ,iiBAGI,mDAKJ,6KACI,eACA,mBACA,gIAGA,6iBAGI,mEAGA,4IAYhC,0BAnIJ,gBAoIQ,sDAII,mDACI,kBAEA,uEACI,sEAGJ,8DACI,eACA,SACA,0BAIJ,mEACI,wDAGR,oCACI,SAEA,uCACI,gBACA,qDACA,yGACA,sDACA,kBAEA,yCACI,2BACA,sFACA,WACA,kEACA,6EACA,6BAGJ,4PAKI,gEAGA,oBAEA,sQACI,2DAMR,wDACI,2CACA,UACA,eAEA,8EACI,qDACA,UAEA,0FACI,YACA,gBACA,UACA,mDACA,WACA,6FACI,eACA,gBACA,SACA,sDAMA,gGACI,sDAGA,UAEA,kGACI,eACA,6B","sources":["webpack://collective.editablemenu/./src/collective/editablemenu/browser/static/sass/editablemenu.scss"],"sourcesContent":[":root {\n --editablemenu-submenu-border-top: none;\n --editablemenu-submenu-border-bottom: none;\n --editablemenu-submenu-box-shadow: none;\n --editablemenu-submenu-background: #f6f2ed;\n --editablemenu-submenu-active-item: var(--bs-link-hover-color);\n --editablemenu-submenu-link-color: var(--bs-link-color);\n --editablemenu-submenu-link-hover-color: var(--bs-link-hover-color);\n --editablemenu-submenu-link-hover-background: none;\n --editablemenu-submenu-link-decoration: none;\n --editablemenu-submenu-link-hover-decoration: underline;\n --editablemenu-submenu-item-border: none;\n --editablemenu-submenu-mobile-item-active: var(--bs-primary);\n --editablemenu-submenu-mobile-item-active-color: #fff;\n}\n\n#portal-globalnav li a span:not(:last-of-type) {\n display: block;\n}\n#portal-globalnav-wrapper {\n position: relative;\n}\n#mainnavigation {\n ul#portal-globalnav {\n > li {\n position: unset;\n > a {\n color: var(--bs-navbar-color);\n &:hover,\n &:active,\n &:focus {\n color: var(--bs-navbar-hover-color);\n }\n }\n\n &.inPath,\n &.current {\n > a {\n color: var(--bs-navbar-hover-color);\n }\n }\n\n #submenu-details {\n position: absolute;\n z-index: 999;\n left: 0;\n width: 100%;\n padding: 1em 5em;\n border-top: var(--editablemenu-submenu-border-top);\n border-bottom: var(--editablemenu-submenu-border-bottom);\n box-shadow: var(--editablemenu-submenu-box-shadow);\n background-color: var(--editablemenu-submenu-background);\n .submenuDetailsContent {\n display: flex;\n gap: 2rem;\n }\n .submenuStaticWrapper,\n .submenuDynamicWrapper {\n --bs-navbar-nav-link-padding-x: 0;\n\n flex: 1;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n align-content: stretch;\n align-items: flex-start;\n justify-content: space-evenly;\n padding: 0;\n\n .staticItem {\n flex: 1 1 25%;\n border: none;\n text-align: left;\n padding: 0 2em;\n\n @media (max-width: 1199px) {\n flex: 1 1 33.33%;\n }\n\n h3 {\n font-size: 1em;\n\n a {\n padding: 0;\n color: var(--bs-heading-color);\n text-align: left;\n font-weight: bold;\n\n &:hover,\n &:focus {\n text-decoration: var(\n --editablemenu-submenu-link-hover-decoration\n );\n background-color: var(\n --editablemenu-submenu-link-hover-background\n );\n }\n }\n }\n }\n\n ul {\n padding: 0;\n list-style-type: none;\n position: unset;\n visibility: visible;\n opacity: 1;\n height: auto;\n\n li {\n padding: 0.2em 0;\n border: none;\n background: none;\n text-align: left;\n letter-spacing: normal;\n color: var(--editablemenu-submenu-link-color);\n\n &.current {\n color: var(--editablemenu-submenu-active-item);\n }\n\n &:hover,\n &:active,\n &:focus {\n color: var(\n --editablemenu-submenu-link-hover-color\n );\n }\n\n a {\n display: inline;\n color: currentColor;\n text-decoration: var(\n --editablemenu-submenu-link-decoration\n );\n &:hover,\n &:active,\n &:focus {\n background-color: var(\n --editablemenu-submenu-link-hover-background\n );\n text-decoration: var(\n --editablemenu-submenu-link-hover-decoration\n );\n }\n }\n }\n }\n }\n }\n }\n }\n\n @media (max-width: 1199px) {\n --editablemenu-submenu-item-border: 1px solid #e5e0db;\n\n //#mobile-menu,\n #offcanvasNavbar {\n .offcanvas-header {\n padding: 10px 20px;\n\n &.justify-content-end {\n justify-content: flex-start;\n }\n\n .btn-close {\n font-size: 36px;\n margin: 0;\n --bs-btn-close-opacity: 1;\n }\n }\n .offcanvas-body {\n #portal-globalnav {\n background-color: var(--editablemenu-submenu-background);\n }\n }\n ul {\n margin: 0;\n\n li {\n text-align: left;\n display: flex;\n flex-direction: column;\n border-bottom: var(--editablemenu-submenu-item-border);\n border-right: none;\n\n a {\n text-align: left !important;\n display: flex !important;\n width: 100%;\n align-items: center;\n justify-content: space-between;\n padding: 15px 30px !important;\n }\n\n &.current,\n &:hover,\n &.current:hover :focus,\n &.current:focus,\n &.tabOpen {\n background-color: var(\n --editablemenu-submenu-mobile-item-active\n );\n border-bottom: unset;\n\n a {\n color: var(\n --editablemenu-submenu-mobile-item-active-color\n );\n }\n }\n\n #submenu-details {\n --editablemenu-submenu-border-bottom: none;\n padding: 0;\n position: unset;\n\n .submenuStaticWrapper {\n display: flex;\n padding: 0;\n\n .staticItem {\n border: none;\n text-align: left;\n padding: 0;\n flex: 1 1 100%;\n width: 100%;\n h3 {\n padding-left: 0;\n padding-right: 0;\n margin: 0;\n border-bottom: var(\n --editablemenu-submenu-item-border\n );\n }\n\n ul {\n li {\n border-bottom: var(\n --editablemenu-submenu-item-border\n );\n padding: 0;\n\n a {\n display: inline;\n padding: 10px 2em !important;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}\n"],"names":[],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ (()=>{var e={411:(e,t,n)=>{var a;!function(r,i){if(r){for(var o,s={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},c={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},u={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},l={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},p=1;p<20;++p)s[111+p]="f"+p;for(p=0;p<=9;++p)s[p+96]=p.toString();y.prototype.bind=function(e,t,n){var a=this;return e=e instanceof Array?e:[e],a._bindMultiple.call(a,e,t,n),a},y.prototype.unbind=function(e,t){return this.bind.call(this,e,function(){},t)},y.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},y.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},y.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(g(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},y.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},y.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(s[t]=e[t]);o=null},y.init=function(){var e=y(i);for(var t in e)"_"!==t.charAt(0)&&(y[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},y.init(),r.Mousetrap=y,e.exports&&(e.exports=y),void 0===(a=function(){return y}.call(t,n,t,e))||(e.exports=a)}function d(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function f(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return s[e.which]?s[e.which]:c[e.which]?c[e.which]:String.fromCharCode(e.which).toLowerCase()}function h(e,t){return e.sort().join(",")===t.sort().join(",")}function b(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function m(e,t,n){return n||(n=function(){if(!o)for(var e in o={},s)e>95&&e<112||s.hasOwnProperty(e)&&(o[s[e]]=e);return o}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function v(e,t){var n,a,r,i=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),r=0;r<n.length;++r)a=n[r],l[a]&&(a=l[a]),t&&"keypress"!=t&&u[a]&&(a=u[a],i.push("shift")),b(a)&&i.push(a);return{key:a,modifiers:i,action:t=m(a,i,t)}}function g(e,t){return null!==e&&e!==i&&(e===t||g(e.parentNode,t))}function y(e){var t=this;if(e=e||i,!(t instanceof y))return new y(e);t.target=e,t._callbacks={},t._directMap={};var n,a={},r=!1,o=!1,s=!1;function c(e){e=e||{};var t,n=!1;for(t in a)e[t]?n=!0:a[t]=0;n||(s=!1)}function u(e,n,r,i,o,s){var c,u,l=[],p=r.type;if(!t._callbacks[e])return[];for("keyup"==p&&b(e)&&(n=[e]),c=0;c<t._callbacks[e].length;++c)if(u=t._callbacks[e][c],(i||!u.seq||a[u.seq]==u.level)&&p==u.action&&("keypress"==p&&!r.metaKey&&!r.ctrlKey||h(n,u.modifiers))){var d=!i&&u.combo==o,f=i&&u.seq==i&&u.level==s;(d||f)&&t._callbacks[e].splice(c,1),l.push(u)}return l}function l(e,n,a,r){t.stopCallback(n,n.target||n.srcElement,a,r)||!1===e(n,a)&&(function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}(n),function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}(n))}function p(e){"number"!=typeof e.which&&(e.which=e.keyCode);var n=f(e);n&&("keyup"!=e.type||r!==n?t.handleKey(n,function(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}(e),e):r=!1)}function m(e,i,o,p,d){t._directMap[e+":"+o]=i;var h,b=(e=e.replace(/\s+/g," ")).split(" ");b.length>1?function(e,t,i,o){function u(t){return function(){s=t,++a[e],clearTimeout(n),n=setTimeout(c,1e3)}}function p(t){l(i,t,e),"keyup"!==o&&(r=f(t)),setTimeout(c,10)}a[e]=0;for(var d=0;d<t.length;++d){var h=d+1===t.length?p:u(o||v(t[d+1]).action);m(t[d],h,o,e,d)}}(e,b,i,o):(h=v(e,o),t._callbacks[h.key]=t._callbacks[h.key]||[],u(h.key,h.modifiers,{type:h.action},p,e,d),t._callbacks[h.key][p?"unshift":"push"]({callback:i,modifiers:h.modifiers,action:h.action,seq:p,level:d,combo:e}))}t._handleKey=function(e,t,n){var a,r=u(e,t,n),i={},p=0,d=!1;for(a=0;a<r.length;++a)r[a].seq&&(p=Math.max(p,r[a].level));for(a=0;a<r.length;++a)if(r[a].seq){if(r[a].level!=p)continue;d=!0,i[r[a].seq]=1,l(r[a].callback,n,r[a].combo,r[a].seq)}else d||l(r[a].callback,n,r[a].combo);var f="keypress"==n.type&&o;n.type!=s||b(e)||f||c(i),o=d&&"keydown"==n.type},t._bindMultiple=function(e,t,n){for(var a=0;a<e.length;++a)m(e[a],t,n)},d(e,"keypress",p),d(e,"keydown",p),d(e,"keyup",p)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}},t={};function n(a){var r=t[a];if(void 0!==r)return r.exports;var i=t[a]={exports:{}};return e[a](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=jQuery;var t=n.n(e),a=n(411),r=n.n(a);t()(function(){var e="editablemenu.submenu.closed",n="editablemenu.submenu.loaded",a="editablemenu.submenu.opened";t()(document).on("click",function(e){t()(e.target).closest("#mainnavigation").length||(t()("#mainnavigation #submenu-details").slideUp(),t()(".tabOpen a").attr("aria-expanded",!1),t()(".tabOpen").removeClass("tabOpen"))}),r().bind("esc",function(){t()(".tabOpen").length>0&&(t()(".tabOpen a").attr("aria-expanded",!1),t()(".tabOpen a.menuTabLink").trigger(e),t()(".tabOpen").removeClass("tabOpen"),t()("#mainnavigation #submenu-details").slideUp())}),t()("a.menuTabLink").on("click",function(r){if(t()(r.currentTarget).hasClass("clickandgo"))return!0;r.preventDefault();var i=t()(this),o=i.data().tabid,s=i.parent(),c=t()("#mainnavigation #submenu-details");if(void 0!==o){if(s.hasClass("tabOpen"))return t()(".tabOpen a").attr("aria-expanded",!1),t()(".tabOpen").removeClass("tabOpen"),void c.slideUp(400,function(){i.trigger(e)});if(t()(".tabOpen a").attr("aria-expanded",!1),t()(".tabOpen").removeClass("tabOpen"),s.addClass("tabOpen"),s.find("a").attr("aria-expanded",!0),1===c.length&&parseInt(c.attr("class").slice(8),10)===o)return void c.slideDown(400,function(){i.trigger(a)});var u=document.body.dataset.baseUrl||"";t().get(u+"/@@submenu_detail_view?tab_id="+o,function(e){var r,c=/<script.*?id="protect-script".*?<\/script>/g,u=e;do{r=u,u=u.replace(c,"")}while(u!==r);var l=t()("#mainnavigation #submenu-details");if(!u.trim())return l.length>0&&l.slideUp(200,function(){t()(this).remove()}),t()(".tabOpen a").attr("aria-expanded",!1),t()(".tabOpen").removeClass("tabOpen"),void i.trigger(n);var p=t()('<div id="submenu-details" class="submenu-'.concat(o,'">').concat(u,"</div>")).hide();l.length>0?l.slideUp(200,function(){t()(this).remove(),s.append(p),p.slideDown(400,function(){i.trigger(n),i.trigger(a)})}):(s.append(p),p.slideDown(400,function(){i.trigger(n),i.trigger(a)}))})}}),t()("#portal-top").on("click",".submenuDetailsContent a",function(){t()(this).focus()}),t()("#mainnavigation").on("click","a.closeSubmenuLink",function(n){n.preventDefault();var a=t()(this);t()(".tabOpen a").attr("aria-expanded",!1),t()(".tabOpen").removeClass("tabOpen"),t()("#mainnavigation #submenu-details").slideUp(400,function(){a.trigger(e)});var r=t()(a.parents("#submenu-details"));if(0!==r.length){var i=r.attr("class").slice(8),o=t()('*[data-tabid="'+i+'"]');1===o.length&&t()(o).focus()}})})})()})();
2
+ //# sourceMappingURL=editablemenu.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editablemenu.min.js","mappings":"2B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EAChB,GAEJ,EAhFA,CAiFF,GAEAD,IAAE,eAAeE,GAAG,QAAS,2BAA4B,WACvDF,IAAEpI,MAAMuK,OACV,GAEAnC,IAAE,mBAAmBE,GAAG,QAAS,qBAAsB,SAAS5H,GAC9DA,EAAE4E,iBACF,IAAMyD,EAAQX,IAAEpI,MAChBoI,IAAE,cAAcM,KAAK,iBAAiB,GACtCN,IAAE,YAAYO,YAAY,WAC1BP,IAAE,oCAAoCK,QAAQ,IAAK,WACjDM,EAAM1I,QAAQgI,EAChB,GACA,IAAMc,EAASf,IAAEW,EAAMyB,QAAQ,qBAC/B,GAAsB,IAAlBrB,EAAO7F,OAAX,CAIA,IAAMmH,EAAUtB,EAAOT,KAAK,SAASc,MAAM,GACrCkB,EAAatC,IAAE,iBAAmBqC,EAAU,MACxB,IAAtBC,EAAWpH,QACb8E,IAAEsC,GAAYH,OALhB,CAOF,EACF,E","sources":["webpack://collective.editablemenu/./node_modules/mousetrap/mousetrap.js","webpack://collective.editablemenu/webpack/bootstrap","webpack://collective.editablemenu/webpack/runtime/compat get default export","webpack://collective.editablemenu/webpack/runtime/define property getters","webpack://collective.editablemenu/webpack/runtime/hasOwnProperty shorthand","webpack://collective.editablemenu/external var \"jQuery\"","webpack://collective.editablemenu/./src/collective/editablemenu/browser/static/js/editablemenu.js"],"sourcesContent":["/*global define:false */\n/**\n * Copyright 2012-2017 Craig Campbell\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Mousetrap is a simple keyboard shortcut library for Javascript with\n * no external dependencies\n *\n * @version 1.6.5\n * @url craig.is/killing/mice\n */\n(function(window, document, undefined) {\n\n // Check if mousetrap is used inside browser, if not, return\n if (!window) {\n return;\n }\n\n /**\n * mapping of special keycodes to their corresponding keys\n *\n * everything in this dictionary cannot use keypress events\n * so it has to be here to map to the correct keycodes for\n * keyup/keydown events\n *\n * @type {Object}\n */\n var _MAP = {\n 8: 'backspace',\n 9: 'tab',\n 13: 'enter',\n 16: 'shift',\n 17: 'ctrl',\n 18: 'alt',\n 20: 'capslock',\n 27: 'esc',\n 32: 'space',\n 33: 'pageup',\n 34: 'pagedown',\n 35: 'end',\n 36: 'home',\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down',\n 45: 'ins',\n 46: 'del',\n 91: 'meta',\n 93: 'meta',\n 224: 'meta'\n };\n\n /**\n * mapping for special characters so they can support\n *\n * this dictionary is only used incase you want to bind a\n * keyup or keydown event to one of these keys\n *\n * @type {Object}\n */\n var _KEYCODE_MAP = {\n 106: '*',\n 107: '+',\n 109: '-',\n 110: '.',\n 111 : '/',\n 186: ';',\n 187: '=',\n 188: ',',\n 189: '-',\n 190: '.',\n 191: '/',\n 192: '`',\n 219: '[',\n 220: '\\\\',\n 221: ']',\n 222: '\\''\n };\n\n /**\n * this is a mapping of keys that require shift on a US keypad\n * back to the non shift equivelents\n *\n * this is so you can use keyup events with these keys\n *\n * note that this will only work reliably on US keyboards\n *\n * @type {Object}\n */\n var _SHIFT_MAP = {\n '~': '`',\n '!': '1',\n '@': '2',\n '#': '3',\n '$': '4',\n '%': '5',\n '^': '6',\n '&': '7',\n '*': '8',\n '(': '9',\n ')': '0',\n '_': '-',\n '+': '=',\n ':': ';',\n '\\\"': '\\'',\n '<': ',',\n '>': '.',\n '?': '/',\n '|': '\\\\'\n };\n\n /**\n * this is a list of special strings you can use to map\n * to modifier keys when you specify your keyboard shortcuts\n *\n * @type {Object}\n */\n var _SPECIAL_ALIASES = {\n 'option': 'alt',\n 'command': 'meta',\n 'return': 'enter',\n 'escape': 'esc',\n 'plus': '+',\n 'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'\n };\n\n /**\n * variable to store the flipped version of _MAP from above\n * needed to check if we should use keypress or not when no action\n * is specified\n *\n * @type {Object|undefined}\n */\n var _REVERSE_MAP;\n\n /**\n * loop through the f keys, f1 to f19 and add them to the map\n * programatically\n */\n for (var i = 1; i < 20; ++i) {\n _MAP[111 + i] = 'f' + i;\n }\n\n /**\n * loop through to map numbers on the numeric keypad\n */\n for (i = 0; i <= 9; ++i) {\n\n // This needs to use a string cause otherwise since 0 is falsey\n // mousetrap will never fire for numpad 0 pressed as part of a keydown\n // event.\n //\n // @see https://github.com/ccampbell/mousetrap/pull/258\n _MAP[i + 96] = i.toString();\n }\n\n /**\n * cross browser add event method\n *\n * @param {Element|HTMLDocument} object\n * @param {string} type\n * @param {Function} callback\n * @returns void\n */\n function _addEvent(object, type, callback) {\n if (object.addEventListener) {\n object.addEventListener(type, callback, false);\n return;\n }\n\n object.attachEvent('on' + type, callback);\n }\n\n /**\n * takes the event and returns the key character\n *\n * @param {Event} e\n * @return {string}\n */\n function _characterFromEvent(e) {\n\n // for keypress events we should return the character as is\n if (e.type == 'keypress') {\n var character = String.fromCharCode(e.which);\n\n // if the shift key is not pressed then it is safe to assume\n // that we want the character to be lowercase. this means if\n // you accidentally have caps lock on then your key bindings\n // will continue to work\n //\n // the only side effect that might not be desired is if you\n // bind something like 'A' cause you want to trigger an\n // event when capital A is pressed caps lock will no longer\n // trigger the event. shift+a will though.\n if (!e.shiftKey) {\n character = character.toLowerCase();\n }\n\n return character;\n }\n\n // for non keypress events the special maps are needed\n if (_MAP[e.which]) {\n return _MAP[e.which];\n }\n\n if (_KEYCODE_MAP[e.which]) {\n return _KEYCODE_MAP[e.which];\n }\n\n // if it is not in the special map\n\n // with keydown and keyup events the character seems to always\n // come in as an uppercase character whether you are pressing shift\n // or not. we should make sure it is always lowercase for comparisons\n return String.fromCharCode(e.which).toLowerCase();\n }\n\n /**\n * checks if two arrays are equal\n *\n * @param {Array} modifiers1\n * @param {Array} modifiers2\n * @returns {boolean}\n */\n function _modifiersMatch(modifiers1, modifiers2) {\n return modifiers1.sort().join(',') === modifiers2.sort().join(',');\n }\n\n /**\n * takes a key event and figures out what the modifiers are\n *\n * @param {Event} e\n * @returns {Array}\n */\n function _eventModifiers(e) {\n var modifiers = [];\n\n if (e.shiftKey) {\n modifiers.push('shift');\n }\n\n if (e.altKey) {\n modifiers.push('alt');\n }\n\n if (e.ctrlKey) {\n modifiers.push('ctrl');\n }\n\n if (e.metaKey) {\n modifiers.push('meta');\n }\n\n return modifiers;\n }\n\n /**\n * prevents default for this event\n *\n * @param {Event} e\n * @returns void\n */\n function _preventDefault(e) {\n if (e.preventDefault) {\n e.preventDefault();\n return;\n }\n\n e.returnValue = false;\n }\n\n /**\n * stops propogation for this event\n *\n * @param {Event} e\n * @returns void\n */\n function _stopPropagation(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n return;\n }\n\n e.cancelBubble = true;\n }\n\n /**\n * determines if the keycode specified is a modifier key or not\n *\n * @param {string} key\n * @returns {boolean}\n */\n function _isModifier(key) {\n return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';\n }\n\n /**\n * reverses the map lookup so that we can look for specific keys\n * to see what can and can't use keypress\n *\n * @return {Object}\n */\n function _getReverseMap() {\n if (!_REVERSE_MAP) {\n _REVERSE_MAP = {};\n for (var key in _MAP) {\n\n // pull out the numeric keypad from here cause keypress should\n // be able to detect the keys from the character\n if (key > 95 && key < 112) {\n continue;\n }\n\n if (_MAP.hasOwnProperty(key)) {\n _REVERSE_MAP[_MAP[key]] = key;\n }\n }\n }\n return _REVERSE_MAP;\n }\n\n /**\n * picks the best action based on the key combination\n *\n * @param {string} key - character for key\n * @param {Array} modifiers\n * @param {string=} action passed in\n */\n function _pickBestAction(key, modifiers, action) {\n\n // if no action was picked in we should try to pick the one\n // that we think would work best for this key\n if (!action) {\n action = _getReverseMap()[key] ? 'keydown' : 'keypress';\n }\n\n // modifier keys don't work as expected with keypress,\n // switch to keydown\n if (action == 'keypress' && modifiers.length) {\n action = 'keydown';\n }\n\n return action;\n }\n\n /**\n * Converts from a string key combination to an array\n *\n * @param {string} combination like \"command+shift+l\"\n * @return {Array}\n */\n function _keysFromString(combination) {\n if (combination === '+') {\n return ['+'];\n }\n\n combination = combination.replace(/\\+{2}/g, '+plus');\n return combination.split('+');\n }\n\n /**\n * Gets info for a specific key combination\n *\n * @param {string} combination key combination (\"command+s\" or \"a\" or \"*\")\n * @param {string=} action\n * @returns {Object}\n */\n function _getKeyInfo(combination, action) {\n var keys;\n var key;\n var i;\n var modifiers = [];\n\n // take the keys from this pattern and figure out what the actual\n // pattern is all about\n keys = _keysFromString(combination);\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n\n // normalize key names\n if (_SPECIAL_ALIASES[key]) {\n key = _SPECIAL_ALIASES[key];\n }\n\n // if this is not a keypress event then we should\n // be smart about using shift keys\n // this will only work for US keyboards however\n if (action && action != 'keypress' && _SHIFT_MAP[key]) {\n key = _SHIFT_MAP[key];\n modifiers.push('shift');\n }\n\n // if this key is a modifier then add it to the list of modifiers\n if (_isModifier(key)) {\n modifiers.push(key);\n }\n }\n\n // depending on what the key combination is\n // we will try to pick the best event for it\n action = _pickBestAction(key, modifiers, action);\n\n return {\n key: key,\n modifiers: modifiers,\n action: action\n };\n }\n\n function _belongsTo(element, ancestor) {\n if (element === null || element === document) {\n return false;\n }\n\n if (element === ancestor) {\n return true;\n }\n\n return _belongsTo(element.parentNode, ancestor);\n }\n\n function Mousetrap(targetElement) {\n var self = this;\n\n targetElement = targetElement || document;\n\n if (!(self instanceof Mousetrap)) {\n return new Mousetrap(targetElement);\n }\n\n /**\n * element to attach key events to\n *\n * @type {Element}\n */\n self.target = targetElement;\n\n /**\n * a list of all the callbacks setup via Mousetrap.bind()\n *\n * @type {Object}\n */\n self._callbacks = {};\n\n /**\n * direct map of string combinations to callbacks used for trigger()\n *\n * @type {Object}\n */\n self._directMap = {};\n\n /**\n * keeps track of what level each sequence is at since multiple\n * sequences can start out with the same sequence\n *\n * @type {Object}\n */\n var _sequenceLevels = {};\n\n /**\n * variable to store the setTimeout call\n *\n * @type {null|number}\n */\n var _resetTimer;\n\n /**\n * temporary state where we will ignore the next keyup\n *\n * @type {boolean|string}\n */\n var _ignoreNextKeyup = false;\n\n /**\n * temporary state where we will ignore the next keypress\n *\n * @type {boolean}\n */\n var _ignoreNextKeypress = false;\n\n /**\n * are we currently inside of a sequence?\n * type of action (\"keyup\" or \"keydown\" or \"keypress\") or false\n *\n * @type {boolean|string}\n */\n var _nextExpectedAction = false;\n\n /**\n * resets all sequence counters except for the ones passed in\n *\n * @param {Object} doNotReset\n * @returns void\n */\n function _resetSequences(doNotReset) {\n doNotReset = doNotReset || {};\n\n var activeSequences = false,\n key;\n\n for (key in _sequenceLevels) {\n if (doNotReset[key]) {\n activeSequences = true;\n continue;\n }\n _sequenceLevels[key] = 0;\n }\n\n if (!activeSequences) {\n _nextExpectedAction = false;\n }\n }\n\n /**\n * finds all callbacks that match based on the keycode, modifiers,\n * and action\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event|Object} e\n * @param {string=} sequenceName - name of the sequence we are looking for\n * @param {string=} combination\n * @param {number=} level\n * @returns {Array}\n */\n function _getMatches(character, modifiers, e, sequenceName, combination, level) {\n var i;\n var callback;\n var matches = [];\n var action = e.type;\n\n // if there are no events related to this keycode\n if (!self._callbacks[character]) {\n return [];\n }\n\n // if a modifier key is coming up on its own we should allow it\n if (action == 'keyup' && _isModifier(character)) {\n modifiers = [character];\n }\n\n // loop through all callbacks for the key that was pressed\n // and see if any of them match\n for (i = 0; i < self._callbacks[character].length; ++i) {\n callback = self._callbacks[character][i];\n\n // if a sequence name is not specified, but this is a sequence at\n // the wrong level then move onto the next match\n if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {\n continue;\n }\n\n // if the action we are looking for doesn't match the action we got\n // then we should keep going\n if (action != callback.action) {\n continue;\n }\n\n // if this is a keypress event and the meta key and control key\n // are not pressed that means that we need to only look at the\n // character, otherwise check the modifiers as well\n //\n // chrome will not fire a keypress if meta or control is down\n // safari will fire a keypress if meta or meta+shift is down\n // firefox will fire a keypress if meta or control is down\n if ((action == 'keypress' && !e.metaKey && !e.ctrlKey) || _modifiersMatch(modifiers, callback.modifiers)) {\n\n // when you bind a combination or sequence a second time it\n // should overwrite the first one. if a sequenceName or\n // combination is specified in this call it does just that\n //\n // @todo make deleting its own method?\n var deleteCombo = !sequenceName && callback.combo == combination;\n var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;\n if (deleteCombo || deleteSequence) {\n self._callbacks[character].splice(i, 1);\n }\n\n matches.push(callback);\n }\n }\n\n return matches;\n }\n\n /**\n * actually calls the callback function\n *\n * if your callback function returns false this will use the jquery\n * convention - prevent default and stop propogation on the event\n *\n * @param {Function} callback\n * @param {Event} e\n * @returns void\n */\n function _fireCallback(callback, e, combo, sequence) {\n\n // if this event should not happen stop here\n if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {\n return;\n }\n\n if (callback(e, combo) === false) {\n _preventDefault(e);\n _stopPropagation(e);\n }\n }\n\n /**\n * handles a character key event\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event} e\n * @returns void\n */\n self._handleKey = function(character, modifiers, e) {\n var callbacks = _getMatches(character, modifiers, e);\n var i;\n var doNotReset = {};\n var maxLevel = 0;\n var processedSequenceCallback = false;\n\n // Calculate the maxLevel for sequences so we can only execute the longest callback sequence\n for (i = 0; i < callbacks.length; ++i) {\n if (callbacks[i].seq) {\n maxLevel = Math.max(maxLevel, callbacks[i].level);\n }\n }\n\n // loop through matching callbacks for this key event\n for (i = 0; i < callbacks.length; ++i) {\n\n // fire for all sequence callbacks\n // this is because if for example you have multiple sequences\n // bound such as \"g i\" and \"g t\" they both need to fire the\n // callback for matching g cause otherwise you can only ever\n // match the first one\n if (callbacks[i].seq) {\n\n // only fire callbacks for the maxLevel to prevent\n // subsequences from also firing\n //\n // for example 'a option b' should not cause 'option b' to fire\n // even though 'option b' is part of the other sequence\n //\n // any sequences that do not match here will be discarded\n // below by the _resetSequences call\n if (callbacks[i].level != maxLevel) {\n continue;\n }\n\n processedSequenceCallback = true;\n\n // keep a list of which sequences were matches for later\n doNotReset[callbacks[i].seq] = 1;\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);\n continue;\n }\n\n // if there were no sequence matches but we are still here\n // that means this is a regular match so we should fire that\n if (!processedSequenceCallback) {\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo);\n }\n }\n\n // if the key you pressed matches the type of sequence without\n // being a modifier (ie \"keyup\" or \"keypress\") then we should\n // reset all sequences that were not matched by this event\n //\n // this is so, for example, if you have the sequence \"h a t\" and you\n // type \"h e a r t\" it does not match. in this case the \"e\" will\n // cause the sequence to reset\n //\n // modifier keys are ignored because you can have a sequence\n // that contains modifiers such as \"enter ctrl+space\" and in most\n // cases the modifier key will be pressed before the next key\n //\n // also if you have a sequence such as \"ctrl+b a\" then pressing the\n // \"b\" key will trigger a \"keypress\" and a \"keydown\"\n //\n // the \"keydown\" is expected when there is a modifier, but the\n // \"keypress\" ends up matching the _nextExpectedAction since it occurs\n // after and that causes the sequence to reset\n //\n // we ignore keypresses in a sequence that directly follow a keydown\n // for the same character\n var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;\n if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {\n _resetSequences(doNotReset);\n }\n\n _ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';\n };\n\n /**\n * handles a keydown event\n *\n * @param {Event} e\n * @returns void\n */\n function _handleKeyEvent(e) {\n\n // normalize e.which for key events\n // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion\n if (typeof e.which !== 'number') {\n e.which = e.keyCode;\n }\n\n var character = _characterFromEvent(e);\n\n // no character found then stop\n if (!character) {\n return;\n }\n\n // need to use === for the character check because the character can be 0\n if (e.type == 'keyup' && _ignoreNextKeyup === character) {\n _ignoreNextKeyup = false;\n return;\n }\n\n self.handleKey(character, _eventModifiers(e), e);\n }\n\n /**\n * called to set a 1 second timeout on the specified sequence\n *\n * this is so after each key press in the sequence you have 1 second\n * to press the next key before you have to start over\n *\n * @returns void\n */\n function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }\n\n /**\n * binds a key sequence to an event\n *\n * @param {string} combo - combo specified in bind call\n * @param {Array} keys\n * @param {Function} callback\n * @param {string=} action\n * @returns void\n */\n function _bindSequence(combo, keys, callback, action) {\n\n // start off by adding a sequence level record for this combination\n // and setting the level to 0\n _sequenceLevels[combo] = 0;\n\n /**\n * callback to increase the sequence level for this sequence and reset\n * all other sequences that were active\n *\n * @param {string} nextAction\n * @returns {Function}\n */\n function _increaseSequence(nextAction) {\n return function() {\n _nextExpectedAction = nextAction;\n ++_sequenceLevels[combo];\n _resetSequenceTimer();\n };\n }\n\n /**\n * wraps the specified callback inside of another function in order\n * to reset all sequence counters as soon as this sequence is done\n *\n * @param {Event} e\n * @returns void\n */\n function _callbackAndReset(e) {\n _fireCallback(callback, e, combo);\n\n // we should ignore the next key up if the action is key down\n // or keypress. this is so if you finish a sequence and\n // release the key the final key will not trigger a keyup\n if (action !== 'keyup') {\n _ignoreNextKeyup = _characterFromEvent(e);\n }\n\n // weird race condition if a sequence ends with the key\n // another sequence begins with\n setTimeout(_resetSequences, 10);\n }\n\n // loop through keys one at a time and bind the appropriate callback\n // function. for any key leading up to the final one it should\n // increase the sequence. after the final, it should reset all sequences\n //\n // if an action is specified in the original bind call then that will\n // be used throughout. otherwise we will pass the action that the\n // next key in the sequence should match. this allows a sequence\n // to mix and match keypress and keydown events depending on which\n // ones are better suited to the key provided\n for (var i = 0; i < keys.length; ++i) {\n var isFinal = i + 1 === keys.length;\n var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);\n _bindSingle(keys[i], wrappedCallback, action, combo, i);\n }\n }\n\n /**\n * binds a single keyboard combination\n *\n * @param {string} combination\n * @param {Function} callback\n * @param {string=} action\n * @param {string=} sequenceName - name of sequence if part of sequence\n * @param {number=} level - what part of the sequence the command is\n * @returns void\n */\n function _bindSingle(combination, callback, action, sequenceName, level) {\n\n // store a direct mapped reference for use with Mousetrap.trigger\n self._directMap[combination + ':' + action] = callback;\n\n // make sure multiple spaces in a row become a single space\n combination = combination.replace(/\\s+/g, ' ');\n\n var sequence = combination.split(' ');\n var info;\n\n // if this pattern is a sequence of keys then run through this method\n // to reprocess each pattern one key at a time\n if (sequence.length > 1) {\n _bindSequence(combination, sequence, callback, action);\n return;\n }\n\n info = _getKeyInfo(combination, action);\n\n // make sure to initialize array if this is the first time\n // a callback is added for this key\n self._callbacks[info.key] = self._callbacks[info.key] || [];\n\n // remove an existing match if there is one\n _getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level);\n\n // add this call back to the array\n // if it is a sequence put it at the beginning\n // if not put it at the end\n //\n // this is important because the way these are processed expects\n // the sequence ones to come first\n self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({\n callback: callback,\n modifiers: info.modifiers,\n action: info.action,\n seq: sequenceName,\n level: level,\n combo: combination\n });\n }\n\n /**\n * binds multiple combinations to the same callback\n *\n * @param {Array} combinations\n * @param {Function} callback\n * @param {string|undefined} action\n * @returns void\n */\n self._bindMultiple = function(combinations, callback, action) {\n for (var i = 0; i < combinations.length; ++i) {\n _bindSingle(combinations[i], callback, action);\n }\n };\n\n // start!\n _addEvent(targetElement, 'keypress', _handleKeyEvent);\n _addEvent(targetElement, 'keydown', _handleKeyEvent);\n _addEvent(targetElement, 'keyup', _handleKeyEvent);\n }\n\n /**\n * binds an event to mousetrap\n *\n * can be a single key, a combination of keys separated with +,\n * an array of keys, or a sequence of keys separated by spaces\n *\n * be sure to list the modifier keys first to make sure that the\n * correct key ends up getting bound (the last key in the pattern)\n *\n * @param {string|Array} keys\n * @param {Function} callback\n * @param {string=} action - 'keypress', 'keydown', or 'keyup'\n * @returns void\n */\n Mousetrap.prototype.bind = function(keys, callback, action) {\n var self = this;\n keys = keys instanceof Array ? keys : [keys];\n self._bindMultiple.call(self, keys, callback, action);\n return self;\n };\n\n /**\n * unbinds an event to mousetrap\n *\n * the unbinding sets the callback function of the specified key combo\n * to an empty function and deletes the corresponding key in the\n * _directMap dict.\n *\n * TODO: actually remove this from the _callbacks dictionary instead\n * of binding an empty function\n *\n * the keycombo+action has to be exactly the same as\n * it was defined in the bind method\n *\n * @param {string|Array} keys\n * @param {string} action\n * @returns void\n */\n Mousetrap.prototype.unbind = function(keys, action) {\n var self = this;\n return self.bind.call(self, keys, function() {}, action);\n };\n\n /**\n * triggers an event that has already been bound\n *\n * @param {string} keys\n * @param {string=} action\n * @returns void\n */\n Mousetrap.prototype.trigger = function(keys, action) {\n var self = this;\n if (self._directMap[keys + ':' + action]) {\n self._directMap[keys + ':' + action]({}, keys);\n }\n return self;\n };\n\n /**\n * resets the library back to its initial state. this is useful\n * if you want to clear out the current keyboard shortcuts and bind\n * new ones - for example if you switch to another page\n *\n * @returns void\n */\n Mousetrap.prototype.reset = function() {\n var self = this;\n self._callbacks = {};\n self._directMap = {};\n return self;\n };\n\n /**\n * should we stop this event before firing off callbacks\n *\n * @param {Event} e\n * @param {Element} element\n * @return {boolean}\n */\n Mousetrap.prototype.stopCallback = function(e, element) {\n var self = this;\n\n // if the element has the class \"mousetrap\" then no need to stop\n if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {\n return false;\n }\n\n if (_belongsTo(element, self.target)) {\n return false;\n }\n\n // Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,\n // not the initial event target in the shadow tree. Note that not all events cross the\n // shadow boundary.\n // For shadow trees with `mode: 'open'`, the initial event target is the first element in\n // the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event\n // target cannot be obtained.\n if ('composedPath' in e && typeof e.composedPath === 'function') {\n // For open shadow trees, update `element` so that the following check works.\n var initialEventTarget = e.composedPath()[0];\n if (initialEventTarget !== e.target) {\n element = initialEventTarget;\n }\n }\n\n // stop for input, select, and textarea\n return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;\n };\n\n /**\n * exposes _handleKey publicly so it can be overwritten by extensions\n */\n Mousetrap.prototype.handleKey = function() {\n var self = this;\n return self._handleKey.apply(self, arguments);\n };\n\n /**\n * allow custom key mappings\n */\n Mousetrap.addKeycodes = function(object) {\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n _MAP[key] = object[key];\n }\n }\n _REVERSE_MAP = null;\n };\n\n /**\n * Init the global mousetrap functions\n *\n * This method is needed to allow the global mousetrap functions to work\n * now that mousetrap is a constructor function.\n */\n Mousetrap.init = function() {\n var documentMousetrap = Mousetrap(document);\n for (var method in documentMousetrap) {\n if (method.charAt(0) !== '_') {\n Mousetrap[method] = (function(method) {\n return function() {\n return documentMousetrap[method].apply(documentMousetrap, arguments);\n };\n } (method));\n }\n }\n };\n\n Mousetrap.init();\n\n // expose mousetrap to the global object\n window.Mousetrap = Mousetrap;\n\n // expose as a common js module\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Mousetrap;\n }\n\n // expose mousetrap as an AMD module\n if (typeof define === 'function' && define.amd) {\n define(function() {\n return Mousetrap;\n });\n }\n}) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","const __WEBPACK_NAMESPACE_OBJECT__ = jQuery;","import $ from 'jquery';\nimport mousetrap from 'mousetrap';\n// import '../sass/editablemenu.scss';\n\n// In Plone 6, il codice viene eseguito dopo il caricamento del DOM di default.\n// Ma usare $(function() { ... }) è ancora una buona pratica per chiarezza.\n$(function() {\n const customEvents = {\n closed: 'editablemenu.submenu.closed',\n loaded: 'editablemenu.submenu.loaded',\n opened: 'editablemenu.submenu.opened',\n };\n\n // Chiude il sottomenù se si clicca fuori dalla navigazione\n $(document).on('click', function(event) {\n if (!$(event.target).closest('#mainnavigation').length) {\n $('#mainnavigation #submenu-details').slideUp();\n $('.tabOpen a').attr('aria-expanded', false);\n $('.tabOpen').removeClass('tabOpen');\n }\n });\n\n // Associa il tasto 'esc' per chiudere il sottomenù\n mousetrap.bind('esc', function() {\n if ($('.tabOpen').length > 0) {\n $('.tabOpen a').attr('aria-expanded', false);\n $('.tabOpen a.menuTabLink').trigger(customEvents.closed);\n $('.tabOpen').removeClass('tabOpen');\n $('#mainnavigation #submenu-details').slideUp();\n }\n });\n\n $('a.menuTabLink').on('click', function(e) {\n if ($(e.currentTarget).hasClass('clickandgo')) {\n return true;\n }\n e.preventDefault();\n const $this = $(this);\n const tabid = $this.data().tabid;\n const container = $this.parent();\n const submenu = $('#mainnavigation #submenu-details');\n if (tabid === undefined) {\n return;\n }\n if (container.hasClass('tabOpen')) {\n // Chiude il sottomenù\n $('.tabOpen a').attr('aria-expanded', false);\n $('.tabOpen').removeClass('tabOpen');\n submenu.slideUp(400, function() {\n $this.trigger(customEvents.closed);\n });\n return;\n }\n // Altrimenti, apre un menù\n $('.tabOpen a').attr('aria-expanded', false);\n $('.tabOpen').removeClass('tabOpen');\n container.addClass('tabOpen');\n container.find('a').attr('aria-expanded', true);\n\n if (submenu.length === 1) {\n const submenu_tabid = parseInt(submenu.attr('class').slice(8), 10);\n if (submenu_tabid === tabid) {\n // Riapre lo stesso sottomenù già caricato\n submenu.slideDown(400, function() {\n $this.trigger(customEvents.opened);\n });\n return;\n }\n }\n\n // [MODIFICA CHIAVE] Ottiene il baseUrl in modo moderno\n const baseUrl = document.body.dataset.baseUrl || '';\n $.get(baseUrl + '/@@submenu_detail_view?tab_id=' + tabid, function(data) {\n const scriptRegex = /<script.*?id=\"protect-script\".*?<\\/script>/g;\n let prevData, newData = data;\n do {\n prevData = newData;\n newData = newData.replace(scriptRegex, '');\n } while (newData !== prevData);\n const $oldSubmenu = $('#mainnavigation #submenu-details');\n\n // Se il contenuto ricevuto è vuoto, non fare nulla e chiudi il menu\n if (!newData.trim()) {\n if ($oldSubmenu.length > 0) {\n $oldSubmenu.slideUp(200, function() {\n $(this).remove();\n });\n }\n $('.tabOpen a').attr('aria-expanded', false);\n $('.tabOpen').removeClass('tabOpen');\n $this.trigger(customEvents.loaded);\n return;\n }\n\n // 1. Crea il nuovo sottomenù come oggetto jQuery, ma tienilo nascosto\n // e fuori dal DOM per ora.\n const $newSubmenu = $(\n `<div id=\"submenu-details\" class=\"submenu-${tabid}\">${newData}</div>`\n ).hide();\n\n // 2. Controlla se un sottomenù è GIA' aperto\n if ($oldSubmenu.length > 0) {\n // Se sì, chiudilo con un'animazione.\n // Esegui il resto del codice SOLO QUANDO l'animazione è finita.\n $oldSubmenu.slideUp(200, function() {\n // 3. ORA che è nascosto, rimuovilo dal DOM\n $(this).remove();\n\n // 4. Aggiungi il nuovo sottomenù e mostralo con un'animazione\n container.append($newSubmenu);\n $newSubmenu.slideDown(400, function() {\n $this.trigger(customEvents.loaded);\n $this.trigger(customEvents.opened);\n });\n });\n } else {\n // 5. Se nessun sottomenù era aperto, aggiungi semplicemente quello nuovo\n container.append($newSubmenu);\n $newSubmenu.slideDown(400, function() {\n $this.trigger(customEvents.loaded);\n $this.trigger(customEvents.opened);\n });\n }\n });\n });\n\n $('#portal-top').on('click', '.submenuDetailsContent a', function() {\n $(this).focus();\n });\n\n $('#mainnavigation').on('click', 'a.closeSubmenuLink', function(e) {\n e.preventDefault();\n const $this = $(this);\n $('.tabOpen a').attr('aria-expanded', false);\n $('.tabOpen').removeClass('tabOpen');\n $('#mainnavigation #submenu-details').slideUp(400, function() {\n $this.trigger(customEvents.closed);\n });\n const parent = $($this.parents('#submenu-details'));\n if (parent.length === 0) {\n return;\n }\n // La classe inizia con \"submenu-\"\n const link_id = parent.attr('class').slice(8);\n const focus_link = $('*[data-tabid=\"' + link_id + '\"]');\n if (focus_link.length === 1) {\n $(focus_link).focus();\n }\n });\n});\n"],"names":["window","document","_REVERSE_MAP","_MAP","_KEYCODE_MAP","_SHIFT_MAP","_SPECIAL_ALIASES","test","navigator","platform","i","toString","Mousetrap","prototype","bind","keys","callback","action","self","this","Array","_bindMultiple","call","unbind","trigger","_directMap","reset","_callbacks","stopCallback","e","element","className","indexOf","_belongsTo","target","composedPath","initialEventTarget","tagName","isContentEditable","handleKey","_handleKey","apply","arguments","addKeycodes","object","key","hasOwnProperty","init","documentMousetrap","method","charAt","module","exports","_addEvent","type","addEventListener","attachEvent","_characterFromEvent","character","String","fromCharCode","which","shiftKey","toLowerCase","_modifiersMatch","modifiers1","modifiers2","sort","join","_isModifier","_pickBestAction","modifiers","_getReverseMap","length","_getKeyInfo","combination","replace","split","_keysFromString","push","ancestor","parentNode","targetElement","_resetTimer","_sequenceLevels","_ignoreNextKeyup","_ignoreNextKeypress","_nextExpectedAction","_resetSequences","doNotReset","activeSequences","_getMatches","sequenceName","level","matches","seq","metaKey","ctrlKey","deleteCombo","combo","deleteSequence","splice","_fireCallback","sequence","srcElement","preventDefault","returnValue","_preventDefault","stopPropagation","cancelBubble","_stopPropagation","_handleKeyEvent","keyCode","altKey","_eventModifiers","_bindSingle","info","_increaseSequence","nextAction","clearTimeout","setTimeout","_callbackAndReset","wrappedCallback","_bindSequence","callbacks","maxLevel","processedSequenceCallback","Math","max","ignoreThisKeypress","combinations","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","get","obj","prop","jQuery","$","customEvents","on","event","closest","slideUp","attr","removeClass","mousetrap","currentTarget","hasClass","$this","tabid","data","container","parent","submenu","addClass","find","parseInt","slice","slideDown","baseUrl","body","dataset","prevData","scriptRegex","newData","$oldSubmenu","trim","remove","$newSubmenu","concat","hide","append","focus","parents","link_id","focus_link"],"sourceRoot":""}
@@ -0,0 +1,3 @@
1
+ .panel{margin-bottom:1.5em;background-color:#fff;border:1px solid rgba(0,0,0,0);border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-body:before,.panel-body:after{content:" ";display:table}.panel-body:after{clear:both}.panel-body>label{display:block;font-weight:400}.panel-body>label+label{padding-top:.75em;margin-top:1em;border-top:1px solid #eee}.panel-body .title{font-weight:600;margin-bottom:.2em}.panel-body input[type=text]{width:50%;min-width:220px}.panel-heading{border-bottom:1px solid rgba(0,0,0,0);border-top-left-radius:3px;border-top-right-radius:3px;position:relative}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:1.125em;color:inherit}.panel-title>a{color:inherit;text-decoration:none;padding:10px 15px;display:block}.panel-title>a span{border-bottom:1px solid #ccc;display:inline-block;line-height:1.2em}.panel-title>a:focus,.panel-title>a:hover{background-color:rgba(0,0,0,.03)}.panel-title>a:focus span,.panel-title>a:hover span{border-bottom-color:rgba(0,0,0,0)}#content-core .panel-title>a{border-bottom:none}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.accordion{margin-bottom:2rem}.accordion-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:1rem;margin-top:0;background-color:#f7f7f7}.accordion-actions{gap:1rem;padding-right:1rem}.accordion-button{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.accordion-item:first-of-type>.accordion-header .accordion-button{border-top-right-radius:0 !important}.custom-settings-editor{background:#fff;padding:6px 12px;border:1px solid #e5e5e5;margin-bottom:20px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.05);box-shadow:0 1px 3px rgba(0,0,0,.05)}.custom-settings-editor .menus-nav{background:#f2f1f1;border-bottom:1px solid #ddd;margin:0 0 .3em}.custom-settings-editor .menus-nav:after{content:"";display:table;line-height:0}.custom-settings-editor .menus-nav a{display:inline-block;background:#fcfcfd;margin:0 .5em -1px .5em;padding:.4em .8em;line-height:1.5em;text-decoration:none;font-weight:400;border:1px solid #e5e5e5;border-radius:4px 4px 0 0}.custom-settings-editor .menus-nav a:last-child{margin-right:6px}.custom-settings-editor .menus-nav a:hover{text-decoration:none;background-color:#eee;border-color:#eee;border-bottom-color:#fff}.custom-settings-editor .menus-nav a.active,.custom-settings-editor .menus-nav a.active:hover{cursor:default;background:#fff;border-bottom-color:#fff}.custom-settings-editor .menus-nav a.active{border:1px solid #ddd;color:#555}.custom-settings-editor .menus-nav a.active:hover{color:dimgray}.custom-settings-editor .menus-nav a:focus{outline-style:none}@media(max-width: 767px){.menus-nav{overflow-x:scroll;overflow-y:hidden;max-height:52px;width:auto;white-space:nowrap;border-bottom:0;-webkit-box-shadow:inset 0 -1px #e5e5e5;box-shadow:inset 0 -1px #e5e5e5}.menus-nav a:not(.active){-webkit-box-shadow:inset 0 -1px #e5e5e5;box-shadow:inset 0 -1px #e5e5e5}}fieldset{display:none}fieldset.active{display:block}fieldset.active legend{display:none}.menu-configuration>ul{list-style:none;padding:0;margin:0}body>li.menu-item{list-style:none}.tab-content>label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:12px 0}.tab-content>label>span{margin-right:15px}.tab-content>label>input{width:50%;min-width:220px}.remove-menu-wrapper{padding-top:20px;margin-top:20px;border-top:1px solid #ddd}#panel-group-template,#section-fieldset-template,#form-widgets-menu_tabs_json{display:none}
2
+
3
+ /*# sourceMappingURL=widget.min.css.map*/