@atlaskit/link-picker 1.48.3 → 1.49.1
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 +17 -0
- package/dist/cjs/common/generic-error-svg/index.compiled.css +2 -0
- package/dist/cjs/common/generic-error-svg/index.js +34 -25
- package/dist/cjs/common/generic-error-svg/old/index.js +66 -0
- package/dist/cjs/common/ui/empty-state/index.compiled.css +3 -0
- package/dist/cjs/common/ui/empty-state/index.js +26 -14
- package/dist/cjs/common/ui/empty-state/old/index.js +38 -0
- package/dist/cjs/common/ui/min-height-container/index.compiled.css +4 -0
- package/dist/cjs/common/ui/min-height-container/index.js +24 -14
- package/dist/cjs/common/ui/min-height-container/old/index.js +34 -0
- package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.compiled.css +2 -0
- package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.js +24 -18
- package/dist/cjs/ui/error-boundary/error-boundary-fallback/old/index.js +50 -0
- package/dist/cjs/ui/link-picker/form-footer/index.compiled.css +3 -0
- package/dist/cjs/ui/link-picker/form-footer/index.js +30 -35
- package/dist/cjs/ui/link-picker/form-footer/link-picker-submit-button/index.js +2 -8
- package/dist/cjs/ui/link-picker/form-footer/old/index.js +116 -0
- package/dist/cjs/ui/link-picker/index.compiled.css +10 -0
- package/dist/cjs/ui/link-picker/index.js +45 -59
- package/dist/cjs/ui/link-picker/old/index.js +435 -0
- package/dist/cjs/ui/link-picker/search-results/index.compiled.css +7 -0
- package/dist/cjs/ui/link-picker/search-results/index.js +33 -32
- package/dist/cjs/ui/link-picker/search-results/link-search-error/index.js +5 -11
- package/dist/cjs/ui/link-picker/search-results/link-search-list/index.compiled.css +24 -0
- package/dist/cjs/ui/link-picker/search-results/link-search-list/index.js +55 -43
- package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.compiled.css +2 -0
- package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +36 -28
- package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.js +70 -0
- package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/index.compiled.css +34 -0
- package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/index.js +99 -76
- package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/old/index.js +145 -0
- package/dist/cjs/ui/link-picker/search-results/link-search-list/old/index.js +188 -0
- package/dist/cjs/ui/link-picker/search-results/old/index.js +105 -0
- package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/index.compiled.css +29 -0
- package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/index.js +54 -42
- package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/old/index.js +163 -0
- package/dist/cjs/ui/link-picker/search-results/search-results-container/index.compiled.css +4 -0
- package/dist/cjs/ui/link-picker/search-results/search-results-container/index.js +21 -19
- package/dist/cjs/ui/link-picker/search-results/search-results-container/old/index.js +43 -0
- package/dist/cjs/ui/link-picker/text-input/index.compiled.css +11 -0
- package/dist/cjs/ui/link-picker/text-input/index.js +36 -39
- package/dist/cjs/ui/link-picker/text-input/old/index.js +125 -0
- package/dist/cjs/ui/loader-fallback/index.compiled.css +1 -0
- package/dist/cjs/ui/loader-fallback/index.js +21 -15
- package/dist/cjs/ui/loader-fallback/old/index.js +67 -0
- package/dist/cjs/ui/main.compiled.css +1 -0
- package/dist/cjs/ui/main.js +25 -24
- package/dist/cjs/ui/old/main.js +75 -0
- package/dist/es2019/common/generic-error-svg/index.compiled.css +2 -0
- package/dist/es2019/common/generic-error-svg/index.js +27 -23
- package/dist/es2019/common/generic-error-svg/old/index.js +58 -0
- package/dist/es2019/common/ui/empty-state/index.compiled.css +3 -0
- package/dist/es2019/common/ui/empty-state/index.js +18 -9
- package/dist/es2019/common/ui/empty-state/old/index.js +32 -0
- package/dist/es2019/common/ui/min-height-container/index.compiled.css +4 -0
- package/dist/es2019/common/ui/min-height-container/index.js +21 -12
- package/dist/es2019/common/ui/min-height-container/old/index.js +25 -0
- package/dist/es2019/ui/error-boundary/error-boundary-fallback/index.compiled.css +2 -0
- package/dist/es2019/ui/error-boundary/error-boundary-fallback/index.js +20 -16
- package/dist/es2019/ui/error-boundary/error-boundary-fallback/old/index.js +41 -0
- package/dist/es2019/ui/link-picker/form-footer/index.compiled.css +3 -0
- package/dist/es2019/ui/link-picker/form-footer/index.js +27 -32
- package/dist/es2019/ui/link-picker/form-footer/link-picker-submit-button/index.js +2 -7
- package/dist/es2019/ui/link-picker/form-footer/old/index.js +104 -0
- package/dist/es2019/ui/link-picker/index.compiled.css +10 -0
- package/dist/es2019/ui/link-picker/index.js +38 -58
- package/dist/es2019/ui/link-picker/old/index.js +436 -0
- package/dist/es2019/ui/link-picker/search-results/index.compiled.css +7 -0
- package/dist/es2019/ui/link-picker/search-results/index.js +29 -31
- package/dist/es2019/ui/link-picker/search-results/link-search-error/index.js +5 -10
- package/dist/es2019/ui/link-picker/search-results/link-search-list/index.compiled.css +24 -0
- package/dist/es2019/ui/link-picker/search-results/link-search-list/index.js +48 -42
- package/dist/es2019/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.compiled.css +2 -0
- package/dist/es2019/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +29 -26
- package/dist/es2019/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.js +63 -0
- package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/index.compiled.css +34 -0
- package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/index.js +77 -72
- package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/old/index.js +132 -0
- package/dist/es2019/ui/link-picker/search-results/link-search-list/old/index.js +178 -0
- package/dist/es2019/ui/link-picker/search-results/old/index.js +98 -0
- package/dist/es2019/ui/link-picker/search-results/scrolling-tabs/index.compiled.css +29 -0
- package/dist/es2019/ui/link-picker/search-results/scrolling-tabs/index.js +39 -39
- package/dist/es2019/ui/link-picker/search-results/scrolling-tabs/old/index.js +130 -0
- package/dist/es2019/ui/link-picker/search-results/search-results-container/index.compiled.css +4 -0
- package/dist/es2019/ui/link-picker/search-results/search-results-container/index.js +16 -16
- package/dist/es2019/ui/link-picker/search-results/search-results-container/old/index.js +37 -0
- package/dist/es2019/ui/link-picker/text-input/index.compiled.css +11 -0
- package/dist/es2019/ui/link-picker/text-input/index.js +30 -38
- package/dist/es2019/ui/link-picker/text-input/old/index.js +121 -0
- package/dist/es2019/ui/loader-fallback/index.compiled.css +1 -0
- package/dist/es2019/ui/loader-fallback/index.js +17 -13
- package/dist/es2019/ui/loader-fallback/old/index.js +60 -0
- package/dist/es2019/ui/main.compiled.css +1 -0
- package/dist/es2019/ui/main.js +24 -22
- package/dist/es2019/ui/old/main.js +73 -0
- package/dist/esm/common/generic-error-svg/index.compiled.css +2 -0
- package/dist/esm/common/generic-error-svg/index.js +30 -23
- package/dist/esm/common/generic-error-svg/old/index.js +58 -0
- package/dist/esm/common/ui/empty-state/index.compiled.css +3 -0
- package/dist/esm/common/ui/empty-state/index.js +18 -9
- package/dist/esm/common/ui/empty-state/old/index.js +31 -0
- package/dist/esm/common/ui/min-height-container/index.compiled.css +4 -0
- package/dist/esm/common/ui/min-height-container/index.js +23 -14
- package/dist/esm/common/ui/min-height-container/old/index.js +25 -0
- package/dist/esm/ui/error-boundary/error-boundary-fallback/index.compiled.css +2 -0
- package/dist/esm/ui/error-boundary/error-boundary-fallback/index.js +20 -16
- package/dist/esm/ui/error-boundary/error-boundary-fallback/old/index.js +43 -0
- package/dist/esm/ui/link-picker/form-footer/index.compiled.css +3 -0
- package/dist/esm/ui/link-picker/form-footer/index.js +28 -34
- package/dist/esm/ui/link-picker/form-footer/link-picker-submit-button/index.js +2 -7
- package/dist/esm/ui/link-picker/form-footer/old/index.js +108 -0
- package/dist/esm/ui/link-picker/index.compiled.css +10 -0
- package/dist/esm/ui/link-picker/index.js +39 -59
- package/dist/esm/ui/link-picker/old/index.js +432 -0
- package/dist/esm/ui/link-picker/search-results/index.compiled.css +7 -0
- package/dist/esm/ui/link-picker/search-results/index.js +30 -32
- package/dist/esm/ui/link-picker/search-results/link-search-error/index.js +5 -10
- package/dist/esm/ui/link-picker/search-results/link-search-list/index.compiled.css +24 -0
- package/dist/esm/ui/link-picker/search-results/link-search-list/index.js +49 -43
- package/dist/esm/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.compiled.css +2 -0
- package/dist/esm/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +32 -26
- package/dist/esm/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.js +63 -0
- package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/index.compiled.css +34 -0
- package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/index.js +94 -72
- package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/old/index.js +136 -0
- package/dist/esm/ui/link-picker/search-results/link-search-list/old/index.js +186 -0
- package/dist/esm/ui/link-picker/search-results/old/index.js +100 -0
- package/dist/esm/ui/link-picker/search-results/scrolling-tabs/index.compiled.css +29 -0
- package/dist/esm/ui/link-picker/search-results/scrolling-tabs/index.js +52 -43
- package/dist/esm/ui/link-picker/search-results/scrolling-tabs/old/index.js +158 -0
- package/dist/esm/ui/link-picker/search-results/search-results-container/index.compiled.css +4 -0
- package/dist/esm/ui/link-picker/search-results/search-results-container/index.js +16 -16
- package/dist/esm/ui/link-picker/search-results/search-results-container/old/index.js +36 -0
- package/dist/esm/ui/link-picker/text-input/index.compiled.css +11 -0
- package/dist/esm/ui/link-picker/text-input/index.js +30 -38
- package/dist/esm/ui/link-picker/text-input/old/index.js +121 -0
- package/dist/esm/ui/loader-fallback/index.compiled.css +1 -0
- package/dist/esm/ui/loader-fallback/index.js +17 -13
- package/dist/esm/ui/loader-fallback/old/index.js +59 -0
- package/dist/esm/ui/main.compiled.css +1 -0
- package/dist/esm/ui/main.js +24 -22
- package/dist/esm/ui/old/main.js +64 -0
- package/dist/types/common/generic-error-svg/index.d.ts +3 -6
- package/dist/types/common/generic-error-svg/old/index.d.ts +6 -0
- package/dist/types/common/types.d.ts +0 -1
- package/dist/types/common/ui/empty-state/index.d.ts +3 -2
- package/dist/types/common/ui/empty-state/old/index.d.ts +9 -0
- package/dist/types/common/ui/min-height-container/index.d.ts +3 -0
- package/dist/types/common/ui/min-height-container/old/index.d.ts +8 -0
- package/dist/types/ui/error-boundary/error-boundary-fallback/index.d.ts +3 -6
- package/dist/types/ui/error-boundary/error-boundary-fallback/old/index.d.ts +6 -0
- package/dist/types/ui/link-picker/form-footer/index.d.ts +2 -5
- package/dist/types/ui/link-picker/form-footer/link-picker-submit-button/index.d.ts +2 -6
- package/dist/types/ui/link-picker/form-footer/old/index.d.ts +42 -0
- package/dist/types/ui/link-picker/index.d.ts +2 -2
- package/dist/types/ui/link-picker/old/index.d.ts +25 -0
- package/dist/types/ui/link-picker/search-results/index.d.ts +2 -2
- package/dist/types/ui/link-picker/search-results/link-search-error/index.d.ts +2 -6
- package/dist/types/ui/link-picker/search-results/link-search-list/index.d.ts +1 -0
- package/dist/types/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.d.ts +3 -6
- package/dist/types/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.d.ts +6 -0
- package/dist/types/ui/link-picker/search-results/link-search-list/list-item/index.d.ts +3 -2
- package/dist/types/ui/link-picker/search-results/link-search-list/list-item/old/index.d.ts +23 -0
- package/dist/types/ui/link-picker/search-results/link-search-list/old/index.d.ts +52 -0
- package/dist/types/ui/link-picker/search-results/old/index.d.ts +45 -0
- package/dist/types/ui/link-picker/search-results/scrolling-tabs/index.d.ts +4 -4
- package/dist/types/ui/link-picker/search-results/scrolling-tabs/old/index.d.ts +7 -0
- package/dist/types/ui/link-picker/search-results/search-results-container/index.d.ts +2 -2
- package/dist/types/ui/link-picker/search-results/search-results-container/old/index.d.ts +10 -0
- package/dist/types/ui/link-picker/text-input/index.d.ts +3 -2
- package/dist/types/ui/link-picker/text-input/old/index.d.ts +18 -0
- package/dist/types/ui/loader-fallback/index.d.ts +3 -6
- package/dist/types/ui/loader-fallback/old/index.d.ts +17 -0
- package/dist/types/ui/main.d.ts +2 -2
- package/dist/types/ui/old/main.d.ts +13 -0
- package/dist/types-ts4.5/common/generic-error-svg/index.d.ts +3 -6
- package/dist/types-ts4.5/common/generic-error-svg/old/index.d.ts +6 -0
- package/dist/types-ts4.5/common/types.d.ts +0 -1
- package/dist/types-ts4.5/common/ui/empty-state/index.d.ts +3 -2
- package/dist/types-ts4.5/common/ui/empty-state/old/index.d.ts +9 -0
- package/dist/types-ts4.5/common/ui/min-height-container/index.d.ts +3 -0
- package/dist/types-ts4.5/common/ui/min-height-container/old/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/error-boundary/error-boundary-fallback/index.d.ts +3 -6
- package/dist/types-ts4.5/ui/error-boundary/error-boundary-fallback/old/index.d.ts +6 -0
- package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +2 -5
- package/dist/types-ts4.5/ui/link-picker/form-footer/link-picker-submit-button/index.d.ts +2 -6
- package/dist/types-ts4.5/ui/link-picker/form-footer/old/index.d.ts +42 -0
- package/dist/types-ts4.5/ui/link-picker/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/link-picker/old/index.d.ts +25 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-error/index.d.ts +2 -6
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.d.ts +3 -6
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.d.ts +6 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/index.d.ts +3 -2
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/old/index.d.ts +23 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/old/index.d.ts +52 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/old/index.d.ts +45 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/scrolling-tabs/index.d.ts +4 -4
- package/dist/types-ts4.5/ui/link-picker/search-results/scrolling-tabs/old/index.d.ts +7 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/search-results-container/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/link-picker/search-results/search-results-container/old/index.d.ts +10 -0
- package/dist/types-ts4.5/ui/link-picker/text-input/index.d.ts +3 -2
- package/dist/types-ts4.5/ui/link-picker/text-input/old/index.d.ts +18 -0
- package/dist/types-ts4.5/ui/loader-fallback/index.d.ts +3 -6
- package/dist/types-ts4.5/ui/loader-fallback/old/index.d.ts +17 -0
- package/dist/types-ts4.5/ui/main.d.ts +2 -2
- package/dist/types-ts4.5/ui/old/main.d.ts +13 -0
- package/lazy/package.json +3 -1
- package/package.json +14 -4
- package/dist/cjs/ui/link-picker/form-footer/feature-discovery/index.js +0 -69
- package/dist/cjs/ui/link-picker/form-footer/feature-discovery/styled.js +0 -25
- package/dist/es2019/ui/link-picker/form-footer/feature-discovery/index.js +0 -61
- package/dist/es2019/ui/link-picker/form-footer/feature-discovery/styled.js +0 -18
- package/dist/esm/ui/link-picker/form-footer/feature-discovery/index.js +0 -62
- package/dist/esm/ui/link-picker/form-footer/feature-discovery/styled.js +0 -18
- package/dist/types/ui/link-picker/form-footer/feature-discovery/index.d.ts +0 -15
- package/dist/types/ui/link-picker/form-footer/feature-discovery/styled.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-picker/form-footer/feature-discovery/index.d.ts +0 -15
- package/dist/types-ts4.5/ui/link-picker/form-footer/feature-discovery/styled.d.ts +0 -1
- /package/dist/cjs/common/ui/min-height-container/{styled.js → old/styled.js} +0 -0
- /package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/{styled.js → old/styled.js} +0 -0
- /package/dist/cjs/ui/link-picker/search-results/link-search-list/{styled.js → old/styled.js} +0 -0
- /package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/{styles.js → old/styles.js} +0 -0
- /package/dist/es2019/common/ui/min-height-container/{styled.js → old/styled.js} +0 -0
- /package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/{styled.js → old/styled.js} +0 -0
- /package/dist/es2019/ui/link-picker/search-results/link-search-list/{styled.js → old/styled.js} +0 -0
- /package/dist/es2019/ui/link-picker/search-results/scrolling-tabs/{styles.js → old/styles.js} +0 -0
- /package/dist/esm/common/ui/min-height-container/{styled.js → old/styled.js} +0 -0
- /package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/{styled.js → old/styled.js} +0 -0
- /package/dist/esm/ui/link-picker/search-results/link-search-list/{styled.js → old/styled.js} +0 -0
- /package/dist/esm/ui/link-picker/search-results/scrolling-tabs/{styles.js → old/styles.js} +0 -0
- /package/dist/types/common/ui/min-height-container/{styled.d.ts → old/styled.d.ts} +0 -0
- /package/dist/types/ui/link-picker/search-results/link-search-list/list-item/{styled.d.ts → old/styled.d.ts} +0 -0
- /package/dist/types/ui/link-picker/search-results/link-search-list/{styled.d.ts → old/styled.d.ts} +0 -0
- /package/dist/types/ui/link-picker/search-results/scrolling-tabs/{styles.d.ts → old/styles.d.ts} +0 -0
- /package/dist/types-ts4.5/common/ui/min-height-container/{styled.d.ts → old/styled.d.ts} +0 -0
- /package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/{styled.d.ts → old/styled.d.ts} +0 -0
- /package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/{styled.d.ts → old/styled.d.ts} +0 -0
- /package/dist/types-ts4.5/ui/link-picker/search-results/scrolling-tabs/{styles.d.ts → old/styles.d.ts} +0 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
|
+
/* eslint-disable @atlassian/tangerine/import/no-parent-imports */
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @jsxRuntime classic
|
|
10
|
+
* @jsx jsx
|
|
11
|
+
*/
|
|
12
|
+
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
|
+
import { jsx } from '@emotion/react';
|
|
16
|
+
import { IconButton } from '@atlaskit/button/new';
|
|
17
|
+
import ChevronLeftIcon from '@atlaskit/icon/utility/migration/chevron-left';
|
|
18
|
+
import ChevronRightIcon from '@atlaskit/icon/utility/migration/chevron-right';
|
|
19
|
+
import { calculateConditionalButtons, createGhost, getTabList, scrollBack, scrollForward } from '../scrolling-tabs';
|
|
20
|
+
import { backButtonStyles, containerStyles, nextButtonStyles, scrollingContainerStyles } from './styles';
|
|
21
|
+
function isTouchDevice() {
|
|
22
|
+
return 'ontouchstart' in window ||
|
|
23
|
+
// eslint-disable-next-line compat/compat
|
|
24
|
+
navigator.maxTouchPoints > 0;
|
|
25
|
+
}
|
|
26
|
+
var initialConditionalButtonsState = {
|
|
27
|
+
back: false,
|
|
28
|
+
forward: false
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
32
|
+
export var ScrollingTabListOld = function ScrollingTabListOld(props) {
|
|
33
|
+
var ref = useRef(null);
|
|
34
|
+
var _useState = useState(initialConditionalButtonsState),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
conditionalButtons = _useState2[0],
|
|
37
|
+
setConditionalButtons = _useState2[1];
|
|
38
|
+
var ghost = useMemo(function () {
|
|
39
|
+
return createGhost();
|
|
40
|
+
}, []);
|
|
41
|
+
var onTabClick = useCallback(function (e) {
|
|
42
|
+
var target = e.currentTarget;
|
|
43
|
+
if (target) {
|
|
44
|
+
target.scrollIntoView({
|
|
45
|
+
behavior: 'smooth',
|
|
46
|
+
block: 'nearest',
|
|
47
|
+
inline: 'center'
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}, []);
|
|
51
|
+
React.useLayoutEffect(function () {
|
|
52
|
+
var container = ref.current;
|
|
53
|
+
var scrollingContainer;
|
|
54
|
+
var tabs;
|
|
55
|
+
var handleConditionalButtonsChange = function handleConditionalButtonsChange() {
|
|
56
|
+
var buttons = calculateConditionalButtons(scrollingContainer, isTouchDevice());
|
|
57
|
+
setConditionalButtons(buttons);
|
|
58
|
+
};
|
|
59
|
+
var observerCallback = function observerCallback(mutationList) {
|
|
60
|
+
var tablist = getTabList(ref);
|
|
61
|
+
var _iterator = _createForOfIteratorHelper(mutationList),
|
|
62
|
+
_step;
|
|
63
|
+
try {
|
|
64
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
65
|
+
var mutation = _step.value;
|
|
66
|
+
if (mutation.type === 'childList') {
|
|
67
|
+
var addedNodes = Array.from(mutation.addedNodes);
|
|
68
|
+
var found = addedNodes.find(function (node) {
|
|
69
|
+
return node.getAttribute('role') === 'tab';
|
|
70
|
+
});
|
|
71
|
+
if (found && tablist) {
|
|
72
|
+
ghost.remove();
|
|
73
|
+
var _tabs = Array.from(tablist.children);
|
|
74
|
+
_tabs.forEach(function (tab) {
|
|
75
|
+
tab.removeEventListener('click', onTabClick);
|
|
76
|
+
tab.addEventListener('click', onTabClick);
|
|
77
|
+
});
|
|
78
|
+
tablist.appendChild(ghost);
|
|
79
|
+
handleConditionalButtonsChange();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
} catch (err) {
|
|
84
|
+
_iterator.e(err);
|
|
85
|
+
} finally {
|
|
86
|
+
_iterator.f();
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
var observer = new MutationObserver(observerCallback);
|
|
90
|
+
if (container) {
|
|
91
|
+
var tablist = getTabList(ref);
|
|
92
|
+
scrollingContainer = tablist === null || tablist === void 0 ? void 0 : tablist.parentElement;
|
|
93
|
+
observer.observe(container, {
|
|
94
|
+
attributes: false,
|
|
95
|
+
childList: true,
|
|
96
|
+
subtree: true
|
|
97
|
+
});
|
|
98
|
+
if (scrollingContainer instanceof HTMLElement && tablist) {
|
|
99
|
+
tablist.appendChild(ghost);
|
|
100
|
+
tabs = Array.from(tablist.children);
|
|
101
|
+
tabs.forEach(function (tab) {
|
|
102
|
+
return tab.addEventListener('click', onTabClick);
|
|
103
|
+
});
|
|
104
|
+
handleConditionalButtonsChange();
|
|
105
|
+
scrollingContainer.addEventListener('scroll', handleConditionalButtonsChange);
|
|
106
|
+
}
|
|
107
|
+
return function () {
|
|
108
|
+
if (scrollingContainer) {
|
|
109
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
110
|
+
scrollingContainer.removeEventListener('scroll', handleConditionalButtonsChange);
|
|
111
|
+
}
|
|
112
|
+
if (tabs.length) {
|
|
113
|
+
tabs.forEach(function (tab) {
|
|
114
|
+
return tab.removeEventListener('click', onTabClick);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}, [onTabClick, ghost, ref]);
|
|
120
|
+
var buttonProps = {
|
|
121
|
+
appearance: 'subtle',
|
|
122
|
+
spacing: 'compact'
|
|
123
|
+
};
|
|
124
|
+
return (
|
|
125
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
126
|
+
jsx("div", {
|
|
127
|
+
css: containerStyles,
|
|
128
|
+
ref: ref,
|
|
129
|
+
"data-testid": "scrolling-tabs"
|
|
130
|
+
}, conditionalButtons.back &&
|
|
131
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
132
|
+
jsx("div", {
|
|
133
|
+
className: "back",
|
|
134
|
+
css: backButtonStyles
|
|
135
|
+
}, jsx(IconButton, _extends({
|
|
136
|
+
"data-test-id": "back",
|
|
137
|
+
onClick: function onClick() {
|
|
138
|
+
return scrollBack(ref);
|
|
139
|
+
},
|
|
140
|
+
label: "back",
|
|
141
|
+
icon: ChevronLeftIcon
|
|
142
|
+
}, buttonProps))), jsx("div", {
|
|
143
|
+
css: scrollingContainerStyles
|
|
144
|
+
}, props.children), conditionalButtons.forward &&
|
|
145
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
146
|
+
jsx("div", {
|
|
147
|
+
css: nextButtonStyles
|
|
148
|
+
}, jsx(IconButton, _extends({
|
|
149
|
+
"data-test-id": "forward",
|
|
150
|
+
onClick: function onClick() {
|
|
151
|
+
return scrollForward(ref);
|
|
152
|
+
}
|
|
153
|
+
}, buttonProps, {
|
|
154
|
+
label: "forward",
|
|
155
|
+
icon: ChevronRightIcon
|
|
156
|
+
}))))
|
|
157
|
+
);
|
|
158
|
+
};
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.0 */
|
|
2
|
+
import "./index.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { useLayoutEffect, useRef } from 'react';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { css, jsx } from '@emotion/react';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
7
|
import { MinHeightContainer } from '../../../../common/ui/min-height-container';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
justifyContent: 'flex-start',
|
|
14
|
-
width: '100%'
|
|
15
|
-
});
|
|
16
|
-
export var SearchResultsContainer = function SearchResultsContainer(_ref) {
|
|
8
|
+
import { SearchResultsContainerOld } from './old';
|
|
9
|
+
var flexColumn = null;
|
|
10
|
+
export var SearchResultsContainerNew = function SearchResultsContainerNew(_ref) {
|
|
17
11
|
var hasTabs = _ref.hasTabs,
|
|
18
12
|
adaptiveHeight = _ref.adaptiveHeight,
|
|
19
13
|
isLoadingResults = _ref.isLoadingResults,
|
|
@@ -28,9 +22,15 @@ export var SearchResultsContainer = function SearchResultsContainer(_ref) {
|
|
|
28
22
|
currentHeight.current = ref.current.getBoundingClientRect().height;
|
|
29
23
|
}
|
|
30
24
|
});
|
|
31
|
-
return
|
|
25
|
+
return /*#__PURE__*/React.createElement(MinHeightContainer, {
|
|
32
26
|
ref: ref,
|
|
33
27
|
minHeight: minheight,
|
|
34
|
-
|
|
28
|
+
className: ax(["_1e0c1txw _2lx21bp4 _1bah1y6m _1bsb1osq"])
|
|
35
29
|
}, children);
|
|
30
|
+
};
|
|
31
|
+
export var SearchResultsContainer = function SearchResultsContainer(props) {
|
|
32
|
+
if (fg('platform_bandicoots-link-picker-css')) {
|
|
33
|
+
return /*#__PURE__*/React.createElement(SearchResultsContainerNew, props);
|
|
34
|
+
}
|
|
35
|
+
return /*#__PURE__*/React.createElement(SearchResultsContainerOld, props);
|
|
36
36
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { useLayoutEffect, useRef } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
+
import { css, jsx } from '@emotion/react';
|
|
9
|
+
import { MinHeightContainer } from '../../../../../common/ui/min-height-container';
|
|
10
|
+
var flexColumn = css({
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'column',
|
|
13
|
+
justifyContent: 'flex-start',
|
|
14
|
+
width: '100%'
|
|
15
|
+
});
|
|
16
|
+
export var SearchResultsContainerOld = function SearchResultsContainerOld(_ref) {
|
|
17
|
+
var hasTabs = _ref.hasTabs,
|
|
18
|
+
adaptiveHeight = _ref.adaptiveHeight,
|
|
19
|
+
isLoadingResults = _ref.isLoadingResults,
|
|
20
|
+
children = _ref.children;
|
|
21
|
+
var ref = useRef(null);
|
|
22
|
+
var currentHeight = useRef(null);
|
|
23
|
+
var fixedMinHeight = hasTabs ? '347px' : '302px';
|
|
24
|
+
var adaptiveMinHeight = isLoadingResults && !!currentHeight.current ? "".concat(currentHeight.current, "px") : 'auto';
|
|
25
|
+
var minheight = adaptiveHeight ? adaptiveMinHeight : fixedMinHeight;
|
|
26
|
+
useLayoutEffect(function () {
|
|
27
|
+
if (ref.current && adaptiveHeight && !isLoadingResults) {
|
|
28
|
+
currentHeight.current = ref.current.getBoundingClientRect().height;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return jsx(MinHeightContainer, {
|
|
32
|
+
ref: ref,
|
|
33
|
+
minHeight: minheight,
|
|
34
|
+
css: flexColumn
|
|
35
|
+
}, children);
|
|
36
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
._11c816g6{font:var(--ds-font-heading-xxsmall,normal 600 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._19itglyw{border:none}
|
|
3
|
+
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
4
|
+
._2hwx1b66{margin-right:var(--ds-space-050,4px)}
|
|
5
|
+
._7yjtidpf >div{margin-top:0}
|
|
6
|
+
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
7
|
+
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
8
|
+
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
9
|
+
._onzypxbi+._onzypxbi{margin-top:var(--ds-space-200,1pc)}
|
|
10
|
+
._s7n4nkob{vertical-align:middle}
|
|
11
|
+
._u5f3ze3t{padding-right:var(--ds-space-0,0)}
|
|
@@ -1,49 +1,35 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.0 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
4
|
var _excluded = ["name", "label", "autoFocus", "onRedo", "onUndo", "onKeyDown", "onClear", "clearLabel", "error", "spotlightTargetName"];
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
*/
|
|
5
|
+
import "./index.compiled.css";
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
8
8
|
import { Fragment, useCallback, useRef } from 'react';
|
|
9
|
-
|
|
10
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
|
-
import { css, jsx } from '@emotion/react';
|
|
12
9
|
import { ErrorMessage, Field } from '@atlaskit/form';
|
|
13
10
|
import Selectclear from '@atlaskit/icon/core/migration/cross-circle--select-clear';
|
|
14
|
-
import {
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
|
+
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
15
13
|
import Textfield from '@atlaskit/textfield';
|
|
16
14
|
import Tooltip from '@atlaskit/tooltip';
|
|
17
15
|
import { ConditionalSpotlightTargetWrapper } from './conditional-spotlight-target-wrapper';
|
|
16
|
+
import { TextInputOld } from './old';
|
|
18
17
|
import { isRedoEvent, isUndoEvent } from './utils';
|
|
18
|
+
var styles = {
|
|
19
|
+
clearTextButton: "_19itglyw _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _2hwx1b66 _bfhksm61 _s7n4nkob"
|
|
20
|
+
};
|
|
19
21
|
|
|
20
22
|
/**
|
|
21
|
-
*
|
|
23
|
+
* Overriding text input margin top which design system provides as a default spacer
|
|
22
24
|
* but it gets in the way of our layout
|
|
23
25
|
*/
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
27
|
-
'> div': {
|
|
28
|
-
marginTop: 0
|
|
29
|
-
},
|
|
30
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
31
|
-
'& + &': {
|
|
32
|
-
marginTop: "var(--ds-space-200, 16px)"
|
|
33
|
-
}
|
|
34
|
-
});
|
|
26
|
+
var baseFieldStyles = null;
|
|
27
|
+
var newFieldStyles = null;
|
|
35
28
|
export var testIds = {
|
|
36
29
|
urlError: 'link-error',
|
|
37
30
|
clearUrlButton: 'clear-text'
|
|
38
31
|
};
|
|
39
|
-
var
|
|
40
|
-
padding: 'space.0',
|
|
41
|
-
marginRight: 'space.050',
|
|
42
|
-
backgroundColor: 'color.background.neutral.subtle',
|
|
43
|
-
border: 'none',
|
|
44
|
-
verticalAlign: 'middle'
|
|
45
|
-
});
|
|
46
|
-
export var TextInput = function TextInput(_ref) {
|
|
32
|
+
export var TextInputNew = function TextInputNew(_ref) {
|
|
47
33
|
var name = _ref.name,
|
|
48
34
|
label = _ref.label,
|
|
49
35
|
autoFocus = _ref.autoFocus,
|
|
@@ -86,34 +72,40 @@ export var TextInput = function TextInput(_ref) {
|
|
|
86
72
|
onClear === null || onClear === void 0 || onClear(name);
|
|
87
73
|
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
88
74
|
}, [name, onClear]);
|
|
89
|
-
var clearText = restProps.value !== '' &&
|
|
75
|
+
var clearText = restProps.value !== '' && /*#__PURE__*/React.createElement(Tooltip, {
|
|
90
76
|
content: clearLabel
|
|
91
|
-
},
|
|
92
|
-
xcss:
|
|
77
|
+
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
78
|
+
xcss: styles.clearTextButton,
|
|
93
79
|
onClick: handleClear,
|
|
94
80
|
testId: testIds.clearUrlButton
|
|
95
|
-
},
|
|
81
|
+
}, /*#__PURE__*/React.createElement(Selectclear, {
|
|
96
82
|
LEGACY_size: "medium",
|
|
97
83
|
label: clearLabel || '',
|
|
98
84
|
color: "var(--ds-icon-subtle, #626F86)",
|
|
99
85
|
spacing: "spacious"
|
|
100
86
|
})));
|
|
101
|
-
return
|
|
102
|
-
|
|
103
|
-
},
|
|
87
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
className: ax(["_7yjtidpf _onzypxbi", fg('platform-linking-visual-refresh-v1') && "_11c816g6"])
|
|
89
|
+
}, /*#__PURE__*/React.createElement(Field, {
|
|
104
90
|
label: label,
|
|
105
91
|
name: name
|
|
106
92
|
}, function (_ref2) {
|
|
107
93
|
var fieldProps = _ref2.fieldProps;
|
|
108
|
-
return
|
|
94
|
+
return /*#__PURE__*/React.createElement(ConditionalSpotlightTargetWrapper, {
|
|
109
95
|
spotlightTargetName: spotlightTargetName
|
|
110
|
-
},
|
|
96
|
+
}, /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Textfield, _extends({}, fieldProps, restProps, {
|
|
111
97
|
onKeyDown: handleKeydown,
|
|
112
98
|
ref: handleRef,
|
|
113
99
|
elemAfterInput: clearText,
|
|
114
100
|
isInvalid: !!error
|
|
115
|
-
})), error &&
|
|
101
|
+
})), error && /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
116
102
|
testId: testIds.urlError
|
|
117
103
|
}, error)));
|
|
118
104
|
}));
|
|
105
|
+
};
|
|
106
|
+
export var TextInput = function TextInput(props) {
|
|
107
|
+
if (fg('platform_bandicoots-link-picker-css')) {
|
|
108
|
+
return /*#__PURE__*/React.createElement(TextInputNew, props);
|
|
109
|
+
}
|
|
110
|
+
return /*#__PURE__*/React.createElement(TextInputOld, props);
|
|
119
111
|
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["name", "label", "autoFocus", "onRedo", "onUndo", "onKeyDown", "onClear", "clearLabel", "error", "spotlightTargetName"];
|
|
4
|
+
/* eslint-disable @atlassian/tangerine/import/no-parent-imports */
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @jsxRuntime classic
|
|
8
|
+
* @jsx jsx
|
|
9
|
+
*/
|
|
10
|
+
import { Fragment, useCallback, useRef } from 'react';
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
|
+
import { css, jsx } from '@emotion/react';
|
|
14
|
+
import { ErrorMessage, Field } from '@atlaskit/form';
|
|
15
|
+
import Selectclear from '@atlaskit/icon/core/migration/cross-circle--select-clear';
|
|
16
|
+
import { Pressable, xcss } from '@atlaskit/primitives';
|
|
17
|
+
import Textfield from '@atlaskit/textfield';
|
|
18
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
19
|
+
import { ConditionalSpotlightTargetWrapper } from '../conditional-spotlight-target-wrapper';
|
|
20
|
+
import { isRedoEvent, isUndoEvent } from '../utils';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Overidding text input margin top which design system provides as a default spacer
|
|
24
|
+
* but it gets in the way of our layout
|
|
25
|
+
*/
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
27
|
+
var fieldStyles = css({
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
29
|
+
'> div': {
|
|
30
|
+
marginTop: 0
|
|
31
|
+
},
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
33
|
+
'& + &': {
|
|
34
|
+
marginTop: "var(--ds-space-200, 16px)"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export var testIds = {
|
|
38
|
+
urlError: 'link-error',
|
|
39
|
+
clearUrlButton: 'clear-text'
|
|
40
|
+
};
|
|
41
|
+
var clearTextButtonStyles = xcss({
|
|
42
|
+
padding: 'space.0',
|
|
43
|
+
marginRight: 'space.050',
|
|
44
|
+
backgroundColor: 'color.background.neutral.subtle',
|
|
45
|
+
border: 'none',
|
|
46
|
+
verticalAlign: 'middle'
|
|
47
|
+
});
|
|
48
|
+
export var TextInputOld = function TextInputOld(_ref) {
|
|
49
|
+
var name = _ref.name,
|
|
50
|
+
label = _ref.label,
|
|
51
|
+
autoFocus = _ref.autoFocus,
|
|
52
|
+
onRedo = _ref.onRedo,
|
|
53
|
+
onUndo = _ref.onUndo,
|
|
54
|
+
onKeyDown = _ref.onKeyDown,
|
|
55
|
+
onClear = _ref.onClear,
|
|
56
|
+
clearLabel = _ref.clearLabel,
|
|
57
|
+
error = _ref.error,
|
|
58
|
+
spotlightTargetName = _ref.spotlightTargetName,
|
|
59
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
60
|
+
var inputRef = useRef(null);
|
|
61
|
+
var handleRef = useCallback(function (input) {
|
|
62
|
+
if (input) {
|
|
63
|
+
inputRef.current = input;
|
|
64
|
+
if (autoFocus) {
|
|
65
|
+
// Need this to prevent jumping when we render TextInput inside Portal @see ED-2992
|
|
66
|
+
input.focus({
|
|
67
|
+
preventScroll: true
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}, [autoFocus]);
|
|
72
|
+
var handleKeydown = useCallback(function (e) {
|
|
73
|
+
if (typeof onUndo === 'function' && isUndoEvent(e)) {
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
onUndo();
|
|
76
|
+
} else if (typeof onRedo === 'function' && isRedoEvent(e)) {
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
onRedo();
|
|
79
|
+
}
|
|
80
|
+
if (onKeyDown) {
|
|
81
|
+
onKeyDown(e);
|
|
82
|
+
}
|
|
83
|
+
}, [onUndo, onRedo, onKeyDown]);
|
|
84
|
+
var handleClear = useCallback(function (e) {
|
|
85
|
+
var _inputRef$current;
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
e.stopPropagation();
|
|
88
|
+
onClear === null || onClear === void 0 || onClear(name);
|
|
89
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
90
|
+
}, [name, onClear]);
|
|
91
|
+
var clearText = restProps.value !== '' && jsx(Tooltip, {
|
|
92
|
+
content: clearLabel
|
|
93
|
+
}, jsx(Pressable, {
|
|
94
|
+
xcss: clearTextButtonStyles,
|
|
95
|
+
onClick: handleClear,
|
|
96
|
+
testId: testIds.clearUrlButton
|
|
97
|
+
}, jsx(Selectclear, {
|
|
98
|
+
LEGACY_size: "medium",
|
|
99
|
+
label: clearLabel || '',
|
|
100
|
+
color: "var(--ds-icon-subtle, #626F86)",
|
|
101
|
+
spacing: "spacious"
|
|
102
|
+
})));
|
|
103
|
+
return jsx("div", {
|
|
104
|
+
css: fieldStyles
|
|
105
|
+
}, jsx(Field, {
|
|
106
|
+
label: label,
|
|
107
|
+
name: name
|
|
108
|
+
}, function (_ref2) {
|
|
109
|
+
var fieldProps = _ref2.fieldProps;
|
|
110
|
+
return jsx(ConditionalSpotlightTargetWrapper, {
|
|
111
|
+
spotlightTargetName: spotlightTargetName
|
|
112
|
+
}, jsx(Fragment, null, jsx(Textfield, _extends({}, fieldProps, restProps, {
|
|
113
|
+
onKeyDown: handleKeydown,
|
|
114
|
+
ref: handleRef,
|
|
115
|
+
elemAfterInput: clearText,
|
|
116
|
+
isInvalid: !!error
|
|
117
|
+
})), error && jsx(ErrorMessage, {
|
|
118
|
+
testId: testIds.urlError
|
|
119
|
+
}, error)));
|
|
120
|
+
}));
|
|
121
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._4cvr1h6o{align-items:center}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { css, jsx } from '@emotion/react';
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.0 */
|
|
2
|
+
import "./index.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import Spinner from '@atlaskit/spinner';
|
|
8
7
|
import { MinHeightContainer } from '../../common/ui/min-height-container';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
});
|
|
8
|
+
import { LoaderFallbackOld } from './old';
|
|
9
|
+
var styles = null;
|
|
12
10
|
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT = '472px';
|
|
13
11
|
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT = '550px';
|
|
14
12
|
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT = '505px';
|
|
@@ -45,15 +43,21 @@ var getEstimatedMinHeight = function getEstimatedMinHeight(_ref) {
|
|
|
45
43
|
* Loader / skeleton for the Link Picker. Takes LoaderFallbackProps (hideDisplayText, isLoadingPlugins, plugins)
|
|
46
44
|
* to determine the height to prevent jumps in height when loading
|
|
47
45
|
*/
|
|
48
|
-
export var
|
|
46
|
+
export var LoaderFallbackNew = function LoaderFallbackNew(props) {
|
|
49
47
|
var minHeight = getEstimatedMinHeight(props);
|
|
50
|
-
return
|
|
48
|
+
return /*#__PURE__*/React.createElement(MinHeightContainer, {
|
|
51
49
|
minHeight: minHeight,
|
|
52
50
|
"data-testid": "link-picker-root-loader-boundary-ui",
|
|
53
|
-
|
|
54
|
-
},
|
|
51
|
+
className: ax(["_4cvr1h6o"])
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
55
53
|
testId: "link-picker.component-loading-indicator",
|
|
56
54
|
interactionName: props.name || 'link-picker-loading',
|
|
57
55
|
size: "medium"
|
|
58
56
|
}));
|
|
57
|
+
};
|
|
58
|
+
export var LoaderFallback = function LoaderFallback(props) {
|
|
59
|
+
if (fg('platform_bandicoots-link-picker-css')) {
|
|
60
|
+
return /*#__PURE__*/React.createElement(LoaderFallbackNew, props);
|
|
61
|
+
}
|
|
62
|
+
return /*#__PURE__*/React.createElement(LoaderFallbackOld, props);
|
|
59
63
|
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
7
|
+
import Spinner from '@atlaskit/spinner';
|
|
8
|
+
import { MinHeightContainer } from '../../../common/ui/min-height-container';
|
|
9
|
+
var styles = css({
|
|
10
|
+
alignItems: 'center'
|
|
11
|
+
});
|
|
12
|
+
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT = '472px';
|
|
13
|
+
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT = '550px';
|
|
14
|
+
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT = '505px';
|
|
15
|
+
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITHOUT_DISPLAYTEXT = '429px';
|
|
16
|
+
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_DISPLAYTEXT = '218px';
|
|
17
|
+
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITHOUT_DISPLAYTEXT = '141px';
|
|
18
|
+
var getEstimatedMinHeight = function getEstimatedMinHeight(_ref) {
|
|
19
|
+
var hideDisplayText = _ref.hideDisplayText,
|
|
20
|
+
isLoadingPlugins = _ref.isLoadingPlugins,
|
|
21
|
+
plugins = _ref.plugins,
|
|
22
|
+
url = _ref.url;
|
|
23
|
+
/**
|
|
24
|
+
* "Insert mode" (search results shown initially)
|
|
25
|
+
*/
|
|
26
|
+
if (!url) {
|
|
27
|
+
/**
|
|
28
|
+
* With tabs
|
|
29
|
+
*/
|
|
30
|
+
if (plugins && plugins.length > 1 || isLoadingPlugins) {
|
|
31
|
+
return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Without tabs
|
|
36
|
+
*/
|
|
37
|
+
if ((plugins === null || plugins === void 0 ? void 0 : plugins.length) === 1) {
|
|
38
|
+
return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_DISPLAYTEXT;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Loader / skeleton for the Link Picker. Takes LoaderFallbackProps (hideDisplayText, isLoadingPlugins, plugins)
|
|
46
|
+
* to determine the height to prevent jumps in height when loading
|
|
47
|
+
*/
|
|
48
|
+
export var LoaderFallbackOld = function LoaderFallbackOld(props) {
|
|
49
|
+
var minHeight = getEstimatedMinHeight(props);
|
|
50
|
+
return jsx(MinHeightContainer, {
|
|
51
|
+
minHeight: minHeight,
|
|
52
|
+
"data-testid": "link-picker-root-loader-boundary-ui",
|
|
53
|
+
css: styles
|
|
54
|
+
}, jsx(Spinner, {
|
|
55
|
+
testId: "link-picker.component-loading-indicator",
|
|
56
|
+
interactionName: props.name || 'link-picker-loading',
|
|
57
|
+
size: "medium"
|
|
58
|
+
}));
|
|
59
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._1bsb1ubl{width:var(--link-picker-width)}
|