@atlaskit/smart-card 26.69.1 → 26.71.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 +19 -0
- package/dist/cjs/extractors/flexible/actions/extract-automation-action.js +1 -1
- package/dist/cjs/messages.js +2 -2
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +2 -2
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/utils.js +31 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +87 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/index.js +14 -78
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +8 -1
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/messages.js +64 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/mocks.js +78 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +127 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/types.js +18 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.js +183 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.js +55 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.js +138 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.js +38 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.js +249 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.js +28 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/main.js +136 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/number-prompt/main.js +59 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/paragraph-prompt/main.js +49 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/select-prompt/main.js +52 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/text-prompt/main.js +38 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.js +95 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/index.js +14 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.js +74 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/index.js +18 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.js +70 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/main.js +39 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/empty-icon/index.js +136 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/main.js +93 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/error-icon/index.js +66 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/main.js +50 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/main.js +121 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/main.js +60 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/manual-trigger-icon/index.js +29 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/main.js +69 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/main.js +32 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.js +86 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +54 -12
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +11 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/actions/extract-automation-action.js +1 -1
- package/dist/es2019/messages.js +2 -2
- package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/index.js +3 -3
- package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/utils.js +30 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +79 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/index.js +15 -80
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +5 -1
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/messages.js +58 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/mocks.js +71 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +74 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/types.js +12 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.js +103 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.js +51 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.js +3 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.js +156 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.js +23 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/main.js +126 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/number-prompt/main.js +52 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/paragraph-prompt/main.js +44 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/select-prompt/main.js +45 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/text-prompt/main.js +31 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.js +53 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/index.js +3 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.js +62 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.js +61 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/main.js +32 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/empty-icon/index.js +127 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/main.js +89 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/error-icon/index.js +57 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/main.js +44 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/main.js +117 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/main.js +57 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/manual-trigger-icon/index.js +20 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/main.js +65 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/main.js +25 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.js +79 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +49 -11
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +8 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/actions/extract-automation-action.js +1 -1
- package/dist/esm/messages.js +2 -2
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +3 -3
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/utils.js +30 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +78 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/index.js +14 -75
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +5 -1
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/messages.js +58 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/mocks.js +71 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +118 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/types.js +12 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.js +177 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.js +131 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.js +3 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.js +240 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.js +21 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/main.js +126 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/number-prompt/main.js +52 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/paragraph-prompt/main.js +42 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/select-prompt/main.js +45 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/text-prompt/main.js +31 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.js +89 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/index.js +3 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.js +64 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.js +61 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/main.js +30 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/empty-icon/index.js +129 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/main.js +86 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/error-icon/index.js +59 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/main.js +43 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/main.js +114 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/main.js +53 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/manual-trigger-icon/index.js +22 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/main.js +62 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/main.js +25 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.js +80 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +51 -11
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +11 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/state/hooks/use-ai-summary/ai-summary-service/utils.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/actions/action/action-stack-item/action-button.d.ts +12 -0
- package/dist/types/view/FlexibleCard/components/actions/action/action-stack-item/index.d.ts +3 -3
- package/dist/types/view/FlexibleCard/components/actions/action/action-stack-item/types.d.ts +2 -5
- package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/messages.d.ts +58 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/mocks.d.ts +6 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.d.ts +27 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/types.d.ts +94 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.d.ts +31 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.d.ts +52 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/main.d.ts +11 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/number-prompt/main.d.ts +12 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/paragraph-prompt/main.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/select-prompt/main.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/text-prompt/main.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.d.ts +17 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/index.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.d.ts +17 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.d.ts +28 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/main.d.ts +8 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/empty-icon/index.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/main.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/error-icon/index.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/main.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/main.d.ts +8 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/main.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/manual-trigger-icon/index.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/main.d.ts +9 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/main.d.ts +8 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.d.ts +7 -0
- package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/utils.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-stack-item/action-button.d.ts +12 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-stack-item/index.d.ts +3 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-stack-item/types.d.ts +2 -5
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/types.d.ts +5 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/messages.d.ts +58 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/mocks.d.ts +6 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.d.ts +27 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/types.d.ts +94 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.d.ts +31 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.d.ts +52 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/main.d.ts +11 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/number-prompt/main.d.ts +12 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/paragraph-prompt/main.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/select-prompt/main.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/text-prompt/main.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.d.ts +17 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/index.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.d.ts +17 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/index.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.d.ts +28 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/main.d.ts +8 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/empty-icon/index.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/main.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/error-icon/index.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/main.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/main.d.ts +8 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/main.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/manual-trigger-icon/index.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/main.d.ts +9 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/main.d.ts +8 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/index.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.d.ts +7 -0
- package/package.json +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.71.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#102381](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102381)
|
|
8
|
+
[`52f7f4ff7d29`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/52f7f4ff7d29) -
|
|
9
|
+
Convert ProductType to expected x-product header for AI Mate
|
|
10
|
+
- [#102337](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102337)
|
|
11
|
+
[`cf716582b7d5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cf716582b7d5) -
|
|
12
|
+
Hide action block action tooltips while action block is in a loading state
|
|
13
|
+
|
|
14
|
+
## 26.70.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [#100392](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100392)
|
|
19
|
+
[`7c506dd93df5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7c506dd93df5) -
|
|
20
|
+
[ux] Initial implementation of the Automation action in smart links
|
|
21
|
+
|
|
3
22
|
## 26.69.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -31,7 +31,7 @@ var getProductData = function getProductData(meta) {
|
|
|
31
31
|
return ProductData === null || ProductData === void 0 || (_ProductData$product = ProductData[product]) === null || _ProductData$product === void 0 ? void 0 : _ProductData$product[resourceType];
|
|
32
32
|
};
|
|
33
33
|
var extractAutomationAction = exports.extractAutomationAction = function extractAutomationAction(response) {
|
|
34
|
-
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.linking-platfom.smart-card.confluence.page.automation-
|
|
34
|
+
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.linking-platfom.smart-card.confluence.page.automation-action_xcdoi') || !response.data) {
|
|
35
35
|
return undefined;
|
|
36
36
|
}
|
|
37
37
|
var data = response.data;
|
package/dist/cjs/messages.js
CHANGED
|
@@ -73,7 +73,7 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
73
73
|
},
|
|
74
74
|
automation_action_title: {
|
|
75
75
|
id: 'fabric.linking.automation-action.title',
|
|
76
|
-
defaultMessage: '
|
|
76
|
+
defaultMessage: 'View automation rules...',
|
|
77
77
|
description: 'The title of the button in a hover card to open an automation menu for a given SmartLink.'
|
|
78
78
|
},
|
|
79
79
|
automation_action_icon_label: {
|
|
@@ -83,7 +83,7 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
83
83
|
},
|
|
84
84
|
automation_action_tooltip: {
|
|
85
85
|
id: 'fabric.linking.automation-action.tooltip',
|
|
86
|
-
defaultMessage: '
|
|
86
|
+
defaultMessage: 'Select an automation rule to run',
|
|
87
87
|
description: 'The tooltip for the automation action indicating that a button will open an automation modal.'
|
|
88
88
|
},
|
|
89
89
|
automation_action_confluence_page_modal_title: {
|
|
@@ -26,7 +26,7 @@ function AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r
|
|
|
26
26
|
var AISummaryService = exports.AISummaryService = /*#__PURE__*/function () {
|
|
27
27
|
function AISummaryService(props) {
|
|
28
28
|
var _this = this,
|
|
29
|
-
|
|
29
|
+
_getXProductHeaderVal;
|
|
30
30
|
(0, _classCallCheck2.default)(this, AISummaryService);
|
|
31
31
|
(0, _defineProperty2.default)(this, "state", {
|
|
32
32
|
content: '',
|
|
@@ -85,7 +85,7 @@ var AISummaryService = exports.AISummaryService = /*#__PURE__*/function () {
|
|
|
85
85
|
headers: _objectSpread({
|
|
86
86
|
'Content-Type': 'application/json;charset=UTF-8',
|
|
87
87
|
'x-experience-id': 'smart-link',
|
|
88
|
-
'x-product': ((
|
|
88
|
+
'x-product': ((_getXProductHeaderVal = (0, _utils.getXProductHeaderValue)(props.product)) === null || _getXProductHeaderVal === void 0 ? void 0 : _getXProductHeaderVal.toLowerCase()) || 'confluence'
|
|
89
89
|
}, props.headers)
|
|
90
90
|
};
|
|
91
91
|
this.url = props.url;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getBufferReader = exports.addPath = void 0;
|
|
6
|
+
exports.getXProductHeaderValue = exports.getBufferReader = exports.addPath = void 0;
|
|
7
7
|
var getBufferReader = exports.getBufferReader = function getBufferReader(response) {
|
|
8
8
|
if (!response.body) {
|
|
9
9
|
throw new Error('Response body is empty');
|
|
@@ -15,4 +15,34 @@ var addPath = exports.addPath = function addPath(baseUrl, path) {
|
|
|
15
15
|
var pathWithoutLeadingSlash = !path.startsWith('/') ? path : path.substring(1, path.length);
|
|
16
16
|
var url = [urlWithTrailingSlash, pathWithoutLeadingSlash].join('');
|
|
17
17
|
return url;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Subset of a map of Jira `ProductTypes` to AI Mate expected values
|
|
22
|
+
* See for more info: https://atlassian.slack.com/archives/C066UP0G0G3/p1716341647677829?thread_ts=1716338063.255939&cid=C066UP0G0G3
|
|
23
|
+
*/
|
|
24
|
+
var AiMateJiraXProduct = {
|
|
25
|
+
JSM: 'JSM',
|
|
26
|
+
JSW: 'JIRA-SOFTWARE',
|
|
27
|
+
JWM: 'JIRA-CORE',
|
|
28
|
+
JPD: 'JPD'
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Checks if `product` is a Jira related product.
|
|
32
|
+
*/
|
|
33
|
+
var isJiraProduct = function isJiraProduct(product) {
|
|
34
|
+
var JIRA_PRODUCTS = ['JPD', 'JSM', 'JSW', 'JWM'];
|
|
35
|
+
return product !== undefined && JIRA_PRODUCTS.includes(product);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Converts a `ProductType` to the expected `x-product` header value for AI Mate.
|
|
40
|
+
*
|
|
41
|
+
* @see https://developer.atlassian.com/platform/assistance-service/security/entitlements/#approach
|
|
42
|
+
*/
|
|
43
|
+
var getXProductHeaderValue = exports.getXProductHeaderValue = function getXProductHeaderValue(product) {
|
|
44
|
+
if (isJiraProduct(product)) {
|
|
45
|
+
return AiMateJiraXProduct[product];
|
|
46
|
+
}
|
|
47
|
+
return product;
|
|
18
48
|
};
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "26.
|
|
25
|
+
packageVersion: "26.71.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _primitives = require("@atlaskit/primitives");
|
|
11
|
+
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _utils = require("../../../utils");
|
|
14
|
+
var _actionIcon = _interopRequireDefault(require("../action-icon"));
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
+
var buttonStyles = (0, _primitives.xcss)({
|
|
18
|
+
all: 'unset',
|
|
19
|
+
cursor: 'pointer',
|
|
20
|
+
padding: 'space.050',
|
|
21
|
+
width: '100%',
|
|
22
|
+
':focus:not(:focus-visible)': {
|
|
23
|
+
outline: 'none'
|
|
24
|
+
},
|
|
25
|
+
':focus': {
|
|
26
|
+
outlineColor: 'color.border.focused',
|
|
27
|
+
// xcss outlineOffset does not support space.negative.025
|
|
28
|
+
// @ts-ignore-next-line TS2322: Type "var(--ds-space-negative-025)" is not assignable to type
|
|
29
|
+
outlineOffset: "var(--ds-space-negative-025, -2px)",
|
|
30
|
+
outlineStyle: 'solid',
|
|
31
|
+
outlineWidth: 'border.width.outline'
|
|
32
|
+
},
|
|
33
|
+
':hover': {
|
|
34
|
+
backgroundColor: 'color.background.neutral.subtle.hovered'
|
|
35
|
+
},
|
|
36
|
+
':active': {
|
|
37
|
+
backgroundColor: 'color.background.neutral.subtle.pressed'
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
var contentStyles = (0, _primitives.xcss)({
|
|
41
|
+
color: 'color.text',
|
|
42
|
+
// Replace with font token once it becomes stable (currently alpha)
|
|
43
|
+
// font: 'font.body.small',
|
|
44
|
+
fontSize: '12px',
|
|
45
|
+
fontStyle: 'normal',
|
|
46
|
+
fontWeight: '400',
|
|
47
|
+
lineHeight: '20px'
|
|
48
|
+
});
|
|
49
|
+
var ActionButton = function ActionButton(_ref) {
|
|
50
|
+
var content = _ref.content,
|
|
51
|
+
iconOption = _ref.icon,
|
|
52
|
+
isDisabled = _ref.isDisabled,
|
|
53
|
+
isLoading = _ref.isLoading,
|
|
54
|
+
onClickCallback = _ref.onClick,
|
|
55
|
+
size = _ref.size,
|
|
56
|
+
spaceOption = _ref.space,
|
|
57
|
+
testId = _ref.testId,
|
|
58
|
+
tooltipProps = _ref.tooltipProps,
|
|
59
|
+
xcss = _ref.xcss;
|
|
60
|
+
var space = spaceOption !== null && spaceOption !== void 0 ? spaceOption : (0, _utils.getPrimitivesInlineSpaceBySize)(size);
|
|
61
|
+
var onClick = (0, _react.useCallback)(function () {
|
|
62
|
+
if (!isDisabled && !isLoading && onClickCallback) {
|
|
63
|
+
onClickCallback();
|
|
64
|
+
}
|
|
65
|
+
}, [isDisabled, isLoading, onClickCallback]);
|
|
66
|
+
var icon = iconOption && isLoading ? /*#__PURE__*/_react.default.createElement(_actionIcon.default, {
|
|
67
|
+
asStackItemIcon: true,
|
|
68
|
+
icon: /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
69
|
+
testId: "".concat(testId, "-loading")
|
|
70
|
+
}),
|
|
71
|
+
size: size
|
|
72
|
+
}) : iconOption;
|
|
73
|
+
return /*#__PURE__*/_react.default.createElement(_primitives.Box, (0, _extends2.default)({
|
|
74
|
+
as: "button",
|
|
75
|
+
xcss: [buttonStyles, xcss]
|
|
76
|
+
}, tooltipProps, {
|
|
77
|
+
onClick: onClick,
|
|
78
|
+
testId: testId
|
|
79
|
+
}), /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
80
|
+
alignBlock: "center",
|
|
81
|
+
grow: "fill",
|
|
82
|
+
space: space
|
|
83
|
+
}, icon, /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
84
|
+
xcss: contentStyles
|
|
85
|
+
}, content)));
|
|
86
|
+
};
|
|
87
|
+
var _default = exports.default = ActionButton;
|
|
@@ -1,98 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var
|
|
11
|
-
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
10
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
13
|
-
var _react =
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
-
var buttonStyles = (0, _primitives.xcss)({
|
|
19
|
-
all: 'unset',
|
|
20
|
-
cursor: 'pointer',
|
|
21
|
-
padding: 'space.050',
|
|
22
|
-
width: '100%',
|
|
23
|
-
':focus:not(:focus-visible)': {
|
|
24
|
-
outline: 'none'
|
|
25
|
-
},
|
|
26
|
-
':focus': {
|
|
27
|
-
outlineColor: 'color.border.focused',
|
|
28
|
-
// xcss outlineOffset does not support space.negative.025
|
|
29
|
-
// @ts-ignore-next-line TS2322: Type "var(--ds-space-negative-025)" is not assignable to type
|
|
30
|
-
outlineOffset: "var(--ds-space-negative-025, -2px)",
|
|
31
|
-
outlineStyle: 'solid',
|
|
32
|
-
outlineWidth: 'border.width.outline'
|
|
33
|
-
},
|
|
34
|
-
':hover': {
|
|
35
|
-
backgroundColor: 'color.background.neutral.subtle.hovered'
|
|
36
|
-
},
|
|
37
|
-
':active': {
|
|
38
|
-
backgroundColor: 'color.background.neutral.subtle.pressed'
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
var contentStyles = (0, _primitives.xcss)({
|
|
42
|
-
color: 'color.text',
|
|
43
|
-
// Replace with font token once it becomes stable (currently alpha)
|
|
44
|
-
// font: 'font.body.small',
|
|
45
|
-
fontSize: '12px',
|
|
46
|
-
fontStyle: 'normal',
|
|
47
|
-
fontWeight: '400',
|
|
48
|
-
lineHeight: '20px'
|
|
49
|
-
});
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _actionButton = _interopRequireDefault(require("./action-button"));
|
|
13
|
+
var _excluded = ["content", "tooltipMessage", "tooltipOnHide", "hideTooltipOnMouseDown", "hideTooltip"];
|
|
50
14
|
var ActionStackItem = function ActionStackItem(_ref) {
|
|
51
15
|
var content = _ref.content,
|
|
52
|
-
iconOption = _ref.icon,
|
|
53
|
-
isDisabled = _ref.isDisabled,
|
|
54
|
-
isLoading = _ref.isLoading,
|
|
55
|
-
onClickCallback = _ref.onClick,
|
|
56
|
-
size = _ref.size,
|
|
57
|
-
spaceOption = _ref.space,
|
|
58
|
-
testId = _ref.testId,
|
|
59
16
|
tooltipMessage = _ref.tooltipMessage,
|
|
60
|
-
xcss = _ref.xcss,
|
|
61
17
|
tooltipOnHide = _ref.tooltipOnHide,
|
|
62
|
-
hideTooltipOnMouseDown = _ref.hideTooltipOnMouseDown
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}, [isDisabled, isLoading, onClickCallback]);
|
|
69
|
-
var icon = iconOption && isLoading ? /*#__PURE__*/_react.default.createElement(_actionIcon.default, {
|
|
70
|
-
asStackItemIcon: true,
|
|
71
|
-
icon: /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
72
|
-
testId: "".concat(testId, "-loading")
|
|
73
|
-
}),
|
|
74
|
-
size: size
|
|
75
|
-
}) : iconOption;
|
|
76
|
-
|
|
77
|
-
// Replace Box with Pressable once it becomes stable (currently beta)
|
|
78
|
-
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
18
|
+
hideTooltipOnMouseDown = _ref.hideTooltipOnMouseDown,
|
|
19
|
+
hideTooltip = _ref.hideTooltip,
|
|
20
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
21
|
+
return hideTooltip ? /*#__PURE__*/_react.default.createElement(_actionButton.default, (0, _extends2.default)({}, props, {
|
|
22
|
+
content: content
|
|
23
|
+
})) : /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
79
24
|
content: tooltipMessage || content,
|
|
80
25
|
onHide: tooltipOnHide,
|
|
81
26
|
hideTooltipOnMouseDown: hideTooltipOnMouseDown
|
|
82
27
|
}, function (tooltipProps) {
|
|
83
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
onClick: onClick,
|
|
88
|
-
testId: testId
|
|
89
|
-
}), /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
90
|
-
alignBlock: "center",
|
|
91
|
-
grow: "fill",
|
|
92
|
-
space: space
|
|
93
|
-
}, icon, /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
94
|
-
xcss: contentStyles
|
|
95
|
-
}, content)));
|
|
28
|
+
return /*#__PURE__*/_react.default.createElement(_actionButton.default, (0, _extends2.default)({}, props, {
|
|
29
|
+
content: content,
|
|
30
|
+
tooltipProps: tooltipProps
|
|
31
|
+
}));
|
|
96
32
|
});
|
|
97
33
|
};
|
|
98
34
|
var _default = exports.default = ActionStackItem;
|
|
@@ -36,6 +36,7 @@ var Action = function Action(_ref) {
|
|
|
36
36
|
spaceInline = _ref.spaceInline,
|
|
37
37
|
tooltipMessage = _ref.tooltipMessage,
|
|
38
38
|
tooltipOnHide = _ref.tooltipOnHide,
|
|
39
|
+
hideTooltip = _ref.hideTooltip,
|
|
39
40
|
hideTooltipOnMouseDown = _ref.hideTooltipOnMouseDown,
|
|
40
41
|
xcss = _ref.xcss,
|
|
41
42
|
asDropDownItem = _ref.asDropDownItem,
|
|
@@ -71,7 +72,8 @@ var Action = function Action(_ref) {
|
|
|
71
72
|
tooltipMessage: tooltipMessage || content,
|
|
72
73
|
xcss: xcss,
|
|
73
74
|
tooltipOnHide: tooltipOnHide,
|
|
74
|
-
hideTooltipOnMouseDown: hideTooltipOnMouseDown
|
|
75
|
+
hideTooltipOnMouseDown: hideTooltipOnMouseDown,
|
|
76
|
+
hideTooltip: hideTooltip
|
|
75
77
|
});
|
|
76
78
|
}
|
|
77
79
|
if (isDropdownItem) {
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.AISummaryActionComponent = void 0;
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
11
12
|
var _useAiSummary = require("../../../../../state/hooks/use-ai-summary");
|
|
12
13
|
var _copySummaryAction = require("./copy-summary-action");
|
|
13
14
|
var _aiSummariseAction = require("./ai-summarise-action");
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
17
|
var AISummaryActionComponent = exports.AISummaryActionComponent = function AISummaryActionComponent(props) {
|
|
15
18
|
var url = props.url,
|
|
16
19
|
ari = props.ari,
|
|
17
20
|
product = props.product,
|
|
21
|
+
onLoadingChange = props.onLoadingChange,
|
|
18
22
|
_props$testId = props.testId,
|
|
19
23
|
testId = _props$testId === void 0 ? 'smart-action-ai-summary-action' : _props$testId;
|
|
20
24
|
var _useAISummary = (0, _useAiSummary.useAISummary)({
|
|
@@ -26,6 +30,9 @@ var AISummaryActionComponent = exports.AISummaryActionComponent = function AISum
|
|
|
26
30
|
status = _useAISummary$state.status,
|
|
27
31
|
content = _useAISummary$state.content,
|
|
28
32
|
summariseUrl = _useAISummary.summariseUrl;
|
|
33
|
+
(0, _react.useEffect)(function () {
|
|
34
|
+
onLoadingChange === null || onLoadingChange === void 0 || onLoadingChange(status === 'loading');
|
|
35
|
+
}, [onLoadingChange, status]);
|
|
29
36
|
return status === 'done' ? /*#__PURE__*/_react.default.createElement(_copySummaryAction.CopySummaryAction, (0, _extends2.default)({}, props, {
|
|
30
37
|
testId: testId,
|
|
31
38
|
content: content
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var messages = {
|
|
8
|
+
successFlag: {
|
|
9
|
+
id: 'automation-platform.common.success-flag',
|
|
10
|
+
defaultMessage: 'Your automation is in progress',
|
|
11
|
+
description: 'Text for a success flag when an automation rule has been triggered'
|
|
12
|
+
},
|
|
13
|
+
failureFlagTitle: {
|
|
14
|
+
id: 'automation-platform.common.failure-flag-title',
|
|
15
|
+
defaultMessage: 'Oops we ran into a problem',
|
|
16
|
+
description: 'Title for an error flag when an automation rule failed to be triggered'
|
|
17
|
+
},
|
|
18
|
+
failureFlagDescription: {
|
|
19
|
+
id: 'automation-platform.common.failure-flag-description',
|
|
20
|
+
defaultMessage: "There was a problem and we couldn't run the automation '{0}'",
|
|
21
|
+
description: 'Description for an error flag when an automation rule failed to be triggered'
|
|
22
|
+
},
|
|
23
|
+
partialFailureFlagDescription: {
|
|
24
|
+
id: 'automation-platform.common.partial-failure-flag-description',
|
|
25
|
+
defaultMessage: "Couldn't run the automation against issues {0}, please ensure you have permission to view these issues",
|
|
26
|
+
description: 'Description for an error flag when some issues failed to invoke because user does not have view permission'
|
|
27
|
+
},
|
|
28
|
+
errorInputMustNotBeEmpty: {
|
|
29
|
+
id: 'automation-platform.common.error-input-must-not-be-empty',
|
|
30
|
+
defaultMessage: 'Input must not be empty',
|
|
31
|
+
description: 'The error message to show the value of a required field is empty'
|
|
32
|
+
},
|
|
33
|
+
errorInputCharacterLimitReached: {
|
|
34
|
+
id: 'automation-platform.common.error-input-character-limit-reached',
|
|
35
|
+
defaultMessage: 'Provided value exceeds the character limit for the field.',
|
|
36
|
+
description: 'The error message to show that the character limit has been reached for the field'
|
|
37
|
+
},
|
|
38
|
+
inputRequiredForAction: {
|
|
39
|
+
id: 'automation-platform.common.input-required-for-action',
|
|
40
|
+
defaultMessage: 'Your input is required to complete this action',
|
|
41
|
+
description: 'The title of the modal for user inputs'
|
|
42
|
+
},
|
|
43
|
+
errorInputTypeIsNotSupported: {
|
|
44
|
+
id: 'automation-platform.common.error-input-type-is-not-supported',
|
|
45
|
+
defaultMessage: 'Input type not supported yet',
|
|
46
|
+
description: 'The error message to show when the type of user input is not recognised'
|
|
47
|
+
},
|
|
48
|
+
errorValueIsNotValidNumber: {
|
|
49
|
+
id: 'automation-platform.common.error-value-is-not-valid-number',
|
|
50
|
+
defaultMessage: 'The value is not a valid number',
|
|
51
|
+
description: 'The error message for when the type of user input is number but the value is not a valid number'
|
|
52
|
+
},
|
|
53
|
+
cancelButtonTitle: {
|
|
54
|
+
id: 'automation-platform.common.cancel-button-title',
|
|
55
|
+
defaultMessage: 'Cancel',
|
|
56
|
+
description: 'The cancel button title'
|
|
57
|
+
},
|
|
58
|
+
continueButtonTitle: {
|
|
59
|
+
id: 'automation-platform.common.continue-button-title',
|
|
60
|
+
defaultMessage: 'Continue',
|
|
61
|
+
description: 'The continue button title'
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var _default = exports.default = messages;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.mockTransformedRules = exports.mockRules = exports.mockInvokeUrl = exports.mockInvocationResponse = exports.mockGetUrl = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _types = require("./types");
|
|
10
|
+
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; }
|
|
11
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
12
|
+
var mockScope = {
|
|
13
|
+
resources: []
|
|
14
|
+
};
|
|
15
|
+
var mockRules = exports.mockRules = [{
|
|
16
|
+
id: 0,
|
|
17
|
+
name: 'Test rule 0 (no inputs)',
|
|
18
|
+
ruleScope: mockScope,
|
|
19
|
+
userInputs: []
|
|
20
|
+
}, {
|
|
21
|
+
id: 1,
|
|
22
|
+
name: 'Test rule 1 (has inputs)',
|
|
23
|
+
ruleScope: mockScope,
|
|
24
|
+
userInputs: [{
|
|
25
|
+
defaultValue: '',
|
|
26
|
+
displayName: 'Test user input',
|
|
27
|
+
inputType: _types.UserInputType.TEXT,
|
|
28
|
+
required: false,
|
|
29
|
+
variableName: 'testUserInput'
|
|
30
|
+
}]
|
|
31
|
+
}, {
|
|
32
|
+
id: 2,
|
|
33
|
+
name: 'Test rule 2 (has multiple inputs)',
|
|
34
|
+
ruleScope: mockScope,
|
|
35
|
+
userInputs: [{
|
|
36
|
+
defaultValue: '',
|
|
37
|
+
displayName: 'Text user input',
|
|
38
|
+
inputType: _types.UserInputType.TEXT,
|
|
39
|
+
required: false,
|
|
40
|
+
variableName: 'textUserInput'
|
|
41
|
+
}, {
|
|
42
|
+
defaultValue: '',
|
|
43
|
+
displayName: 'Number user input',
|
|
44
|
+
inputType: _types.UserInputType.NUMBER,
|
|
45
|
+
required: false,
|
|
46
|
+
variableName: 'numberUserInput'
|
|
47
|
+
}, {
|
|
48
|
+
defaultValue: true,
|
|
49
|
+
displayName: 'Boolean user input',
|
|
50
|
+
inputType: _types.UserInputType.BOOLEAN,
|
|
51
|
+
required: false,
|
|
52
|
+
variableName: 'booleanUserInput'
|
|
53
|
+
}, {
|
|
54
|
+
defaultValue: [''],
|
|
55
|
+
displayName: 'Dropdown user input',
|
|
56
|
+
inputType: _types.UserInputType.DROPDOWN,
|
|
57
|
+
required: false,
|
|
58
|
+
variableName: 'dropdownUserInput'
|
|
59
|
+
}, {
|
|
60
|
+
defaultValue: '',
|
|
61
|
+
displayName: 'Paragraph user input',
|
|
62
|
+
inputType: _types.UserInputType.PARAGRAPH,
|
|
63
|
+
required: false,
|
|
64
|
+
variableName: 'paragraphUserInput'
|
|
65
|
+
}]
|
|
66
|
+
}];
|
|
67
|
+
var mockTransformedRules = exports.mockTransformedRules = [_objectSpread(_objectSpread({}, mockRules[0]), {}, {
|
|
68
|
+
userInputPrompts: mockRules[0].userInputs
|
|
69
|
+
}), _objectSpread(_objectSpread({}, mockRules[1]), {}, {
|
|
70
|
+
userInputPrompts: mockRules[1].userInputs
|
|
71
|
+
}), _objectSpread(_objectSpread({}, mockRules[2]), {}, {
|
|
72
|
+
userInputPrompts: mockRules[2].userInputs
|
|
73
|
+
})];
|
|
74
|
+
var mockInvocationResponse = exports.mockInvocationResponse = {
|
|
75
|
+
'TEST-1': 'SUCCESS'
|
|
76
|
+
};
|
|
77
|
+
var mockGetUrl = exports.mockGetUrl = 'https://test-api/get/rules';
|
|
78
|
+
var mockInvokeUrl = exports.mockInvokeUrl = 'https://test-api/invoke';
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.successStubInvokeManuallyTriggeredRule = exports.renderWithDi = exports.createStubInvokeManuallyTriggeredRule = exports.createGenericComponent = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
16
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
var _react2 = require("@testing-library/react");
|
|
20
|
+
var _reactMagneticDi = require("react-magnetic-di");
|
|
21
|
+
var _reactIntlNext = require("react-intl-next");
|
|
22
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
23
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
26
|
+
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; }
|
|
27
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
28
|
+
/**
|
|
29
|
+
* Creates a stubbed invocation API call for triggering rules. Will return
|
|
30
|
+
* the supplied invocation result for all objects the rule was called
|
|
31
|
+
* for.
|
|
32
|
+
*/
|
|
33
|
+
var createStubInvokeManuallyTriggeredRule = exports.createStubInvokeManuallyTriggeredRule = function createStubInvokeManuallyTriggeredRule(stubbedInvocationResultForAllObjects, responseDelay) {
|
|
34
|
+
return /*#__PURE__*/function () {
|
|
35
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_env, _site, _ruleId, objects, _inputs) {
|
|
36
|
+
var response;
|
|
37
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
38
|
+
while (1) switch (_context.prev = _context.next) {
|
|
39
|
+
case 0:
|
|
40
|
+
response = objects.reduce(function (acc, current) {
|
|
41
|
+
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, current, stubbedInvocationResultForAllObjects));
|
|
42
|
+
}, {});
|
|
43
|
+
return _context.abrupt("return", responseDelay ? new Promise(function (resolve) {
|
|
44
|
+
return setTimeout(resolve, responseDelay);
|
|
45
|
+
}) : Promise.resolve(response));
|
|
46
|
+
case 2:
|
|
47
|
+
case "end":
|
|
48
|
+
return _context.stop();
|
|
49
|
+
}
|
|
50
|
+
}, _callee);
|
|
51
|
+
}));
|
|
52
|
+
return function (_x, _x2, _x3, _x4, _x5) {
|
|
53
|
+
return _ref.apply(this, arguments);
|
|
54
|
+
};
|
|
55
|
+
}();
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Default stubbed invokeManuallyTriggeredRule call. Returns 'SUCCESS' for
|
|
60
|
+
* all objects the rule was called for.
|
|
61
|
+
*/
|
|
62
|
+
var successStubInvokeManuallyTriggeredRule = exports.successStubInvokeManuallyTriggeredRule = createStubInvokeManuallyTriggeredRule('SUCCESS', 2000);
|
|
63
|
+
var Provider = function Provider(_ref2) {
|
|
64
|
+
var children = _ref2.children,
|
|
65
|
+
use = _ref2.use,
|
|
66
|
+
target = _ref2.target;
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.IntlProvider, {
|
|
68
|
+
locale: "en"
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement(_reactMagneticDi.DiProvider, {
|
|
70
|
+
use: use,
|
|
71
|
+
target: target
|
|
72
|
+
}, children));
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Render into a container which is appended to `document.body`.
|
|
77
|
+
*
|
|
78
|
+
* Includes `IntlProvider` wrapper
|
|
79
|
+
*
|
|
80
|
+
* @param node The React element to render
|
|
81
|
+
* @param dependencies List of React Magnetic DI dependencies to inject
|
|
82
|
+
* @param options React Testing Library options
|
|
83
|
+
*/
|
|
84
|
+
var renderWithDi = exports.renderWithDi = function renderWithDi(node) {
|
|
85
|
+
var dependencies = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
86
|
+
var options = arguments.length > 2 ? arguments[2] : undefined;
|
|
87
|
+
return (0, _react2.render)(node, _objectSpread(_objectSpread({}, options), {}, {
|
|
88
|
+
wrapper: function wrapper(_ref3) {
|
|
89
|
+
var _options$wrapper;
|
|
90
|
+
var children = _ref3.children;
|
|
91
|
+
var CustomWrapper = (_options$wrapper = options === null || options === void 0 ? void 0 : options.wrapper) !== null && _options$wrapper !== void 0 ? _options$wrapper : _react.Fragment;
|
|
92
|
+
return /*#__PURE__*/_react.default.createElement(Provider, {
|
|
93
|
+
use: (0, _toConsumableArray2.default)(dependencies),
|
|
94
|
+
target: options === null || options === void 0 ? void 0 : options.target
|
|
95
|
+
}, /*#__PURE__*/_react.default.createElement(CustomWrapper, null, children));
|
|
96
|
+
}
|
|
97
|
+
}));
|
|
98
|
+
};
|
|
99
|
+
var createGenericComponent = exports.createGenericComponent = function createGenericComponent(displayName) {
|
|
100
|
+
var _class;
|
|
101
|
+
var renderChildren = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
102
|
+
var childrenParams = arguments.length > 2 ? arguments[2] : undefined;
|
|
103
|
+
return _class = /*#__PURE__*/function (_Component) {
|
|
104
|
+
(0, _inherits2.default)(_class, _Component);
|
|
105
|
+
var _super = _createSuper(_class);
|
|
106
|
+
function _class() {
|
|
107
|
+
(0, _classCallCheck2.default)(this, _class);
|
|
108
|
+
return _super.apply(this, arguments);
|
|
109
|
+
}
|
|
110
|
+
(0, _createClass2.default)(_class, [{
|
|
111
|
+
key: "render",
|
|
112
|
+
value: function render() {
|
|
113
|
+
if (renderChildren && typeof this.props.children === 'function') {
|
|
114
|
+
if (childrenParams) {
|
|
115
|
+
return this.props.children(childrenParams);
|
|
116
|
+
}
|
|
117
|
+
return this.props.children();
|
|
118
|
+
}
|
|
119
|
+
if (renderChildren && this.props.children) {
|
|
120
|
+
return this.props.children;
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
}]);
|
|
125
|
+
return _class;
|
|
126
|
+
}(_react.Component), (0, _defineProperty2.default)(_class, "displayName", displayName), _class;
|
|
127
|
+
};
|