@atlaskit/editor-plugin-card 0.1.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.
Files changed (200) hide show
  1. package/.eslintrc.js +15 -0
  2. package/CHANGELOG.md +1 -0
  3. package/LICENSE.md +13 -0
  4. package/README.md +7 -0
  5. package/dist/cjs/index.js +12 -0
  6. package/dist/cjs/messages.js +20 -0
  7. package/dist/cjs/nodeviews/blockCard.js +164 -0
  8. package/dist/cjs/nodeviews/datasource.js +173 -0
  9. package/dist/cjs/nodeviews/embedCard.js +398 -0
  10. package/dist/cjs/nodeviews/genericCard.js +118 -0
  11. package/dist/cjs/nodeviews/inlineCard.js +132 -0
  12. package/dist/cjs/plugin.js +138 -0
  13. package/dist/cjs/pm-plugins/actions.js +122 -0
  14. package/dist/cjs/pm-plugins/analytics/create-analytics-queue.js +48 -0
  15. package/dist/cjs/pm-plugins/analytics/events-from-tr.js +359 -0
  16. package/dist/cjs/pm-plugins/analytics/index.js +19 -0
  17. package/dist/cjs/pm-plugins/analytics/types.js +5 -0
  18. package/dist/cjs/pm-plugins/analytics/utils.js +178 -0
  19. package/dist/cjs/pm-plugins/doc.js +479 -0
  20. package/dist/cjs/pm-plugins/keymap.js +64 -0
  21. package/dist/cjs/pm-plugins/main.js +212 -0
  22. package/dist/cjs/pm-plugins/mountHyperlink.js +47 -0
  23. package/dist/cjs/pm-plugins/plugin-key.js +9 -0
  24. package/dist/cjs/pm-plugins/reducers.js +111 -0
  25. package/dist/cjs/pm-plugins/shouldReplaceLink.js +35 -0
  26. package/dist/cjs/pm-plugins/util/resolve.js +59 -0
  27. package/dist/cjs/pm-plugins/util/state.js +49 -0
  28. package/dist/cjs/toolbar.js +364 -0
  29. package/dist/cjs/types.js +5 -0
  30. package/dist/cjs/ui/DatasourceModal/ModalWithState.js +25 -0
  31. package/dist/cjs/ui/DatasourceModal/index.js +60 -0
  32. package/dist/cjs/ui/EditLinkToolbar.js +258 -0
  33. package/dist/cjs/ui/EditorSmartCardEvents.js +21 -0
  34. package/dist/cjs/ui/EditorSmartCardEventsNext.js +215 -0
  35. package/dist/cjs/ui/HyperlinkToolbarAppearance.js +174 -0
  36. package/dist/cjs/ui/LayoutButton/index.js +121 -0
  37. package/dist/cjs/ui/LayoutButton/types.js +5 -0
  38. package/dist/cjs/ui/LayoutButton/utils.js +19 -0
  39. package/dist/cjs/ui/LinkToolbarAppearance.js +152 -0
  40. package/dist/cjs/ui/ResizableEmbedCard.js +364 -0
  41. package/dist/cjs/ui/SmallerEditIcon.js +22 -0
  42. package/dist/cjs/utils.js +60 -0
  43. package/dist/cjs/version.json +5 -0
  44. package/dist/es2019/index.js +1 -0
  45. package/dist/es2019/messages.js +13 -0
  46. package/dist/es2019/nodeviews/blockCard.js +131 -0
  47. package/dist/es2019/nodeviews/datasource.js +137 -0
  48. package/dist/es2019/nodeviews/embedCard.js +370 -0
  49. package/dist/es2019/nodeviews/genericCard.js +92 -0
  50. package/dist/es2019/nodeviews/inlineCard.js +113 -0
  51. package/dist/es2019/plugin.js +129 -0
  52. package/dist/es2019/pm-plugins/actions.js +57 -0
  53. package/dist/es2019/pm-plugins/analytics/create-analytics-queue.js +38 -0
  54. package/dist/es2019/pm-plugins/analytics/events-from-tr.js +339 -0
  55. package/dist/es2019/pm-plugins/analytics/index.js +2 -0
  56. package/dist/es2019/pm-plugins/analytics/types.js +1 -0
  57. package/dist/es2019/pm-plugins/analytics/utils.js +160 -0
  58. package/dist/es2019/pm-plugins/doc.js +451 -0
  59. package/dist/es2019/pm-plugins/keymap.js +59 -0
  60. package/dist/es2019/pm-plugins/main.js +208 -0
  61. package/dist/es2019/pm-plugins/mountHyperlink.js +37 -0
  62. package/dist/es2019/pm-plugins/plugin-key.js +2 -0
  63. package/dist/es2019/pm-plugins/reducers.js +110 -0
  64. package/dist/es2019/pm-plugins/shouldReplaceLink.js +25 -0
  65. package/dist/es2019/pm-plugins/util/resolve.js +50 -0
  66. package/dist/es2019/pm-plugins/util/state.js +26 -0
  67. package/dist/es2019/toolbar.js +359 -0
  68. package/dist/es2019/types.js +1 -0
  69. package/dist/es2019/ui/DatasourceModal/ModalWithState.js +19 -0
  70. package/dist/es2019/ui/DatasourceModal/index.js +48 -0
  71. package/dist/es2019/ui/EditLinkToolbar.js +226 -0
  72. package/dist/es2019/ui/EditorSmartCardEvents.js +15 -0
  73. package/dist/es2019/ui/EditorSmartCardEventsNext.js +199 -0
  74. package/dist/es2019/ui/HyperlinkToolbarAppearance.js +86 -0
  75. package/dist/es2019/ui/LayoutButton/index.js +114 -0
  76. package/dist/es2019/ui/LayoutButton/types.js +1 -0
  77. package/dist/es2019/ui/LayoutButton/utils.js +15 -0
  78. package/dist/es2019/ui/LinkToolbarAppearance.js +118 -0
  79. package/dist/es2019/ui/ResizableEmbedCard.js +335 -0
  80. package/dist/es2019/ui/SmallerEditIcon.js +14 -0
  81. package/dist/es2019/utils.js +46 -0
  82. package/dist/es2019/version.json +5 -0
  83. package/dist/esm/index.js +1 -0
  84. package/dist/esm/messages.js +13 -0
  85. package/dist/esm/nodeviews/blockCard.js +156 -0
  86. package/dist/esm/nodeviews/datasource.js +165 -0
  87. package/dist/esm/nodeviews/embedCard.js +389 -0
  88. package/dist/esm/nodeviews/genericCard.js +111 -0
  89. package/dist/esm/nodeviews/inlineCard.js +124 -0
  90. package/dist/esm/plugin.js +130 -0
  91. package/dist/esm/pm-plugins/actions.js +102 -0
  92. package/dist/esm/pm-plugins/analytics/create-analytics-queue.js +41 -0
  93. package/dist/esm/pm-plugins/analytics/events-from-tr.js +350 -0
  94. package/dist/esm/pm-plugins/analytics/index.js +2 -0
  95. package/dist/esm/pm-plugins/analytics/types.js +1 -0
  96. package/dist/esm/pm-plugins/analytics/utils.js +160 -0
  97. package/dist/esm/pm-plugins/doc.js +460 -0
  98. package/dist/esm/pm-plugins/keymap.js +58 -0
  99. package/dist/esm/pm-plugins/main.js +199 -0
  100. package/dist/esm/pm-plugins/mountHyperlink.js +39 -0
  101. package/dist/esm/pm-plugins/plugin-key.js +2 -0
  102. package/dist/esm/pm-plugins/reducers.js +103 -0
  103. package/dist/esm/pm-plugins/shouldReplaceLink.js +29 -0
  104. package/dist/esm/pm-plugins/util/resolve.js +52 -0
  105. package/dist/esm/pm-plugins/util/state.js +40 -0
  106. package/dist/esm/toolbar.js +350 -0
  107. package/dist/esm/types.js +1 -0
  108. package/dist/esm/ui/DatasourceModal/ModalWithState.js +17 -0
  109. package/dist/esm/ui/DatasourceModal/index.js +49 -0
  110. package/dist/esm/ui/EditLinkToolbar.js +244 -0
  111. package/dist/esm/ui/EditorSmartCardEvents.js +14 -0
  112. package/dist/esm/ui/EditorSmartCardEventsNext.js +203 -0
  113. package/dist/esm/ui/HyperlinkToolbarAppearance.js +163 -0
  114. package/dist/esm/ui/LayoutButton/index.js +110 -0
  115. package/dist/esm/ui/LayoutButton/types.js +1 -0
  116. package/dist/esm/ui/LayoutButton/utils.js +12 -0
  117. package/dist/esm/ui/LinkToolbarAppearance.js +141 -0
  118. package/dist/esm/ui/ResizableEmbedCard.js +358 -0
  119. package/dist/esm/ui/SmallerEditIcon.js +14 -0
  120. package/dist/esm/utils.js +48 -0
  121. package/dist/esm/version.json +5 -0
  122. package/dist/types/index.d.ts +2 -0
  123. package/dist/types/messages.d.ts +12 -0
  124. package/dist/types/nodeviews/blockCard.d.ts +26 -0
  125. package/dist/types/nodeviews/datasource.d.ts +42 -0
  126. package/dist/types/nodeviews/embedCard.d.ts +46 -0
  127. package/dist/types/nodeviews/genericCard.d.ts +37 -0
  128. package/dist/types/nodeviews/inlineCard.d.ts +23 -0
  129. package/dist/types/plugin.d.ts +24 -0
  130. package/dist/types/pm-plugins/actions.d.ts +23 -0
  131. package/dist/types/pm-plugins/analytics/create-analytics-queue.d.ts +10 -0
  132. package/dist/types/pm-plugins/analytics/events-from-tr.d.ts +17 -0
  133. package/dist/types/pm-plugins/analytics/index.d.ts +2 -0
  134. package/dist/types/pm-plugins/analytics/types.d.ts +12 -0
  135. package/dist/types/pm-plugins/analytics/utils.d.ts +32 -0
  136. package/dist/types/pm-plugins/doc.d.ts +22 -0
  137. package/dist/types/pm-plugins/keymap.d.ts +3 -0
  138. package/dist/types/pm-plugins/main.d.ts +6 -0
  139. package/dist/types/pm-plugins/mountHyperlink.d.ts +5 -0
  140. package/dist/types/pm-plugins/plugin-key.d.ts +3 -0
  141. package/dist/types/pm-plugins/reducers.d.ts +3 -0
  142. package/dist/types/pm-plugins/shouldReplaceLink.d.ts +2 -0
  143. package/dist/types/pm-plugins/util/resolve.d.ts +8 -0
  144. package/dist/types/pm-plugins/util/state.d.ts +31 -0
  145. package/dist/types/toolbar.d.ts +9 -0
  146. package/dist/types/types.d.ts +163 -0
  147. package/dist/types/ui/DatasourceModal/ModalWithState.d.ts +9 -0
  148. package/dist/types/ui/DatasourceModal/index.d.ts +11 -0
  149. package/dist/types/ui/EditLinkToolbar.d.ts +47 -0
  150. package/dist/types/ui/EditorSmartCardEvents.d.ts +5 -0
  151. package/dist/types/ui/EditorSmartCardEventsNext.d.ts +18 -0
  152. package/dist/types/ui/HyperlinkToolbarAppearance.d.ts +32 -0
  153. package/dist/types/ui/LayoutButton/index.d.ts +9 -0
  154. package/dist/types/ui/LayoutButton/types.d.ts +19 -0
  155. package/dist/types/ui/LayoutButton/utils.d.ts +5 -0
  156. package/dist/types/ui/LinkToolbarAppearance.d.ts +29 -0
  157. package/dist/types/ui/ResizableEmbedCard.d.ts +61 -0
  158. package/dist/types/ui/SmallerEditIcon.d.ts +3 -0
  159. package/dist/types/utils.d.ts +19 -0
  160. package/dist/types-ts4.5/index.d.ts +2 -0
  161. package/dist/types-ts4.5/messages.d.ts +12 -0
  162. package/dist/types-ts4.5/nodeviews/blockCard.d.ts +26 -0
  163. package/dist/types-ts4.5/nodeviews/datasource.d.ts +42 -0
  164. package/dist/types-ts4.5/nodeviews/embedCard.d.ts +46 -0
  165. package/dist/types-ts4.5/nodeviews/genericCard.d.ts +37 -0
  166. package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +23 -0
  167. package/dist/types-ts4.5/plugin.d.ts +24 -0
  168. package/dist/types-ts4.5/pm-plugins/actions.d.ts +23 -0
  169. package/dist/types-ts4.5/pm-plugins/analytics/create-analytics-queue.d.ts +10 -0
  170. package/dist/types-ts4.5/pm-plugins/analytics/events-from-tr.d.ts +17 -0
  171. package/dist/types-ts4.5/pm-plugins/analytics/index.d.ts +2 -0
  172. package/dist/types-ts4.5/pm-plugins/analytics/types.d.ts +12 -0
  173. package/dist/types-ts4.5/pm-plugins/analytics/utils.d.ts +32 -0
  174. package/dist/types-ts4.5/pm-plugins/doc.d.ts +22 -0
  175. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +3 -0
  176. package/dist/types-ts4.5/pm-plugins/main.d.ts +6 -0
  177. package/dist/types-ts4.5/pm-plugins/mountHyperlink.d.ts +5 -0
  178. package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +3 -0
  179. package/dist/types-ts4.5/pm-plugins/reducers.d.ts +3 -0
  180. package/dist/types-ts4.5/pm-plugins/shouldReplaceLink.d.ts +2 -0
  181. package/dist/types-ts4.5/pm-plugins/util/resolve.d.ts +8 -0
  182. package/dist/types-ts4.5/pm-plugins/util/state.d.ts +31 -0
  183. package/dist/types-ts4.5/toolbar.d.ts +9 -0
  184. package/dist/types-ts4.5/types.d.ts +163 -0
  185. package/dist/types-ts4.5/ui/DatasourceModal/ModalWithState.d.ts +9 -0
  186. package/dist/types-ts4.5/ui/DatasourceModal/index.d.ts +11 -0
  187. package/dist/types-ts4.5/ui/EditLinkToolbar.d.ts +47 -0
  188. package/dist/types-ts4.5/ui/EditorSmartCardEvents.d.ts +5 -0
  189. package/dist/types-ts4.5/ui/EditorSmartCardEventsNext.d.ts +18 -0
  190. package/dist/types-ts4.5/ui/HyperlinkToolbarAppearance.d.ts +32 -0
  191. package/dist/types-ts4.5/ui/LayoutButton/index.d.ts +9 -0
  192. package/dist/types-ts4.5/ui/LayoutButton/types.d.ts +19 -0
  193. package/dist/types-ts4.5/ui/LayoutButton/utils.d.ts +5 -0
  194. package/dist/types-ts4.5/ui/LinkToolbarAppearance.d.ts +29 -0
  195. package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +61 -0
  196. package/dist/types-ts4.5/ui/SmallerEditIcon.d.ts +3 -0
  197. package/dist/types-ts4.5/utils.d.ts +19 -0
  198. package/package.json +126 -0
  199. package/report.api.md +146 -0
  200. package/tmp/api-report-tmp.d.ts +117 -0
