@atlaskit/editor-common 74.19.2 → 74.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/link/LinkPicker/EditorLinkPicker/index.js +86 -0
- package/dist/cjs/link/LinkPicker/EditorLinkPicker/useEscapeClickaway.js +32 -0
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +939 -0
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/index.js +79 -0
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/messages.js +40 -0
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/utils.js +84 -0
- package/dist/cjs/link/LinkSearch/LinkSearchList.js +83 -0
- package/dist/cjs/link/LinkSearch/LinkSearchListItem.js +146 -0
- package/dist/cjs/link/LinkSearch/ToolbarComponents.js +17 -0
- package/dist/cjs/link/LinkSearch/index.js +328 -0
- package/dist/cjs/link/LinkSearch/listItemAlts.js +70 -0
- package/dist/cjs/link/LinkSearch/transformTimeStamp.js +42 -0
- package/dist/cjs/link/LinkSearch/types.js +5 -0
- package/dist/cjs/link/LinkSearch/withActivityProvider.js +59 -0
- package/dist/cjs/link/index.js +122 -0
- package/dist/cjs/link/types.js +22 -0
- package/dist/cjs/link/utils.js +19 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/assets/action.js +43 -0
- package/dist/cjs/quick-insert/assets/code.js +115 -0
- package/dist/cjs/quick-insert/assets/custom-panel.js +55 -0
- package/dist/cjs/quick-insert/assets/datasource-jira-issue.js +108 -0
- package/dist/cjs/quick-insert/assets/date.js +93 -0
- package/dist/cjs/quick-insert/assets/decision.js +34 -0
- package/dist/cjs/quick-insert/assets/divider.js +74 -0
- package/dist/cjs/quick-insert/assets/emoji.js +37 -0
- package/dist/cjs/quick-insert/assets/expand.js +47 -0
- package/dist/cjs/quick-insert/assets/fallback.js +55 -0
- package/dist/cjs/quick-insert/assets/feedback.js +70 -0
- package/dist/cjs/quick-insert/assets/heading1.js +50 -0
- package/dist/cjs/quick-insert/assets/heading2.js +50 -0
- package/dist/cjs/quick-insert/assets/heading3.js +50 -0
- package/dist/cjs/quick-insert/assets/heading4.js +50 -0
- package/dist/cjs/quick-insert/assets/heading5.js +50 -0
- package/dist/cjs/quick-insert/assets/heading6.js +50 -0
- package/dist/cjs/quick-insert/assets/images.js +92 -0
- package/dist/cjs/quick-insert/assets/index.js +385 -0
- package/dist/cjs/quick-insert/assets/layout.js +71 -0
- package/dist/cjs/quick-insert/assets/link.js +35 -0
- package/dist/cjs/quick-insert/assets/list-number.js +51 -0
- package/dist/cjs/quick-insert/assets/list.js +65 -0
- package/dist/cjs/quick-insert/assets/mention.js +56 -0
- package/dist/cjs/quick-insert/assets/panel-error.js +35 -0
- package/dist/cjs/quick-insert/assets/panel-note.js +35 -0
- package/dist/cjs/quick-insert/assets/panel-success.js +35 -0
- package/dist/cjs/quick-insert/assets/panel-warning.js +35 -0
- package/dist/cjs/quick-insert/assets/panel.js +50 -0
- package/dist/cjs/quick-insert/assets/quote.js +35 -0
- package/dist/cjs/quick-insert/assets/status.js +109 -0
- package/dist/cjs/quick-insert/index.js +156 -0
- package/dist/cjs/types/block-type.js +5 -0
- package/dist/cjs/types/datasource.js +5 -0
- package/dist/cjs/ui/Announcer/announcer.js +62 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/PanelTextInput/index.js +174 -0
- package/dist/cjs/ui/PanelTextInput/styles.js +19 -0
- package/dist/cjs/ui/index.js +21 -0
- package/dist/cjs/utils/commands.js +20 -0
- package/dist/cjs/utils/datasource.js +4 -4
- package/dist/cjs/utils/hyperlink.js +25 -2
- package/dist/cjs/utils/index.js +24 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/link/LinkPicker/EditorLinkPicker/index.js +74 -0
- package/dist/es2019/link/LinkPicker/EditorLinkPicker/useEscapeClickaway.js +25 -0
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +789 -0
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/index.js +74 -0
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/messages.js +33 -0
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/utils.js +83 -0
- package/dist/es2019/link/LinkSearch/LinkSearchList.js +63 -0
- package/dist/es2019/link/LinkSearch/LinkSearchListItem.js +141 -0
- package/dist/es2019/link/LinkSearch/ToolbarComponents.js +20 -0
- package/dist/es2019/link/LinkSearch/index.js +213 -0
- package/dist/es2019/link/LinkSearch/listItemAlts.js +63 -0
- package/dist/es2019/link/LinkSearch/transformTimeStamp.js +34 -0
- package/dist/es2019/link/LinkSearch/types.js +1 -0
- package/dist/es2019/link/LinkSearch/withActivityProvider.js +35 -0
- package/dist/es2019/link/index.js +11 -0
- package/dist/es2019/link/types.js +14 -0
- package/dist/es2019/link/utils.js +12 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/assets/action.js +35 -0
- package/dist/es2019/quick-insert/assets/code.js +107 -0
- package/dist/es2019/quick-insert/assets/custom-panel.js +47 -0
- package/dist/es2019/quick-insert/assets/datasource-jira-issue.js +100 -0
- package/dist/es2019/quick-insert/assets/date.js +85 -0
- package/dist/es2019/quick-insert/assets/decision.js +26 -0
- package/dist/es2019/quick-insert/assets/divider.js +66 -0
- package/dist/es2019/quick-insert/assets/emoji.js +29 -0
- package/dist/es2019/quick-insert/assets/expand.js +39 -0
- package/dist/es2019/quick-insert/assets/fallback.js +47 -0
- package/dist/es2019/quick-insert/assets/feedback.js +62 -0
- package/dist/es2019/quick-insert/assets/heading1.js +42 -0
- package/dist/es2019/quick-insert/assets/heading2.js +42 -0
- package/dist/es2019/quick-insert/assets/heading3.js +42 -0
- package/dist/es2019/quick-insert/assets/heading4.js +42 -0
- package/dist/es2019/quick-insert/assets/heading5.js +42 -0
- package/dist/es2019/quick-insert/assets/heading6.js +42 -0
- package/dist/es2019/quick-insert/assets/images.js +84 -0
- package/dist/es2019/quick-insert/assets/index.js +119 -0
- package/dist/es2019/quick-insert/assets/layout.js +63 -0
- package/dist/es2019/quick-insert/assets/link.js +27 -0
- package/dist/es2019/quick-insert/assets/list-number.js +43 -0
- package/dist/es2019/quick-insert/assets/list.js +57 -0
- package/dist/es2019/quick-insert/assets/mention.js +48 -0
- package/dist/es2019/quick-insert/assets/panel-error.js +27 -0
- package/dist/es2019/quick-insert/assets/panel-note.js +27 -0
- package/dist/es2019/quick-insert/assets/panel-success.js +27 -0
- package/dist/es2019/quick-insert/assets/panel-warning.js +27 -0
- package/dist/es2019/quick-insert/assets/panel.js +42 -0
- package/dist/es2019/quick-insert/assets/quote.js +27 -0
- package/dist/es2019/quick-insert/assets/status.js +101 -0
- package/dist/es2019/quick-insert/index.js +1 -0
- package/dist/es2019/types/block-type.js +1 -0
- package/dist/es2019/types/datasource.js +1 -0
- package/dist/es2019/ui/Announcer/announcer.js +41 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/PanelTextInput/index.js +149 -0
- package/dist/es2019/ui/PanelTextInput/styles.js +36 -0
- package/dist/es2019/ui/index.js +4 -1
- package/dist/es2019/utils/commands.js +11 -0
- package/dist/es2019/utils/datasource.js +4 -4
- package/dist/es2019/utils/hyperlink.js +19 -1
- package/dist/es2019/utils/index.js +8 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/link/LinkPicker/EditorLinkPicker/index.js +76 -0
- package/dist/esm/link/LinkPicker/EditorLinkPicker/useEscapeClickaway.js +25 -0
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +924 -0
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/index.js +72 -0
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/messages.js +33 -0
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/utils.js +73 -0
- package/dist/esm/link/LinkSearch/LinkSearchList.js +75 -0
- package/dist/esm/link/LinkSearch/LinkSearchListItem.js +131 -0
- package/dist/esm/link/LinkSearch/ToolbarComponents.js +7 -0
- package/dist/esm/link/LinkSearch/index.js +320 -0
- package/dist/esm/link/LinkSearch/listItemAlts.js +63 -0
- package/dist/esm/link/LinkSearch/transformTimeStamp.js +34 -0
- package/dist/esm/link/LinkSearch/types.js +1 -0
- package/dist/esm/link/LinkSearch/withActivityProvider.js +52 -0
- package/dist/esm/link/index.js +11 -0
- package/dist/esm/link/types.js +14 -0
- package/dist/esm/link/utils.js +12 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/assets/action.js +35 -0
- package/dist/esm/quick-insert/assets/code.js +107 -0
- package/dist/esm/quick-insert/assets/custom-panel.js +47 -0
- package/dist/esm/quick-insert/assets/datasource-jira-issue.js +100 -0
- package/dist/esm/quick-insert/assets/date.js +85 -0
- package/dist/esm/quick-insert/assets/decision.js +26 -0
- package/dist/esm/quick-insert/assets/divider.js +66 -0
- package/dist/esm/quick-insert/assets/emoji.js +29 -0
- package/dist/esm/quick-insert/assets/expand.js +39 -0
- package/dist/esm/quick-insert/assets/fallback.js +47 -0
- package/dist/esm/quick-insert/assets/feedback.js +62 -0
- package/dist/esm/quick-insert/assets/heading1.js +42 -0
- package/dist/esm/quick-insert/assets/heading2.js +42 -0
- package/dist/esm/quick-insert/assets/heading3.js +42 -0
- package/dist/esm/quick-insert/assets/heading4.js +42 -0
- package/dist/esm/quick-insert/assets/heading5.js +42 -0
- package/dist/esm/quick-insert/assets/heading6.js +42 -0
- package/dist/esm/quick-insert/assets/images.js +84 -0
- package/dist/esm/quick-insert/assets/index.js +258 -0
- package/dist/esm/quick-insert/assets/layout.js +63 -0
- package/dist/esm/quick-insert/assets/link.js +27 -0
- package/dist/esm/quick-insert/assets/list-number.js +43 -0
- package/dist/esm/quick-insert/assets/list.js +57 -0
- package/dist/esm/quick-insert/assets/mention.js +48 -0
- package/dist/esm/quick-insert/assets/panel-error.js +27 -0
- package/dist/esm/quick-insert/assets/panel-note.js +27 -0
- package/dist/esm/quick-insert/assets/panel-success.js +27 -0
- package/dist/esm/quick-insert/assets/panel-warning.js +27 -0
- package/dist/esm/quick-insert/assets/panel.js +42 -0
- package/dist/esm/quick-insert/assets/quote.js +27 -0
- package/dist/esm/quick-insert/assets/status.js +101 -0
- package/dist/esm/quick-insert/index.js +1 -0
- package/dist/esm/types/block-type.js +1 -0
- package/dist/esm/types/datasource.js +1 -0
- package/dist/esm/ui/Announcer/announcer.js +52 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/PanelTextInput/index.js +168 -0
- package/dist/esm/ui/PanelTextInput/styles.js +10 -0
- package/dist/esm/ui/index.js +4 -1
- package/dist/esm/utils/commands.js +13 -0
- package/dist/esm/utils/datasource.js +4 -4
- package/dist/esm/utils/hyperlink.js +23 -1
- package/dist/esm/utils/index.js +12 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/link/LinkPicker/EditorLinkPicker/index.d.ts +23 -0
- package/dist/types/link/LinkPicker/EditorLinkPicker/useEscapeClickaway.d.ts +2 -0
- package/dist/types/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +115 -0
- package/dist/types/link/LinkPicker/HyperlinkAddToolbar/index.d.ts +21 -0
- package/dist/types/link/LinkPicker/HyperlinkAddToolbar/messages.d.ts +32 -0
- package/dist/types/link/LinkPicker/HyperlinkAddToolbar/utils.d.ts +8 -0
- package/dist/types/link/LinkSearch/LinkSearchList.d.ts +20 -0
- package/dist/types/link/LinkSearch/LinkSearchListItem.d.ts +22 -0
- package/dist/types/link/LinkSearch/ToolbarComponents.d.ts +3 -0
- package/dist/types/link/LinkSearch/index.d.ts +59 -0
- package/dist/types/link/LinkSearch/listItemAlts.d.ts +2 -0
- package/dist/types/link/LinkSearch/transformTimeStamp.d.ts +10 -0
- package/dist/types/link/LinkSearch/types.d.ts +49 -0
- package/dist/types/link/LinkSearch/withActivityProvider.d.ts +66 -0
- package/dist/types/link/index.d.ts +16 -0
- package/dist/types/link/types.d.ts +40 -0
- package/dist/types/link/utils.d.ts +3 -0
- package/dist/types/provider-factory/quick-insert-provider.d.ts +1 -1
- package/dist/types/quick-insert/assets/action.d.ts +2 -0
- package/dist/types/quick-insert/assets/code.d.ts +2 -0
- package/dist/types/quick-insert/assets/custom-panel.d.ts +2 -0
- package/dist/types/quick-insert/assets/datasource-jira-issue.d.ts +2 -0
- package/dist/types/quick-insert/assets/date.d.ts +2 -0
- package/dist/types/quick-insert/assets/decision.d.ts +2 -0
- package/dist/types/quick-insert/assets/divider.d.ts +2 -0
- package/dist/types/quick-insert/assets/emoji.d.ts +2 -0
- package/dist/types/quick-insert/assets/expand.d.ts +2 -0
- package/dist/types/quick-insert/assets/fallback.d.ts +2 -0
- package/dist/types/quick-insert/assets/feedback.d.ts +2 -0
- package/dist/types/quick-insert/assets/heading1.d.ts +2 -0
- package/dist/types/quick-insert/assets/heading2.d.ts +2 -0
- package/dist/types/quick-insert/assets/heading3.d.ts +2 -0
- package/dist/types/quick-insert/assets/heading4.d.ts +2 -0
- package/dist/types/quick-insert/assets/heading5.d.ts +2 -0
- package/dist/types/quick-insert/assets/heading6.d.ts +2 -0
- package/dist/types/quick-insert/assets/images.d.ts +2 -0
- package/dist/types/quick-insert/assets/index.d.ts +31 -0
- package/dist/types/quick-insert/assets/layout.d.ts +2 -0
- package/dist/types/quick-insert/assets/link.d.ts +2 -0
- package/dist/types/quick-insert/assets/list-number.d.ts +2 -0
- package/dist/types/quick-insert/assets/list.d.ts +2 -0
- package/dist/types/quick-insert/assets/mention.d.ts +2 -0
- package/dist/types/quick-insert/assets/panel-error.d.ts +2 -0
- package/dist/types/quick-insert/assets/panel-note.d.ts +2 -0
- package/dist/types/quick-insert/assets/panel-success.d.ts +2 -0
- package/dist/types/quick-insert/assets/panel-warning.d.ts +2 -0
- package/dist/types/quick-insert/assets/panel.d.ts +2 -0
- package/dist/types/quick-insert/assets/quote.d.ts +2 -0
- package/dist/types/quick-insert/assets/status.d.ts +2 -0
- package/dist/types/quick-insert/index.d.ts +1 -0
- package/dist/types/types/block-type.d.ts +3 -0
- package/dist/types/types/command.d.ts +1 -0
- package/dist/types/types/datasource.d.ts +1 -0
- package/dist/types/types/index.d.ts +3 -1
- package/dist/types/ui/Announcer/announcer.d.ts +22 -0
- package/dist/types/ui/PanelTextInput/index.d.ts +45 -0
- package/dist/types/ui/PanelTextInput/styles.d.ts +2 -0
- package/dist/types/ui/index.d.ts +3 -0
- package/dist/types/utils/commands.d.ts +2 -0
- package/dist/types/utils/datasource.d.ts +1 -2
- package/dist/types/utils/hyperlink.d.ts +2 -0
- package/dist/types/utils/index.d.ts +3 -1
- package/dist/types-ts4.5/link/LinkPicker/EditorLinkPicker/index.d.ts +23 -0
- package/dist/types-ts4.5/link/LinkPicker/EditorLinkPicker/useEscapeClickaway.d.ts +2 -0
- package/dist/types-ts4.5/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +115 -0
- package/dist/types-ts4.5/link/LinkPicker/HyperlinkAddToolbar/index.d.ts +21 -0
- package/dist/types-ts4.5/link/LinkPicker/HyperlinkAddToolbar/messages.d.ts +32 -0
- package/dist/types-ts4.5/link/LinkPicker/HyperlinkAddToolbar/utils.d.ts +8 -0
- package/dist/types-ts4.5/link/LinkSearch/LinkSearchList.d.ts +20 -0
- package/dist/types-ts4.5/link/LinkSearch/LinkSearchListItem.d.ts +22 -0
- package/dist/types-ts4.5/link/LinkSearch/ToolbarComponents.d.ts +3 -0
- package/dist/types-ts4.5/link/LinkSearch/index.d.ts +59 -0
- package/dist/types-ts4.5/link/LinkSearch/listItemAlts.d.ts +2 -0
- package/dist/types-ts4.5/link/LinkSearch/transformTimeStamp.d.ts +10 -0
- package/dist/types-ts4.5/link/LinkSearch/types.d.ts +49 -0
- package/dist/types-ts4.5/link/LinkSearch/withActivityProvider.d.ts +66 -0
- package/dist/types-ts4.5/link/index.d.ts +16 -0
- package/dist/types-ts4.5/link/types.d.ts +40 -0
- package/dist/types-ts4.5/link/utils.d.ts +3 -0
- package/dist/types-ts4.5/provider-factory/quick-insert-provider.d.ts +1 -1
- package/dist/types-ts4.5/quick-insert/assets/action.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/code.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/custom-panel.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/datasource-jira-issue.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/date.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/decision.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/divider.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/emoji.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/expand.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/fallback.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/feedback.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/heading1.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/heading2.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/heading3.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/heading4.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/heading5.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/heading6.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/images.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/index.d.ts +31 -0
- package/dist/types-ts4.5/quick-insert/assets/layout.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/link.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/list-number.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/list.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/mention.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/panel-error.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/panel-note.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/panel-success.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/panel-warning.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/panel.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/quote.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/assets/status.d.ts +2 -0
- package/dist/types-ts4.5/quick-insert/index.d.ts +1 -0
- package/dist/types-ts4.5/types/block-type.d.ts +3 -0
- package/dist/types-ts4.5/types/command.d.ts +1 -0
- package/dist/types-ts4.5/types/datasource.d.ts +1 -0
- package/dist/types-ts4.5/types/index.d.ts +3 -1
- package/dist/types-ts4.5/ui/Announcer/announcer.d.ts +22 -0
- package/dist/types-ts4.5/ui/PanelTextInput/index.d.ts +45 -0
- package/dist/types-ts4.5/ui/PanelTextInput/styles.d.ts +2 -0
- package/dist/types-ts4.5/ui/index.d.ts +3 -0
- package/dist/types-ts4.5/utils/commands.d.ts +2 -0
- package/dist/types-ts4.5/utils/datasource.d.ts +1 -2
- package/dist/types-ts4.5/utils/hyperlink.d.ts +2 -0
- package/dist/types-ts4.5/utils/index.d.ts +3 -1
- package/link/package.json +15 -0
- package/package.json +12 -4
- package/quick-insert/package.json +15 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
var _react = require("react");
|
|
17
|
+
var _react2 = require("@emotion/react");
|
|
18
|
+
var _utils = require("../../utils");
|
|
19
|
+
var _styles = require("./styles");
|
|
20
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
21
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
22
|
+
var KeyZCode = 90;
|
|
23
|
+
var KeyYCode = 89;
|
|
24
|
+
var PanelTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
25
|
+
(0, _inherits2.default)(PanelTextInput, _PureComponent);
|
|
26
|
+
var _super = _createSuper(PanelTextInput);
|
|
27
|
+
function PanelTextInput(props) {
|
|
28
|
+
var _this;
|
|
29
|
+
(0, _classCallCheck2.default)(this, PanelTextInput);
|
|
30
|
+
_this = _super.call(this, props);
|
|
31
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onMouseDown", function () {
|
|
32
|
+
var onMouseDown = _this.props.onMouseDown;
|
|
33
|
+
if (onMouseDown) {
|
|
34
|
+
onMouseDown();
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onBlur", function (e) {
|
|
38
|
+
var onBlur = _this.props.onBlur;
|
|
39
|
+
if (onBlur) {
|
|
40
|
+
onBlur(e);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleChange", function () {
|
|
44
|
+
var onChange = _this.props.onChange;
|
|
45
|
+
if (_this.input) {
|
|
46
|
+
_this.setState({
|
|
47
|
+
value: _this.input.value
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (onChange && _this.input) {
|
|
51
|
+
onChange(_this.input.value);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleKeydown", function (e) {
|
|
55
|
+
var _this$props = _this.props,
|
|
56
|
+
onUndo = _this$props.onUndo,
|
|
57
|
+
onRedo = _this$props.onRedo,
|
|
58
|
+
onSubmit = _this$props.onSubmit,
|
|
59
|
+
onCancel = _this$props.onCancel;
|
|
60
|
+
if (e.keyCode === 13 && onSubmit) {
|
|
61
|
+
e.preventDefault(); // Prevent from submitting if an editor is inside a form.
|
|
62
|
+
onSubmit(_this.input.value);
|
|
63
|
+
} else if (e.keyCode === 27 && onCancel) {
|
|
64
|
+
onCancel(e);
|
|
65
|
+
} else if (typeof onUndo === 'function' && _this.isUndoEvent(e)) {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
onUndo();
|
|
68
|
+
} else if (typeof onRedo === 'function' && _this.isRedoEvent(e)) {
|
|
69
|
+
e.preventDefault();
|
|
70
|
+
onRedo();
|
|
71
|
+
}
|
|
72
|
+
if (_this.props.onKeyDown) {
|
|
73
|
+
_this.props.onKeyDown(e);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleRef", function (input) {
|
|
77
|
+
if (input instanceof HTMLInputElement) {
|
|
78
|
+
_this.input = input;
|
|
79
|
+
if (_this.props.autoFocus) {
|
|
80
|
+
// Need this to prevent jumping when we render TextInput inside Portal @see ED-2992
|
|
81
|
+
_this.focusTimeoutId = window.setTimeout(function () {
|
|
82
|
+
return _this.focus();
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
_this.input = undefined;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
_this.state = {
|
|
90
|
+
value: props.defaultValue || ''
|
|
91
|
+
};
|
|
92
|
+
return _this;
|
|
93
|
+
}
|
|
94
|
+
(0, _createClass2.default)(PanelTextInput, [{
|
|
95
|
+
key: "componentDidUpdate",
|
|
96
|
+
value: function componentDidUpdate(prevProps) {
|
|
97
|
+
if (prevProps.defaultValue !== this.props.defaultValue) {
|
|
98
|
+
this.setState({
|
|
99
|
+
value: this.props.defaultValue
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
key: "componentWillUnmount",
|
|
105
|
+
value: function componentWillUnmount() {
|
|
106
|
+
window.clearTimeout(this.focusTimeoutId);
|
|
107
|
+
}
|
|
108
|
+
}, {
|
|
109
|
+
key: "render",
|
|
110
|
+
value: function render() {
|
|
111
|
+
var _this$props2 = this.props,
|
|
112
|
+
placeholder = _this$props2.placeholder,
|
|
113
|
+
width = _this$props2.width,
|
|
114
|
+
maxLength = _this$props2.maxLength,
|
|
115
|
+
testId = _this$props2.testId,
|
|
116
|
+
ariaLabel = _this$props2.ariaLabel,
|
|
117
|
+
describedById = _this$props2.describedById,
|
|
118
|
+
ariaActiveDescendant = _this$props2.ariaActiveDescendant,
|
|
119
|
+
ariaControls = _this$props2.ariaControls,
|
|
120
|
+
ariaExpanded = _this$props2.ariaExpanded,
|
|
121
|
+
ariaAutoComplete = _this$props2.ariaAutoComplete,
|
|
122
|
+
role = _this$props2.role;
|
|
123
|
+
var value = this.state.value;
|
|
124
|
+
return (0, _react2.jsx)("input", {
|
|
125
|
+
css: [_styles.panelTextInput, width !== undefined && (0, _styles.panelTextInputWithCustomWidth)(width)],
|
|
126
|
+
role: role,
|
|
127
|
+
"aria-autocomplete": ariaAutoComplete ? 'list' : undefined,
|
|
128
|
+
"aria-expanded": ariaExpanded,
|
|
129
|
+
"aria-controls": ariaControls,
|
|
130
|
+
"aria-activedescendant": ariaActiveDescendant,
|
|
131
|
+
"aria-describedby": describedById,
|
|
132
|
+
"data-testid": testId || '',
|
|
133
|
+
type: "text",
|
|
134
|
+
placeholder: placeholder,
|
|
135
|
+
value: value,
|
|
136
|
+
onChange: this.handleChange,
|
|
137
|
+
onKeyDown: this.handleKeydown,
|
|
138
|
+
onMouseDown: this.onMouseDown,
|
|
139
|
+
onBlur: this.onBlur,
|
|
140
|
+
ref: this.handleRef,
|
|
141
|
+
maxLength: maxLength,
|
|
142
|
+
"aria-label": ariaLabel
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
key: "focus",
|
|
147
|
+
value: function focus() {
|
|
148
|
+
var input = this.input;
|
|
149
|
+
if (input) {
|
|
150
|
+
var focusOpts = (0, _typeof2.default)(this.props.autoFocus) === 'object' ? this.props.autoFocus : {};
|
|
151
|
+
input.focus(focusOpts);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
key: "isUndoEvent",
|
|
156
|
+
value: function isUndoEvent(event) {
|
|
157
|
+
return event.keyCode === KeyZCode && (
|
|
158
|
+
// cmd + z for mac
|
|
159
|
+
_utils.browser.mac && event.metaKey && !event.shiftKey ||
|
|
160
|
+
// ctrl + z for non-mac
|
|
161
|
+
!_utils.browser.mac && event.ctrlKey);
|
|
162
|
+
}
|
|
163
|
+
}, {
|
|
164
|
+
key: "isRedoEvent",
|
|
165
|
+
value: function isRedoEvent(event) {
|
|
166
|
+
return (
|
|
167
|
+
// ctrl + y for non-mac
|
|
168
|
+
!_utils.browser.mac && event.ctrlKey && event.keyCode === KeyYCode || _utils.browser.mac && event.metaKey && event.shiftKey && event.keyCode === KeyZCode || event.ctrlKey && event.shiftKey && event.keyCode === KeyZCode
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
}]);
|
|
172
|
+
return PanelTextInput;
|
|
173
|
+
}(_react.PureComponent);
|
|
174
|
+
exports.default = PanelTextInput;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.panelTextInputWithCustomWidth = exports.panelTextInput = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
12
|
+
var _templateObject, _templateObject2;
|
|
13
|
+
// Normal .className gets overridden by input[type=text] hence this hack to produce input.className
|
|
14
|
+
var panelTextInput = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n input& {\n background: transparent;\n border: 0;\n border-radius: 0;\n box-sizing: content-box;\n color: ", ";\n flex-grow: 1;\n font-size: ", ";\n line-height: 20px;\n padding: 0;\n min-width: 145px;\n\n /* Hides IE10+ built-in [x] clear input button */\n &::-ms-clear {\n display: none;\n }\n\n &:focus {\n outline: none;\n }\n\n &::placeholder {\n color: ", ";\n }\n }\n"])), "var(--ds-text-subtle, ".concat(_colors.N400, ")"), (0, _editorSharedStyles.relativeFontSizeToBase16)(13), "var(--ds-text-subtlest, ".concat(_colors.N100, ")"));
|
|
15
|
+
exports.panelTextInput = panelTextInput;
|
|
16
|
+
var panelTextInputWithCustomWidth = function panelTextInputWithCustomWidth(width) {
|
|
17
|
+
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n input& {\n width: ", "px;\n }\n"])), width);
|
|
18
|
+
};
|
|
19
|
+
exports.panelTextInputWithCustomWidth = panelTextInputWithCustomWidth;
|
package/dist/cjs/ui/index.js
CHANGED
|
@@ -5,6 +5,12 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
Object.defineProperty(exports, "Announcer", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _announcer.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
8
14
|
Object.defineProperty(exports, "BaseTheme", {
|
|
9
15
|
enumerable: true,
|
|
10
16
|
get: function get() {
|
|
@@ -119,6 +125,12 @@ Object.defineProperty(exports, "MediaSingleDimensionHelper", {
|
|
|
119
125
|
return _styled.MediaSingleDimensionHelper;
|
|
120
126
|
}
|
|
121
127
|
});
|
|
128
|
+
Object.defineProperty(exports, "PanelTextInput", {
|
|
129
|
+
enumerable: true,
|
|
130
|
+
get: function get() {
|
|
131
|
+
return _PanelTextInput.default;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
122
134
|
Object.defineProperty(exports, "Popup", {
|
|
123
135
|
enumerable: true,
|
|
124
136
|
get: function get() {
|
|
@@ -305,6 +317,12 @@ Object.defineProperty(exports, "overflowShadow", {
|
|
|
305
317
|
return _OverflowShadow.default;
|
|
306
318
|
}
|
|
307
319
|
});
|
|
320
|
+
Object.defineProperty(exports, "panelTextInput", {
|
|
321
|
+
enumerable: true,
|
|
322
|
+
get: function get() {
|
|
323
|
+
return _styles.panelTextInput;
|
|
324
|
+
}
|
|
325
|
+
});
|
|
308
326
|
Object.defineProperty(exports, "shadowClassNames", {
|
|
309
327
|
enumerable: true,
|
|
310
328
|
get: function get() {
|
|
@@ -384,5 +402,8 @@ var _context = require("./ContextPanel/context");
|
|
|
384
402
|
var _ResizerLegacy = _interopRequireDefault(require("./ResizerLegacy"));
|
|
385
403
|
var _utils = require("./ResizerLegacy/utils");
|
|
386
404
|
var _styled2 = require("./ResizerLegacy/styled");
|
|
405
|
+
var _styles = require("./PanelTextInput/styles");
|
|
406
|
+
var _PanelTextInput = _interopRequireDefault(require("./PanelTextInput"));
|
|
407
|
+
var _announcer = _interopRequireDefault(require("./Announcer/announcer"));
|
|
387
408
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
388
409
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.filter = void 0;
|
|
7
|
+
var filter = function filter(predicates, cmd) {
|
|
8
|
+
return function (state, dispatch, view) {
|
|
9
|
+
if (!Array.isArray(predicates)) {
|
|
10
|
+
predicates = [predicates];
|
|
11
|
+
}
|
|
12
|
+
if (predicates.some(function (pred) {
|
|
13
|
+
return !pred(state, view);
|
|
14
|
+
})) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return cmd(state, dispatch, view) || false;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
exports.filter = filter;
|
|
@@ -6,17 +6,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.canRenderDatasource = void 0;
|
|
7
7
|
var _linkDatasource = require("@atlaskit/link-datasource");
|
|
8
8
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
|
-
var getDatasourceType = function getDatasourceType(
|
|
10
|
-
switch (
|
|
9
|
+
var getDatasourceType = function getDatasourceType(datasourceId) {
|
|
10
|
+
switch (datasourceId) {
|
|
11
11
|
case _linkDatasource.JIRA_LIST_OF_LINKS_DATASOURCE_ID:
|
|
12
12
|
return 'jira';
|
|
13
13
|
default:
|
|
14
14
|
return undefined;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
var canRenderDatasource = function canRenderDatasource(
|
|
17
|
+
var canRenderDatasource = function canRenderDatasource(datasourceId) {
|
|
18
18
|
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
19
|
-
var datasourceType = getDatasourceType(
|
|
19
|
+
var datasourceType = getDatasourceType(datasourceId);
|
|
20
20
|
switch (datasourceType) {
|
|
21
21
|
case 'jira':
|
|
22
22
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.datasource-jira_issues')) {
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.findFilepaths = exports.LinkMatcher = exports.FILEPATH_REGEXP = exports.DONTLINKIFY_REGEXP = void 0;
|
|
7
|
+
exports.findFilepaths = exports.canLinkBeCreatedInRange = exports.LinkMatcher = exports.FILEPATH_REGEXP = exports.DONTLINKIFY_REGEXP = void 0;
|
|
8
8
|
exports.getLinkCreationAnalyticsEvent = getLinkCreationAnalyticsEvent;
|
|
9
9
|
exports.getLinkDomain = getLinkDomain;
|
|
10
10
|
exports.isFromCurrentDomain = isFromCurrentDomain;
|
|
@@ -197,4 +197,27 @@ function getLinkCreationAnalyticsEvent(inputMethod, url) {
|
|
|
197
197
|
linkDomain: getLinkDomain(url)
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
|
-
}
|
|
200
|
+
}
|
|
201
|
+
var canLinkBeCreatedInRange = function canLinkBeCreatedInRange(from, to) {
|
|
202
|
+
return function (state) {
|
|
203
|
+
if (!state.doc.rangeHasMark(from, to, state.schema.marks.link)) {
|
|
204
|
+
var $from = state.doc.resolve(from);
|
|
205
|
+
var $to = state.doc.resolve(to);
|
|
206
|
+
var link = state.schema.marks.link;
|
|
207
|
+
if ($from.parent === $to.parent && $from.parent.isTextblock) {
|
|
208
|
+
if ($from.parent.type.allowsMarkType(link)) {
|
|
209
|
+
var allowed = true;
|
|
210
|
+
state.doc.nodesBetween(from, to, function (node) {
|
|
211
|
+
allowed = allowed && !node.marks.some(function (m) {
|
|
212
|
+
return m.type.excludes(link);
|
|
213
|
+
});
|
|
214
|
+
return allowed;
|
|
215
|
+
});
|
|
216
|
+
return allowed;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return false;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
exports.canLinkBeCreatedInRange = canLinkBeCreatedInRange;
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -166,6 +166,12 @@ Object.defineProperty(exports, "canApplyAnnotationOnRange", {
|
|
|
166
166
|
return _annotation.canApplyAnnotationOnRange;
|
|
167
167
|
}
|
|
168
168
|
});
|
|
169
|
+
Object.defineProperty(exports, "canLinkBeCreatedInRange", {
|
|
170
|
+
enumerable: true,
|
|
171
|
+
get: function get() {
|
|
172
|
+
return _hyperlink.canLinkBeCreatedInRange;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
169
175
|
Object.defineProperty(exports, "canRenderDatasource", {
|
|
170
176
|
enumerable: true,
|
|
171
177
|
get: function get() {
|
|
@@ -220,6 +226,12 @@ Object.defineProperty(exports, "extractSliceFromStep", {
|
|
|
220
226
|
return _editorCoreUtils.extractSliceFromStep;
|
|
221
227
|
}
|
|
222
228
|
});
|
|
229
|
+
Object.defineProperty(exports, "filterCommands", {
|
|
230
|
+
enumerable: true,
|
|
231
|
+
get: function get() {
|
|
232
|
+
return _commands.filter;
|
|
233
|
+
}
|
|
234
|
+
});
|
|
223
235
|
Object.defineProperty(exports, "findAndTrackUnsupportedContentNodes", {
|
|
224
236
|
enumerable: true,
|
|
225
237
|
get: function get() {
|
|
@@ -701,6 +713,7 @@ Object.defineProperty(exports, "setTextSelection", {
|
|
|
701
713
|
return _editorCoreUtils.setTextSelection;
|
|
702
714
|
}
|
|
703
715
|
});
|
|
716
|
+
exports.shallowEqual = shallowEqual;
|
|
704
717
|
Object.defineProperty(exports, "shouldForceTracking", {
|
|
705
718
|
enumerable: true,
|
|
706
719
|
get: function get() {
|
|
@@ -870,6 +883,16 @@ var _document = require("./document");
|
|
|
870
883
|
var _richMediaUtils = require("./rich-media-utils");
|
|
871
884
|
var _privacyFilter = require("./filter/privacy-filter");
|
|
872
885
|
var _datasource = require("./datasource");
|
|
886
|
+
var _commands = require("./commands");
|
|
873
887
|
// prosemirror-history does not export its plugin key
|
|
874
888
|
var pmHistoryPluginKey = 'history$';
|
|
875
|
-
exports.pmHistoryPluginKey = pmHistoryPluginKey;
|
|
889
|
+
exports.pmHistoryPluginKey = pmHistoryPluginKey;
|
|
890
|
+
function shallowEqual() {
|
|
891
|
+
var obj1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
892
|
+
var obj2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
893
|
+
var keys1 = Object.keys(obj1);
|
|
894
|
+
var keys2 = Object.keys(obj2);
|
|
895
|
+
return keys1.length === keys2.length && keys1.reduce(function (acc, key) {
|
|
896
|
+
return acc && obj1[key] === obj2[key];
|
|
897
|
+
}, true);
|
|
898
|
+
}
|
package/dist/cjs/version.json
CHANGED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
4
|
+
import { LinkPicker } from '@atlaskit/link-picker';
|
|
5
|
+
import { getAnalyticsEditorAppearance } from '../../../utils';
|
|
6
|
+
import { useEscapeClickaway } from './useEscapeClickaway';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Returns a type that matches T but where keys (K) are now optional
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export const EditorLinkPicker = ({
|
|
13
|
+
view,
|
|
14
|
+
onCancel,
|
|
15
|
+
invokeMethod = '_unknown',
|
|
16
|
+
editorAppearance,
|
|
17
|
+
onClose,
|
|
18
|
+
onEscapeCallback,
|
|
19
|
+
onClickAwayCallback,
|
|
20
|
+
...restProps
|
|
21
|
+
}) => {
|
|
22
|
+
/**
|
|
23
|
+
* Track onClose handler in a
|
|
24
|
+
* ref so that we void needing it in the dependency array
|
|
25
|
+
* below
|
|
26
|
+
*/
|
|
27
|
+
const onCloseRef = useRef(onClose);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
onCloseRef.current = onClose;
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Call onClose on mount, usefull to provide
|
|
34
|
+
* a handler for performing an action after the component has been
|
|
35
|
+
* unmounted (e.g. return focus to the editors)
|
|
36
|
+
*/
|
|
37
|
+
useEffect(() => () => {
|
|
38
|
+
var _onCloseRef$current;
|
|
39
|
+
return (_onCloseRef$current = onCloseRef.current) === null || _onCloseRef$current === void 0 ? void 0 : _onCloseRef$current.call(onCloseRef);
|
|
40
|
+
}, []);
|
|
41
|
+
const onEscape = useCallback(() => {
|
|
42
|
+
const {
|
|
43
|
+
state,
|
|
44
|
+
dispatch
|
|
45
|
+
} = view;
|
|
46
|
+
onEscapeCallback === null || onEscapeCallback === void 0 ? void 0 : onEscapeCallback(state, dispatch);
|
|
47
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
48
|
+
}, [view, onCancel, onEscapeCallback]);
|
|
49
|
+
const onClickAway = useCallback(() => {
|
|
50
|
+
const {
|
|
51
|
+
state,
|
|
52
|
+
dispatch
|
|
53
|
+
} = view;
|
|
54
|
+
onClickAwayCallback === null || onClickAwayCallback === void 0 ? void 0 : onClickAwayCallback(state, dispatch);
|
|
55
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
56
|
+
}, [view, onCancel, onClickAwayCallback]);
|
|
57
|
+
const ref = useEscapeClickaway(onEscape, onClickAway);
|
|
58
|
+
const analyticsEditorAppearance = getAnalyticsEditorAppearance(editorAppearance);
|
|
59
|
+
const analyticsData = useMemo(() => ({
|
|
60
|
+
attributes: {
|
|
61
|
+
invokeMethod,
|
|
62
|
+
location: analyticsEditorAppearance
|
|
63
|
+
},
|
|
64
|
+
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
65
|
+
location: analyticsEditorAppearance
|
|
66
|
+
}), [invokeMethod, analyticsEditorAppearance]);
|
|
67
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
ref: ref
|
|
69
|
+
}, /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
70
|
+
data: analyticsData
|
|
71
|
+
}, /*#__PURE__*/React.createElement(LinkPicker, _extends({}, restProps, {
|
|
72
|
+
onCancel: onEscape
|
|
73
|
+
}))));
|
|
74
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
export const useEscapeClickaway = (onEscape, onClickAway) => {
|
|
3
|
+
const ref = useRef(null);
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
const handleClickAway = event => {
|
|
6
|
+
const el = ref.current;
|
|
7
|
+
if (event.target instanceof Element && el && !el.contains(event.target)) {
|
|
8
|
+
onClickAway();
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const handleKeydown = event => {
|
|
12
|
+
if (event.key === 'Escape') {
|
|
13
|
+
event.preventDefault();
|
|
14
|
+
onEscape();
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
document.addEventListener('mousedown', handleClickAway);
|
|
18
|
+
document.addEventListener('keydown', handleKeydown);
|
|
19
|
+
return () => {
|
|
20
|
+
document.removeEventListener('mousedown', handleClickAway);
|
|
21
|
+
document.removeEventListener('keydown', handleKeydown);
|
|
22
|
+
};
|
|
23
|
+
}, [onClickAway, onEscape]);
|
|
24
|
+
return ref;
|
|
25
|
+
};
|