@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.
- package/CHANGELOG.md +1048 -0
- package/LICENSE.md +13 -0
- package/README.md +3 -0
- package/dist/cjs/accessibility/index.js +12 -0
- package/dist/cjs/accessibility/styled.js +12 -0
- package/dist/cjs/analytics/constants.js +27 -0
- package/dist/cjs/analytics/index.js +57 -0
- package/dist/cjs/analytics/listener/analytics-web-client-wrapper.js +77 -0
- package/dist/cjs/analytics/listener/handle-event.js +21 -0
- package/dist/cjs/analytics/listener/helpers/logger.js +89 -0
- package/dist/cjs/analytics/listener/index.js +13 -0
- package/dist/cjs/analytics/listener/jql-editor-analytics-listener.js +52 -0
- package/dist/cjs/analytics/listener/process-event-payload.js +44 -0
- package/dist/cjs/analytics/listener/types.js +5 -0
- package/dist/cjs/analytics/types.js +5 -0
- package/dist/cjs/analytics/util.js +10 -0
- package/dist/cjs/async.js +34 -0
- package/dist/cjs/commands/select-error-command/index.js +30 -0
- package/dist/cjs/common/constants.js +11 -0
- package/dist/cjs/common/messages.js +14 -0
- package/dist/cjs/common/styled.js +15 -0
- package/dist/cjs/hooks/use-editor-theme/index.js +53 -0
- package/dist/cjs/hooks/use-editor-view-has-infos/index.js +16 -0
- package/dist/cjs/hooks/use-editor-view-has-warnings/index.js +19 -0
- package/dist/cjs/hooks/use-editor-view-is-invalid/index.js +52 -0
- package/dist/cjs/i18n/cs.js +68 -0
- package/dist/cjs/i18n/da.js +68 -0
- package/dist/cjs/i18n/de.js +68 -0
- package/dist/cjs/i18n/en.js +68 -0
- package/dist/cjs/i18n/en_GB.js +68 -0
- package/dist/cjs/i18n/en_ZZ.js +68 -0
- package/dist/cjs/i18n/es.js +68 -0
- package/dist/cjs/i18n/et.js +14 -0
- package/dist/cjs/i18n/fi.js +68 -0
- package/dist/cjs/i18n/fr.js +68 -0
- package/dist/cjs/i18n/hu.js +68 -0
- package/dist/cjs/i18n/index.js +132 -0
- package/dist/cjs/i18n/it.js +68 -0
- package/dist/cjs/i18n/ja.js +68 -0
- package/dist/cjs/i18n/ko.js +68 -0
- package/dist/cjs/i18n/nb.js +68 -0
- package/dist/cjs/i18n/nl.js +68 -0
- package/dist/cjs/i18n/pl.js +68 -0
- package/dist/cjs/i18n/pt_BR.js +68 -0
- package/dist/cjs/i18n/pt_PT.js +14 -0
- package/dist/cjs/i18n/ru.js +68 -0
- package/dist/cjs/i18n/sk.js +14 -0
- package/dist/cjs/i18n/sv.js +68 -0
- package/dist/cjs/i18n/th.js +68 -0
- package/dist/cjs/i18n/tr.js +68 -0
- package/dist/cjs/i18n/uk.js +68 -0
- package/dist/cjs/i18n/vi.js +68 -0
- package/dist/cjs/i18n/zh.js +68 -0
- package/dist/cjs/i18n/zh_TW.js +68 -0
- package/dist/cjs/index.js +52 -0
- package/dist/cjs/plugins/autocomplete/components/autocomplete/index.js +48 -0
- package/dist/cjs/plugins/autocomplete/components/autocomplete-dropdown/index.js +278 -0
- package/dist/cjs/plugins/autocomplete/components/autocomplete-dropdown/styled.js +22 -0
- package/dist/cjs/plugins/autocomplete/components/autocomplete-option/glyphs.js +104 -0
- package/dist/cjs/plugins/autocomplete/components/autocomplete-option/index.js +175 -0
- package/dist/cjs/plugins/autocomplete/components/autocomplete-option/messages.js +19 -0
- package/dist/cjs/plugins/autocomplete/components/autocomplete-option/styled.js +26 -0
- package/dist/cjs/plugins/autocomplete/components/types.js +5 -0
- package/dist/cjs/plugins/autocomplete/constants.js +35 -0
- package/dist/cjs/plugins/autocomplete/index.js +37 -0
- package/dist/cjs/plugins/autocomplete/messages.js +14 -0
- package/dist/cjs/plugins/autocomplete/types.js +5 -0
- package/dist/cjs/plugins/autocomplete/view.js +125 -0
- package/dist/cjs/plugins/common/get-document-position/index.js +99 -0
- package/dist/cjs/plugins/common/plugin-keymap.js +50 -0
- package/dist/cjs/plugins/common/react-plugin-view.js +93 -0
- package/dist/cjs/plugins/index.js +41 -0
- package/dist/cjs/plugins/jql-ast/JQLEditorErrorStrategy.js +218 -0
- package/dist/cjs/plugins/jql-ast/constants.js +15 -0
- package/dist/cjs/plugins/jql-ast/error-handlers/CustomFieldRuleErrorHandler.js +13 -0
- package/dist/cjs/plugins/jql-ast/error-handlers/ExpectedTokensErrorHandler.js +62 -0
- package/dist/cjs/plugins/jql-ast/error-handlers/FieldPropertyIdErrorHandler.js +17 -0
- package/dist/cjs/plugins/jql-ast/error-handlers/FieldRuleErrorHandler.js +20 -0
- package/dist/cjs/plugins/jql-ast/error-handlers/FunctionArgumentRuleErrorHandler.js +17 -0
- package/dist/cjs/plugins/jql-ast/error-handlers/OperandRuleErrorHandler.js +66 -0
- package/dist/cjs/plugins/jql-ast/error-handlers/OperatorRuleErrorHandler.js +18 -0
- package/dist/cjs/plugins/jql-ast/index.js +46 -0
- package/dist/cjs/plugins/jql-ast/messages.js +179 -0
- package/dist/cjs/plugins/jql-ast/utils.js +23 -0
- package/dist/cjs/plugins/jql-syntax-highlighting/index.js +69 -0
- package/dist/cjs/plugins/jql-syntax-highlighting/types.js +5 -0
- package/dist/cjs/plugins/jql-syntax-highlighting/visitor.js +89 -0
- package/dist/cjs/plugins/rich-inline-nodes/constants.js +9 -0
- package/dist/cjs/plugins/rich-inline-nodes/index.js +63 -0
- package/dist/cjs/plugins/rich-inline-nodes/nodes/index.js +10 -0
- package/dist/cjs/plugins/rich-inline-nodes/nodes/types.js +5 -0
- package/dist/cjs/plugins/rich-inline-nodes/nodes/user/index.js +41 -0
- package/dist/cjs/plugins/rich-inline-nodes/nodes/user/styled.js +35 -0
- package/dist/cjs/plugins/rich-inline-nodes/types.js +5 -0
- package/dist/cjs/plugins/rich-inline-nodes/util/create-node-spec.js +37 -0
- package/dist/cjs/plugins/rich-inline-nodes/util/react-node-view.js +129 -0
- package/dist/cjs/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +138 -0
- package/dist/cjs/plugins/types.js +5 -0
- package/dist/cjs/plugins/validation-tooltip/constants.js +11 -0
- package/dist/cjs/plugins/validation-tooltip/index.js +58 -0
- package/dist/cjs/plugins/validation-tooltip/view.js +74 -0
- package/dist/cjs/schema/index.js +137 -0
- package/dist/cjs/state/analytics/index.js +56 -0
- package/dist/cjs/state/autocomplete/index.js +23 -0
- package/dist/cjs/state/hydration/index.js +92 -0
- package/dist/cjs/state/hydration/util.js +89 -0
- package/dist/cjs/state/index.js +997 -0
- package/dist/cjs/state/types.js +5 -0
- package/dist/cjs/state/util.js +176 -0
- package/dist/cjs/types.js +5 -0
- package/dist/cjs/ui/error-boundary/index.js +81 -0
- package/dist/cjs/ui/index.js +11 -0
- package/dist/cjs/ui/intl-provider/index.js +23 -0
- package/dist/cjs/ui/jql-editor/index.js +75 -0
- package/dist/cjs/ui/jql-editor/types.js +5 -0
- package/dist/cjs/ui/jql-editor-controls-content/base-expand-toggle/index.js +55 -0
- package/dist/cjs/ui/jql-editor-controls-content/base-expand-toggle/styled.js +12 -0
- package/dist/cjs/ui/jql-editor-controls-content/base-search/index.js +44 -0
- package/dist/cjs/ui/jql-editor-controls-content/base-syntax-help/index.js +33 -0
- package/dist/cjs/ui/jql-editor-controls-content/base-syntax-help/styled.js +12 -0
- package/dist/cjs/ui/jql-editor-controls-content/expand-toggle/index.js +67 -0
- package/dist/cjs/ui/jql-editor-controls-content/expand-toggle/messages.js +24 -0
- package/dist/cjs/ui/jql-editor-controls-content/index.js +17 -0
- package/dist/cjs/ui/jql-editor-controls-content/read-only-controls-content/index.js +38 -0
- package/dist/cjs/ui/jql-editor-controls-content/search/index.js +40 -0
- package/dist/cjs/ui/jql-editor-controls-content/search/messages.js +14 -0
- package/dist/cjs/ui/jql-editor-controls-content/syntax-help/index.js +62 -0
- package/dist/cjs/ui/jql-editor-controls-content/syntax-help/messages.js +19 -0
- package/dist/cjs/ui/jql-editor-footer-content/index.js +34 -0
- package/dist/cjs/ui/jql-editor-footer-content/jql-editor-help/index.js +42 -0
- package/dist/cjs/ui/jql-editor-footer-content/jql-editor-help/messages.js +24 -0
- package/dist/cjs/ui/jql-editor-footer-content/jql-editor-help/styled.js +15 -0
- package/dist/cjs/ui/jql-editor-footer-content/jql-messages/errors/index.js +70 -0
- package/dist/cjs/ui/jql-editor-footer-content/jql-messages/errors/messages.js +14 -0
- package/dist/cjs/ui/jql-editor-footer-content/jql-messages/format/index.js +34 -0
- package/dist/cjs/ui/jql-editor-footer-content/jql-messages/format/styled.js +14 -0
- package/dist/cjs/ui/jql-editor-footer-content/jql-messages/index.js +26 -0
- package/dist/cjs/ui/jql-editor-footer-content/jql-messages/infos/index.js +41 -0
- package/dist/cjs/ui/jql-editor-footer-content/jql-messages/warnings/index.js +110 -0
- package/dist/cjs/ui/jql-editor-footer-content/jql-messages/warnings/messages.js +24 -0
- package/dist/cjs/ui/jql-editor-layout/index.js +104 -0
- package/dist/cjs/ui/jql-editor-layout/styled.js +61 -0
- package/dist/cjs/ui/jql-editor-portal-provider/context.js +17 -0
- package/dist/cjs/ui/jql-editor-portal-provider/index.js +116 -0
- package/dist/cjs/ui/jql-editor-portal-provider/types.js +5 -0
- package/dist/cjs/ui/jql-editor-view/index.js +198 -0
- package/dist/cjs/ui/messages.js +14 -0
- package/dist/cjs/ui/tooltip-tag/index.js +19 -0
- package/dist/cjs/ui/tooltip-tag/styled.js +11 -0
- package/dist/cjs/ui/types.js +5 -0
- package/dist/cjs/utils/document-text/index.js +43 -0
- package/dist/cjs/utils/split-text-by-new-line/index.js +12 -0
- package/dist/es2019/accessibility/index.js +1 -0
- package/dist/es2019/accessibility/styled.js +5 -0
- package/dist/es2019/analytics/constants.js +21 -0
- package/dist/es2019/analytics/index.js +5 -0
- package/dist/es2019/analytics/listener/analytics-web-client-wrapper.js +57 -0
- package/dist/es2019/analytics/listener/handle-event.js +15 -0
- package/dist/es2019/analytics/listener/helpers/logger.js +49 -0
- package/dist/es2019/analytics/listener/index.js +7 -0
- package/dist/es2019/analytics/listener/jql-editor-analytics-listener.js +30 -0
- package/dist/es2019/analytics/listener/process-event-payload.js +29 -0
- package/dist/es2019/analytics/listener/types.js +1 -0
- package/dist/es2019/analytics/types.js +1 -0
- package/dist/es2019/analytics/util.js +4 -0
- package/dist/es2019/async.js +19 -0
- package/dist/es2019/commands/select-error-command/index.js +23 -0
- package/dist/es2019/common/constants.js +5 -0
- package/dist/es2019/common/messages.js +8 -0
- package/dist/es2019/common/styled.js +19 -0
- package/dist/es2019/hooks/use-editor-theme/index.js +33 -0
- package/dist/es2019/hooks/use-editor-view-has-infos/index.js +8 -0
- package/dist/es2019/hooks/use-editor-view-has-warnings/index.js +9 -0
- package/dist/es2019/hooks/use-editor-view-is-invalid/index.js +38 -0
- package/dist/es2019/i18n/cs.js +62 -0
- package/dist/es2019/i18n/da.js +62 -0
- package/dist/es2019/i18n/de.js +62 -0
- package/dist/es2019/i18n/en.js +62 -0
- package/dist/es2019/i18n/en_GB.js +62 -0
- package/dist/es2019/i18n/en_ZZ.js +62 -0
- package/dist/es2019/i18n/es.js +62 -0
- package/dist/es2019/i18n/et.js +8 -0
- package/dist/es2019/i18n/fi.js +62 -0
- package/dist/es2019/i18n/fr.js +62 -0
- package/dist/es2019/i18n/hu.js +62 -0
- package/dist/es2019/i18n/index.js +24 -0
- package/dist/es2019/i18n/it.js +62 -0
- package/dist/es2019/i18n/ja.js +62 -0
- package/dist/es2019/i18n/ko.js +62 -0
- package/dist/es2019/i18n/nb.js +62 -0
- package/dist/es2019/i18n/nl.js +62 -0
- package/dist/es2019/i18n/pl.js +62 -0
- package/dist/es2019/i18n/pt_BR.js +62 -0
- package/dist/es2019/i18n/pt_PT.js +8 -0
- package/dist/es2019/i18n/ru.js +62 -0
- package/dist/es2019/i18n/sk.js +8 -0
- package/dist/es2019/i18n/sv.js +62 -0
- package/dist/es2019/i18n/th.js +62 -0
- package/dist/es2019/i18n/tr.js +62 -0
- package/dist/es2019/i18n/uk.js +62 -0
- package/dist/es2019/i18n/vi.js +62 -0
- package/dist/es2019/i18n/zh.js +62 -0
- package/dist/es2019/i18n/zh_TW.js +62 -0
- package/dist/es2019/index.js +4 -0
- package/dist/es2019/plugins/autocomplete/components/autocomplete/index.js +33 -0
- package/dist/es2019/plugins/autocomplete/components/autocomplete-dropdown/index.js +245 -0
- package/dist/es2019/plugins/autocomplete/components/autocomplete-dropdown/styled.js +46 -0
- package/dist/es2019/plugins/autocomplete/components/autocomplete-option/glyphs.js +80 -0
- package/dist/es2019/plugins/autocomplete/components/autocomplete-option/index.js +159 -0
- package/dist/es2019/plugins/autocomplete/components/autocomplete-option/messages.js +13 -0
- package/dist/es2019/plugins/autocomplete/components/autocomplete-option/styled.js +51 -0
- package/dist/es2019/plugins/autocomplete/components/types.js +1 -0
- package/dist/es2019/plugins/autocomplete/constants.js +21 -0
- package/dist/es2019/plugins/autocomplete/index.js +36 -0
- package/dist/es2019/plugins/autocomplete/messages.js +8 -0
- package/dist/es2019/plugins/autocomplete/types.js +1 -0
- package/dist/es2019/plugins/autocomplete/view.js +102 -0
- package/dist/es2019/plugins/common/get-document-position/index.js +92 -0
- package/dist/es2019/plugins/common/plugin-keymap.js +30 -0
- package/dist/es2019/plugins/common/react-plugin-view.js +67 -0
- package/dist/es2019/plugins/index.js +5 -0
- package/dist/es2019/plugins/jql-ast/JQLEditorErrorStrategy.js +183 -0
- package/dist/es2019/plugins/jql-ast/constants.js +9 -0
- package/dist/es2019/plugins/jql-ast/error-handlers/CustomFieldRuleErrorHandler.js +8 -0
- package/dist/es2019/plugins/jql-ast/error-handlers/ExpectedTokensErrorHandler.js +53 -0
- package/dist/es2019/plugins/jql-ast/error-handlers/FieldPropertyIdErrorHandler.js +12 -0
- package/dist/es2019/plugins/jql-ast/error-handlers/FieldRuleErrorHandler.js +15 -0
- package/dist/es2019/plugins/jql-ast/error-handlers/FunctionArgumentRuleErrorHandler.js +12 -0
- package/dist/es2019/plugins/jql-ast/error-handlers/OperandRuleErrorHandler.js +61 -0
- package/dist/es2019/plugins/jql-ast/error-handlers/OperatorRuleErrorHandler.js +13 -0
- package/dist/es2019/plugins/jql-ast/index.js +40 -0
- package/dist/es2019/plugins/jql-ast/messages.js +173 -0
- package/dist/es2019/plugins/jql-ast/utils.js +13 -0
- package/dist/es2019/plugins/jql-syntax-highlighting/index.js +59 -0
- package/dist/es2019/plugins/jql-syntax-highlighting/types.js +1 -0
- package/dist/es2019/plugins/jql-syntax-highlighting/visitor.js +55 -0
- package/dist/es2019/plugins/rich-inline-nodes/constants.js +3 -0
- package/dist/es2019/plugins/rich-inline-nodes/index.js +48 -0
- package/dist/es2019/plugins/rich-inline-nodes/nodes/index.js +4 -0
- package/dist/es2019/plugins/rich-inline-nodes/nodes/types.js +1 -0
- package/dist/es2019/plugins/rich-inline-nodes/nodes/user/index.js +32 -0
- package/dist/es2019/plugins/rich-inline-nodes/nodes/user/styled.js +77 -0
- package/dist/es2019/plugins/rich-inline-nodes/types.js +1 -0
- package/dist/es2019/plugins/rich-inline-nodes/util/create-node-spec.js +26 -0
- package/dist/es2019/plugins/rich-inline-nodes/util/react-node-view.js +101 -0
- package/dist/es2019/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +104 -0
- package/dist/es2019/plugins/types.js +1 -0
- package/dist/es2019/plugins/validation-tooltip/constants.js +5 -0
- package/dist/es2019/plugins/validation-tooltip/index.js +52 -0
- package/dist/es2019/plugins/validation-tooltip/view.js +55 -0
- package/dist/es2019/schema/index.js +117 -0
- package/dist/es2019/state/analytics/index.js +49 -0
- package/dist/es2019/state/autocomplete/index.js +15 -0
- package/dist/es2019/state/hydration/index.js +63 -0
- package/dist/es2019/state/hydration/util.js +57 -0
- package/dist/es2019/state/index.js +968 -0
- package/dist/es2019/state/types.js +1 -0
- package/dist/es2019/state/util.js +144 -0
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/ui/error-boundary/index.js +55 -0
- package/dist/es2019/ui/index.js +4 -0
- package/dist/es2019/ui/intl-provider/index.js +16 -0
- package/dist/es2019/ui/jql-editor/index.js +63 -0
- package/dist/es2019/ui/jql-editor/types.js +1 -0
- package/dist/es2019/ui/jql-editor-controls-content/base-expand-toggle/index.js +48 -0
- package/dist/es2019/ui/jql-editor-controls-content/base-expand-toggle/styled.js +20 -0
- package/dist/es2019/ui/jql-editor-controls-content/base-search/index.js +35 -0
- package/dist/es2019/ui/jql-editor-controls-content/base-syntax-help/index.js +27 -0
- package/dist/es2019/ui/jql-editor-controls-content/base-syntax-help/styled.js +29 -0
- package/dist/es2019/ui/jql-editor-controls-content/expand-toggle/index.js +51 -0
- package/dist/es2019/ui/jql-editor-controls-content/expand-toggle/messages.js +18 -0
- package/dist/es2019/ui/jql-editor-controls-content/index.js +11 -0
- package/dist/es2019/ui/jql-editor-controls-content/read-only-controls-content/index.js +29 -0
- package/dist/es2019/ui/jql-editor-controls-content/search/index.js +26 -0
- package/dist/es2019/ui/jql-editor-controls-content/search/messages.js +8 -0
- package/dist/es2019/ui/jql-editor-controls-content/syntax-help/index.js +44 -0
- package/dist/es2019/ui/jql-editor-controls-content/syntax-help/messages.js +13 -0
- package/dist/es2019/ui/jql-editor-footer-content/index.js +28 -0
- package/dist/es2019/ui/jql-editor-footer-content/jql-editor-help/index.js +27 -0
- package/dist/es2019/ui/jql-editor-footer-content/jql-editor-help/messages.js +18 -0
- package/dist/es2019/ui/jql-editor-footer-content/jql-editor-help/styled.js +23 -0
- package/dist/es2019/ui/jql-editor-footer-content/jql-messages/errors/index.js +55 -0
- package/dist/es2019/ui/jql-editor-footer-content/jql-messages/errors/messages.js +8 -0
- package/dist/es2019/ui/jql-editor-footer-content/jql-messages/format/index.js +29 -0
- package/dist/es2019/ui/jql-editor-footer-content/jql-messages/format/styled.js +8 -0
- package/dist/es2019/ui/jql-editor-footer-content/jql-messages/index.js +3 -0
- package/dist/es2019/ui/jql-editor-footer-content/jql-messages/infos/index.js +30 -0
- package/dist/es2019/ui/jql-editor-footer-content/jql-messages/warnings/index.js +84 -0
- package/dist/es2019/ui/jql-editor-footer-content/jql-messages/warnings/messages.js +18 -0
- package/dist/es2019/ui/jql-editor-layout/index.js +100 -0
- package/dist/es2019/ui/jql-editor-layout/styled.js +223 -0
- package/dist/es2019/ui/jql-editor-portal-provider/context.js +8 -0
- package/dist/es2019/ui/jql-editor-portal-provider/index.js +99 -0
- package/dist/es2019/ui/jql-editor-portal-provider/types.js +1 -0
- package/dist/es2019/ui/jql-editor-view/index.js +167 -0
- package/dist/es2019/ui/messages.js +8 -0
- package/dist/es2019/ui/tooltip-tag/index.js +8 -0
- package/dist/es2019/ui/tooltip-tag/styled.js +4 -0
- package/dist/es2019/ui/types.js +1 -0
- package/dist/es2019/utils/document-text/index.js +37 -0
- package/dist/es2019/utils/split-text-by-new-line/index.js +4 -0
- package/dist/esm/accessibility/index.js +1 -0
- package/dist/esm/accessibility/styled.js +5 -0
- package/dist/esm/analytics/constants.js +21 -0
- package/dist/esm/analytics/index.js +5 -0
- package/dist/esm/analytics/listener/analytics-web-client-wrapper.js +70 -0
- package/dist/esm/analytics/listener/handle-event.js +15 -0
- package/dist/esm/analytics/listener/helpers/logger.js +83 -0
- package/dist/esm/analytics/listener/index.js +7 -0
- package/dist/esm/analytics/listener/jql-editor-analytics-listener.js +48 -0
- package/dist/esm/analytics/listener/process-event-payload.js +39 -0
- package/dist/esm/analytics/listener/types.js +1 -0
- package/dist/esm/analytics/types.js +1 -0
- package/dist/esm/analytics/util.js +4 -0
- package/dist/esm/async.js +22 -0
- package/dist/esm/commands/select-error-command/index.js +23 -0
- package/dist/esm/common/constants.js +5 -0
- package/dist/esm/common/messages.js +8 -0
- package/dist/esm/common/styled.js +9 -0
- package/dist/esm/hooks/use-editor-theme/index.js +46 -0
- package/dist/esm/hooks/use-editor-view-has-infos/index.js +9 -0
- package/dist/esm/hooks/use-editor-view-has-warnings/index.js +12 -0
- package/dist/esm/hooks/use-editor-view-is-invalid/index.js +46 -0
- package/dist/esm/i18n/cs.js +62 -0
- package/dist/esm/i18n/da.js +62 -0
- package/dist/esm/i18n/de.js +62 -0
- package/dist/esm/i18n/en.js +62 -0
- package/dist/esm/i18n/en_GB.js +62 -0
- package/dist/esm/i18n/en_ZZ.js +62 -0
- package/dist/esm/i18n/es.js +62 -0
- package/dist/esm/i18n/et.js +8 -0
- package/dist/esm/i18n/fi.js +62 -0
- package/dist/esm/i18n/fr.js +62 -0
- package/dist/esm/i18n/hu.js +62 -0
- package/dist/esm/i18n/index.js +24 -0
- package/dist/esm/i18n/it.js +62 -0
- package/dist/esm/i18n/ja.js +62 -0
- package/dist/esm/i18n/ko.js +62 -0
- package/dist/esm/i18n/nb.js +62 -0
- package/dist/esm/i18n/nl.js +62 -0
- package/dist/esm/i18n/pl.js +62 -0
- package/dist/esm/i18n/pt_BR.js +62 -0
- package/dist/esm/i18n/pt_PT.js +8 -0
- package/dist/esm/i18n/ru.js +62 -0
- package/dist/esm/i18n/sk.js +8 -0
- package/dist/esm/i18n/sv.js +62 -0
- package/dist/esm/i18n/th.js +62 -0
- package/dist/esm/i18n/tr.js +62 -0
- package/dist/esm/i18n/uk.js +62 -0
- package/dist/esm/i18n/vi.js +62 -0
- package/dist/esm/i18n/zh.js +62 -0
- package/dist/esm/i18n/zh_TW.js +62 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/plugins/autocomplete/components/autocomplete/index.js +38 -0
- package/dist/esm/plugins/autocomplete/components/autocomplete-dropdown/index.js +268 -0
- package/dist/esm/plugins/autocomplete/components/autocomplete-dropdown/styled.js +16 -0
- package/dist/esm/plugins/autocomplete/components/autocomplete-option/glyphs.js +98 -0
- package/dist/esm/plugins/autocomplete/components/autocomplete-option/index.js +165 -0
- package/dist/esm/plugins/autocomplete/components/autocomplete-option/messages.js +13 -0
- package/dist/esm/plugins/autocomplete/components/autocomplete-option/styled.js +21 -0
- package/dist/esm/plugins/autocomplete/components/types.js +1 -0
- package/dist/esm/plugins/autocomplete/constants.js +29 -0
- package/dist/esm/plugins/autocomplete/index.js +30 -0
- package/dist/esm/plugins/autocomplete/messages.js +8 -0
- package/dist/esm/plugins/autocomplete/types.js +1 -0
- package/dist/esm/plugins/autocomplete/view.js +120 -0
- package/dist/esm/plugins/common/get-document-position/index.js +93 -0
- package/dist/esm/plugins/common/plugin-keymap.js +43 -0
- package/dist/esm/plugins/common/react-plugin-view.js +84 -0
- package/dist/esm/plugins/index.js +5 -0
- package/dist/esm/plugins/jql-ast/JQLEditorErrorStrategy.js +212 -0
- package/dist/esm/plugins/jql-ast/constants.js +9 -0
- package/dist/esm/plugins/jql-ast/error-handlers/CustomFieldRuleErrorHandler.js +8 -0
- package/dist/esm/plugins/jql-ast/error-handlers/ExpectedTokensErrorHandler.js +57 -0
- package/dist/esm/plugins/jql-ast/error-handlers/FieldPropertyIdErrorHandler.js +12 -0
- package/dist/esm/plugins/jql-ast/error-handlers/FieldRuleErrorHandler.js +15 -0
- package/dist/esm/plugins/jql-ast/error-handlers/FunctionArgumentRuleErrorHandler.js +12 -0
- package/dist/esm/plugins/jql-ast/error-handlers/OperandRuleErrorHandler.js +61 -0
- package/dist/esm/plugins/jql-ast/error-handlers/OperatorRuleErrorHandler.js +13 -0
- package/dist/esm/plugins/jql-ast/index.js +39 -0
- package/dist/esm/plugins/jql-ast/messages.js +173 -0
- package/dist/esm/plugins/jql-ast/utils.js +17 -0
- package/dist/esm/plugins/jql-syntax-highlighting/index.js +62 -0
- package/dist/esm/plugins/jql-syntax-highlighting/types.js +1 -0
- package/dist/esm/plugins/jql-syntax-highlighting/visitor.js +82 -0
- package/dist/esm/plugins/rich-inline-nodes/constants.js +3 -0
- package/dist/esm/plugins/rich-inline-nodes/index.js +56 -0
- package/dist/esm/plugins/rich-inline-nodes/nodes/index.js +4 -0
- package/dist/esm/plugins/rich-inline-nodes/nodes/types.js +1 -0
- package/dist/esm/plugins/rich-inline-nodes/nodes/user/index.js +34 -0
- package/dist/esm/plugins/rich-inline-nodes/nodes/user/styled.js +28 -0
- package/dist/esm/plugins/rich-inline-nodes/types.js +1 -0
- package/dist/esm/plugins/rich-inline-nodes/util/create-node-spec.js +30 -0
- package/dist/esm/plugins/rich-inline-nodes/util/react-node-view.js +119 -0
- package/dist/esm/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +131 -0
- package/dist/esm/plugins/types.js +1 -0
- package/dist/esm/plugins/validation-tooltip/constants.js +5 -0
- package/dist/esm/plugins/validation-tooltip/index.js +52 -0
- package/dist/esm/plugins/validation-tooltip/view.js +67 -0
- package/dist/esm/schema/index.js +129 -0
- package/dist/esm/state/analytics/index.js +50 -0
- package/dist/esm/state/autocomplete/index.js +17 -0
- package/dist/esm/state/hydration/index.js +85 -0
- package/dist/esm/state/hydration/util.js +83 -0
- package/dist/esm/state/index.js +991 -0
- package/dist/esm/state/types.js +1 -0
- package/dist/esm/state/util.js +169 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/ui/error-boundary/index.js +73 -0
- package/dist/esm/ui/index.js +4 -0
- package/dist/esm/ui/intl-provider/index.js +16 -0
- package/dist/esm/ui/jql-editor/index.js +63 -0
- package/dist/esm/ui/jql-editor/types.js +1 -0
- package/dist/esm/ui/jql-editor-controls-content/base-expand-toggle/index.js +49 -0
- package/dist/esm/ui/jql-editor-controls-content/base-expand-toggle/styled.js +5 -0
- package/dist/esm/ui/jql-editor-controls-content/base-search/index.js +34 -0
- package/dist/esm/ui/jql-editor-controls-content/base-syntax-help/index.js +26 -0
- package/dist/esm/ui/jql-editor-controls-content/base-syntax-help/styled.js +5 -0
- package/dist/esm/ui/jql-editor-controls-content/expand-toggle/index.js +55 -0
- package/dist/esm/ui/jql-editor-controls-content/expand-toggle/messages.js +18 -0
- package/dist/esm/ui/jql-editor-controls-content/index.js +10 -0
- package/dist/esm/ui/jql-editor-controls-content/read-only-controls-content/index.js +28 -0
- package/dist/esm/ui/jql-editor-controls-content/search/index.js +31 -0
- package/dist/esm/ui/jql-editor-controls-content/search/messages.js +8 -0
- package/dist/esm/ui/jql-editor-controls-content/syntax-help/index.js +50 -0
- package/dist/esm/ui/jql-editor-controls-content/syntax-help/messages.js +13 -0
- package/dist/esm/ui/jql-editor-footer-content/index.js +28 -0
- package/dist/esm/ui/jql-editor-footer-content/jql-editor-help/index.js +35 -0
- package/dist/esm/ui/jql-editor-footer-content/jql-editor-help/messages.js +18 -0
- package/dist/esm/ui/jql-editor-footer-content/jql-editor-help/styled.js +8 -0
- package/dist/esm/ui/jql-editor-footer-content/jql-messages/errors/index.js +60 -0
- package/dist/esm/ui/jql-editor-footer-content/jql-messages/errors/messages.js +8 -0
- package/dist/esm/ui/jql-editor-footer-content/jql-messages/format/index.js +28 -0
- package/dist/esm/ui/jql-editor-footer-content/jql-messages/format/styled.js +7 -0
- package/dist/esm/ui/jql-editor-footer-content/jql-messages/index.js +3 -0
- package/dist/esm/ui/jql-editor-footer-content/jql-messages/infos/index.js +31 -0
- package/dist/esm/ui/jql-editor-footer-content/jql-messages/warnings/index.js +100 -0
- package/dist/esm/ui/jql-editor-footer-content/jql-messages/warnings/messages.js +18 -0
- package/dist/esm/ui/jql-editor-layout/index.js +98 -0
- package/dist/esm/ui/jql-editor-layout/styled.js +56 -0
- package/dist/esm/ui/jql-editor-portal-provider/context.js +10 -0
- package/dist/esm/ui/jql-editor-portal-provider/index.js +107 -0
- package/dist/esm/ui/jql-editor-portal-provider/types.js +1 -0
- package/dist/esm/ui/jql-editor-view/index.js +190 -0
- package/dist/esm/ui/messages.js +8 -0
- package/dist/esm/ui/tooltip-tag/index.js +10 -0
- package/dist/esm/ui/tooltip-tag/styled.js +4 -0
- package/dist/esm/ui/types.js +1 -0
- package/dist/esm/utils/document-text/index.js +37 -0
- package/dist/esm/utils/split-text-by-new-line/index.js +6 -0
- package/dist/types/accessibility/index.d.ts +1 -0
- package/dist/types/accessibility/styled.d.ts +2 -0
- package/dist/types/analytics/constants.d.ts +18 -0
- package/dist/types/analytics/index.d.ts +7 -0
- package/dist/types/analytics/listener/analytics-web-client-wrapper.d.ts +9 -0
- package/dist/types/analytics/listener/handle-event.d.ts +9 -0
- package/dist/types/analytics/listener/helpers/logger.d.ts +24 -0
- package/dist/types/analytics/listener/index.d.ts +7 -0
- package/dist/types/analytics/listener/jql-editor-analytics-listener.d.ts +20 -0
- package/dist/types/analytics/listener/process-event-payload.d.ts +8 -0
- package/dist/types/analytics/listener/types.d.ts +7 -0
- package/dist/types/analytics/types.d.ts +3 -0
- package/dist/types/analytics/util.d.ts +4 -0
- package/dist/types/async.d.ts +3 -0
- package/dist/types/commands/select-error-command/index.d.ts +5 -0
- package/dist/types/common/constants.d.ts +5 -0
- package/dist/types/common/messages.d.ts +7 -0
- package/dist/types/common/styled.d.ts +3 -0
- package/dist/types/hooks/use-editor-theme/index.d.ts +38 -0
- package/dist/types/hooks/use-editor-view-has-infos/index.d.ts +1 -0
- package/dist/types/hooks/use-editor-view-has-warnings/index.d.ts +1 -0
- package/dist/types/hooks/use-editor-view-is-invalid/index.d.ts +11 -0
- package/dist/types/i18n/cs.d.ts +61 -0
- package/dist/types/i18n/da.d.ts +61 -0
- package/dist/types/i18n/de.d.ts +61 -0
- package/dist/types/i18n/en.d.ts +61 -0
- package/dist/types/i18n/en_GB.d.ts +61 -0
- package/dist/types/i18n/en_ZZ.d.ts +61 -0
- package/dist/types/i18n/es.d.ts +61 -0
- package/dist/types/i18n/et.d.ts +8 -0
- package/dist/types/i18n/fi.d.ts +61 -0
- package/dist/types/i18n/fr.d.ts +61 -0
- package/dist/types/i18n/hu.d.ts +61 -0
- package/dist/types/i18n/index.d.ts +24 -0
- package/dist/types/i18n/it.d.ts +61 -0
- package/dist/types/i18n/ja.d.ts +61 -0
- package/dist/types/i18n/ko.d.ts +61 -0
- package/dist/types/i18n/nb.d.ts +61 -0
- package/dist/types/i18n/nl.d.ts +61 -0
- package/dist/types/i18n/pl.d.ts +61 -0
- package/dist/types/i18n/pt_BR.d.ts +61 -0
- package/dist/types/i18n/pt_PT.d.ts +8 -0
- package/dist/types/i18n/ru.d.ts +61 -0
- package/dist/types/i18n/sk.d.ts +8 -0
- package/dist/types/i18n/sv.d.ts +61 -0
- package/dist/types/i18n/th.d.ts +61 -0
- package/dist/types/i18n/tr.d.ts +61 -0
- package/dist/types/i18n/uk.d.ts +61 -0
- package/dist/types/i18n/vi.d.ts +61 -0
- package/dist/types/i18n/zh.d.ts +61 -0
- package/dist/types/i18n/zh_TW.d.ts +61 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/plugins/autocomplete/components/autocomplete/index.d.ts +4 -0
- package/dist/types/plugins/autocomplete/components/autocomplete-dropdown/index.d.ts +11 -0
- package/dist/types/plugins/autocomplete/components/autocomplete-dropdown/styled.d.ts +9 -0
- package/dist/types/plugins/autocomplete/components/autocomplete-option/glyphs.d.ts +10 -0
- package/dist/types/plugins/autocomplete/components/autocomplete-option/index.d.ts +10 -0
- package/dist/types/plugins/autocomplete/components/autocomplete-option/messages.d.ts +12 -0
- package/dist/types/plugins/autocomplete/components/autocomplete-option/styled.d.ts +11 -0
- package/dist/types/plugins/autocomplete/components/types.d.ts +38 -0
- package/dist/types/plugins/autocomplete/constants.d.ts +14 -0
- package/dist/types/plugins/autocomplete/index.d.ts +4 -0
- package/dist/types/plugins/autocomplete/messages.d.ts +7 -0
- package/dist/types/plugins/autocomplete/types.d.ts +1 -0
- package/dist/types/plugins/autocomplete/view.d.ts +19 -0
- package/dist/types/plugins/common/get-document-position/index.d.ts +9 -0
- package/dist/types/plugins/common/plugin-keymap.d.ts +7 -0
- package/dist/types/plugins/common/react-plugin-view.d.ts +48 -0
- package/dist/types/plugins/index.d.ts +5 -0
- package/dist/types/plugins/jql-ast/JQLEditorErrorStrategy.d.ts +17 -0
- package/dist/types/plugins/jql-ast/constants.d.ts +3 -0
- package/dist/types/plugins/jql-ast/error-handlers/CustomFieldRuleErrorHandler.d.ts +5 -0
- package/dist/types/plugins/jql-ast/error-handlers/ExpectedTokensErrorHandler.d.ts +11 -0
- package/dist/types/plugins/jql-ast/error-handlers/FieldPropertyIdErrorHandler.d.ts +6 -0
- package/dist/types/plugins/jql-ast/error-handlers/FieldRuleErrorHandler.d.ts +6 -0
- package/dist/types/plugins/jql-ast/error-handlers/FunctionArgumentRuleErrorHandler.d.ts +6 -0
- package/dist/types/plugins/jql-ast/error-handlers/OperandRuleErrorHandler.d.ts +9 -0
- package/dist/types/plugins/jql-ast/error-handlers/OperatorRuleErrorHandler.d.ts +6 -0
- package/dist/types/plugins/jql-ast/index.d.ts +7 -0
- package/dist/types/plugins/jql-ast/messages.d.ts +172 -0
- package/dist/types/plugins/jql-ast/utils.d.ts +4 -0
- package/dist/types/plugins/jql-syntax-highlighting/index.d.ts +4 -0
- package/dist/types/plugins/jql-syntax-highlighting/types.d.ts +5 -0
- package/dist/types/plugins/jql-syntax-highlighting/visitor.d.ts +19 -0
- package/dist/types/plugins/rich-inline-nodes/constants.d.ts +3 -0
- package/dist/types/plugins/rich-inline-nodes/index.d.ts +4 -0
- package/dist/types/plugins/rich-inline-nodes/nodes/index.d.ts +3 -0
- package/dist/types/plugins/rich-inline-nodes/nodes/types.d.ts +9 -0
- package/dist/types/plugins/rich-inline-nodes/nodes/user/index.d.ts +7 -0
- package/dist/types/plugins/rich-inline-nodes/nodes/user/styled.d.ts +7 -0
- package/dist/types/plugins/rich-inline-nodes/types.d.ts +2 -0
- package/dist/types/plugins/rich-inline-nodes/util/create-node-spec.d.ts +4 -0
- package/dist/types/plugins/rich-inline-nodes/util/react-node-view.d.ts +24 -0
- package/dist/types/plugins/rich-inline-nodes/util/replace-nodes-transaction.d.ts +3 -0
- package/dist/types/plugins/types.d.ts +16 -0
- package/dist/types/plugins/validation-tooltip/constants.d.ts +5 -0
- package/dist/types/plugins/validation-tooltip/index.d.ts +3 -0
- package/dist/types/plugins/validation-tooltip/view.d.ts +18 -0
- package/dist/types/schema/index.d.ts +28 -0
- package/dist/types/state/analytics/index.d.ts +9 -0
- package/dist/types/state/autocomplete/index.d.ts +4 -0
- package/dist/types/state/hydration/index.d.ts +3 -0
- package/dist/types/state/hydration/util.d.ts +23 -0
- package/dist/types/state/index.d.ts +796 -0
- package/dist/types/state/types.d.ts +242 -0
- package/dist/types/state/util.d.ts +16 -0
- package/dist/types/types.d.ts +5 -0
- package/dist/types/ui/error-boundary/index.d.ts +25 -0
- package/dist/types/ui/index.d.ts +4 -0
- package/dist/types/ui/intl-provider/index.d.ts +10 -0
- package/dist/types/ui/jql-editor/index.d.ts +13 -0
- package/dist/types/ui/jql-editor/types.d.ts +101 -0
- package/dist/types/ui/jql-editor-controls-content/base-expand-toggle/index.d.ts +10 -0
- package/dist/types/ui/jql-editor-controls-content/base-expand-toggle/styled.d.ts +2 -0
- package/dist/types/ui/jql-editor-controls-content/base-search/index.d.ts +9 -0
- package/dist/types/ui/jql-editor-controls-content/base-syntax-help/index.d.ts +9 -0
- package/dist/types/ui/jql-editor-controls-content/base-syntax-help/styled.d.ts +2 -0
- package/dist/types/ui/jql-editor-controls-content/expand-toggle/index.d.ts +2 -0
- package/dist/types/ui/jql-editor-controls-content/expand-toggle/messages.d.ts +17 -0
- package/dist/types/ui/jql-editor-controls-content/index.d.ts +2 -0
- package/dist/types/ui/jql-editor-controls-content/read-only-controls-content/index.d.ts +2 -0
- package/dist/types/ui/jql-editor-controls-content/search/index.d.ts +2 -0
- package/dist/types/ui/jql-editor-controls-content/search/messages.d.ts +7 -0
- package/dist/types/ui/jql-editor-controls-content/syntax-help/index.d.ts +2 -0
- package/dist/types/ui/jql-editor-controls-content/syntax-help/messages.d.ts +12 -0
- package/dist/types/ui/jql-editor-footer-content/index.d.ts +6 -0
- package/dist/types/ui/jql-editor-footer-content/jql-editor-help/index.d.ts +2 -0
- package/dist/types/ui/jql-editor-footer-content/jql-editor-help/messages.d.ts +17 -0
- package/dist/types/ui/jql-editor-footer-content/jql-editor-help/styled.d.ts +6 -0
- package/dist/types/ui/jql-editor-footer-content/jql-messages/errors/index.d.ts +2 -0
- package/dist/types/ui/jql-editor-footer-content/jql-messages/errors/messages.d.ts +7 -0
- package/dist/types/ui/jql-editor-footer-content/jql-messages/format/index.d.ts +8 -0
- package/dist/types/ui/jql-editor-footer-content/jql-messages/format/styled.d.ts +5 -0
- package/dist/types/ui/jql-editor-footer-content/jql-messages/index.d.ts +3 -0
- package/dist/types/ui/jql-editor-footer-content/jql-messages/infos/index.d.ts +3 -0
- package/dist/types/ui/jql-editor-footer-content/jql-messages/warnings/index.d.ts +3 -0
- package/dist/types/ui/jql-editor-footer-content/jql-messages/warnings/messages.d.ts +17 -0
- package/dist/types/ui/jql-editor-layout/index.d.ts +64 -0
- package/dist/types/ui/jql-editor-layout/styled.d.ts +65 -0
- package/dist/types/ui/jql-editor-portal-provider/context.d.ts +4 -0
- package/dist/types/ui/jql-editor-portal-provider/index.d.ts +7 -0
- package/dist/types/ui/jql-editor-portal-provider/types.d.ts +38 -0
- package/dist/types/ui/jql-editor-view/index.d.ts +10 -0
- package/dist/types/ui/messages.d.ts +7 -0
- package/dist/types/ui/tooltip-tag/index.d.ts +2 -0
- package/dist/types/ui/tooltip-tag/styled.d.ts +2 -0
- package/dist/types/ui/types.d.ts +9 -0
- package/dist/types/utils/document-text/index.d.ts +9 -0
- package/dist/types/utils/split-text-by-new-line/index.d.ts +4 -0
- package/dist/types-ts4.5/accessibility/index.d.ts +1 -0
- package/dist/types-ts4.5/accessibility/styled.d.ts +2 -0
- package/dist/types-ts4.5/analytics/constants.d.ts +18 -0
- package/dist/types-ts4.5/analytics/index.d.ts +7 -0
- package/dist/types-ts4.5/analytics/listener/analytics-web-client-wrapper.d.ts +9 -0
- package/dist/types-ts4.5/analytics/listener/handle-event.d.ts +9 -0
- package/dist/types-ts4.5/analytics/listener/helpers/logger.d.ts +24 -0
- package/dist/types-ts4.5/analytics/listener/index.d.ts +7 -0
- package/dist/types-ts4.5/analytics/listener/jql-editor-analytics-listener.d.ts +20 -0
- package/dist/types-ts4.5/analytics/listener/process-event-payload.d.ts +8 -0
- package/dist/types-ts4.5/analytics/listener/types.d.ts +7 -0
- package/dist/types-ts4.5/analytics/types.d.ts +3 -0
- package/dist/types-ts4.5/analytics/util.d.ts +4 -0
- package/dist/types-ts4.5/async.d.ts +3 -0
- package/dist/types-ts4.5/commands/select-error-command/index.d.ts +5 -0
- package/dist/types-ts4.5/common/constants.d.ts +5 -0
- package/dist/types-ts4.5/common/messages.d.ts +7 -0
- package/dist/types-ts4.5/common/styled.d.ts +3 -0
- package/dist/types-ts4.5/hooks/use-editor-theme/index.d.ts +38 -0
- package/dist/types-ts4.5/hooks/use-editor-view-has-infos/index.d.ts +1 -0
- package/dist/types-ts4.5/hooks/use-editor-view-has-warnings/index.d.ts +1 -0
- package/dist/types-ts4.5/hooks/use-editor-view-is-invalid/index.d.ts +11 -0
- package/dist/types-ts4.5/i18n/cs.d.ts +61 -0
- package/dist/types-ts4.5/i18n/da.d.ts +61 -0
- package/dist/types-ts4.5/i18n/de.d.ts +61 -0
- package/dist/types-ts4.5/i18n/en.d.ts +61 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +61 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +61 -0
- package/dist/types-ts4.5/i18n/es.d.ts +61 -0
- package/dist/types-ts4.5/i18n/et.d.ts +8 -0
- package/dist/types-ts4.5/i18n/fi.d.ts +61 -0
- package/dist/types-ts4.5/i18n/fr.d.ts +61 -0
- package/dist/types-ts4.5/i18n/hu.d.ts +61 -0
- package/dist/types-ts4.5/i18n/index.d.ts +24 -0
- package/dist/types-ts4.5/i18n/it.d.ts +61 -0
- package/dist/types-ts4.5/i18n/ja.d.ts +61 -0
- package/dist/types-ts4.5/i18n/ko.d.ts +61 -0
- package/dist/types-ts4.5/i18n/nb.d.ts +61 -0
- package/dist/types-ts4.5/i18n/nl.d.ts +61 -0
- package/dist/types-ts4.5/i18n/pl.d.ts +61 -0
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +61 -0
- package/dist/types-ts4.5/i18n/pt_PT.d.ts +8 -0
- package/dist/types-ts4.5/i18n/ru.d.ts +61 -0
- package/dist/types-ts4.5/i18n/sk.d.ts +8 -0
- package/dist/types-ts4.5/i18n/sv.d.ts +61 -0
- package/dist/types-ts4.5/i18n/th.d.ts +61 -0
- package/dist/types-ts4.5/i18n/tr.d.ts +61 -0
- package/dist/types-ts4.5/i18n/uk.d.ts +61 -0
- package/dist/types-ts4.5/i18n/vi.d.ts +61 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +61 -0
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +61 -0
- package/dist/types-ts4.5/index.d.ts +5 -0
- package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-dropdown/index.d.ts +11 -0
- package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-dropdown/styled.d.ts +9 -0
- package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-option/glyphs.d.ts +10 -0
- package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-option/index.d.ts +10 -0
- package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-option/messages.d.ts +12 -0
- package/dist/types-ts4.5/plugins/autocomplete/components/autocomplete-option/styled.d.ts +11 -0
- package/dist/types-ts4.5/plugins/autocomplete/components/types.d.ts +38 -0
- package/dist/types-ts4.5/plugins/autocomplete/constants.d.ts +14 -0
- package/dist/types-ts4.5/plugins/autocomplete/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/autocomplete/messages.d.ts +7 -0
- package/dist/types-ts4.5/plugins/autocomplete/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/autocomplete/view.d.ts +19 -0
- package/dist/types-ts4.5/plugins/common/get-document-position/index.d.ts +9 -0
- package/dist/types-ts4.5/plugins/common/plugin-keymap.d.ts +7 -0
- package/dist/types-ts4.5/plugins/common/react-plugin-view.d.ts +48 -0
- package/dist/types-ts4.5/plugins/index.d.ts +5 -0
- package/dist/types-ts4.5/plugins/jql-ast/JQLEditorErrorStrategy.d.ts +17 -0
- package/dist/types-ts4.5/plugins/jql-ast/constants.d.ts +3 -0
- package/dist/types-ts4.5/plugins/jql-ast/error-handlers/CustomFieldRuleErrorHandler.d.ts +5 -0
- package/dist/types-ts4.5/plugins/jql-ast/error-handlers/ExpectedTokensErrorHandler.d.ts +11 -0
- package/dist/types-ts4.5/plugins/jql-ast/error-handlers/FieldPropertyIdErrorHandler.d.ts +6 -0
- package/dist/types-ts4.5/plugins/jql-ast/error-handlers/FieldRuleErrorHandler.d.ts +6 -0
- package/dist/types-ts4.5/plugins/jql-ast/error-handlers/FunctionArgumentRuleErrorHandler.d.ts +6 -0
- package/dist/types-ts4.5/plugins/jql-ast/error-handlers/OperandRuleErrorHandler.d.ts +9 -0
- package/dist/types-ts4.5/plugins/jql-ast/error-handlers/OperatorRuleErrorHandler.d.ts +6 -0
- package/dist/types-ts4.5/plugins/jql-ast/index.d.ts +7 -0
- package/dist/types-ts4.5/plugins/jql-ast/messages.d.ts +172 -0
- package/dist/types-ts4.5/plugins/jql-ast/utils.d.ts +4 -0
- package/dist/types-ts4.5/plugins/jql-syntax-highlighting/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/jql-syntax-highlighting/types.d.ts +5 -0
- package/dist/types-ts4.5/plugins/jql-syntax-highlighting/visitor.d.ts +19 -0
- package/dist/types-ts4.5/plugins/rich-inline-nodes/constants.d.ts +3 -0
- package/dist/types-ts4.5/plugins/rich-inline-nodes/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/index.d.ts +3 -0
- package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/types.d.ts +9 -0
- package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/user/index.d.ts +7 -0
- package/dist/types-ts4.5/plugins/rich-inline-nodes/nodes/user/styled.d.ts +7 -0
- package/dist/types-ts4.5/plugins/rich-inline-nodes/types.d.ts +2 -0
- package/dist/types-ts4.5/plugins/rich-inline-nodes/util/create-node-spec.d.ts +4 -0
- package/dist/types-ts4.5/plugins/rich-inline-nodes/util/react-node-view.d.ts +24 -0
- package/dist/types-ts4.5/plugins/rich-inline-nodes/util/replace-nodes-transaction.d.ts +3 -0
- package/dist/types-ts4.5/plugins/types.d.ts +16 -0
- package/dist/types-ts4.5/plugins/validation-tooltip/constants.d.ts +5 -0
- package/dist/types-ts4.5/plugins/validation-tooltip/index.d.ts +3 -0
- package/dist/types-ts4.5/plugins/validation-tooltip/view.d.ts +18 -0
- package/dist/types-ts4.5/schema/index.d.ts +28 -0
- package/dist/types-ts4.5/state/analytics/index.d.ts +9 -0
- package/dist/types-ts4.5/state/autocomplete/index.d.ts +4 -0
- package/dist/types-ts4.5/state/hydration/index.d.ts +3 -0
- package/dist/types-ts4.5/state/hydration/util.d.ts +23 -0
- package/dist/types-ts4.5/state/index.d.ts +796 -0
- package/dist/types-ts4.5/state/types.d.ts +242 -0
- package/dist/types-ts4.5/state/util.d.ts +16 -0
- package/dist/types-ts4.5/types.d.ts +5 -0
- package/dist/types-ts4.5/ui/error-boundary/index.d.ts +25 -0
- package/dist/types-ts4.5/ui/index.d.ts +4 -0
- package/dist/types-ts4.5/ui/intl-provider/index.d.ts +10 -0
- package/dist/types-ts4.5/ui/jql-editor/index.d.ts +13 -0
- package/dist/types-ts4.5/ui/jql-editor/types.d.ts +101 -0
- package/dist/types-ts4.5/ui/jql-editor-controls-content/base-expand-toggle/index.d.ts +10 -0
- package/dist/types-ts4.5/ui/jql-editor-controls-content/base-expand-toggle/styled.d.ts +2 -0
- package/dist/types-ts4.5/ui/jql-editor-controls-content/base-search/index.d.ts +9 -0
- package/dist/types-ts4.5/ui/jql-editor-controls-content/base-syntax-help/index.d.ts +9 -0
- package/dist/types-ts4.5/ui/jql-editor-controls-content/base-syntax-help/styled.d.ts +2 -0
- package/dist/types-ts4.5/ui/jql-editor-controls-content/expand-toggle/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/jql-editor-controls-content/expand-toggle/messages.d.ts +17 -0
- package/dist/types-ts4.5/ui/jql-editor-controls-content/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/jql-editor-controls-content/read-only-controls-content/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/jql-editor-controls-content/search/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/jql-editor-controls-content/search/messages.d.ts +7 -0
- package/dist/types-ts4.5/ui/jql-editor-controls-content/syntax-help/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/jql-editor-controls-content/syntax-help/messages.d.ts +12 -0
- package/dist/types-ts4.5/ui/jql-editor-footer-content/index.d.ts +6 -0
- package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-editor-help/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-editor-help/messages.d.ts +17 -0
- package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-editor-help/styled.d.ts +6 -0
- package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/errors/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/errors/messages.d.ts +7 -0
- package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/format/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/format/styled.d.ts +5 -0
- package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/index.d.ts +3 -0
- package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/infos/index.d.ts +3 -0
- package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/warnings/index.d.ts +3 -0
- package/dist/types-ts4.5/ui/jql-editor-footer-content/jql-messages/warnings/messages.d.ts +17 -0
- package/dist/types-ts4.5/ui/jql-editor-layout/index.d.ts +64 -0
- package/dist/types-ts4.5/ui/jql-editor-layout/styled.d.ts +65 -0
- package/dist/types-ts4.5/ui/jql-editor-portal-provider/context.d.ts +4 -0
- package/dist/types-ts4.5/ui/jql-editor-portal-provider/index.d.ts +7 -0
- package/dist/types-ts4.5/ui/jql-editor-portal-provider/types.d.ts +38 -0
- package/dist/types-ts4.5/ui/jql-editor-view/index.d.ts +10 -0
- package/dist/types-ts4.5/ui/messages.d.ts +7 -0
- package/dist/types-ts4.5/ui/tooltip-tag/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/tooltip-tag/styled.d.ts +2 -0
- package/dist/types-ts4.5/ui/types.d.ts +9 -0
- package/dist/types-ts4.5/utils/document-text/index.d.ts +9 -0
- package/dist/types-ts4.5/utils/split-text-by-new-line/index.d.ts +4 -0
- package/i18n/package.json +15 -0
- package/package.json +127 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { DefaultErrorStrategy } from 'antlr4ts';
|
|
2
|
+
import padStart from 'lodash/padStart';
|
|
3
|
+
import { normaliseJqlString } from '@atlaskit/jql-ast';
|
|
4
|
+
import { JQLAutocomplete } from '@atlaskit/jql-autocomplete';
|
|
5
|
+
import { JQLLexer, JQLParser } from '@atlaskit/jql-parser';
|
|
6
|
+
import { ignoredTokens, preferredRules } from './constants';
|
|
7
|
+
import { handleCustomFieldRuleError } from './error-handlers/CustomFieldRuleErrorHandler';
|
|
8
|
+
import { handleExpectedTokensError } from './error-handlers/ExpectedTokensErrorHandler';
|
|
9
|
+
import { handleFieldPropertyIdRuleError } from './error-handlers/FieldPropertyIdErrorHandler';
|
|
10
|
+
import { handleFieldRuleError } from './error-handlers/FieldRuleErrorHandler';
|
|
11
|
+
import { handleFunctionArgumentRuleError } from './error-handlers/FunctionArgumentRuleErrorHandler';
|
|
12
|
+
import { handleOperandRuleError } from './error-handlers/OperandRuleErrorHandler';
|
|
13
|
+
import { handleOperatorRuleError } from './error-handlers/OperatorRuleErrorHandler';
|
|
14
|
+
import { errorMessages } from './messages';
|
|
15
|
+
import { getExpectedTokensFromParserOrException } from './utils';
|
|
16
|
+
const isEscape = char => char === '\\';
|
|
17
|
+
export const getPrintableChar = char => {
|
|
18
|
+
const hex = char.charCodeAt(0).toString(16).toUpperCase();
|
|
19
|
+
return `U+${padStart(hex, 4, '0')}`;
|
|
20
|
+
};
|
|
21
|
+
export const getJavaCodeFromChar = char => {
|
|
22
|
+
const hex = char.charCodeAt(0).toString(16);
|
|
23
|
+
return `\\u${padStart(hex, 4, '0')}`;
|
|
24
|
+
};
|
|
25
|
+
export default class JQLEditorErrorStrategy extends DefaultErrorStrategy {
|
|
26
|
+
constructor(intlRef) {
|
|
27
|
+
super();
|
|
28
|
+
this.intlRef = intlRef;
|
|
29
|
+
}
|
|
30
|
+
reportInputMismatch(recognizer, exception) {
|
|
31
|
+
this.handleSyntaxError(recognizer, recognizer.currentToken, exception);
|
|
32
|
+
}
|
|
33
|
+
reportUnwantedToken(recognizer) {
|
|
34
|
+
if (this.inErrorRecoveryMode(recognizer)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this.beginErrorCondition(recognizer);
|
|
38
|
+
this.handleSyntaxError(recognizer, recognizer.currentToken);
|
|
39
|
+
}
|
|
40
|
+
reportMissingToken(recognizer) {
|
|
41
|
+
if (this.inErrorRecoveryMode(recognizer)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this.beginErrorCondition(recognizer);
|
|
45
|
+
|
|
46
|
+
// This is called when single token insertion is a viable recovery strategy for the error. In this case we can
|
|
47
|
+
// use expected tokens from the parser to display an error to the user. If there are no viable tokens to show then
|
|
48
|
+
// we should fallback to syntax error handling.
|
|
49
|
+
if (getExpectedTokensFromParserOrException(recognizer).length > 0) {
|
|
50
|
+
const message = handleExpectedTokensError(recognizer, recognizer.currentToken,
|
|
51
|
+
// We want to derive expectedTokens from the parser state
|
|
52
|
+
[], this.intlRef.current);
|
|
53
|
+
recognizer.notifyErrorListeners(message, recognizer.currentToken, undefined);
|
|
54
|
+
} else {
|
|
55
|
+
this.handleSyntaxError(recognizer, recognizer.currentToken);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
reportNoViableAlternative(recognizer, exception) {
|
|
59
|
+
var _exception$getOffendi;
|
|
60
|
+
// There are some cases, like "status was", where parser is unable to provide viable alternatives for current
|
|
61
|
+
// token, but autocomplete engine is still able to provide meaningful suggestions at offending token index
|
|
62
|
+
const currentToken = (_exception$getOffendi = exception === null || exception === void 0 ? void 0 : exception.getOffendingToken()) !== null && _exception$getOffendi !== void 0 ? _exception$getOffendi : recognizer.currentToken;
|
|
63
|
+
this.handleSyntaxError(recognizer, currentToken, exception);
|
|
64
|
+
}
|
|
65
|
+
reportFailedPredicate(recognizer, e) {
|
|
66
|
+
// TODO: Don't know how to produce this error. Monitor if this happens and defer to default implementation
|
|
67
|
+
super.reportFailedPredicate(recognizer, e);
|
|
68
|
+
}
|
|
69
|
+
handleSyntaxError(recognizer, currentToken, exception) {
|
|
70
|
+
let message;
|
|
71
|
+
switch (currentToken.type) {
|
|
72
|
+
/*
|
|
73
|
+
* This is called when ANTLR finds a character that the grammar does not recognise. The grammar lexer uses
|
|
74
|
+
* a DFA to decide if a character is in error or not. This can mean that legal characters come as an error
|
|
75
|
+
* because they do not form a valid token. Because of this we have to do some extra checks here.
|
|
76
|
+
*/
|
|
77
|
+
case JQLLexer.ERRORCHAR:
|
|
78
|
+
case JQLLexer.INVALID_QUOTE_STRING:
|
|
79
|
+
case JQLLexer.INVALID_SQUOTE_STRING:
|
|
80
|
+
{
|
|
81
|
+
let currentText = currentToken.text;
|
|
82
|
+
|
|
83
|
+
// These tokens are returned when an illegal character appears at the end of a quote string, but the token
|
|
84
|
+
// includes the entire quoted text. We take the last character from our text as that's the offending token.
|
|
85
|
+
if (currentToken.type === JQLLexer.INVALID_QUOTE_STRING || currentToken.type === JQLLexer.INVALID_SQUOTE_STRING) {
|
|
86
|
+
var _currentText;
|
|
87
|
+
currentText = (_currentText = currentText) === null || _currentText === void 0 ? void 0 : _currentText.slice(-1);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// This can happen (e.g. comment ~ \)
|
|
91
|
+
if (isEscape(currentText)) {
|
|
92
|
+
const nextToken = recognizer.inputStream.get(currentToken.tokenIndex + 1);
|
|
93
|
+
if (nextToken.type === JQLLexer.MATCHWS || nextToken.type === JQLLexer.EOF) {
|
|
94
|
+
message = this.intlRef.current.formatMessage(errorMessages.illegalEscapeBlank);
|
|
95
|
+
} else {
|
|
96
|
+
var _currentText2, _nextToken$text;
|
|
97
|
+
// Show the escaped character sequence in the message
|
|
98
|
+
const received = `${(_currentText2 = currentText) !== null && _currentText2 !== void 0 ? _currentText2 : ''}${(_nextToken$text = nextToken.text) !== null && _nextToken$text !== void 0 ? _nextToken$text : ''}`;
|
|
99
|
+
message = this.intlRef.current.formatMessage(errorMessages.illegalEscape, {
|
|
100
|
+
received
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
} else {
|
|
104
|
+
var _currentText3, _currentText4;
|
|
105
|
+
message = this.intlRef.current.formatMessage(errorMessages.illegalChar, {
|
|
106
|
+
char: getPrintableChar((_currentText3 = currentText) !== null && _currentText3 !== void 0 ? _currentText3 : ''),
|
|
107
|
+
escapedChar: getJavaCodeFromChar((_currentText4 = currentText) !== null && _currentText4 !== void 0 ? _currentText4 : '')
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
// Special tokens that get created every time there is an unfinished string (i.e. without matching closing quote)
|
|
113
|
+
case JQLLexer.UNCLOSED_QUOTE_STRING:
|
|
114
|
+
case JQLLexer.UNCLOSED_SQUOTE_STRING:
|
|
115
|
+
{
|
|
116
|
+
var _currentToken$text;
|
|
117
|
+
const received = normaliseJqlString((_currentToken$text = currentToken.text) !== null && _currentToken$text !== void 0 ? _currentToken$text : '');
|
|
118
|
+
if (received === '') {
|
|
119
|
+
message = this.intlRef.current.formatMessage(errorMessages.unfinishedStringBlank);
|
|
120
|
+
} else {
|
|
121
|
+
message = this.intlRef.current.formatMessage(errorMessages.unfinishedString, {
|
|
122
|
+
received
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
case JQLLexer.RESERVED_WORD:
|
|
128
|
+
{
|
|
129
|
+
message = this.intlRef.current.formatMessage(errorMessages.reservedWord, {
|
|
130
|
+
word: currentToken.text
|
|
131
|
+
});
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
case JQLLexer.ERROR_RESERVED:
|
|
135
|
+
{
|
|
136
|
+
var _currentToken$text2;
|
|
137
|
+
message = this.intlRef.current.formatMessage(errorMessages.reservedChar, {
|
|
138
|
+
char: currentToken.text,
|
|
139
|
+
escapedChar: getJavaCodeFromChar((_currentToken$text2 = currentToken.text) !== null && _currentToken$text2 !== void 0 ? _currentToken$text2 : '')
|
|
140
|
+
});
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
default:
|
|
144
|
+
{
|
|
145
|
+
const autocomplete = JQLAutocomplete.fromParser(recognizer, ignoredTokens, preferredRules, new Set());
|
|
146
|
+
const {
|
|
147
|
+
tokens,
|
|
148
|
+
rules
|
|
149
|
+
} = autocomplete.getJQLSuggestionsForTokenIndex(currentToken.tokenIndex);
|
|
150
|
+
if (rules.value || rules.list ||
|
|
151
|
+
// Restrict function rules to only be shown if we are currently INSIDE a function rule. Otherwise this error
|
|
152
|
+
// message would be shown for incomplete tokens following an operand, e.g. `status = open ord`.
|
|
153
|
+
rules.function && recognizer.context.ruleIndex === JQLParser.RULE_jqlFunction) {
|
|
154
|
+
message = handleOperandRuleError(recognizer, currentToken, tokens.values, rules, this.intlRef.current, exception);
|
|
155
|
+
} else if (tokens.values.includes('EMPTY')) {
|
|
156
|
+
message = handleExpectedTokensError(recognizer, currentToken, tokens.values, this.intlRef.current, exception);
|
|
157
|
+
} else if (rules.operator) {
|
|
158
|
+
message = handleOperatorRuleError(currentToken, this.intlRef.current);
|
|
159
|
+
} else if (rules.field) {
|
|
160
|
+
message = handleFieldRuleError(currentToken, this.intlRef.current);
|
|
161
|
+
} else if (rules.customField) {
|
|
162
|
+
message = handleCustomFieldRuleError(this.intlRef.current);
|
|
163
|
+
}
|
|
164
|
+
// Restrict field property rules to only be shown if we are currently INSIDE a field property. Otherwise this
|
|
165
|
+
// error message would be shown for incomplete tokens following a field, e.g. `ORDER BY issuetype as`.
|
|
166
|
+
else if (rules.fieldProperty && recognizer.context.ruleIndex === JQLParser.RULE_jqlFieldProperty) {
|
|
167
|
+
// Shows the correct message when a field property rule hasn't been completed, e.g. `issuetype[abc!`
|
|
168
|
+
message = handleExpectedTokensError(recognizer, currentToken,
|
|
169
|
+
// We want to derive expectedTokens from the exception/parser state
|
|
170
|
+
[], this.intlRef.current, exception);
|
|
171
|
+
} else if (rules.fieldPropertyId) {
|
|
172
|
+
message = handleFieldPropertyIdRuleError(currentToken, this.intlRef.current);
|
|
173
|
+
} else if (rules.functionArgument) {
|
|
174
|
+
message = handleFunctionArgumentRuleError(currentToken, this.intlRef.current);
|
|
175
|
+
} else {
|
|
176
|
+
message = handleExpectedTokensError(recognizer, currentToken, tokens.values, this.intlRef.current, exception);
|
|
177
|
+
}
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
recognizer.notifyErrorListeners(message, currentToken, undefined);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JQLLexer, JQLParser } from '@atlaskit/jql-parser';
|
|
2
|
+
export const 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 const 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 const 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 const handleCustomFieldRuleError = intl => {
|
|
7
|
+
return intl.formatMessage(errorMessages.expectingCustomFieldId);
|
|
8
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
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 const 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
|
+
const lowPriorityTokenNames = getTokenDisplayNames(recognizer, lowPriorityTokens);
|
|
19
|
+
|
|
20
|
+
// Only include tokens that are NOT low priority
|
|
21
|
+
const highPriorityTokens = expectedTokens.filter(tokenType => !lowPriorityTokenNames.includes(tokenType));
|
|
22
|
+
|
|
23
|
+
// If we have any tokens that are high priority then we want to show them (without low priority suggestions).
|
|
24
|
+
if (highPriorityTokens.length > 0) {
|
|
25
|
+
expectedTokens = highPriorityTokens;
|
|
26
|
+
}
|
|
27
|
+
const isEOF = currentToken.type === JQLLexer.EOF;
|
|
28
|
+
if (expectedTokens.length > 1) {
|
|
29
|
+
const firstExpectedTokens = expectedTokens.slice(0, -1)
|
|
30
|
+
// Need to wrap tokens in single quotes ourselves as we cannot do it in the message descriptor
|
|
31
|
+
.map(token => `'${token}'`).join(', ');
|
|
32
|
+
const lastExpectedToken = expectedTokens[expectedTokens.length - 1];
|
|
33
|
+
return isEOF ? intl.formatMessage(errorMessages.expectingMultipleTokensBeforeEOF, {
|
|
34
|
+
firstExpectedTokens,
|
|
35
|
+
lastExpectedToken
|
|
36
|
+
}) : intl.formatMessage(errorMessages.expectingMultipleTokensButReceived, {
|
|
37
|
+
firstExpectedTokens,
|
|
38
|
+
lastExpectedToken,
|
|
39
|
+
received: currentToken.text
|
|
40
|
+
});
|
|
41
|
+
} else if (expectedTokens.length === 1) {
|
|
42
|
+
return isEOF ? intl.formatMessage(errorMessages.expectingTokenBeforeEOF, {
|
|
43
|
+
expectedToken: expectedTokens[0]
|
|
44
|
+
}) : intl.formatMessage(errorMessages.expectingTokenButReceived, {
|
|
45
|
+
expectedToken: expectedTokens[0],
|
|
46
|
+
received: currentToken.text
|
|
47
|
+
});
|
|
48
|
+
} else {
|
|
49
|
+
return isEOF ? intl.formatMessage(commonMessages.unknownError) : intl.formatMessage(errorMessages.unknownErrorAtToken, {
|
|
50
|
+
received: currentToken.text
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
@@ -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 const handleFieldPropertyIdRuleError = (currentToken, intl) => {
|
|
8
|
+
const isEOF = currentToken.type === JQLLexer.EOF;
|
|
9
|
+
return isEOF ? intl.formatMessage(errorMessages.expectingFieldPropertyIdBeforeEOF) : intl.formatMessage(errorMessages.expectingFieldPropertyIdButReceived, {
|
|
10
|
+
received: currentToken.text
|
|
11
|
+
});
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
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 rule was expected.
|
|
6
|
+
*/
|
|
7
|
+
export const handleFieldRuleError = (currentToken, intl) => {
|
|
8
|
+
const isEOF = currentToken.type === JQLLexer.EOF;
|
|
9
|
+
if (currentToken.type === JQLLexer.LBRACKET) {
|
|
10
|
+
return intl.formatMessage(errorMessages.expectingCFButReceived);
|
|
11
|
+
}
|
|
12
|
+
return isEOF ? intl.formatMessage(errorMessages.expectingFieldBeforeEOF) : intl.formatMessage(errorMessages.expectingFieldButReceived, {
|
|
13
|
+
received: currentToken.text
|
|
14
|
+
});
|
|
15
|
+
};
|
|
@@ -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 function argument rule was expected.
|
|
6
|
+
*/
|
|
7
|
+
export const handleFunctionArgumentRuleError = (currentToken, intl) => {
|
|
8
|
+
const isEOF = currentToken.type === JQLLexer.EOF;
|
|
9
|
+
return isEOF ? intl.formatMessage(errorMessages.expectingFunctionArgBeforeEOF) : intl.formatMessage(errorMessages.expectingFunctionArgButReceived, {
|
|
10
|
+
received: currentToken.text
|
|
11
|
+
});
|
|
12
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { JQLLexer } from '@atlaskit/jql-parser';
|
|
2
|
+
import { errorMessages } from '../messages';
|
|
3
|
+
import { getExpectedTokensFromParserOrException, getTokenDisplayNames } from '../utils';
|
|
4
|
+
import { handleExpectedTokensError } from './ExpectedTokensErrorHandler';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Show the appropriate error message when parsing JQL fails and an operand rule was expected.
|
|
8
|
+
*/
|
|
9
|
+
export const handleOperandRuleError = (recognizer, currentToken, expectedTokens, rules, intl, exception) => {
|
|
10
|
+
// If there are no expected autocomplete tokens, then attempt to find viable tokens from the exception/parser.
|
|
11
|
+
if (expectedTokens.length === 0) {
|
|
12
|
+
expectedTokens = getTokenDisplayNames(recognizer, getExpectedTokensFromParserOrException(recognizer, exception));
|
|
13
|
+
}
|
|
14
|
+
const isEOF = currentToken.type === JQLLexer.EOF;
|
|
15
|
+
if (rules.value && rules.list && rules.function) {
|
|
16
|
+
return isEOF ? intl.formatMessage(errorMessages.expectingOperandBeforeEOF) : intl.formatMessage(errorMessages.expectingOperandButReceived, {
|
|
17
|
+
received: currentToken.text
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (rules.value && rules.function) {
|
|
21
|
+
return isEOF ? intl.formatMessage(errorMessages.expectingValueOrFunctionBeforeEOF) : intl.formatMessage(errorMessages.expectingValueOrFunctionButReceived, {
|
|
22
|
+
received: currentToken.text
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
if (rules.list && rules.function) {
|
|
26
|
+
// Lists and functions are the only operands that contain structural tokens (i.e. LPAREN, RPAREN and COMMA).
|
|
27
|
+
// So, if there are specific expected tokens, we prioritize those over generic rule messages.
|
|
28
|
+
if (expectedTokens.length) {
|
|
29
|
+
return handleExpectedTokensError(recognizer, currentToken, expectedTokens, intl, exception);
|
|
30
|
+
}
|
|
31
|
+
return isEOF ? intl.formatMessage(errorMessages.expectingListOrFunctionBeforeEOF) : intl.formatMessage(errorMessages.expectingListOrFunctionButReceived, {
|
|
32
|
+
received: currentToken.text
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Value or list combination is not possible with current grammar definition
|
|
37
|
+
|
|
38
|
+
if (rules.function) {
|
|
39
|
+
// Lists and functions are the only operands that contain structural tokens (i.e. LPAREN, RPAREN and COMMA).
|
|
40
|
+
// So, if there are specific expected tokens, we prioritize those over generic rule messages.
|
|
41
|
+
if (expectedTokens.length) {
|
|
42
|
+
return handleExpectedTokensError(recognizer, currentToken, expectedTokens, intl, exception);
|
|
43
|
+
}
|
|
44
|
+
return isEOF ? intl.formatMessage(errorMessages.expectingFunctionBeforeEOF) : intl.formatMessage(errorMessages.expectingFunctionButReceived, {
|
|
45
|
+
received: currentToken.text
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (rules.list) {
|
|
49
|
+
// Lists and functions are the only operands that contain structural tokens (i.e. LPAREN, RPAREN and COMMA).
|
|
50
|
+
// So, if there are specific expected tokens, we prioritize those over generic rule messages.
|
|
51
|
+
if (expectedTokens.length) {
|
|
52
|
+
return handleExpectedTokensError(recognizer, currentToken, expectedTokens, intl, exception);
|
|
53
|
+
}
|
|
54
|
+
return isEOF ? intl.formatMessage(errorMessages.expectingListBeforeEOF) : intl.formatMessage(errorMessages.expectingListButReceived, {
|
|
55
|
+
received: currentToken.text
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return isEOF ? intl.formatMessage(errorMessages.expectingValueBeforeEOF) : intl.formatMessage(errorMessages.expectingValueButReceived, {
|
|
59
|
+
received: currentToken.text
|
|
60
|
+
});
|
|
61
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JQLLexer } from '@atlaskit/jql-parser';
|
|
2
|
+
import { errorMessages } from '../messages';
|
|
3
|
+
|
|
4
|
+
// TODO: Figure out if we can show a message without hardcoded operators
|
|
5
|
+
/**
|
|
6
|
+
* Show the appropriate error message when parsing JQL fails and an operator rule was expected.
|
|
7
|
+
*/
|
|
8
|
+
export const handleOperatorRuleError = (currentToken, intl) => {
|
|
9
|
+
const isEOF = currentToken.type === JQLLexer.EOF;
|
|
10
|
+
return isEOF ? intl.formatMessage(errorMessages.expectingOperatorBeforeEOF) : intl.formatMessage(errorMessages.expectingOperatorButReceived, {
|
|
11
|
+
received: currentToken.text
|
|
12
|
+
});
|
|
13
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Plugin, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { JastBuilder } from '@atlaskit/jql-ast';
|
|
3
|
+
import { getNodeText } from '../../utils/document-text';
|
|
4
|
+
import JQLEditorErrorStrategy from './JQLEditorErrorStrategy';
|
|
5
|
+
const JQLAstPluginKey = new PluginKey('jql-ast-plugin');
|
|
6
|
+
export const getJastFromState = state => {
|
|
7
|
+
const jast = JQLAstPluginKey.getState(state);
|
|
8
|
+
// This should never happen as the JQLAstPlugin will always be configured but we'll handle this case anyway to keep TS happy.
|
|
9
|
+
if (jast == null) {
|
|
10
|
+
// eslint-disable-next-line no-console
|
|
11
|
+
console.error('Unable to get state from the JQLAstPlugin as it has not been configured.');
|
|
12
|
+
return {
|
|
13
|
+
query: undefined,
|
|
14
|
+
represents: '',
|
|
15
|
+
errors: []
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return jast;
|
|
19
|
+
};
|
|
20
|
+
const jqlAstPlugin = intlRef => {
|
|
21
|
+
const jastBuilder = new JastBuilder().setErrorHandler(new JQLEditorErrorStrategy(intlRef));
|
|
22
|
+
return new Plugin({
|
|
23
|
+
key: JQLAstPluginKey,
|
|
24
|
+
state: {
|
|
25
|
+
init: (_, {
|
|
26
|
+
doc
|
|
27
|
+
}) => {
|
|
28
|
+
return jastBuilder.build(getNodeText(doc, 0, doc.content.size));
|
|
29
|
+
},
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
apply: (tr, value, oldState) => {
|
|
32
|
+
const text = getNodeText(tr.doc, 0, tr.doc.content.size);
|
|
33
|
+
const oldText = getNodeText(oldState.doc, 0, oldState.doc.content.size);
|
|
34
|
+
// Only update the AST if textContent has changed
|
|
35
|
+
return text !== oldText ? jastBuilder.build(text) : value;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
export default jqlAstPlugin;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export const errorMessages = defineMessages({
|
|
3
|
+
expectingOperatorButReceived: {
|
|
4
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingOperatorButReceived',
|
|
5
|
+
defaultMessage: "Expecting an operator but got ''{received}''. The valid operators are '=', '!=', '<', '>', '<=', '>=', '~', '!~', 'IN', 'NOT IN', 'IS' and 'IS NOT'.",
|
|
6
|
+
description: 'When an operator was expected but another token was received.'
|
|
7
|
+
},
|
|
8
|
+
expectingOperatorBeforeEOF: {
|
|
9
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingOperatorBeforeEOF',
|
|
10
|
+
defaultMessage: "Expecting an operator before the end of the query. The valid operators are '=', '!=', '<', '>', '<=', '>=', '~', '!~', 'IN', 'NOT IN', 'IS' and 'IS NOT'.",
|
|
11
|
+
description: 'When an operator was expected before the end of the query.'
|
|
12
|
+
},
|
|
13
|
+
expectingFieldButReceived: {
|
|
14
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingFieldButReceived',
|
|
15
|
+
defaultMessage: "Expecting a field name but got ''{received}''. You must surround ''{received}'' in quotation marks to use it as a field name.",
|
|
16
|
+
description: 'When a field was expected but another token was received.'
|
|
17
|
+
},
|
|
18
|
+
expectingFieldBeforeEOF: {
|
|
19
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingFieldBeforeEOF',
|
|
20
|
+
defaultMessage: 'Expecting a field name before the end of the query.',
|
|
21
|
+
description: 'When a field was expected before the end of the query.'
|
|
22
|
+
},
|
|
23
|
+
expectingCFButReceived: {
|
|
24
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingCFButReceived',
|
|
25
|
+
defaultMessage: "Expecting a field name but got '['. Did you mean 'cf['?",
|
|
26
|
+
description: `When a field was expected but a left bracket was received without a 'cf' prefix.`
|
|
27
|
+
},
|
|
28
|
+
expectingCustomFieldId: {
|
|
29
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingCustomFieldId',
|
|
30
|
+
defaultMessage: `Expecting a custom field id enclosed by '[ ]' after 'cf'. Example: 'cf[10021]'.`,
|
|
31
|
+
description: 'When a custom field id was expected before the end of the query. Text wrapped in single quotes in our message refer to specific tokens in the query so they should not be translated.'
|
|
32
|
+
},
|
|
33
|
+
expectingOperandButReceived: {
|
|
34
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingOperandButReceived',
|
|
35
|
+
defaultMessage: "Expecting either a value, list or function but got ''{received}''. You must surround ''{received}'' in quotation marks to use it as a value.",
|
|
36
|
+
description: 'When an operand was expected but another token was received.'
|
|
37
|
+
},
|
|
38
|
+
expectingOperandBeforeEOF: {
|
|
39
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingOperandBeforeEOF',
|
|
40
|
+
defaultMessage: 'Expecting either a value, list or function before the end of the query.',
|
|
41
|
+
description: 'When an operand was expected before the end of the query.'
|
|
42
|
+
},
|
|
43
|
+
expectingValueOrFunctionButReceived: {
|
|
44
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingValueOrFunctionButReceived',
|
|
45
|
+
defaultMessage: "Expecting a value or function but got ''{received}''. You must surround ''{received}'' in quotation marks to use it as a value.",
|
|
46
|
+
description: 'When a value or function was expected but another token was received.'
|
|
47
|
+
},
|
|
48
|
+
expectingValueOrFunctionBeforeEOF: {
|
|
49
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingValueOrFunctionBeforeEOF',
|
|
50
|
+
defaultMessage: 'Expecting a value or function before the end of the query.',
|
|
51
|
+
description: 'When a value or function was expected before the end of the query.'
|
|
52
|
+
},
|
|
53
|
+
expectingListOrFunctionButReceived: {
|
|
54
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingListOrFunctionButReceived',
|
|
55
|
+
defaultMessage: "Expecting a list or function but got ''{received}''. You must surround ''{received}'' in quotation marks to use it as a value.",
|
|
56
|
+
description: 'When a list or function was expected but another token was received.'
|
|
57
|
+
},
|
|
58
|
+
expectingListOrFunctionBeforeEOF: {
|
|
59
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingListOrFunctionBeforeEOF',
|
|
60
|
+
defaultMessage: 'Expecting a list or function before the end of the query.',
|
|
61
|
+
description: 'When a list or function was expected before the end of the query.'
|
|
62
|
+
},
|
|
63
|
+
expectingValueButReceived: {
|
|
64
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingValueButReceived',
|
|
65
|
+
defaultMessage: "Expecting a value but got ''{received}''. You must surround ''{received}'' in quotation marks to use it as a value.",
|
|
66
|
+
description: 'When a value was expected but another token was received.'
|
|
67
|
+
},
|
|
68
|
+
expectingValueBeforeEOF: {
|
|
69
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingValueBeforeEOF',
|
|
70
|
+
defaultMessage: 'Expecting a value before the end of the query.',
|
|
71
|
+
description: 'When a value was expected before the end of the query.'
|
|
72
|
+
},
|
|
73
|
+
expectingListButReceived: {
|
|
74
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingListButReceived',
|
|
75
|
+
defaultMessage: "Expecting a list but got ''{received}''. You must surround ''{received}'' in quotation marks to use it as a value.",
|
|
76
|
+
description: 'When a list was expected but another token was received.'
|
|
77
|
+
},
|
|
78
|
+
expectingListBeforeEOF: {
|
|
79
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingListBeforeEOF',
|
|
80
|
+
defaultMessage: 'Expecting a list before the end of the query.',
|
|
81
|
+
description: 'When a list was expected before the end of the query.'
|
|
82
|
+
},
|
|
83
|
+
expectingFunctionButReceived: {
|
|
84
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingFunctionButReceived',
|
|
85
|
+
defaultMessage: "Expecting a function but got ''{received}''. You must surround ''{received}'' in quotation marks to use it as a value.",
|
|
86
|
+
description: 'When a function was expected but another token was received.'
|
|
87
|
+
},
|
|
88
|
+
expectingFunctionBeforeEOF: {
|
|
89
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingFunctionBeforeEOF',
|
|
90
|
+
defaultMessage: 'Expecting a function before the end of the query.',
|
|
91
|
+
description: 'When a function was expected before the end of the query.'
|
|
92
|
+
},
|
|
93
|
+
expectingFieldPropertyIdButReceived: {
|
|
94
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingFieldPropertyIdButReceived',
|
|
95
|
+
defaultMessage: "Expecting a property id but got ''{received}''. You must surround ''{received}'' in quotation marks to use it as a value.",
|
|
96
|
+
description: 'When a field property ID was expected but another token was received.'
|
|
97
|
+
},
|
|
98
|
+
expectingFieldPropertyIdBeforeEOF: {
|
|
99
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingFieldPropertyIdBeforeEOF',
|
|
100
|
+
defaultMessage: 'Expecting a property id before the end of the query.',
|
|
101
|
+
description: 'When a field property ID was expected before the end of the query.'
|
|
102
|
+
},
|
|
103
|
+
expectingFunctionArgButReceived: {
|
|
104
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingFunctionArgButReceived',
|
|
105
|
+
defaultMessage: "Expecting a function argument but got ''{received}''. You must surround ''{received}'' in quotation marks to use it as a value.",
|
|
106
|
+
description: 'When a function argument was expected but another token was received.'
|
|
107
|
+
},
|
|
108
|
+
expectingFunctionArgBeforeEOF: {
|
|
109
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingFunctionArgBeforeEOF',
|
|
110
|
+
defaultMessage: 'Expecting a function argument before the end of the query.',
|
|
111
|
+
description: 'When a function argument was expected before the end of the query.'
|
|
112
|
+
},
|
|
113
|
+
expectingMultipleTokensButReceived: {
|
|
114
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingMultipleTokensButReceived',
|
|
115
|
+
defaultMessage: "Expecting {firstExpectedTokens} or ''{lastExpectedToken}'' but got ''{received}''.",
|
|
116
|
+
description: 'When the text the user entered does not match any of the expected tokens.'
|
|
117
|
+
},
|
|
118
|
+
expectingMultipleTokensBeforeEOF: {
|
|
119
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingMultipleTokensBeforeEOF',
|
|
120
|
+
defaultMessage: "Expecting {firstExpectedTokens} or ''{lastExpectedToken}'' before the end of the query.",
|
|
121
|
+
description: 'When there are still tokens expected before the query can end.'
|
|
122
|
+
},
|
|
123
|
+
expectingTokenButReceived: {
|
|
124
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingTokenButReceived',
|
|
125
|
+
defaultMessage: "Expecting ''{expectedToken}'' but got ''{received}''.",
|
|
126
|
+
description: 'When the text the user entered does not match the expected tokens.'
|
|
127
|
+
},
|
|
128
|
+
expectingTokenBeforeEOF: {
|
|
129
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.expectingTokenBeforeEOF',
|
|
130
|
+
defaultMessage: "Expecting ''{expectedToken}'' before the end of the query.",
|
|
131
|
+
description: 'When an expected token needs to be inserted before the query can end.'
|
|
132
|
+
},
|
|
133
|
+
unknownErrorAtToken: {
|
|
134
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.unknownErrorAtToken',
|
|
135
|
+
defaultMessage: "Unable to parse the query at ''{received}''.",
|
|
136
|
+
description: 'When the query could not be parsed when a token was reached.'
|
|
137
|
+
},
|
|
138
|
+
reservedChar: {
|
|
139
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.reservedChar',
|
|
140
|
+
defaultMessage: "The character ''{char}'' is a reserved JQL character. You must enclose it in a string or use the escape ''{escapedChar}'' instead.",
|
|
141
|
+
description: 'When the user has a reserved character in the query.'
|
|
142
|
+
},
|
|
143
|
+
reservedWord: {
|
|
144
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.reservedWord',
|
|
145
|
+
defaultMessage: "''{word}'' is a reserved JQL word. You must surround it in quotation marks to use it in a query.",
|
|
146
|
+
description: 'When the user has a reserved word in the query.'
|
|
147
|
+
},
|
|
148
|
+
unfinishedString: {
|
|
149
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.unfinishedString',
|
|
150
|
+
defaultMessage: `The quoted string ''{received}'' has not been completed.`,
|
|
151
|
+
description: 'When a string is missing an opening or closing quote.'
|
|
152
|
+
},
|
|
153
|
+
unfinishedStringBlank: {
|
|
154
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.unfinishedStringBlank',
|
|
155
|
+
defaultMessage: 'The quoted string has not been completed.',
|
|
156
|
+
description: 'When a string is missing an opening or closing quote.'
|
|
157
|
+
},
|
|
158
|
+
illegalEscape: {
|
|
159
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.illegalEscape',
|
|
160
|
+
defaultMessage: `''{received}'' is an illegal JQL escape sequence. The valid escape sequences are \u005C', \u005C", \u005Ct, \u005Cn, \u005Cr, \u005C\u005C, '\u005C ' and \u005CuXXXX.`,
|
|
161
|
+
description: 'When there are no valid tokens following an escape character.'
|
|
162
|
+
},
|
|
163
|
+
illegalEscapeBlank: {
|
|
164
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.illegalEscapeBlank',
|
|
165
|
+
defaultMessage: `The escape sequence has not been completed. The valid escape sequences are \u005C', \u005C", \u005Ct, \u005Cn, \u005Cr, \u005C\u005C, '\u005C ' and \u005CuXXXX.`,
|
|
166
|
+
description: 'When there are no valid tokens following an escape character.'
|
|
167
|
+
},
|
|
168
|
+
illegalChar: {
|
|
169
|
+
id: 'jql-editor.plugins.jql-ast.error-messages.illegalChar',
|
|
170
|
+
defaultMessage: "The character ''{char}'' must be escaped. Use the escape ''{escapedChar}'' instead.",
|
|
171
|
+
description: 'When an illegal character is encountered in a query.'
|
|
172
|
+
}
|
|
173
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ignoredTokens } from './constants';
|
|
2
|
+
export const getTokenDisplayNames = (parser, tokens) => {
|
|
3
|
+
return tokens.map(tokenType => parser.vocabulary.getDisplayName(tokenType).replace(/^'|'$/g, ''));
|
|
4
|
+
};
|
|
5
|
+
export const getExpectedTokensFromParserOrException = (parser, exception) => {
|
|
6
|
+
var _exception$expectedTo;
|
|
7
|
+
// Read expected tokens from the exception if present, as it refers to the expected input symbols at the time the
|
|
8
|
+
// exception was thrown (whereas JQLParser will give us possible tokens from the current parser state).
|
|
9
|
+
const expectedTokenSet = (_exception$expectedTo = exception === null || exception === void 0 ? void 0 : exception.expectedTokens) !== null && _exception$expectedTo !== void 0 ? _exception$expectedTo : parser.getExpectedTokens();
|
|
10
|
+
return expectedTokenSet.toArray()
|
|
11
|
+
// Show the token if it's not ignored
|
|
12
|
+
.filter(tokenType => !ignoredTokens.has(tokenType));
|
|
13
|
+
};
|