@atlaskit/jql-editor 4.0.0

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 (750) hide show
  1. package/CHANGELOG.md +1048 -0
  2. package/LICENSE.md +13 -0
  3. package/README.md +3 -0
  4. package/dist/cjs/accessibility/index.js +12 -0
  5. package/dist/cjs/accessibility/styled.js +12 -0
  6. package/dist/cjs/analytics/constants.js +27 -0
  7. package/dist/cjs/analytics/index.js +57 -0
  8. package/dist/cjs/analytics/listener/analytics-web-client-wrapper.js +77 -0
  9. package/dist/cjs/analytics/listener/handle-event.js +21 -0
  10. package/dist/cjs/analytics/listener/helpers/logger.js +89 -0
  11. package/dist/cjs/analytics/listener/index.js +13 -0
  12. package/dist/cjs/analytics/listener/jql-editor-analytics-listener.js +52 -0
  13. package/dist/cjs/analytics/listener/process-event-payload.js +44 -0
  14. package/dist/cjs/analytics/listener/types.js +5 -0
  15. package/dist/cjs/analytics/types.js +5 -0
  16. package/dist/cjs/analytics/util.js +10 -0
  17. package/dist/cjs/async.js +34 -0
  18. package/dist/cjs/commands/select-error-command/index.js +30 -0
  19. package/dist/cjs/common/constants.js +11 -0
  20. package/dist/cjs/common/messages.js +14 -0
  21. package/dist/cjs/common/styled.js +15 -0
  22. package/dist/cjs/hooks/use-editor-theme/index.js +53 -0
  23. package/dist/cjs/hooks/use-editor-view-has-infos/index.js +16 -0
  24. package/dist/cjs/hooks/use-editor-view-has-warnings/index.js +19 -0
  25. package/dist/cjs/hooks/use-editor-view-is-invalid/index.js +52 -0
  26. package/dist/cjs/i18n/cs.js +68 -0
  27. package/dist/cjs/i18n/da.js +68 -0
  28. package/dist/cjs/i18n/de.js +68 -0
  29. package/dist/cjs/i18n/en.js +68 -0
  30. package/dist/cjs/i18n/en_GB.js +68 -0
  31. package/dist/cjs/i18n/en_ZZ.js +68 -0
  32. package/dist/cjs/i18n/es.js +68 -0
  33. package/dist/cjs/i18n/et.js +14 -0
  34. package/dist/cjs/i18n/fi.js +68 -0
  35. package/dist/cjs/i18n/fr.js +68 -0
  36. package/dist/cjs/i18n/hu.js +68 -0
  37. package/dist/cjs/i18n/index.js +132 -0
  38. package/dist/cjs/i18n/it.js +68 -0
  39. package/dist/cjs/i18n/ja.js +68 -0
  40. package/dist/cjs/i18n/ko.js +68 -0
  41. package/dist/cjs/i18n/nb.js +68 -0
  42. package/dist/cjs/i18n/nl.js +68 -0
  43. package/dist/cjs/i18n/pl.js +68 -0
  44. package/dist/cjs/i18n/pt_BR.js +68 -0
  45. package/dist/cjs/i18n/pt_PT.js +14 -0
  46. package/dist/cjs/i18n/ru.js +68 -0
  47. package/dist/cjs/i18n/sk.js +14 -0
  48. package/dist/cjs/i18n/sv.js +68 -0
  49. package/dist/cjs/i18n/th.js +68 -0
  50. package/dist/cjs/i18n/tr.js +68 -0
  51. package/dist/cjs/i18n/uk.js +68 -0
  52. package/dist/cjs/i18n/vi.js +68 -0
  53. package/dist/cjs/i18n/zh.js +68 -0
  54. package/dist/cjs/i18n/zh_TW.js +68 -0
  55. package/dist/cjs/index.js +52 -0
  56. package/dist/cjs/plugins/autocomplete/components/autocomplete/index.js +48 -0
  57. package/dist/cjs/plugins/autocomplete/components/autocomplete-dropdown/index.js +278 -0
  58. package/dist/cjs/plugins/autocomplete/components/autocomplete-dropdown/styled.js +22 -0
  59. package/dist/cjs/plugins/autocomplete/components/autocomplete-option/glyphs.js +104 -0
  60. package/dist/cjs/plugins/autocomplete/components/autocomplete-option/index.js +175 -0
  61. package/dist/cjs/plugins/autocomplete/components/autocomplete-option/messages.js +19 -0
  62. package/dist/cjs/plugins/autocomplete/components/autocomplete-option/styled.js +26 -0
  63. package/dist/cjs/plugins/autocomplete/components/types.js +5 -0
  64. package/dist/cjs/plugins/autocomplete/constants.js +35 -0
  65. package/dist/cjs/plugins/autocomplete/index.js +37 -0
  66. package/dist/cjs/plugins/autocomplete/messages.js +14 -0
  67. package/dist/cjs/plugins/autocomplete/types.js +5 -0
  68. package/dist/cjs/plugins/autocomplete/view.js +125 -0
  69. package/dist/cjs/plugins/common/get-document-position/index.js +99 -0
  70. package/dist/cjs/plugins/common/plugin-keymap.js +50 -0
  71. package/dist/cjs/plugins/common/react-plugin-view.js +93 -0
  72. package/dist/cjs/plugins/index.js +41 -0
  73. package/dist/cjs/plugins/jql-ast/JQLEditorErrorStrategy.js +218 -0
  74. package/dist/cjs/plugins/jql-ast/constants.js +15 -0
  75. package/dist/cjs/plugins/jql-ast/error-handlers/CustomFieldRuleErrorHandler.js +13 -0
  76. package/dist/cjs/plugins/jql-ast/error-handlers/ExpectedTokensErrorHandler.js +62 -0
  77. package/dist/cjs/plugins/jql-ast/error-handlers/FieldPropertyIdErrorHandler.js +17 -0
  78. package/dist/cjs/plugins/jql-ast/error-handlers/FieldRuleErrorHandler.js +20 -0
  79. package/dist/cjs/plugins/jql-ast/error-handlers/FunctionArgumentRuleErrorHandler.js +17 -0
  80. package/dist/cjs/plugins/jql-ast/error-handlers/OperandRuleErrorHandler.js +66 -0
  81. package/dist/cjs/plugins/jql-ast/error-handlers/OperatorRuleErrorHandler.js +18 -0
  82. package/dist/cjs/plugins/jql-ast/index.js +46 -0
  83. package/dist/cjs/plugins/jql-ast/messages.js +179 -0
  84. package/dist/cjs/plugins/jql-ast/utils.js +23 -0
  85. package/dist/cjs/plugins/jql-syntax-highlighting/index.js +69 -0
  86. package/dist/cjs/plugins/jql-syntax-highlighting/types.js +5 -0
  87. package/dist/cjs/plugins/jql-syntax-highlighting/visitor.js +89 -0
  88. package/dist/cjs/plugins/rich-inline-nodes/constants.js +9 -0
  89. package/dist/cjs/plugins/rich-inline-nodes/index.js +63 -0
  90. package/dist/cjs/plugins/rich-inline-nodes/nodes/index.js +10 -0
  91. package/dist/cjs/plugins/rich-inline-nodes/nodes/types.js +5 -0
  92. package/dist/cjs/plugins/rich-inline-nodes/nodes/user/index.js +41 -0
  93. package/dist/cjs/plugins/rich-inline-nodes/nodes/user/styled.js +35 -0
  94. package/dist/cjs/plugins/rich-inline-nodes/types.js +5 -0
  95. package/dist/cjs/plugins/rich-inline-nodes/util/create-node-spec.js +37 -0
  96. package/dist/cjs/plugins/rich-inline-nodes/util/react-node-view.js +129 -0
  97. package/dist/cjs/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +138 -0
  98. package/dist/cjs/plugins/types.js +5 -0
  99. package/dist/cjs/plugins/validation-tooltip/constants.js +11 -0
  100. package/dist/cjs/plugins/validation-tooltip/index.js +58 -0
  101. package/dist/cjs/plugins/validation-tooltip/view.js +74 -0
  102. package/dist/cjs/schema/index.js +137 -0
  103. package/dist/cjs/state/analytics/index.js +56 -0
  104. package/dist/cjs/state/autocomplete/index.js +23 -0
  105. package/dist/cjs/state/hydration/index.js +92 -0
  106. package/dist/cjs/state/hydration/util.js +89 -0
  107. package/dist/cjs/state/index.js +997 -0
  108. package/dist/cjs/state/types.js +5 -0
  109. package/dist/cjs/state/util.js +176 -0
  110. package/dist/cjs/types.js +5 -0
  111. package/dist/cjs/ui/error-boundary/index.js +81 -0
  112. package/dist/cjs/ui/index.js +11 -0
  113. package/dist/cjs/ui/intl-provider/index.js +23 -0
  114. package/dist/cjs/ui/jql-editor/index.js +75 -0
  115. package/dist/cjs/ui/jql-editor/types.js +5 -0
  116. package/dist/cjs/ui/jql-editor-controls-content/base-expand-toggle/index.js +55 -0
  117. package/dist/cjs/ui/jql-editor-controls-content/base-expand-toggle/styled.js +12 -0
  118. package/dist/cjs/ui/jql-editor-controls-content/base-search/index.js +44 -0
  119. package/dist/cjs/ui/jql-editor-controls-content/base-syntax-help/index.js +33 -0
  120. package/dist/cjs/ui/jql-editor-controls-content/base-syntax-help/styled.js +12 -0
  121. package/dist/cjs/ui/jql-editor-controls-content/expand-toggle/index.js +67 -0
  122. package/dist/cjs/ui/jql-editor-controls-content/expand-toggle/messages.js +24 -0
  123. package/dist/cjs/ui/jql-editor-controls-content/index.js +17 -0
  124. package/dist/cjs/ui/jql-editor-controls-content/read-only-controls-content/index.js +38 -0
  125. package/dist/cjs/ui/jql-editor-controls-content/search/index.js +40 -0
  126. package/dist/cjs/ui/jql-editor-controls-content/search/messages.js +14 -0
  127. package/dist/cjs/ui/jql-editor-controls-content/syntax-help/index.js +62 -0
  128. package/dist/cjs/ui/jql-editor-controls-content/syntax-help/messages.js +19 -0
  129. package/dist/cjs/ui/jql-editor-footer-content/index.js +34 -0
  130. package/dist/cjs/ui/jql-editor-footer-content/jql-editor-help/index.js +42 -0
  131. package/dist/cjs/ui/jql-editor-footer-content/jql-editor-help/messages.js +24 -0
  132. package/dist/cjs/ui/jql-editor-footer-content/jql-editor-help/styled.js +15 -0
  133. package/dist/cjs/ui/jql-editor-footer-content/jql-messages/errors/index.js +70 -0
  134. package/dist/cjs/ui/jql-editor-footer-content/jql-messages/errors/messages.js +14 -0
  135. package/dist/cjs/ui/jql-editor-footer-content/jql-messages/format/index.js +34 -0
  136. package/dist/cjs/ui/jql-editor-footer-content/jql-messages/format/styled.js +14 -0
  137. package/dist/cjs/ui/jql-editor-footer-content/jql-messages/index.js +26 -0
  138. package/dist/cjs/ui/jql-editor-footer-content/jql-messages/infos/index.js +41 -0
  139. package/dist/cjs/ui/jql-editor-footer-content/jql-messages/warnings/index.js +110 -0
  140. package/dist/cjs/ui/jql-editor-footer-content/jql-messages/warnings/messages.js +24 -0
  141. package/dist/cjs/ui/jql-editor-layout/index.js +104 -0
  142. package/dist/cjs/ui/jql-editor-layout/styled.js +61 -0
  143. package/dist/cjs/ui/jql-editor-portal-provider/context.js +17 -0
  144. package/dist/cjs/ui/jql-editor-portal-provider/index.js +116 -0
  145. package/dist/cjs/ui/jql-editor-portal-provider/types.js +5 -0
  146. package/dist/cjs/ui/jql-editor-view/index.js +198 -0
  147. package/dist/cjs/ui/messages.js +14 -0
  148. package/dist/cjs/ui/tooltip-tag/index.js +19 -0
  149. package/dist/cjs/ui/tooltip-tag/styled.js +11 -0
  150. package/dist/cjs/ui/types.js +5 -0
  151. package/dist/cjs/utils/document-text/index.js +43 -0
  152. package/dist/cjs/utils/split-text-by-new-line/index.js +12 -0
  153. package/dist/es2019/accessibility/index.js +1 -0
  154. package/dist/es2019/accessibility/styled.js +5 -0
  155. package/dist/es2019/analytics/constants.js +21 -0
  156. package/dist/es2019/analytics/index.js +5 -0
  157. package/dist/es2019/analytics/listener/analytics-web-client-wrapper.js +57 -0
  158. package/dist/es2019/analytics/listener/handle-event.js +15 -0
  159. package/dist/es2019/analytics/listener/helpers/logger.js +49 -0
  160. package/dist/es2019/analytics/listener/index.js +7 -0
  161. package/dist/es2019/analytics/listener/jql-editor-analytics-listener.js +30 -0
  162. package/dist/es2019/analytics/listener/process-event-payload.js +29 -0
  163. package/dist/es2019/analytics/listener/types.js +1 -0
  164. package/dist/es2019/analytics/types.js +1 -0
  165. package/dist/es2019/analytics/util.js +4 -0
  166. package/dist/es2019/async.js +19 -0
  167. package/dist/es2019/commands/select-error-command/index.js +23 -0
  168. package/dist/es2019/common/constants.js +5 -0
  169. package/dist/es2019/common/messages.js +8 -0
  170. package/dist/es2019/common/styled.js +19 -0
  171. package/dist/es2019/hooks/use-editor-theme/index.js +33 -0
  172. package/dist/es2019/hooks/use-editor-view-has-infos/index.js +8 -0
  173. package/dist/es2019/hooks/use-editor-view-has-warnings/index.js +9 -0
  174. package/dist/es2019/hooks/use-editor-view-is-invalid/index.js +38 -0
  175. package/dist/es2019/i18n/cs.js +62 -0
  176. package/dist/es2019/i18n/da.js +62 -0
  177. package/dist/es2019/i18n/de.js +62 -0
  178. package/dist/es2019/i18n/en.js +62 -0
  179. package/dist/es2019/i18n/en_GB.js +62 -0
  180. package/dist/es2019/i18n/en_ZZ.js +62 -0
  181. package/dist/es2019/i18n/es.js +62 -0
  182. package/dist/es2019/i18n/et.js +8 -0
  183. package/dist/es2019/i18n/fi.js +62 -0
  184. package/dist/es2019/i18n/fr.js +62 -0
  185. package/dist/es2019/i18n/hu.js +62 -0
  186. package/dist/es2019/i18n/index.js +24 -0
  187. package/dist/es2019/i18n/it.js +62 -0
  188. package/dist/es2019/i18n/ja.js +62 -0
  189. package/dist/es2019/i18n/ko.js +62 -0
  190. package/dist/es2019/i18n/nb.js +62 -0
  191. package/dist/es2019/i18n/nl.js +62 -0
  192. package/dist/es2019/i18n/pl.js +62 -0
  193. package/dist/es2019/i18n/pt_BR.js +62 -0
  194. package/dist/es2019/i18n/pt_PT.js +8 -0
  195. package/dist/es2019/i18n/ru.js +62 -0
  196. package/dist/es2019/i18n/sk.js +8 -0
  197. package/dist/es2019/i18n/sv.js +62 -0
  198. package/dist/es2019/i18n/th.js +62 -0
  199. package/dist/es2019/i18n/tr.js +62 -0
  200. package/dist/es2019/i18n/uk.js +62 -0
  201. package/dist/es2019/i18n/vi.js +62 -0
  202. package/dist/es2019/i18n/zh.js +62 -0
  203. package/dist/es2019/i18n/zh_TW.js +62 -0
  204. package/dist/es2019/index.js +4 -0
  205. package/dist/es2019/plugins/autocomplete/components/autocomplete/index.js +33 -0
  206. package/dist/es2019/plugins/autocomplete/components/autocomplete-dropdown/index.js +245 -0
  207. package/dist/es2019/plugins/autocomplete/components/autocomplete-dropdown/styled.js +46 -0
  208. package/dist/es2019/plugins/autocomplete/components/autocomplete-option/glyphs.js +80 -0
  209. package/dist/es2019/plugins/autocomplete/components/autocomplete-option/index.js +159 -0
  210. package/dist/es2019/plugins/autocomplete/components/autocomplete-option/messages.js +13 -0
  211. package/dist/es2019/plugins/autocomplete/components/autocomplete-option/styled.js +51 -0
  212. package/dist/es2019/plugins/autocomplete/components/types.js +1 -0
  213. package/dist/es2019/plugins/autocomplete/constants.js +21 -0
  214. package/dist/es2019/plugins/autocomplete/index.js +36 -0
  215. package/dist/es2019/plugins/autocomplete/messages.js +8 -0
  216. package/dist/es2019/plugins/autocomplete/types.js +1 -0
  217. package/dist/es2019/plugins/autocomplete/view.js +102 -0
  218. package/dist/es2019/plugins/common/get-document-position/index.js +92 -0
  219. package/dist/es2019/plugins/common/plugin-keymap.js +30 -0
  220. package/dist/es2019/plugins/common/react-plugin-view.js +67 -0
  221. package/dist/es2019/plugins/index.js +5 -0
  222. package/dist/es2019/plugins/jql-ast/JQLEditorErrorStrategy.js +183 -0
  223. package/dist/es2019/plugins/jql-ast/constants.js +9 -0
  224. package/dist/es2019/plugins/jql-ast/error-handlers/CustomFieldRuleErrorHandler.js +8 -0
  225. package/dist/es2019/plugins/jql-ast/error-handlers/ExpectedTokensErrorHandler.js +53 -0
  226. package/dist/es2019/plugins/jql-ast/error-handlers/FieldPropertyIdErrorHandler.js +12 -0
  227. package/dist/es2019/plugins/jql-ast/error-handlers/FieldRuleErrorHandler.js +15 -0
  228. package/dist/es2019/plugins/jql-ast/error-handlers/FunctionArgumentRuleErrorHandler.js +12 -0
  229. package/dist/es2019/plugins/jql-ast/error-handlers/OperandRuleErrorHandler.js +61 -0
  230. package/dist/es2019/plugins/jql-ast/error-handlers/OperatorRuleErrorHandler.js +13 -0
  231. package/dist/es2019/plugins/jql-ast/index.js +40 -0
  232. package/dist/es2019/plugins/jql-ast/messages.js +173 -0
  233. package/dist/es2019/plugins/jql-ast/utils.js +13 -0
  234. package/dist/es2019/plugins/jql-syntax-highlighting/index.js +59 -0
  235. package/dist/es2019/plugins/jql-syntax-highlighting/types.js +1 -0
  236. package/dist/es2019/plugins/jql-syntax-highlighting/visitor.js +55 -0
  237. package/dist/es2019/plugins/rich-inline-nodes/constants.js +3 -0
  238. package/dist/es2019/plugins/rich-inline-nodes/index.js +48 -0
  239. package/dist/es2019/plugins/rich-inline-nodes/nodes/index.js +4 -0
  240. package/dist/es2019/plugins/rich-inline-nodes/nodes/types.js +1 -0
  241. package/dist/es2019/plugins/rich-inline-nodes/nodes/user/index.js +32 -0
  242. package/dist/es2019/plugins/rich-inline-nodes/nodes/user/styled.js +77 -0
  243. package/dist/es2019/plugins/rich-inline-nodes/types.js +1 -0
  244. package/dist/es2019/plugins/rich-inline-nodes/util/create-node-spec.js +26 -0
  245. package/dist/es2019/plugins/rich-inline-nodes/util/react-node-view.js +101 -0
  246. package/dist/es2019/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +104 -0
  247. package/dist/es2019/plugins/types.js +1 -0
  248. package/dist/es2019/plugins/validation-tooltip/constants.js +5 -0
  249. package/dist/es2019/plugins/validation-tooltip/index.js +52 -0
  250. package/dist/es2019/plugins/validation-tooltip/view.js +55 -0
  251. package/dist/es2019/schema/index.js +117 -0
  252. package/dist/es2019/state/analytics/index.js +49 -0
  253. package/dist/es2019/state/autocomplete/index.js +15 -0
  254. package/dist/es2019/state/hydration/index.js +63 -0
  255. package/dist/es2019/state/hydration/util.js +57 -0
  256. package/dist/es2019/state/index.js +968 -0
  257. package/dist/es2019/state/types.js +1 -0
  258. package/dist/es2019/state/util.js +144 -0
  259. package/dist/es2019/types.js +1 -0
  260. package/dist/es2019/ui/error-boundary/index.js +55 -0
  261. package/dist/es2019/ui/index.js +4 -0
  262. package/dist/es2019/ui/intl-provider/index.js +16 -0
  263. package/dist/es2019/ui/jql-editor/index.js +63 -0
  264. package/dist/es2019/ui/jql-editor/types.js +1 -0
  265. package/dist/es2019/ui/jql-editor-controls-content/base-expand-toggle/index.js +48 -0
  266. package/dist/es2019/ui/jql-editor-controls-content/base-expand-toggle/styled.js +20 -0
  267. package/dist/es2019/ui/jql-editor-controls-content/base-search/index.js +35 -0
  268. package/dist/es2019/ui/jql-editor-controls-content/base-syntax-help/index.js +27 -0
  269. package/dist/es2019/ui/jql-editor-controls-content/base-syntax-help/styled.js +29 -0
  270. package/dist/es2019/ui/jql-editor-controls-content/expand-toggle/index.js +51 -0
  271. package/dist/es2019/ui/jql-editor-controls-content/expand-toggle/messages.js +18 -0
  272. package/dist/es2019/ui/jql-editor-controls-content/index.js +11 -0
  273. package/dist/es2019/ui/jql-editor-controls-content/read-only-controls-content/index.js +29 -0
  274. package/dist/es2019/ui/jql-editor-controls-content/search/index.js +26 -0
  275. package/dist/es2019/ui/jql-editor-controls-content/search/messages.js +8 -0
  276. package/dist/es2019/ui/jql-editor-controls-content/syntax-help/index.js +44 -0
  277. package/dist/es2019/ui/jql-editor-controls-content/syntax-help/messages.js +13 -0
  278. package/dist/es2019/ui/jql-editor-footer-content/index.js +28 -0
  279. package/dist/es2019/ui/jql-editor-footer-content/jql-editor-help/index.js +27 -0
  280. package/dist/es2019/ui/jql-editor-footer-content/jql-editor-help/messages.js +18 -0
  281. package/dist/es2019/ui/jql-editor-footer-content/jql-editor-help/styled.js +23 -0
  282. package/dist/es2019/ui/jql-editor-footer-content/jql-messages/errors/index.js +55 -0
  283. package/dist/es2019/ui/jql-editor-footer-content/jql-messages/errors/messages.js +8 -0
  284. package/dist/es2019/ui/jql-editor-footer-content/jql-messages/format/index.js +29 -0
  285. package/dist/es2019/ui/jql-editor-footer-content/jql-messages/format/styled.js +8 -0
  286. package/dist/es2019/ui/jql-editor-footer-content/jql-messages/index.js +3 -0
  287. package/dist/es2019/ui/jql-editor-footer-content/jql-messages/infos/index.js +30 -0
  288. package/dist/es2019/ui/jql-editor-footer-content/jql-messages/warnings/index.js +84 -0
  289. package/dist/es2019/ui/jql-editor-footer-content/jql-messages/warnings/messages.js +18 -0
  290. package/dist/es2019/ui/jql-editor-layout/index.js +100 -0
  291. package/dist/es2019/ui/jql-editor-layout/styled.js +223 -0
  292. package/dist/es2019/ui/jql-editor-portal-provider/context.js +8 -0
  293. package/dist/es2019/ui/jql-editor-portal-provider/index.js +99 -0
  294. package/dist/es2019/ui/jql-editor-portal-provider/types.js +1 -0
  295. package/dist/es2019/ui/jql-editor-view/index.js +167 -0
  296. package/dist/es2019/ui/messages.js +8 -0
  297. package/dist/es2019/ui/tooltip-tag/index.js +8 -0
  298. package/dist/es2019/ui/tooltip-tag/styled.js +4 -0
  299. package/dist/es2019/ui/types.js +1 -0
  300. package/dist/es2019/utils/document-text/index.js +37 -0
  301. package/dist/es2019/utils/split-text-by-new-line/index.js +4 -0
  302. package/dist/esm/accessibility/index.js +1 -0
  303. package/dist/esm/accessibility/styled.js +5 -0
  304. package/dist/esm/analytics/constants.js +21 -0
  305. package/dist/esm/analytics/index.js +5 -0
  306. package/dist/esm/analytics/listener/analytics-web-client-wrapper.js +70 -0
  307. package/dist/esm/analytics/listener/handle-event.js +15 -0
  308. package/dist/esm/analytics/listener/helpers/logger.js +83 -0
  309. package/dist/esm/analytics/listener/index.js +7 -0
  310. package/dist/esm/analytics/listener/jql-editor-analytics-listener.js +48 -0
  311. package/dist/esm/analytics/listener/process-event-payload.js +39 -0
  312. package/dist/esm/analytics/listener/types.js +1 -0
  313. package/dist/esm/analytics/types.js +1 -0
  314. package/dist/esm/analytics/util.js +4 -0
  315. package/dist/esm/async.js +22 -0
  316. package/dist/esm/commands/select-error-command/index.js +23 -0
  317. package/dist/esm/common/constants.js +5 -0
  318. package/dist/esm/common/messages.js +8 -0
  319. package/dist/esm/common/styled.js +9 -0
  320. package/dist/esm/hooks/use-editor-theme/index.js +46 -0
  321. package/dist/esm/hooks/use-editor-view-has-infos/index.js +9 -0
  322. package/dist/esm/hooks/use-editor-view-has-warnings/index.js +12 -0
  323. package/dist/esm/hooks/use-editor-view-is-invalid/index.js +46 -0
  324. package/dist/esm/i18n/cs.js +62 -0
  325. package/dist/esm/i18n/da.js +62 -0
  326. package/dist/esm/i18n/de.js +62 -0
  327. package/dist/esm/i18n/en.js +62 -0
  328. package/dist/esm/i18n/en_GB.js +62 -0
  329. package/dist/esm/i18n/en_ZZ.js +62 -0
  330. package/dist/esm/i18n/es.js +62 -0
  331. package/dist/esm/i18n/et.js +8 -0
  332. package/dist/esm/i18n/fi.js +62 -0
  333. package/dist/esm/i18n/fr.js +62 -0
  334. package/dist/esm/i18n/hu.js +62 -0
  335. package/dist/esm/i18n/index.js +24 -0
  336. package/dist/esm/i18n/it.js +62 -0
  337. package/dist/esm/i18n/ja.js +62 -0
  338. package/dist/esm/i18n/ko.js +62 -0
  339. package/dist/esm/i18n/nb.js +62 -0
  340. package/dist/esm/i18n/nl.js +62 -0
  341. package/dist/esm/i18n/pl.js +62 -0
  342. package/dist/esm/i18n/pt_BR.js +62 -0
  343. package/dist/esm/i18n/pt_PT.js +8 -0
  344. package/dist/esm/i18n/ru.js +62 -0
  345. package/dist/esm/i18n/sk.js +8 -0
  346. package/dist/esm/i18n/sv.js +62 -0
  347. package/dist/esm/i18n/th.js +62 -0
  348. package/dist/esm/i18n/tr.js +62 -0
  349. package/dist/esm/i18n/uk.js +62 -0
  350. package/dist/esm/i18n/vi.js +62 -0
  351. package/dist/esm/i18n/zh.js +62 -0
  352. package/dist/esm/i18n/zh_TW.js +62 -0
  353. package/dist/esm/index.js +4 -0
  354. package/dist/esm/plugins/autocomplete/components/autocomplete/index.js +38 -0
  355. package/dist/esm/plugins/autocomplete/components/autocomplete-dropdown/index.js +268 -0
  356. package/dist/esm/plugins/autocomplete/components/autocomplete-dropdown/styled.js +16 -0
  357. package/dist/esm/plugins/autocomplete/components/autocomplete-option/glyphs.js +98 -0
  358. package/dist/esm/plugins/autocomplete/components/autocomplete-option/index.js +165 -0
  359. package/dist/esm/plugins/autocomplete/components/autocomplete-option/messages.js +13 -0
  360. package/dist/esm/plugins/autocomplete/components/autocomplete-option/styled.js +21 -0
  361. package/dist/esm/plugins/autocomplete/components/types.js +1 -0
  362. package/dist/esm/plugins/autocomplete/constants.js +29 -0
  363. package/dist/esm/plugins/autocomplete/index.js +30 -0
  364. package/dist/esm/plugins/autocomplete/messages.js +8 -0
  365. package/dist/esm/plugins/autocomplete/types.js +1 -0
  366. package/dist/esm/plugins/autocomplete/view.js +120 -0
  367. package/dist/esm/plugins/common/get-document-position/index.js +93 -0
  368. package/dist/esm/plugins/common/plugin-keymap.js +43 -0
  369. package/dist/esm/plugins/common/react-plugin-view.js +84 -0
  370. package/dist/esm/plugins/index.js +5 -0
  371. package/dist/esm/plugins/jql-ast/JQLEditorErrorStrategy.js +212 -0
  372. package/dist/esm/plugins/jql-ast/constants.js +9 -0
  373. package/dist/esm/plugins/jql-ast/error-handlers/CustomFieldRuleErrorHandler.js +8 -0
  374. package/dist/esm/plugins/jql-ast/error-handlers/ExpectedTokensErrorHandler.js +57 -0
  375. package/dist/esm/plugins/jql-ast/error-handlers/FieldPropertyIdErrorHandler.js +12 -0
  376. package/dist/esm/plugins/jql-ast/error-handlers/FieldRuleErrorHandler.js +15 -0
  377. package/dist/esm/plugins/jql-ast/error-handlers/FunctionArgumentRuleErrorHandler.js +12 -0
  378. package/dist/esm/plugins/jql-ast/error-handlers/OperandRuleErrorHandler.js +61 -0
  379. package/dist/esm/plugins/jql-ast/error-handlers/OperatorRuleErrorHandler.js +13 -0
  380. package/dist/esm/plugins/jql-ast/index.js +39 -0
  381. package/dist/esm/plugins/jql-ast/messages.js +173 -0
  382. package/dist/esm/plugins/jql-ast/utils.js +17 -0
  383. package/dist/esm/plugins/jql-syntax-highlighting/index.js +62 -0
  384. package/dist/esm/plugins/jql-syntax-highlighting/types.js +1 -0
  385. package/dist/esm/plugins/jql-syntax-highlighting/visitor.js +82 -0
  386. package/dist/esm/plugins/rich-inline-nodes/constants.js +3 -0
  387. package/dist/esm/plugins/rich-inline-nodes/index.js +56 -0
  388. package/dist/esm/plugins/rich-inline-nodes/nodes/index.js +4 -0
  389. package/dist/esm/plugins/rich-inline-nodes/nodes/types.js +1 -0
  390. package/dist/esm/plugins/rich-inline-nodes/nodes/user/index.js +34 -0
  391. package/dist/esm/plugins/rich-inline-nodes/nodes/user/styled.js +28 -0
  392. package/dist/esm/plugins/rich-inline-nodes/types.js +1 -0
  393. package/dist/esm/plugins/rich-inline-nodes/util/create-node-spec.js +30 -0
  394. package/dist/esm/plugins/rich-inline-nodes/util/react-node-view.js +119 -0
  395. package/dist/esm/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +131 -0
  396. package/dist/esm/plugins/types.js +1 -0
  397. package/dist/esm/plugins/validation-tooltip/constants.js +5 -0
  398. package/dist/esm/plugins/validation-tooltip/index.js +52 -0
  399. package/dist/esm/plugins/validation-tooltip/view.js +67 -0
  400. package/dist/esm/schema/index.js +129 -0
  401. package/dist/esm/state/analytics/index.js +50 -0
  402. package/dist/esm/state/autocomplete/index.js +17 -0
  403. package/dist/esm/state/hydration/index.js +85 -0
  404. package/dist/esm/state/hydration/util.js +83 -0
  405. package/dist/esm/state/index.js +991 -0
  406. package/dist/esm/state/types.js +1 -0
  407. package/dist/esm/state/util.js +169 -0
  408. package/dist/esm/types.js +1 -0
  409. package/dist/esm/ui/error-boundary/index.js +73 -0
  410. package/dist/esm/ui/index.js +4 -0
  411. package/dist/esm/ui/intl-provider/index.js +16 -0
  412. package/dist/esm/ui/jql-editor/index.js +63 -0
  413. package/dist/esm/ui/jql-editor/types.js +1 -0
  414. package/dist/esm/ui/jql-editor-controls-content/base-expand-toggle/index.js +49 -0
  415. package/dist/esm/ui/jql-editor-controls-content/base-expand-toggle/styled.js +5 -0
  416. package/dist/esm/ui/jql-editor-controls-content/base-search/index.js +34 -0
  417. package/dist/esm/ui/jql-editor-controls-content/base-syntax-help/index.js +26 -0
  418. package/dist/esm/ui/jql-editor-controls-content/base-syntax-help/styled.js +5 -0
  419. package/dist/esm/ui/jql-editor-controls-content/expand-toggle/index.js +55 -0
  420. package/dist/esm/ui/jql-editor-controls-content/expand-toggle/messages.js +18 -0
  421. package/dist/esm/ui/jql-editor-controls-content/index.js +10 -0
  422. package/dist/esm/ui/jql-editor-controls-content/read-only-controls-content/index.js +28 -0
  423. package/dist/esm/ui/jql-editor-controls-content/search/index.js +31 -0
  424. package/dist/esm/ui/jql-editor-controls-content/search/messages.js +8 -0
  425. package/dist/esm/ui/jql-editor-controls-content/syntax-help/index.js +50 -0
  426. package/dist/esm/ui/jql-editor-controls-content/syntax-help/messages.js +13 -0
  427. package/dist/esm/ui/jql-editor-footer-content/index.js +28 -0
  428. package/dist/esm/ui/jql-editor-footer-content/jql-editor-help/index.js +35 -0
  429. package/dist/esm/ui/jql-editor-footer-content/jql-editor-help/messages.js +18 -0
  430. package/dist/esm/ui/jql-editor-footer-content/jql-editor-help/styled.js +8 -0
  431. package/dist/esm/ui/jql-editor-footer-content/jql-messages/errors/index.js +60 -0
  432. package/dist/esm/ui/jql-editor-footer-content/jql-messages/errors/messages.js +8 -0
  433. package/dist/esm/ui/jql-editor-footer-content/jql-messages/format/index.js +28 -0
  434. package/dist/esm/ui/jql-editor-footer-content/jql-messages/format/styled.js +7 -0
  435. package/dist/esm/ui/jql-editor-footer-content/jql-messages/index.js +3 -0
  436. package/dist/esm/ui/jql-editor-footer-content/jql-messages/infos/index.js +31 -0
  437. package/dist/esm/ui/jql-editor-footer-content/jql-messages/warnings/index.js +100 -0
  438. package/dist/esm/ui/jql-editor-footer-content/jql-messages/warnings/messages.js +18 -0
  439. package/dist/esm/ui/jql-editor-layout/index.js +98 -0
  440. package/dist/esm/ui/jql-editor-layout/styled.js +56 -0
  441. package/dist/esm/ui/jql-editor-portal-provider/context.js +10 -0
  442. package/dist/esm/ui/jql-editor-portal-provider/index.js +107 -0
  443. package/dist/esm/ui/jql-editor-portal-provider/types.js +1 -0
  444. package/dist/esm/ui/jql-editor-view/index.js +190 -0
  445. package/dist/esm/ui/messages.js +8 -0
  446. package/dist/esm/ui/tooltip-tag/index.js +10 -0
  447. package/dist/esm/ui/tooltip-tag/styled.js +4 -0
  448. package/dist/esm/ui/types.js +1 -0
  449. package/dist/esm/utils/document-text/index.js +37 -0
  450. package/dist/esm/utils/split-text-by-new-line/index.js +6 -0
  451. package/dist/types/accessibility/index.d.ts +1 -0
  452. package/dist/types/accessibility/styled.d.ts +2 -0
  453. package/dist/types/analytics/constants.d.ts +18 -0
  454. package/dist/types/analytics/index.d.ts +7 -0
  455. package/dist/types/analytics/listener/analytics-web-client-wrapper.d.ts +9 -0
  456. package/dist/types/analytics/listener/handle-event.d.ts +9 -0
  457. package/dist/types/analytics/listener/helpers/logger.d.ts +24 -0
  458. package/dist/types/analytics/listener/index.d.ts +7 -0
  459. package/dist/types/analytics/listener/jql-editor-analytics-listener.d.ts +20 -0
  460. package/dist/types/analytics/listener/process-event-payload.d.ts +8 -0
  461. package/dist/types/analytics/listener/types.d.ts +7 -0
  462. package/dist/types/analytics/types.d.ts +3 -0
  463. package/dist/types/analytics/util.d.ts +4 -0
  464. package/dist/types/async.d.ts +3 -0
  465. package/dist/types/commands/select-error-command/index.d.ts +5 -0
  466. package/dist/types/common/constants.d.ts +5 -0
  467. package/dist/types/common/messages.d.ts +7 -0
  468. package/dist/types/common/styled.d.ts +3 -0
  469. package/dist/types/hooks/use-editor-theme/index.d.ts +38 -0
  470. package/dist/types/hooks/use-editor-view-has-infos/index.d.ts +1 -0
  471. package/dist/types/hooks/use-editor-view-has-warnings/index.d.ts +1 -0
  472. package/dist/types/hooks/use-editor-view-is-invalid/index.d.ts +11 -0
  473. package/dist/types/i18n/cs.d.ts +61 -0
  474. package/dist/types/i18n/da.d.ts +61 -0
  475. package/dist/types/i18n/de.d.ts +61 -0
  476. package/dist/types/i18n/en.d.ts +61 -0
  477. package/dist/types/i18n/en_GB.d.ts +61 -0
  478. package/dist/types/i18n/en_ZZ.d.ts +61 -0
  479. package/dist/types/i18n/es.d.ts +61 -0
  480. package/dist/types/i18n/et.d.ts +8 -0
  481. package/dist/types/i18n/fi.d.ts +61 -0
  482. package/dist/types/i18n/fr.d.ts +61 -0
  483. package/dist/types/i18n/hu.d.ts +61 -0
  484. package/dist/types/i18n/index.d.ts +24 -0
  485. package/dist/types/i18n/it.d.ts +61 -0
  486. package/dist/types/i18n/ja.d.ts +61 -0
  487. package/dist/types/i18n/ko.d.ts +61 -0
  488. package/dist/types/i18n/nb.d.ts +61 -0
  489. package/dist/types/i18n/nl.d.ts +61 -0
  490. package/dist/types/i18n/pl.d.ts +61 -0
  491. package/dist/types/i18n/pt_BR.d.ts +61 -0
  492. package/dist/types/i18n/pt_PT.d.ts +8 -0
  493. package/dist/types/i18n/ru.d.ts +61 -0
  494. package/dist/types/i18n/sk.d.ts +8 -0
  495. package/dist/types/i18n/sv.d.ts +61 -0
  496. package/dist/types/i18n/th.d.ts +61 -0
  497. package/dist/types/i18n/tr.d.ts +61 -0
  498. package/dist/types/i18n/uk.d.ts +61 -0
  499. package/dist/types/i18n/vi.d.ts +61 -0
  500. package/dist/types/i18n/zh.d.ts +61 -0
  501. package/dist/types/i18n/zh_TW.d.ts +61 -0
  502. package/dist/types/index.d.ts +5 -0
  503. package/dist/types/plugins/autocomplete/components/autocomplete/index.d.ts +4 -0
  504. package/dist/types/plugins/autocomplete/components/autocomplete-dropdown/index.d.ts +11 -0
  505. package/dist/types/plugins/autocomplete/components/autocomplete-dropdown/styled.d.ts +9 -0
  506. package/dist/types/plugins/autocomplete/components/autocomplete-option/glyphs.d.ts +10 -0
  507. package/dist/types/plugins/autocomplete/components/autocomplete-option/index.d.ts +10 -0
  508. package/dist/types/plugins/autocomplete/components/autocomplete-option/messages.d.ts +12 -0
  509. package/dist/types/plugins/autocomplete/components/autocomplete-option/styled.d.ts +11 -0
  510. package/dist/types/plugins/autocomplete/components/types.d.ts +38 -0
  511. package/dist/types/plugins/autocomplete/constants.d.ts +14 -0
  512. package/dist/types/plugins/autocomplete/index.d.ts +4 -0
  513. package/dist/types/plugins/autocomplete/messages.d.ts +7 -0
  514. package/dist/types/plugins/autocomplete/types.d.ts +1 -0
  515. package/dist/types/plugins/autocomplete/view.d.ts +19 -0
  516. package/dist/types/plugins/common/get-document-position/index.d.ts +9 -0
  517. package/dist/types/plugins/common/plugin-keymap.d.ts +7 -0
  518. package/dist/types/plugins/common/react-plugin-view.d.ts +48 -0
  519. package/dist/types/plugins/index.d.ts +5 -0
  520. package/dist/types/plugins/jql-ast/JQLEditorErrorStrategy.d.ts +17 -0
  521. package/dist/types/plugins/jql-ast/constants.d.ts +3 -0
  522. package/dist/types/plugins/jql-ast/error-handlers/CustomFieldRuleErrorHandler.d.ts +5 -0
  523. package/dist/types/plugins/jql-ast/error-handlers/ExpectedTokensErrorHandler.d.ts +11 -0
  524. package/dist/types/plugins/jql-ast/error-handlers/FieldPropertyIdErrorHandler.d.ts +6 -0
  525. package/dist/types/plugins/jql-ast/error-handlers/FieldRuleErrorHandler.d.ts +6 -0
  526. package/dist/types/plugins/jql-ast/error-handlers/FunctionArgumentRuleErrorHandler.d.ts +6 -0
  527. package/dist/types/plugins/jql-ast/error-handlers/OperandRuleErrorHandler.d.ts +9 -0
  528. package/dist/types/plugins/jql-ast/error-handlers/OperatorRuleErrorHandler.d.ts +6 -0
  529. package/dist/types/plugins/jql-ast/index.d.ts +7 -0
  530. package/dist/types/plugins/jql-ast/messages.d.ts +172 -0
  531. package/dist/types/plugins/jql-ast/utils.d.ts +4 -0
  532. package/dist/types/plugins/jql-syntax-highlighting/index.d.ts +4 -0
  533. package/dist/types/plugins/jql-syntax-highlighting/types.d.ts +5 -0
  534. package/dist/types/plugins/jql-syntax-highlighting/visitor.d.ts +19 -0
  535. package/dist/types/plugins/rich-inline-nodes/constants.d.ts +3 -0
  536. package/dist/types/plugins/rich-inline-nodes/index.d.ts +4 -0
  537. package/dist/types/plugins/rich-inline-nodes/nodes/index.d.ts +3 -0
  538. package/dist/types/plugins/rich-inline-nodes/nodes/types.d.ts +9 -0
  539. package/dist/types/plugins/rich-inline-nodes/nodes/user/index.d.ts +7 -0
  540. package/dist/types/plugins/rich-inline-nodes/nodes/user/styled.d.ts +7 -0
  541. package/dist/types/plugins/rich-inline-nodes/types.d.ts +2 -0
  542. package/dist/types/plugins/rich-inline-nodes/util/create-node-spec.d.ts +4 -0
  543. package/dist/types/plugins/rich-inline-nodes/util/react-node-view.d.ts +24 -0
  544. package/dist/types/plugins/rich-inline-nodes/util/replace-nodes-transaction.d.ts +3 -0
  545. package/dist/types/plugins/types.d.ts +16 -0
  546. package/dist/types/plugins/validation-tooltip/constants.d.ts +5 -0
  547. package/dist/types/plugins/validation-tooltip/index.d.ts +3 -0
  548. package/dist/types/plugins/validation-tooltip/view.d.ts +18 -0
  549. package/dist/types/schema/index.d.ts +28 -0
  550. package/dist/types/state/analytics/index.d.ts +9 -0
  551. package/dist/types/state/autocomplete/index.d.ts +4 -0
  552. package/dist/types/state/hydration/index.d.ts +3 -0
  553. package/dist/types/state/hydration/util.d.ts +23 -0
  554. package/dist/types/state/index.d.ts +796 -0
  555. package/dist/types/state/types.d.ts +242 -0
  556. package/dist/types/state/util.d.ts +16 -0
  557. package/dist/types/types.d.ts +5 -0
  558. package/dist/types/ui/error-boundary/index.d.ts +25 -0
  559. package/dist/types/ui/index.d.ts +4 -0
  560. package/dist/types/ui/intl-provider/index.d.ts +10 -0
  561. package/dist/types/ui/jql-editor/index.d.ts +13 -0
  562. package/dist/types/ui/jql-editor/types.d.ts +101 -0
  563. package/dist/types/ui/jql-editor-controls-content/base-expand-toggle/index.d.ts +10 -0
  564. package/dist/types/ui/jql-editor-controls-content/base-expand-toggle/styled.d.ts +2 -0
  565. package/dist/types/ui/jql-editor-controls-content/base-search/index.d.ts +9 -0
  566. package/dist/types/ui/jql-editor-controls-content/base-syntax-help/index.d.ts +9 -0
  567. package/dist/types/ui/jql-editor-controls-content/base-syntax-help/styled.d.ts +2 -0
  568. package/dist/types/ui/jql-editor-controls-content/expand-toggle/index.d.ts +2 -0
  569. package/dist/types/ui/jql-editor-controls-content/expand-toggle/messages.d.ts +17 -0
  570. package/dist/types/ui/jql-editor-controls-content/index.d.ts +2 -0
  571. package/dist/types/ui/jql-editor-controls-content/read-only-controls-content/index.d.ts +2 -0
  572. package/dist/types/ui/jql-editor-controls-content/search/index.d.ts +2 -0
  573. package/dist/types/ui/jql-editor-controls-content/search/messages.d.ts +7 -0
  574. package/dist/types/ui/jql-editor-controls-content/syntax-help/index.d.ts +2 -0
  575. package/dist/types/ui/jql-editor-controls-content/syntax-help/messages.d.ts +12 -0
  576. package/dist/types/ui/jql-editor-footer-content/index.d.ts +6 -0
  577. package/dist/types/ui/jql-editor-footer-content/jql-editor-help/index.d.ts +2 -0
  578. package/dist/types/ui/jql-editor-footer-content/jql-editor-help/messages.d.ts +17 -0
  579. package/dist/types/ui/jql-editor-footer-content/jql-editor-help/styled.d.ts +6 -0
  580. package/dist/types/ui/jql-editor-footer-content/jql-messages/errors/index.d.ts +2 -0
  581. package/dist/types/ui/jql-editor-footer-content/jql-messages/errors/messages.d.ts +7 -0
  582. package/dist/types/ui/jql-editor-footer-content/jql-messages/format/index.d.ts +8 -0
  583. package/dist/types/ui/jql-editor-footer-content/jql-messages/format/styled.d.ts +5 -0
  584. package/dist/types/ui/jql-editor-footer-content/jql-messages/index.d.ts +3 -0
  585. package/dist/types/ui/jql-editor-footer-content/jql-messages/infos/index.d.ts +3 -0
  586. package/dist/types/ui/jql-editor-footer-content/jql-messages/warnings/index.d.ts +3 -0
  587. package/dist/types/ui/jql-editor-footer-content/jql-messages/warnings/messages.d.ts +17 -0
  588. package/dist/types/ui/jql-editor-layout/index.d.ts +64 -0
  589. package/dist/types/ui/jql-editor-layout/styled.d.ts +65 -0
  590. package/dist/types/ui/jql-editor-portal-provider/context.d.ts +4 -0
  591. package/dist/types/ui/jql-editor-portal-provider/index.d.ts +7 -0
  592. package/dist/types/ui/jql-editor-portal-provider/types.d.ts +38 -0
  593. package/dist/types/ui/jql-editor-view/index.d.ts +10 -0
  594. package/dist/types/ui/messages.d.ts +7 -0
  595. package/dist/types/ui/tooltip-tag/index.d.ts +2 -0
  596. package/dist/types/ui/tooltip-tag/styled.d.ts +2 -0
  597. package/dist/types/ui/types.d.ts +9 -0
  598. package/dist/types/utils/document-text/index.d.ts +9 -0
  599. package/dist/types/utils/split-text-by-new-line/index.d.ts +4 -0
  600. package/dist/types-ts4.5/accessibility/index.d.ts +1 -0
  601. package/dist/types-ts4.5/accessibility/styled.d.ts +2 -0
  602. package/dist/types-ts4.5/analytics/constants.d.ts +18 -0
  603. package/dist/types-ts4.5/analytics/index.d.ts +7 -0
  604. package/dist/types-ts4.5/analytics/listener/analytics-web-client-wrapper.d.ts +9 -0
  605. package/dist/types-ts4.5/analytics/listener/handle-event.d.ts +9 -0
  606. package/dist/types-ts4.5/analytics/listener/helpers/logger.d.ts +24 -0
  607. package/dist/types-ts4.5/analytics/listener/index.d.ts +7 -0
  608. package/dist/types-ts4.5/analytics/listener/jql-editor-analytics-listener.d.ts +20 -0
  609. package/dist/types-ts4.5/analytics/listener/process-event-payload.d.ts +8 -0
  610. package/dist/types-ts4.5/analytics/listener/types.d.ts +7 -0
  611. package/dist/types-ts4.5/analytics/types.d.ts +3 -0
  612. package/dist/types-ts4.5/analytics/util.d.ts +4 -0
  613. package/dist/types-ts4.5/async.d.ts +3 -0
  614. package/dist/types-ts4.5/commands/select-error-command/index.d.ts +5 -0
  615. package/dist/types-ts4.5/common/constants.d.ts +5 -0
  616. package/dist/types-ts4.5/common/messages.d.ts +7 -0
  617. package/dist/types-ts4.5/common/styled.d.ts +3 -0
  618. package/dist/types-ts4.5/hooks/use-editor-theme/index.d.ts +38 -0
  619. package/dist/types-ts4.5/hooks/use-editor-view-has-infos/index.d.ts +1 -0
  620. package/dist/types-ts4.5/hooks/use-editor-view-has-warnings/index.d.ts +1 -0
  621. package/dist/types-ts4.5/hooks/use-editor-view-is-invalid/index.d.ts +11 -0
  622. package/dist/types-ts4.5/i18n/cs.d.ts +61 -0
  623. package/dist/types-ts4.5/i18n/da.d.ts +61 -0
  624. package/dist/types-ts4.5/i18n/de.d.ts +61 -0
  625. package/dist/types-ts4.5/i18n/en.d.ts +61 -0
  626. package/dist/types-ts4.5/i18n/en_GB.d.ts +61 -0
  627. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +61 -0
  628. package/dist/types-ts4.5/i18n/es.d.ts +61 -0
  629. package/dist/types-ts4.5/i18n/et.d.ts +8 -0
  630. package/dist/types-ts4.5/i18n/fi.d.ts +61 -0
  631. package/dist/types-ts4.5/i18n/fr.d.ts +61 -0
  632. package/dist/types-ts4.5/i18n/hu.d.ts +61 -0
  633. package/dist/types-ts4.5/i18n/index.d.ts +24 -0
  634. package/dist/types-ts4.5/i18n/it.d.ts +61 -0
  635. package/dist/types-ts4.5/i18n/ja.d.ts +61 -0
  636. package/dist/types-ts4.5/i18n/ko.d.ts +61 -0
  637. package/dist/types-ts4.5/i18n/nb.d.ts +61 -0
  638. package/dist/types-ts4.5/i18n/nl.d.ts +61 -0
  639. package/dist/types-ts4.5/i18n/pl.d.ts +61 -0
  640. package/dist/types-ts4.5/i18n/pt_BR.d.ts +61 -0
  641. package/dist/types-ts4.5/i18n/pt_PT.d.ts +8 -0
  642. package/dist/types-ts4.5/i18n/ru.d.ts +61 -0
  643. package/dist/types-ts4.5/i18n/sk.d.ts +8 -0
  644. package/dist/types-ts4.5/i18n/sv.d.ts +61 -0
  645. package/dist/types-ts4.5/i18n/th.d.ts +61 -0
  646. package/dist/types-ts4.5/i18n/tr.d.ts +61 -0
  647. package/dist/types-ts4.5/i18n/uk.d.ts +61 -0
  648. package/dist/types-ts4.5/i18n/vi.d.ts +61 -0
  649. package/dist/types-ts4.5/i18n/zh.d.ts +61 -0
  650. package/dist/types-ts4.5/i18n/zh_TW.d.ts +61 -0
  651. package/dist/types-ts4.5/index.d.ts +5 -0
  652. package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete/index.d.ts +4 -0
  653. package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-dropdown/index.d.ts +11 -0
  654. package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-dropdown/styled.d.ts +9 -0
  655. package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-option/glyphs.d.ts +10 -0
  656. package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-option/index.d.ts +10 -0
  657. package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-option/messages.d.ts +12 -0
  658. package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-option/styled.d.ts +11 -0
  659. package/dist/types-ts4.5/plugins/autocomplete/components/types.d.ts +38 -0
  660. package/dist/types-ts4.5/plugins/autocomplete/constants.d.ts +14 -0
  661. package/dist/types-ts4.5/plugins/autocomplete/index.d.ts +4 -0
  662. package/dist/types-ts4.5/plugins/autocomplete/messages.d.ts +7 -0
  663. package/dist/types-ts4.5/plugins/autocomplete/types.d.ts +1 -0
  664. package/dist/types-ts4.5/plugins/autocomplete/view.d.ts +19 -0
  665. package/dist/types-ts4.5/plugins/common/get-document-position/index.d.ts +9 -0
  666. package/dist/types-ts4.5/plugins/common/plugin-keymap.d.ts +7 -0
  667. package/dist/types-ts4.5/plugins/common/react-plugin-view.d.ts +48 -0
  668. package/dist/types-ts4.5/plugins/index.d.ts +5 -0
  669. package/dist/types-ts4.5/plugins/jql-ast/JQLEditorErrorStrategy.d.ts +17 -0
  670. package/dist/types-ts4.5/plugins/jql-ast/constants.d.ts +3 -0
  671. package/dist/types-ts4.5/plugins/jql-ast/error-handlers/CustomFieldRuleErrorHandler.d.ts +5 -0
  672. package/dist/types-ts4.5/plugins/jql-ast/error-handlers/ExpectedTokensErrorHandler.d.ts +11 -0
  673. package/dist/types-ts4.5/plugins/jql-ast/error-handlers/FieldPropertyIdErrorHandler.d.ts +6 -0
  674. package/dist/types-ts4.5/plugins/jql-ast/error-handlers/FieldRuleErrorHandler.d.ts +6 -0
  675. package/dist/types-ts4.5/plugins/jql-ast/error-handlers/FunctionArgumentRuleErrorHandler.d.ts +6 -0
  676. package/dist/types-ts4.5/plugins/jql-ast/error-handlers/OperandRuleErrorHandler.d.ts +9 -0
  677. package/dist/types-ts4.5/plugins/jql-ast/error-handlers/OperatorRuleErrorHandler.d.ts +6 -0
  678. package/dist/types-ts4.5/plugins/jql-ast/index.d.ts +7 -0
  679. package/dist/types-ts4.5/plugins/jql-ast/messages.d.ts +172 -0
  680. package/dist/types-ts4.5/plugins/jql-ast/utils.d.ts +4 -0
  681. package/dist/types-ts4.5/plugins/jql-syntax-highlighting/index.d.ts +4 -0
  682. package/dist/types-ts4.5/plugins/jql-syntax-highlighting/types.d.ts +5 -0
  683. package/dist/types-ts4.5/plugins/jql-syntax-highlighting/visitor.d.ts +19 -0
  684. package/dist/types-ts4.5/plugins/rich-inline-nodes/constants.d.ts +3 -0
  685. package/dist/types-ts4.5/plugins/rich-inline-nodes/index.d.ts +4 -0
  686. package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/index.d.ts +3 -0
  687. package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/types.d.ts +9 -0
  688. package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/user/index.d.ts +7 -0
  689. package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/user/styled.d.ts +7 -0
  690. package/dist/types-ts4.5/plugins/rich-inline-nodes/types.d.ts +2 -0
  691. package/dist/types-ts4.5/plugins/rich-inline-nodes/util/create-node-spec.d.ts +4 -0
  692. package/dist/types-ts4.5/plugins/rich-inline-nodes/util/react-node-view.d.ts +24 -0
  693. package/dist/types-ts4.5/plugins/rich-inline-nodes/util/replace-nodes-transaction.d.ts +3 -0
  694. package/dist/types-ts4.5/plugins/types.d.ts +16 -0
  695. package/dist/types-ts4.5/plugins/validation-tooltip/constants.d.ts +5 -0
  696. package/dist/types-ts4.5/plugins/validation-tooltip/index.d.ts +3 -0
  697. package/dist/types-ts4.5/plugins/validation-tooltip/view.d.ts +18 -0
  698. package/dist/types-ts4.5/schema/index.d.ts +28 -0
  699. package/dist/types-ts4.5/state/analytics/index.d.ts +9 -0
  700. package/dist/types-ts4.5/state/autocomplete/index.d.ts +4 -0
  701. package/dist/types-ts4.5/state/hydration/index.d.ts +3 -0
  702. package/dist/types-ts4.5/state/hydration/util.d.ts +23 -0
  703. package/dist/types-ts4.5/state/index.d.ts +796 -0
  704. package/dist/types-ts4.5/state/types.d.ts +242 -0
  705. package/dist/types-ts4.5/state/util.d.ts +16 -0
  706. package/dist/types-ts4.5/types.d.ts +5 -0
  707. package/dist/types-ts4.5/ui/error-boundary/index.d.ts +25 -0
  708. package/dist/types-ts4.5/ui/index.d.ts +4 -0
  709. package/dist/types-ts4.5/ui/intl-provider/index.d.ts +10 -0
  710. package/dist/types-ts4.5/ui/jql-editor/index.d.ts +13 -0
  711. package/dist/types-ts4.5/ui/jql-editor/types.d.ts +101 -0
  712. package/dist/types-ts4.5/ui/jql-editor-controls-content/base-expand-toggle/index.d.ts +10 -0
  713. package/dist/types-ts4.5/ui/jql-editor-controls-content/base-expand-toggle/styled.d.ts +2 -0
  714. package/dist/types-ts4.5/ui/jql-editor-controls-content/base-search/index.d.ts +9 -0
  715. package/dist/types-ts4.5/ui/jql-editor-controls-content/base-syntax-help/index.d.ts +9 -0
  716. package/dist/types-ts4.5/ui/jql-editor-controls-content/base-syntax-help/styled.d.ts +2 -0
  717. package/dist/types-ts4.5/ui/jql-editor-controls-content/expand-toggle/index.d.ts +2 -0
  718. package/dist/types-ts4.5/ui/jql-editor-controls-content/expand-toggle/messages.d.ts +17 -0
  719. package/dist/types-ts4.5/ui/jql-editor-controls-content/index.d.ts +2 -0
  720. package/dist/types-ts4.5/ui/jql-editor-controls-content/read-only-controls-content/index.d.ts +2 -0
  721. package/dist/types-ts4.5/ui/jql-editor-controls-content/search/index.d.ts +2 -0
  722. package/dist/types-ts4.5/ui/jql-editor-controls-content/search/messages.d.ts +7 -0
  723. package/dist/types-ts4.5/ui/jql-editor-controls-content/syntax-help/index.d.ts +2 -0
  724. package/dist/types-ts4.5/ui/jql-editor-controls-content/syntax-help/messages.d.ts +12 -0
  725. package/dist/types-ts4.5/ui/jql-editor-footer-content/index.d.ts +6 -0
  726. package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-editor-help/index.d.ts +2 -0
  727. package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-editor-help/messages.d.ts +17 -0
  728. package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-editor-help/styled.d.ts +6 -0
  729. package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/errors/index.d.ts +2 -0
  730. package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/errors/messages.d.ts +7 -0
  731. package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/format/index.d.ts +8 -0
  732. package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/format/styled.d.ts +5 -0
  733. package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/index.d.ts +3 -0
  734. package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/infos/index.d.ts +3 -0
  735. package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/warnings/index.d.ts +3 -0
  736. package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/warnings/messages.d.ts +17 -0
  737. package/dist/types-ts4.5/ui/jql-editor-layout/index.d.ts +64 -0
  738. package/dist/types-ts4.5/ui/jql-editor-layout/styled.d.ts +65 -0
  739. package/dist/types-ts4.5/ui/jql-editor-portal-provider/context.d.ts +4 -0
  740. package/dist/types-ts4.5/ui/jql-editor-portal-provider/index.d.ts +7 -0
  741. package/dist/types-ts4.5/ui/jql-editor-portal-provider/types.d.ts +38 -0
  742. package/dist/types-ts4.5/ui/jql-editor-view/index.d.ts +10 -0
  743. package/dist/types-ts4.5/ui/messages.d.ts +7 -0
  744. package/dist/types-ts4.5/ui/tooltip-tag/index.d.ts +2 -0
  745. package/dist/types-ts4.5/ui/tooltip-tag/styled.d.ts +2 -0
  746. package/dist/types-ts4.5/ui/types.d.ts +9 -0
  747. package/dist/types-ts4.5/utils/document-text/index.d.ts +9 -0
  748. package/dist/types-ts4.5/utils/split-text-by-new-line/index.d.ts +4 -0
  749. package/i18n/package.json +15 -0
  750. package/package.json +127 -0
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,120 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
+ import _inherits from "@babel/runtime/helpers/inherits";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
11
+ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
12
+ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
13
+ import { isListOperator } from '@atlaskit/jql-ast';
14
+ import getDocumentPosition from '../common/get-document-position';
15
+ import ReactPluginView from '../common/react-plugin-view';
16
+ import Autocomplete from './components/autocomplete';
17
+ import { AUTOCOMPLETE_PLUGIN_NAME, JQLAutocompletePluginKey } from './constants';
18
+
19
+ /**
20
+ * Returns whether an opening parenthesis should be automatically inserted for this option (e.g. after a list operator)
21
+ */
22
+ var shouldInsertOpeningParenthesis = function shouldInsertOpeningParenthesis(_ref) {
23
+ var type = _ref.type,
24
+ context = _ref.context,
25
+ isListFunction = _ref.isListFunction;
26
+ if (type === 'value' || type === 'function' || type === 'keyword') {
27
+ var operator = context === null || context === void 0 ? void 0 : context.operator;
28
+ if (operator && isListOperator(operator) && !(context !== null && context !== void 0 && context.isList) && !isListFunction) {
29
+ return true;
30
+ }
31
+ }
32
+ return false;
33
+ };
34
+ var AutocompletePluginView = /*#__PURE__*/function (_ReactPluginView) {
35
+ _inherits(AutocompletePluginView, _ReactPluginView);
36
+ var _super = _createSuper(AutocompletePluginView);
37
+ function AutocompletePluginView(view, keymap, portalActions, enableRichInlineNodes) {
38
+ var _this;
39
+ _classCallCheck(this, AutocompletePluginView);
40
+ _this = _super.call(this, portalActions, AUTOCOMPLETE_PLUGIN_NAME, 'main');
41
+ _defineProperty(_assertThisInitialized(_this), "getComponent", function () {
42
+ return Autocomplete;
43
+ });
44
+ _defineProperty(_assertThisInitialized(_this), "getInitialComponentProps", function () {
45
+ return {
46
+ keymap: _this.keymap,
47
+ onClick: _this.onReplaceSuggestion
48
+ };
49
+ });
50
+ _defineProperty(_assertThisInitialized(_this), "onReplaceSuggestion", function (option) {
51
+ var _option$replacePositi = _slicedToArray(option.replacePosition, 2),
52
+ from = _option$replacePositi[0],
53
+ to = _option$replacePositi[1];
54
+ var transaction = _this.view.state.tr;
55
+ transaction.setMeta(JQLAutocompletePluginKey, true);
56
+
57
+ // Request query hydration if we are inserting a user node
58
+ if (_this.enableRichInlineNodes && option.type === 'value' && option.valueType === 'user') {
59
+ transaction.setMeta('hydrate', true);
60
+ }
61
+ var documentFrom = getDocumentPosition(transaction.doc, from);
62
+ var documentTo = getDocumentPosition(transaction.doc, to);
63
+
64
+ // Change current selection to the mapped replace position
65
+ transaction.setSelection(TextSelection.create(transaction.doc, documentTo, documentFrom));
66
+
67
+ // Replace selected range with the selected autocomplete option
68
+ transaction.replaceSelection(_this.getSliceForSuggestion(option));
69
+ _this.view.focus();
70
+ _this.view.dispatch(transaction);
71
+ });
72
+ _defineProperty(_assertThisInitialized(_this), "getSliceForSuggestion", function (option) {
73
+ var value = option.value,
74
+ name = option.name,
75
+ nameOnRichInlineNode = option.nameOnRichInlineNode,
76
+ valueType = option.valueType,
77
+ context = option.context;
78
+ var nodes = [];
79
+ if (shouldInsertOpeningParenthesis(option)) {
80
+ nodes.push(_this.view.state.schema.text('('));
81
+ }
82
+ var textContent = _this.view.state.schema.text(value);
83
+ if (!_this.enableRichInlineNodes) {
84
+ nodes.push(textContent);
85
+ } else {
86
+ switch (valueType) {
87
+ case 'user':
88
+ {
89
+ var attributes = {
90
+ type: 'user',
91
+ id: value,
92
+ name: nameOnRichInlineNode !== null && nameOnRichInlineNode !== void 0 ? nameOnRichInlineNode : name,
93
+ fieldName: context === null || context === void 0 ? void 0 : context.field
94
+ };
95
+ nodes.push(_this.view.state.schema.nodes.user.create(attributes, textContent));
96
+ break;
97
+ }
98
+ default:
99
+ {
100
+ nodes.push(textContent);
101
+ break;
102
+ }
103
+ }
104
+ }
105
+ return new Slice(Fragment.from(nodes), 0, 0);
106
+ });
107
+ _this.view = view;
108
+ _this.keymap = keymap;
109
+ _this.enableRichInlineNodes = enableRichInlineNodes;
110
+ return _this;
111
+ }
112
+ _createClass(AutocompletePluginView, [{
113
+ key: "isSameState",
114
+ value: function isSameState(state, prevState) {
115
+ return prevState.doc.eq(state.doc) && prevState.selection.eq(state.selection);
116
+ }
117
+ }]);
118
+ return AutocompletePluginView;
119
+ }(ReactPluginView);
120
+ export { AutocompletePluginView as default };
@@ -0,0 +1,93 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ 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; }
3
+ 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; }
4
+ import { JQLEditorSchema } from '../../../schema';
5
+
6
+ /**
7
+ * Accumulator object to represent the current PM document position + text position within a PM node.
8
+ */
9
+
10
+ /**
11
+ * Recursively find the PM node which includes our text position. This method tracks the offset of PM nodes in order
12
+ * to compute the correct document position according to the rules identified here: https://prosemirror.net/docs/guide/#doc.indexing.
13
+ *
14
+ * If for some reason the text position can not be found in the node then the position at which the current node ends
15
+ * will be returned.
16
+ *
17
+ * @param node Node to search
18
+ * @param parentNodePos Current document and text position within the parent when entering the current node.
19
+ * @param textPosition Text position to find in the Prosemirror document.
20
+ */
21
+ var enterNode = function enterNode(node, parentNodePos, textPosition) {
22
+ var nodePos = _objectSpread({}, parentNodePos);
23
+ var isDocNode = node.type === JQLEditorSchema.nodes.doc;
24
+
25
+ // Enter non-leaf node
26
+ if (!node.isLeaf && !isDocNode) {
27
+ nodePos.doc += 1;
28
+ if (node.isBlock) {
29
+ if (nodePos.enteredInitialBlock) {
30
+ // Every time we enter a block node (after the initial block),
31
+ // we need to increment text position to account for newline char.
32
+ nodePos.text += 1;
33
+ }
34
+ nodePos.enteredInitialBlock = true;
35
+ }
36
+
37
+ // If we've entered a new block and now have a matching node then return the current node position.
38
+ if (nodePos.text === textPosition) {
39
+ return nodePos;
40
+ }
41
+
42
+ // If text position matches last position of a node view, return its outer document position
43
+ if (node.isAtom && textPosition === nodePos.text + node.content.size) {
44
+ nodePos.doc += node.content.size + 1;
45
+ nodePos.text += node.content.size;
46
+ return nodePos;
47
+ }
48
+ }
49
+ if (node.isText) {
50
+ // If our expected text position lies within the text nodes content, then return the associated document position.
51
+ if (textPosition >= nodePos.text && textPosition <= nodePos.text + node.nodeSize) {
52
+ var textOffset = textPosition - nodePos.text;
53
+ nodePos.doc += textOffset;
54
+ nodePos.text += textOffset;
55
+ return nodePos;
56
+ } else {
57
+ // Otherwise increment our accumulated document/text position
58
+ nodePos.doc += node.nodeSize;
59
+ nodePos.text += node.nodeSize;
60
+ }
61
+ }
62
+ for (var i = 0; i < node.childCount; i++) {
63
+ nodePos = enterNode(node.child(i), nodePos, textPosition);
64
+
65
+ // If we have a matching node after iterating this nodes children then return the current node position.
66
+ if (nodePos.text === textPosition) {
67
+ return nodePos;
68
+ }
69
+ }
70
+
71
+ // Exit non-leaf node
72
+ if (!node.isLeaf && !isDocNode) {
73
+ nodePos.doc += 1;
74
+ }
75
+ return nodePos;
76
+ };
77
+
78
+ /**
79
+ * Return the Prosemirror document position that maps to the provided plain text position.
80
+ *
81
+ * @param doc Prosemirror document
82
+ * @param textPosition Text position to find in the Prosemirror document.
83
+ */
84
+ var getDocumentPosition = function getDocumentPosition(doc, textPosition) {
85
+ var currentPos = {
86
+ doc: 0,
87
+ text: 0,
88
+ enteredInitialBlock: false
89
+ };
90
+ var matchingNodePos = enterNode(doc, currentPos, textPosition);
91
+ return matchingNodePos.doc;
92
+ };
93
+ export default getDocumentPosition;
@@ -0,0 +1,43 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
+ import _createClass from "@babel/runtime/helpers/createClass";
5
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ 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; }
9
+ 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; }
10
+ export var PluginKeymap = /*#__PURE__*/function () {
11
+ function PluginKeymap() {
12
+ _classCallCheck(this, PluginKeymap);
13
+ _defineProperty(this, "keymap", {});
14
+ }
15
+ _createClass(PluginKeymap, [{
16
+ key: "bindKey",
17
+ value: function bindKey(key, handler) {
18
+ this.keymap = _objectSpread(_objectSpread({}, this.keymap), {}, _defineProperty({}, key, handler));
19
+ }
20
+ }, {
21
+ key: "bindMultipleKeys",
22
+ value: function bindMultipleKeys(keys, handler) {
23
+ var _this = this;
24
+ keys.forEach(function (key) {
25
+ _this.keymap = _objectSpread(_objectSpread({}, _this.keymap), {}, _defineProperty({}, key, handler));
26
+ });
27
+ }
28
+ }, {
29
+ key: "unbindKey",
30
+ value: function unbindKey(key) {
31
+ var _this$keymap = this.keymap,
32
+ keyToUnbind = _this$keymap[key],
33
+ rest = _objectWithoutProperties(_this$keymap, [key].map(_toPropertyKey));
34
+ this.keymap = rest;
35
+ }
36
+ }, {
37
+ key: "getKeyBinding",
38
+ value: function getKeyBinding(key) {
39
+ return this.keymap[key];
40
+ }
41
+ }]);
42
+ return PluginKeymap;
43
+ }();
@@ -0,0 +1,84 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
+ import React, { useEffect, useState } from 'react';
6
+ import { Subject } from 'rxjs/Subject';
7
+ /**
8
+ * Abstract class for Prosemirror plugin views which need to mount a React component. Concrete subclasses must implement
9
+ * {@link ReactPluginView#getComponent} which specifies the React component to render, along with
10
+ * {@link ReactPluginView#getInitialComponentProps} which returns any props to pass to the component on initial render.
11
+ *
12
+ * After the class is constructed, the caller must invoke {@link ReactPluginView#init} in order to mount the component.
13
+ *
14
+ * If there are external changes which the component needs to respond to, {@link ReactPluginView#componentSubject} can
15
+ * be used to trigger a re-render of the component with updated props. For example:
16
+ * ```
17
+ * update = (view: EditorView) => {
18
+ * this.componentSubject.next(this.getComponentProps(view));
19
+ * };
20
+ *
21
+ * getComponentProps = (view: EditorView) => {
22
+ * // Some logic to get props from the Prosemirror view
23
+ * }
24
+ * ```
25
+ */
26
+ var ReactPluginView = /*#__PURE__*/function () {
27
+ /**
28
+ * Construct a Prosemirror plugin view which will render a React component in a portal.
29
+ *
30
+ * @param portalActions Provides callback functions which can be invoked to create and destroy a portal.
31
+ * @param portalKey Unique identifier for the plugin component.
32
+ * @param containerKey Key representing the HTML container the React component will be portalled into.
33
+ * @protected
34
+ */
35
+ function ReactPluginView(portalActions, portalKey, containerKey) {
36
+ var _this = this;
37
+ _classCallCheck(this, ReactPluginView);
38
+ _defineProperty(this, "componentSubject", new Subject());
39
+ _defineProperty(this, "init", function () {
40
+ var Component = _this.getComponent();
41
+ var PortallingComponent = function PortallingComponent() {
42
+ var _useState = useState(function () {
43
+ return _this.getInitialComponentProps();
44
+ }),
45
+ _useState2 = _slicedToArray(_useState, 2),
46
+ state = _useState2[0],
47
+ setState = _useState2[1];
48
+ useEffect(function () {
49
+ // Subscribe to the RxJS subject so concrete subclasses can emit events to re-render the plugin component.
50
+ var subscription = _this.componentSubject.subscribe(function (updatedProps) {
51
+ setState(updatedProps);
52
+ });
53
+ return function () {
54
+ return subscription.unsubscribe();
55
+ };
56
+ }, []);
57
+ return /*#__PURE__*/React.createElement(Component, state);
58
+ };
59
+
60
+ // Dispatch onCreatePortal which will allow the handler to create a new portalled React component
61
+ _this.portalActions.onCreatePortal(_this.portalKey, /*#__PURE__*/React.createElement(PortallingComponent, null), _this.containerKey);
62
+ });
63
+ this.portalActions = portalActions;
64
+ this.portalKey = portalKey;
65
+ this.containerKey = containerKey;
66
+ }
67
+ _createClass(ReactPluginView, [{
68
+ key: "destroy",
69
+ value: function destroy() {
70
+ // Dispatch onDestroyPortal which will allow the handler to remove the portalled React component.
71
+ this.portalActions.onDestroyPortal(this.portalKey);
72
+ }
73
+
74
+ /**
75
+ * Return a React component to render for the plugin.
76
+ */
77
+
78
+ /**
79
+ * Return props to set on the component for initial render.
80
+ */
81
+ }]);
82
+ return ReactPluginView;
83
+ }();
84
+ export { ReactPluginView as default };
@@ -0,0 +1,5 @@
1
+ export { default as autocompletePlugin } from './autocomplete';
2
+ export { default as jqlAstPlugin } from './jql-ast';
3
+ export { default as jqlSyntaxHighlightingPlugin } from './jql-syntax-highlighting';
4
+ export { default as richInlineNodesPlugin } from './rich-inline-nodes';
5
+ export { default as validationTooltipPlugin } from './validation-tooltip';
@@ -0,0 +1,212 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _get from "@babel/runtime/helpers/get";
4
+ import _inherits from "@babel/runtime/helpers/inherits";
5
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9
+ import { DefaultErrorStrategy } from 'antlr4ts';
10
+ import padStart from 'lodash/padStart';
11
+ import { normaliseJqlString } from '@atlaskit/jql-ast';
12
+ import { JQLAutocomplete } from '@atlaskit/jql-autocomplete';
13
+ import { JQLLexer, JQLParser } from '@atlaskit/jql-parser';
14
+ import { ignoredTokens, preferredRules } from './constants';
15
+ import { handleCustomFieldRuleError } from './error-handlers/CustomFieldRuleErrorHandler';
16
+ import { handleExpectedTokensError } from './error-handlers/ExpectedTokensErrorHandler';
17
+ import { handleFieldPropertyIdRuleError } from './error-handlers/FieldPropertyIdErrorHandler';
18
+ import { handleFieldRuleError } from './error-handlers/FieldRuleErrorHandler';
19
+ import { handleFunctionArgumentRuleError } from './error-handlers/FunctionArgumentRuleErrorHandler';
20
+ import { handleOperandRuleError } from './error-handlers/OperandRuleErrorHandler';
21
+ import { handleOperatorRuleError } from './error-handlers/OperatorRuleErrorHandler';
22
+ import { errorMessages } from './messages';
23
+ import { getExpectedTokensFromParserOrException } from './utils';
24
+ var isEscape = function isEscape(char) {
25
+ return char === '\\';
26
+ };
27
+ export var getPrintableChar = function getPrintableChar(char) {
28
+ var hex = char.charCodeAt(0).toString(16).toUpperCase();
29
+ return "U+".concat(padStart(hex, 4, '0'));
30
+ };
31
+ export var getJavaCodeFromChar = function getJavaCodeFromChar(char) {
32
+ var hex = char.charCodeAt(0).toString(16);
33
+ return "\\u".concat(padStart(hex, 4, '0'));
34
+ };
35
+ var JQLEditorErrorStrategy = /*#__PURE__*/function (_DefaultErrorStrategy) {
36
+ _inherits(JQLEditorErrorStrategy, _DefaultErrorStrategy);
37
+ var _super = _createSuper(JQLEditorErrorStrategy);
38
+ function JQLEditorErrorStrategy(intlRef) {
39
+ var _this;
40
+ _classCallCheck(this, JQLEditorErrorStrategy);
41
+ _this = _super.call(this);
42
+ _this.intlRef = intlRef;
43
+ return _this;
44
+ }
45
+ _createClass(JQLEditorErrorStrategy, [{
46
+ key: "reportInputMismatch",
47
+ value: function reportInputMismatch(recognizer, exception) {
48
+ this.handleSyntaxError(recognizer, recognizer.currentToken, exception);
49
+ }
50
+ }, {
51
+ key: "reportUnwantedToken",
52
+ value: function reportUnwantedToken(recognizer) {
53
+ if (this.inErrorRecoveryMode(recognizer)) {
54
+ return;
55
+ }
56
+ this.beginErrorCondition(recognizer);
57
+ this.handleSyntaxError(recognizer, recognizer.currentToken);
58
+ }
59
+ }, {
60
+ key: "reportMissingToken",
61
+ value: function reportMissingToken(recognizer) {
62
+ if (this.inErrorRecoveryMode(recognizer)) {
63
+ return;
64
+ }
65
+ this.beginErrorCondition(recognizer);
66
+
67
+ // This is called when single token insertion is a viable recovery strategy for the error. In this case we can
68
+ // use expected tokens from the parser to display an error to the user. If there are no viable tokens to show then
69
+ // we should fallback to syntax error handling.
70
+ if (getExpectedTokensFromParserOrException(recognizer).length > 0) {
71
+ var message = handleExpectedTokensError(recognizer, recognizer.currentToken,
72
+ // We want to derive expectedTokens from the parser state
73
+ [], this.intlRef.current);
74
+ recognizer.notifyErrorListeners(message, recognizer.currentToken, undefined);
75
+ } else {
76
+ this.handleSyntaxError(recognizer, recognizer.currentToken);
77
+ }
78
+ }
79
+ }, {
80
+ key: "reportNoViableAlternative",
81
+ value: function reportNoViableAlternative(recognizer, exception) {
82
+ var _exception$getOffendi;
83
+ // There are some cases, like "status was", where parser is unable to provide viable alternatives for current
84
+ // token, but autocomplete engine is still able to provide meaningful suggestions at offending token index
85
+ var currentToken = (_exception$getOffendi = exception === null || exception === void 0 ? void 0 : exception.getOffendingToken()) !== null && _exception$getOffendi !== void 0 ? _exception$getOffendi : recognizer.currentToken;
86
+ this.handleSyntaxError(recognizer, currentToken, exception);
87
+ }
88
+ }, {
89
+ key: "reportFailedPredicate",
90
+ value: function reportFailedPredicate(recognizer, e) {
91
+ // TODO: Don't know how to produce this error. Monitor if this happens and defer to default implementation
92
+ _get(_getPrototypeOf(JQLEditorErrorStrategy.prototype), "reportFailedPredicate", this).call(this, recognizer, e);
93
+ }
94
+ }, {
95
+ key: "handleSyntaxError",
96
+ value: function handleSyntaxError(recognizer, currentToken, exception) {
97
+ var message;
98
+ switch (currentToken.type) {
99
+ /*
100
+ * This is called when ANTLR finds a character that the grammar does not recognise. The grammar lexer uses
101
+ * a DFA to decide if a character is in error or not. This can mean that legal characters come as an error
102
+ * because they do not form a valid token. Because of this we have to do some extra checks here.
103
+ */
104
+ case JQLLexer.ERRORCHAR:
105
+ case JQLLexer.INVALID_QUOTE_STRING:
106
+ case JQLLexer.INVALID_SQUOTE_STRING:
107
+ {
108
+ var currentText = currentToken.text;
109
+
110
+ // These tokens are returned when an illegal character appears at the end of a quote string, but the token
111
+ // includes the entire quoted text. We take the last character from our text as that's the offending token.
112
+ if (currentToken.type === JQLLexer.INVALID_QUOTE_STRING || currentToken.type === JQLLexer.INVALID_SQUOTE_STRING) {
113
+ var _currentText;
114
+ currentText = (_currentText = currentText) === null || _currentText === void 0 ? void 0 : _currentText.slice(-1);
115
+ }
116
+
117
+ // This can happen (e.g. comment ~ \)
118
+ if (isEscape(currentText)) {
119
+ var nextToken = recognizer.inputStream.get(currentToken.tokenIndex + 1);
120
+ if (nextToken.type === JQLLexer.MATCHWS || nextToken.type === JQLLexer.EOF) {
121
+ message = this.intlRef.current.formatMessage(errorMessages.illegalEscapeBlank);
122
+ } else {
123
+ var _currentText2, _nextToken$text;
124
+ // Show the escaped character sequence in the message
125
+ var received = "".concat((_currentText2 = currentText) !== null && _currentText2 !== void 0 ? _currentText2 : '').concat((_nextToken$text = nextToken.text) !== null && _nextToken$text !== void 0 ? _nextToken$text : '');
126
+ message = this.intlRef.current.formatMessage(errorMessages.illegalEscape, {
127
+ received: received
128
+ });
129
+ }
130
+ } else {
131
+ var _currentText3, _currentText4;
132
+ message = this.intlRef.current.formatMessage(errorMessages.illegalChar, {
133
+ char: getPrintableChar((_currentText3 = currentText) !== null && _currentText3 !== void 0 ? _currentText3 : ''),
134
+ escapedChar: getJavaCodeFromChar((_currentText4 = currentText) !== null && _currentText4 !== void 0 ? _currentText4 : '')
135
+ });
136
+ }
137
+ break;
138
+ }
139
+ // Special tokens that get created every time there is an unfinished string (i.e. without matching closing quote)
140
+ case JQLLexer.UNCLOSED_QUOTE_STRING:
141
+ case JQLLexer.UNCLOSED_SQUOTE_STRING:
142
+ {
143
+ var _currentToken$text;
144
+ var _received = normaliseJqlString((_currentToken$text = currentToken.text) !== null && _currentToken$text !== void 0 ? _currentToken$text : '');
145
+ if (_received === '') {
146
+ message = this.intlRef.current.formatMessage(errorMessages.unfinishedStringBlank);
147
+ } else {
148
+ message = this.intlRef.current.formatMessage(errorMessages.unfinishedString, {
149
+ received: _received
150
+ });
151
+ }
152
+ break;
153
+ }
154
+ case JQLLexer.RESERVED_WORD:
155
+ {
156
+ message = this.intlRef.current.formatMessage(errorMessages.reservedWord, {
157
+ word: currentToken.text
158
+ });
159
+ break;
160
+ }
161
+ case JQLLexer.ERROR_RESERVED:
162
+ {
163
+ var _currentToken$text2;
164
+ message = this.intlRef.current.formatMessage(errorMessages.reservedChar, {
165
+ char: currentToken.text,
166
+ escapedChar: getJavaCodeFromChar((_currentToken$text2 = currentToken.text) !== null && _currentToken$text2 !== void 0 ? _currentToken$text2 : '')
167
+ });
168
+ break;
169
+ }
170
+ default:
171
+ {
172
+ var autocomplete = JQLAutocomplete.fromParser(recognizer, ignoredTokens, preferredRules, new Set());
173
+ var _autocomplete$getJQLS = autocomplete.getJQLSuggestionsForTokenIndex(currentToken.tokenIndex),
174
+ tokens = _autocomplete$getJQLS.tokens,
175
+ rules = _autocomplete$getJQLS.rules;
176
+ if (rules.value || rules.list ||
177
+ // Restrict function rules to only be shown if we are currently INSIDE a function rule. Otherwise this error
178
+ // message would be shown for incomplete tokens following an operand, e.g. `status = open ord`.
179
+ rules.function && recognizer.context.ruleIndex === JQLParser.RULE_jqlFunction) {
180
+ message = handleOperandRuleError(recognizer, currentToken, tokens.values, rules, this.intlRef.current, exception);
181
+ } else if (tokens.values.includes('EMPTY')) {
182
+ message = handleExpectedTokensError(recognizer, currentToken, tokens.values, this.intlRef.current, exception);
183
+ } else if (rules.operator) {
184
+ message = handleOperatorRuleError(currentToken, this.intlRef.current);
185
+ } else if (rules.field) {
186
+ message = handleFieldRuleError(currentToken, this.intlRef.current);
187
+ } else if (rules.customField) {
188
+ message = handleCustomFieldRuleError(this.intlRef.current);
189
+ }
190
+ // Restrict field property rules to only be shown if we are currently INSIDE a field property. Otherwise this
191
+ // error message would be shown for incomplete tokens following a field, e.g. `ORDER BY issuetype as`.
192
+ else if (rules.fieldProperty && recognizer.context.ruleIndex === JQLParser.RULE_jqlFieldProperty) {
193
+ // Shows the correct message when a field property rule hasn't been completed, e.g. `issuetype[abc!`
194
+ message = handleExpectedTokensError(recognizer, currentToken,
195
+ // We want to derive expectedTokens from the exception/parser state
196
+ [], this.intlRef.current, exception);
197
+ } else if (rules.fieldPropertyId) {
198
+ message = handleFieldPropertyIdRuleError(currentToken, this.intlRef.current);
199
+ } else if (rules.functionArgument) {
200
+ message = handleFunctionArgumentRuleError(currentToken, this.intlRef.current);
201
+ } else {
202
+ message = handleExpectedTokensError(recognizer, currentToken, tokens.values, this.intlRef.current, exception);
203
+ }
204
+ break;
205
+ }
206
+ }
207
+ recognizer.notifyErrorListeners(message, currentToken, undefined);
208
+ }
209
+ }]);
210
+ return JQLEditorErrorStrategy;
211
+ }(DefaultErrorStrategy);
212
+ export { JQLEditorErrorStrategy as default };
@@ -0,0 +1,9 @@
1
+ import { JQLLexer, JQLParser } from '@atlaskit/jql-parser';
2
+ export var ignoredTokens = new Set([JQLLexer.EOF, JQLLexer.LPAREN, JQLLexer.LBRACKET, JQLLexer.STRING, JQLLexer.QUOTE_STRING, JQLLexer.SQUOTE_STRING, JQLLexer.POSNUMBER, JQLLexer.NEGNUMBER, JQLLexer.BANG, JQLLexer.CUSTOMFIELD]);
3
+ export var preferredRules = new Set([JQLParser.RULE_jqlField, JQLParser.RULE_jqlFieldProperty, JQLParser.RULE_jqlEqualsOperator, JQLParser.RULE_jqlLikeOperator, JQLParser.RULE_jqlComparisonOperator, JQLParser.RULE_jqlInOperator, JQLParser.RULE_jqlIsOperator, JQLParser.RULE_jqlWasOperator, JQLParser.RULE_jqlWasInOperator, JQLParser.RULE_jqlChangedOperator, JQLParser.RULE_jqlValue, JQLParser.RULE_jqlListStart, JQLParser.RULE_jqlFunction, JQLParser.RULE_jqlCustomField,
4
+ // Produces rules for fieldPropertyId, fieldPropertyArgument and functionArgument
5
+ JQLParser.RULE_jqlArgument]);
6
+
7
+ // The following tokens are returned by autocomplete but they are considered "lower" priority suggestions. We only want
8
+ // to show these if there are no other viable tokens to suggest.
9
+ export var lowPriorityTokens = [JQLLexer.RPAREN, JQLLexer.RBRACKET, JQLLexer.COMMA];
@@ -0,0 +1,8 @@
1
+ import { errorMessages } from '../messages';
2
+
3
+ /**
4
+ * Show the appropriate error message when parsing JQL fails and a custom field rule was expected.
5
+ */
6
+ export var handleCustomFieldRuleError = function handleCustomFieldRuleError(intl) {
7
+ return intl.formatMessage(errorMessages.expectingCustomFieldId);
8
+ };
@@ -0,0 +1,57 @@
1
+ import { JQLLexer } from '@atlaskit/jql-parser';
2
+ import { commonMessages } from '../../../common/messages';
3
+ import { lowPriorityTokens } from '../constants';
4
+ import { errorMessages } from '../messages';
5
+ import { getExpectedTokensFromParserOrException, getTokenDisplayNames } from '../utils';
6
+
7
+ /**
8
+ * Show the appropriate error message when parsing JQL fails and 0 or more tokens were expected.
9
+ *
10
+ * If no `expectedTokens` were provided then we'll attempt to find viable tokens to suggest from the provided
11
+ * exception/parser state.
12
+ */
13
+ export var handleExpectedTokensError = function handleExpectedTokensError(recognizer, currentToken, expectedTokens, intl, exception) {
14
+ // If there are no expected autocomplete tokens, then attempt to find viable tokens from the exception/parser.
15
+ if (expectedTokens.length === 0) {
16
+ expectedTokens = getTokenDisplayNames(recognizer, getExpectedTokensFromParserOrException(recognizer, exception));
17
+ }
18
+ var lowPriorityTokenNames = getTokenDisplayNames(recognizer, lowPriorityTokens);
19
+
20
+ // Only include tokens that are NOT low priority
21
+ var highPriorityTokens = expectedTokens.filter(function (tokenType) {
22
+ return !lowPriorityTokenNames.includes(tokenType);
23
+ });
24
+
25
+ // If we have any tokens that are high priority then we want to show them (without low priority suggestions).
26
+ if (highPriorityTokens.length > 0) {
27
+ expectedTokens = highPriorityTokens;
28
+ }
29
+ var isEOF = currentToken.type === JQLLexer.EOF;
30
+ if (expectedTokens.length > 1) {
31
+ var firstExpectedTokens = expectedTokens.slice(0, -1)
32
+ // Need to wrap tokens in single quotes ourselves as we cannot do it in the message descriptor
33
+ .map(function (token) {
34
+ return "'".concat(token, "'");
35
+ }).join(', ');
36
+ var lastExpectedToken = expectedTokens[expectedTokens.length - 1];
37
+ return isEOF ? intl.formatMessage(errorMessages.expectingMultipleTokensBeforeEOF, {
38
+ firstExpectedTokens: firstExpectedTokens,
39
+ lastExpectedToken: lastExpectedToken
40
+ }) : intl.formatMessage(errorMessages.expectingMultipleTokensButReceived, {
41
+ firstExpectedTokens: firstExpectedTokens,
42
+ lastExpectedToken: lastExpectedToken,
43
+ received: currentToken.text
44
+ });
45
+ } else if (expectedTokens.length === 1) {
46
+ return isEOF ? intl.formatMessage(errorMessages.expectingTokenBeforeEOF, {
47
+ expectedToken: expectedTokens[0]
48
+ }) : intl.formatMessage(errorMessages.expectingTokenButReceived, {
49
+ expectedToken: expectedTokens[0],
50
+ received: currentToken.text
51
+ });
52
+ } else {
53
+ return isEOF ? intl.formatMessage(commonMessages.unknownError) : intl.formatMessage(errorMessages.unknownErrorAtToken, {
54
+ received: currentToken.text
55
+ });
56
+ }
57
+ };
@@ -0,0 +1,12 @@
1
+ import { JQLLexer } from '@atlaskit/jql-parser';
2
+ import { errorMessages } from '../messages';
3
+
4
+ /**
5
+ * Show the appropriate error message when parsing JQL fails and a field property ID rule was expected.
6
+ */
7
+ export var handleFieldPropertyIdRuleError = function handleFieldPropertyIdRuleError(currentToken, intl) {
8
+ var isEOF = currentToken.type === JQLLexer.EOF;
9
+ return isEOF ? intl.formatMessage(errorMessages.expectingFieldPropertyIdBeforeEOF) : intl.formatMessage(errorMessages.expectingFieldPropertyIdButReceived, {
10
+ received: currentToken.text
11
+ });
12
+ };