@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,991 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
import clamp from 'lodash/clamp';
|
|
7
|
+
import groupBy from 'lodash/groupBy';
|
|
8
|
+
import { createIntl } from 'react-intl-next';
|
|
9
|
+
import { createContainer, createHook, createSelector, createStore } from 'react-sweet-state';
|
|
10
|
+
import { merge } from 'rxjs/observable/merge';
|
|
11
|
+
import { tap } from 'rxjs/operators/tap';
|
|
12
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
13
|
+
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
14
|
+
import { computeJqlInsights, isListOperator } from '@atlaskit/jql-ast';
|
|
15
|
+
import { JQLAutocomplete } from '@atlaskit/jql-autocomplete';
|
|
16
|
+
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
17
|
+
import { gridSize } from '@atlaskit/theme/constants';
|
|
18
|
+
import { ActionSubject, ActionSubjectId, Action as AnalyticsAction, EventType } from '../analytics';
|
|
19
|
+
import { selectErrorCommand } from '../commands/select-error-command';
|
|
20
|
+
import { JQL_EDITOR_MAIN_ID } from '../common/constants';
|
|
21
|
+
import { defaultAutocompleteProvider, JQLAutocompletePluginKey } from '../plugins/autocomplete/constants';
|
|
22
|
+
import { getJastFromState } from '../plugins/jql-ast';
|
|
23
|
+
import { clipboardTextParser, clipboardTextSerializer, configurePlugins as _configurePlugins, defaultEditorState } from '../schema';
|
|
24
|
+
import { getNodeText } from '../utils/document-text';
|
|
25
|
+
import { onStartAutocompleteEvent } from './analytics';
|
|
26
|
+
import { sortOperators } from './autocomplete';
|
|
27
|
+
import { hydrateQuery } from './hydration';
|
|
28
|
+
import { getAutocompleteOptionId, getAutocompletePosition, getFieldNodes, getReplacePositionStart, sendDebugMessage, tokensToAutocompleteOptions } from './util';
|
|
29
|
+
var initialIntl = createIntl({
|
|
30
|
+
locale: 'en'
|
|
31
|
+
});
|
|
32
|
+
var defaultAutocompleteOptions = {
|
|
33
|
+
tokens: [],
|
|
34
|
+
fields: [],
|
|
35
|
+
operators: [],
|
|
36
|
+
values: [],
|
|
37
|
+
functions: []
|
|
38
|
+
};
|
|
39
|
+
export var initialState = {
|
|
40
|
+
controlledQuery: '',
|
|
41
|
+
query: '',
|
|
42
|
+
externalMessages: [],
|
|
43
|
+
isSearching: undefined,
|
|
44
|
+
editorState: defaultEditorState,
|
|
45
|
+
editorView: undefined,
|
|
46
|
+
intlRef: {
|
|
47
|
+
current: initialIntl
|
|
48
|
+
},
|
|
49
|
+
autocompleteProvider: defaultAutocompleteProvider,
|
|
50
|
+
idPrefix: '',
|
|
51
|
+
editorViewHasFocus: false,
|
|
52
|
+
editorViewBlurTimeout: null,
|
|
53
|
+
lineNumbersVisible: false,
|
|
54
|
+
jqlError: null,
|
|
55
|
+
autocomplete: {
|
|
56
|
+
// Keep autocomplete closed until user modifies query
|
|
57
|
+
shouldStayClosedOnNextUpdate: true,
|
|
58
|
+
shouldStayClosed: true,
|
|
59
|
+
selectedOptionId: undefined,
|
|
60
|
+
loading: false,
|
|
61
|
+
options: defaultAutocompleteOptions,
|
|
62
|
+
subscription: null,
|
|
63
|
+
analyticsSubscription: null,
|
|
64
|
+
container: null,
|
|
65
|
+
offsetParentRect: undefined,
|
|
66
|
+
replacePositionStart: 0
|
|
67
|
+
},
|
|
68
|
+
enableRichInlineNodes: false,
|
|
69
|
+
hydratedValues: {},
|
|
70
|
+
resizeObserver: undefined,
|
|
71
|
+
editorViewContainer: undefined,
|
|
72
|
+
editorViewContainerRect: undefined,
|
|
73
|
+
editorViewContainerScroll: 0,
|
|
74
|
+
onDebugUnsafeMessage: undefined
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Line numbers should be shown if there are more than 1 paragraph blocks in the document.
|
|
79
|
+
*/
|
|
80
|
+
var isLineNumbersVisible = function isLineNumbersVisible(editorState) {
|
|
81
|
+
return editorState.doc.childCount > 1;
|
|
82
|
+
};
|
|
83
|
+
export var actions = {
|
|
84
|
+
onEditorViewBlur: function onEditorViewBlur() {
|
|
85
|
+
return function (_ref) {
|
|
86
|
+
var setState = _ref.setState,
|
|
87
|
+
dispatch = _ref.dispatch;
|
|
88
|
+
// Set editorViewHasFocus within a timeout, to handle the scenario where a dropdown option is clicked. Without the
|
|
89
|
+
// timeout, a blur event would be fired for the editor on mousedown, which would cause the dropdown to be hidden
|
|
90
|
+
// before the click event is fired.
|
|
91
|
+
var editorViewBlurTimeout = window.setTimeout(function () {
|
|
92
|
+
setState({
|
|
93
|
+
editorViewHasFocus: false
|
|
94
|
+
});
|
|
95
|
+
dispatch(actions.setSelectedAutocompleteOptionId(undefined));
|
|
96
|
+
});
|
|
97
|
+
setState({
|
|
98
|
+
editorViewBlurTimeout: editorViewBlurTimeout
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
onEditorViewFocus: function onEditorViewFocus(event) {
|
|
103
|
+
return function (_ref2, _ref3) {
|
|
104
|
+
var setState = _ref2.setState,
|
|
105
|
+
getState = _ref2.getState;
|
|
106
|
+
var onFocus = _ref3.onFocus;
|
|
107
|
+
var _getState = getState(),
|
|
108
|
+
autocomplete = _getState.autocomplete,
|
|
109
|
+
editorViewBlurTimeout = _getState.editorViewBlurTimeout,
|
|
110
|
+
editorViewHasFocus = _getState.editorViewHasFocus;
|
|
111
|
+
editorViewBlurTimeout && clearTimeout(editorViewBlurTimeout);
|
|
112
|
+
if (!editorViewHasFocus) {
|
|
113
|
+
var _autocomplete$contain;
|
|
114
|
+
setState({
|
|
115
|
+
autocomplete: _objectSpread(_objectSpread({}, autocomplete), {}, {
|
|
116
|
+
// This is a performance optimization to avoid querying this rect on every autocomplete dropdown render.
|
|
117
|
+
// We assume that autocomplete offset parent rect is not going to change while user interacts with the editor,
|
|
118
|
+
// so we only recompute this on focus.
|
|
119
|
+
offsetParentRect: (_autocomplete$contain = autocomplete.container) === null || _autocomplete$contain === void 0 || (_autocomplete$contain = _autocomplete$contain.offsetParent) === null || _autocomplete$contain === void 0 ? void 0 : _autocomplete$contain.getBoundingClientRect()
|
|
120
|
+
}),
|
|
121
|
+
editorViewHasFocus: true
|
|
122
|
+
});
|
|
123
|
+
onFocus && onFocus(event);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
openAutocompleteOnNextUpdate: function openAutocompleteOnNextUpdate() {
|
|
128
|
+
return function (_ref4) {
|
|
129
|
+
var setState = _ref4.setState,
|
|
130
|
+
getState = _ref4.getState;
|
|
131
|
+
var autocompleteState = getState().autocomplete;
|
|
132
|
+
setState({
|
|
133
|
+
autocomplete: _objectSpread(_objectSpread({}, autocompleteState), {}, {
|
|
134
|
+
// Schedule open for next update of autocomplete suggestions so dropdown doesn't incur in layout shifts
|
|
135
|
+
shouldStayClosedOnNextUpdate: false
|
|
136
|
+
})
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
closeAutocomplete: function closeAutocomplete() {
|
|
141
|
+
return function (_ref5) {
|
|
142
|
+
var setState = _ref5.setState,
|
|
143
|
+
getState = _ref5.getState;
|
|
144
|
+
var autocompleteState = getState().autocomplete;
|
|
145
|
+
setState({
|
|
146
|
+
autocomplete: _objectSpread(_objectSpread({}, autocompleteState), {}, {
|
|
147
|
+
// Closing autocomplete can be done immediately as it won't incur in layout shifts
|
|
148
|
+
shouldStayClosed: true,
|
|
149
|
+
shouldStayClosedOnNextUpdate: true
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
setSelectedAutocompleteOptionId: function setSelectedAutocompleteOptionId(selectedOptionId) {
|
|
155
|
+
return function (_ref6) {
|
|
156
|
+
var setState = _ref6.setState,
|
|
157
|
+
getState = _ref6.getState;
|
|
158
|
+
var autocompleteState = getState().autocomplete;
|
|
159
|
+
setState({
|
|
160
|
+
autocomplete: _objectSpread(_objectSpread({}, autocompleteState), {}, {
|
|
161
|
+
selectedOptionId: selectedOptionId
|
|
162
|
+
})
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
},
|
|
166
|
+
getAutocompleteSuggestions: function getAutocompleteSuggestions(editorState) {
|
|
167
|
+
return function (_ref7) {
|
|
168
|
+
var getState = _ref7.getState,
|
|
169
|
+
dispatch = _ref7.dispatch;
|
|
170
|
+
// No need to process suggestions if autocomplete is going to stay closed on next update
|
|
171
|
+
if (!getState().autocomplete.shouldStayClosedOnNextUpdate) {
|
|
172
|
+
var _editorState$selectio = editorState.selection,
|
|
173
|
+
from = _editorState$selectio.from,
|
|
174
|
+
to = _editorState$selectio.to;
|
|
175
|
+
var text = getNodeText(editorState.doc, 0, editorState.doc.content.size);
|
|
176
|
+
var textBeforeSelectionStart = getNodeText(editorState.doc, 0, from);
|
|
177
|
+
var textBeforeSelectionEnd = getNodeText(editorState.doc, 0, to);
|
|
178
|
+
var textPositionStart = textBeforeSelectionStart.length;
|
|
179
|
+
var textPositionStop = textBeforeSelectionEnd.length;
|
|
180
|
+
var autocomplete = JQLAutocomplete.fromText(text);
|
|
181
|
+
var suggestions = autocomplete.getJQLSuggestionsForCaretPosition([textPositionStart, textPositionStop]);
|
|
182
|
+
var _ref8 = suggestions,
|
|
183
|
+
rules = _ref8.rules,
|
|
184
|
+
tokens = _ref8.tokens;
|
|
185
|
+
|
|
186
|
+
// In some situations (e.g. "issuetype in "), autocomplete expects a list, but we want to display operands
|
|
187
|
+
// to the user as a shortcut – so they don't have to manually type the opening parenthesis. There is logic
|
|
188
|
+
// on autocomplete option selection that will auto-insert this opening parenthesis.
|
|
189
|
+
if (rules.list && rules.list.context && !rules.list.context.isList) {
|
|
190
|
+
if (!tokens.values.includes('EMPTY')) {
|
|
191
|
+
tokens.values.push('EMPTY');
|
|
192
|
+
tokens.context = rules.list.context;
|
|
193
|
+
}
|
|
194
|
+
if (!rules.value) {
|
|
195
|
+
rules.value = rules.list;
|
|
196
|
+
}
|
|
197
|
+
if (!rules.function) {
|
|
198
|
+
rules.function = rules.list;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
dispatch(actions.getAutocompleteOptions(suggestions));
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
},
|
|
205
|
+
getAutocompleteOptions: function getAutocompleteOptions(suggestions) {
|
|
206
|
+
return function (_ref9) {
|
|
207
|
+
var setState = _ref9.setState,
|
|
208
|
+
getState = _ref9.getState,
|
|
209
|
+
dispatch = _ref9.dispatch;
|
|
210
|
+
var _getState2 = getState(),
|
|
211
|
+
autocomplete = _getState2.autocomplete,
|
|
212
|
+
editorView = _getState2.editorView;
|
|
213
|
+
var shouldStayClosedOnNextUpdate = autocomplete.shouldStayClosedOnNextUpdate;
|
|
214
|
+
setState({
|
|
215
|
+
autocomplete: _objectSpread(_objectSpread(_objectSpread({}, autocomplete), {}, {
|
|
216
|
+
options: _objectSpread(_objectSpread({}, defaultAutocompleteOptions), {}, {
|
|
217
|
+
tokens: tokensToAutocompleteOptions(suggestions.tokens)
|
|
218
|
+
})
|
|
219
|
+
}, editorView && {
|
|
220
|
+
replacePositionStart: getReplacePositionStart(suggestions)
|
|
221
|
+
}), {}, {
|
|
222
|
+
// Update autocomplete visibility in the same update as initial options to avoid visible layout shifts
|
|
223
|
+
shouldStayClosed: shouldStayClosedOnNextUpdate
|
|
224
|
+
})
|
|
225
|
+
});
|
|
226
|
+
dispatch(actions.cancelSubscription());
|
|
227
|
+
dispatch(actions.callAutocompleteProviders(suggestions));
|
|
228
|
+
};
|
|
229
|
+
},
|
|
230
|
+
appendOptionsForObservable: function appendOptionsForObservable(key, observable, rule, type) {
|
|
231
|
+
return function (_ref10) {
|
|
232
|
+
var getState = _ref10.getState,
|
|
233
|
+
setState = _ref10.setState;
|
|
234
|
+
var context = rule.context,
|
|
235
|
+
matchedText = rule.matchedText,
|
|
236
|
+
replacePosition = rule.replacePosition;
|
|
237
|
+
return observable.pipe(tap(function (data) {
|
|
238
|
+
var nextSuggestions = data.map(function (option) {
|
|
239
|
+
return _objectSpread(_objectSpread({}, option), {}, {
|
|
240
|
+
context: context,
|
|
241
|
+
matchedText: matchedText,
|
|
242
|
+
replacePosition: replacePosition,
|
|
243
|
+
type: type,
|
|
244
|
+
id: getAutocompleteOptionId(option.value)
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
var _getState3 = getState(),
|
|
248
|
+
autocomplete = _getState3.autocomplete;
|
|
249
|
+
var options = autocomplete.options;
|
|
250
|
+
setState({
|
|
251
|
+
autocomplete: _objectSpread(_objectSpread({}, autocomplete), {}, {
|
|
252
|
+
options: _objectSpread(_objectSpread({}, options), {}, _defineProperty({}, key, options[key].concat(nextSuggestions)))
|
|
253
|
+
})
|
|
254
|
+
});
|
|
255
|
+
}));
|
|
256
|
+
};
|
|
257
|
+
},
|
|
258
|
+
cancelSubscription: function cancelSubscription() {
|
|
259
|
+
return function (_ref11) {
|
|
260
|
+
var setState = _ref11.setState,
|
|
261
|
+
getState = _ref11.getState;
|
|
262
|
+
var autocompleteState = getState().autocomplete;
|
|
263
|
+
var subscription = autocompleteState.subscription,
|
|
264
|
+
analyticsSubscription = autocompleteState.analyticsSubscription;
|
|
265
|
+
// Cancel any in-flight subscriptions
|
|
266
|
+
subscription && subscription.unsubscribe();
|
|
267
|
+
analyticsSubscription && analyticsSubscription.unsubscribe();
|
|
268
|
+
setState({
|
|
269
|
+
autocomplete: _objectSpread(_objectSpread({}, autocompleteState), {}, {
|
|
270
|
+
subscription: null,
|
|
271
|
+
analyticsSubscription: null,
|
|
272
|
+
// Setting loading back to false on unsubscribe as this won't call error or complete callbacks
|
|
273
|
+
// in the observer, and we don't seem to have any other way to handle this from the observer itself
|
|
274
|
+
loading: false
|
|
275
|
+
})
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
},
|
|
279
|
+
setLoading: function setLoading(loading) {
|
|
280
|
+
return function (_ref12) {
|
|
281
|
+
var setState = _ref12.setState,
|
|
282
|
+
getState = _ref12.getState;
|
|
283
|
+
var _getState4 = getState(),
|
|
284
|
+
autocomplete = _getState4.autocomplete;
|
|
285
|
+
setState({
|
|
286
|
+
autocomplete: _objectSpread(_objectSpread({}, autocomplete), {}, {
|
|
287
|
+
loading: loading
|
|
288
|
+
})
|
|
289
|
+
});
|
|
290
|
+
};
|
|
291
|
+
},
|
|
292
|
+
setAutocompleteOptions: function setAutocompleteOptions(options) {
|
|
293
|
+
return function (_ref13) {
|
|
294
|
+
var setState = _ref13.setState,
|
|
295
|
+
getState = _ref13.getState;
|
|
296
|
+
var autocompleteState = getState().autocomplete;
|
|
297
|
+
setState({
|
|
298
|
+
autocomplete: _objectSpread(_objectSpread({}, autocompleteState), {}, {
|
|
299
|
+
options: options
|
|
300
|
+
})
|
|
301
|
+
});
|
|
302
|
+
};
|
|
303
|
+
},
|
|
304
|
+
setAutocompleteContainer: function setAutocompleteContainer(container) {
|
|
305
|
+
return function (_ref14) {
|
|
306
|
+
var _container$offsetPare;
|
|
307
|
+
var setState = _ref14.setState,
|
|
308
|
+
getState = _ref14.getState;
|
|
309
|
+
var autocompleteState = getState().autocomplete;
|
|
310
|
+
setState({
|
|
311
|
+
autocomplete: _objectSpread(_objectSpread({}, autocompleteState), {}, {
|
|
312
|
+
container: container,
|
|
313
|
+
offsetParentRect: container === null || container === void 0 || (_container$offsetPare = container.offsetParent) === null || _container$offsetPare === void 0 ? void 0 : _container$offsetPare.getBoundingClientRect()
|
|
314
|
+
})
|
|
315
|
+
});
|
|
316
|
+
};
|
|
317
|
+
},
|
|
318
|
+
callAutocompleteProviders: function callAutocompleteProviders(_ref15) {
|
|
319
|
+
var rules = _ref15.rules,
|
|
320
|
+
tokens = _ref15.tokens;
|
|
321
|
+
return function (_ref16) {
|
|
322
|
+
var getState = _ref16.getState,
|
|
323
|
+
setState = _ref16.setState,
|
|
324
|
+
dispatch = _ref16.dispatch;
|
|
325
|
+
var _getState$autocomplet = getState().autocompleteProvider,
|
|
326
|
+
onFields = _getState$autocomplet.onFields,
|
|
327
|
+
onOperators = _getState$autocomplet.onOperators,
|
|
328
|
+
onValues = _getState$autocomplet.onValues,
|
|
329
|
+
onFunctions = _getState$autocomplet.onFunctions;
|
|
330
|
+
var optionTypes = [];
|
|
331
|
+
var observables = [];
|
|
332
|
+
if (rules.value || rules.function ||
|
|
333
|
+
// If EMPTY is suggested as a token, we are also in "operand mode" and we don't want to call other providers
|
|
334
|
+
// e.g. "assignee is " will return "EMPTY" token and "operator" rule as suggestions (because of "is not")
|
|
335
|
+
tokens.values.includes('EMPTY')) {
|
|
336
|
+
if (rules.value) {
|
|
337
|
+
var _rules$value$context;
|
|
338
|
+
var values$ = onValues(rules.value.matchedText, (_rules$value$context = rules.value.context) === null || _rules$value$context === void 0 ? void 0 : _rules$value$context.field);
|
|
339
|
+
optionTypes.push('values');
|
|
340
|
+
observables.push(dispatch(actions.appendOptionsForObservable('values', values$, rules.value, 'value')));
|
|
341
|
+
}
|
|
342
|
+
if (rules.function) {
|
|
343
|
+
var _rules$function$conte, _rules$function$conte2;
|
|
344
|
+
var functions$ = onFunctions(rules.function.matchedText, (_rules$function$conte = rules.function.context) === null || _rules$function$conte === void 0 ? void 0 : _rules$function$conte.field, (_rules$function$conte2 = rules.function.context) !== null && _rules$function$conte2 !== void 0 && _rules$function$conte2.operator ? isListOperator(rules.function.context.operator) : false);
|
|
345
|
+
optionTypes.push('functions');
|
|
346
|
+
observables.push(dispatch(actions.appendOptionsForObservable('functions', functions$, rules.function, 'function')));
|
|
347
|
+
}
|
|
348
|
+
} else if (rules.operator) {
|
|
349
|
+
var _rules$operator = rules.operator,
|
|
350
|
+
context = _rules$operator.context,
|
|
351
|
+
matchedText = _rules$operator.matchedText;
|
|
352
|
+
var operators$ = sortOperators(onOperators(matchedText, context === null || context === void 0 ? void 0 : context.field));
|
|
353
|
+
optionTypes.push('operators');
|
|
354
|
+
observables.push(dispatch(actions.appendOptionsForObservable('operators', operators$, rules.operator, 'operator')));
|
|
355
|
+
} else if (rules.field) {
|
|
356
|
+
var _rules$field = rules.field,
|
|
357
|
+
_context = _rules$field.context,
|
|
358
|
+
_matchedText = _rules$field.matchedText;
|
|
359
|
+
var fields$ = onFields(_matchedText, _context === null || _context === void 0 ? void 0 : _context.clause);
|
|
360
|
+
optionTypes.push('fields');
|
|
361
|
+
observables.push(dispatch(actions.appendOptionsForObservable('fields', fields$, rules.field, 'field')));
|
|
362
|
+
}
|
|
363
|
+
if (observables.length === 0) {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
var _dispatch = dispatch(onStartAutocompleteEvent()),
|
|
367
|
+
analyticsSubscription = _dispatch.analyticsSubscription,
|
|
368
|
+
onStopAutocompleteEvent = _dispatch.onStopAutocompleteEvent;
|
|
369
|
+
dispatch(actions.setLoading(true));
|
|
370
|
+
var hasOptions = false;
|
|
371
|
+
var subscription = merge.apply(void 0, observables).subscribe({
|
|
372
|
+
next: function next() {
|
|
373
|
+
hasOptions = true;
|
|
374
|
+
},
|
|
375
|
+
error: function error() {
|
|
376
|
+
onStopAutocompleteEvent(false, optionTypes, hasOptions);
|
|
377
|
+
dispatch(actions.setLoading(false));
|
|
378
|
+
},
|
|
379
|
+
complete: function complete() {
|
|
380
|
+
onStopAutocompleteEvent(true, optionTypes, hasOptions);
|
|
381
|
+
dispatch(actions.setLoading(false));
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
var _getState5 = getState(),
|
|
385
|
+
autocomplete = _getState5.autocomplete;
|
|
386
|
+
setState({
|
|
387
|
+
autocomplete: _objectSpread(_objectSpread({}, autocomplete), {}, {
|
|
388
|
+
subscription: subscription,
|
|
389
|
+
analyticsSubscription: analyticsSubscription
|
|
390
|
+
})
|
|
391
|
+
});
|
|
392
|
+
};
|
|
393
|
+
},
|
|
394
|
+
updateValidationState: function updateValidationState() {
|
|
395
|
+
return function (_ref17) {
|
|
396
|
+
var getState = _ref17.getState,
|
|
397
|
+
setState = _ref17.setState;
|
|
398
|
+
var _getState6 = getState(),
|
|
399
|
+
editorState = _getState6.editorState;
|
|
400
|
+
var jast = getJastFromState(editorState);
|
|
401
|
+
setState({
|
|
402
|
+
jqlError: jast.errors.length > 0 ? jast.errors[0] : null
|
|
403
|
+
});
|
|
404
|
+
};
|
|
405
|
+
},
|
|
406
|
+
initialiseEditorState: function initialiseEditorState() {
|
|
407
|
+
return function (_ref18, _ref19) {
|
|
408
|
+
var dispatch = _ref18.dispatch;
|
|
409
|
+
var query = _ref19.query;
|
|
410
|
+
// Configure plugins that don't require portal rendering (these will be reconfigured later when the editor view is mounted).
|
|
411
|
+
dispatch(actions.configurePlugins(undefined));
|
|
412
|
+
dispatch(actions.resetEditorState(query, false));
|
|
413
|
+
};
|
|
414
|
+
},
|
|
415
|
+
configurePlugins: function configurePlugins(portalActions) {
|
|
416
|
+
return function (_ref20, _ref21) {
|
|
417
|
+
var getState = _ref20.getState,
|
|
418
|
+
setState = _ref20.setState,
|
|
419
|
+
dispatch = _ref20.dispatch;
|
|
420
|
+
var intlRef = _ref21.intlRef,
|
|
421
|
+
onSearch = _ref21.onSearch;
|
|
422
|
+
var state = getState();
|
|
423
|
+
var editorState = state.editorState;
|
|
424
|
+
var enableRichInlineNodes = state.enableRichInlineNodes;
|
|
425
|
+
|
|
426
|
+
// Initialise our editor using inline functions which will delegate to our sweet state actions. This prevents
|
|
427
|
+
// stale references when our functions are invoked by Prosemirror.
|
|
428
|
+
var onSearchCommand = function onSearchCommand(pmState, pmDispatch, pmView) {
|
|
429
|
+
return (
|
|
430
|
+
// Set keyboardShortcut arg to true as this action is invoked by the 'Enter' keyboard command
|
|
431
|
+
dispatch(actions.onSearchCommand(pmState, pmDispatch, pmView, true))
|
|
432
|
+
);
|
|
433
|
+
};
|
|
434
|
+
editorState = _configurePlugins(editorState, onSearch ? onSearchCommand : undefined, intlRef, getScopedId(getState(), JQL_EDITOR_MAIN_ID), portalActions, enableRichInlineNodes);
|
|
435
|
+
setState({
|
|
436
|
+
editorState: editorState
|
|
437
|
+
});
|
|
438
|
+
};
|
|
439
|
+
},
|
|
440
|
+
onApplyEditorTransaction: function onApplyEditorTransaction(transaction) {
|
|
441
|
+
return function (_ref22, _ref23) {
|
|
442
|
+
var getState = _ref22.getState,
|
|
443
|
+
setState = _ref22.setState,
|
|
444
|
+
dispatch = _ref22.dispatch;
|
|
445
|
+
var onUpdate = _ref23.onUpdate;
|
|
446
|
+
var _getState7 = getState(),
|
|
447
|
+
query = _getState7.query,
|
|
448
|
+
editorState = _getState7.editorState,
|
|
449
|
+
editorView = _getState7.editorView,
|
|
450
|
+
enableRichInlineNodes = _getState7.enableRichInlineNodes;
|
|
451
|
+
var oldSelection = editorState.selection;
|
|
452
|
+
var updatedQuery = getNodeText(transaction.doc, 0, transaction.doc.content.size);
|
|
453
|
+
var updatedEditorState = editorState.apply(transaction);
|
|
454
|
+
|
|
455
|
+
// Update state in our editor view
|
|
456
|
+
if (editorView) {
|
|
457
|
+
editorView.updateState(updatedEditorState);
|
|
458
|
+
}
|
|
459
|
+
setState({
|
|
460
|
+
query: updatedQuery,
|
|
461
|
+
editorState: updatedEditorState,
|
|
462
|
+
lineNumbersVisible: isLineNumbersVisible(updatedEditorState)
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
// Hydrate query if transaction has requested it or a query fragment has been pasted
|
|
466
|
+
if (enableRichInlineNodes && (transaction.getMeta('hydrate') || transaction.getMeta('paste'))) {
|
|
467
|
+
void dispatch(hydrateQuery());
|
|
468
|
+
}
|
|
469
|
+
if (query !== updatedQuery && !transaction.getMeta(JQLAutocompletePluginKey)) {
|
|
470
|
+
// Open autocomplete on next update if query has changed and update wasn't triggered internally
|
|
471
|
+
dispatch(actions.openAutocompleteOnNextUpdate());
|
|
472
|
+
}
|
|
473
|
+
if (query !== updatedQuery || !updatedEditorState.selection.eq(oldSelection)) {
|
|
474
|
+
// Get autocomplete suggestions for new editor state
|
|
475
|
+
dispatch(actions.getAutocompleteSuggestions(updatedEditorState));
|
|
476
|
+
}
|
|
477
|
+
if (query !== updatedQuery) {
|
|
478
|
+
// Only dispatch update event if query has changed
|
|
479
|
+
onUpdate && onUpdate(updatedQuery, getJastFromState(updatedEditorState));
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
},
|
|
483
|
+
resetEditorState: function resetEditorState(query) {
|
|
484
|
+
var addToHistory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
485
|
+
return function (_ref24) {
|
|
486
|
+
var getState = _ref24.getState,
|
|
487
|
+
dispatch = _ref24.dispatch;
|
|
488
|
+
var _getState8 = getState(),
|
|
489
|
+
editorState = _getState8.editorState,
|
|
490
|
+
enableRichInlineNodes = _getState8.enableRichInlineNodes;
|
|
491
|
+
|
|
492
|
+
// Use the clipboard text parser to get our slice to ensure new lines are split into separate paragraphs
|
|
493
|
+
var slice = clipboardTextParser(query, editorState.doc.resolve(0));
|
|
494
|
+
var resetQueryTransaction = editorState.tr.setMeta('addToHistory', addToHistory).replace(0, editorState.doc.content.size, slice);
|
|
495
|
+
dispatch(actions.onApplyEditorTransaction(resetQueryTransaction));
|
|
496
|
+
dispatch(actions.updateValidationState());
|
|
497
|
+
if (enableRichInlineNodes) {
|
|
498
|
+
void dispatch(hydrateQuery());
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
},
|
|
502
|
+
initialiseEditorView: function initialiseEditorView(editorViewNode, attributes, portalActions) {
|
|
503
|
+
return function (_ref25, _ref26) {
|
|
504
|
+
var getState = _ref25.getState,
|
|
505
|
+
setState = _ref25.setState,
|
|
506
|
+
dispatch = _ref25.dispatch;
|
|
507
|
+
var onEditorMounted = _ref26.onEditorMounted;
|
|
508
|
+
// Configure plugins that require portal rendering (i.e. autocomplete and rich inline nodes).
|
|
509
|
+
dispatch(actions.configurePlugins(portalActions));
|
|
510
|
+
var _getState9 = getState(),
|
|
511
|
+
editorState = _getState9.editorState,
|
|
512
|
+
resizeObserver = _getState9.resizeObserver;
|
|
513
|
+
var editorView = new EditorView(editorViewNode, {
|
|
514
|
+
state: editorState,
|
|
515
|
+
dispatchTransaction: function dispatchTransaction(transaction) {
|
|
516
|
+
return dispatch(actions.onApplyEditorTransaction(transaction));
|
|
517
|
+
},
|
|
518
|
+
clipboardTextSerializer: clipboardTextSerializer,
|
|
519
|
+
clipboardTextParser: clipboardTextParser,
|
|
520
|
+
attributes: attributes
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
// Unobserve previously observed elements
|
|
524
|
+
resizeObserver === null || resizeObserver === void 0 || resizeObserver.disconnect();
|
|
525
|
+
|
|
526
|
+
// Observe size changes to update rect
|
|
527
|
+
resizeObserver === null || resizeObserver === void 0 || resizeObserver.observe(editorViewNode);
|
|
528
|
+
setState({
|
|
529
|
+
editorView: editorView
|
|
530
|
+
});
|
|
531
|
+
onEditorMounted && onEditorMounted();
|
|
532
|
+
};
|
|
533
|
+
},
|
|
534
|
+
updateEditorView: function updateEditorView(attributes) {
|
|
535
|
+
return function (_ref27) {
|
|
536
|
+
var getState = _ref27.getState;
|
|
537
|
+
var _getState10 = getState(),
|
|
538
|
+
editorView = _getState10.editorView,
|
|
539
|
+
onDebugUnsafeMessage = _getState10.onDebugUnsafeMessage,
|
|
540
|
+
editorState = _getState10.editorState;
|
|
541
|
+
if (editorView) {
|
|
542
|
+
try {
|
|
543
|
+
editorView.update(_objectSpread(_objectSpread({}, editorView.props), {}, {
|
|
544
|
+
attributes: attributes
|
|
545
|
+
}));
|
|
546
|
+
} catch (error) {
|
|
547
|
+
// We've observed several errors from this step but we're unsure how to reproduce it. It seems to be some type of
|
|
548
|
+
// race condition whether the view is being updated with a mismatched selection in the UI. We'll catch the error
|
|
549
|
+
// so the UI doesn't break trying to change attributes and fire a callback to debug the error.
|
|
550
|
+
var message = "Error occurred trying to update attributes on the editor view with the message: ".concat(error instanceof Error ? error.message : String(error));
|
|
551
|
+
var attributeDiff = Object.keys(attributes).reduce(function (result, key) {
|
|
552
|
+
var _editorView$props$att;
|
|
553
|
+
var prevAttr = // @ts-ignore
|
|
554
|
+
(_editorView$props$att = editorView.props.attributes) === null || _editorView$props$att === void 0 ? void 0 : _editorView$props$att[key];
|
|
555
|
+
var nextAttr = attributes[key];
|
|
556
|
+
if (nextAttr !== prevAttr) {
|
|
557
|
+
// @ts-ignore
|
|
558
|
+
result["prev_".concat(key)] = prevAttr;
|
|
559
|
+
// @ts-ignore
|
|
560
|
+
result["next_".concat(key)] = nextAttr;
|
|
561
|
+
}
|
|
562
|
+
return result;
|
|
563
|
+
}, {});
|
|
564
|
+
sendDebugMessage(message, editorView, editorState, onDebugUnsafeMessage, _objectSpread({
|
|
565
|
+
stack: error instanceof Error ? error.stack : ''
|
|
566
|
+
}, attributeDiff));
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
},
|
|
571
|
+
setEditorViewContainer: function setEditorViewContainer(editorViewContainer) {
|
|
572
|
+
return function (_ref28) {
|
|
573
|
+
var setState = _ref28.setState;
|
|
574
|
+
setState({
|
|
575
|
+
editorViewContainer: editorViewContainer,
|
|
576
|
+
// Set initial rect
|
|
577
|
+
editorViewContainerRect: editorViewContainer === null || editorViewContainer === void 0 ? void 0 : editorViewContainer.getBoundingClientRect()
|
|
578
|
+
});
|
|
579
|
+
};
|
|
580
|
+
},
|
|
581
|
+
setEditorViewContainerScroll: function setEditorViewContainerScroll(scroll) {
|
|
582
|
+
return function (_ref29) {
|
|
583
|
+
var setState = _ref29.setState;
|
|
584
|
+
setState({
|
|
585
|
+
editorViewContainerScroll: scroll
|
|
586
|
+
});
|
|
587
|
+
};
|
|
588
|
+
},
|
|
589
|
+
onSearch: function onSearch() {
|
|
590
|
+
return function (_ref30) {
|
|
591
|
+
var getState = _ref30.getState,
|
|
592
|
+
dispatch = _ref30.dispatch;
|
|
593
|
+
var _getState11 = getState(),
|
|
594
|
+
editorState = _getState11.editorState,
|
|
595
|
+
editorView = _getState11.editorView;
|
|
596
|
+
dispatch(
|
|
597
|
+
// Set keyboardShortcut arg to false as this action is invoked directly by the search UI button
|
|
598
|
+
actions.onSearchCommand(editorState, editorView === null || editorView === void 0 ? void 0 : editorView.dispatch, editorView, false));
|
|
599
|
+
};
|
|
600
|
+
},
|
|
601
|
+
onSearchCommand: function onSearchCommand(pmState, pmDispatch, pmView, keyboardShortcut) {
|
|
602
|
+
return function (_ref31, _ref32) {
|
|
603
|
+
var getState = _ref31.getState,
|
|
604
|
+
dispatch = _ref31.dispatch;
|
|
605
|
+
var onSearch = _ref32.onSearch,
|
|
606
|
+
createAndFireAnalyticsEvent = _ref32.createAndFireAnalyticsEvent;
|
|
607
|
+
if (!onSearch) {
|
|
608
|
+
return true;
|
|
609
|
+
}
|
|
610
|
+
var jast = getJastFromState(pmState);
|
|
611
|
+
var _getState12 = getState(),
|
|
612
|
+
query = _getState12.query;
|
|
613
|
+
onSearch(query, jast);
|
|
614
|
+
createAndFireAnalyticsEvent({
|
|
615
|
+
action: AnalyticsAction.CLICKED,
|
|
616
|
+
actionSubject: ActionSubject.BUTTON,
|
|
617
|
+
actionSubjectId: ActionSubjectId.EDITOR_SEARCH,
|
|
618
|
+
eventType: EventType.UI,
|
|
619
|
+
attributes: _objectSpread(_objectSpread({}, computeJqlInsights(jast)), {}, {
|
|
620
|
+
keyboardShortcut: keyboardShortcut
|
|
621
|
+
})
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
// Update JQL validation state
|
|
625
|
+
dispatch(actions.updateValidationState());
|
|
626
|
+
|
|
627
|
+
// Invoke command to select any errors in the query
|
|
628
|
+
selectErrorCommand(pmState, pmDispatch, pmView);
|
|
629
|
+
return true;
|
|
630
|
+
};
|
|
631
|
+
},
|
|
632
|
+
externalErrorMessageViewed: function externalErrorMessageViewed() {
|
|
633
|
+
return function (_ref33, _ref34) {
|
|
634
|
+
var getState = _ref33.getState;
|
|
635
|
+
var createAndFireAnalyticsEvent = _ref34.createAndFireAnalyticsEvent,
|
|
636
|
+
externalMessages = _ref34.externalMessages;
|
|
637
|
+
var _getState13 = getState(),
|
|
638
|
+
editorView = _getState13.editorView,
|
|
639
|
+
onDebugUnsafeMessage = _getState13.onDebugUnsafeMessage,
|
|
640
|
+
jqlError = _getState13.jqlError,
|
|
641
|
+
editorState = _getState13.editorState;
|
|
642
|
+
var externalErrors = externalMessages.filter(function (_ref35) {
|
|
643
|
+
var type = _ref35.type;
|
|
644
|
+
return type === 'error';
|
|
645
|
+
});
|
|
646
|
+
if (externalErrors.length > 0) {
|
|
647
|
+
var hasClientError = jqlError !== null;
|
|
648
|
+
var initialValue = {
|
|
649
|
+
hasClientError: hasClientError,
|
|
650
|
+
semanticErrorCount: 0,
|
|
651
|
+
syntaxErrorCount: 0,
|
|
652
|
+
syntaxErrorTypes: []
|
|
653
|
+
};
|
|
654
|
+
var attributes = externalErrors.reduce(function (result, _ref36) {
|
|
655
|
+
var errorType = _ref36.errorType;
|
|
656
|
+
if (typeof errorType === 'string') {
|
|
657
|
+
result.syntaxErrorCount++;
|
|
658
|
+
result.syntaxErrorTypes.push(errorType);
|
|
659
|
+
} else {
|
|
660
|
+
result.semanticErrorCount++;
|
|
661
|
+
}
|
|
662
|
+
return result;
|
|
663
|
+
}, initialValue);
|
|
664
|
+
attributes.syntaxErrorTypes.sort();
|
|
665
|
+
createAndFireAnalyticsEvent({
|
|
666
|
+
action: AnalyticsAction.VIEWED,
|
|
667
|
+
actionSubject: ActionSubject.ERROR_MESSAGE,
|
|
668
|
+
actionSubjectId: ActionSubjectId.JQL_RESULT,
|
|
669
|
+
eventType: EventType.UI,
|
|
670
|
+
attributes: attributes
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
// If we have JQL errors which have been externally provided but no errors in our JAST, then we may have gaps in
|
|
674
|
+
// our client side validation. Let's monitor any errors we weren't expecting.
|
|
675
|
+
if (editorView && !hasClientError && attributes.syntaxErrorCount > 0) {
|
|
676
|
+
var message = 'External JQL syntax error is shown without a client error.';
|
|
677
|
+
sendDebugMessage(message, editorView, editorState, onDebugUnsafeMessage, {
|
|
678
|
+
syntaxErrorTypes: attributes.syntaxErrorTypes.join(',')
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
},
|
|
684
|
+
createAndFireAnalyticsEvent: function createAndFireAnalyticsEvent(payload) {
|
|
685
|
+
return function (_, _ref37) {
|
|
686
|
+
var createAndFireAnalyticsEvent = _ref37.createAndFireAnalyticsEvent;
|
|
687
|
+
createAndFireAnalyticsEvent(payload);
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
};
|
|
691
|
+
var Store = createStore({
|
|
692
|
+
name: 'jql-editor',
|
|
693
|
+
initialState: initialState,
|
|
694
|
+
actions: actions
|
|
695
|
+
});
|
|
696
|
+
export var useStoreActions = createHook(Store, {
|
|
697
|
+
selector: null
|
|
698
|
+
});
|
|
699
|
+
export var useEditorState = createHook(Store, {
|
|
700
|
+
selector: function selector(state) {
|
|
701
|
+
return state.editorState;
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
export var useEditorView = createHook(Store, {
|
|
705
|
+
selector: function selector(state) {
|
|
706
|
+
return state.editorView;
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
export var useIsSearching = createHook(Store, {
|
|
710
|
+
selector: function selector(state) {
|
|
711
|
+
return state.isSearching;
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
export var useIntl = createHook(Store, {
|
|
715
|
+
selector: function selector(state) {
|
|
716
|
+
return state.intlRef.current;
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
export var useAutocompleteProvider = createHook(Store, {
|
|
720
|
+
selector: function selector(state) {
|
|
721
|
+
return state.autocompleteProvider;
|
|
722
|
+
}
|
|
723
|
+
});
|
|
724
|
+
var getScopedId = function getScopedId(state, idSuffix) {
|
|
725
|
+
return "".concat(state.idPrefix, "_").concat(idSuffix);
|
|
726
|
+
};
|
|
727
|
+
export var useScopedId = createHook(Store, {
|
|
728
|
+
selector: getScopedId
|
|
729
|
+
});
|
|
730
|
+
export var useIdPrefix = createHook(Store, {
|
|
731
|
+
selector: function selector(state) {
|
|
732
|
+
return state.idPrefix;
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
export var useEditorViewHasFocus = createHook(Store, {
|
|
736
|
+
selector: function selector(_ref38) {
|
|
737
|
+
var editorViewHasFocus = _ref38.editorViewHasFocus;
|
|
738
|
+
return editorViewHasFocus;
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
export var useLineNumbersVisible = createHook(Store, {
|
|
742
|
+
selector: function selector(_ref39) {
|
|
743
|
+
var lineNumbersVisible = _ref39.lineNumbersVisible;
|
|
744
|
+
return lineNumbersVisible;
|
|
745
|
+
}
|
|
746
|
+
});
|
|
747
|
+
var getAutocomplete = function getAutocomplete(state) {
|
|
748
|
+
return state.autocomplete;
|
|
749
|
+
};
|
|
750
|
+
export var useAutocomplete = createHook(Store, {
|
|
751
|
+
selector: getAutocomplete
|
|
752
|
+
});
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* Returns the JQL error from the last query that was searched, or {@code null} if there were none.
|
|
756
|
+
*/
|
|
757
|
+
export var useJqlError = createHook(Store, {
|
|
758
|
+
selector: function selector(state) {
|
|
759
|
+
return state.jqlError;
|
|
760
|
+
}
|
|
761
|
+
});
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Returns whether there are any JQL errors in the current Prosemirror editor state.
|
|
765
|
+
*/
|
|
766
|
+
export var useEditorStateHasJqlError = createHook(Store, {
|
|
767
|
+
selector: function selector(state) {
|
|
768
|
+
return getJastFromState(state.editorState).errors.length > 0;
|
|
769
|
+
}
|
|
770
|
+
});
|
|
771
|
+
export var useExternalMessages = createHook(Store, {
|
|
772
|
+
selector: function selector(state) {
|
|
773
|
+
var byType = groupBy(state.externalMessages, 'type');
|
|
774
|
+
return {
|
|
775
|
+
errors: byType.error || [],
|
|
776
|
+
warnings: byType.warning || [],
|
|
777
|
+
infos: byType.info || []
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
var memoizedAutocompleteOptionsSelector = createSelector(function (state) {
|
|
782
|
+
return state.autocomplete.options.tokens;
|
|
783
|
+
}, function (state) {
|
|
784
|
+
return state.autocomplete.options.functions;
|
|
785
|
+
}, function (state) {
|
|
786
|
+
return state.autocomplete.options.values;
|
|
787
|
+
}, function (state) {
|
|
788
|
+
return state.autocomplete.options.operators;
|
|
789
|
+
}, function (state) {
|
|
790
|
+
return state.autocomplete.options.fields;
|
|
791
|
+
}, function (tokens, functions, values, operators, fields) {
|
|
792
|
+
return [].concat(_toConsumableArray(tokens), _toConsumableArray(functions), _toConsumableArray(values), _toConsumableArray(operators), _toConsumableArray(fields));
|
|
793
|
+
});
|
|
794
|
+
export var useAutocompleteOptions = createHook(Store, {
|
|
795
|
+
selector: memoizedAutocompleteOptionsSelector
|
|
796
|
+
});
|
|
797
|
+
var autocompleteIsLoadingSelector = function autocompleteIsLoadingSelector(state) {
|
|
798
|
+
return state.autocomplete.loading;
|
|
799
|
+
};
|
|
800
|
+
export var useAutocompleteLoading = createHook(Store, {
|
|
801
|
+
selector: autocompleteIsLoadingSelector
|
|
802
|
+
});
|
|
803
|
+
var memoizedAutocompleteIsOpenSelector = createSelector(function (state) {
|
|
804
|
+
return state.editorViewHasFocus;
|
|
805
|
+
}, memoizedAutocompleteOptionsSelector, autocompleteIsLoadingSelector, function (state) {
|
|
806
|
+
return state.autocomplete.shouldStayClosed;
|
|
807
|
+
}, function (hasFocus, options, loading, shouldStayClosed) {
|
|
808
|
+
return !shouldStayClosed && hasFocus && (options.length > 0 || loading);
|
|
809
|
+
});
|
|
810
|
+
export var useAutocompleteIsOpen = createHook(Store, {
|
|
811
|
+
selector: memoizedAutocompleteIsOpenSelector
|
|
812
|
+
});
|
|
813
|
+
export var useAutocompletePosition = createHook(Store, {
|
|
814
|
+
selector: function selector(state) {
|
|
815
|
+
var _offsetParentRect$lef, _offsetParentRect$top;
|
|
816
|
+
var autocomplete = state.autocomplete,
|
|
817
|
+
editorView = state.editorView,
|
|
818
|
+
editorViewContainerRect = state.editorViewContainerRect,
|
|
819
|
+
onDebugUnsafeMessage = state.onDebugUnsafeMessage,
|
|
820
|
+
editorState = state.editorState;
|
|
821
|
+
var replacePositionStart = autocomplete.replacePositionStart,
|
|
822
|
+
offsetParentRect = autocomplete.offsetParentRect;
|
|
823
|
+
if (!editorView) {
|
|
824
|
+
// Should never™ happen
|
|
825
|
+
return {
|
|
826
|
+
top: 0,
|
|
827
|
+
left: 0
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
var docTop;
|
|
831
|
+
var docLeft;
|
|
832
|
+
try {
|
|
833
|
+
var autocompletePosition = getAutocompletePosition(editorView, replacePositionStart);
|
|
834
|
+
docTop = autocompletePosition.top;
|
|
835
|
+
docLeft = autocompletePosition.left;
|
|
836
|
+
} catch (error) {
|
|
837
|
+
var _editorViewContainerR, _editorViewContainerR2;
|
|
838
|
+
// We've observed several 'Invalid position: x' errors from this step but we're unsure how to reproduce it. It
|
|
839
|
+
// seems to be some type of race condition whether the view is being updated with a mismatched selection in the
|
|
840
|
+
// UI. We'll catch the error so the UI doesn't break and fire a callback to debug the error.
|
|
841
|
+
var message = "Error occurred trying to get autocomplete position with the message: ".concat(error instanceof Error ? error.message : String(error));
|
|
842
|
+
sendDebugMessage(message, editorView, editorState, onDebugUnsafeMessage, {
|
|
843
|
+
stack: error instanceof Error ? error.stack : ''
|
|
844
|
+
});
|
|
845
|
+
|
|
846
|
+
// Fallback to showing autocomplete at bottom left of editor view if we were unable to calculate the position.
|
|
847
|
+
docTop = (_editorViewContainerR = editorViewContainerRect === null || editorViewContainerRect === void 0 ? void 0 : editorViewContainerRect.bottom) !== null && _editorViewContainerR !== void 0 ? _editorViewContainerR : 0;
|
|
848
|
+
docLeft = (_editorViewContainerR2 = editorViewContainerRect === null || editorViewContainerRect === void 0 ? void 0 : editorViewContainerRect.left) !== null && _editorViewContainerR2 !== void 0 ? _editorViewContainerR2 : 0;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
// In some situations, we can get an autocompleteTop that exceeds editor view container top/bottom boundaries,
|
|
852
|
+
// e.g. when editor content overflows editor view container and selection start/end is not visible. To prevent
|
|
853
|
+
// situations where autocomplete dropdown greatly overflows editor view container, we clamp this position.
|
|
854
|
+
// We also offset top position returned by ProseMirror to ensure autocomplete is positioned consistently at
|
|
855
|
+
// a grid size distance from editor input bottom in all situations where autocomplete is outside of the editor.
|
|
856
|
+
var autocompleteTop = docTop + gridSize();
|
|
857
|
+
var viewportTop = editorViewContainerRect !== undefined ? clamp(autocompleteTop, editorViewContainerRect.top, editorViewContainerRect.bottom) : autocompleteTop;
|
|
858
|
+
var left = docLeft - ((_offsetParentRect$lef = offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.left) !== null && _offsetParentRect$lef !== void 0 ? _offsetParentRect$lef : 0);
|
|
859
|
+
var top = viewportTop - ((_offsetParentRect$top = offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.top) !== null && _offsetParentRect$top !== void 0 ? _offsetParentRect$top : 0);
|
|
860
|
+
return {
|
|
861
|
+
// Left position from ProseMirror - autocomplete option padding so texts are vertically aligned
|
|
862
|
+
left: left - 5 / 4 * gridSize(),
|
|
863
|
+
top: top + gridSize()
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
});
|
|
867
|
+
export var useHydratedValue = createHook(Store, {
|
|
868
|
+
selector: function selector(state, _ref40) {
|
|
869
|
+
var _state$hydratedValues;
|
|
870
|
+
var id = _ref40.id,
|
|
871
|
+
fieldName = _ref40.fieldName;
|
|
872
|
+
return (_state$hydratedValues = state.hydratedValues[fieldName]) === null || _state$hydratedValues === void 0 ? void 0 : _state$hydratedValues.get(id);
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
export var useHydratedUser = createHook(Store, {
|
|
876
|
+
selector: function selector(state, _ref41) {
|
|
877
|
+
var _state$hydratedValues2;
|
|
878
|
+
var id = _ref41.id,
|
|
879
|
+
fieldName = _ref41.fieldName;
|
|
880
|
+
var user = (_state$hydratedValues2 = state.hydratedValues[fieldName]) === null || _state$hydratedValues2 === void 0 ? void 0 : _state$hydratedValues2.get(id);
|
|
881
|
+
return user && user.type === 'user' ? user : undefined;
|
|
882
|
+
}
|
|
883
|
+
});
|
|
884
|
+
export var useHydratedDeprecations = createHook(Store, {
|
|
885
|
+
selector: function selector(state) {
|
|
886
|
+
var ast = getJastFromState(state.editorState);
|
|
887
|
+
var fieldsInQuery = getFieldNodes(ast);
|
|
888
|
+
var toReturn = [];
|
|
889
|
+
Object.entries(state.hydratedValues).forEach(function (_ref42) {
|
|
890
|
+
var _state$hydratedValues3;
|
|
891
|
+
var _ref43 = _slicedToArray(_ref42, 1),
|
|
892
|
+
fieldName = _ref43[0];
|
|
893
|
+
(_state$hydratedValues3 = state.hydratedValues[fieldName]) === null || _state$hydratedValues3 === void 0 || _state$hydratedValues3.forEach(function (value) {
|
|
894
|
+
if (value.type === 'deprecated-field') {
|
|
895
|
+
if (fieldsInQuery.has(value.id.toLowerCase())) {
|
|
896
|
+
toReturn.push(value);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
});
|
|
901
|
+
return toReturn;
|
|
902
|
+
}
|
|
903
|
+
});
|
|
904
|
+
export var useRichInlineNodesEnabled = createHook(Store, {
|
|
905
|
+
selector: function selector(state) {
|
|
906
|
+
return state.enableRichInlineNodes;
|
|
907
|
+
}
|
|
908
|
+
});
|
|
909
|
+
export var useOnSyntaxHelp = createHook(Store, {
|
|
910
|
+
selector: function selector(state) {
|
|
911
|
+
return state.onSyntaxHelp;
|
|
912
|
+
}
|
|
913
|
+
});
|
|
914
|
+
export var EditorStateContainer = createContainer(Store, {
|
|
915
|
+
onInit: function onInit() {
|
|
916
|
+
return function (_ref44, _ref45) {
|
|
917
|
+
var getState = _ref44.getState,
|
|
918
|
+
setState = _ref44.setState,
|
|
919
|
+
dispatch = _ref44.dispatch;
|
|
920
|
+
var intlRef = _ref45.intlRef,
|
|
921
|
+
query = _ref45.query,
|
|
922
|
+
isSearching = _ref45.isSearching,
|
|
923
|
+
autocompleteProvider = _ref45.autocompleteProvider,
|
|
924
|
+
externalMessages = _ref45.externalMessages,
|
|
925
|
+
enableRichInlineNodes = _ref45.enableRichInlineNodes,
|
|
926
|
+
onDebugUnsafeMessage = _ref45.onDebugUnsafeMessage,
|
|
927
|
+
onSyntaxHelp = _ref45.onSyntaxHelp;
|
|
928
|
+
setState({
|
|
929
|
+
controlledQuery: query,
|
|
930
|
+
query: query,
|
|
931
|
+
externalMessages: externalMessages,
|
|
932
|
+
isSearching: isSearching,
|
|
933
|
+
intlRef: intlRef,
|
|
934
|
+
autocompleteProvider: autocompleteProvider,
|
|
935
|
+
enableRichInlineNodes: enableRichInlineNodes,
|
|
936
|
+
// Generate unique identifiers for each JQL editor instance
|
|
937
|
+
idPrefix: uuidv4(),
|
|
938
|
+
resizeObserver: window.ResizeObserver !== undefined ? new window.ResizeObserver(function () {
|
|
939
|
+
var _getState$editorViewC;
|
|
940
|
+
setState({
|
|
941
|
+
// We assume editor view container is the only element using the observer to avoid extra processing.
|
|
942
|
+
// If this instance is reused to observe more elements (which is a good practice to optimize performance),
|
|
943
|
+
// we would need to adjust this logic.
|
|
944
|
+
editorViewContainerRect: (_getState$editorViewC = getState().editorViewContainer) === null || _getState$editorViewC === void 0 ? void 0 : _getState$editorViewC.getBoundingClientRect()
|
|
945
|
+
});
|
|
946
|
+
}) : undefined,
|
|
947
|
+
onDebugUnsafeMessage: onDebugUnsafeMessage,
|
|
948
|
+
onSyntaxHelp: onSyntaxHelp
|
|
949
|
+
});
|
|
950
|
+
dispatch(actions.initialiseEditorState());
|
|
951
|
+
};
|
|
952
|
+
},
|
|
953
|
+
onUpdate: function onUpdate() {
|
|
954
|
+
return function (_ref46, _ref47) {
|
|
955
|
+
var getState = _ref46.getState,
|
|
956
|
+
setState = _ref46.setState,
|
|
957
|
+
dispatch = _ref46.dispatch;
|
|
958
|
+
var controlledQueryProp = _ref47.query,
|
|
959
|
+
isSearching = _ref47.isSearching,
|
|
960
|
+
autocompleteProvider = _ref47.autocompleteProvider,
|
|
961
|
+
externalMessages = _ref47.externalMessages,
|
|
962
|
+
enableRichInlineNodes = _ref47.enableRichInlineNodes,
|
|
963
|
+
onDebugUnsafeMessage = _ref47.onDebugUnsafeMessage,
|
|
964
|
+
onSyntaxHelp = _ref47.onSyntaxHelp;
|
|
965
|
+
var _getState14 = getState(),
|
|
966
|
+
controlledQuery = _getState14.controlledQuery,
|
|
967
|
+
query = _getState14.query;
|
|
968
|
+
|
|
969
|
+
// Track changes to our controlledQuery state
|
|
970
|
+
if (controlledQuery !== controlledQueryProp) {
|
|
971
|
+
setState({
|
|
972
|
+
controlledQuery: controlledQueryProp
|
|
973
|
+
});
|
|
974
|
+
|
|
975
|
+
// If the controlled query prop has changed and it doesn't match the query in our editor then we need to reset
|
|
976
|
+
// the editor state.
|
|
977
|
+
if (controlledQueryProp !== query) {
|
|
978
|
+
dispatch(actions.resetEditorState(controlledQueryProp));
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
setState({
|
|
982
|
+
externalMessages: externalMessages,
|
|
983
|
+
isSearching: isSearching,
|
|
984
|
+
autocompleteProvider: autocompleteProvider,
|
|
985
|
+
enableRichInlineNodes: enableRichInlineNodes,
|
|
986
|
+
onDebugUnsafeMessage: onDebugUnsafeMessage,
|
|
987
|
+
onSyntaxHelp: onSyntaxHelp
|
|
988
|
+
});
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
});
|