@atlaskit/smart-card 19.1.16 → 19.1.17
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/extractors/block/index.js +2 -1
- package/dist/cjs/extractors/common/actions/extractPreviewAction.js +2 -1
- package/dist/cjs/i18n/cs.js +29 -115
- package/dist/cjs/i18n/da.js +31 -116
- package/dist/cjs/i18n/de.js +30 -116
- package/dist/cjs/i18n/en.js +29 -115
- package/dist/cjs/i18n/en_GB.js +29 -115
- package/dist/cjs/i18n/en_ZZ.js +10 -129
- package/dist/cjs/i18n/es.js +29 -115
- package/dist/cjs/i18n/fi.js +29 -115
- package/dist/cjs/i18n/fr.js +30 -116
- package/dist/cjs/i18n/hu.js +30 -116
- package/dist/cjs/i18n/it.js +29 -115
- package/dist/cjs/i18n/ja.js +29 -115
- package/dist/cjs/i18n/ko.js +29 -115
- package/dist/cjs/i18n/nb.js +30 -116
- package/dist/cjs/i18n/nl.js +29 -115
- package/dist/cjs/i18n/pl.js +30 -116
- package/dist/cjs/i18n/pt_BR.js +29 -115
- package/dist/cjs/i18n/ru.js +30 -116
- package/dist/cjs/i18n/sv.js +29 -115
- package/dist/cjs/i18n/th.js +29 -115
- package/dist/cjs/i18n/tr.js +30 -116
- package/dist/cjs/i18n/uk.js +29 -115
- package/dist/cjs/i18n/vi.js +29 -115
- package/dist/cjs/i18n/zh.js +30 -116
- package/dist/cjs/i18n/zh_TW.js +29 -115
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +12 -12
- package/dist/cjs/state/hooks-external/useSmartLinkActions.js +2 -1
- package/dist/cjs/utils/analytics/analytics.js +8 -4
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/HoverCard/components/hover-card-content.js +125 -0
- package/dist/cjs/view/HoverCard/index.js +22 -89
- package/dist/cjs/view/HoverCard/utils.js +3 -1
- package/dist/es2019/extractors/block/index.js +2 -1
- package/dist/es2019/extractors/common/actions/extractPreviewAction.js +2 -2
- package/dist/es2019/i18n/cs.js +29 -115
- package/dist/es2019/i18n/da.js +31 -116
- package/dist/es2019/i18n/de.js +30 -116
- package/dist/es2019/i18n/en.js +29 -115
- package/dist/es2019/i18n/en_GB.js +29 -115
- package/dist/es2019/i18n/en_ZZ.js +10 -129
- package/dist/es2019/i18n/es.js +29 -115
- package/dist/es2019/i18n/fi.js +29 -115
- package/dist/es2019/i18n/fr.js +30 -116
- package/dist/es2019/i18n/hu.js +30 -116
- package/dist/es2019/i18n/it.js +29 -115
- package/dist/es2019/i18n/ja.js +29 -115
- package/dist/es2019/i18n/ko.js +29 -115
- package/dist/es2019/i18n/nb.js +30 -116
- package/dist/es2019/i18n/nl.js +29 -115
- package/dist/es2019/i18n/pl.js +30 -116
- package/dist/es2019/i18n/pt_BR.js +29 -115
- package/dist/es2019/i18n/ru.js +30 -116
- package/dist/es2019/i18n/sv.js +29 -115
- package/dist/es2019/i18n/th.js +29 -115
- package/dist/es2019/i18n/tr.js +30 -116
- package/dist/es2019/i18n/uk.js +29 -115
- package/dist/es2019/i18n/vi.js +29 -115
- package/dist/es2019/i18n/zh.js +30 -116
- package/dist/es2019/i18n/zh_TW.js +29 -115
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +4 -4
- package/dist/es2019/state/hooks-external/useSmartLinkActions.js +2 -1
- package/dist/es2019/utils/analytics/analytics.js +8 -4
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/HoverCard/components/hover-card-content.js +85 -0
- package/dist/es2019/view/HoverCard/index.js +23 -78
- package/dist/es2019/view/HoverCard/utils.js +1 -0
- package/dist/esm/extractors/block/index.js +2 -1
- package/dist/esm/extractors/common/actions/extractPreviewAction.js +2 -1
- package/dist/esm/i18n/cs.js +29 -115
- package/dist/esm/i18n/da.js +31 -116
- package/dist/esm/i18n/de.js +30 -116
- package/dist/esm/i18n/en.js +29 -115
- package/dist/esm/i18n/en_GB.js +29 -115
- package/dist/esm/i18n/en_ZZ.js +10 -129
- package/dist/esm/i18n/es.js +29 -115
- package/dist/esm/i18n/fi.js +29 -115
- package/dist/esm/i18n/fr.js +30 -116
- package/dist/esm/i18n/hu.js +30 -116
- package/dist/esm/i18n/it.js +29 -115
- package/dist/esm/i18n/ja.js +29 -115
- package/dist/esm/i18n/ko.js +29 -115
- package/dist/esm/i18n/nb.js +30 -116
- package/dist/esm/i18n/nl.js +29 -115
- package/dist/esm/i18n/pl.js +30 -116
- package/dist/esm/i18n/pt_BR.js +29 -115
- package/dist/esm/i18n/ru.js +30 -116
- package/dist/esm/i18n/sv.js +29 -115
- package/dist/esm/i18n/th.js +29 -115
- package/dist/esm/i18n/tr.js +30 -116
- package/dist/esm/i18n/uk.js +29 -115
- package/dist/esm/i18n/vi.js +29 -115
- package/dist/esm/i18n/zh.js +30 -116
- package/dist/esm/i18n/zh_TW.js +29 -115
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +12 -12
- package/dist/esm/state/hooks-external/useSmartLinkActions.js +2 -1
- package/dist/esm/utils/analytics/analytics.js +8 -4
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/HoverCard/components/hover-card-content.js +99 -0
- package/dist/esm/view/HoverCard/index.js +25 -87
- package/dist/esm/view/HoverCard/utils.js +1 -0
- package/dist/types/extractors/block/types.d.ts +2 -0
- package/dist/types/extractors/common/actions/extractPreviewAction.d.ts +2 -1
- package/dist/types/i18n/cs.d.ts +28 -114
- package/dist/types/i18n/da.d.ts +28 -113
- package/dist/types/i18n/de.d.ts +28 -114
- package/dist/types/i18n/en.d.ts +28 -114
- package/dist/types/i18n/en_GB.d.ts +28 -114
- package/dist/types/i18n/en_ZZ.d.ts +9 -128
- package/dist/types/i18n/es.d.ts +28 -114
- package/dist/types/i18n/fi.d.ts +28 -114
- package/dist/types/i18n/fr.d.ts +28 -114
- package/dist/types/i18n/hu.d.ts +28 -114
- package/dist/types/i18n/it.d.ts +28 -114
- package/dist/types/i18n/ja.d.ts +28 -114
- package/dist/types/i18n/ko.d.ts +28 -114
- package/dist/types/i18n/nb.d.ts +28 -114
- package/dist/types/i18n/nl.d.ts +28 -114
- package/dist/types/i18n/pl.d.ts +28 -114
- package/dist/types/i18n/pt_BR.d.ts +28 -114
- package/dist/types/i18n/ru.d.ts +28 -114
- package/dist/types/i18n/sv.d.ts +28 -114
- package/dist/types/i18n/th.d.ts +28 -114
- package/dist/types/i18n/tr.d.ts +28 -114
- package/dist/types/i18n/uk.d.ts +28 -114
- package/dist/types/i18n/vi.d.ts +28 -114
- package/dist/types/i18n/zh.d.ts +28 -114
- package/dist/types/i18n/zh_TW.d.ts +28 -114
- package/dist/types/state/actions/index.d.ts +2 -1
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +2 -2
- package/dist/types/state/hooks/useSmartLink.d.ts +3 -3
- package/dist/types/state/hooks-external/useSmartLinkActions.d.ts +2 -2
- package/dist/types/utils/analytics/analytics.d.ts +4 -4
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/HoverCard/components/hover-card-content.d.ts +4 -0
- package/dist/types/view/HoverCard/types.d.ts +12 -0
- package/dist/types/view/HoverCard/utils.d.ts +1 -0
- package/package.json +1 -1
|
@@ -6,152 +6,66 @@
|
|
|
6
6
|
*/
|
|
7
7
|
//Chinese (Traditional)
|
|
8
8
|
export default {
|
|
9
|
-
'fabric.linking.cannot_connect': '無法連結,請再試一次',
|
|
10
|
-
'fabric.linking.cannot_find_link': '找不到連結',
|
|
11
|
-
'fabric.linking.join_to_view': '加入 {context} 以查看此議題',
|
|
12
|
-
'fabric.linking.create_on': '建立時間:{context}',
|
|
13
|
-
'fabric.linking.created_by': '建立者:{context}',
|
|
14
|
-
'fabric.linking.delete': '刪除',
|
|
15
|
-
'fabric.linking.edit': '編輯',
|
|
16
|
-
'fabric.linking.forbidden_access': '您的存取遭拒',
|
|
17
|
-
'fabric.linking.restricted_link': '連結受到限制,請嘗試其他帳戶',
|
|
18
|
-
'fabric.linking.modified_on': '更新時間:{context}',
|
|
19
|
-
'fabric.linking.pending_request': '您的存取要求擱置中',
|
|
20
|
-
'fabric.linking.priority_blocker': '封鎖程式',
|
|
21
|
-
'fabric.linking.priority_critical': '重要',
|
|
22
|
-
'fabric.linking.priority_high': '高',
|
|
23
|
-
'fabric.linking.priority_highest': '最高',
|
|
24
|
-
'fabric.linking.priority_low': '低',
|
|
25
|
-
'fabric.linking.priority_lowest': '最低',
|
|
26
|
-
'fabric.linking.priority_major': '主要',
|
|
27
|
-
'fabric.linking.priority_medium': '中',
|
|
28
|
-
'fabric.linking.priority_minor': '次要',
|
|
29
|
-
'fabric.linking.priority_trivial': '不太重要',
|
|
30
|
-
'fabric.linking.priority_undefined': '未定義',
|
|
31
|
-
'fabric.linking.request_access_to_view': '要求存取 {context} 以檢視此議題',
|
|
32
|
-
'fabric.linking.request_denied': '您的存取要求遭拒',
|
|
33
|
-
'fabric.linking.updated_by': '修改者:{context}',
|
|
34
|
-
'fabric.linking.accounts': '帳戶',
|
|
35
9
|
'fabric.linking.actions': '動作',
|
|
36
10
|
'fabric.linking.add_account': '新增帳戶',
|
|
37
|
-
'fabric.linking.annotate': '加上註解',
|
|
38
|
-
'fabric.linking.annotate.confirmation.close.anyway': '仍要關閉',
|
|
39
|
-
'fabric.linking.annotate.confirmation.content': '您有一些未儲存的變更,確定要離開嗎?',
|
|
40
|
-
'fabric.linking.annotate.confirmation.heading': '未儲存的變更',
|
|
41
|
-
'fabric.linking.annotate.tool.arrow': '箭頭',
|
|
42
|
-
'fabric.linking.annotate.tool.blur': '模糊',
|
|
43
|
-
'fabric.linking.annotate.tool.brush': '筆刷',
|
|
44
|
-
'fabric.linking.annotate.tool.color': '顏色',
|
|
45
|
-
'fabric.linking.annotate.tool.line.thickness': '線條粗細',
|
|
46
|
-
'fabric.linking.annotate.tool.shape': '形狀',
|
|
47
|
-
'fabric.linking.annotate.tool.text': '文字',
|
|
48
|
-
'fabric.linking.archive': '封存',
|
|
49
|
-
'fabric.linking.audio': '音訊',
|
|
50
11
|
'fabric.linking.cancel': '取消',
|
|
51
|
-
'fabric.linking.
|
|
52
|
-
'fabric.linking.
|
|
53
|
-
'fabric.linking.cant_retrieve_gifs': '唉呦!我們無法擷取任何 GIF',
|
|
54
|
-
'fabric.linking.change_view': '變更檢視畫面',
|
|
55
|
-
'fabric.linking.check_your_network': '請檢查您的網路連線',
|
|
12
|
+
'fabric.linking.cannot_connect': '無法連結,請再試一次',
|
|
13
|
+
'fabric.linking.cannot_find_link': '找不到連結',
|
|
56
14
|
'fabric.linking.click_to_join': '加入 {context}',
|
|
57
15
|
'fabric.linking.click_to_join_description': '您已獲得核准,因此可以立即加入 {context}。',
|
|
58
16
|
'fabric.linking.close': '關閉',
|
|
59
|
-
'fabric.linking.close_and_reopen': '請試著關閉此檔案,然後再重新開啟。',
|
|
60
17
|
'fabric.linking.connect_account_description': '我們會開啟新的頁面來協助您連結 {name} 帳戶',
|
|
61
18
|
'fabric.linking.connect_link_account': '連線以預覽',
|
|
62
19
|
'fabric.linking.connect_link_account_card_view': '連結',
|
|
63
20
|
'fabric.linking.connect_link_account_card_view_description': '若要顯示此連結的預覽,請連接您的 {context} 帳戶。',
|
|
64
21
|
'fabric.linking.connect_link_account_card_view_name': '連結 {context} 帳戶',
|
|
65
22
|
'fabric.linking.connect_to': '連結至 {name}',
|
|
66
|
-
'fabric.linking.could_not_load_editor': '唉呦!我們無法載入編輯器',
|
|
67
|
-
'fabric.linking.could_not_save_image': '唉呦!我們無法儲存影像',
|
|
68
|
-
'fabric.linking.couldnt_generate_encrypted_entry_preview': '我們無法預覽加密或以密碼保護的檔案。',
|
|
69
|
-
'fabric.linking.couldnt_generate_preview': '我們無法為此檔案產生預覽。',
|
|
70
|
-
'fabric.linking.couldnt_load_file': '我們無法載入檔案。',
|
|
71
23
|
'fabric.linking.couldnt_load_link': '基於不明原因,我們無法載入此連結。',
|
|
72
|
-
'fabric.linking.
|
|
73
|
-
'fabric.linking.
|
|
74
|
-
'fabric.linking.
|
|
75
|
-
'fabric.linking.
|
|
76
|
-
'fabric.linking.document': '文件',
|
|
24
|
+
'fabric.linking.create_on_absolute': '於 {context} 建立',
|
|
25
|
+
'fabric.linking.create_on_relative': '建立時間:{context}',
|
|
26
|
+
'fabric.linking.created_by': '建立者:{context}',
|
|
27
|
+
'fabric.linking.delete': '刪除',
|
|
77
28
|
'fabric.linking.download': '下載',
|
|
78
|
-
'fabric.linking.
|
|
79
|
-
'fabric.linking.
|
|
80
|
-
'fabric.linking.drag_and_drop_your_files_and_folders': '將檔案和資料夾拖曳至任何位置或',
|
|
81
|
-
'fabric.linking.drop_your_files': '置放要上傳的檔案',
|
|
82
|
-
'fabric.linking.drop_your_files_here': '將檔案置放在此',
|
|
83
|
-
'fabric.linking.email': '電子郵件',
|
|
84
|
-
'fabric.linking.enable_fullscreen': '啟用全螢幕',
|
|
85
|
-
'fabric.linking.error_429': '錯誤 429',
|
|
86
|
-
'fabric.linking.error_generating_preview': '產生預覽時發生錯誤',
|
|
87
|
-
'fabric.linking.error_hint_critical': '如果問題持續發生,請聯絡支援人員。',
|
|
88
|
-
'fabric.linking.error_hint_retry': '請再試一次。',
|
|
89
|
-
'fabric.linking.error_loading_file': '載入檔案時發生錯誤',
|
|
90
|
-
'fabric.linking.failed_to_load': '無法載入',
|
|
91
|
-
'fabric.linking.failed_to_upload': '無法上傳',
|
|
29
|
+
'fabric.linking.edit': '編輯',
|
|
30
|
+
'fabric.linking.forbidden_access': '您的存取遭拒',
|
|
92
31
|
'fabric.linking.forbidden_description': '您沒有此預覽的存取權。如果您需要存取權,請連絡網站管理員。',
|
|
93
|
-
'fabric.linking.give_feedback': '提供意見反應',
|
|
94
|
-
'fabric.linking.image': '影像',
|
|
95
|
-
'fabric.linking.image_format_invalid_error': '無法載入影像,格式無效。',
|
|
96
|
-
'fabric.linking.image_size_too_large_error': '影像太大,不得大於 {MAX_SIZE_MB}Mb',
|
|
97
|
-
'fabric.linking.image_url_invalid_error': '無法載入影像,URL 無效。',
|
|
98
|
-
'fabric.linking.insert_files': '{0, plural, other {插入 {0} 個檔案}}',
|
|
99
32
|
'fabric.linking.invalid_permissions': '限制連結',
|
|
100
33
|
'fabric.linking.invalid_permissions_description': '您需要請求存取或嘗試不同的帳戶,來檢視此預覽。',
|
|
101
|
-
'fabric.linking.
|
|
102
|
-
'fabric.linking.learn_more': '深入了解',
|
|
103
|
-
'fabric.linking.load_more_gifs': '載入更多 GIF',
|
|
34
|
+
'fabric.linking.join_to_view': '加入 {context} 以查看此議題',
|
|
104
35
|
'fabric.linking.loading': '正在載入...',
|
|
105
|
-
'fabric.linking.
|
|
106
|
-
'fabric.linking.
|
|
107
|
-
'fabric.linking.
|
|
108
|
-
'fabric.linking.no_gifs_found_suggestion': '我們找不到符合「{query}」的項目',
|
|
109
|
-
'fabric.linking.no_pdf_artifacts': '找不到符合此檔案的 PDF 成品。',
|
|
36
|
+
'fabric.linking.modified_on_absolute': '更新於 {context}',
|
|
37
|
+
'fabric.linking.modified_on_relative': '更新時間:{context}',
|
|
38
|
+
'fabric.linking.more_actions': '更多動作',
|
|
110
39
|
'fabric.linking.not_found_description': '我們找不到此連結。請檢查 URL,然後試著編輯或再次貼上。',
|
|
111
40
|
'fabric.linking.not_found_title': '糟糕,我們找不到此連結!',
|
|
112
|
-
'fabric.linking.
|
|
113
|
-
'fabric.linking.pause': '暫停',
|
|
114
|
-
'fabric.linking.play': '播放',
|
|
115
|
-
'fabric.linking.playback_default_speed': '預設',
|
|
116
|
-
'fabric.linking.playback_speed': '播放速度',
|
|
41
|
+
'fabric.linking.pending_request': '您的存取要求擱置中',
|
|
117
42
|
'fabric.linking.preview': '預覽',
|
|
118
|
-
'fabric.linking.
|
|
119
|
-
'fabric.linking.
|
|
120
|
-
'fabric.linking.
|
|
121
|
-
'fabric.linking.
|
|
43
|
+
'fabric.linking.priority_blocker': '受阻',
|
|
44
|
+
'fabric.linking.priority_critical': '嚴重',
|
|
45
|
+
'fabric.linking.priority_high': '高',
|
|
46
|
+
'fabric.linking.priority_highest': '最高',
|
|
47
|
+
'fabric.linking.priority_low': '低',
|
|
48
|
+
'fabric.linking.priority_lowest': '最低',
|
|
49
|
+
'fabric.linking.priority_major': '主要',
|
|
50
|
+
'fabric.linking.priority_medium': '中',
|
|
51
|
+
'fabric.linking.priority_minor': '次要',
|
|
52
|
+
'fabric.linking.priority_trivial': '不太重要',
|
|
53
|
+
'fabric.linking.priority_undefined': '未定義',
|
|
122
54
|
'fabric.linking.request_access': '要求存取權',
|
|
123
55
|
'fabric.linking.request_access_description': '要求 {context} 的存取權以檢視此預覽。',
|
|
124
56
|
'fabric.linking.request_access_pending': '存取擱置',
|
|
125
57
|
'fabric.linking.request_access_pending_description': '您的存取要求擱置中。',
|
|
58
|
+
'fabric.linking.request_access_to_view': '要求存取 {context} 以檢視此議題',
|
|
59
|
+
'fabric.linking.request_denied': '您的存取要求遭拒',
|
|
126
60
|
'fabric.linking.request_denied_description': '您的存取要求遭到拒絕。如果您仍需要存取權,請連絡網站管理員。',
|
|
61
|
+
'fabric.linking.restricted_link': '連結受到限制,請嘗試其他帳戶',
|
|
127
62
|
'fabric.linking.retry': '重試',
|
|
128
63
|
'fabric.linking.save': '儲存',
|
|
129
|
-
'fabric.linking.search': '搜尋',
|
|
130
|
-
'fabric.linking.search_all_gifs': '搜尋所有 GIF!',
|
|
131
|
-
'fabric.linking.share_files_instantly': '我們會立即分享',
|
|
132
|
-
'fabric.linking.skip_backward': '倒退 10 秒',
|
|
133
|
-
'fabric.linking.skip_forward': '快轉 10 秒',
|
|
134
|
-
'fabric.linking.something_went_wrong': '發生錯誤。',
|
|
135
64
|
'fabric.linking.srclink': '使用以下檢視:',
|
|
136
65
|
'fabric.linking.srclinkunknown': '檢視原始狀態',
|
|
137
|
-
'fabric.linking.text': '文字',
|
|
138
66
|
'fabric.linking.try_again': '再試一次',
|
|
139
67
|
'fabric.linking.try_another_account': '使用其他帳戶嘗試',
|
|
140
|
-
'fabric.linking.try_downloading_file': '嘗試下載檔案來進行檢視。',
|
|
141
|
-
'fabric.linking.unable_to_annotate_image': '您無法對此影像加上註解',
|
|
142
|
-
'fabric.linking.unknown': '未知',
|
|
143
68
|
'fabric.linking.unlink_account': '取消帳戶的連結',
|
|
144
|
-
'fabric.linking.
|
|
145
|
-
'fabric.linking.
|
|
146
|
-
'fabric.linking.upload_file': '上傳檔案',
|
|
147
|
-
'fabric.linking.upload_file_from': '從 {name} 上傳檔案',
|
|
148
|
-
'fabric.linking.upload_image': '上傳影像',
|
|
149
|
-
'fabric.linking.upload_photo': '上傳相片',
|
|
150
|
-
'fabric.linking.video': '影片',
|
|
151
|
-
'fabric.linking.view': '檢視',
|
|
152
|
-
'fabric.linking.viewer_rateLimited': '載入您的檔案時發生問題。',
|
|
153
|
-
'fabric.linking.webgl_warning_description': '您的瀏覽器不支援 WebGL。使用啟用 WebGL 的瀏覽器來為影像加上註解。',
|
|
154
|
-
'fabric.linking.zip_entry_load_failed': '我們無法載入該 zip 檔案項目來進行預覽',
|
|
155
|
-
'fabric.linking.zoom_in': '縮小',
|
|
156
|
-
'fabric.linking.zoom_out': '放大'
|
|
69
|
+
'fabric.linking.updated_by': '修改者:{context}',
|
|
70
|
+
'fabric.linking.view': '檢視'
|
|
157
71
|
};
|
|
@@ -77,7 +77,7 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
77
77
|
extensionKey,
|
|
78
78
|
invokeType
|
|
79
79
|
});
|
|
80
|
-
dispatchAnalytics(uiActionClickedEvent(actionType, extensionKey, display));
|
|
80
|
+
dispatchAnalytics(uiActionClickedEvent(id, actionType, extensionKey, display));
|
|
81
81
|
},
|
|
82
82
|
|
|
83
83
|
/**
|
|
@@ -89,7 +89,7 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
89
89
|
* @param previewInvokeMethod How the preview was triggered.
|
|
90
90
|
*/
|
|
91
91
|
hoverCardOpenLinkClickedEvent: (previewDisplay, definitionId = extractedDefinitionId, extensionKey = extractedExtensionKey, previewInvokeMethod) => {
|
|
92
|
-
dispatchAnalytics(uiHoverCardOpenLinkClickedEvent(previewDisplay, definitionId, extensionKey, previewInvokeMethod));
|
|
92
|
+
dispatchAnalytics(uiHoverCardOpenLinkClickedEvent(defaultId, previewDisplay, definitionId, extensionKey, previewInvokeMethod));
|
|
93
93
|
},
|
|
94
94
|
|
|
95
95
|
/**
|
|
@@ -129,7 +129,7 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
129
129
|
* @param previewInvokeMethod How the preview was triggered.
|
|
130
130
|
* @returns
|
|
131
131
|
*/
|
|
132
|
-
hoverCardViewedEvent: (previewDisplay, definitionId = extractedDefinitionId, extensionKey = extractedExtensionKey
|
|
132
|
+
hoverCardViewedEvent: (previewDisplay, previewInvokeMethod, id = defaultId, definitionId = extractedDefinitionId, extensionKey = extractedExtensionKey) => dispatchAnalytics(uiHoverCardViewedEvent(id, previewDisplay, definitionId, extensionKey, previewInvokeMethod)),
|
|
133
133
|
|
|
134
134
|
/**
|
|
135
135
|
* This fires an event that represents a hover preview being dismissed.
|
|
@@ -140,7 +140,7 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
140
140
|
* @param previewInvokeMethod How the preview was triggered.
|
|
141
141
|
* @returns
|
|
142
142
|
*/
|
|
143
|
-
hoverCardDismissedEvent: (previewDisplay, hoverTime, definitionId = extractedDefinitionId, extensionKey = extractedExtensionKey
|
|
143
|
+
hoverCardDismissedEvent: (previewDisplay, hoverTime, previewInvokeMethod, id = defaultId, definitionId = extractedDefinitionId, extensionKey = extractedExtensionKey) => dispatchAnalytics(uiHoverCardDismissedEvent(id, previewDisplay, hoverTime, definitionId, extensionKey, previewInvokeMethod))
|
|
144
144
|
}), [defaultId, defaultLocation, extractedDefinitionId, extractedExtensionKey, dispatchAnalytics]);
|
|
145
145
|
/** Contains all operational analytics events */
|
|
146
146
|
|
|
@@ -24,7 +24,8 @@ export function useSmartLinkActions({
|
|
|
24
24
|
const cardProperties = extractCardProps(linkState.details.data, linkState.details.meta, {
|
|
25
25
|
handleInvoke: opts => linkActions.invoke(opts, appearance),
|
|
26
26
|
handleAnalytics: analyticsHandler,
|
|
27
|
-
extensionKey: getExtensionKey(linkState.details)
|
|
27
|
+
extensionKey: getExtensionKey(linkState.details),
|
|
28
|
+
source: appearance
|
|
28
29
|
}, undefined, platform);
|
|
29
30
|
|
|
30
31
|
if (!cardProperties.actions || cardProperties.actions.length === 0) {
|
|
@@ -190,12 +190,13 @@ export const uiCardClickedEvent = (id, display, status, definitionId, extensionK
|
|
|
190
190
|
destinationProduct
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
|
-
export const uiActionClickedEvent = (actionType, extensionKey, display) => ({
|
|
193
|
+
export const uiActionClickedEvent = (id, actionType, extensionKey, display) => ({
|
|
194
194
|
action: 'clicked',
|
|
195
195
|
actionSubject: 'button',
|
|
196
196
|
actionSubjectId: uiActionSubjectIds[actionType],
|
|
197
197
|
eventType: 'ui',
|
|
198
198
|
attributes: { ...context,
|
|
199
|
+
id,
|
|
199
200
|
display,
|
|
200
201
|
extensionKey: extensionKey || '',
|
|
201
202
|
actionType: actionType
|
|
@@ -240,22 +241,24 @@ export const uiRenderFailedEvent = (display, error, errorInfo) => ({
|
|
|
240
241
|
display
|
|
241
242
|
}
|
|
242
243
|
});
|
|
243
|
-
export const uiHoverCardViewedEvent = (previewDisplay, definitionId, extensionKey, previewInvokeMethod) => ({
|
|
244
|
+
export const uiHoverCardViewedEvent = (id, previewDisplay, definitionId, extensionKey, previewInvokeMethod) => ({
|
|
244
245
|
action: 'viewed',
|
|
245
246
|
actionSubject: 'hoverCard',
|
|
246
247
|
eventType: 'ui',
|
|
247
248
|
attributes: { ...context,
|
|
249
|
+
id,
|
|
248
250
|
definitionId: definitionId || '',
|
|
249
251
|
extensionKey: extensionKey || '',
|
|
250
252
|
previewDisplay,
|
|
251
253
|
previewInvokeMethod
|
|
252
254
|
}
|
|
253
255
|
});
|
|
254
|
-
export const uiHoverCardDismissedEvent = (previewDisplay, hoverTime, definitionId, extensionKey, previewInvokeMethod) => ({
|
|
256
|
+
export const uiHoverCardDismissedEvent = (id, previewDisplay, hoverTime, definitionId, extensionKey, previewInvokeMethod) => ({
|
|
255
257
|
action: 'dismissed',
|
|
256
258
|
actionSubject: 'hoverCard',
|
|
257
259
|
eventType: 'ui',
|
|
258
260
|
attributes: { ...context,
|
|
261
|
+
id,
|
|
259
262
|
definitionId: definitionId || '',
|
|
260
263
|
extensionKey: extensionKey || '',
|
|
261
264
|
hoverTime,
|
|
@@ -263,12 +266,13 @@ export const uiHoverCardDismissedEvent = (previewDisplay, hoverTime, definitionI
|
|
|
263
266
|
previewInvokeMethod
|
|
264
267
|
}
|
|
265
268
|
});
|
|
266
|
-
export const uiHoverCardOpenLinkClickedEvent = (previewDisplay, definitionId, extensionKey, previewInvokeMethod) => ({
|
|
269
|
+
export const uiHoverCardOpenLinkClickedEvent = (id, previewDisplay, definitionId, extensionKey, previewInvokeMethod) => ({
|
|
267
270
|
action: 'clicked',
|
|
268
271
|
actionSubject: 'button',
|
|
269
272
|
actionSubjectId: 'shortcutGoToLink',
|
|
270
273
|
eventType: 'ui',
|
|
271
274
|
attributes: { ...context,
|
|
275
|
+
id,
|
|
272
276
|
definitionId: definitionId || '',
|
|
273
277
|
extensionKey: extensionKey || '',
|
|
274
278
|
previewDisplay,
|
package/dist/es2019/version.json
CHANGED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
2
|
+
import { extractMetadata } from '../../../extractors/hover/extractMetadata';
|
|
3
|
+
import { getSimulatedMetadata, HOVER_CARD_ANALYTICS_DISPLAY } from '../utils';
|
|
4
|
+
import extractPreview from '../../../extractors/flexible/extract-preview';
|
|
5
|
+
import { ActionName, SmartLinkSize, SmartLinkTheme } from '../../../constants';
|
|
6
|
+
import FlexibleCard from '../../FlexibleCard';
|
|
7
|
+
import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from '../../FlexibleCard/components/blocks';
|
|
8
|
+
import { isSpecialEvent } from '../../../utils';
|
|
9
|
+
import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
|
|
10
|
+
import { getExtensionKey } from '../../../state/helpers';
|
|
11
|
+
const flexibleUiOptions = {
|
|
12
|
+
hideElevation: true,
|
|
13
|
+
size: SmartLinkSize.Large,
|
|
14
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
15
|
+
theme: SmartLinkTheme.Black
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const getOpenAction = (url, analytics) => ({
|
|
19
|
+
name: ActionName.CustomAction,
|
|
20
|
+
icon: /*#__PURE__*/React.createElement(ShortcutIcon, {
|
|
21
|
+
label: "open in new tab",
|
|
22
|
+
size: "medium"
|
|
23
|
+
}),
|
|
24
|
+
iconPosition: 'before',
|
|
25
|
+
onClick: () => {
|
|
26
|
+
window.open(url, '_blank');
|
|
27
|
+
analytics.ui.hoverCardOpenLinkClickedEvent('card');
|
|
28
|
+
},
|
|
29
|
+
testId: 'hover-card-open-button'
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const toFooterActions = cardActions => cardActions.map(action => ({
|
|
33
|
+
content: action.text,
|
|
34
|
+
name: ActionName.CustomAction,
|
|
35
|
+
onClick: () => action.invoke(),
|
|
36
|
+
testId: action.id
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
const HoverCardContent = ({
|
|
40
|
+
analytics,
|
|
41
|
+
cardActions = [],
|
|
42
|
+
cardState,
|
|
43
|
+
onResolve,
|
|
44
|
+
renderers,
|
|
45
|
+
url
|
|
46
|
+
}) => {
|
|
47
|
+
var _cardState$details;
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
// Since hover preview only render on resolved status,
|
|
51
|
+
// there is no need to check for statuses.
|
|
52
|
+
analytics.ui.renderSuccessEvent(HOVER_CARD_ANALYTICS_DISPLAY, cardState.status);
|
|
53
|
+
}, [analytics.ui, cardState.status]);
|
|
54
|
+
const extensionKey = useMemo(() => getExtensionKey(cardState.details), [cardState.details]);
|
|
55
|
+
const onClick = useCallback(event => {
|
|
56
|
+
const isModifierKeyPressed = isSpecialEvent(event);
|
|
57
|
+
analytics.ui.cardClickedEvent(undefined, HOVER_CARD_ANALYTICS_DISPLAY, cardState.status, undefined, undefined, isModifierKeyPressed);
|
|
58
|
+
}, [cardState.status, analytics.ui]);
|
|
59
|
+
const titleActions = useMemo(() => [getOpenAction(url, analytics)], [url, analytics]);
|
|
60
|
+
const footerActions = useMemo(() => toFooterActions(cardActions), [cardActions]); //TODO: EDM-3224 deleted simulated and use real JsonLd
|
|
61
|
+
|
|
62
|
+
const {
|
|
63
|
+
primary,
|
|
64
|
+
secondary
|
|
65
|
+
} = extractMetadata(getSimulatedMetadata(extensionKey));
|
|
66
|
+
const data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
67
|
+
const body = data && extractPreview(data) ? /*#__PURE__*/React.createElement(PreviewBlock, null) : /*#__PURE__*/React.createElement(SnippetBlock, null);
|
|
68
|
+
return /*#__PURE__*/React.createElement(FlexibleCard, {
|
|
69
|
+
cardState: cardState,
|
|
70
|
+
onClick: onClick,
|
|
71
|
+
onResolve: onResolve,
|
|
72
|
+
renderers: renderers,
|
|
73
|
+
ui: flexibleUiOptions,
|
|
74
|
+
url: url
|
|
75
|
+
}, /*#__PURE__*/React.createElement(TitleBlock, {
|
|
76
|
+
actions: titleActions
|
|
77
|
+
}), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
78
|
+
primary: primary,
|
|
79
|
+
secondary: secondary
|
|
80
|
+
}), body, /*#__PURE__*/React.createElement(FooterBlock, {
|
|
81
|
+
actions: footerActions
|
|
82
|
+
}));
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export default HoverCardContent;
|
|
@@ -2,22 +2,17 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { jsx } from '@emotion/core';
|
|
5
|
-
import React, { useCallback, useRef
|
|
6
|
-
import { TitleBlock, SnippetBlock, FooterBlock, MetadataBlock, PreviewBlock } from '../FlexibleCard/components/blocks';
|
|
7
|
-
import { Card } from '../Card';
|
|
5
|
+
import React, { useCallback, useRef } from 'react';
|
|
8
6
|
import Popup from '@atlaskit/popup';
|
|
9
|
-
import { SmartLinkSize, ActionName, SmartLinkTheme } from '../../constants';
|
|
10
7
|
import { useSmartLinkActions } from '../../state/hooks-external/useSmartLinkActions';
|
|
11
8
|
import { HoverCardContainer } from './styled';
|
|
12
|
-
import
|
|
13
|
-
import { withAnalyticsEvents, withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
9
|
+
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
14
10
|
import { fireSmartLinkEvent } from '../../utils/analytics';
|
|
15
11
|
import { useSmartCardState as useLinkState } from '../../state/store';
|
|
16
12
|
import { useSmartLinkAnalytics } from '../../state/analytics';
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import extractPreview from '../../extractors/flexible/extract-preview';
|
|
13
|
+
import { useSmartLinkRenderers } from '../../state/renderers';
|
|
14
|
+
import HoverCardContent from './components/hover-card-content';
|
|
15
|
+
import { HOVER_CARD_ANALYTICS_DISPLAY } from './utils';
|
|
21
16
|
export const HoverCardComponent = ({
|
|
22
17
|
children,
|
|
23
18
|
id,
|
|
@@ -32,10 +27,9 @@ export const HoverCardComponent = ({
|
|
|
32
27
|
const fadeOutTimeoutId = useRef();
|
|
33
28
|
const fadeInTimeoutId = useRef();
|
|
34
29
|
const cardOpenTime = useRef();
|
|
30
|
+
const renderers = useSmartLinkRenderers();
|
|
35
31
|
const linkState = useLinkState(url);
|
|
36
32
|
const analytics = useSmartLinkAnalytics(url, analyticsHandler, id);
|
|
37
|
-
const extensionKey = useMemo(() => getExtensionKey(linkState.details), [linkState]);
|
|
38
|
-
const definitionId = useMemo(() => getDefinitionId(linkState.details), [linkState]);
|
|
39
33
|
const initHideCard = useCallback(() => {
|
|
40
34
|
if (fadeInTimeoutId.current) {
|
|
41
35
|
clearTimeout(fadeInTimeoutId.current);
|
|
@@ -45,12 +39,12 @@ export const HoverCardComponent = ({
|
|
|
45
39
|
//Check its previously open to avoid firing events when moving between the child and hover card components
|
|
46
40
|
if (isOpen === true && cardOpenTime.current) {
|
|
47
41
|
const hoverTime = Date.now() - cardOpenTime.current;
|
|
48
|
-
analytics.ui.hoverCardDismissedEvent('card', hoverTime,
|
|
42
|
+
analytics.ui.hoverCardDismissedEvent('card', hoverTime, 'mouse_hover');
|
|
49
43
|
}
|
|
50
44
|
|
|
51
45
|
setIsOpen(false);
|
|
52
46
|
}, delay);
|
|
53
|
-
}, [delay, isOpen,
|
|
47
|
+
}, [delay, isOpen, analytics.ui]);
|
|
54
48
|
const initShowCard = useCallback(() => {
|
|
55
49
|
if (fadeOutTimeoutId.current) {
|
|
56
50
|
clearTimeout(fadeOutTimeoutId.current);
|
|
@@ -60,73 +54,17 @@ export const HoverCardComponent = ({
|
|
|
60
54
|
//Check if its previously closed to avoid firing events when moving between the child and hover card components
|
|
61
55
|
if (isOpen === false) {
|
|
62
56
|
cardOpenTime.current = Date.now();
|
|
63
|
-
analytics.ui.hoverCardViewedEvent('card',
|
|
57
|
+
analytics.ui.hoverCardViewedEvent('card', 'mouse_hover');
|
|
64
58
|
}
|
|
65
59
|
|
|
66
60
|
setIsOpen(true);
|
|
67
61
|
}, delay);
|
|
68
|
-
}, [delay, isOpen,
|
|
62
|
+
}, [delay, isOpen, analytics.ui]);
|
|
69
63
|
const linkActions = useSmartLinkActions({
|
|
70
64
|
url,
|
|
71
|
-
appearance:
|
|
65
|
+
appearance: HOVER_CARD_ANALYTICS_DISPLAY,
|
|
72
66
|
analyticsHandler
|
|
73
67
|
});
|
|
74
|
-
const smartlinkActions = useMemo(() => linkActions.map(action => ({
|
|
75
|
-
content: action.text,
|
|
76
|
-
name: ActionName.CustomAction,
|
|
77
|
-
onClick: () => action.invoke(),
|
|
78
|
-
testId: action.id
|
|
79
|
-
})), [linkActions]);
|
|
80
|
-
const openAction = useMemo(() => {
|
|
81
|
-
return {
|
|
82
|
-
name: ActionName.CustomAction,
|
|
83
|
-
icon: jsx(ShortcutIcon, {
|
|
84
|
-
label: "open in new tab",
|
|
85
|
-
size: "medium"
|
|
86
|
-
}),
|
|
87
|
-
iconPosition: 'before',
|
|
88
|
-
onClick: () => {
|
|
89
|
-
window.open(url, '_blank');
|
|
90
|
-
analytics.ui.hoverCardOpenLinkClickedEvent('card', definitionId, extensionKey);
|
|
91
|
-
},
|
|
92
|
-
testId: 'hover-card-open-button'
|
|
93
|
-
};
|
|
94
|
-
}, [url, definitionId, extensionKey, analytics]);
|
|
95
|
-
|
|
96
|
-
const CardComponent = ({
|
|
97
|
-
update
|
|
98
|
-
}) => {
|
|
99
|
-
var _linkState$details;
|
|
100
|
-
|
|
101
|
-
//TODO: EDM-3224 deleted simulated and use real JsonLd
|
|
102
|
-
const metadataElements = extractMetadata(getSimulatedMetadata(extensionKey));
|
|
103
|
-
const linkData = (_linkState$details = linkState.details) === null || _linkState$details === void 0 ? void 0 : _linkState$details.data;
|
|
104
|
-
const content = extractPreview(linkData) ? jsx(PreviewBlock, null) : jsx(SnippetBlock, null);
|
|
105
|
-
return jsx("div", {
|
|
106
|
-
onMouseEnter: initShowCard,
|
|
107
|
-
onMouseLeave: initHideCard,
|
|
108
|
-
css: HoverCardContainer
|
|
109
|
-
}, jsx(Card, {
|
|
110
|
-
id: id,
|
|
111
|
-
appearance: "block",
|
|
112
|
-
url: url,
|
|
113
|
-
ui: {
|
|
114
|
-
hideElevation: true,
|
|
115
|
-
size: SmartLinkSize.Large,
|
|
116
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
117
|
-
theme: SmartLinkTheme.Black
|
|
118
|
-
},
|
|
119
|
-
onResolve: update
|
|
120
|
-
}, jsx(TitleBlock, {
|
|
121
|
-
actions: [openAction]
|
|
122
|
-
}), jsx(MetadataBlock, {
|
|
123
|
-
primary: metadataElements.primary,
|
|
124
|
-
secondary: metadataElements.secondary
|
|
125
|
-
}), content, jsx(FooterBlock, {
|
|
126
|
-
actions: smartlinkActions
|
|
127
|
-
})));
|
|
128
|
-
};
|
|
129
|
-
|
|
130
68
|
const onClose = useCallback(() => setIsOpen(false), []);
|
|
131
69
|
return jsx(Popup, {
|
|
132
70
|
testId: "hover-card",
|
|
@@ -135,11 +73,18 @@ export const HoverCardComponent = ({
|
|
|
135
73
|
placement: "bottom-start",
|
|
136
74
|
content: ({
|
|
137
75
|
update
|
|
138
|
-
}) => {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
},
|
|
76
|
+
}) => jsx("div", {
|
|
77
|
+
onMouseEnter: initShowCard,
|
|
78
|
+
onMouseLeave: initHideCard,
|
|
79
|
+
css: HoverCardContainer
|
|
80
|
+
}, jsx(HoverCardContent, {
|
|
81
|
+
analytics: analytics,
|
|
82
|
+
cardActions: linkActions,
|
|
83
|
+
cardState: linkState,
|
|
84
|
+
onResolve: update,
|
|
85
|
+
renderers: renderers,
|
|
86
|
+
url: url
|
|
87
|
+
})),
|
|
143
88
|
trigger: triggerProps => jsx("span", _extends({}, triggerProps, {
|
|
144
89
|
onMouseEnter: initShowCard,
|
|
145
90
|
onMouseLeave: initHideCard
|
|
@@ -45,9 +45,10 @@ export var extractBlockActions = function extractBlockActions(props, jsonLd, opt
|
|
|
45
45
|
var handleInvoke = opts.handleInvoke,
|
|
46
46
|
handleAnalytics = opts.handleAnalytics,
|
|
47
47
|
extensionKey = opts.extensionKey,
|
|
48
|
+
source = opts.source,
|
|
48
49
|
testId = opts.testId;
|
|
49
50
|
var actions = extractActions(jsonLd, handleInvoke);
|
|
50
|
-
var previewAction = extractPreviewAction(extensionKey, props, jsonLd, handleInvoke, handleAnalytics, testId, platform); // The previewAction should always be the last action
|
|
51
|
+
var previewAction = extractPreviewAction(extensionKey, props, jsonLd, handleInvoke, handleAnalytics, testId, platform, source); // The previewAction should always be the last action
|
|
51
52
|
|
|
52
53
|
if (previewAction) {
|
|
53
54
|
actions.push(previewAction);
|
|
@@ -60,6 +60,7 @@ export var extractPreviewAction = function extractPreviewAction() {
|
|
|
60
60
|
var handleAnalytics = arguments.length > 4 ? arguments[4] : undefined;
|
|
61
61
|
var testId = arguments.length > 5 ? arguments[5] : undefined;
|
|
62
62
|
var platform = arguments.length > 6 ? arguments[6] : undefined;
|
|
63
|
+
var source = arguments.length > 7 ? arguments[7] : undefined;
|
|
63
64
|
// Extract metadata from view props & raw JSON-LD.
|
|
64
65
|
var metadataFromJsonLd = getMetadataFromJsonLd(jsonLd, platform);
|
|
65
66
|
var metadataFromViewProps = getMetadataFromResolvedProps(viewProps);
|
|
@@ -87,7 +88,7 @@ export var extractPreviewAction = function extractPreviewAction() {
|
|
|
87
88
|
})); // Setup props to go through proper Redux 'invocation' flow
|
|
88
89
|
// for analytics, further state management if required in future.
|
|
89
90
|
|
|
90
|
-
var previewActionProps = getInvokeOpts(key, 'PreviewAction', 'block'); // - Promise invoked by the action invocation handler; open preview.
|
|
91
|
+
var previewActionProps = getInvokeOpts(key, 'PreviewAction', source !== null && source !== void 0 ? source : 'block'); // - Promise invoked by the action invocation handler; open preview.
|
|
91
92
|
|
|
92
93
|
previewActionProps.action.promise = previewAction.promise; // - Promise invoked on click of `Preview` on block card; trigger above promise.
|
|
93
94
|
|