@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 @@
|
|
|
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
|
+
};
|