@atlaskit/link-picker 1.1.1 → 1.1.2
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 +6 -0
- package/dist/cjs/browser.js +39 -0
- package/dist/cjs/index.js +13 -0
- package/dist/cjs/messages.js +112 -0
- package/dist/cjs/transformTimeStamp.js +55 -0
- package/dist/cjs/types.js +5 -0
- package/dist/cjs/ui/announcer.js +64 -0
- package/dist/cjs/ui/link-picker.js +611 -0
- package/dist/cjs/ui/link-search-list/index.js +102 -0
- package/dist/cjs/ui/link-search-list/styled.js +21 -0
- package/dist/cjs/ui/link-search-no-results/index.js +27 -0
- package/dist/cjs/ui/link-search-no-results/no-results.svg +38 -0
- package/dist/cjs/ui/list-item/index.js +103 -0
- package/dist/cjs/ui/list-item/styled.js +59 -0
- package/dist/cjs/ui/styled.js +32 -0
- package/dist/cjs/ui/text-input/index.js +116 -0
- package/dist/cjs/ui/text-input/styled.js +25 -0
- package/dist/cjs/url.js +104 -0
- package/dist/cjs/utils.js +27 -0
- package/dist/cjs/version.json +5 -0
- package/dist/es2019/browser.js +34 -0
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/messages.js +103 -0
- package/dist/es2019/transformTimeStamp.js +41 -0
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/ui/announcer.js +38 -0
- package/dist/es2019/ui/link-picker.js +499 -0
- package/dist/es2019/ui/link-search-list/index.js +60 -0
- package/dist/es2019/ui/link-search-list/styled.js +13 -0
- package/dist/es2019/ui/link-search-no-results/index.js +12 -0
- package/dist/es2019/ui/link-search-no-results/no-results.svg +38 -0
- package/dist/es2019/ui/list-item/index.js +88 -0
- package/dist/es2019/ui/list-item/styled.js +65 -0
- package/dist/es2019/ui/styled.js +28 -0
- package/dist/es2019/ui/text-input/index.js +99 -0
- package/dist/es2019/ui/text-input/styled.js +15 -0
- package/dist/es2019/url.js +88 -0
- package/dist/es2019/utils.js +13 -0
- package/dist/es2019/version.json +5 -0
- package/dist/esm/browser.js +34 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/messages.js +103 -0
- package/dist/esm/transformTimeStamp.js +41 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/ui/announcer.js +51 -0
- package/dist/esm/ui/link-picker.js +589 -0
- package/dist/esm/ui/link-search-list/index.js +88 -0
- package/dist/esm/ui/link-search-list/styled.js +8 -0
- package/dist/esm/ui/link-search-no-results/index.js +14 -0
- package/dist/esm/ui/link-search-no-results/no-results.svg +38 -0
- package/dist/esm/ui/list-item/index.js +90 -0
- package/dist/esm/ui/list-item/styled.js +37 -0
- package/dist/esm/ui/styled.js +16 -0
- package/dist/esm/ui/text-input/index.js +99 -0
- package/dist/esm/ui/text-input/styled.js +10 -0
- package/dist/esm/url.js +90 -0
- package/dist/esm/utils.js +13 -0
- package/dist/esm/version.json +5 -0
- package/dist/types/browser.d.ts +15 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/messages.d.ts +102 -0
- package/dist/types/transformTimeStamp.d.ts +3 -0
- package/dist/types/types.d.ts +40 -0
- package/dist/types/ui/announcer.d.ts +22 -0
- package/dist/types/ui/link-picker.d.ts +51 -0
- package/dist/types/ui/link-search-list/index.d.ts +20 -0
- package/dist/types/ui/link-search-list/styled.d.ts +3 -0
- package/dist/types/ui/link-search-no-results/index.d.ts +4 -0
- package/dist/types/ui/list-item/index.d.ts +17 -0
- package/dist/types/ui/list-item/styled.d.ts +7 -0
- package/dist/types/ui/styled.d.ts +4 -0
- package/dist/types/ui/text-input/index.d.ts +17 -0
- package/dist/types/ui/text-input/styled.d.ts +2 -0
- package/dist/types/url.d.ts +5 -0
- package/dist/types/utils.d.ts +3 -0
- package/package.json +1 -2
- package/example-helpers/flight-deck/_manifest.json +0 -9
- package/example-helpers/flight-deck/mockFDResponse.json +0 -133
- package/example-helpers/mock-data.ts +0 -318
- package/example-helpers/providers.ts +0 -39
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<svg width="208" height="191" viewBox="0 0 208 191" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_1442_1680)">
|
|
3
|
+
<rect width="207.16" height="189.87" transform="translate(0 0.619141)" fill="white" fill-opacity="0.01"/>
|
|
4
|
+
<path opacity="0.3" d="M105.28 190.44C104.35 190.47 103.42 190.49 102.49 190.5C101.19 190.51 100.13 189.46 100.13 188.16C100.12 186.89 101.13 185.84 102.4 185.8C102.42 185.8 102.45 185.8 102.47 185.8C108.4 185.77 114.42 185.13 120.21 183.9C121.48 183.63 122.73 184.44 123 185.71C123.27 186.98 122.46 188.23 121.19 188.5C115.98 189.59 110.63 190.25 105.28 190.44Z" fill="#B3BAC5"/>
|
|
5
|
+
<path opacity="0.3" d="M89.77 189.649C89.64 189.649 89.5 189.649 89.36 189.629C83.14 188.769 77 187.259 71.09 185.139C69.87 184.699 69.23 183.359 69.67 182.129C70.11 180.909 71.46 180.269 72.68 180.709C78.28 182.719 84.1 184.149 90 184.959C91.29 185.139 92.19 186.319 92.01 187.609C91.86 188.769 90.89 189.609 89.77 189.649Z" fill="#B3BAC5"/>
|
|
6
|
+
<path opacity="0.3" d="M133.08 184.98C132.09 185.01 131.15 184.42 130.79 183.44C130.34 182.22 130.96 180.87 132.18 180.42C137.76 178.36 143.14 175.71 148.19 172.55C149.29 171.86 150.74 172.19 151.43 173.29C152.12 174.39 151.79 175.84 150.69 176.53C145.37 179.86 139.69 182.66 133.82 184.83C133.57 184.93 133.33 184.97 133.08 184.98Z" fill="#B3BAC5"/>
|
|
7
|
+
<path opacity="0.3" d="M60.25 180.089C59.85 180.099 59.44 180.019 59.07 179.819C53.54 176.879 48.28 173.349 43.46 169.339C42.46 168.509 42.32 167.029 43.15 166.029C43.98 165.029 45.46 164.889 46.46 165.719C51.04 169.529 56.02 172.869 61.27 175.659C62.42 176.269 62.85 177.689 62.24 178.839C61.83 179.619 61.06 180.069 60.25 180.089Z" fill="#B3BAC5"/>
|
|
8
|
+
<path opacity="0.3" d="M35.79 161.01C35.12 161.03 34.44 160.77 33.96 160.24C29.75 155.58 26.01 150.48 22.85 145.07C22.19 143.95 22.57 142.51 23.69 141.85C24.81 141.19 26.25 141.57 26.91 142.69C29.91 147.82 33.46 152.66 37.45 157.08C38.32 158.04 38.25 159.53 37.28 160.4C36.85 160.79 36.32 160.99 35.79 161.01Z" fill="#B3BAC5"/>
|
|
9
|
+
<path opacity="0.3" d="M179.7 145.469C179.28 145.479 178.84 145.389 178.45 145.159C177.32 144.509 176.93 143.079 177.58 141.949C180.54 136.779 182.97 131.289 184.8 125.639C185.2 124.399 186.53 123.729 187.76 124.129C189 124.529 189.67 125.859 189.27 127.089C187.34 133.049 184.77 138.829 181.65 144.279C181.24 145.019 180.49 145.439 179.7 145.469Z" fill="#B3BAC5"/>
|
|
10
|
+
<path opacity="0.3" d="M19.3 134.749C18.34 134.779 17.42 134.219 17.04 133.279C14.68 127.469 12.92 121.399 11.81 115.219C11.58 113.939 12.43 112.719 13.71 112.489C14.99 112.259 16.21 113.109 16.44 114.389C17.5 120.249 19.17 126.009 21.4 131.519C21.89 132.719 21.31 134.099 20.1 134.579C19.84 134.679 19.57 134.739 19.3 134.749Z" fill="#B3BAC5"/>
|
|
11
|
+
<path opacity="0.3" d="M190.19 116.26C190.03 116.27 189.87 116.26 189.71 116.23C188.43 116.01 187.57 114.8 187.79 113.52C188.79 107.68 189.18 101.69 188.97 95.7197L188.96 95.5197C188.91 94.2197 189.93 93.1297 191.23 93.0897C192.53 93.0397 193.62 94.0597 193.66 95.3597L193.67 95.5597C193.89 101.85 193.47 108.16 192.42 114.32C192.23 115.43 191.28 116.22 190.19 116.26Z" fill="#B3BAC5"/>
|
|
12
|
+
<path opacity="0.3" d="M12.82 104.36C11.52 104.41 10.43 103.44 10.39 102.14V102.04C10.17 95.7795 10.58 89.4995 11.62 83.3795C11.84 82.0995 13.05 81.2395 14.33 81.4495C15.61 81.6695 16.47 82.8795 16.26 84.1595C15.28 89.9695 14.88 95.9295 15.09 101.86C15.14 103.17 14.12 104.31 12.82 104.36Z" fill="#B3BAC5"/>
|
|
13
|
+
<path opacity="0.3" d="M190 85.05C188.85 85.09 187.82 84.28 187.61 83.12C186.54 77.26 184.87 71.5 182.63 66C182.14 64.8 182.72 63.42 183.92 62.93C185.12 62.44 186.5 63.02 186.99 64.22C189.35 70.02 191.12 76.1 192.24 82.28C192.47 83.56 191.63 84.78 190.35 85.02C190.23 85.03 190.12 85.04 190 85.05Z" fill="#B3BAC5"/>
|
|
14
|
+
<path opacity="0.3" d="M17.07 73.6685C16.8 73.6785 16.53 73.6385 16.26 73.5585C15.02 73.1585 14.35 71.8285 14.75 70.5985C16.68 64.6385 19.23 58.8485 22.35 53.3985C22.99 52.2685 24.43 51.8785 25.56 52.5185C26.69 53.1585 27.08 54.5985 26.44 55.7285C23.49 60.8985 21.06 66.3885 19.23 72.0485C18.91 73.0085 18.03 73.6385 17.07 73.6685Z" fill="#B3BAC5"/>
|
|
15
|
+
<path opacity="0.3" d="M179.22 55.9797C178.38 56.0097 177.56 55.5897 177.11 54.8197C174.1 49.6997 170.55 44.8597 166.55 40.4397C165.68 39.4797 165.75 37.9897 166.72 37.1197C167.68 36.2497 169.17 36.3197 170.04 37.2897C174.26 41.9497 178 47.0397 181.17 52.4397C181.83 53.5597 181.45 54.9997 180.33 55.6597C179.98 55.8597 179.6 55.9597 179.22 55.9797Z" fill="#B3BAC5"/>
|
|
16
|
+
<path opacity="0.3" d="M31.61 46.2591C31.08 46.2791 30.54 46.1191 30.08 45.7591C29.06 44.9591 28.87 43.4791 29.67 42.4591C33.53 37.5091 37.9 32.9491 42.68 28.8891C43.67 28.0491 45.15 28.1691 46 29.1591C46.84 30.1491 46.72 31.6291 45.73 32.4791C41.2 36.3291 37.04 40.6691 33.38 45.3591C32.94 45.9291 32.28 46.2391 31.61 46.2591Z" fill="#B3BAC5"/>
|
|
17
|
+
<path opacity="0.3" d="M159.12 32.3496C158.56 32.3696 158 32.1896 157.54 31.8096C152.95 28.0096 147.97 24.6696 142.71 21.8796C141.56 21.2696 141.12 19.8496 141.73 18.6996C142.34 17.5496 143.76 17.1196 144.91 17.7196C150.44 20.6496 155.7 24.1696 160.53 28.1796C161.53 29.0096 161.67 30.4896 160.84 31.4896C160.4 32.0296 159.76 32.3196 159.12 32.3496Z" fill="#B3BAC5"/>
|
|
18
|
+
<path opacity="0.3" d="M54.62 25.4492C53.81 25.4792 53.01 25.0892 52.54 24.3492C51.85 23.2492 52.18 21.7992 53.28 21.1092C58.6 17.7692 64.27 14.9692 70.15 12.7892C71.37 12.3392 72.72 12.9592 73.17 14.1792C73.62 15.3992 73 16.7492 71.78 17.1992C66.21 19.2592 60.83 21.9192 55.78 25.0892C55.42 25.3192 55.02 25.4392 54.62 25.4492Z" fill="#B3BAC5"/>
|
|
19
|
+
<path opacity="0.3" d="M132.16 16.9787C131.87 16.9887 131.57 16.9487 131.29 16.8387C125.69 14.8387 119.86 13.4187 113.96 12.6087C112.67 12.4287 111.77 11.2487 111.95 9.9587C112.13 8.6687 113.32 7.7687 114.6 7.9487C120.82 8.7987 126.96 10.2987 132.87 12.4087C134.09 12.8487 134.73 14.1887 134.29 15.4187C133.96 16.3487 133.09 16.9487 132.16 16.9787Z" fill="#B3BAC5"/>
|
|
20
|
+
<path opacity="0.3" d="M83.36 13.7797C82.24 13.8197 81.22 13.0497 80.98 11.9197C80.71 10.6497 81.52 9.39968 82.79 9.12968C88.9 7.82968 95.24 7.14968 101.48 7.09968C102.78 7.08968 103.84 8.13968 103.85 9.43968C103.86 10.7197 102.85 11.7597 101.58 11.8097C101.56 11.8097 101.53 11.8097 101.51 11.8097C95.58 11.8397 89.56 12.4997 83.77 13.7297C83.63 13.7597 83.49 13.7697 83.36 13.7797Z" fill="#B3BAC5"/>
|
|
21
|
+
<path opacity="0.3" d="M190.8 34.8096C190.55 34.7396 190.38 34.5096 190.41 34.2496C190.43 34.0996 190.45 33.9496 190.47 33.7996C190.52 33.5096 190.58 33.1996 190.66 32.8796C190.96 31.7296 191.51 30.6996 192.3 29.7896C193.09 28.8796 194.23 28.1196 195.7 27.5296L198.18 26.5196C199.66 25.9296 200.57 24.9496 200.93 23.5996C201.06 23.1096 201.1 22.6096 201.05 22.0896C201 21.5696 200.85 21.0796 200.58 20.6296C200.31 20.1796 199.94 19.7696 199.45 19.4096C198.96 19.0496 198.36 18.7796 197.64 18.5896C196.86 18.3896 196.17 18.3596 195.55 18.4996C194.93 18.6396 194.38 18.8896 193.9 19.2396C193.42 19.5896 193.02 20.0396 192.7 20.5796C192.37 21.1196 192.13 21.6996 191.97 22.2996C191.92 22.4796 191.88 22.6596 191.85 22.8196C191.76 23.2896 191.29 23.5696 190.83 23.4296L187 22.2596C186.64 22.1496 186.39 21.7996 186.43 21.4296C186.44 21.3096 186.46 21.1896 186.48 21.0696C186.54 20.7296 186.61 20.4096 186.69 20.0896C186.99 18.9396 187.5 17.8696 188.22 16.8796C188.94 15.8896 189.83 15.0796 190.89 14.4496C191.95 13.8196 193.15 13.4096 194.51 13.2096C195.87 13.0096 197.35 13.1296 198.96 13.5496C200.63 13.9896 202.03 14.6196 203.16 15.4396C204.3 16.2596 205.19 17.1796 205.84 18.1896C206.49 19.2096 206.9 20.2896 207.06 21.4396C207.22 22.5896 207.16 23.7096 206.87 24.7996C206.42 26.5196 205.64 27.8896 204.55 28.9096C203.45 29.9296 202.14 30.7296 200.6 31.2996L198.51 32.0896C197.92 32.2796 197.04 32.6696 196.31 33.4696C196.24 33.5496 195.94 33.8796 195.64 34.3896C195.42 34.7696 195.26 35.1396 195.15 35.4596C195.06 35.7196 194.78 35.8596 194.52 35.7896L190.8 34.8096ZM187.74 40.6796C187.99 39.7296 188.53 39.0096 189.37 38.5096C190.21 38.0096 191.1 37.8796 192.05 38.1296C193 38.3796 193.72 38.9296 194.22 39.7796C194.72 40.6296 194.84 41.5296 194.59 42.4796C194.34 43.4296 193.79 44.1396 192.94 44.6296C192.09 45.1096 191.19 45.2296 190.25 44.9796C189.3 44.7296 188.58 44.1896 188.1 43.3596C187.61 42.5196 187.49 41.6296 187.74 40.6796Z" fill="#C1C7D0"/>
|
|
22
|
+
<path opacity="0.3" d="M18.51 21.9392C18.27 21.8592 18.11 21.6092 18.16 21.3592C18.19 21.2092 18.22 21.0592 18.25 20.9092C18.32 20.6192 18.4 20.3192 18.51 20.0092C18.89 18.8792 19.5 17.8892 20.36 17.0392C21.21 16.1792 22.39 15.5092 23.91 15.0092L26.45 14.1692C27.96 13.6792 28.94 12.7692 29.39 11.4392C29.55 10.9592 29.63 10.4592 29.61 9.93915C29.6 9.41915 29.47 8.91915 29.24 8.44915C29.01 7.97915 28.66 7.54915 28.19 7.15915C27.73 6.76915 27.14 6.45915 26.44 6.21915C25.68 5.95915 24.98 5.88915 24.36 5.98915C23.73 6.08915 23.17 6.29915 22.67 6.61915C22.17 6.93915 21.74 7.35915 21.38 7.87915C21 8.39915 20.72 8.95915 20.52 9.54915C20.46 9.72915 20.41 9.89915 20.37 10.0592C20.25 10.5192 19.76 10.7692 19.31 10.5992L15.57 9.17915C15.22 9.04915 15 8.67915 15.06 8.30915C15.08 8.18915 15.11 8.06915 15.14 7.94915C15.22 7.61915 15.31 7.29915 15.42 6.98915C15.8 5.85915 16.38 4.82915 17.17 3.88915C17.96 2.94915 18.9 2.19915 19.99 1.63915C21.09 1.07915 22.32 0.749152 23.68 0.649152C25.05 0.549152 26.52 0.759152 28.09 1.28915C29.72 1.83915 31.08 2.55915 32.16 3.45915C33.24 4.35915 34.07 5.32915 34.65 6.38915C35.23 7.44915 35.57 8.54915 35.65 9.70915C35.73 10.8692 35.59 11.9792 35.23 13.0492C34.66 14.7392 33.8 16.0492 32.63 16.9892C31.47 17.9292 30.1 18.6392 28.53 19.1092L26.39 19.7492C25.79 19.8992 24.88 20.2292 24.1 20.9792C24.02 21.0592 23.7 21.3692 23.37 21.8492C23.12 22.2192 22.94 22.5692 22.81 22.8792C22.71 23.1292 22.42 23.2592 22.16 23.1692L18.51 21.9392ZM15.06 27.5892C15.37 26.6592 15.96 25.9692 16.83 25.5292C17.7 25.0892 18.6 25.0192 19.53 25.3292C20.46 25.6392 21.14 26.2392 21.58 27.1192C22.02 27.9992 22.08 28.9092 21.77 29.8392C21.46 30.7692 20.86 31.4492 19.98 31.8692C19.1 32.2892 18.2 32.3492 17.27 32.0392C16.34 31.7292 15.66 31.1392 15.23 30.2692C14.81 29.4192 14.75 28.5192 15.06 27.5892Z" fill="#C1C7D0"/>
|
|
23
|
+
<path opacity="0.3" d="M12.39 180.998C12.15 181.088 11.87 180.998 11.75 180.768C11.68 180.638 11.61 180.498 11.54 180.358C11.41 180.088 11.29 179.798 11.17 179.498C10.76 178.388 10.61 177.228 10.74 176.028C10.87 174.828 11.36 173.558 12.23 172.218L13.68 169.968C14.55 168.638 14.74 167.308 14.25 165.998C14.07 165.528 13.82 165.088 13.48 164.688C13.14 164.288 12.74 163.978 12.26 163.758C11.78 163.538 11.24 163.428 10.63 163.408C10.02 163.398 9.37001 163.518 8.68001 163.778C7.93001 164.058 7.34001 164.428 6.91001 164.908C6.48001 165.378 6.18001 165.898 5.99001 166.458C5.80001 167.018 5.73001 167.618 5.77001 168.248C5.81001 168.878 5.94001 169.488 6.16001 170.078C6.23001 170.258 6.29001 170.418 6.36001 170.568C6.56001 170.998 6.33001 171.508 5.88001 171.658L2.08001 172.898C1.72001 173.018 1.32001 172.868 1.14001 172.538C1.08001 172.428 1.03001 172.318 0.970012 172.208C0.820012 171.898 0.690012 171.588 0.580012 171.288C0.170012 170.178 -0.029988 169.008 -0.00998796 167.778C0.010012 166.548 0.270012 165.378 0.780012 164.258C1.28001 163.138 2.03001 162.108 3.03001 161.168C4.03001 160.228 5.31001 159.468 6.87001 158.898C8.49001 158.298 9.99001 158.008 11.39 158.028C12.79 158.048 14.05 158.288 15.17 158.738C16.29 159.198 17.24 159.848 18.03 160.698C18.82 161.548 19.41 162.498 19.8 163.558C20.42 165.228 20.57 166.798 20.26 168.258C19.95 169.718 19.33 171.128 18.4 172.488L17.14 174.338C16.77 174.838 16.27 175.658 16.13 176.728C16.12 176.838 16.06 177.278 16.11 177.858C16.15 178.298 16.23 178.688 16.33 179.008C16.41 179.268 16.26 179.548 16 179.648L12.39 180.998ZM13.26 187.558C12.92 186.638 12.95 185.738 13.35 184.838C13.75 183.948 14.41 183.328 15.33 182.988C16.25 182.648 17.16 182.688 18.05 183.098C18.95 183.508 19.57 184.178 19.91 185.098C20.25 186.018 20.21 186.918 19.79 187.798C19.37 188.678 18.7 189.288 17.79 189.628C16.87 189.968 15.97 189.938 15.09 189.538C14.21 189.138 13.6 188.478 13.26 187.558Z" fill="#C1C7D0"/>
|
|
24
|
+
<path d="M149.36 134.209L142.21 127.279L132.58 137.229L139.73 144.159C141.56 145.929 142.84 148.179 143.44 150.649C144.04 153.119 145.33 155.369 147.15 157.139L176.18 185.239C180.58 189.499 187.59 189.379 191.85 184.989C196.11 180.589 195.99 173.579 191.6 169.319L162.57 141.219C160.74 139.449 158.45 138.239 155.96 137.719C153.48 137.189 151.19 135.969 149.36 134.209Z" fill="#CFD4DB"/>
|
|
25
|
+
<path d="M155.68 137.628C153.31 137.078 151.12 135.898 149.37 134.198L147.19 132.088C144.44 129.428 140.06 129.498 137.4 132.248C134.74 134.998 134.81 139.378 137.56 142.038L139.74 144.148C141.49 145.848 142.74 147.988 143.37 150.338C145.72 148.558 147.94 146.588 150.03 144.428C152.1 142.298 153.98 140.018 155.68 137.628Z" fill="#B3BAC5"/>
|
|
26
|
+
<path d="M101.95 156.619C86.48 156.869 71.84 151.079 60.73 140.319C37.78 118.109 37.19 81.369 59.4 58.419C70.16 47.309 84.61 41.049 100.07 40.789C115.54 40.539 130.18 46.329 141.29 57.089C152.41 67.849 158.66 82.299 158.92 97.759C159.17 113.229 153.38 127.869 142.62 138.979C131.87 150.109 117.42 156.369 101.95 156.619ZM100.3 54.619C88.52 54.809 77.53 59.579 69.33 68.039C52.42 85.509 52.87 113.479 70.34 130.389C78.8 138.579 89.95 142.989 101.73 142.799C113.51 142.609 124.5 137.839 132.7 129.379C140.89 120.919 145.3 109.769 145.11 97.989C144.92 86.209 140.15 75.219 131.69 67.019C123.22 58.839 112.08 54.429 100.3 54.619Z" fill="url(#paint0_linear_1442_1680)"/>
|
|
27
|
+
<path d="M118.92 85.8396L113.58 80.5896C112.79 79.8196 111.53 79.8296 110.75 80.6196L100.96 90.5896L90.9899 80.7996C90.1999 80.0296 88.9399 80.0396 88.1599 80.8296L82.9099 86.1696C82.1399 86.9596 82.1499 88.2196 82.9399 88.9996L92.9099 98.7896L83.1199 108.76C82.3499 109.55 82.3599 110.81 83.1499 111.59L88.4899 116.84C89.2799 117.61 90.5399 117.6 91.3199 116.81L101.11 106.84L111.08 116.63C111.87 117.4 113.13 117.39 113.91 116.6L119.16 111.26C119.93 110.47 119.92 109.21 119.13 108.43L109.16 98.6396L118.95 88.6696C119.72 87.8796 119.71 86.6096 118.92 85.8396Z" fill="#C1C7D0"/>
|
|
28
|
+
</g>
|
|
29
|
+
<defs>
|
|
30
|
+
<linearGradient id="paint0_linear_1442_1680" x1="60.0621" y1="139.664" x2="141.969" y2="57.757" gradientUnits="userSpaceOnUse">
|
|
31
|
+
<stop offset="0.5572" stop-color="#C1C7D0"/>
|
|
32
|
+
<stop offset="0.966" stop-color="#E9EBEF" stop-opacity="0.5"/>
|
|
33
|
+
</linearGradient>
|
|
34
|
+
<clipPath id="clip0_1442_1680">
|
|
35
|
+
<rect width="207.16" height="189.87" fill="white" transform="translate(0 0.619141)"/>
|
|
36
|
+
</clipPath>
|
|
37
|
+
</defs>
|
|
38
|
+
</svg>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { injectIntl } from 'react-intl-next';
|
|
5
|
+
import { transformTimeStamp } from '../../transformTimeStamp';
|
|
6
|
+
import { itemNameStyles, itemIconStyles, listItemContextStyles, listItemNameStyles, composeListItemStyles, imgStyles } from './styled';
|
|
7
|
+
|
|
8
|
+
var LinkSearchListItem = function LinkSearchListItem(_ref) {
|
|
9
|
+
var item = _ref.item,
|
|
10
|
+
selected = _ref.selected,
|
|
11
|
+
active = _ref.active,
|
|
12
|
+
id = _ref.id,
|
|
13
|
+
role = _ref.role,
|
|
14
|
+
intl = _ref.intl,
|
|
15
|
+
onSelect = _ref.onSelect,
|
|
16
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
17
|
+
onMouseLeave = _ref.onMouseLeave;
|
|
18
|
+
|
|
19
|
+
var handleSelect = function handleSelect() {
|
|
20
|
+
return onSelect(item.objectId);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var handleMouseEnter = function handleMouseEnter() {
|
|
24
|
+
return onMouseEnter(item.objectId);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
var handleMouseLeave = function handleMouseLeave() {
|
|
28
|
+
return onMouseLeave(item.objectId);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var container = item.container || null;
|
|
32
|
+
var date = transformTimeStamp(intl, item.lastViewedDate, item.lastUpdatedDate);
|
|
33
|
+
return jsx("div", {
|
|
34
|
+
css: composeListItemStyles(active, selected),
|
|
35
|
+
role: role,
|
|
36
|
+
id: id,
|
|
37
|
+
"aria-selected": selected,
|
|
38
|
+
"data-testid": "link-search-list-item",
|
|
39
|
+
onMouseEnter: handleMouseEnter,
|
|
40
|
+
onMouseLeave: handleMouseLeave,
|
|
41
|
+
onClick: handleSelect
|
|
42
|
+
}, jsx(ListItemIcon, {
|
|
43
|
+
item: item,
|
|
44
|
+
intl: intl
|
|
45
|
+
}), jsx("div", {
|
|
46
|
+
css: itemNameStyles
|
|
47
|
+
}, jsx("div", {
|
|
48
|
+
"data-testid": "link-search-list-item-title",
|
|
49
|
+
css: listItemNameStyles
|
|
50
|
+
}, item.name), jsx("div", {
|
|
51
|
+
"data-testid": "link-search-list-item-subtitle",
|
|
52
|
+
css: listItemContextStyles
|
|
53
|
+
}, container, container && date && jsx(Fragment, null, "\xA0 \u2022\xA0 "), date && jsx(Fragment, null, formatDate(date)))));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default injectIntl(LinkSearchListItem);
|
|
57
|
+
|
|
58
|
+
var formatDate = function formatDate(date) {
|
|
59
|
+
return [date.pageAction, date.dateString, date.timeSince].filter(Boolean).join(' ');
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var ListItemIcon = function ListItemIcon(props) {
|
|
63
|
+
var item = props.item,
|
|
64
|
+
intl = props.intl;
|
|
65
|
+
var icon = item.icon,
|
|
66
|
+
iconAlt = item.iconAlt;
|
|
67
|
+
|
|
68
|
+
if (!icon) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
var alt = typeof iconAlt === 'string' ? iconAlt : intl.formatMessage(iconAlt);
|
|
73
|
+
|
|
74
|
+
if (typeof icon !== 'string') {
|
|
75
|
+
var Glyph = icon;
|
|
76
|
+
return jsx("span", {
|
|
77
|
+
css: itemIconStyles
|
|
78
|
+
}, jsx(Glyph, {
|
|
79
|
+
alt: alt
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return jsx("span", {
|
|
84
|
+
css: itemIconStyles
|
|
85
|
+
}, jsx("img", {
|
|
86
|
+
src: icon,
|
|
87
|
+
alt: alt,
|
|
88
|
+
css: imgStyles
|
|
89
|
+
}));
|
|
90
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
4
|
+
|
|
5
|
+
import { token } from '@atlaskit/tokens';
|
|
6
|
+
import { css } from '@emotion/react';
|
|
7
|
+
import { B50, N300, N800, N20, B400 } from '@atlaskit/theme/colors';
|
|
8
|
+
import { gridSize } from '@atlaskit/theme/constants'; // AFP-2532 TODO: Fix automatic suppressions below
|
|
9
|
+
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
10
|
+
|
|
11
|
+
import { fontSizeSmall, fontSize } from '@atlaskit/theme';
|
|
12
|
+
export var relativeFontSizeToBase16 = function relativeFontSizeToBase16(px) {
|
|
13
|
+
if (typeof px === 'string') {
|
|
14
|
+
px = parseInt(px);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (isNaN(px)) {
|
|
18
|
+
throw new Error("Invalid font size: '".concat(px, "'"));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return "".concat(px / 16, "rem");
|
|
22
|
+
};
|
|
23
|
+
var listItemBaseStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n padding: ", "px ", "px;\n margin: 0 -", "px;\n cursor: pointer;\n"])), gridSize(), gridSize() * 2, gridSize() * 2);
|
|
24
|
+
var listItemBoxShadow = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n box-shadow: inset 2px 0px 0px ", ";\n"])), token('color.border.selected', B400));
|
|
25
|
+
var listItemActive = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background-color: ", ";\n"])), token('color.background.neutral.subtle.hovered', N20));
|
|
26
|
+
var listItemSelected = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: ", ";\n"])), token('color.background.selected', B50));
|
|
27
|
+
export var composeListItemStyles = function composeListItemStyles() {
|
|
28
|
+
var active = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
29
|
+
var selected = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
30
|
+
var hasShadow = active || selected;
|
|
31
|
+
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n ", ";\n ", ";\n ", ";\n ", ";\n "])), listItemBaseStyles, active && listItemActive, selected && listItemSelected, hasShadow && listItemBoxShadow);
|
|
32
|
+
};
|
|
33
|
+
export var itemNameStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n overflow: hidden;\n"])));
|
|
34
|
+
export var listItemNameStyles = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n line-height: 20px;\n"])), token('color.text', N800));
|
|
35
|
+
export var listItemContextStyles = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", ";\n line-height: ", "px;\n"])), token('color.text', N300), relativeFontSizeToBase16(fontSizeSmall()), fontSize());
|
|
36
|
+
export var itemIconStyles = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n min-width: ", "px;\n margin-top: 3px;\n margin-right: 12px;\n"])), gridSize() * 2);
|
|
37
|
+
export var imgStyles = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n max-width: ", "px;\n"])), gridSize() * 2);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
4
|
+
|
|
5
|
+
import { token } from '@atlaskit/tokens';
|
|
6
|
+
import { css } from '@emotion/react';
|
|
7
|
+
import { N500 } from '@atlaskit/theme/colors'; // AFP-2532 TODO: Fix automatic suppressions below
|
|
8
|
+
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
9
|
+
|
|
10
|
+
import { typography } from '@atlaskit/theme';
|
|
11
|
+
import { gridSize } from '@atlaskit/theme/constants';
|
|
12
|
+
var LINK_PICKER_WIDTH_IN_PX = 342;
|
|
13
|
+
export var recentListStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n"])), LINK_PICKER_WIDTH_IN_PX);
|
|
14
|
+
export var containerStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: ", "px;\n width: 100%;\n overflow: hidden;\n line-height: initial;\n box-sizing: border-box;\n"])), gridSize() * 2);
|
|
15
|
+
export var searchIconStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-left: ", "px;\n color: ", ";\n cursor: default;\n"])), gridSize() / 2, token('color.icon', N500));
|
|
16
|
+
export var listTitleStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", "\n text-transform: uppercase;\n margin-bottom: ", "px;\n"])), typography.h100(), gridSize() / 2);
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["name", "label", "autoFocus", "onSubmit", "onRedo", "onUndo", "onChange", "onKeyDown", "onClear", "clearLabel", "error"];
|
|
4
|
+
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { useCallback, useRef, Fragment } from 'react';
|
|
7
|
+
import { jsx } from '@emotion/react';
|
|
8
|
+
import { ErrorMessage, Field } from '@atlaskit/form';
|
|
9
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
10
|
+
import Textfield from '@atlaskit/textfield';
|
|
11
|
+
import Selectclear from '@atlaskit/icon/glyph/select-clear';
|
|
12
|
+
import { isRedoEvent, isUndoEvent } from '../../utils';
|
|
13
|
+
import { clearTextButtonStyles, fieldStyles } from './styled';
|
|
14
|
+
|
|
15
|
+
var PanelTextInput = function PanelTextInput(props) {
|
|
16
|
+
var name = props.name,
|
|
17
|
+
label = props.label,
|
|
18
|
+
autoFocus = props.autoFocus,
|
|
19
|
+
onSubmit = props.onSubmit,
|
|
20
|
+
onRedo = props.onRedo,
|
|
21
|
+
onUndo = props.onUndo,
|
|
22
|
+
onChange = props.onChange,
|
|
23
|
+
onKeyDown = props.onKeyDown,
|
|
24
|
+
onClear = props.onClear,
|
|
25
|
+
clearLabel = props.clearLabel,
|
|
26
|
+
error = props.error,
|
|
27
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
28
|
+
|
|
29
|
+
var inputRef = useRef(null);
|
|
30
|
+
var handleRef = useCallback(function (input) {
|
|
31
|
+
if (input) {
|
|
32
|
+
inputRef.current = input;
|
|
33
|
+
|
|
34
|
+
if (autoFocus) {
|
|
35
|
+
// Need this to prevent jumping when we render TextInput inside Portal @see ED-2992
|
|
36
|
+
input.focus({
|
|
37
|
+
preventScroll: true
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}, [autoFocus]);
|
|
42
|
+
var handleChange = useCallback(function (e) {
|
|
43
|
+
onChange(e.currentTarget.value);
|
|
44
|
+
}, [onChange]);
|
|
45
|
+
var handleKeydown = useCallback(function (e) {
|
|
46
|
+
var value = e.currentTarget.value;
|
|
47
|
+
|
|
48
|
+
if (e.keyCode === 13 && onSubmit) {
|
|
49
|
+
e.preventDefault(); // Prevent from submitting if an editor is inside a form.
|
|
50
|
+
|
|
51
|
+
onSubmit(value);
|
|
52
|
+
} else if (typeof onUndo === 'function' && isUndoEvent(e)) {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
onUndo();
|
|
55
|
+
} else if (typeof onRedo === 'function' && isRedoEvent(e)) {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
onRedo();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (onKeyDown) {
|
|
61
|
+
onKeyDown(e);
|
|
62
|
+
}
|
|
63
|
+
}, [onSubmit, onUndo, onRedo, onKeyDown]);
|
|
64
|
+
var handleClear = useCallback(function () {
|
|
65
|
+
if (inputRef.current && onClear) {
|
|
66
|
+
inputRef.current.focus();
|
|
67
|
+
onClear();
|
|
68
|
+
}
|
|
69
|
+
}, [onClear]);
|
|
70
|
+
var clearText = restProps.value !== '' && jsx(Tooltip, {
|
|
71
|
+
content: clearLabel
|
|
72
|
+
}, jsx("button", {
|
|
73
|
+
css: clearTextButtonStyles,
|
|
74
|
+
onClick: handleClear,
|
|
75
|
+
"data-testid": "clear-text"
|
|
76
|
+
}, jsx(Selectclear, {
|
|
77
|
+
size: "medium",
|
|
78
|
+
label: clearLabel || ''
|
|
79
|
+
})));
|
|
80
|
+
return jsx("div", {
|
|
81
|
+
css: fieldStyles
|
|
82
|
+
}, jsx(Field, {
|
|
83
|
+
label: label,
|
|
84
|
+
name: name
|
|
85
|
+
}, function (_ref) {
|
|
86
|
+
var fieldProps = _ref.fieldProps;
|
|
87
|
+
return jsx(Fragment, null, jsx(Textfield, _extends({}, fieldProps, restProps, {
|
|
88
|
+
onKeyDown: handleKeydown,
|
|
89
|
+
onChange: handleChange,
|
|
90
|
+
ref: handleRef,
|
|
91
|
+
elemAfterInput: clearText,
|
|
92
|
+
isInvalid: !!error
|
|
93
|
+
})), error && jsx(ErrorMessage, {
|
|
94
|
+
testId: "link-error"
|
|
95
|
+
}, error));
|
|
96
|
+
}));
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export default PanelTextInput;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
|
+
|
|
5
|
+
import { token } from '@atlaskit/tokens';
|
|
6
|
+
import { css } from '@emotion/react';
|
|
7
|
+
import { N500 } from '@atlaskit/theme/colors';
|
|
8
|
+
import { gridSize } from '@atlaskit/theme/constants';
|
|
9
|
+
export var clearTextButtonStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 0;\n margin-right: ", "px;\n color: ", ";\n background: transparent;\n border: none;\n cursor: pointer;\n"])), gridSize() / 2, token('color.icon.subtle', N500));
|
|
10
|
+
export var fieldStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-bottom: ", "px;\n"])), gridSize() * 2);
|
package/dist/esm/url.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import LinkifyIt from 'linkify-it';
|
|
2
|
+
var linkify = LinkifyIt();
|
|
3
|
+
linkify.add('sourcetree:', 'http:');
|
|
4
|
+
var tlds = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
|
|
5
|
+
var tlds2Char = 'a[cdefgilmnoqrtuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrtuvwxyz]|n[acefgilopruz]|om|p[aefghkmnrtw]|qa|r[eosuw]|s[abcdegijklmnrtuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
|
|
6
|
+
tlds.push(tlds2Char);
|
|
7
|
+
linkify.tlds(tlds, false);
|
|
8
|
+
var whitelistedURLPatterns = [/^https?:\/\/[^\s]*$/im, /^ftps?:\/\//im, /^\//im, /^mailto:/im, /^skype:/im, /^callto:[^\s]*$/im, /^facetime:[^\s]*$/im, /^git:/im, /^irc6?:/im, /^news:/im, /^nntp:/im, /^feed:/im, /^cvs:/im, /^svn:/im, /^mvn:/im, /^ssh:/im, /^scp:\/\//im, /^sftp:\/\//im, /^itms:/im, /^notes:/im, /^hipchat:\/\//im, /^sourcetree:/im, /^urn:/im, /^tel:/im, /^xmpp:/im, /^telnet:/im, /^vnc:/im, /^rdp:/im, /^whatsapp:/im, /^slack:/im, /^sips?:/im, /^magnet:/im, /^foo:/im, /^#/im];
|
|
9
|
+
|
|
10
|
+
var normaliseLinkHref = function normaliseLinkHref(url) {
|
|
11
|
+
var match = getLinkMatch(url);
|
|
12
|
+
return match && match.url || null;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
var getLinkMatch = function getLinkMatch(str) {
|
|
16
|
+
if (!str) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
var match = linkifyMatch(str);
|
|
21
|
+
|
|
22
|
+
if (!match.length) {
|
|
23
|
+
match = linkify.match(str);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return match && match.length > 0 && match[0].index === 0 && match[0].lastIndex === str.trim().length ? match[0] : null;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var LINK_REGEXP = /(https?|ftp):\/\/[^\s]+/;
|
|
30
|
+
|
|
31
|
+
var linkifyMatch = function linkifyMatch(text) {
|
|
32
|
+
var matches = [];
|
|
33
|
+
|
|
34
|
+
if (!LINK_REGEXP.test(text)) {
|
|
35
|
+
return matches;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
var startpos = 0;
|
|
39
|
+
var substr;
|
|
40
|
+
|
|
41
|
+
while (substr = text.substr(startpos)) {
|
|
42
|
+
var link = (substr.match(LINK_REGEXP) || [''])[0];
|
|
43
|
+
|
|
44
|
+
if (link) {
|
|
45
|
+
var index = substr.search(LINK_REGEXP);
|
|
46
|
+
var start = index >= 0 ? index + startpos : index;
|
|
47
|
+
var end = start + link.length;
|
|
48
|
+
matches.push({
|
|
49
|
+
index: start,
|
|
50
|
+
lastIndex: end,
|
|
51
|
+
raw: link,
|
|
52
|
+
url: link,
|
|
53
|
+
text: link,
|
|
54
|
+
schema: ''
|
|
55
|
+
});
|
|
56
|
+
startpos += end;
|
|
57
|
+
} else {
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return matches;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export var isSafeUrl = function isSafeUrl(url) {
|
|
66
|
+
var urlTrimmed = url.trim();
|
|
67
|
+
|
|
68
|
+
if (urlTrimmed.length === 0) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return whitelistedURLPatterns.some(function (p) {
|
|
73
|
+
return p.test(urlTrimmed);
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Adds protocol to url if needed.
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
export function normalizeUrl(url) {
|
|
81
|
+
if (!url) {
|
|
82
|
+
return '';
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (isSafeUrl(url)) {
|
|
86
|
+
return url.trim();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return normaliseLinkHref(url);
|
|
90
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { browser } from './browser';
|
|
2
|
+
var KeyZCode = 90;
|
|
3
|
+
var KeyYCode = 89;
|
|
4
|
+
export var isUndoEvent = function isUndoEvent(e) {
|
|
5
|
+
return e.keyCode === KeyZCode && ( // cmd + z for mac
|
|
6
|
+
browser.mac && e.metaKey && !e.shiftKey || // ctrl + z for non-mac
|
|
7
|
+
!browser.mac && e.ctrlKey);
|
|
8
|
+
};
|
|
9
|
+
export var isRedoEvent = function isRedoEvent(e) {
|
|
10
|
+
return (// ctrl + y for non-mac
|
|
11
|
+
!browser.mac && e.ctrlKey && e.keyCode === KeyYCode || browser.mac && e.metaKey && e.shiftKey && e.keyCode === KeyZCode || e.ctrlKey && e.shiftKey && e.keyCode === KeyZCode
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const result: {
|
|
2
|
+
mac: boolean;
|
|
3
|
+
ie: boolean;
|
|
4
|
+
ie_version: number;
|
|
5
|
+
gecko: boolean;
|
|
6
|
+
chrome: boolean;
|
|
7
|
+
chrome_version: number;
|
|
8
|
+
android: boolean;
|
|
9
|
+
ios: boolean;
|
|
10
|
+
webkit: boolean;
|
|
11
|
+
safari: boolean;
|
|
12
|
+
supportsIntersectionObserver: boolean;
|
|
13
|
+
supportsResizeObserver: boolean;
|
|
14
|
+
};
|
|
15
|
+
export { result as browser };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
placeholder: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
linkPlaceholder: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
linkTextPlaceholder: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
linkLabel: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
linkInvalid: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
linkTextLabel: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
clearText: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
clearLink: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
searchLinkAriaDescription: {
|
|
43
|
+
id: string;
|
|
44
|
+
defaultMessage: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
searchLinkResults: {
|
|
48
|
+
id: string;
|
|
49
|
+
defaultMessage: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
linkAriaLabel: {
|
|
53
|
+
id: string;
|
|
54
|
+
defaultMessage: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
timeUpdated: {
|
|
58
|
+
id: string;
|
|
59
|
+
defaultMessage: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
timeViewed: {
|
|
63
|
+
id: string;
|
|
64
|
+
defaultMessage: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
timeAgo: {
|
|
68
|
+
id: string;
|
|
69
|
+
defaultMessage: string;
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
72
|
+
titleRecentlyViewed: {
|
|
73
|
+
id: string;
|
|
74
|
+
defaultMessage: string;
|
|
75
|
+
description: string;
|
|
76
|
+
};
|
|
77
|
+
titleResults: {
|
|
78
|
+
id: string;
|
|
79
|
+
defaultMessage: string;
|
|
80
|
+
description: string;
|
|
81
|
+
};
|
|
82
|
+
cancelButton: {
|
|
83
|
+
id: string;
|
|
84
|
+
defaultMessage: string;
|
|
85
|
+
description: string;
|
|
86
|
+
};
|
|
87
|
+
insertButton: {
|
|
88
|
+
id: string;
|
|
89
|
+
defaultMessage: string;
|
|
90
|
+
description: string;
|
|
91
|
+
};
|
|
92
|
+
noResults: {
|
|
93
|
+
id: string;
|
|
94
|
+
defaultMessage: string;
|
|
95
|
+
description: string;
|
|
96
|
+
};
|
|
97
|
+
noResultsDescription: {
|
|
98
|
+
id: string;
|
|
99
|
+
defaultMessage: string;
|
|
100
|
+
description: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MessageDescriptor } from 'react-intl-next';
|
|
3
|
+
export declare type LinkInputType = 'manual' | 'typeAhead';
|
|
4
|
+
export interface LinkSearchListItemData {
|
|
5
|
+
/** Unique identifiable attribute for the item */
|
|
6
|
+
objectId: string;
|
|
7
|
+
/** Name / title / display text of the link */
|
|
8
|
+
name: string;
|
|
9
|
+
/** URL of the resource being linked to */
|
|
10
|
+
url: string;
|
|
11
|
+
/** Icon to display in link result */
|
|
12
|
+
icon: string | React.ComponentType<{
|
|
13
|
+
alt: string;
|
|
14
|
+
}>;
|
|
15
|
+
/** Alt text describing the icon */
|
|
16
|
+
iconAlt: string | MessageDescriptor;
|
|
17
|
+
/** Context to display in link result */
|
|
18
|
+
container?: string;
|
|
19
|
+
/** Optional last view date to display in link result */
|
|
20
|
+
lastViewedDate?: Date;
|
|
21
|
+
/** Optional last updated date to display in link result */
|
|
22
|
+
lastUpdatedDate?: Date;
|
|
23
|
+
/** Whether the result is pre-fetched from activity provider */
|
|
24
|
+
prefetch?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare type ListItemTimeStamp = {
|
|
27
|
+
pageAction: string;
|
|
28
|
+
dateString: string;
|
|
29
|
+
timeSince?: string | undefined;
|
|
30
|
+
};
|
|
31
|
+
export interface LinkPickerState {
|
|
32
|
+
/** Current query string / URL input field value */
|
|
33
|
+
query: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ResolveResult {
|
|
36
|
+
data: LinkSearchListItemData[];
|
|
37
|
+
}
|
|
38
|
+
export interface LinkPickerPlugin {
|
|
39
|
+
resolve: (state: LinkPickerState) => Promise<ResolveResult> | AsyncGenerator<ResolveResult, ResolveResult>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { AriaAttributes, Ref } from 'react';
|
|
2
|
+
declare type AnnouncerProps = {
|
|
3
|
+
ref?: Ref<HTMLDivElement>;
|
|
4
|
+
/** Set 'false' for announcing only changed text
|
|
5
|
+
* (not announce duplicate part of string after second render),
|
|
6
|
+
* and 'true' for announcing all the string after each render */
|
|
7
|
+
ariaAtomic?: AriaAttributes['aria-atomic'];
|
|
8
|
+
/** Set politeness settings */
|
|
9
|
+
ariaLive?: AriaAttributes['aria-live'];
|
|
10
|
+
/** Used to describe what types of changes have occurred to an aria-live region */
|
|
11
|
+
ariaRelevant?: AriaAttributes['aria-relevant'];
|
|
12
|
+
/** Role used to set attribute role. See more details https://dequeuniversity.com/library/aria/liveregion-playground#configOptions */
|
|
13
|
+
role?: 'status' | 'log' | 'alert' | 'timer' | 'marquee';
|
|
14
|
+
/** Text message that will be announced */
|
|
15
|
+
text: string;
|
|
16
|
+
/** Debounce delay.
|
|
17
|
+
* Set delay (ms) to prevent announce the same string multiple times.
|
|
18
|
+
* It can be useful for cases when the parent component re-renders with the same announcer's text. */
|
|
19
|
+
delay?: number;
|
|
20
|
+
};
|
|
21
|
+
declare const _default: React.NamedExoticComponent<AnnouncerProps>;
|
|
22
|
+
export default _default;
|