@aquera/nile-elements 1.7.9 → 1.8.1

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 (111) hide show
  1. package/README.md +6 -0
  2. package/dist/index-6faafdf4.cjs.js +2 -0
  3. package/dist/index-6faafdf4.cjs.js.map +1 -0
  4. package/dist/index-9931b440.esm.js +1 -0
  5. package/dist/index.cjs.js +1 -1
  6. package/dist/index.esm.js +1 -1
  7. package/dist/index.js +630 -435
  8. package/dist/nile-combobox/index.cjs.js +1 -1
  9. package/dist/nile-combobox/index.esm.js +1 -1
  10. package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
  11. package/dist/nile-combobox/nile-combobox.esm.js +1 -1
  12. package/dist/nile-context-menu/index.cjs.js +2 -0
  13. package/dist/nile-context-menu/index.cjs.js.map +1 -0
  14. package/dist/nile-context-menu/index.esm.js +1 -0
  15. package/dist/nile-context-menu/nile-context-menu.cjs.js +2 -0
  16. package/dist/nile-context-menu/nile-context-menu.cjs.js.map +1 -0
  17. package/dist/nile-context-menu/nile-context-menu.css.cjs.js +2 -0
  18. package/dist/nile-context-menu/nile-context-menu.css.cjs.js.map +1 -0
  19. package/dist/nile-context-menu/nile-context-menu.css.esm.js +51 -0
  20. package/dist/nile-context-menu/nile-context-menu.esm.js +25 -0
  21. package/dist/nile-context-menu-group/index.cjs.js +2 -0
  22. package/dist/nile-context-menu-group/index.cjs.js.map +1 -0
  23. package/dist/nile-context-menu-group/index.esm.js +1 -0
  24. package/dist/nile-context-menu-group/nile-context-menu-group.cjs.js +2 -0
  25. package/dist/nile-context-menu-group/nile-context-menu-group.cjs.js.map +1 -0
  26. package/dist/nile-context-menu-group/nile-context-menu-group.css.cjs.js +2 -0
  27. package/dist/nile-context-menu-group/nile-context-menu-group.css.cjs.js.map +1 -0
  28. package/dist/nile-context-menu-group/nile-context-menu-group.css.esm.js +20 -0
  29. package/dist/nile-context-menu-group/nile-context-menu-group.esm.js +11 -0
  30. package/dist/nile-context-menu-item/index.cjs.js +2 -0
  31. package/dist/nile-context-menu-item/index.cjs.js.map +1 -0
  32. package/dist/nile-context-menu-item/index.esm.js +1 -0
  33. package/dist/nile-context-menu-item/nile-context-menu-item.cjs.js +2 -0
  34. package/dist/nile-context-menu-item/nile-context-menu-item.cjs.js.map +1 -0
  35. package/dist/nile-context-menu-item/nile-context-menu-item.css.cjs.js +2 -0
  36. package/dist/nile-context-menu-item/nile-context-menu-item.css.cjs.js.map +1 -0
  37. package/dist/nile-context-menu-item/nile-context-menu-item.css.esm.js +72 -0
  38. package/dist/nile-context-menu-item/nile-context-menu-item.esm.js +20 -0
  39. package/dist/nile-context-submenu/index.cjs.js +2 -0
  40. package/dist/nile-context-submenu/index.cjs.js.map +1 -0
  41. package/dist/nile-context-submenu/index.esm.js +1 -0
  42. package/dist/nile-context-submenu/nile-context-submenu.cjs.js +2 -0
  43. package/dist/nile-context-submenu/nile-context-submenu.cjs.js.map +1 -0
  44. package/dist/nile-context-submenu/nile-context-submenu.esm.js +3 -0
  45. package/dist/nile-detail/index.cjs.js +1 -1
  46. package/dist/nile-detail/index.esm.js +1 -1
  47. package/dist/nile-detail/nile-detail.cjs.js +1 -1
  48. package/dist/nile-detail/nile-detail.esm.js +1 -1
  49. package/dist/nile-floating-panel/nile-floating-panel.cjs.js +1 -1
  50. package/dist/nile-floating-panel/nile-floating-panel.cjs.js.map +1 -1
  51. package/dist/nile-floating-panel/nile-floating-panel.esm.js +1 -1
  52. package/dist/src/index.d.ts +3 -0
  53. package/dist/src/index.js +3 -0
  54. package/dist/src/index.js.map +1 -1
  55. package/dist/src/nile-context-menu/index.d.ts +3 -0
  56. package/dist/src/nile-context-menu/index.js +4 -0
  57. package/dist/src/nile-context-menu/index.js.map +1 -0
  58. package/dist/src/nile-context-menu/nile-context-menu.css.d.ts +10 -0
  59. package/dist/src/nile-context-menu/nile-context-menu.css.js +127 -0
  60. package/dist/src/nile-context-menu/nile-context-menu.css.js.map +1 -0
  61. package/dist/src/nile-context-menu/nile-context-menu.d.ts +132 -0
  62. package/dist/src/nile-context-menu/nile-context-menu.js +705 -0
  63. package/dist/src/nile-context-menu/nile-context-menu.js.map +1 -0
  64. package/dist/src/nile-context-menu-group/index.d.ts +1 -0
  65. package/dist/src/nile-context-menu-group/index.js +2 -0
  66. package/dist/src/nile-context-menu-group/index.js.map +1 -0
  67. package/dist/src/nile-context-menu-group/nile-context-menu-group.css.d.ts +9 -0
  68. package/dist/src/nile-context-menu-group/nile-context-menu-group.css.js +29 -0
  69. package/dist/src/nile-context-menu-group/nile-context-menu-group.css.js.map +1 -0
  70. package/dist/src/nile-context-menu-group/nile-context-menu-group.d.ts +28 -0
  71. package/dist/src/nile-context-menu-group/nile-context-menu-group.js +55 -0
  72. package/dist/src/nile-context-menu-group/nile-context-menu-group.js.map +1 -0
  73. package/dist/src/nile-context-menu-item/index.d.ts +1 -0
  74. package/dist/src/nile-context-menu-item/index.js +2 -0
  75. package/dist/src/nile-context-menu-item/index.js.map +1 -0
  76. package/dist/src/nile-context-menu-item/nile-context-menu-item.css.d.ts +9 -0
  77. package/dist/src/nile-context-menu-item/nile-context-menu-item.css.js +81 -0
  78. package/dist/src/nile-context-menu-item/nile-context-menu-item.css.js.map +1 -0
  79. package/dist/src/nile-context-menu-item/nile-context-menu-item.d.ts +46 -0
  80. package/dist/src/nile-context-menu-item/nile-context-menu-item.js +100 -0
  81. package/dist/src/nile-context-menu-item/nile-context-menu-item.js.map +1 -0
  82. package/dist/src/nile-context-submenu/index.d.ts +1 -0
  83. package/dist/src/nile-context-submenu/index.js +2 -0
  84. package/dist/src/nile-context-submenu/index.js.map +1 -0
  85. package/dist/src/nile-context-submenu/nile-context-submenu.d.ts +69 -0
  86. package/dist/src/nile-context-submenu/nile-context-submenu.js +408 -0
  87. package/dist/src/nile-context-submenu/nile-context-submenu.js.map +1 -0
  88. package/dist/src/nile-floating-panel/nile-floating-panel.d.ts +2 -0
  89. package/dist/src/nile-floating-panel/nile-floating-panel.js +4 -0
  90. package/dist/src/nile-floating-panel/nile-floating-panel.js.map +1 -1
  91. package/dist/src/version.js +1 -1
  92. package/dist/src/version.js.map +1 -1
  93. package/dist/tsconfig.tsbuildinfo +1 -1
  94. package/package.json +1 -1
  95. package/src/index.ts +3 -0
  96. package/src/nile-context-menu/index.ts +12 -0
  97. package/src/nile-context-menu/nile-context-menu.css.ts +130 -0
  98. package/src/nile-context-menu/nile-context-menu.ts +776 -0
  99. package/src/nile-context-menu-group/index.ts +1 -0
  100. package/src/nile-context-menu-group/nile-context-menu-group.css.ts +31 -0
  101. package/src/nile-context-menu-group/nile-context-menu-group.ts +55 -0
  102. package/src/nile-context-menu-item/index.ts +5 -0
  103. package/src/nile-context-menu-item/nile-context-menu-item.css.ts +83 -0
  104. package/src/nile-context-menu-item/nile-context-menu-item.ts +114 -0
  105. package/src/nile-context-submenu/index.ts +1 -0
  106. package/src/nile-context-submenu/nile-context-submenu.ts +407 -0
  107. package/src/nile-floating-panel/nile-floating-panel.ts +5 -0
  108. package/vscode-html-custom-data.json +92 -4
  109. package/dist/index-644974d4.esm.js +0 -1
  110. package/dist/index-dd2af8ec.cjs.js +0 -2
  111. package/dist/index-dd2af8ec.cjs.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ System.register(["lit"],function(_export,_context){"use strict";var n,_templateObject,e;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){n=_lit.css;}],execute:function execute(){_export("s",e=n(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n box-sizing: border-box;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n display: block;\n }\n\n .nile-context-menu__menu {\n display: none;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .nile-context-menu__menu {\n min-width: 200px;\n max-width: 540px;\n padding: var(--nile-spacing-xs, var(--ng-spacing-xs)) var(--nile-spacing-none, var(--ng-spacing-none));\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border: solid 1px var(--nile-colors-border-surface, var(--ng-colors-border-secondary-alt));\n border-radius: var(--nile-radius-radius-lg, var(--ng-radius-md));\n box-shadow: 0px 20px 24px -4px rgba(16, 24, 40, 0.08),\n 0px 8px 8px -4px rgba(16, 24, 40, 0.03);\n overflow: hidden;\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));\n line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));\n color: var(--nile-colors-text-default, var(--ng-colors-text-secondary-700));\n user-select: none;\n }\n\n .nile-context-menu__menu nile-context-menu-group + nile-context-menu-group {\n position: relative;\n margin-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n padding-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n }\n .nile-context-menu__menu nile-context-menu-group + nile-context-menu-group::before {\n content: '';\n position: absolute;\n top: 0;\n left: var(--nile-spacing-lg, var(--ng-spacing-lg));\n right: var(--nile-spacing-lg, var(--ng-spacing-lg));\n height: 1px;\n background: var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n }\n"]))));!function(_document$head){if("undefined"==typeof document)return;var n="nile-context-menu-overrides";if(document.getElementById(n))return;var e=document.createElement("style");e.id=n,e.textContent="\n .nile-context-menu-panel .nile-floating-panel__body {\n min-width: 0;\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n gap: var(--nile-spacing-none, var(--ng-spacing-none));\n }\n .nile-context-menu-panel .nile-floating-panel__main {\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n margin: var(--nile-spacing-none, var(--ng-spacing-none));\n }\n .nile-context-menu-panel .tippy-box[data-theme~='floating-panel'] {\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n background: transparent;\n border: none;\n border-radius: var(--nile-radius-none, var(--ng-radius-none));\n box-shadow: none;\n }\n .nile-context-menu__menu[role='menu'] {\n min-width: 200px;\n max-width: 540px;\n max-height: min(60vh, 400px);\n padding: var(--nile-spacing-xs, var(--ng-spacing-xs)) var(--nile-spacing-none, var(--ng-spacing-none));\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border: solid 1px var(--nile-colors-border-surface, var(--ng-colors-border-secondary-alt));\n border-radius: var(--nile-radius-radius-lg, var(--ng-radius-md));\n box-shadow: 0px 20px 24px -4px rgba(16, 24, 40, 0.08),\n 0px 8px 8px -4px rgba(16, 24, 40, 0.03);\n overflow-y: auto;\n overflow-x: hidden;\n font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));\n line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));\n color: var(--nile-colors-text-default, var(--ng-colors-text-secondary-700));\n user-select: none;\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-item,\n .nile-context-menu__menu[role='menu'] nile-context-menu-group {\n font-family: inherit;\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-group + nile-context-menu-group {\n position: relative;\n margin-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n padding-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-group + nile-context-menu-group::before {\n content: '';\n position: absolute;\n top: 0;\n left: var(--nile-spacing-xl, var(--ng-spacing-lg));\n right: var(--nile-spacing-xl, var(--ng-spacing-lg));\n height: 1px;\n background: var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n }\n",(_document$head=document.head)===null||_document$head===void 0?void 0:_document$head.appendChild(e);}();}};});
2
+ //# sourceMappingURL=nile-context-menu.css.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-context-menu.css.cjs.js","sources":["../../../src/nile-context-menu/nile-context-menu.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2026\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\nexport const styles = css`\n :host {\n box-sizing: border-box;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n display: block;\n }\n\n .nile-context-menu__menu {\n display: none;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .nile-context-menu__menu {\n min-width: 200px;\n max-width: 540px;\n padding: var(--nile-spacing-xs, var(--ng-spacing-xs)) var(--nile-spacing-none, var(--ng-spacing-none));\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border: solid 1px var(--nile-colors-border-surface, var(--ng-colors-border-secondary-alt));\n border-radius: var(--nile-radius-radius-lg, var(--ng-radius-md));\n box-shadow: 0px 20px 24px -4px rgba(16, 24, 40, 0.08),\n 0px 8px 8px -4px rgba(16, 24, 40, 0.03);\n overflow: hidden;\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));\n line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));\n color: var(--nile-colors-text-default, var(--ng-colors-text-secondary-700));\n user-select: none;\n }\n\n .nile-context-menu__menu nile-context-menu-group + nile-context-menu-group {\n position: relative;\n margin-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n padding-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n }\n .nile-context-menu__menu nile-context-menu-group + nile-context-menu-group::before {\n content: '';\n position: absolute;\n top: 0;\n left: var(--nile-spacing-lg, var(--ng-spacing-lg));\n right: var(--nile-spacing-lg, var(--ng-spacing-lg));\n height: 1px;\n background: var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n }\n`;\n\nconst GLOBAL_OVERRIDE_CSS = `\n .nile-context-menu-panel .nile-floating-panel__body {\n min-width: 0;\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n gap: var(--nile-spacing-none, var(--ng-spacing-none));\n }\n .nile-context-menu-panel .nile-floating-panel__main {\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n margin: var(--nile-spacing-none, var(--ng-spacing-none));\n }\n .nile-context-menu-panel .tippy-box[data-theme~='floating-panel'] {\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n background: transparent;\n border: none;\n border-radius: var(--nile-radius-none, var(--ng-radius-none));\n box-shadow: none;\n }\n .nile-context-menu__menu[role='menu'] {\n min-width: 200px;\n max-width: 540px;\n max-height: min(60vh, 400px);\n padding: var(--nile-spacing-xs, var(--ng-spacing-xs)) var(--nile-spacing-none, var(--ng-spacing-none));\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border: solid 1px var(--nile-colors-border-surface, var(--ng-colors-border-secondary-alt));\n border-radius: var(--nile-radius-radius-lg, var(--ng-radius-md));\n box-shadow: 0px 20px 24px -4px rgba(16, 24, 40, 0.08),\n 0px 8px 8px -4px rgba(16, 24, 40, 0.03);\n overflow-y: auto;\n overflow-x: hidden;\n font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));\n line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));\n color: var(--nile-colors-text-default, var(--ng-colors-text-secondary-700));\n user-select: none;\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-item,\n .nile-context-menu__menu[role='menu'] nile-context-menu-group {\n font-family: inherit;\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-group + nile-context-menu-group {\n position: relative;\n margin-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n padding-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-group + nile-context-menu-group::before {\n content: '';\n position: absolute;\n top: 0;\n left: var(--nile-spacing-xl, var(--ng-spacing-lg));\n right: var(--nile-spacing-xl, var(--ng-spacing-lg));\n height: 1px;\n background: var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n }\n`;\n\nexport function injectGlobalContextMenuOverrides(): void {\n if (typeof document === 'undefined') return;\n const STYLE_ID = 'nile-context-menu-overrides';\n if (document.getElementById(STYLE_ID)) return;\n const style = document.createElement('style');\n style.id = STYLE_ID;\n style.textContent = GLOBAL_OVERRIDE_CSS;\n document.head?.appendChild(style);\n}\n\ninjectGlobalContextMenuOverrides();\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral","document","STYLE_ID","getElementById","style","createElement","id","textContent","head","appendChild","injectGlobalContextMenuOverrides"],"mappings":"oTASaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,6+DA6GvB,GAAwB,WAAA,EAAA,MAAbC,CAAAA,QAA0B,CAAA,OACrC,GAAMC,CAAAA,CAAAA,CAAW,6BACjB,CAAA,GAAID,QAASE,CAAAA,cAAAA,CAAeD,CAAW,CAAA,CAAA,OACvC,GAAME,CAAAA,CAAAA,CAAQH,QAASI,CAAAA,aAAAA,CAAc,OACrCD,CAAAA,CAAAA,CAAAA,CAAME,EAAKJ,CAAAA,CAAAA,CACXE,CAAMG,CAAAA,WAAAA,CA9DoB,k+EA+D1BN,EAAAA,cAAAA,CAAAA,QAAAA,CAASO,IAAMC,UAAAA,cAAAA,iBAAfR,cAAAA,CAAeQ,WAAAA,CAAYL,CAC7B,CAAA,EAEAM"}
@@ -0,0 +1,51 @@
1
+ import{css as n}from"lit";const e=n`
2
+ :host {
3
+ box-sizing: border-box;
4
+ -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
5
+ -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));
6
+ text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));
7
+ display: block;
8
+ }
9
+
10
+ .nile-context-menu__menu {
11
+ display: none;
12
+ }
13
+
14
+ :host *,
15
+ :host *::before,
16
+ :host *::after {
17
+ box-sizing: inherit;
18
+ }
19
+
20
+ .nile-context-menu__menu {
21
+ min-width: 200px;
22
+ max-width: 540px;
23
+ padding: var(--nile-spacing-xs, var(--ng-spacing-xs)) var(--nile-spacing-none, var(--ng-spacing-none));
24
+ background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
25
+ border: solid 1px var(--nile-colors-border-surface, var(--ng-colors-border-secondary-alt));
26
+ border-radius: var(--nile-radius-radius-lg, var(--ng-radius-md));
27
+ box-shadow: 0px 20px 24px -4px rgba(16, 24, 40, 0.08),
28
+ 0px 8px 8px -4px rgba(16, 24, 40, 0.03);
29
+ overflow: hidden;
30
+ font-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));
31
+ font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));
32
+ line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));
33
+ color: var(--nile-colors-text-default, var(--ng-colors-text-secondary-700));
34
+ user-select: none;
35
+ }
36
+
37
+ .nile-context-menu__menu nile-context-menu-group + nile-context-menu-group {
38
+ position: relative;
39
+ margin-top: var(--nile-spacing-xs, var(--ng-spacing-xs));
40
+ padding-top: var(--nile-spacing-xs, var(--ng-spacing-xs));
41
+ }
42
+ .nile-context-menu__menu nile-context-menu-group + nile-context-menu-group::before {
43
+ content: '';
44
+ position: absolute;
45
+ top: 0;
46
+ left: var(--nile-spacing-lg, var(--ng-spacing-lg));
47
+ right: var(--nile-spacing-lg, var(--ng-spacing-lg));
48
+ height: 1px;
49
+ background: var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
50
+ }
51
+ `;!function(){if("undefined"==typeof document)return;const n="nile-context-menu-overrides";if(document.getElementById(n))return;const e=document.createElement("style");e.id=n,e.textContent="\n .nile-context-menu-panel .nile-floating-panel__body {\n min-width: 0;\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n gap: var(--nile-spacing-none, var(--ng-spacing-none));\n }\n .nile-context-menu-panel .nile-floating-panel__main {\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n margin: var(--nile-spacing-none, var(--ng-spacing-none));\n }\n .nile-context-menu-panel .tippy-box[data-theme~='floating-panel'] {\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n background: transparent;\n border: none;\n border-radius: var(--nile-radius-none, var(--ng-radius-none));\n box-shadow: none;\n }\n .nile-context-menu__menu[role='menu'] {\n min-width: 200px;\n max-width: 540px;\n max-height: min(60vh, 400px);\n padding: var(--nile-spacing-xs, var(--ng-spacing-xs)) var(--nile-spacing-none, var(--ng-spacing-none));\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border: solid 1px var(--nile-colors-border-surface, var(--ng-colors-border-secondary-alt));\n border-radius: var(--nile-radius-radius-lg, var(--ng-radius-md));\n box-shadow: 0px 20px 24px -4px rgba(16, 24, 40, 0.08),\n 0px 8px 8px -4px rgba(16, 24, 40, 0.03);\n overflow-y: auto;\n overflow-x: hidden;\n font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));\n line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));\n color: var(--nile-colors-text-default, var(--ng-colors-text-secondary-700));\n user-select: none;\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-item,\n .nile-context-menu__menu[role='menu'] nile-context-menu-group {\n font-family: inherit;\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-group + nile-context-menu-group {\n position: relative;\n margin-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n padding-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-group + nile-context-menu-group::before {\n content: '';\n position: absolute;\n top: 0;\n left: var(--nile-spacing-xl, var(--ng-spacing-lg));\n right: var(--nile-spacing-xl, var(--ng-spacing-lg));\n height: 1px;\n background: var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n }\n",document.head?.appendChild(e)}();export{e as s};
@@ -0,0 +1,25 @@
1
+ import{__decorate as t}from"tslib";import{html as i}from"lit";import{property as e,query as s,state as n,customElement as o}from"lit/decorators.js";import{s as r}from"./nile-context-menu.css.esm.js";import{N as h}from"../internal/nile-element.esm.js";import"../nile-floating-panel/nile-floating-panel.esm.js";import"../nile-context-menu-group/nile-context-menu-group.esm.js";import"../nile-context-menu-item/nile-context-menu-item.esm.js";import"../nile-context-submenu/nile-context-submenu.esm.js";import"../internal/accessibility/a11y.state.enum.esm.js";import"../internal/accessibility/a11y.property.enum.esm.js";import"../internal/accessibility/role.enum.esm.js";import"../nile-floating-panel/nile-floating-panel.css.esm.js";import"../tippy.esm-57628c2b.esm.js";import"../nile-lite-tooltip/utils.esm.js";import"../utilities/visibility-manager.esm.js";import"../nile-context-menu-group/nile-context-menu-group.css.esm.js";import"../nile-context-menu-item/nile-context-menu-item.css.esm.js";var c;const l="nile-context-menu-item",u="nile-context-submenu",a="nile-context-menu__menu",m=["value","disabled"];let d=0,p=c=class extends h{constructor(){super(...arguments),this.for="",this.trigger="right",this.skipOn="",this.zIndex=9999,this.open=!1,this.items=[],this._items=[],this._open=!1,this._pinned=!1,this._openContext=null,this._targetEl=null,this._previouslyFocused=null,this._proxyId="nile-context-menu-anchor-"+ ++d,this._wasDataMode=!1,this._onPinnedReposition=()=>{if(!this._open||!this._pinned||!this._targetEl)return;const t=this._targetEl.getBoundingClientRect();this._positionProxyAt(t.left,t.bottom)},this._menuContainerRef=null,this._onKeydown=t=>{if(this._open)switch(t.key){case"Escape":return t.preventDefault(),void this.close("escape");case"Tab":return void this.close("programmatic");case"ArrowDown":return t.preventDefault(),void this._moveFocus(1);case"ArrowUp":return t.preventDefault(),void this._moveFocus(-1);case"ArrowRight":{const{item:i}=this._getFocusedItemAnyLevel(),e=i?.querySelector(`:scope > ${u}`);if(!e)return;return t.preventDefault(),e.openSubmenu?.(),void requestAnimationFrame((()=>{e.focusFirstItem?.()}))}case"ArrowLeft":{const{item:i,container:e}=this._getFocusedItemAnyLevel();if(!i||!e)return;const s=this._findSubmenuOwning(e);if(!s)return;return t.preventDefault(),s.parentItem?.open||s.closeSubmenu?.(),void s.parentItem?.focus()}case"Enter":case" ":{t.preventDefault();const{item:i}=this._getFocusedItemAnyLevel();if(!i||i.disabled)return;const e=i.querySelector(`:scope > ${u}`);return e?(e.openSubmenu?.(),void requestAnimationFrame((()=>{const t=e.shadowRoot?.querySelector(`.${a}`),i=t?this._enabledItemsIn(t)[0]:void 0;i?.focus()}))):void this._selectItem(i)}}},this._onScroll=t=>{if(!this._open)return;if(this._pinned)return void this._onPinnedReposition();const i=t.composedPath();if(!this._menuContainerRef||!i.includes(this._menuContainerRef)){for(const t of i)if(t instanceof HTMLElement&&t.classList?.contains(a))return;this.close("programmatic")}},this._onOutsidePointer=t=>{if(!this._open)return;const i=t.composedPath();if(!this._menuContainerRef||!i.includes(this._menuContainerRef)){for(const t of i)if(t instanceof HTMLElement&&t.classList?.contains(a))return;this.close("outside-click")}},this._onDescendantSelect=t=>{"click"===t.detail?.type&&this.close("select")},this._onPanelShown=t=>{t.stopPropagation(),this._openPinnedSubmenus()},this._onMenuMouseOver=t=>{const i=t.composedPath().find((t=>t instanceof HTMLElement&&t.tagName.toLowerCase()===l));i&&!i.disabled&&i.focus()},this._onMenuClick=t=>{const i=t.composedPath().find((t=>t instanceof HTMLElement&&t.tagName.toLowerCase()===l));i&&!i.disabled&&(i.querySelector(`:scope > ${u}`)||this._selectItem(i))}}static get styles(){return[r]}get _isDataMode(){return Array.isArray(this.items)&&this.items.length>0}connectedCallback(){super.connectedCallback(),this._ensureProxy(),this._resolveTarget(),this._attachTriggers(),this._lightObserver=new MutationObserver((()=>{this._isDataMode||this._relocateLightChildren()})),this._lightObserver.observe(this,{childList:!0}),this.open&&!this._open&&this.updateComplete.then((()=>{this.isConnected&&this.open&&!this._open&&(this._pinned=!0,this._openAtTarget())}))}updated(t){super.updated(t),(t.has("for")||t.has("trigger")||t.has("skipOn"))&&this._open&&this.close("programmatic"),t.has("for")?(this._resolveTarget(),this._attachTriggers()):(t.has("trigger")||t.has("skipOn"))&&this._attachTriggers(),t.has("items")&&this._menuContainerRef&&(this._isDataMode?(this._renderDataItems(),this._wasDataMode=!0):this._wasDataMode&&(this._renderDataItems(),this._wasDataMode=!1)),t.has("open")&&(this.open&&!this._open?(this._pinned=!0,this._openAtTarget()):!this.open&&this._open&&this.close("programmatic"))}_openAtTarget(){const t=this._targetEl?.getBoundingClientRect();this.openAt({x:t?t.left:0,y:t?t.bottom:0,target:this._targetEl??void 0})}_resolveTarget(){const t=this.for?.trim();if(!t)return void(this._targetEl=null);const i=this.getRootNode()??document;/^[#.\[:]/.test(t)?this._targetEl=i.querySelector(t):this._targetEl="getElementById"in i?i.getElementById(t):document.getElementById(t)}get targetElement(){return this._targetEl}_attachTriggers(){this._detachTriggers?.(),this._detachTriggers=void 0;const t=this.trigger;if("manual"===t)return;const i=[];if("global"===t){const t=this.skipOn?.trim()??"",e=i=>!(!i||!t)&&!!i.closest(t),s=t=>{const i=t;e(i.target)||(i.preventDefault(),this._open||this.openAt({x:i.clientX,y:i.clientY,target:i.target??void 0,originalEvent:i}))};return window.addEventListener("contextmenu",s,!0),i.push((()=>window.removeEventListener("contextmenu",s,!0))),void(this._detachTriggers=()=>i.forEach((t=>t())))}const e=this._targetEl;if(!e)return;const s="left"===t||"both"===t;if("right"===t||"both"===t){const t=t=>{const i=t;i.preventDefault(),this.openAt({x:i.clientX,y:i.clientY,target:e,originalEvent:i})};e.addEventListener("contextmenu",t),i.push((()=>e.removeEventListener("contextmenu",t)))}if(s){const t=t=>{const i=t;this.openAt({x:i.clientX,y:i.clientY,target:e,originalEvent:i})};e.addEventListener("click",t),i.push((()=>e.removeEventListener("click",t)))}0!==i.length&&(this._detachTriggers=()=>i.forEach((t=>t())))}disconnectedCallback(){super.disconnectedCallback(),c._openInstances.delete(this),this._open=!1,this._detachTriggers?.(),this._detachTriggers=void 0,this._lightObserver?.disconnect(),this._lightObserver=void 0,this._menuObserver?.disconnect(),this._menuObserver=void 0,this._menuContainerRef?.removeEventListener("click",this._onMenuClick),this._menuContainerRef?.removeEventListener("mouseover",this._onMenuMouseOver),this._menuContainerRef?.removeEventListener("nile-change",this._onDescendantSelect),document.removeEventListener("pointerdown",this._onOutsidePointer,!0),document.removeEventListener("keydown",this._onKeydown,!0),window.removeEventListener("scroll",this._onScroll,!0),window.removeEventListener("resize",this._onPinnedReposition),this._proxyEl?.remove(),this._proxyEl=void 0}firstUpdated(){this._menuContainerRef=this.renderRoot.querySelector(".nile-context-menu__menu"),this._isDataMode?(this._renderDataItems(),this._wasDataMode=!0):this._relocateLightChildren(),this._menuContainerRef&&(this._menuObserver=new MutationObserver((()=>this._parseChildren())),this._menuObserver.observe(this._menuContainerRef,{childList:!0,subtree:!0,attributes:!0,attributeFilter:m}),this._menuContainerRef.addEventListener("click",this._onMenuClick),this._menuContainerRef.addEventListener("mouseover",this._onMenuMouseOver),this._menuContainerRef.addEventListener("nile-change",this._onDescendantSelect)),this._parseChildren()}_ensureProxy(){if(this._proxyEl)return;const t=document.createElement("div");t.id=this._proxyId,t.setAttribute("aria-hidden","true"),t.style.cssText="position: fixed; top: 0; left: 0; width: 0; height: 0; pointer-events: none;",document.body.appendChild(t),this._proxyEl=t}_positionProxyAt(t,i){if(this._proxyEl){if(this._pinned&&this._targetEl){const t=this._targetEl.getBoundingClientRect();return this._proxyEl.style.position="absolute",this._proxyEl.style.left=`${t.left+window.scrollX}px`,this._proxyEl.style.top=`${t.top+window.scrollY}px`,this._proxyEl.style.width=`${t.width}px`,void(this._proxyEl.style.height=`${t.height}px`)}this._proxyEl.style.position="fixed",this._proxyEl.style.left=`${t}px`,this._proxyEl.style.top=`${i}px`,this._proxyEl.style.width="0",this._proxyEl.style.height="0"}}_relocateLightChildren(){if(!this._menuContainerRef)return;const t=Array.from(this.children);if(0!==t.length)for(const i of t)this._menuContainerRef.appendChild(i)}_renderDataItems(){const t=this._menuContainerRef;if(t){for(;t.firstChild;)t.removeChild(t.firstChild);for(const i of this.items){const e=this._createDataNode(i);e&&t.appendChild(e)}}}_createDataNode(t){if("group"===t.type){const i=document.createElement("nile-context-menu-group");t.name&&(i.label=t.name);for(const e of t.data??[])i.appendChild(this._createItemNode(e));return i}return null}_createItemNode(t){const i=document.createElement("nile-context-menu-item");if(t.id&&(i.id=t.id),i.value=t.value??t.id??"",t.disabled&&(i.disabled=!0),t.open&&(i.open=!0),t.icon){const e=document.createElement("nile-glyph");e.setAttribute("slot","icon"),e.setAttribute("name",t.icon),t.iconSet&&e.setAttribute("set",t.iconSet),t.iconSize&&e.setAttribute("size",t.iconSize),t.iconMethod&&e.setAttribute("method",t.iconMethod),t.iconColor&&e.setAttribute("color",t.iconColor),i.appendChild(e)}if(i.appendChild(document.createTextNode(t.label)),t.submenu&&t.submenu.length>0){const e=document.createElement("nile-context-submenu");for(const i of t.submenu){const t=this._createDataNode(i);t&&e.appendChild(t)}i.appendChild(e)}return i}_parseChildren(){const t=this._menuContainerRef??this,i=Array.from(t.querySelectorAll(l));this._items=i.filter((i=>!this._isInsideDescendantSubmenu(i,t)))}_isInsideDescendantSubmenu(t,i){let e=t.parentElement;for(;e&&e!==i;){if(e.tagName.toLowerCase()===u)return!0;e=e.parentElement}return!1}get menuItems(){return this._items}getItemByValue(t){return this._items.find((i=>i.value===t))}get isOpen(){return this._open}openAt(t){if(!this._open){for(const t of c._openInstances)t!==this&&t.close("programmatic");this._previouslyFocused=document.activeElement,this._openContext={x:t.x,y:t.y,target:t.target??null,originalEvent:t.originalEvent??null},this._ensureProxy(),this._positionProxyAt(t.x,t.y),this._open=!0,this.open=!0,c._openInstances.add(this),document.addEventListener("pointerdown",this._onOutsidePointer,!0),document.addEventListener("keydown",this._onKeydown,!0),this._pinned&&window.addEventListener("resize",this._onPinnedReposition),requestAnimationFrame((()=>{this._open&&window.addEventListener("scroll",this._onScroll,!0),requestAnimationFrame((()=>this._openPinnedSubmenus()))})),this.emit("nile-change",{type:"open",...this._openContext})}}close(t="programmatic"){if(!this._open)return;this._open=!1,this.open=!1,this._pinned=!1,this._openContext=null,c._openInstances.delete(this);const i=this._menuContainerRef?.querySelectorAll(u);i?.forEach((t=>t.closeSubmenu?.())),document.removeEventListener("pointerdown",this._onOutsidePointer,!0),document.removeEventListener("keydown",this._onKeydown,!0),window.removeEventListener("scroll",this._onScroll,!0),window.removeEventListener("resize",this._onPinnedReposition);const e=document.activeElement;(e===this||this._items.some((t=>t===e||t.shadowRoot?.contains(e))))&&this._previouslyFocused?.focus?.(),this._previouslyFocused=null,this.emit("nile-change",{type:"close",reason:t})}_enabledItems(){return this._items.filter((t=>!t.disabled))}_getFocusedItem(){const t=document.activeElement;for(const i of this._items)if(i===t||i.shadowRoot?.contains(t))return i;return null}_getFocusedItemAnyLevel(){let t=document.activeElement;for(;t&&t.tagName?.toLowerCase()!==l;){const i=t.getRootNode();t=i instanceof ShadowRoot?i.host:t.parentElement}if(!t)return{item:null,container:null};const i=t.closest(`.${a}`);return{item:t,container:i}}_enabledItemsIn(t){return Array.from(t.querySelectorAll(l)).filter((i=>!i.disabled&&!this._isInsideDescendantSubmenu(i,t)))}_focusFirstEnabled(){const t=this._enabledItems();t[0]?.focus()}_moveFocus(t){const{item:i,container:e}=this._getFocusedItemAnyLevel(),s=e??this._menuContainerRef??this,n=this._enabledItemsIn(s);if(0===n.length)return;const o=i?n.indexOf(i):-1;n[((o+t)%n.length+n.length)%n.length].focus()}_findSubmenuOwning(t){const i=window.customElements.get(u);return i?.findByContainer?.(t)??null}_stop(t){t.stopPropagation()}_openPinnedSubmenus(){if(this._open&&this._menuContainerRef)for(const t of this._items){if(!t.open||t.disabled)continue;const i=t.querySelector(`:scope > ${u}`);i?.openSubmenu?.()}}_selectItem(t){const i={id:t.id,value:t.value,name:(t.textContent??"").trim(),target:this._openContext?.target??null,originalEvent:this._openContext?.originalEvent??null};try{t.onSelect?.(i)}catch(t){console.error("[nile-context-menu] onSelect callback threw:",t)}this.emit("nile-change",{type:"click",...i}),this.close("select")}render(){return i`
2
+ <nile-floating-panel
3
+ for=${this._proxyId}
4
+ trigger="manual"
5
+ placement="bottom-start"
6
+ panelClass="nile-context-menu-panel"
7
+ .zIndex=${this.zIndex}
8
+ ?open=${this._open}
9
+ .interactive=${!0}
10
+ .hideOnClick=${!1}
11
+ .closeOnEscape=${!1}
12
+ .arrow=${"none"}
13
+ .distance=${0}
14
+ @nile-init=${this._stop}
15
+ @nile-destroy=${this._stop}
16
+ @nile-show=${this._stop}
17
+ @nile-hide=${this._stop}
18
+ @nile-after-show=${this._onPanelShown}
19
+ @nile-after-hide=${this._stop}
20
+ @nile-toggle=${this._stop}
21
+ @nile-visibility-change=${this._stop}
22
+ >
23
+ <div class="nile-context-menu__menu" role="menu"></div>
24
+ </nile-floating-panel>
25
+ `}};p._openInstances=new Set,t([e({attribute:!0,type:String,reflect:!0})],p.prototype,"for",void 0),t([e({attribute:!0,type:String,reflect:!0})],p.prototype,"trigger",void 0),t([e({attribute:!0,type:String,reflect:!0})],p.prototype,"skipOn",void 0),t([e({attribute:!0,type:Number,reflect:!0})],p.prototype,"zIndex",void 0),t([e({attribute:!0,type:Boolean,reflect:!0})],p.prototype,"open",void 0),t([e({attribute:!1})],p.prototype,"items",void 0),t([s("nile-floating-panel")],p.prototype,"_floatingPanel",void 0),t([n()],p.prototype,"_items",void 0),t([n()],p.prototype,"_open",void 0),p=c=t([o("nile-context-menu")],p);export{p as N};
@@ -0,0 +1,2 @@
1
+ System.register(["./nile-context-menu-group.cjs.js","tslib","lit","lit/decorators.js","./nile-context-menu-group.css.cjs.js","../internal/nile-element.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileContextMenuGroupCjsJs){_export("NileContextMenuGroup",_nileContextMenuGroupCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_nileContextMenuGroupCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){}};});
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export{N as NileContextMenuGroup}from"./nile-context-menu-group.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"./nile-context-menu-group.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/accessibility/a11y.state.enum.esm.js";import"../internal/accessibility/a11y.property.enum.esm.js";import"../internal/accessibility/role.enum.esm.js";
@@ -0,0 +1,2 @@
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-context-menu-group.css.cjs.js","../internal/nile-element.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var t,e,s,r,i,l,_templateObject,_templateObject2,_o,n;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){e=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.property;r=_litDecoratorsJs.customElement;},function(_nileContextMenuGroupCssCjsJs){i=_nileContextMenuGroupCssCjsJs.s;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",n=_o=/*#__PURE__*/function(_l){function o(){var _this;_classCallCheck(this,o);_this=_callSuper(this,o,arguments),_this.label="",_this._labelId="nile-context-menu-group-label-"+ ++_o._idSeq;return _this;}_inherits(o,_l);return _createClass(o,[{key:"render",value:function render(){var t=this.label||this.id;return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"group\"\n class=\"group\"\n role=\"group\"\n aria-labelledby=","\n >\n ","\n <slot></slot>\n </div>\n "])),t?this._labelId:void 0,t?e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<div part=\"label\" class=\"label\" id=",">","</div>"])),this._labelId,t):null);}}],[{key:"styles",get:function get(){return[i];}}]);}(l));n._idSeq=0,t([s({attribute:!0,type:String,reflect:!0})],n.prototype,"label",void 0),_export("N",n=_o=t([r("nile-context-menu-group")],n));}};});
2
+ //# sourceMappingURL=nile-context-menu-group.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-context-menu-group.cjs.js","sources":["../../../src/nile-context-menu-group/nile-context-menu-group.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2026\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './nile-context-menu-group.css';\nimport NileElement from '../internal/nile-element';\n\n/**\n * Nile context-menu group. Groups related items inside a `nile-context-menu`.\n *\n * @tag nile-context-menu-group\n *\n * @slot - Default slot for `nile-context-menu-item` children.\n */\n@customElement('nile-context-menu-group')\nexport class NileContextMenuGroup extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ attribute: true, type: String, reflect: true }) label = '';\n\n private static _idSeq = 0;\n private readonly _labelId = `nile-context-menu-group-label-${++NileContextMenuGroup._idSeq}`;\n\n public render(): TemplateResult {\n const heading = this.label || this.id;\n return html`\n <div\n part=\"group\"\n class=\"group\"\n role=\"group\"\n aria-labelledby=${heading ? this._labelId : undefined}\n >\n ${heading\n ? html`<div part=\"label\" class=\"label\" id=${this._labelId}>${heading}</div>`\n : null}\n <slot></slot>\n </div>\n `;\n }\n}\n\nexport default NileContextMenuGroup;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-context-menu-group': NileContextMenuGroup;\n }\n}\n"],"names":["NileContextMenuGroup","NileContextMenuGroup_1","o","constructor","this","label","_labelId","_idSeq","_this","_inherits","_l","_createClass","key","value","render","heading","id","html","_templateObject","_taggedTemplateLiteral","undefined","_templateObject2","get","styles","NileElement","__decorate","property","attribute","type","String","reflect","prototype","customElement"],"mappings":"k+GAoBaA,CAAAA,CAAoBC,6BAA1B,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAKuDC,KAAAA,CAAKC,KAAG,CAAA,EAAA,CAGnDD,KAAAA,CAAAE,QAAW,CAAA,gCAAA,CAAA,GAAmCL,GAAqBM,MAkBrF,QAAAC,KAAA,EAzBQC,SAAA,CAAAP,CAAA,CAAAQ,EAAA,SAAAC,YAAA,CAAAT,CAAA,GAAAU,GAAA,UAAAC,KAAA,CASA,SAAAC,MAAAA,CAAAA,EACL,GAAMC,CAAAA,CAAAA,CAAUX,KAAKC,KAASD,EAAAA,IAAAA,CAAKY,EACnC,CAAA,MAAOC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,2LAKWJ,CAAAA,CAAUX,KAAKE,QAAWc,CAAAA,IAAAA,EAAAA,CAE1CL,CAAAA,CACEE,CAAI,CAAAI,gBAAA,GAAAA,gBAAA,CAAAF,sBAAA,4DAAsCf,IAAKE,CAAAA,QAAAA,CAAYS,CAC3D,EAAA,IAAA,EAIT,CAlBcf,KAAAA,GAAAA,UAAAA,GAAAA,CANR,SAAAsB,IAAA,CAAWC,CAChB,MAAO,CAACA,EACT,EAOM,MAViCC,CAAAA,CAOzBxB,EAAAA,CAAAA,CAAMO,OAAG,CAFoCkB,CAAAA,CAAAA,CAAA,CAA3DC,CAAS,CAAA,CAAEC,SAAW,CAAA,CAAA,CAAA,CAAMC,IAAMC,CAAAA,MAAAA,CAAQC,SAAS,CAAmB9B,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA+B,SAAA,CAAA,OAAA,CAAA,IAAA,EAL5D/B,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAoBC,GAAAwB,CAAA,CAAA,CADhCO,CAAc,CAAA,yBAAA,CAAA,CAAA,CACFhC"}
@@ -0,0 +1,2 @@
1
+ System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,i;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("s",i=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n box-sizing: border-box;\n display: block;\n }\n\n .group {\n display: flex;\n flex-direction: column;\n }\n\n .label {\n padding: var(--nile-spacing-xs, var(--ng-spacing-xs)) var(--nile-spacing-xl, var(--ng-spacing-xl));\n font-family: inherit;\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-xs));\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-semibold));\n line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-placeholder-subtle));\n }\n"]))));}};});
2
+ //# sourceMappingURL=nile-context-menu-group.css.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-context-menu-group.css.cjs.js","sources":["../../../src/nile-context-menu-group/nile-context-menu-group.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2026\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\nexport const styles = css`\n :host {\n box-sizing: border-box;\n display: block;\n }\n\n .group {\n display: flex;\n flex-direction: column;\n }\n\n .label {\n padding: var(--nile-spacing-xs, var(--ng-spacing-xs)) var(--nile-spacing-xl, var(--ng-spacing-xl));\n font-family: inherit;\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-xs));\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-semibold));\n line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-placeholder-subtle));\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTASaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
@@ -0,0 +1,20 @@
1
+ import{css as e}from"lit";const i=e`
2
+ :host {
3
+ box-sizing: border-box;
4
+ display: block;
5
+ }
6
+
7
+ .group {
8
+ display: flex;
9
+ flex-direction: column;
10
+ }
11
+
12
+ .label {
13
+ padding: var(--nile-spacing-xs, var(--ng-spacing-xs)) var(--nile-spacing-xl, var(--ng-spacing-xl));
14
+ font-family: inherit;
15
+ font-size: var(--nile-type-scale-3, var(--ng-font-size-text-xs));
16
+ font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-semibold));
17
+ line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));
18
+ color: var(--nile-colors-neutral-500, var(--ng-colors-text-placeholder-subtle));
19
+ }
20
+ `;export{i as s};
@@ -0,0 +1,11 @@
1
+ import{__decorate as t}from"tslib";import{html as e}from"lit";import{property as s,customElement as r}from"lit/decorators.js";import{s as i}from"./nile-context-menu-group.css.esm.js";import{N as l}from"../internal/nile-element.esm.js";import"../internal/accessibility/a11y.state.enum.esm.js";import"../internal/accessibility/a11y.property.enum.esm.js";import"../internal/accessibility/role.enum.esm.js";var o;let n=o=class extends l{constructor(){super(...arguments),this.label="",this._labelId="nile-context-menu-group-label-"+ ++o._idSeq}static get styles(){return[i]}render(){const t=this.label||this.id;return e`
2
+ <div
3
+ part="group"
4
+ class="group"
5
+ role="group"
6
+ aria-labelledby=${t?this._labelId:void 0}
7
+ >
8
+ ${t?e`<div part="label" class="label" id=${this._labelId}>${t}</div>`:null}
9
+ <slot></slot>
10
+ </div>
11
+ `}};n._idSeq=0,t([s({attribute:!0,type:String,reflect:!0})],n.prototype,"label",void 0),n=o=t([r("nile-context-menu-group")],n);export{n as N};
@@ -0,0 +1,2 @@
1
+ System.register(["./nile-context-menu-item.cjs.js","tslib","lit","lit/decorators.js","./nile-context-menu-item.css.cjs.js","../internal/nile-element.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileContextMenuItemCjsJs){_export("NileContextMenuItem",_nileContextMenuItemCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_nileContextMenuItemCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){}};});
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export{N as NileContextMenuItem}from"./nile-context-menu-item.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"./nile-context-menu-item.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/accessibility/a11y.state.enum.esm.js";import"../internal/accessibility/a11y.property.enum.esm.js";import"../internal/accessibility/role.enum.esm.js";
@@ -0,0 +1,2 @@
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-context-menu-item.css.cjs.js","../internal/nile-element.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var t,e,s,i,a,n,r,o,_templateObject,_templateObject2,l;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){e=_lit.html;s=_lit.nothing;},function(_litDecoratorsJs){i=_litDecoratorsJs.property;a=_litDecoratorsJs.state;n=_litDecoratorsJs.customElement;},function(_nileContextMenuItemCssCjsJs){r=_nileContextMenuItemCssCjsJs.s;},function(_internalNileElementCjsJs){o=_internalNileElementCjsJs.N;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",l=/*#__PURE__*/function(_o){function l(){var _this;_classCallCheck(this,l);_this=_callSuper(this,l,arguments),_this.value="",_this.disabled=!1,_this.open=!1,_this._hasSubmenu=!1,_this._hasIcon=!1,_this._submenuExpanded=!1,_this._onSlotChange=function(t){var e=t.target.assignedElements({flatten:!0});_this._hasSubmenu=e.some(function(t){return"nile-context-submenu"===t.tagName.toLowerCase();});},_this._onIconSlotChange=function(t){var e=t.target;_this._hasIcon=e.assignedNodes({flatten:!0}).some(function(t){var _t$textContent;return t.nodeType===Node.ELEMENT_NODE||""!==((_t$textContent=t.textContent)!==null&&_t$textContent!==void 0?_t$textContent:"").trim();});};return _this;}_inherits(l,_o);return _createClass(l,[{key:"setSubmenuExpanded",value:function setSubmenuExpanded(t){this._submenuExpanded=t;}},{key:"focus",value:function focus(t){var _this$shadowRoot;var e=(_this$shadowRoot=this.shadowRoot)===null||_this$shadowRoot===void 0?void 0:_this$shadowRoot.querySelector(".item");e===null||e===void 0||e.focus(t);}},{key:"hasSubmenu",get:function get(){return this._hasSubmenu;}},{key:"render",value:function render(){return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"item\"\n class=\"item\"\n role=\"menuitem\"\n tabindex=\"-1\"\n aria-disabled=","\n aria-haspopup=","\n aria-expanded=","\n data-has-submenu=","\n >\n <span part=\"icon\" class=\"icon\" data-empty=",">\n <slot name=\"icon\" @slotchange=","></slot>\n </span>\n <span part=\"label\" class=\"label\"><slot @slotchange=","></slot></span>\n ","\n </div>\n "])),this.disabled?"true":"false",this._hasSubmenu?"menu":s,this._hasSubmenu?String(this._submenuExpanded):s,this._hasSubmenu?"true":"false",this._hasIcon?"false":"true",this._onIconSlotChange,this._onSlotChange,this._hasSubmenu?e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<span part=\"chevron\" class=\"chevron\" aria-hidden=\"true\">\n <nile-glyph name=\"ng-chevron-right\" size=\"16\" method=\"stroke\"></nile-glyph>\n </span>"]))):"");}}],[{key:"styles",get:function get(){return[r];}}]);}(o));t([i({attribute:!0,type:String,reflect:!0})],l.prototype,"value",void 0),t([i({attribute:!0,type:Boolean,reflect:!0})],l.prototype,"disabled",void 0),t([i({attribute:!0,type:Boolean,reflect:!0})],l.prototype,"open",void 0),t([a()],l.prototype,"_hasSubmenu",void 0),t([a()],l.prototype,"_hasIcon",void 0),t([a()],l.prototype,"_submenuExpanded",void 0),_export("N",l=t([n("nile-context-menu-item")],l));}};});
2
+ //# sourceMappingURL=nile-context-menu-item.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-context-menu-item.cjs.js","sources":["../../../src/nile-context-menu-item/nile-context-menu-item.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2026\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, CSSResultArray, TemplateResult, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { styles } from './nile-context-menu-item.css';\nimport NileElement from '../internal/nile-element';\n\n//Data passed to an item's `onSelect` callback. Matches the `nile-context-menu:select` event detail.\nexport interface NileContextMenuItemSelectDetail {\n id: string;\n value: string;\n name: string;\n target: Element | null;\n originalEvent: Event | null;\n}\n\nexport type NileContextMenuItemSelectHandler = (\n detail: NileContextMenuItemSelectDetail\n) => void;\n\n/**\n * Nile context-menu item. A clickable entry inside `nile-context-menu`.\n *\n * @tag nile-context-menu-item\n *\n * @slot - Default slot for the visible label.\n * @slot icon - Optional leading icon (e.g. a `<nile-glyph slot=\"icon\">`).\n */\n@customElement('nile-context-menu-item')\nexport class NileContextMenuItem extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ attribute: true, type: String, reflect: true }) value = '';\n\n @property({ attribute: true, type: Boolean, reflect: true }) disabled = false;\n\n @property({ attribute: true, type: Boolean, reflect: true }) open = false;\n\n public onSelect?: NileContextMenuItemSelectHandler;\n\n @state() private _hasSubmenu = false;\n\n @state() private _hasIcon = false;\n\n @state() private _submenuExpanded = false;\n\n public setSubmenuExpanded(expanded: boolean): void {\n this._submenuExpanded = expanded;\n }\n\n public override focus(options?: FocusOptions): void {\n const inner = this.shadowRoot?.querySelector('.item') as HTMLElement | null;\n inner?.focus(options);\n }\n\n public get hasSubmenu(): boolean {\n return this._hasSubmenu;\n }\n\n private _onSlotChange = (e: Event): void => {\n const slot = e.target as HTMLSlotElement;\n const nodes = slot.assignedElements({ flatten: true });\n this._hasSubmenu = nodes.some(\n n => n.tagName.toLowerCase() === 'nile-context-submenu'\n );\n };\n\n private _onIconSlotChange = (e: Event): void => {\n const slot = e.target as HTMLSlotElement;\n this._hasIcon = slot.assignedNodes({ flatten: true }).some(\n n => n.nodeType === Node.ELEMENT_NODE || (n.textContent ?? '').trim() !== ''\n );\n };\n\n public render(): TemplateResult {\n return html`\n <div\n part=\"item\"\n class=\"item\"\n role=\"menuitem\"\n tabindex=\"-1\"\n aria-disabled=${this.disabled ? 'true' : 'false'}\n aria-haspopup=${this._hasSubmenu ? 'menu' : nothing}\n aria-expanded=${this._hasSubmenu ? String(this._submenuExpanded) : nothing}\n data-has-submenu=${this._hasSubmenu ? 'true' : 'false'}\n >\n <span part=\"icon\" class=\"icon\" data-empty=${this._hasIcon ? 'false' : 'true'}>\n <slot name=\"icon\" @slotchange=${this._onIconSlotChange}></slot>\n </span>\n <span part=\"label\" class=\"label\"><slot @slotchange=${this._onSlotChange}></slot></span>\n ${this._hasSubmenu\n ? html`<span part=\"chevron\" class=\"chevron\" aria-hidden=\"true\">\n <nile-glyph name=\"ng-chevron-right\" size=\"16\" method=\"stroke\"></nile-glyph>\n </span>`\n : ''}\n </div>\n `;\n }\n}\n\nexport default NileContextMenuItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-context-menu-item': NileContextMenuItem;\n }\n}\n"],"names":["NileContextMenuItem","_o","l","this","value","disabled","open","_hasSubmenu","_hasIcon","_submenuExpanded","_onSlotChange","e","nodes","target","assignedElements","flatten","some","n","tagName","toLowerCase","_onIconSlotChange","slot","assignedNodes","nodeType","Node","ELEMENT_NODE","textContent","_t$textContent","trim","_this","_inherits","_createClass","key","setSubmenuExpanded","expanded","focus","options","_this$shadowRoot","inner","shadowRoot","querySelector","get","render","html","_templateObject","_taggedTemplateLiteral","nothing","String","_templateObject2","styles","NileElement","__decorate","property","attribute","type","reflect","prototype","Boolean","state","_export","customElement"],"mappings":"wgHAkCaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,qEAKuDC,EAAAA,KAAAA,CAAKC,KAAG,CAAA,EAAA,CAEPD,KAAAA,C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AAA,CAAS,CAAmBvD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwD,SAAA,CAAA,OAAA,CAAA,IAAA,IAEVL,CAAA,CAAA,CAA5DC,CAAS,CAAA,CAAEC,SAAW,CAAA,CAAA,CAAA,CAAMC,IAAMG,CAAAA,OAAAA,CAASF,SAAS,CAAyBvD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwD,SAAA,CAAA,UAAA,CAAA,IAAA,EAEjBL,CAAAA,CAAAA,CAAAA,CAAA,CAA5DC,CAAAA,CAAS,CAAEC,SAAW,CAAA,CAAA,CAAA,CAAMC,IAAMG,CAAAA,OAAAA,CAASF,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqBvD,CAAAwD,CAAAA,SAAAA,CAAA,WAAA,EAIzDL,CAAAA,CAAAA,CAAAA,CAAA,CAAhBO,CAAAA,CAAAA,CAAAA,CAAAA,CAAoC1D,CAAAwD,CAAAA,SAAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,CAEpBL,EAAA,CAAhBO,CAAAA,CAAAA,CAAAA,CAAAA,CAAiC1D,CAAAwD,CAAAA,SAAAA,CAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAEjBL,CAAA,CAAA,CAAhBO,KAAyC1D,CAAAwD,CAAAA,SAAAA,CAAA,kBAAA,CAAA,IAAA,EAAA,CAAA,CAAAG,OAAA,KAjB/B3D,CAAmBmD,CAAAA,CAAAA,CAAA,CAD/BS,CAAAA,CAAc,2BACF5D"}
@@ -0,0 +1,2 @@
1
+ System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,n;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("s",n=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n box-sizing: border-box;\n display: block;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .item {\n position: relative;\n display: flex;\n align-items: center;\n min-height: 40px;\n padding: var(--nile-spacing-none, var(--ng-spacing-none)) var(--nile-spacing-xl, var(--ng-spacing-xl));\n font-family: inherit;\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));\n line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));\n letter-spacing: normal;\n color: var(--nile-colors-text-default, var(--ng-colors-text-secondary-700));\n cursor: pointer;\n white-space: nowrap;\n user-select: none;\n transition: 150ms fill;\n }\n\n .item:hover,\n .item:focus,\n .item:focus-visible {\n outline: none;\n background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-primary-hover));\n color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-hover));\n }\n\n .item[aria-disabled='true'] {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n\n .icon {\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n margin-right: var(--nile-spacing-md, var(--ng-spacing-md));\n }\n\n .icon[data-empty='true'] {\n display: none;\n }\n\n .label {\n flex: 1 1 auto;\n min-width: 0;\n }\n\n .chevron {\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n margin-left: var(--nile-spacing-md, var(--ng-spacing-md));\n line-height: 1;\n opacity: 0.6;\n }\n"]))));}};});
2
+ //# sourceMappingURL=nile-context-menu-item.css.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-context-menu-item.css.cjs.js","sources":["../../../src/nile-context-menu-item/nile-context-menu-item.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2026\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\nexport const styles = css`\n :host {\n box-sizing: border-box;\n display: block;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .item {\n position: relative;\n display: flex;\n align-items: center;\n min-height: 40px;\n padding: var(--nile-spacing-none, var(--ng-spacing-none)) var(--nile-spacing-xl, var(--ng-spacing-xl));\n font-family: inherit;\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));\n line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));\n letter-spacing: normal;\n color: var(--nile-colors-text-default, var(--ng-colors-text-secondary-700));\n cursor: pointer;\n white-space: nowrap;\n user-select: none;\n transition: 150ms fill;\n }\n\n .item:hover,\n .item:focus,\n .item:focus-visible {\n outline: none;\n background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-primary-hover));\n color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-hover));\n }\n\n .item[aria-disabled='true'] {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n\n .icon {\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n margin-right: var(--nile-spacing-md, var(--ng-spacing-md));\n }\n\n .icon[data-empty='true'] {\n display: none;\n }\n\n .label {\n flex: 1 1 auto;\n min-width: 0;\n }\n\n .chevron {\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n margin-left: var(--nile-spacing-md, var(--ng-spacing-md));\n line-height: 1;\n opacity: 0.6;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTASaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
@@ -0,0 +1,72 @@
1
+ import{css as e}from"lit";const n=e`
2
+ :host {
3
+ box-sizing: border-box;
4
+ display: block;
5
+ -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
6
+ -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));
7
+ text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));
8
+ }
9
+
10
+ :host *,
11
+ :host *::before,
12
+ :host *::after {
13
+ box-sizing: inherit;
14
+ }
15
+
16
+ .item {
17
+ position: relative;
18
+ display: flex;
19
+ align-items: center;
20
+ min-height: 40px;
21
+ padding: var(--nile-spacing-none, var(--ng-spacing-none)) var(--nile-spacing-xl, var(--ng-spacing-xl));
22
+ font-family: inherit;
23
+ font-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));
24
+ font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));
25
+ line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));
26
+ letter-spacing: normal;
27
+ color: var(--nile-colors-text-default, var(--ng-colors-text-secondary-700));
28
+ cursor: pointer;
29
+ white-space: nowrap;
30
+ user-select: none;
31
+ transition: 150ms fill;
32
+ }
33
+
34
+ .item:hover,
35
+ .item:focus,
36
+ .item:focus-visible {
37
+ outline: none;
38
+ background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-primary-hover));
39
+ color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-hover));
40
+ }
41
+
42
+ .item[aria-disabled='true'] {
43
+ opacity: 0.5;
44
+ cursor: not-allowed;
45
+ pointer-events: none;
46
+ }
47
+
48
+ .icon {
49
+ flex: 0 0 auto;
50
+ display: inline-flex;
51
+ align-items: center;
52
+ margin-right: var(--nile-spacing-md, var(--ng-spacing-md));
53
+ }
54
+
55
+ .icon[data-empty='true'] {
56
+ display: none;
57
+ }
58
+
59
+ .label {
60
+ flex: 1 1 auto;
61
+ min-width: 0;
62
+ }
63
+
64
+ .chevron {
65
+ flex: 0 0 auto;
66
+ display: inline-flex;
67
+ align-items: center;
68
+ margin-left: var(--nile-spacing-md, var(--ng-spacing-md));
69
+ line-height: 1;
70
+ opacity: 0.6;
71
+ }
72
+ `;export{n as s};
@@ -0,0 +1,20 @@
1
+ import{__decorate as t}from"tslib";import{html as e,nothing as s}from"lit";import{property as i,state as a,customElement as n}from"lit/decorators.js";import{s as r}from"./nile-context-menu-item.css.esm.js";import{N as o}from"../internal/nile-element.esm.js";import"../internal/accessibility/a11y.state.enum.esm.js";import"../internal/accessibility/a11y.property.enum.esm.js";import"../internal/accessibility/role.enum.esm.js";let l=class extends o{constructor(){super(...arguments),this.value="",this.disabled=!1,this.open=!1,this._hasSubmenu=!1,this._hasIcon=!1,this._submenuExpanded=!1,this._onSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this._hasSubmenu=e.some((t=>"nile-context-submenu"===t.tagName.toLowerCase()))},this._onIconSlotChange=t=>{const e=t.target;this._hasIcon=e.assignedNodes({flatten:!0}).some((t=>t.nodeType===Node.ELEMENT_NODE||""!==(t.textContent??"").trim()))}}static get styles(){return[r]}setSubmenuExpanded(t){this._submenuExpanded=t}focus(t){const e=this.shadowRoot?.querySelector(".item");e?.focus(t)}get hasSubmenu(){return this._hasSubmenu}render(){return e`
2
+ <div
3
+ part="item"
4
+ class="item"
5
+ role="menuitem"
6
+ tabindex="-1"
7
+ aria-disabled=${this.disabled?"true":"false"}
8
+ aria-haspopup=${this._hasSubmenu?"menu":s}
9
+ aria-expanded=${this._hasSubmenu?String(this._submenuExpanded):s}
10
+ data-has-submenu=${this._hasSubmenu?"true":"false"}
11
+ >
12
+ <span part="icon" class="icon" data-empty=${this._hasIcon?"false":"true"}>
13
+ <slot name="icon" @slotchange=${this._onIconSlotChange}></slot>
14
+ </span>
15
+ <span part="label" class="label"><slot @slotchange=${this._onSlotChange}></slot></span>
16
+ ${this._hasSubmenu?e`<span part="chevron" class="chevron" aria-hidden="true">
17
+ <nile-glyph name="ng-chevron-right" size="16" method="stroke"></nile-glyph>
18
+ </span>`:""}
19
+ </div>
20
+ `}};t([i({attribute:!0,type:String,reflect:!0})],l.prototype,"value",void 0),t([i({attribute:!0,type:Boolean,reflect:!0})],l.prototype,"disabled",void 0),t([i({attribute:!0,type:Boolean,reflect:!0})],l.prototype,"open",void 0),t([a()],l.prototype,"_hasSubmenu",void 0),t([a()],l.prototype,"_hasIcon",void 0),t([a()],l.prototype,"_submenuExpanded",void 0),l=t([n("nile-context-menu-item")],l);export{l as N};
@@ -0,0 +1,2 @@
1
+ System.register(["./nile-context-submenu.cjs.js","tslib","lit","lit/decorators.js","../internal/nile-element.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js","../nile-floating-panel/nile-floating-panel.cjs.js","../nile-floating-panel/nile-floating-panel.css.cjs.js","../tippy.esm-78baa8f2.cjs.js","../nile-lite-tooltip/utils.cjs.js","../utilities/visibility-manager.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileContextSubmenuCjsJs){_export("NileContextSubmenu",_nileContextSubmenuCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_internalNileElementCjsJs){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){},function(_nileFloatingPanelNileFloatingPanelCjsJs){},function(_nileFloatingPanelNileFloatingPanelCssCjsJs){},function(_tippyEsm006CjsJs){},function(_nileLiteTooltipUtilsCjsJs){},function(_utilitiesVisibilityManagerCjsJs){}],execute:function execute(){}};});
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export{N as NileContextSubmenu}from"./nile-context-submenu.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"../internal/nile-element.esm.js";import"../internal/accessibility/a11y.state.enum.esm.js";import"../internal/accessibility/a11y.property.enum.esm.js";import"../internal/accessibility/role.enum.esm.js";import"../nile-floating-panel/nile-floating-panel.esm.js";import"../nile-floating-panel/nile-floating-panel.css.esm.js";import"../tippy.esm-57628c2b.esm.js";import"../nile-lite-tooltip/utils.esm.js";import"../utilities/visibility-manager.esm.js";
@@ -0,0 +1,2 @@
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","../internal/nile-element.cjs.js","../nile-floating-panel/nile-floating-panel.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js","../nile-floating-panel/nile-floating-panel.css.cjs.js","../tippy.esm-78baa8f2.cjs.js","../nile-lite-tooltip/utils.cjs.js","../utilities/visibility-manager.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,n,h,o,_templateObject,_templateObject2,_r,l,c,u,a;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0,F=function F(){};return{s:F,n:function(_n){function n(){return _n.apply(this,arguments);}n.toString=function(){return _n.toString();};return n;}(function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]};}),e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.css;s=_lit.html;},function(_litDecoratorsJs){e=_litDecoratorsJs.property;n=_litDecoratorsJs.state;h=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){o=_internalNileElementCjsJs.N;},function(_nileFloatingPanelNileFloatingPanelCjsJs){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){},function(_nileFloatingPanelNileFloatingPanelCssCjsJs){},function(_tippyEsm006CjsJs){},function(_nileLiteTooltipUtilsCjsJs){},function(_utilitiesVisibilityManagerCjsJs){}],execute:function execute(){l="nile-context-menu-item",c="nile-context-submenu";u=0,_export("N",a=_r=/*#__PURE__*/function(_o){function r(){var _this;_classCallCheck(this,r);_this=_callSuper(this,r,arguments),_this.zIndex=9999,_this._open=!1,_this._parentItem=null,_this._proxyId="nile-context-submenu-anchor-"+ ++u,_this._menuContainerRef=null,_this._setupDone=!1,_this._repositionQueued=!1,_this._onParentEnter=function(){var _this$_parentItem;((_this$_parentItem=_this._parentItem)===null||_this$_parentItem===void 0?void 0:_this$_parentItem.disabled)||(_this._clearTimers(),_this._open||(_this._openTimer=window.setTimeout(function(){return _this.openSubmenu();},100)));},_this._onParentLeave=function(){null!=_this._openTimer&&(clearTimeout(_this._openTimer),_this._openTimer=void 0),_this._pinnedOpen||_this._open&&(_this._closeTimer=window.setTimeout(function(){return _this.closeSubmenu();},300));},_this._onParentClick=function(t){var _this$_parentItem2;t.stopPropagation(),((_this$_parentItem2=_this._parentItem)===null||_this$_parentItem2===void 0?void 0:_this$_parentItem2.disabled)||(_this._clearTimers(),_this._open?_this._pinnedOpen||_this.closeSubmenu():_this.openSubmenu());},_this._onPanelEnter=function(){_this._clearTimers();},_this._onReposition=function(){!_this._repositionQueued&&_this._open&&(_this._repositionQueued=!0,requestAnimationFrame(function(){var _this$_floatingPanelE;_this._repositionQueued=!1,_this._open&&(_this._syncProxyToParent(),(_this$_floatingPanelE=_this._floatingPanelEl)===null||_this$_floatingPanelE===void 0?void 0:_this$_floatingPanelE.reposition());}));},_this._onPanelLeave=function(){_this._pinnedOpen||_this._open&&(_this._closeTimer=window.setTimeout(function(){_r.openStack.some(function(t){var _this$_menuContainerR;return t!==_assertThisInitialized(_this)&&((_this$_menuContainerR=_this._menuContainerRef)===null||_this$_menuContainerR===void 0?void 0:_this$_menuContainerR.contains(t));})||_this.closeSubmenu();},300));},_this._onMenuMouseOver=function(t){var i=t.composedPath().find(function(t){return t instanceof HTMLElement&&t.tagName.toLowerCase()===l;});i&&!i.disabled&&i.focus();},_this._onNestedSelect=function(t){var _t$detail;t.target!==_assertThisInitialized(_this)&&"click"===((_t$detail=t.detail)===null||_t$detail===void 0?void 0:_t$detail.type)&&_this.emit("nile-change",t.detail);},_this._onMenuClick=function(t){var _i$textContent;var i=t.composedPath().find(function(t){return t instanceof HTMLElement&&t.tagName.toLowerCase()===l;});if(!i||i.disabled)return;if(i.querySelector(":scope > ".concat(c)))return;var s={id:i.id,value:i.value,name:((_i$textContent=i.textContent)!==null&&_i$textContent!==void 0?_i$textContent:"").trim(),target:null,originalEvent:t};try{var _i$onSelect;(_i$onSelect=i.onSelect)===null||_i$onSelect===void 0||_i$onSelect.call(i,s);}catch(t){console.error("[nile-context-submenu] onSelect callback threw:",t);}_this.emit("nile-change",_objectSpread({type:"click"},s));};return _this;}_inherits(r,_o);return _createClass(r,[{key:"_pinnedOpen",get:function get(){var _this$_parentItem3;return!(!((_this$_parentItem3=this._parentItem)!==null&&_this$_parentItem3!==void 0&&_this$_parentItem3.open)||this._parentItem.disabled);}},{key:"connectedCallback",value:function connectedCallback(){var _this$_parentItem$set,_this$_parentItem4,_this2=this;_superPropGet(r,"connectedCallback",this,3)([]);var t=this.parentElement;for(;t&&t.tagName.toLowerCase()!==l;)t=t.parentElement;this._parentItem=t,this._ensureProxy(),this._parentItem&&((_this$_parentItem$set=(_this$_parentItem4=this._parentItem).setSubmenuExpanded)!==null&&_this$_parentItem$set!==void 0&&_this$_parentItem$set.call(_this$_parentItem4,!1),this._parentItem.addEventListener("mouseenter",this._onParentEnter),this._parentItem.addEventListener("mouseleave",this._onParentLeave),this._parentItem.addEventListener("click",this._onParentClick,!0),this._parentObserver=new MutationObserver(function(){_this2._pinnedOpen?_this2._isParentVisible()&&_this2.openSubmenu():_this2._open&&_this2.closeSubmenu();}),this._parentObserver.observe(this._parentItem,{attributes:!0,attributeFilter:["open"]})),this._ensureBodyPanel();}},{key:"_isParentVisible",value:function _isParentVisible(){var _this$_parentItem5;var t=(_this$_parentItem5=this._parentItem)===null||_this$_parentItem5===void 0?void 0:_this$_parentItem5.getBoundingClientRect();return!!t&&t.width>0&&t.height>0;}},{key:"_ensureProxy",value:function _ensureProxy(){if(this._proxyEl)return;var t=document.createElement("div");t.id=this._proxyId,t.setAttribute("aria-hidden","true"),t.style.cssText="position: fixed; top: 0; left: 0; width: 0; height: 0; pointer-events: none;",document.body.appendChild(t),this._proxyEl=t;}},{key:"_syncProxyToParent",value:function _syncProxyToParent(){if(!this._proxyEl||!this._parentItem)return;var t=this._parentItem.getBoundingClientRect();this._pinnedOpen?(this._proxyEl.style.position="absolute",this._proxyEl.style.left="".concat(t.left+window.scrollX,"px"),this._proxyEl.style.top="".concat(t.top+window.scrollY,"px")):(this._proxyEl.style.position="fixed",this._proxyEl.style.left="".concat(t.left,"px"),this._proxyEl.style.top="".concat(t.top,"px")),this._proxyEl.style.width="".concat(t.width,"px"),this._proxyEl.style.height="".concat(t.height,"px");}},{key:"disconnectedCallback",value:function disconnectedCallback(){var _this$_parentObserver,_this3=this;_superPropGet(r,"disconnectedCallback",this,3)([]),this._parentItem&&(this._parentItem.removeEventListener("mouseenter",this._onParentEnter),this._parentItem.removeEventListener("mouseleave",this._onParentLeave),this._parentItem.removeEventListener("click",this._onParentClick,!0)),(_this$_parentObserver=this._parentObserver)!==null&&_this$_parentObserver!==void 0&&_this$_parentObserver.disconnect(),this._parentObserver=void 0,this._clearTimers(),this._open&&this.closeSubmenu(),this._teardownBodyArtifacts(),_r.openStack=_r.openStack.filter(function(t){return t!==_this3;});}},{key:"_teardownBodyArtifacts",value:function _teardownBodyArtifacts(){var _this$_floatingPanelE2,_this$_proxyEl;var t=this._menuContainerRef;if(t)for(t.removeEventListener("click",this._onMenuClick),t.removeEventListener("mouseover",this._onMenuMouseOver),t.removeEventListener("mouseenter",this._onPanelEnter),t.removeEventListener("mouseleave",this._onPanelLeave),t.removeEventListener("nile-change",this._onNestedSelect);t.firstChild;)this.appendChild(t.firstChild);(_this$_floatingPanelE2=this._floatingPanelEl)!==null&&_this$_floatingPanelE2!==void 0&&_this$_floatingPanelE2.remove(),this._floatingPanelEl=void 0,this._menuContainerRef=null,this._setupDone=!1,(_this$_proxyEl=this._proxyEl)!==null&&_this$_proxyEl!==void 0&&_this$_proxyEl.remove(),this._proxyEl=void 0;}},{key:"_ensureBodyPanel",value:function _ensureBodyPanel(){if(this._setupDone)return;var t=document.createElement("nile-floating-panel");t.setAttribute("for",this._proxyId),t.setAttribute("trigger","manual"),t.setAttribute("placement","right-start"),t.panelClass="nile-context-menu-panel",t.zIndex=this.zIndex,t.interactive=!0,t.hideOnClick=!1,t.closeOnEscape=!1,t.arrow="none",t.distance=0;var i=document.createElement("div");i.className="nile-context-menu__menu",i.setAttribute("role","menu"),t.appendChild(i),document.body.appendChild(t),this._floatingPanelEl=t,this._menuContainerRef=i,i.addEventListener("click",this._onMenuClick),i.addEventListener("mouseover",this._onMenuMouseOver),i.addEventListener("mouseenter",this._onPanelEnter),i.addEventListener("mouseleave",this._onPanelLeave),i.addEventListener("nile-change",this._onNestedSelect),this._relocateLightChildren(),this._setupDone=!0;}},{key:"firstUpdated",value:function firstUpdated(){this._relocateLightChildren();}},{key:"_relocateLightChildren",value:function _relocateLightChildren(){if(this._menuContainerRef)for(var _i=0,_Array$from=Array.from(this.children);_i<_Array$from.length;_i++){var _t=_Array$from[_i];this._menuContainerRef.appendChild(_t);}}},{key:"_clearTimers",value:function _clearTimers(){null!=this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=void 0),null!=this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=void 0);}},{key:"openSubmenu",value:function openSubmenu(){var _this$_parentItem6,_this4=this,_this$_parentItem7,_this$_parentItem7$se;this._open||((_this$_parentItem6=this._parentItem)===null||_this$_parentItem6===void 0?void 0:_this$_parentItem6.disabled)||(this._closeSiblingSubmenus(),this._ensureProxy(),this._ensureBodyPanel(),this._syncProxyToParent(),this._open=!0,this._floatingPanelEl&&(this._floatingPanelEl.addEventListener("nile-after-show",function(){_this4._open&&_this4._openPinnedDescendants();},{once:!0}),this._floatingPanelEl.open=!0),_r.openStack.push(this),window.addEventListener("scroll",this._onReposition,!0),window.addEventListener("resize",this._onReposition),requestAnimationFrame(function(){return requestAnimationFrame(function(){_this4._open&&_this4._openPinnedDescendants();});}),(_this$_parentItem7=this._parentItem)===null||_this$_parentItem7===void 0||(_this$_parentItem7$se=_this$_parentItem7.setSubmenuExpanded)===null||_this$_parentItem7$se===void 0?void 0:_this$_parentItem7$se.call(_this$_parentItem7,!0));}},{key:"_openPinnedDescendants",value:function _openPinnedDescendants(){if(!this._menuContainerRef)return;var t=Array.from(this._menuContainerRef.querySelectorAll(l));for(var _i2=0,_t2=t;_i2<_t2.length;_i2++){var _i3=_t2[_i2];if(!this._isDirectChildItem(_i3))continue;if(!_i3.open||_i3.disabled)continue;var _t3=_i3.querySelector(":scope > ".concat(c));_t3===null||_t3===void 0||_t3.openSubmenu();}}},{key:"_isDirectChildItem",value:function _isDirectChildItem(t){var i=t.parentElement;for(;i&&i!==this._menuContainerRef;){if(i.tagName.toLowerCase()===c)return!1;i=i.parentElement;}return!0;}},{key:"closeSubmenu",value:function closeSubmenu(){var _this5=this;if(this._open){var _this$_parentItem8,_this$_parentItem8$se;for(var _i4=0,_arr=_toConsumableArray(_r.openStack);_i4<_arr.length;_i4++){var _this$_menuContainerR2;var _t4=_arr[_i4];_t4!==this&&((_this$_menuContainerR2=this._menuContainerRef)===null||_this$_menuContainerR2===void 0?void 0:_this$_menuContainerR2.contains(_t4))&&_t4.closeSubmenu();}this._open=!1,this._floatingPanelEl&&(this._floatingPanelEl.open=!1),window.removeEventListener("scroll",this._onReposition,!0),window.removeEventListener("resize",this._onReposition),_r.openStack=_r.openStack.filter(function(t){return t!==_this5;}),this._clearTimers(),(_this$_parentItem8=this._parentItem)===null||_this$_parentItem8===void 0||(_this$_parentItem8$se=_this$_parentItem8.setSubmenuExpanded)===null||_this$_parentItem8$se===void 0?void 0:_this$_parentItem8$se.call(_this$_parentItem8,!1);}}},{key:"isOpen",get:function get(){return this._open;}},{key:"parentItem",get:function get(){return this._parentItem;}},{key:"focusFirstItem",value:function focusFirstItem(){if(!this._menuContainerRef)return;var t=Array.from(this._menuContainerRef.querySelectorAll(l));for(var _i5=0,_t5=t;_i5<_t5.length;_i5++){var _i6=_t5[_i5];if(this._isDirectChildItem(_i6)&&!_i6.disabled)return void _i6.focus();}}},{key:"_closeSiblingSubmenus",value:function _closeSiblingSubmenus(){var t=this._parentLevel();for(var _i7=0,_arr2=_toConsumableArray(_r.openStack);_i7<_arr2.length;_i7++){var _i8=_arr2[_i7];_i8!==this&&(_i8._pinnedOpen||_i8._parentLevel()===t&&_i8.closeSubmenu());}}},{key:"_parentLevel",value:function _parentLevel(){var _t$parentElement$clos,_t$parentElement;var t=this._parentItem;return t?(_t$parentElement$clos=(_t$parentElement=t.parentElement)===null||_t$parentElement===void 0?void 0:_t$parentElement.closest(".nile-context-menu__menu"))!==null&&_t$parentElement$clos!==void 0?_t$parentElement$clos:null:null;}},{key:"render",value:function render(){return s(_templateObject||(_templateObject=_taggedTemplateLiteral([""])));}}],[{key:"styles",get:function get(){return[i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n :host { display: contents; }\n "])))];}},{key:"findByContainer",value:function findByContainer(t){var _iterator=_createForOfIteratorHelper(_r.openStack),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _i9=_step.value;if(_i9._menuContainerRef===t)return _i9;}}catch(err){_iterator.e(err);}finally{_iterator.f();}return null;}}]);}(o));a.openStack=[],t([e({attribute:!0,type:Number,reflect:!0})],a.prototype,"zIndex",void 0),t([n()],a.prototype,"_open",void 0),_export("N",a=_r=t([h("nile-context-submenu")],a));}};});
2
+ //# sourceMappingURL=nile-context-submenu.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-context-submenu.cjs.js","sources":["../../../src/nile-context-submenu/nile-context-submenu.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2026\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, CSSResultArray, TemplateResult, css } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport NileElement from '../internal/nile-element';\nimport type { NileContextMenuItem } from '../nile-context-menu-item';\nimport '../nile-floating-panel';\nimport type { NileFloatingPanel } from '../nile-floating-panel';\n\nconst ITEM_TAG = 'nile-context-menu-item';\nconst SUBMENU_TAG = 'nile-context-submenu';\nconst HOVER_OPEN_DELAY = 100;\nconst HOVER_CLOSE_DELAY = 300;\n\nlet submenuIdSeq = 0;\n\n/**\n * Nested submenu inside a `nile-context-menu-item`.\n * @tag nile-context-submenu\n */\n@customElement('nile-context-submenu')\nexport class NileContextSubmenu extends NileElement {\n public static get styles(): CSSResultArray {\n return [\n css`\n :host { display: contents; }\n `,\n ];\n }\n\n @property({ attribute: true, type: Number, reflect: true }) zIndex = 9999;\n\n @state() private _open = false;\n\n public static openStack: NileContextSubmenu[] = [];\n\n private _parentItem: NileContextMenuItem | null = null;\n private _proxyId = `nile-context-submenu-anchor-${++submenuIdSeq}`;\n private _proxyEl?: HTMLDivElement;\n private _floatingPanelEl?: NileFloatingPanel;\n private _menuContainerRef: HTMLDivElement | null = null;\n private _openTimer?: number;\n private _closeTimer?: number;\n private _setupDone = false;\n private _parentObserver?: MutationObserver;\n private _repositionQueued = false;\n private get _pinnedOpen(): boolean {\n return !!(this._parentItem?.open && !this._parentItem.disabled);\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n let p: Element | null = this.parentElement;\n while (p && p.tagName.toLowerCase() !== ITEM_TAG) p = p.parentElement;\n this._parentItem = p as NileContextMenuItem | null;\n this._ensureProxy();\n if (this._parentItem) {\n this._parentItem.setSubmenuExpanded?.(false);\n this._parentItem.addEventListener('mouseenter', this._onParentEnter);\n this._parentItem.addEventListener('mouseleave', this._onParentLeave);\n this._parentItem.addEventListener('click', this._onParentClick, true);\n // Open/close the submenu when the parent item's `open` attribute changes.\n this._parentObserver = new MutationObserver(() => {\n if (this._pinnedOpen) {\n if (this._isParentVisible()) this.openSubmenu();\n } else if (this._open) {\n this.closeSubmenu();\n }\n });\n this._parentObserver.observe(this._parentItem, {\n attributes: true,\n attributeFilter: ['open'],\n });\n }\n this._ensureBodyPanel();\n }\n\n private _isParentVisible(): boolean {\n const rect = this._parentItem?.getBoundingClientRect();\n return !!rect && rect.width > 0 && rect.height > 0;\n }\n\n private _ensureProxy(): void {\n if (this._proxyEl) return;\n const el = document.createElement('div');\n el.id = this._proxyId;\n el.setAttribute('aria-hidden', 'true');\n el.style.cssText =\n 'position: fixed; top: 0; left: 0; width: 0; height: 0; pointer-events: none;';\n document.body.appendChild(el);\n this._proxyEl = el;\n }\n\n private _syncProxyToParent(): void {\n if (!this._proxyEl || !this._parentItem) return;\n const rect = this._parentItem.getBoundingClientRect();\n if (this._pinnedOpen) {\n // Pinned submenus anchor in document coordinates.\n this._proxyEl.style.position = 'absolute';\n this._proxyEl.style.left = `${rect.left + window.scrollX}px`;\n this._proxyEl.style.top = `${rect.top + window.scrollY}px`;\n } else {\n this._proxyEl.style.position = 'fixed';\n this._proxyEl.style.left = `${rect.left}px`;\n this._proxyEl.style.top = `${rect.top}px`;\n }\n this._proxyEl.style.width = `${rect.width}px`;\n this._proxyEl.style.height = `${rect.height}px`;\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this._parentItem) {\n this._parentItem.removeEventListener('mouseenter', this._onParentEnter);\n this._parentItem.removeEventListener('mouseleave', this._onParentLeave);\n this._parentItem.removeEventListener('click', this._onParentClick, true);\n }\n this._parentObserver?.disconnect();\n this._parentObserver = undefined;\n this._clearTimers();\n if (this._open) this.closeSubmenu();\n this._teardownBodyArtifacts();\n NileContextSubmenu.openStack = NileContextSubmenu.openStack.filter(s => s !== this);\n }\n\n private _teardownBodyArtifacts(): void {\n const menu = this._menuContainerRef;\n if (menu) {\n menu.removeEventListener('click', this._onMenuClick);\n menu.removeEventListener('mouseover', this._onMenuMouseOver);\n menu.removeEventListener('mouseenter', this._onPanelEnter);\n menu.removeEventListener('mouseleave', this._onPanelLeave);\n menu.removeEventListener('nile-change', this._onNestedSelect as EventListener);\n while (menu.firstChild) this.appendChild(menu.firstChild);\n }\n this._floatingPanelEl?.remove();\n this._floatingPanelEl = undefined;\n this._menuContainerRef = null;\n this._setupDone = false;\n this._proxyEl?.remove();\n this._proxyEl = undefined;\n }\n\n private _ensureBodyPanel(): void {\n if (this._setupDone) return;\n const fp = document.createElement('nile-floating-panel') as NileFloatingPanel;\n fp.setAttribute('for', this._proxyId);\n fp.setAttribute('trigger', 'manual');\n fp.setAttribute('placement', 'right-start');\n fp.panelClass = 'nile-context-menu-panel';\n fp.zIndex = this.zIndex;\n fp.interactive = true;\n fp.hideOnClick = false;\n fp.closeOnEscape = false;\n (fp as unknown as { arrow: 'none' }).arrow = 'none';\n fp.distance = 0;\n\n const menu = document.createElement('div');\n menu.className = 'nile-context-menu__menu';\n menu.setAttribute('role', 'menu');\n fp.appendChild(menu);\n\n document.body.appendChild(fp);\n this._floatingPanelEl = fp;\n this._menuContainerRef = menu;\n\n menu.addEventListener('click', this._onMenuClick);\n menu.addEventListener('mouseover', this._onMenuMouseOver);\n menu.addEventListener('mouseenter', this._onPanelEnter);\n menu.addEventListener('mouseleave', this._onPanelLeave);\n menu.addEventListener('nile-change', this._onNestedSelect as EventListener);\n\n this._relocateLightChildren();\n this._setupDone = true;\n }\n\n protected override firstUpdated(): void {\n this._relocateLightChildren();\n }\n\n private _relocateLightChildren(): void {\n if (!this._menuContainerRef) return;\n for (const kid of Array.from(this.children)) {\n this._menuContainerRef.appendChild(kid);\n }\n }\n\n private _clearTimers(): void {\n if (this._openTimer != null) { clearTimeout(this._openTimer); this._openTimer = undefined; }\n if (this._closeTimer != null) { clearTimeout(this._closeTimer); this._closeTimer = undefined; }\n }\n\n private _onParentEnter = (): void => {\n if (this._parentItem?.disabled) return;\n this._clearTimers();\n if (this._open) return;\n this._openTimer = window.setTimeout(() => this.openSubmenu(), HOVER_OPEN_DELAY);\n };\n\n private _onParentLeave = (): void => {\n if (this._openTimer != null) { clearTimeout(this._openTimer); this._openTimer = undefined; }\n if (this._pinnedOpen) return;\n if (this._open) {\n this._closeTimer = window.setTimeout(() => this.closeSubmenu(), HOVER_CLOSE_DELAY);\n }\n };\n\n private _onParentClick = (e: MouseEvent): void => {\n e.stopPropagation();\n if (this._parentItem?.disabled) return;\n this._clearTimers();\n if (this._open) {\n if (!this._pinnedOpen) this.closeSubmenu();\n } else {\n this.openSubmenu();\n }\n };\n\n private _onPanelEnter = (): void => {\n this._clearTimers();\n };\n\n //Re-anchor to the parent item after scroll/resize\n private _onReposition = (): void => {\n if (this._repositionQueued || !this._open) return;\n this._repositionQueued = true;\n requestAnimationFrame(() => {\n this._repositionQueued = false;\n if (!this._open) return;\n this._syncProxyToParent();\n this._floatingPanelEl?.reposition();\n });\n };\n\n private _onPanelLeave = (): void => {\n if (this._pinnedOpen) return;\n if (this._open) {\n this._closeTimer = window.setTimeout(() => {\n const hasOpenDescendant = NileContextSubmenu.openStack.some(\n sub => sub !== this && this._menuContainerRef?.contains(sub),\n );\n if (hasOpenDescendant) return;\n this.closeSubmenu();\n }, HOVER_CLOSE_DELAY);\n }\n };\n\n public openSubmenu(): void {\n if (this._open) return;\n if (this._parentItem?.disabled) return;\n this._closeSiblingSubmenus();\n this._ensureProxy();\n this._ensureBodyPanel();\n this._syncProxyToParent();\n this._open = true;\n if (this._floatingPanelEl) {\n // open pinned descendants only once this panel is fully shown\n this._floatingPanelEl.addEventListener(\n 'nile-after-show',\n () => {\n if (this._open) this._openPinnedDescendants();\n },\n { once: true },\n );\n this._floatingPanelEl.open = true;\n }\n NileContextSubmenu.openStack.push(this);\n window.addEventListener('scroll', this._onReposition, true);\n window.addEventListener('resize', this._onReposition);\n requestAnimationFrame(() => requestAnimationFrame(() => {\n if (this._open) this._openPinnedDescendants();\n }));\n this._parentItem?.setSubmenuExpanded?.(true);\n }\n\n /** Open the submenu of every direct child item carrying the `open` attribute. */\n private _openPinnedDescendants(): void {\n if (!this._menuContainerRef) return;\n const items = Array.from(\n this._menuContainerRef.querySelectorAll(ITEM_TAG)\n ) as NileContextMenuItem[];\n for (const item of items) {\n if (!this._isDirectChildItem(item)) continue;\n if (!item.open || item.disabled) continue;\n const sub = item.querySelector(`:scope > ${SUBMENU_TAG}`) as NileContextSubmenu | null;\n sub?.openSubmenu();\n }\n }\n\n /** True if `item` sits at this submenu's own level (not inside a deeper submenu). */\n private _isDirectChildItem(item: Element): boolean {\n let cur: Element | null = item.parentElement;\n while (cur && cur !== this._menuContainerRef) {\n if (cur.tagName.toLowerCase() === SUBMENU_TAG) return false;\n cur = cur.parentElement;\n }\n return true;\n }\n\n public closeSubmenu(): void {\n if (!this._open) return;\n for (const sub of [...NileContextSubmenu.openStack]) {\n if (sub !== this && this._menuContainerRef?.contains(sub)) {\n sub.closeSubmenu();\n }\n }\n this._open = false;\n if (this._floatingPanelEl) this._floatingPanelEl.open = false;\n window.removeEventListener('scroll', this._onReposition, true);\n window.removeEventListener('resize', this._onReposition);\n NileContextSubmenu.openStack = NileContextSubmenu.openStack.filter(s => s !== this);\n this._clearTimers();\n this._parentItem?.setSubmenuExpanded?.(false);\n }\n\n public get isOpen(): boolean {\n return this._open;\n }\n\n public static findByContainer(container: Element): NileContextSubmenu | null {\n for (const sub of NileContextSubmenu.openStack) {\n if (sub._menuContainerRef === container) return sub;\n }\n return null;\n }\n\n public get parentItem(): NileContextMenuItem | null {\n return this._parentItem;\n }\n public focusFirstItem(): void {\n if (!this._menuContainerRef) return;\n const items = Array.from(\n this._menuContainerRef.querySelectorAll(ITEM_TAG)\n ) as NileContextMenuItem[];\n for (const item of items) {\n if (!this._isDirectChildItem(item)) continue;\n if (!item.disabled) { item.focus(); return; }\n }\n }\n\n private _closeSiblingSubmenus(): void {\n const myLevel = this._parentLevel();\n for (const sub of [...NileContextSubmenu.openStack]) {\n if (sub === this) continue;\n if (sub._pinnedOpen) continue;\n if (sub._parentLevel() === myLevel) sub.closeSubmenu();\n }\n }\n\n private _parentLevel(): Element | null {\n const item = this._parentItem;\n if (!item) return null;\n return item.parentElement?.closest('.nile-context-menu__menu') ?? null;\n }\n\n private _onMenuMouseOver = (e: MouseEvent): void => {\n const item = e.composedPath().find(\n n => n instanceof HTMLElement && n.tagName.toLowerCase() === ITEM_TAG\n ) as NileContextMenuItem | undefined;\n if (!item || item.disabled) return;\n item.focus();\n };\n\n private _onNestedSelect = (e: CustomEvent): void => {\n if (e.target === this) return;\n if (e.detail?.type !== 'click') return;\n this.emit('nile-change', e.detail);\n };\n\n private _onMenuClick = (e: MouseEvent): void => {\n const item = e.composedPath().find(\n n => n instanceof HTMLElement && n.tagName.toLowerCase() === ITEM_TAG\n ) as NileContextMenuItem | undefined;\n if (!item || item.disabled) return;\n if (item.querySelector(`:scope > ${SUBMENU_TAG}`)) return;\n const detail = {\n id: item.id,\n value: item.value,\n name: (item.textContent ?? '').trim(),\n target: null,\n originalEvent: e,\n };\n try {\n (item as unknown as { onSelect?: (d: typeof detail) => void }).onSelect?.(detail);\n } catch (err) {\n console.error('[nile-context-submenu] onSelect callback threw:', err);\n }\n this.emit('nile-change', { type: 'click', ...detail });\n };\n\n public render(): TemplateResult {\n return html``;\n }\n}\n\nexport default NileContextSubmenu;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-context-submenu': NileContextSubmenu;\n }\n}\n"],"names":["ITEM_TAG","SUBMENU_TAG","submenuIdSeq","NileContextSubmenu","NileContextSubmenu_1","_o","r","constructor","this","zIndex","_open","_parentItem","_proxyId","_menuContainerRef","_setupDone","_repositionQueued","_onParentEnter","_this$_parentItem","disabled","_clearTimers","_openTimer","window","setTimeout","openSubmenu","_onParentLeave","clearTimeout","undefined","_pinnedOpen","_closeTimer","closeSubmenu","_onParentClick","e","stopPropagation","_onPanelEnter","_onReposition","requestAnimationFrame","_this$_floatingPanelE","_syncProxyToParent","_floatingPanelEl","reposition","_onPanelLeave","openStack","some","sub","contains","_onMenuMouseOver","item","composedPath","find","n","HTMLElement","tagName","toLowerCase","focus","_onNestedSelect","target","detail","type","emit","_onMenuClick","querySelector","id","value","name","textContent","_i$textContent","trim","originalEvent","onSelect","err","console","error","_objectSpread","_this","_inherits","_createClass","key","get","open","connectedCallback","super","p","parentElement","_ensureProxy","setSubmenuExpanded","addEventListener","_parentObserver","MutationObserver","_isParentVisible","observe","attributes","attributeFilter","_ensureBodyPanel","rect","getBoundingClientRect","width","height","_proxyEl","el","document","createElement","setAttribute","style","cssText","body","appendChild","position","left","concat","scrollX","top","scrollY","disconnectedCallback","removeEventListener","disconnect","_teardownBodyArtifacts","filter","s","menu","firstChild","remove","fp","panelClass","interactive","hideOnClick","closeOnEscape","arrow","distance","className","_relocateLightChildren","firstUpdated","_i","_Array$from","Array","from","children","kid","_closeSiblingSubmenus","_openPinnedDescendants","once","push","items","querySelectorAll","_i2","_t2","length","_isDirectChildItem","cur","_this$_parentItem8","_this$_parentItem8$se","_i4","_arr","_toConsumableArray","focusFirstItem","_i5","_t5","myLevel","_parentLevel","_i7","_arr2","closest","_t$parentElement$clos","render","html","_templateObject","_taggedTemplateLiteral","css","_templateObject2","findByContainer","container","_step","_iterator","done","f","NileElement","__decorate","property","attribute","Number","reflect","prototype","state","customElement"],"mappings":"o3NAcMA,CAAAA,CAAW,yBACXC,CAAc,CAAA,sBAAA,CAIhBC,CAAAA,CAAe,CAONC,CAAAA,OAAAA,KAAAA,CAAAA,CAAkBC,EAAxB,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCASuDC,KAAAA,CAAMC,MAAAA,CAAG,IAEpDD,CAAAA,KAAAA,CAAKE,OAAG,CAIjBF,CAAAA,KAAAA,CAAWG,WAA+B,CAAA,IAAA,CAC1CH,KAAAA,CAAAI,QAAAA,CAAW,8BAAiCV,CAAAA,GAAAA,CAAAA,CAG5CM,KAAAA,CAAiBK,iBAA0B,CAAA,IAAA,CAG3CL,KAAAA,CAAUM,UAAAA,CAAAA,CAAG,CAEbN,CAAAA,KAAAA,CAAiBO,iBAAG,CAAA,CAAA,CAAA,CAmJpBP,KAAAA,CAAcQ,cAAG,CAAA,UAAA,KAAAC,iBAAA,CACnBT,EAAAA,iBAAAA,CAAAA,KAAAA,CAAKG,WAAAA,UAAAA,iBAAAA,iBAALH,iBAAAA,CAAkBU,QACtBV,IAAAA,KAAAA,CAAKW,YACDX,CAAAA,CAAAA,CAAAA,KAAAA,CAAKE,QACTF,KAAAA,CAAKY,UAAAA,CAAaC,MAAOC,CAAAA,UAAAA,CAAW,iBAAMd,CAAAA,KAAAA,CAAKe,WAzL1B,CAAA,CAAA,GAAA,GAAA,CAAA,CAAA,CAyL0D,GAGzEf,KAAAA,CAAcgB,cA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AAA,CAAAA,CAASsC,UAAyB,EAJYsI,CAAAA,CAAAA,CAAA,CAA3DC,CAAS,CAAA,CAAEC,WAAW,CAAMxH,CAAAA,IAAAA,CAAMyH,OAAQC,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsBhL,EAAAiL,SAAA,CAAA,QAAA,CAAA,IAAA,IAEzDL,CAAA,CAAA,CAAhBM,KAA8BlL,CAAAiL,CAAAA,SAAAA,CAAA,YAAA,EAXpBjL,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAkBC,GAAA2K,CAAA,CAAA,CAD9BO,CAAc,CAAA,sBAAA,CAAA,CAAA,CACFnL"}
@@ -0,0 +1,3 @@
1
+ import{__decorate as t}from"tslib";import{css as i,html as s}from"lit";import{property as e,state as n,customElement as h}from"lit/decorators.js";import{N as o}from"../internal/nile-element.esm.js";import"../nile-floating-panel/nile-floating-panel.esm.js";import"../internal/accessibility/a11y.state.enum.esm.js";import"../internal/accessibility/a11y.property.enum.esm.js";import"../internal/accessibility/role.enum.esm.js";import"../nile-floating-panel/nile-floating-panel.css.esm.js";import"../tippy.esm-57628c2b.esm.js";import"../nile-lite-tooltip/utils.esm.js";import"../utilities/visibility-manager.esm.js";var r;const l="nile-context-menu-item",c="nile-context-submenu";let u=0,a=r=class extends o{constructor(){super(...arguments),this.zIndex=9999,this._open=!1,this._parentItem=null,this._proxyId="nile-context-submenu-anchor-"+ ++u,this._menuContainerRef=null,this._setupDone=!1,this._repositionQueued=!1,this._onParentEnter=()=>{this._parentItem?.disabled||(this._clearTimers(),this._open||(this._openTimer=window.setTimeout((()=>this.openSubmenu()),100)))},this._onParentLeave=()=>{null!=this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=void 0),this._pinnedOpen||this._open&&(this._closeTimer=window.setTimeout((()=>this.closeSubmenu()),300))},this._onParentClick=t=>{t.stopPropagation(),this._parentItem?.disabled||(this._clearTimers(),this._open?this._pinnedOpen||this.closeSubmenu():this.openSubmenu())},this._onPanelEnter=()=>{this._clearTimers()},this._onReposition=()=>{!this._repositionQueued&&this._open&&(this._repositionQueued=!0,requestAnimationFrame((()=>{this._repositionQueued=!1,this._open&&(this._syncProxyToParent(),this._floatingPanelEl?.reposition())})))},this._onPanelLeave=()=>{this._pinnedOpen||this._open&&(this._closeTimer=window.setTimeout((()=>{r.openStack.some((t=>t!==this&&this._menuContainerRef?.contains(t)))||this.closeSubmenu()}),300))},this._onMenuMouseOver=t=>{const i=t.composedPath().find((t=>t instanceof HTMLElement&&t.tagName.toLowerCase()===l));i&&!i.disabled&&i.focus()},this._onNestedSelect=t=>{t.target!==this&&"click"===t.detail?.type&&this.emit("nile-change",t.detail)},this._onMenuClick=t=>{const i=t.composedPath().find((t=>t instanceof HTMLElement&&t.tagName.toLowerCase()===l));if(!i||i.disabled)return;if(i.querySelector(`:scope > ${c}`))return;const s={id:i.id,value:i.value,name:(i.textContent??"").trim(),target:null,originalEvent:t};try{i.onSelect?.(s)}catch(t){console.error("[nile-context-submenu] onSelect callback threw:",t)}this.emit("nile-change",{type:"click",...s})}}static get styles(){return[i`
2
+ :host { display: contents; }
3
+ `]}get _pinnedOpen(){return!(!this._parentItem?.open||this._parentItem.disabled)}connectedCallback(){super.connectedCallback();let t=this.parentElement;for(;t&&t.tagName.toLowerCase()!==l;)t=t.parentElement;this._parentItem=t,this._ensureProxy(),this._parentItem&&(this._parentItem.setSubmenuExpanded?.(!1),this._parentItem.addEventListener("mouseenter",this._onParentEnter),this._parentItem.addEventListener("mouseleave",this._onParentLeave),this._parentItem.addEventListener("click",this._onParentClick,!0),this._parentObserver=new MutationObserver((()=>{this._pinnedOpen?this._isParentVisible()&&this.openSubmenu():this._open&&this.closeSubmenu()})),this._parentObserver.observe(this._parentItem,{attributes:!0,attributeFilter:["open"]})),this._ensureBodyPanel()}_isParentVisible(){const t=this._parentItem?.getBoundingClientRect();return!!t&&t.width>0&&t.height>0}_ensureProxy(){if(this._proxyEl)return;const t=document.createElement("div");t.id=this._proxyId,t.setAttribute("aria-hidden","true"),t.style.cssText="position: fixed; top: 0; left: 0; width: 0; height: 0; pointer-events: none;",document.body.appendChild(t),this._proxyEl=t}_syncProxyToParent(){if(!this._proxyEl||!this._parentItem)return;const t=this._parentItem.getBoundingClientRect();this._pinnedOpen?(this._proxyEl.style.position="absolute",this._proxyEl.style.left=`${t.left+window.scrollX}px`,this._proxyEl.style.top=`${t.top+window.scrollY}px`):(this._proxyEl.style.position="fixed",this._proxyEl.style.left=`${t.left}px`,this._proxyEl.style.top=`${t.top}px`),this._proxyEl.style.width=`${t.width}px`,this._proxyEl.style.height=`${t.height}px`}disconnectedCallback(){super.disconnectedCallback(),this._parentItem&&(this._parentItem.removeEventListener("mouseenter",this._onParentEnter),this._parentItem.removeEventListener("mouseleave",this._onParentLeave),this._parentItem.removeEventListener("click",this._onParentClick,!0)),this._parentObserver?.disconnect(),this._parentObserver=void 0,this._clearTimers(),this._open&&this.closeSubmenu(),this._teardownBodyArtifacts(),r.openStack=r.openStack.filter((t=>t!==this))}_teardownBodyArtifacts(){const t=this._menuContainerRef;if(t)for(t.removeEventListener("click",this._onMenuClick),t.removeEventListener("mouseover",this._onMenuMouseOver),t.removeEventListener("mouseenter",this._onPanelEnter),t.removeEventListener("mouseleave",this._onPanelLeave),t.removeEventListener("nile-change",this._onNestedSelect);t.firstChild;)this.appendChild(t.firstChild);this._floatingPanelEl?.remove(),this._floatingPanelEl=void 0,this._menuContainerRef=null,this._setupDone=!1,this._proxyEl?.remove(),this._proxyEl=void 0}_ensureBodyPanel(){if(this._setupDone)return;const t=document.createElement("nile-floating-panel");t.setAttribute("for",this._proxyId),t.setAttribute("trigger","manual"),t.setAttribute("placement","right-start"),t.panelClass="nile-context-menu-panel",t.zIndex=this.zIndex,t.interactive=!0,t.hideOnClick=!1,t.closeOnEscape=!1,t.arrow="none",t.distance=0;const i=document.createElement("div");i.className="nile-context-menu__menu",i.setAttribute("role","menu"),t.appendChild(i),document.body.appendChild(t),this._floatingPanelEl=t,this._menuContainerRef=i,i.addEventListener("click",this._onMenuClick),i.addEventListener("mouseover",this._onMenuMouseOver),i.addEventListener("mouseenter",this._onPanelEnter),i.addEventListener("mouseleave",this._onPanelLeave),i.addEventListener("nile-change",this._onNestedSelect),this._relocateLightChildren(),this._setupDone=!0}firstUpdated(){this._relocateLightChildren()}_relocateLightChildren(){if(this._menuContainerRef)for(const t of Array.from(this.children))this._menuContainerRef.appendChild(t)}_clearTimers(){null!=this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=void 0),null!=this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=void 0)}openSubmenu(){this._open||this._parentItem?.disabled||(this._closeSiblingSubmenus(),this._ensureProxy(),this._ensureBodyPanel(),this._syncProxyToParent(),this._open=!0,this._floatingPanelEl&&(this._floatingPanelEl.addEventListener("nile-after-show",(()=>{this._open&&this._openPinnedDescendants()}),{once:!0}),this._floatingPanelEl.open=!0),r.openStack.push(this),window.addEventListener("scroll",this._onReposition,!0),window.addEventListener("resize",this._onReposition),requestAnimationFrame((()=>requestAnimationFrame((()=>{this._open&&this._openPinnedDescendants()})))),this._parentItem?.setSubmenuExpanded?.(!0))}_openPinnedDescendants(){if(!this._menuContainerRef)return;const t=Array.from(this._menuContainerRef.querySelectorAll(l));for(const i of t){if(!this._isDirectChildItem(i))continue;if(!i.open||i.disabled)continue;const t=i.querySelector(`:scope > ${c}`);t?.openSubmenu()}}_isDirectChildItem(t){let i=t.parentElement;for(;i&&i!==this._menuContainerRef;){if(i.tagName.toLowerCase()===c)return!1;i=i.parentElement}return!0}closeSubmenu(){if(this._open){for(const t of[...r.openStack])t!==this&&this._menuContainerRef?.contains(t)&&t.closeSubmenu();this._open=!1,this._floatingPanelEl&&(this._floatingPanelEl.open=!1),window.removeEventListener("scroll",this._onReposition,!0),window.removeEventListener("resize",this._onReposition),r.openStack=r.openStack.filter((t=>t!==this)),this._clearTimers(),this._parentItem?.setSubmenuExpanded?.(!1)}}get isOpen(){return this._open}static findByContainer(t){for(const i of r.openStack)if(i._menuContainerRef===t)return i;return null}get parentItem(){return this._parentItem}focusFirstItem(){if(!this._menuContainerRef)return;const t=Array.from(this._menuContainerRef.querySelectorAll(l));for(const i of t)if(this._isDirectChildItem(i)&&!i.disabled)return void i.focus()}_closeSiblingSubmenus(){const t=this._parentLevel();for(const i of[...r.openStack])i!==this&&(i._pinnedOpen||i._parentLevel()===t&&i.closeSubmenu())}_parentLevel(){const t=this._parentItem;return t?t.parentElement?.closest(".nile-context-menu__menu")??null:null}render(){return s``}};a.openStack=[],t([e({attribute:!0,type:Number,reflect:!0})],a.prototype,"zIndex",void 0),t([n()],a.prototype,"_open",void 0),a=r=t([h("nile-context-submenu")],a);export{a as N};