context-menu.json 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {
  2. "title": "Application Context Menu",
  3. "description": "JupyterLab context menu settings.",
  4. "jupyter.lab.setting-icon-label": "Application Context Menu",
  5. "jupyter.lab.shortcuts": [],
  6. "jupyter.lab.transform": true,
  7. "properties": {
  8. "contextMenu": {
  9. "title": "The application context menu.",
  10. "description": "Note: To disable a context menu item,\ncopy it to User Preferences and add the\n\"disabled\" key. The following example will disable Download item on files:\n{\n \"contextMenu\": [\n {\n \"command\": \"filebrowser:download\",\n \"selector\": \".jp-DirListing-item[data-isdir=\\\"false\\\"]\",\n \"disabled\": true\n }\n ]\n}\n\nContext menu description:",
  11. "items": {
  12. "allOf": [
  13. { "$ref": "#/definitions/menuItem" },
  14. {
  15. "properties": {
  16. "selector": {
  17. "description": "The CSS selector for the context menu item.",
  18. "type": "string"
  19. }
  20. }
  21. }
  22. ]
  23. },
  24. "type": "array",
  25. "default": []
  26. }
  27. },
  28. "additionalProperties": false,
  29. "definitions": {
  30. "menu": {
  31. "properties": {
  32. "disabled": {
  33. "description": "Whether the menu is disabled or not",
  34. "type": "boolean",
  35. "default": false
  36. },
  37. "icon": {
  38. "description": "Menu icon id",
  39. "type": "string"
  40. },
  41. "id": {
  42. "description": "Menu unique id",
  43. "type": "string",
  44. "pattern": "[a-z][a-z0-9\\-_]+"
  45. },
  46. "items": {
  47. "description": "Menu items",
  48. "type": "array",
  49. "items": {
  50. "$ref": "#/definitions/menuItem"
  51. }
  52. },
  53. "label": {
  54. "description": "Menu label",
  55. "type": "string"
  56. },
  57. "mnemonic": {
  58. "description": "Mnemonic index for the label",
  59. "type": "number",
  60. "minimum": -1,
  61. "default": -1
  62. },
  63. "rank": {
  64. "description": "Menu rank",
  65. "type": "number",
  66. "minimum": 0
  67. }
  68. },
  69. "required": ["id"],
  70. "additionalProperties": false,
  71. "type": "object"
  72. },
  73. "menuItem": {
  74. "properties": {
  75. "args": {
  76. "description": "Command arguments",
  77. "type": "object"
  78. },
  79. "command": {
  80. "description": "Command id",
  81. "type": "string"
  82. },
  83. "disabled": {
  84. "description": "Whether the item is disabled or not",
  85. "type": "boolean",
  86. "default": false
  87. },
  88. "type": {
  89. "description": "Item type",
  90. "type": "string",
  91. "enum": ["command", "submenu", "separator"],
  92. "default": "command"
  93. },
  94. "rank": {
  95. "description": "Item rank",
  96. "type": "number",
  97. "minimum": 0
  98. },
  99. "submenu": {
  100. "description": "Submenu definition",
  101. "oneOf": [
  102. {
  103. "$ref": "#/definitions/menu"
  104. },
  105. {
  106. "type": "null"
  107. }
  108. ]
  109. }
  110. },
  111. "type": "object"
  112. }
  113. },
  114. "type": "object"
  115. }