@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,30 @@
|
|
|
1
|
+
import mapKeys from 'lodash/mapKeys';
|
|
2
|
+
import mapValues from 'lodash/mapValues';
|
|
3
|
+
import { RICH_INLINE_NODE } from '../constants';
|
|
4
|
+
export var createNodeSpec = function createNodeSpec(name, attrs) {
|
|
5
|
+
return {
|
|
6
|
+
group: RICH_INLINE_NODE,
|
|
7
|
+
content: 'text*',
|
|
8
|
+
inline: true,
|
|
9
|
+
atom: true,
|
|
10
|
+
// treat node as a leaf
|
|
11
|
+
attrs: attrs,
|
|
12
|
+
toDOM: function toDOM(node) {
|
|
13
|
+
var domAttrs = mapKeys(node.attrs, function (_, attr) {
|
|
14
|
+
return "data-".concat(attr);
|
|
15
|
+
});
|
|
16
|
+
return [name, domAttrs, 0];
|
|
17
|
+
},
|
|
18
|
+
parseDOM: [{
|
|
19
|
+
tag: name,
|
|
20
|
+
getAttrs: function getAttrs(node) {
|
|
21
|
+
if (node instanceof Element) {
|
|
22
|
+
return mapValues(attrs, function (_, attr) {
|
|
23
|
+
return node.getAttribute("data-".concat(attr));
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return null; // should never™ happen
|
|
27
|
+
}
|
|
28
|
+
}]
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
|
+
function 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; }
|
|
7
|
+
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; }
|
|
8
|
+
import React, { useEffect, useLayoutEffect, useState } from 'react';
|
|
9
|
+
import { Subject } from 'rxjs/Subject';
|
|
10
|
+
import { v4 as uuid } from 'uuid';
|
|
11
|
+
import { useEditorViewHasFocus } from '../../../state';
|
|
12
|
+
import { ERROR_NODE, SELECTED_NODE } from '../constants';
|
|
13
|
+
export var ReactNodeView = /*#__PURE__*/function () {
|
|
14
|
+
function ReactNodeView(component, portalActions, _node) {
|
|
15
|
+
var _this = this;
|
|
16
|
+
_classCallCheck(this, ReactNodeView);
|
|
17
|
+
_defineProperty(this, "componentSubject", new Subject());
|
|
18
|
+
_defineProperty(this, "init", function (decorations) {
|
|
19
|
+
var Component = _this.component;
|
|
20
|
+
var PortallingComponent = function PortallingComponent() {
|
|
21
|
+
var _useState = useState(_objectSpread(_objectSpread({}, _this.getProps(_this.node)), {}, {
|
|
22
|
+
selected: _this.isSelected(decorations),
|
|
23
|
+
error: _this.hasError(decorations)
|
|
24
|
+
})),
|
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
+
state = _useState2[0],
|
|
27
|
+
setState = _useState2[1];
|
|
28
|
+
|
|
29
|
+
// ProseMirror keeps decorations on blur (as those are derived from editor state and focus isn't part of it),
|
|
30
|
+
// but we don't want to show node views as selected when that happens. We could build a workaround for this in
|
|
31
|
+
// richInlineNodesPlugin, but this hook will make selection behave more consistently with other focus-related features.
|
|
32
|
+
var _useEditorViewHasFocu = useEditorViewHasFocus(),
|
|
33
|
+
_useEditorViewHasFocu2 = _slicedToArray(_useEditorViewHasFocu, 1),
|
|
34
|
+
hasFocus = _useEditorViewHasFocu2[0];
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
// Subscribe to the RxJS subject so concrete subclasses can emit events to re-render the node view component
|
|
37
|
+
var subscription = _this.componentSubject.subscribe(function (props) {
|
|
38
|
+
setState(props);
|
|
39
|
+
});
|
|
40
|
+
return function () {
|
|
41
|
+
return subscription.unsubscribe();
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
useLayoutEffect(function () {
|
|
45
|
+
if (state.error) {
|
|
46
|
+
_this.dom.dataset.tokenType = 'error';
|
|
47
|
+
} else {
|
|
48
|
+
delete _this.dom.dataset.tokenType;
|
|
49
|
+
}
|
|
50
|
+
}, [state]);
|
|
51
|
+
return /*#__PURE__*/React.createElement(Component, _extends({}, state, {
|
|
52
|
+
selected: state.selected && hasFocus
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// Ok, this is a tricky one. As everything that requires collaboration between ProseMirror and React.
|
|
57
|
+
//
|
|
58
|
+
// If we run `onCreatePortal` synchronously, ProseMirror won't insert the node view container (`this.dom`)
|
|
59
|
+
// immediately into the DOM (as init function hasn't returned yet). This can trigger race conditions in other
|
|
60
|
+
// code paths where ProseMirror may try to get DOM position for this node view before it has been inserted
|
|
61
|
+
// (e.g. calculating new autocomplete position after insertion, or setting selection after the node).
|
|
62
|
+
//
|
|
63
|
+
// With `queueMicrotask` we can schedule this operation to be run after ProseMirror is done with the element
|
|
64
|
+
// insertion, but before control of the execution context is returned to the browser's event loop. This should
|
|
65
|
+
// prevent all conflicts with other pieces of asynchronous code and still render the portal as soon as it is
|
|
66
|
+
// practically possible, so we can avoid flicker in situations where node views are reconstructed by ProseMirror.
|
|
67
|
+
// @see https://github.com/ProseMirror/prosemirror/issues/872
|
|
68
|
+
queueMicrotask(function () {
|
|
69
|
+
_this.portalActions.onCreatePortal(_this.portalKey, /*#__PURE__*/React.createElement(PortallingComponent, null), _this.dom);
|
|
70
|
+
});
|
|
71
|
+
return _this;
|
|
72
|
+
});
|
|
73
|
+
_defineProperty(this, "destroy", function () {
|
|
74
|
+
_this.portalActions.onDestroyPortal(_this.portalKey);
|
|
75
|
+
});
|
|
76
|
+
_defineProperty(this, "update", function (node, decorations) {
|
|
77
|
+
// Update function may be called by ProseMirror with a node that has nothing to do with this node view ¯\_(ツ)_/¯
|
|
78
|
+
// @see https://prosemirror.net/docs/ref/#view.NodeView.update
|
|
79
|
+
if (node !== _this.node) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
_this.componentSubject.next(_objectSpread(_objectSpread({}, _this.getProps(node)), {}, {
|
|
83
|
+
selected: _this.isSelected(decorations),
|
|
84
|
+
error: _this.hasError(decorations)
|
|
85
|
+
}));
|
|
86
|
+
return true;
|
|
87
|
+
});
|
|
88
|
+
_defineProperty(this, "getProps", function (node) {
|
|
89
|
+
return _objectSpread({}, node.attrs);
|
|
90
|
+
});
|
|
91
|
+
_defineProperty(this, "isSelected", function (decorations) {
|
|
92
|
+
return decorations.some(function (decoration) {
|
|
93
|
+
return decoration.spec.type === SELECTED_NODE;
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
_defineProperty(this, "hasError", function (decorations) {
|
|
97
|
+
return decorations.some(function (decoration) {
|
|
98
|
+
return decoration.spec.type === ERROR_NODE;
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
this.component = component;
|
|
102
|
+
this.portalActions = portalActions;
|
|
103
|
+
this.node = _node;
|
|
104
|
+
// Generate unique portal identifier
|
|
105
|
+
// If you read this comment in the future and TypeScript has added support for Symbols as object keys, please do
|
|
106
|
+
// JQL Editor a favor and replace this library with the native JS functionality that TS was supposed to support.
|
|
107
|
+
this.portalKey = uuid();
|
|
108
|
+
// Creating span under the assumption that all node views will be inline elements in JQL Editor
|
|
109
|
+
this.dom = document.createElement('span');
|
|
110
|
+
this.dom.setAttribute('data-testid', 'jql-editor-node-view');
|
|
111
|
+
}
|
|
112
|
+
_createClass(ReactNodeView, null, [{
|
|
113
|
+
key: "for",
|
|
114
|
+
value: function _for(component, portalActions, node, decorations) {
|
|
115
|
+
return new ReactNodeView(component, portalActions, node).init(decorations);
|
|
116
|
+
}
|
|
117
|
+
}]);
|
|
118
|
+
return ReactNodeView;
|
|
119
|
+
}();
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
10
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
|
+
import { AbstractJastVisitor } from '@atlaskit/jql-ast';
|
|
15
|
+
import { JQLEditorSchema } from '../../../schema';
|
|
16
|
+
import getDocumentPosition from '../../common/get-document-position';
|
|
17
|
+
import { getJastFromState } from '../../jql-ast';
|
|
18
|
+
import { RICH_INLINE_NODE } from '../constants';
|
|
19
|
+
export var replaceRichInlineNodes = function replaceRichInlineNodes(editorState, hydratedValues) {
|
|
20
|
+
var ast = getJastFromState(editorState);
|
|
21
|
+
var transaction = editorState.tr;
|
|
22
|
+
// Do not allow users to revert this transaction with undo command so they can't land in an unhydrated state
|
|
23
|
+
transaction.setMeta('addToHistory', false);
|
|
24
|
+
Object.entries(hydratedValues).forEach(function (_ref) {
|
|
25
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
26
|
+
fieldName = _ref2[0],
|
|
27
|
+
values = _ref2[1];
|
|
28
|
+
values.forEach(function (value) {
|
|
29
|
+
if (value.type === 'user') {
|
|
30
|
+
var astNodes = getValueNodes(ast, fieldName, value.id);
|
|
31
|
+
astNodes.forEach(function (astNode) {
|
|
32
|
+
if (astNode.position) {
|
|
33
|
+
var _astNode$position = _slicedToArray(astNode.position, 2),
|
|
34
|
+
from = _astNode$position[0],
|
|
35
|
+
to = _astNode$position[1];
|
|
36
|
+
var documentFrom = getDocumentPosition(transaction.doc, from);
|
|
37
|
+
if (!isRichInlineNode(transaction.doc, documentFrom)) {
|
|
38
|
+
var documentTo = getDocumentPosition(transaction.doc, to);
|
|
39
|
+
var node = getRichInlineNode(fieldName, value, astNode.text);
|
|
40
|
+
transaction.replaceWith(documentFrom, documentTo, node);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
return transaction;
|
|
48
|
+
};
|
|
49
|
+
var getRichInlineNode = function getRichInlineNode(fieldName, value, text) {
|
|
50
|
+
switch (value.type) {
|
|
51
|
+
case 'user':
|
|
52
|
+
{
|
|
53
|
+
var textContent = JQLEditorSchema.text(text);
|
|
54
|
+
return JQLEditorSchema.nodes.user.create(_objectSpread(_objectSpread({}, value), {}, {
|
|
55
|
+
fieldName: fieldName
|
|
56
|
+
}), textContent);
|
|
57
|
+
}
|
|
58
|
+
default:
|
|
59
|
+
{
|
|
60
|
+
throw new Error("Unsupported hydrated value type ".concat(value.type));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var isRichInlineNode = function isRichInlineNode(doc, position) {
|
|
65
|
+
var _doc$resolve$nodeAfte;
|
|
66
|
+
return ((_doc$resolve$nodeAfte = doc.resolve(position).nodeAfter) === null || _doc$resolve$nodeAfte === void 0 ? void 0 : _doc$resolve$nodeAfte.type.spec.group) === RICH_INLINE_NODE;
|
|
67
|
+
};
|
|
68
|
+
var getValueNodes = function getValueNodes(ast, field, value) {
|
|
69
|
+
if (!ast.query) {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
return ast.query.accept(new FindValuesVisitor(field, value));
|
|
73
|
+
};
|
|
74
|
+
var FindValuesVisitor = /*#__PURE__*/function (_AbstractJastVisitor) {
|
|
75
|
+
_inherits(FindValuesVisitor, _AbstractJastVisitor);
|
|
76
|
+
var _super = _createSuper(FindValuesVisitor);
|
|
77
|
+
function FindValuesVisitor(field, value) {
|
|
78
|
+
var _this;
|
|
79
|
+
_classCallCheck(this, FindValuesVisitor);
|
|
80
|
+
_this = _super.call(this);
|
|
81
|
+
_defineProperty(_assertThisInitialized(_this), "visitQuery", function (query) {
|
|
82
|
+
if (query.where === undefined) {
|
|
83
|
+
return [];
|
|
84
|
+
}
|
|
85
|
+
return query.where.accept(_assertThisInitialized(_this));
|
|
86
|
+
});
|
|
87
|
+
_defineProperty(_assertThisInitialized(_this), "visitCompoundClause", function (compoundClause) {
|
|
88
|
+
return compoundClause.clauses.reduce(function (operands, compoundClause) {
|
|
89
|
+
return [].concat(_toConsumableArray(operands), _toConsumableArray(compoundClause.accept(_assertThisInitialized(_this))));
|
|
90
|
+
}, []);
|
|
91
|
+
});
|
|
92
|
+
_defineProperty(_assertThisInitialized(_this), "visitTerminalClause", function (terminalClause) {
|
|
93
|
+
if (terminalClause.field.value !== _this.field) {
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
if (terminalClause.operand === undefined) {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
return terminalClause.operand.accept(_assertThisInitialized(_this));
|
|
100
|
+
});
|
|
101
|
+
_defineProperty(_assertThisInitialized(_this), "visitNotClause", function (notClause) {
|
|
102
|
+
return notClause.clause.accept(_assertThisInitialized(_this));
|
|
103
|
+
});
|
|
104
|
+
_defineProperty(_assertThisInitialized(_this), "visitValueOperand", function (valueOperand) {
|
|
105
|
+
if (valueOperand.value !== _this.value) {
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
return [valueOperand];
|
|
109
|
+
});
|
|
110
|
+
_defineProperty(_assertThisInitialized(_this), "visitListOperand", function (listOperand) {
|
|
111
|
+
return listOperand.values.reduce(function (values, operand) {
|
|
112
|
+
return [].concat(_toConsumableArray(values), _toConsumableArray(operand.accept(_assertThisInitialized(_this))));
|
|
113
|
+
}, []);
|
|
114
|
+
});
|
|
115
|
+
_this.field = field;
|
|
116
|
+
_this.value = value;
|
|
117
|
+
return _this;
|
|
118
|
+
}
|
|
119
|
+
_createClass(FindValuesVisitor, [{
|
|
120
|
+
key: "aggregateResult",
|
|
121
|
+
value: function aggregateResult(aggregate, nextResult) {
|
|
122
|
+
return [].concat(_toConsumableArray(aggregate), _toConsumableArray(nextResult));
|
|
123
|
+
}
|
|
124
|
+
}, {
|
|
125
|
+
key: "defaultResult",
|
|
126
|
+
value: function defaultResult() {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
}]);
|
|
130
|
+
return FindValuesVisitor;
|
|
131
|
+
}(AbstractJastVisitor);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
export var JQLValidationTooltipPluginKey = new PluginKey('jql-validation-tooltip-plugin');
|
|
3
|
+
export var TOOLTIP_CLASSNAME = 'jql-validation-tooltip';
|
|
4
|
+
export var TOOLTIP_ENTER_CLASSNAME = 'jql-validation-tooltip-enter';
|
|
5
|
+
export var TOOLTIP_EXIT_CLASSNAME = 'jql-validation-tooltip-exit';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Plugin } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { JQLValidationTooltipPluginKey } from './constants';
|
|
3
|
+
import { ValidationTooltipPluginView } from './view';
|
|
4
|
+
var validationTooltipPlugin = function validationTooltipPlugin(mainId) {
|
|
5
|
+
var plugin = new Plugin({
|
|
6
|
+
key: JQLValidationTooltipPluginKey,
|
|
7
|
+
view: function view() {
|
|
8
|
+
return new ValidationTooltipPluginView(mainId);
|
|
9
|
+
},
|
|
10
|
+
state: {
|
|
11
|
+
init: function init() {
|
|
12
|
+
return false;
|
|
13
|
+
},
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
apply: function apply(tr, value) {
|
|
16
|
+
if (tr.getMeta(plugin) !== undefined) {
|
|
17
|
+
return tr.getMeta(plugin);
|
|
18
|
+
} else {
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
handleDOMEvents: {
|
|
25
|
+
mouseover: function mouseover(_ref, event) {
|
|
26
|
+
var state = _ref.state,
|
|
27
|
+
dispatch = _ref.dispatch;
|
|
28
|
+
var isHovered = plugin.getState(state);
|
|
29
|
+
if (event.target instanceof Element && event.target.closest('[data-token-type="error"]')) {
|
|
30
|
+
if (!isHovered) {
|
|
31
|
+
dispatch(state.tr.setMeta(plugin, true));
|
|
32
|
+
}
|
|
33
|
+
} else if (isHovered) {
|
|
34
|
+
dispatch(state.tr.setMeta(plugin, false));
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
},
|
|
38
|
+
mouseleave: function mouseleave(_ref2) {
|
|
39
|
+
var state = _ref2.state,
|
|
40
|
+
dispatch = _ref2.dispatch;
|
|
41
|
+
var isHovered = plugin.getState(state);
|
|
42
|
+
if (isHovered) {
|
|
43
|
+
dispatch(state.tr.setMeta(plugin, false));
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return plugin;
|
|
51
|
+
};
|
|
52
|
+
export default validationTooltipPlugin;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
import { JQLSyntaxError } from '@atlaskit/jql-ast';
|
|
6
|
+
import getDocumentPosition from '../common/get-document-position';
|
|
7
|
+
import { getJastFromState } from '../jql-ast';
|
|
8
|
+
import { JQLValidationTooltipPluginKey, TOOLTIP_CLASSNAME, TOOLTIP_ENTER_CLASSNAME, TOOLTIP_EXIT_CLASSNAME } from './constants';
|
|
9
|
+
export var ValidationTooltipPluginView = /*#__PURE__*/function () {
|
|
10
|
+
function ValidationTooltipPluginView(mainId) {
|
|
11
|
+
var _this = this,
|
|
12
|
+
_document$getElementB;
|
|
13
|
+
_classCallCheck(this, ValidationTooltipPluginView);
|
|
14
|
+
_defineProperty(this, "showTooltip", function (error, start, end) {
|
|
15
|
+
var _this$tooltip$offsetP, _box$left, _box$top;
|
|
16
|
+
// Find a center position from the selection endpoints
|
|
17
|
+
var left = (start.left + end.left) / 2;
|
|
18
|
+
|
|
19
|
+
// The box in which the container is positioned, to use as base
|
|
20
|
+
var box = (_this$tooltip$offsetP = _this.tooltip.offsetParent) === null || _this$tooltip$offsetP === void 0 ? void 0 : _this$tooltip$offsetP.getBoundingClientRect();
|
|
21
|
+
_this.tooltip.style.left = "".concat(left - ((_box$left = box === null || box === void 0 ? void 0 : box.left) !== null && _box$left !== void 0 ? _box$left : 0), "px");
|
|
22
|
+
_this.tooltip.style.top = "".concat(start.top - ((_box$top = box === null || box === void 0 ? void 0 : box.top) !== null && _box$top !== void 0 ? _box$top : 0), "px");
|
|
23
|
+
_this.tooltip.textContent = error.message;
|
|
24
|
+
_this.tooltip.classList.remove(TOOLTIP_EXIT_CLASSNAME);
|
|
25
|
+
_this.tooltip.classList.add(TOOLTIP_ENTER_CLASSNAME);
|
|
26
|
+
});
|
|
27
|
+
_defineProperty(this, "hideTooltip", function () {
|
|
28
|
+
_this.tooltip.classList.remove(TOOLTIP_ENTER_CLASSNAME);
|
|
29
|
+
_this.tooltip.classList.add(TOOLTIP_EXIT_CLASSNAME);
|
|
30
|
+
});
|
|
31
|
+
this.tooltip = document.createElement('div');
|
|
32
|
+
this.tooltip.setAttribute('data-testid', 'jql-validation-tooltip');
|
|
33
|
+
this.tooltip.classList.add(TOOLTIP_CLASSNAME);
|
|
34
|
+
(_document$getElementB = document.getElementById(mainId)) === null || _document$getElementB === void 0 || _document$getElementB.appendChild(this.tooltip);
|
|
35
|
+
}
|
|
36
|
+
_createClass(ValidationTooltipPluginView, [{
|
|
37
|
+
key: "update",
|
|
38
|
+
value: function update(view, lastState) {
|
|
39
|
+
var state = view.state;
|
|
40
|
+
var isHovered = JQLValidationTooltipPluginKey.getState(state);
|
|
41
|
+
var lastIsHovered = JQLValidationTooltipPluginKey.getState(lastState);
|
|
42
|
+
var jast = getJastFromState(state);
|
|
43
|
+
var _jast$errors = _slicedToArray(jast.errors, 1),
|
|
44
|
+
error = _jast$errors[0];
|
|
45
|
+
if (isHovered === lastIsHovered) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (isHovered) {
|
|
49
|
+
if (error instanceof JQLSyntaxError) {
|
|
50
|
+
var start = getDocumentPosition(state.doc, error.start);
|
|
51
|
+
var stop = getDocumentPosition(state.doc, error.stop);
|
|
52
|
+
var startCoords = view.coordsAtPos(start);
|
|
53
|
+
var stopCoords = view.coordsAtPos(stop);
|
|
54
|
+
this.showTooltip(error, startCoords, stopCoords);
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
this.hideTooltip();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "destroy",
|
|
62
|
+
value: function destroy() {
|
|
63
|
+
this.tooltip.remove();
|
|
64
|
+
}
|
|
65
|
+
}]);
|
|
66
|
+
return ValidationTooltipPluginView;
|
|
67
|
+
}();
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
import mapValues from 'lodash/mapValues';
|
|
6
|
+
import { baseKeymap } from '@atlaskit/editor-prosemirror/commands';
|
|
7
|
+
import { history, redo, undo } from '@atlaskit/editor-prosemirror/history';
|
|
8
|
+
import { keydownHandler, keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
9
|
+
import { DOMParser, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
10
|
+
import { EditorState, Plugin } from '@atlaskit/editor-prosemirror/state';
|
|
11
|
+
import { autocompletePlugin, jqlAstPlugin, jqlSyntaxHighlightingPlugin, richInlineNodesPlugin, validationTooltipPlugin } from '../plugins';
|
|
12
|
+
import { RICH_INLINE_NODE } from '../plugins/rich-inline-nodes/constants';
|
|
13
|
+
import { richInlineNodes } from '../plugins/rich-inline-nodes/nodes';
|
|
14
|
+
import { createNodeSpec } from '../plugins/rich-inline-nodes/util/create-node-spec';
|
|
15
|
+
import { getFragmentText } from '../utils/document-text';
|
|
16
|
+
import { splitTextByNewLine } from '../utils/split-text-by-new-line';
|
|
17
|
+
var createMarkWithStyle = function createMarkWithStyle(tokenType) {
|
|
18
|
+
var mark = document.createElement('span');
|
|
19
|
+
mark.className = "mark-token-".concat(tokenType);
|
|
20
|
+
mark.setAttribute('data-token-type', tokenType);
|
|
21
|
+
mark.setAttribute('spellcheck', 'false');
|
|
22
|
+
return mark;
|
|
23
|
+
};
|
|
24
|
+
export var JQLEditorSchema = new Schema({
|
|
25
|
+
nodes: _objectSpread({
|
|
26
|
+
doc: {
|
|
27
|
+
content: 'paragraph+'
|
|
28
|
+
},
|
|
29
|
+
paragraph: {
|
|
30
|
+
content: "(text|".concat(RICH_INLINE_NODE, ")*"),
|
|
31
|
+
toDOM: function toDOM() {
|
|
32
|
+
return ['p', {
|
|
33
|
+
spellcheck: 'false'
|
|
34
|
+
}, 0];
|
|
35
|
+
},
|
|
36
|
+
parseDOM: [{
|
|
37
|
+
tag: 'p'
|
|
38
|
+
}]
|
|
39
|
+
},
|
|
40
|
+
text: {}
|
|
41
|
+
}, mapValues(richInlineNodes, function (spec, name) {
|
|
42
|
+
return createNodeSpec(name, spec.attrs);
|
|
43
|
+
})),
|
|
44
|
+
marks: {
|
|
45
|
+
token: {
|
|
46
|
+
toDOM: function toDOM(_ref) {
|
|
47
|
+
var attrs = _ref.attrs;
|
|
48
|
+
return createMarkWithStyle(attrs.tokenType);
|
|
49
|
+
},
|
|
50
|
+
attrs: {
|
|
51
|
+
tokenType: {}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
cursor: {
|
|
55
|
+
toDOM: function toDOM() {
|
|
56
|
+
return document.createElement('span');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
var domParser = DOMParser.fromSchema(JQLEditorSchema);
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Emulate the behaviour of the default https://prosemirror.net/docs/ref/#view.EditorProps.clipboardTextSerializer but
|
|
65
|
+
* preserves consecutive empty block nodes.
|
|
66
|
+
*/
|
|
67
|
+
export var clipboardTextSerializer = function clipboardTextSerializer(slice) {
|
|
68
|
+
return getFragmentText(slice.content, 0, slice.content.size);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Emulate the behaviour of the default https://prosemirror.net/docs/ref/#view.EditorProps.clipboardTextParser but
|
|
73
|
+
* preserves consecutive empty lines.
|
|
74
|
+
*/
|
|
75
|
+
export var clipboardTextParser = function clipboardTextParser(text, $context) {
|
|
76
|
+
var dom = document.createElement('div');
|
|
77
|
+
// Split each line of text and wrap each in a p tag.
|
|
78
|
+
splitTextByNewLine(text).forEach(function (block) {
|
|
79
|
+
dom.appendChild(document.createElement('p')).textContent = block;
|
|
80
|
+
});
|
|
81
|
+
return domParser.parseSlice(dom, {
|
|
82
|
+
context: $context,
|
|
83
|
+
preserveWhitespace: true
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
export var defaultEditorState = EditorState.create({
|
|
87
|
+
schema: JQLEditorSchema
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// @types/prosemirror-commands@1.0.1 does not export Command and Keymap types
|
|
91
|
+
// TODO: update to Command<JQLEditorSchemaType> and Keymap<JQLEditorSchemaType> if types are bumped to a newer version
|
|
92
|
+
export var configurePlugins = function configurePlugins(editorState, onSearchCommand, intlRef, mainId, portalActions, enableRichInlineNodes) {
|
|
93
|
+
return editorState.reconfigure({
|
|
94
|
+
plugins: [history(),
|
|
95
|
+
// Other plugins rely on having AST as part of the state during a transaction, this plugin should be kept first
|
|
96
|
+
jqlAstPlugin(intlRef), jqlSyntaxHighlightingPlugin()].concat(_toConsumableArray(portalActions !== undefined ? [autocompletePlugin(portalActions, enableRichInlineNodes)].concat(_toConsumableArray(enableRichInlineNodes ? [richInlineNodesPlugin(portalActions)] : [])) : []), [validationTooltipPlugin(mainId),
|
|
97
|
+
// Keeping these at the bottom allows plugins to define custom key bindings to override default behavior
|
|
98
|
+
keymap({
|
|
99
|
+
'Mod-z': undo,
|
|
100
|
+
'Mod-Shift-z': redo,
|
|
101
|
+
'Mod-y': redo,
|
|
102
|
+
// Mimic default Enter behavior in PM's base keymap, allowing to insert new lines even when autocomplete is open
|
|
103
|
+
'Shift-Enter': baseKeymap.Enter
|
|
104
|
+
})], _toConsumableArray(!onSearchCommand ? [] : [keymapNoRepeat({
|
|
105
|
+
'Mod-Enter': onSearchCommand,
|
|
106
|
+
Enter: onSearchCommand
|
|
107
|
+
})]), [keymap(baseKeymap)])
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
var noopCommand = function noopCommand() {
|
|
111
|
+
return true;
|
|
112
|
+
};
|
|
113
|
+
function keymapNoRepeat(bindings) {
|
|
114
|
+
var handler = keydownHandler(bindings);
|
|
115
|
+
var proxyBindings = mapValues(bindings, function () {
|
|
116
|
+
return noopCommand;
|
|
117
|
+
});
|
|
118
|
+
var proxyHandler = keydownHandler(proxyBindings);
|
|
119
|
+
return new Plugin({
|
|
120
|
+
props: {
|
|
121
|
+
handleKeyDown: function handleKeyDown(view, event) {
|
|
122
|
+
if (event.repeat) {
|
|
123
|
+
return proxyHandler(view, event);
|
|
124
|
+
}
|
|
125
|
+
return handler(view, event);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Subscription } from 'rxjs/Subscription';
|
|
2
|
+
import { ActionSubject, Action as AnalyticsAction, EventType } from '../../analytics';
|
|
3
|
+
export var ANALYTICS_DEBOUNCE_MS = 2000;
|
|
4
|
+
var AUTOCOMPLETE_ANALYTICS_MEASURE = 'jql-editor-autocomplete';
|
|
5
|
+
export var onStartAutocompleteEvent = function onStartAutocompleteEvent() {
|
|
6
|
+
return function (_, _ref) {
|
|
7
|
+
var createAndFireAnalyticsEvent = _ref.createAndFireAnalyticsEvent;
|
|
8
|
+
performance.clearMeasures(AUTOCOMPLETE_ANALYTICS_MEASURE);
|
|
9
|
+
performance.clearMarks("".concat(AUTOCOMPLETE_ANALYTICS_MEASURE, "::start"));
|
|
10
|
+
performance.mark("".concat(AUTOCOMPLETE_ANALYTICS_MEASURE, "::start"));
|
|
11
|
+
var timeoutId = null;
|
|
12
|
+
var promise = new Promise(function (resolve) {
|
|
13
|
+
// Resolve the promise after a fixed debounce period
|
|
14
|
+
timeoutId = window.setTimeout(function () {
|
|
15
|
+
resolve();
|
|
16
|
+
}, ANALYTICS_DEBOUNCE_MS);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
// Create a new subscription which will cancel the analytics promise when unsubscribed
|
|
20
|
+
var analyticsSubscription = new Subscription(function () {
|
|
21
|
+
timeoutId !== null && window.clearTimeout(timeoutId);
|
|
22
|
+
});
|
|
23
|
+
var onStopAutocompleteEvent = function onStopAutocompleteEvent(isSuccess, optionTypes, hasOptions) {
|
|
24
|
+
performance.measure(AUTOCOMPLETE_ANALYTICS_MEASURE, "".concat(AUTOCOMPLETE_ANALYTICS_MEASURE, "::start"));
|
|
25
|
+
var entry = performance.getEntriesByName(AUTOCOMPLETE_ANALYTICS_MEASURE).pop();
|
|
26
|
+
var duration = entry === null || entry === void 0 ? void 0 : entry.duration;
|
|
27
|
+
|
|
28
|
+
// Fire our analytics event once our autocomplete data is fetched AND our debounced promise is resolved
|
|
29
|
+
return promise.then(function () {
|
|
30
|
+
var attributes = {
|
|
31
|
+
optionTypes: optionTypes.sort(),
|
|
32
|
+
hasOptions: hasOptions
|
|
33
|
+
};
|
|
34
|
+
if (duration !== undefined) {
|
|
35
|
+
attributes.duration = duration;
|
|
36
|
+
}
|
|
37
|
+
createAndFireAnalyticsEvent({
|
|
38
|
+
action: isSuccess ? AnalyticsAction.RETRIEVED : AnalyticsAction.RETRIEVE_FAILED,
|
|
39
|
+
actionSubject: ActionSubject.AUTOCOMPLETE_OPTION,
|
|
40
|
+
eventType: EventType.OPERATIONAL,
|
|
41
|
+
attributes: attributes
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
analyticsSubscription: analyticsSubscription,
|
|
47
|
+
onStopAutocompleteEvent: onStopAutocompleteEvent
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { map } from 'rxjs/operators/map';
|
|
2
|
+
import { OPERATOR_CHANGED, OPERATOR_EQUALS, OPERATOR_GT, OPERATOR_GT_EQUALS, OPERATOR_IN, OPERATOR_IS, OPERATOR_IS_NOT, OPERATOR_LIKE, OPERATOR_LT, OPERATOR_LT_EQUALS, OPERATOR_NOT_EQUALS, OPERATOR_NOT_IN, OPERATOR_NOT_LIKE, OPERATOR_WAS, OPERATOR_WAS_IN, OPERATOR_WAS_NOT, OPERATOR_WAS_NOT_IN } from '@atlaskit/jql-ast';
|
|
3
|
+
// Opinionated order in which we want to render operators
|
|
4
|
+
export var ORDERED_OPERATORS = [OPERATOR_EQUALS, OPERATOR_NOT_EQUALS, OPERATOR_LIKE, OPERATOR_NOT_LIKE, OPERATOR_LT_EQUALS, OPERATOR_GT_EQUALS, OPERATOR_GT, OPERATOR_LT, OPERATOR_IS, OPERATOR_IS_NOT, OPERATOR_IN, OPERATOR_NOT_IN, OPERATOR_WAS, OPERATOR_WAS_NOT, OPERATOR_WAS_IN, OPERATOR_WAS_NOT_IN, OPERATOR_CHANGED];
|
|
5
|
+
export var sortOperators = function sortOperators(operators$) {
|
|
6
|
+
return operators$.pipe(map(function (options) {
|
|
7
|
+
return ORDERED_OPERATORS.reduce(function (result, orderedOperator) {
|
|
8
|
+
var matchingOption = options.find(function (option) {
|
|
9
|
+
return orderedOperator.toLowerCase() === option.value.toLowerCase();
|
|
10
|
+
});
|
|
11
|
+
if (matchingOption !== undefined) {
|
|
12
|
+
result.push(matchingOption);
|
|
13
|
+
}
|
|
14
|
+
return result;
|
|
15
|
+
}, []);
|
|
16
|
+
}));
|
|
17
|
+
};
|