@@ -0,0 +1,358 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
+ import _inherits from "@babel/runtime/helpers/inherits";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
+ 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; } }
13
+ /** @jsx jsx */
14
+ import React from 'react';
15
+ import { jsx } from '@emotion/react';
16
+ import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from 'prosemirror-utils';
17
+ import { embedSpacingStyles } from '@atlaskit/editor-common/styles';
18
+ import { calcColumnsFromPx, calcMediaPxWidth, calcPctFromPx, calcPxFromColumns, handleSides, imageAlignmentMap, Resizer, snapTo, wrappedLayouts, wrapperStyle } from '@atlaskit/editor-common/ui';
19
+ import { akEditorBreakoutPadding, akEditorMediaResizeHandlerPaddingWide, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
20
+ import { embedHeaderHeight } from '@atlaskit/smart-card';
21
+ // eslint-disable-next-line @repo/internal/react/no-class-components
22
+ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
23
+ _inherits(ResizableEmbedCard, _React$Component);
24
+ var _super = _createSuper(ResizableEmbedCard);
25
+ function ResizableEmbedCard() {
26
+ var _this;
27
+ _classCallCheck(this, ResizableEmbedCard);
28
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
29
+ args[_key] = arguments[_key];
30
+ }
31
+ _this = _super.call.apply(_super, [this].concat(args));
32
+ _defineProperty(_assertThisInitialized(_this), "state", {
33
+ offsetLeft: _this.calcOffsetLeft()
34
+ });
35
+ _defineProperty(_assertThisInitialized(_this), "calcNewSize", function (newWidth, stop) {
36
+ var _this$props = _this.props,
37
+ layout = _this$props.layout,
38
+ state = _this$props.view.state;
39
+ var newPct = calcPctFromPx(newWidth, _this.props.lineLength) * 100;
40
+ _this.setState({
41
+ resizedPctWidth: newPct
42
+ });
43
+ var newLayout = hasParentNodeOfType(state.schema.nodes.table)(state.selection) ? layout : _this.calcUnwrappedLayout(newPct, newWidth);
44
+ if (newPct <= 100) {
45
+ if (_this.wrappedLayout && (stop ? newPct !== 100 : true)) {
46
+ newLayout = layout;
47
+ }
48
+ return {
49
+ width: newPct,
50
+ layout: newLayout
51
+ };
52
+ } else {
53
+ return {
54
+ width: _this.props.pctWidth || null,
55
+ layout: newLayout
56
+ };
57
+ }
58
+ });
59
+ _defineProperty(_assertThisInitialized(_this), "calcUnwrappedLayout", function (pct, width) {
60
+ if (pct <= 100) {
61
+ return 'center';
62
+ }
63
+ if (width <= _this.wideLayoutWidth) {
64
+ return 'wide';
65
+ }
66
+ return 'full-width';
67
+ });
68
+ _defineProperty(_assertThisInitialized(_this), "calcColumnLeftOffset", function () {
69
+ var offsetLeft = _this.state.offsetLeft;
70
+ return _this.insideInlineLike ? calcColumnsFromPx(offsetLeft, _this.props.lineLength, _this.props.gridSize) : 0;
71
+ });
72
+ _defineProperty(_assertThisInitialized(_this), "calcPxWidth", function (useLayout) {
73
+ var _this$props2 = _this.props,
74
+ layout = _this$props2.layout,
75
+ pctWidth = _this$props2.pctWidth,
76
+ lineLength = _this$props2.lineLength,
77
+ containerWidth = _this$props2.containerWidth,
78
+ fullWidthMode = _this$props2.fullWidthMode,
79
+ getPos = _this$props2.getPos,
80
+ state = _this$props2.view.state;
81
+ var resizedPctWidth = _this.state.resizedPctWidth;
82
+ var pos = typeof getPos === 'function' ? getPos() : undefined;
83
+ return calcMediaPxWidth({
84
+ origWidth: DEFAULT_EMBED_CARD_WIDTH,
85
+ origHeight: DEFAULT_EMBED_CARD_HEIGHT,
86
+ pctWidth: pctWidth,
87
+ state: state,
88
+ containerWidth: {
89
+ width: containerWidth,
90
+ lineLength: lineLength
91
+ },
92
+ isFullWidthModeEnabled: fullWidthMode,
93
+ layout: useLayout || layout,
94
+ pos: pos,
95
+ resizedPctWidth: resizedPctWidth
96
+ });
97
+ });
98
+ _defineProperty(_assertThisInitialized(_this), "highlights", function (newWidth, snapPoints) {
99
+ var snapWidth = snapTo(newWidth, snapPoints);
100
+ var _this$props$view$stat = _this.props.view.state.schema.nodes,
101
+ layoutColumn = _this$props$view$stat.layoutColumn,
102
+ table = _this$props$view$stat.table,
103
+ expand = _this$props$view$stat.expand,
104
+ nestedExpand = _this$props$view$stat.nestedExpand;
105
+ if (_this.$pos && !!findParentNodeOfTypeClosestToPos(_this.$pos, [layoutColumn, table, expand, nestedExpand].filter(Boolean))) {
106
+ return [];
107
+ }
108
+ if (snapWidth > _this.wideLayoutWidth) {
109
+ return ['full-width'];
110
+ }
111
+ var _this$props3 = _this.props,
112
+ layout = _this$props3.layout,
113
+ lineLength = _this$props3.lineLength,
114
+ gridSize = _this$props3.gridSize;
115
+ var columns = calcColumnsFromPx(snapWidth, lineLength, gridSize);
116
+ var columnWidth = Math.round(columns);
117
+ var highlight = [];
118
+ if (layout === 'wrap-left' || layout === 'align-start') {
119
+ highlight.push(0, columnWidth);
120
+ } else if (layout === 'wrap-right' || layout === 'align-end') {
121
+ highlight.push(gridSize, gridSize - columnWidth);
122
+ } else if (_this.insideInlineLike) {
123
+ highlight.push(Math.round(columns + _this.calcColumnLeftOffset()));
124
+ } else {
125
+ highlight.push(Math.floor((gridSize - columnWidth) / 2), Math.ceil((gridSize + columnWidth) / 2));
126
+ }
127
+ return highlight;
128
+ });
129
+ return _this;
130
+ }
131
+ _createClass(ResizableEmbedCard, [{
132
+ key: "componentDidUpdate",
133
+ value: function componentDidUpdate() {
134
+ var offsetLeft = this.calcOffsetLeft();
135
+ if (offsetLeft !== this.state.offsetLeft && offsetLeft >= 0) {
136
+ this.setState({
137
+ offsetLeft: offsetLeft
138
+ });
139
+ }
140
+ }
141
+ }, {
142
+ key: "wrappedLayout",
143
+ get: function get() {
144
+ return wrappedLayouts.indexOf(this.props.layout) > -1;
145
+ }
146
+ }, {
147
+ key: "UNSAFE_componentWillReceiveProps",
148
+ value: function UNSAFE_componentWillReceiveProps(nextProps) {
149
+ if (this.props.layout !== nextProps.layout) {
150
+ this.checkLayout(this.props.layout, nextProps.layout);
151
+ }
152
+ }
153
+
154
+ /**
155
+ * When returning to center layout from a wrapped/aligned layout, it might actually
156
+ * be wide or full-width
157
+ */
158
+ }, {
159
+ key: "checkLayout",
160
+ value: function checkLayout(oldLayout, newLayout) {
161
+ var resizedPctWidth = this.state.resizedPctWidth;
162
+ if (wrappedLayouts.indexOf(oldLayout) > -1 && newLayout === 'center' && resizedPctWidth) {
163
+ var layout = this.calcUnwrappedLayout(resizedPctWidth, this.calcPxWidth(newLayout));
164
+ this.props.updateSize(resizedPctWidth, layout);
165
+ }
166
+ }
167
+ }, {
168
+ key: "$pos",
169
+ get: function get() {
170
+ if (typeof this.props.getPos !== 'function') {
171
+ return null;
172
+ }
173
+ var pos = this.props.getPos();
174
+ if (Number.isNaN(pos) || typeof pos !== 'number') {
175
+ return null;
176
+ }
177
+
178
+ // need to pass view because we may not get updated props in time
179
+ return this.props.view.state.doc.resolve(pos);
180
+ }
181
+
182
+ /**
183
+ * The maxmimum number of grid columns this node can resize to.
184
+ */
185
+ }, {
186
+ key: "gridWidth",
187
+ get: function get() {
188
+ var gridSize = this.props.gridSize;
189
+ return !(this.wrappedLayout || this.insideInlineLike) ? gridSize / 2 : gridSize;
190
+ }
191
+ }, {
192
+ key: "calcOffsetLeft",
193
+ value: function calcOffsetLeft() {
194
+ var offsetLeft = 0;
195
+ if (this.wrapper && this.insideInlineLike) {
196
+ var currentNode = this.wrapper;
197
+ var boundingRect = currentNode.getBoundingClientRect();
198
+ var pmRect = this.props.view.dom.getBoundingClientRect();
199
+ offsetLeft = boundingRect.left - pmRect.left;
200
+ }
201
+ return offsetLeft;
202
+ }
203
+ }, {
204
+ key: "wideLayoutWidth",
205
+ get: function get() {
206
+ var lineLength = this.props.lineLength;
207
+ if (lineLength) {
208
+ return Math.ceil(lineLength * breakoutWideScaleRatio);
209
+ } else {
210
+ return akEditorWideLayoutWidth;
211
+ }
212
+ }
213
+ }, {
214
+ key: "calcSnapPoints",
215
+ value: function calcSnapPoints() {
216
+ var offsetLeft = this.state.offsetLeft;
217
+ var _this$props4 = this.props,
218
+ containerWidth = _this$props4.containerWidth,
219
+ lineLength = _this$props4.lineLength;
220
+ var snapTargets = [];
221
+ for (var i = 0; i < this.gridWidth; i++) {
222
+ snapTargets.push(calcPxFromColumns(i, lineLength, this.gridWidth) - offsetLeft);
223
+ }
224
+ // full width
225
+ snapTargets.push(lineLength - offsetLeft);
226
+ var minimumWidth = calcPxFromColumns(this.wrappedLayout || this.insideInlineLike ? 1 : 2, lineLength, this.props.gridSize);
227
+ var snapPoints = snapTargets.filter(function (width) {
228
+ return width >= minimumWidth;
229
+ });
230
+ var $pos = this.$pos;
231
+ if (!$pos) {
232
+ return snapPoints;
233
+ }
234
+ var isTopLevel = $pos.parent.type.name === 'doc';
235
+ if (isTopLevel) {
236
+ snapPoints.push(this.wideLayoutWidth);
237
+ var fullWidthPoint = containerWidth - akEditorBreakoutPadding;
238
+ if (fullWidthPoint > this.wideLayoutWidth) {
239
+ snapPoints.push(fullWidthPoint);
240
+ }
241
+ }
242
+ return snapPoints;
243
+ }
244
+ }, {
245
+ key: "insideInlineLike",
246
+ get: function get() {
247
+ var $pos = this.$pos;
248
+ if (!$pos) {
249
+ return false;
250
+ }
251
+ var listItem = this.props.view.state.schema.nodes.listItem;
252
+ return !!findParentNodeOfTypeClosestToPos($pos, [listItem]);
253
+ }
254
+ }, {
255
+ key: "getHeightDefiningComponent",
256
+ value:
257
+ /**
258
+ * Previously height of the box was controlled with paddingTop/paddingBottom trick inside Wrapper.
259
+ * It allowed height to be defined by a given percent ratio and so absolute value was defined by actual width.
260
+ * Also, it was part of styled component, which was fine because it was static through out life time of component.
261
+ *
262
+ * Now, two things changed:
263
+ * 1. If `height` is present we take it as actual height of the box, and hence we don't need
264
+ * (or even can't have, due to lack of width value) paddingTop trick.
265
+ * 2. Since `height` can be changing through out life time of a component, we can't have it as part of styled component,
266
+ * and hence we use `style` prop.
267
+ */
268
+ function getHeightDefiningComponent() {
269
+ var _this$props5 = this.props,
270
+ height = _this$props5.height,
271
+ aspectRatio = _this$props5.aspectRatio;
272
+ var heightDefiningStyles;
273
+ if (height) {
274
+ heightDefiningStyles = {
275
+ height: "".concat(height, "px")
276
+ };
277
+ } else {
278
+ // paddingBottom css trick defines ratio of `iframe height (y) + header (32)` to `width (x)`,
279
+ // where is `aspectRatio` defines iframe aspectRatio alone
280
+ // So, visually:
281
+ //
282
+ // x
283
+ // ┌──────────┐
284
+ // │ header │ 32
285
+ // ├──────────┤
286
+ // │ │
287
+ // │ iframe │ y
288
+ // │ │
289
+ // └──────────┘
290
+ //
291
+ // aspectRatio = x / y
292
+ // paddingBottom = (y + 32) / x
293
+ // which can be achieved with css calc() as (1 / (x/y)) * 100)% + 32px
294
+ heightDefiningStyles = {
295
+ paddingBottom: "calc(".concat((1 / aspectRatio * 100).toFixed(3), "% + ").concat(embedHeaderHeight, "px)")
296
+ };
297
+ }
298
+ return jsx("span", {
299
+ "data-testid": 'resizable-embed-card-height-definer',
300
+ style: _objectSpread({
301
+ display: 'block',
302
+ /* Fixes extra padding problem in Firefox */
303
+ fontSize: 0,
304
+ lineHeight: 0
305
+ }, heightDefiningStyles)
306
+ });
307
+ }
308
+ }, {
309
+ key: "render",
310
+ value: function render() {
311
+ var _this2 = this;
312
+ var _this$props6 = this.props,
313
+ layout = _this$props6.layout,
314
+ pctWidth = _this$props6.pctWidth,
315
+ containerWidth = _this$props6.containerWidth,
316
+ fullWidthMode = _this$props6.fullWidthMode,
317
+ children = _this$props6.children;
318
+ var initialWidth = this.calcPxWidth() - akEditorMediaResizeHandlerPaddingWide;
319
+ var enable = {};
320
+ handleSides.forEach(function (side) {
321
+ var oppositeSide = side === 'left' ? 'right' : 'left';
322
+ enable[side] = ['full-width', 'wide', 'center'].concat("wrap-".concat(oppositeSide)).concat("align-".concat(imageAlignmentMap[oppositeSide])).indexOf(layout) > -1;
323
+ if (side === 'left' && _this2.insideInlineLike) {
324
+ enable[side] = false;
325
+ }
326
+ });
327
+
328
+ /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
329
+ return jsx("div", {
330
+ css: embedSpacingStyles,
331
+ "data-testid": "resizable-embed-card-spacing"
332
+ }, jsx("div", {
333
+ css: wrapperStyle({
334
+ layout: layout,
335
+ isResized: !!pctWidth,
336
+ containerWidth: containerWidth || DEFAULT_EMBED_CARD_WIDTH,
337
+ fullWidthMode: fullWidthMode
338
+ })
339
+ }, jsx(Resizer, _extends({}, this.props, {
340
+ width: initialWidth // Starting or initial width of embed <iframe> itself.
341
+ ,
342
+ enable: enable,
343
+ calcNewSize: this.calcNewSize,
344
+ snapPoints: this.calcSnapPoints(),
345
+ scaleFactor: !this.wrappedLayout && !this.insideInlineLike ? 2 : 1,
346
+ highlights: this.highlights,
347
+ innerPadding: akEditorMediaResizeHandlerPaddingWide,
348
+ nodeType: "embed"
349
+ }), children, this.getHeightDefiningComponent())));
350
+ /* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */
351
+ }
352
+ }]);
353
+ return ResizableEmbedCard;
354
+ }(React.Component);
355
+ _defineProperty(ResizableEmbedCard, "defaultProps", {
356
+ aspectRatio: DEFAULT_EMBED_CARD_WIDTH / DEFAULT_EMBED_CARD_HEIGHT
357
+ });
358
+ export { ResizableEmbedCard as default };
@@ -0,0 +1,14 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { editIconStyles } from '@atlaskit/editor-common/styles';
4
+ import EditIcon from '@atlaskit/icon/glyph/edit';
5
+
6
+ /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
7
+ export var SmallerEditIcon = function SmallerEditIcon() {
8
+ return jsx("div", {
9
+ css: editIconStyles
10
+ }, jsx(EditIcon, {
11
+ label: "edit"
12
+ }));
13
+ };
14
+ /* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */
@@ -0,0 +1,48 @@
1
+ import { NodeSelection } from 'prosemirror-state';
2
+ import { pluginKey } from './pm-plugins/plugin-key';
3
+ export var appearanceForNodeType = function appearanceForNodeType(spec) {
4
+ if (spec.name === 'inlineCard') {
5
+ return 'inline';
6
+ } else if (spec.name === 'blockCard') {
7
+ return 'block';
8
+ } else if (spec.name === 'embedCard') {
9
+ return 'embed';
10
+ }
11
+ return;
12
+ };
13
+ export var selectedCardAppearance = function selectedCardAppearance(state) {
14
+ if (state.selection instanceof NodeSelection) {
15
+ return appearanceForNodeType(state.selection.node.type);
16
+ }
17
+ };
18
+ export var titleUrlPairFromNode = function titleUrlPairFromNode(node) {
19
+ var attrs = node.attrs;
20
+ return {
21
+ url: attrs.url || attrs.data && attrs.data.url,
22
+ title: attrs.data && attrs.data.title
23
+ };
24
+ };
25
+
26
+ /**
27
+ * Merges the title and url from attributes and CardInfo from the resolved view, preferring the CardInfo.
28
+ * @param titleUrlPair title and url information from the node attributes
29
+ * @param info information stored in state from the resolved UI component view
30
+ */
31
+ export var mergeCardInfo = function mergeCardInfo(titleUrlPair, info) {
32
+ return {
33
+ title: info && info.title || titleUrlPair.title,
34
+ url: info && info.url || titleUrlPair.url
35
+ };
36
+ };
37
+ export var displayInfoForCard = function displayInfoForCard(node, info) {
38
+ return mergeCardInfo(titleUrlPairFromNode(node), info);
39
+ };
40
+ export var findCardInfo = function findCardInfo(state) {
41
+ var pluginState = pluginKey.getState(state);
42
+ if (!pluginState) {
43
+ return undefined;
44
+ }
45
+ return pluginState.cards.find(function (cardInfo) {
46
+ return cardInfo.pos === state.selection.from;
47
+ });
48
+ };
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "@atlaskit/editor-plugin-card",
3
+ "version": "0.1.0",
4
+ "sideEffects": false
5
+ }
@@ -0,0 +1,2 @@
1
+ export { cardPlugin } from './plugin';
2
+ export type { Request } from './types';
@@ -0,0 +1,12 @@
1
+ export declare const messages: {
2
+ datasourceJiraIssue: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ datasourceJiraIssueDescription: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ };
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
4
+ import { SmartCardProps } from './genericCard';
5
+ export declare class BlockCardComponent extends React.PureComponent<SmartCardProps> {
6
+ private scrollContainer?;
7
+ onClick: () => void;
8
+ static contextTypes: {
9
+ contextAdapter: PropTypes.Requireable<object>;
10
+ };
11
+ UNSAFE_componentWillMount(): void;
12
+ onResolve: (data: {
13
+ url?: string | undefined;
14
+ title?: string | undefined;
15
+ }) => void;
16
+ gapCursorSpan: () => JSX.Element | undefined;
17
+ onError: ({ err }: {
18
+ err?: Error | undefined;
19
+ }) => void;
20
+ render(): JSX.Element;
21
+ }
22
+ export type BlockCardNodeViewProps = Pick<SmartCardProps, 'platform' | 'showServerActions'>;
23
+ export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
24
+ createDomRef(): HTMLElement;
25
+ render(): JSX.Element;
26
+ }
@@ -0,0 +1,42 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import PropTypes from 'prop-types';
5
+ import { Node as PMNode } from 'prosemirror-model';
6
+ import { EditorView } from 'prosemirror-view';
7
+ import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
8
+ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
9
+ import ReactNodeView, { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
10
+ import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
11
+ import type { cardPlugin } from '../index';
12
+ import { DatasourceTableLayout } from '../ui/LayoutButton/types';
13
+ interface DatasourceProps extends ReactComponentProps {
14
+ node: PMNode;
15
+ view: EditorView;
16
+ getPos: getPosHandler;
17
+ portalProviderAPI: PortalProviderAPI;
18
+ eventDispatcher: EventDispatcher;
19
+ hasIntlContext: boolean;
20
+ pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
21
+ }
22
+ interface DatasourceComponentProps extends ReactComponentProps, Pick<DatasourceProps, 'node' | 'view' | 'getPos'> {
23
+ }
24
+ export declare class DatasourceComponent extends React.PureComponent<DatasourceComponentProps> {
25
+ static contextTypes: {
26
+ contextAdapter: PropTypes.Requireable<object>;
27
+ };
28
+ constructor(props: DatasourceComponentProps);
29
+ private getPosSafely;
30
+ private getDatasource;
31
+ private getTableView;
32
+ handleColumnChange: (columnKeys: string[]) => void;
33
+ render(): jsx.JSX.Element | null;
34
+ }
35
+ export declare class Datasource extends ReactNodeView<DatasourceProps> {
36
+ private tableWidth;
37
+ constructor(props: DatasourceProps);
38
+ createDomRef(): HTMLElement;
39
+ calcTableWidth: (layout: DatasourceTableLayout, containerWidth?: number) => number | 'inherit';
40
+ render(): jsx.JSX.Element;
41
+ }
42
+ export {};
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { Node as PMNode } from 'prosemirror-model';
4
+ import { RichMediaLayout } from '@atlaskit/adf-schema';
5
+ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
6
+ import { SmartCardProps } from './genericCard';
7
+ export type EmbedCardState = {
8
+ hasPreview: boolean;
9
+ liveHeight?: number;
10
+ initialAspectRatio?: number;
11
+ };
12
+ export declare class EmbedCardComponent extends React.PureComponent<SmartCardProps, EmbedCardState> {
13
+ private scrollContainer?;
14
+ private embedIframeRef;
15
+ onClick: () => void;
16
+ static contextTypes: {
17
+ contextAdapter: PropTypes.Requireable<object>;
18
+ };
19
+ state: EmbedCardState;
20
+ UNSAFE_componentWillMount(): void;
21
+ private getPosSafely;
22
+ onResolve: (data: {
23
+ url?: string | undefined;
24
+ title?: string | undefined;
25
+ aspectRatio?: number | undefined;
26
+ }) => void;
27
+ updateSize: (pctWidth: number | null, layout: RichMediaLayout) => true | undefined;
28
+ private getLineLength;
29
+ /**
30
+ * Even though render is capable of listening and reacting to iframely wrapper iframe sent `resize` events
31
+ * it's good idea to store latest actual height in ADF, so that when renderer (well, editor as well) is loading
32
+ * we will show embed window of appropriate size and avoid unnecessary content jumping.
33
+ */
34
+ saveOriginalDimensionsAttributes: (height: number, width: number | undefined) => void;
35
+ onHeightUpdate: (height: number) => void;
36
+ onError: ({ err }: {
37
+ err?: Error | undefined;
38
+ }) => void;
39
+ render(): JSX.Element;
40
+ }
41
+ export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'platform' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi'>;
42
+ export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
43
+ viewShouldUpdate(nextNode: PMNode): boolean;
44
+ createDomRef(): HTMLElement;
45
+ render(): JSX.Element;
46
+ }
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { Node as PMNode } from 'prosemirror-model';
3
+ import { EditorView } from 'prosemirror-view';
4
+ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
5
+ import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
6
+ import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
7
+ import { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
8
+ import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
+ import { SmartCardContext } from '@atlaskit/link-provider';
10
+ import { CardPlatform } from '@atlaskit/smart-card';
11
+ import type { cardPlugin } from '../index';
12
+ export type EditorContext<T> = React.Context<T> & {
13
+ value: T;
14
+ };
15
+ export interface CardNodeViewProps extends ReactComponentProps {
16
+ providerFactory?: ProviderFactory;
17
+ platform?: CardPlatform;
18
+ eventDispatcher?: EventDispatcher;
19
+ }
20
+ export interface CardProps extends CardNodeViewProps {
21
+ children?: React.ReactNode;
22
+ node: PMNode;
23
+ view: EditorView;
24
+ getPos: getPosHandler;
25
+ dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
26
+ isMobile?: boolean;
27
+ eventDispatcher?: EventDispatcher;
28
+ allowResizing?: boolean;
29
+ fullWidthMode?: boolean;
30
+ useAlternativePreloader?: boolean;
31
+ showServerActions?: boolean;
32
+ pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
33
+ }
34
+ export interface SmartCardProps extends CardProps {
35
+ cardContext?: EditorContext<typeof SmartCardContext>;
36
+ }
37
+ export declare function Card(SmartCardComponent: React.ComponentType<SmartCardProps>, UnsupportedComponent: React.ComponentType): React.ComponentType<CardProps>;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import type { InlineNodeViewComponentProps } from '@atlaskit/editor-common/react-node-view';
4
+ import { SmartCardProps } from './genericCard';
5
+ export declare class InlineCardComponent extends React.PureComponent<SmartCardProps> {
6
+ private scrollContainer?;
7
+ private onClick;
8
+ static contextTypes: {
9
+ contextAdapter: PropTypes.Requireable<object>;
10
+ };
11
+ UNSAFE_componentWillMount(): void;
12
+ onResolve: (data: {
13
+ url?: string | undefined;
14
+ title?: string | undefined;
15
+ }) => void;
16
+ onError: (data: {
17
+ url?: string | undefined;
18
+ err?: Error | undefined;
19
+ }) => void;
20
+ render(): JSX.Element | null;
21
+ }
22
+ export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'showServerActions'>;
23
+ export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps): JSX.Element;
@@ -0,0 +1,24 @@
1
+ import type { CardPluginActions } from '@atlaskit/editor-common/card';
2
+ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
3
+ import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
+ import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
5
+ import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
6
+ import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
7
+ import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
8
+ import type { hyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
9
+ import type { widthPlugin } from '@atlaskit/editor-plugin-width';
10
+ import type { CardPluginOptions, CardPluginState } from './types';
11
+ export declare const cardPlugin: NextEditorPlugin<'card', {
12
+ pluginConfiguration: CardPluginOptions;
13
+ dependencies: [
14
+ typeof featureFlagsPlugin,
15
+ OptionalPlugin<typeof analyticsPlugin>,
16
+ typeof widthPlugin,
17
+ typeof decorationsPlugin,
18
+ typeof gridPlugin,
19
+ FloatingToolbarPlugin,
20
+ typeof hyperlinkPlugin
21
+ ];
22
+ sharedState: CardPluginState | null;
23
+ actions: CardPluginActions;
24
+ }>;
@@ -0,0 +1,23 @@
1
+ import { Transaction } from 'prosemirror-state';
2
+ import { CardProvider } from '@atlaskit/editor-common/provider-factory';
3
+ import type { DatasourceModalType } from '@atlaskit/editor-common/types';
4
+ import { SmartLinkEvents } from '@atlaskit/smart-card';
5
+ import { CardInfo, CardPluginAction, Request, SmartLinkEventsNext } from '../types';
6
+ import { DatasourceTableLayout } from '../ui/LayoutButton/types';
7
+ export declare const cardAction: (tr: Transaction, action: CardPluginAction) => Transaction;
8
+ export declare const resolveCard: (url: string) => (tr: Transaction) => Transaction;
9
+ export declare const queueCards: (requests: Request[]) => (tr: Transaction) => Transaction;
10
+ export declare const registerCard: (info: CardInfo) => (tr: Transaction) => Transaction;
11
+ export declare const registerSmartCardEvents: (smartLinkEvents: SmartLinkEvents) => (tr: Transaction) => Transaction;
12
+ export declare const registerSmartCardEventsNext: (smartLinkEvents: SmartLinkEventsNext) => (tr: Transaction) => Transaction;
13
+ export declare const setProvider: (cardProvider: CardProvider | null) => (tr: Transaction) => Transaction;
14
+ export declare const setDatasourceTableRef: (datasourceTableRef?: HTMLElement) => (tr: Transaction) => Transaction;
15
+ export declare const setCardLayout: (layout: DatasourceTableLayout) => (tr: Transaction) => Transaction;
16
+ export declare const setCardLayoutAndDatasourceTableRef: ({ layout, datasourceTableRef, }: {
17
+ layout: DatasourceTableLayout;
18
+ datasourceTableRef?: HTMLElement | undefined;
19
+ }) => (tr: Transaction) => Transaction;
20
+ export declare const showLinkToolbar: (tr: Transaction) => Transaction;
21
+ export declare const hideLinkToolbar: (tr: Transaction) => Transaction;
22
+ export declare const showDatasourceModal: (modalType: DatasourceModalType) => (tr: Transaction) => Transaction;
23
+ export declare const hideDatasourceModal: (tr: Transaction) => Transaction;