@atlaskit/editor-common 134.12.0 → 134.13.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 (91) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/credit-guard/floating-toolbar-button/package.json +10 -0
  3. package/credit-guard/floating-toolbar-item/package.json +10 -0
  4. package/dist/cjs/credit-guard/CreditCheckedFloatingToolbarButton.js +114 -0
  5. package/dist/cjs/credit-guard/CreditCheckedPopup.js +1 -1
  6. package/dist/cjs/credit-guard/getCreditCheckedFloatingToolbarItem.js +30 -0
  7. package/dist/cjs/element-browser/components/ViewMore.js +1 -1
  8. package/dist/cjs/extensibility/Extension/Lozenge/ExtensionFloatingLabel.js +1 -1
  9. package/dist/cjs/extensibility/GeneratedContentReveal.js +1 -1
  10. package/dist/cjs/extensions/UnknownMacroPlaceholder.js +1 -1
  11. package/dist/cjs/icons/shared/PanelErrorIcon.js +1 -1
  12. package/dist/cjs/icons/shared/PanelInfoIcon.js +1 -1
  13. package/dist/cjs/icons/shared/PanelNoteIcon.js +1 -1
  14. package/dist/cjs/icons/shared/PanelSuccessIcon.js +1 -1
  15. package/dist/cjs/icons/shared/PanelWarningIcon.js +1 -1
  16. package/dist/cjs/monitoring/error.js +1 -1
  17. package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.js +1 -1
  18. package/dist/cjs/quick-insert/ElementBrowserQuickInsertMenuItem.js +1 -1
  19. package/dist/cjs/quick-insert/QuickInsertHoverPreview.js +1 -1
  20. package/dist/cjs/quick-insert/QuickInsertPreviewContent.js +1 -1
  21. package/dist/cjs/quick-insert/QuickInsertShortcut.js +1 -1
  22. package/dist/cjs/quick-insert/SkillTag.js +1 -1
  23. package/dist/cjs/table/NewSortingIcon.js +1 -1
  24. package/dist/cjs/ui/DropList/index.js +1 -1
  25. package/dist/cjs/ui/FloatingToolbar/Button.js +2 -0
  26. package/dist/cjs/ui/Shortcut/index.js +1 -1
  27. package/dist/cjs/ui/Toolbar/ButtonGroup.js +1 -1
  28. package/dist/cjs/ui/Toolbar/DropdownTriggerWrapper.js +1 -1
  29. package/dist/cjs/ui/Toolbar/DropdownWrapper.js +1 -1
  30. package/dist/cjs/ui/Toolbar/ExpandIcon.js +1 -1
  31. package/dist/cjs/ui/Toolbar/Separator.js +1 -1
  32. package/dist/es2019/credit-guard/CreditCheckedFloatingToolbarButton.js +102 -0
  33. package/dist/es2019/credit-guard/CreditCheckedPopup.js +1 -1
  34. package/dist/es2019/credit-guard/getCreditCheckedFloatingToolbarItem.js +21 -0
  35. package/dist/es2019/element-browser/components/ViewMore.js +1 -1
  36. package/dist/es2019/extensibility/Extension/Lozenge/ExtensionFloatingLabel.js +1 -1
  37. package/dist/es2019/extensibility/GeneratedContentReveal.js +1 -1
  38. package/dist/es2019/extensions/UnknownMacroPlaceholder.js +1 -1
  39. package/dist/es2019/icons/shared/PanelErrorIcon.js +1 -1
  40. package/dist/es2019/icons/shared/PanelInfoIcon.js +1 -1
  41. package/dist/es2019/icons/shared/PanelNoteIcon.js +1 -1
  42. package/dist/es2019/icons/shared/PanelSuccessIcon.js +1 -1
  43. package/dist/es2019/icons/shared/PanelWarningIcon.js +1 -1
  44. package/dist/es2019/monitoring/error.js +1 -1
  45. package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.js +1 -1
  46. package/dist/es2019/quick-insert/ElementBrowserQuickInsertMenuItem.js +1 -1
  47. package/dist/es2019/quick-insert/QuickInsertHoverPreview.js +1 -1
  48. package/dist/es2019/quick-insert/QuickInsertPreviewContent.js +1 -1
  49. package/dist/es2019/quick-insert/QuickInsertShortcut.js +1 -1
  50. package/dist/es2019/quick-insert/SkillTag.js +1 -1
  51. package/dist/es2019/table/NewSortingIcon.js +1 -1
  52. package/dist/es2019/ui/DropList/index.js +1 -1
  53. package/dist/es2019/ui/FloatingToolbar/Button.js +2 -0
  54. package/dist/es2019/ui/Shortcut/index.js +1 -1
  55. package/dist/es2019/ui/Toolbar/ButtonGroup.js +1 -1
  56. package/dist/es2019/ui/Toolbar/DropdownTriggerWrapper.js +1 -1
  57. package/dist/es2019/ui/Toolbar/DropdownWrapper.js +1 -1
  58. package/dist/es2019/ui/Toolbar/ExpandIcon.js +1 -1
  59. package/dist/es2019/ui/Toolbar/Separator.js +1 -1
  60. package/dist/esm/credit-guard/CreditCheckedFloatingToolbarButton.js +106 -0
  61. package/dist/esm/credit-guard/CreditCheckedPopup.js +1 -1
  62. package/dist/esm/credit-guard/getCreditCheckedFloatingToolbarItem.js +24 -0
  63. package/dist/esm/element-browser/components/ViewMore.js +1 -1
  64. package/dist/esm/extensibility/Extension/Lozenge/ExtensionFloatingLabel.js +1 -1
  65. package/dist/esm/extensibility/GeneratedContentReveal.js +1 -1
  66. package/dist/esm/extensions/UnknownMacroPlaceholder.js +1 -1
  67. package/dist/esm/icons/shared/PanelErrorIcon.js +1 -1
  68. package/dist/esm/icons/shared/PanelInfoIcon.js +1 -1
  69. package/dist/esm/icons/shared/PanelNoteIcon.js +1 -1
  70. package/dist/esm/icons/shared/PanelSuccessIcon.js +1 -1
  71. package/dist/esm/icons/shared/PanelWarningIcon.js +1 -1
  72. package/dist/esm/monitoring/error.js +1 -1
  73. package/dist/esm/quick-insert/CompactQuickInsertMenuItem.js +1 -1
  74. package/dist/esm/quick-insert/ElementBrowserQuickInsertMenuItem.js +1 -1
  75. package/dist/esm/quick-insert/QuickInsertHoverPreview.js +1 -1
  76. package/dist/esm/quick-insert/QuickInsertPreviewContent.js +1 -1
  77. package/dist/esm/quick-insert/QuickInsertShortcut.js +1 -1
  78. package/dist/esm/quick-insert/SkillTag.js +1 -1
  79. package/dist/esm/table/NewSortingIcon.js +1 -1
  80. package/dist/esm/ui/DropList/index.js +1 -1
  81. package/dist/esm/ui/FloatingToolbar/Button.js +2 -0
  82. package/dist/esm/ui/Shortcut/index.js +1 -1
  83. package/dist/esm/ui/Toolbar/ButtonGroup.js +1 -1
  84. package/dist/esm/ui/Toolbar/DropdownTriggerWrapper.js +1 -1
  85. package/dist/esm/ui/Toolbar/DropdownWrapper.js +1 -1
  86. package/dist/esm/ui/Toolbar/ExpandIcon.js +1 -1
  87. package/dist/esm/ui/Toolbar/Separator.js +1 -1
  88. package/dist/types/credit-guard/CreditCheckedFloatingToolbarButton.d.ts +26 -0
  89. package/dist/types/credit-guard/getCreditCheckedFloatingToolbarItem.d.ts +5 -0
  90. package/dist/types/ui/FloatingToolbar/Button.d.ts +1 -0
  91. package/package.json +6 -6
@@ -1,4 +1,4 @@
1
- /* QuickInsertPreviewContent.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* QuickInsertPreviewContent.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./QuickInsertPreviewContent.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useState } from 'react';
@@ -1,4 +1,4 @@
1
- /* QuickInsertShortcut.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* QuickInsertShortcut.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./QuickInsertShortcut.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* SkillTag.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* SkillTag.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./SkillTag.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* NewSortingIcon.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* NewSortingIcon.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./NewSortingIcon.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "134.11.2";
16
+ const packageVersion = "134.12.0";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -12,6 +12,7 @@ const FloatingToolbarButton = ({
12
12
  title,
13
13
  icon,
14
14
  iconAfter,
15
+ id,
15
16
  onClick,
16
17
  onKeyDown,
17
18
  onMouseEnter,
@@ -107,6 +108,7 @@ const FloatingToolbarButton = ({
107
108
  ...rest
108
109
  };
109
110
  },
111
+ id: id,
110
112
  "aria-label": ariaLabel || title,
111
113
  "aria-pressed": ariaPressed,
112
114
  "aria-checked": ariaChecked,
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* index.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./index.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* ButtonGroup.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* ButtonGroup.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./ButtonGroup.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* DropdownTriggerWrapper.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* DropdownTriggerWrapper.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./DropdownTriggerWrapper.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* DropdownWrapper.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* DropdownWrapper.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./DropdownWrapper.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* ExpandIcon.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* ExpandIcon.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./ExpandIcon.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* Separator.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* Separator.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./Separator.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -0,0 +1,106 @@
1
+ import React, { useCallback } from 'react';
2
+ import FloatingToolbarButtonComponent from '../ui/FloatingToolbar/Button';
3
+ import { CreditCheckedPopup } from './CreditCheckedPopup';
4
+
5
+ /**
6
+ * A confirm dialog needs the floating toolbar's own state, and a link would navigate before the
7
+ * credit check, so neither can be credit checked.
8
+ */
9
+
10
+ /**
11
+ * A floating toolbar button that checks AI credits before running its action, and anchors the
12
+ * product's credits popup to itself when credits are blocked. Matches the floating toolbar's own buttons.
13
+ */
14
+ export var CreditCheckedFloatingToolbarButton = function CreditCheckedFloatingToolbarButton(_ref) {
15
+ var areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled,
16
+ button = _ref.button,
17
+ creditCheck = _ref.creditCheck,
18
+ getAICreditStatus = _ref.getAICreditStatus,
19
+ view = _ref.view;
20
+ var runCommand = useCallback(function (command) {
21
+ if (view && command) {
22
+ command(view.state, view.dispatch, view);
23
+ }
24
+ }, [view]);
25
+ var focusEditoronEnter = button.focusEditoronEnter,
26
+ onClick = button.onClick;
27
+ var runAction = useCallback(function () {
28
+ runCommand(onClick);
29
+ if (focusEditoronEnter && !(view !== null && view !== void 0 && view.hasFocus())) {
30
+ view === null || view === void 0 || view.focus();
31
+ }
32
+ }, [runCommand, onClick, focusEditoronEnter, view]);
33
+ var renderTrigger = useCallback(function (triggerProps) {
34
+ var _button$disabled = button.disabled,
35
+ disabled = _button$disabled === void 0 ? false : _button$disabled,
36
+ showTitle = button.showTitle,
37
+ title = button.title;
38
+ var selected = Boolean(button.selected) || triggerProps.isSelected;
39
+ // Ignored via go/ees005
40
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
+ var ButtonIcon = button.icon;
42
+ var IconAfter = button.iconAfter;
43
+ return /*#__PURE__*/React.createElement(FloatingToolbarButtonComponent, {
44
+ ref: triggerProps.ref,
45
+ id: triggerProps.id
46
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides -- Matches the floating toolbar's own buttons
47
+ ,
48
+ className: button.className,
49
+ title: title,
50
+ ariaLabel: button.ariaLabel,
51
+ icon: ButtonIcon ? /*#__PURE__*/React.createElement(ButtonIcon, {
52
+ color: disabled ? "var(--ds-icon-disabled, #080F214A)" : selected ? "var(--ds-icon-selected, #1868DB)" : 'currentColor',
53
+ spacing: "spacious",
54
+ label: undefined,
55
+ "aria-hidden": true
56
+ }) : undefined,
57
+ iconAfter: IconAfter ? /*#__PURE__*/React.createElement(IconAfter, {
58
+ label: ""
59
+ }) : undefined,
60
+ appearance: button.appearance,
61
+ onClick: triggerProps.onClick
62
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Matches the floating toolbar's own buttons
63
+ ,
64
+ onMouseEnter: function onMouseEnter() {
65
+ return runCommand(button.onMouseEnter);
66
+ }
67
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Matches the floating toolbar's own buttons
68
+ ,
69
+ onMouseLeave: function onMouseLeave() {
70
+ return runCommand(button.onMouseLeave);
71
+ }
72
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Matches the floating toolbar's own buttons
73
+ ,
74
+ onFocus: function onFocus() {
75
+ return runCommand(button.onFocus);
76
+ }
77
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Matches the floating toolbar's own buttons
78
+ ,
79
+ onBlur: function onBlur() {
80
+ return runCommand(button.onBlur);
81
+ },
82
+ onMount: button.onMount,
83
+ onUnmount: button.onUnmount,
84
+ selected: selected,
85
+ disabled: disabled,
86
+ tooltipContent: button.tooltipContent,
87
+ hideTooltipOnClick: button.hideTooltipOnClick,
88
+ hasNewContentOnTriggerClick: button.hasNewContentOnTriggerClick,
89
+ ariaHasPopup: triggerProps['aria-haspopup'],
90
+ areaControls: triggerProps['aria-controls'],
91
+ tabIndex: button.tabIndex,
92
+ isRadioButton: button.isRadioButton,
93
+ pulse: button.pulse,
94
+ testId: button.testId,
95
+ interactionName: button.interactionName,
96
+ areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
97
+ }, showTitle && title);
98
+ }, [areAnyNewToolbarFlagsEnabled, button, runCommand]);
99
+ return /*#__PURE__*/React.createElement(CreditCheckedPopup, {
100
+ creditCheck: creditCheck,
101
+ getAICreditStatus: getAICreditStatus,
102
+ onAllowed: runAction,
103
+ placement: "bottom-start",
104
+ renderTrigger: renderTrigger
105
+ });
106
+ };
@@ -1,4 +1,4 @@
1
- /* CreditCheckedPopup.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* CreditCheckedPopup.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import "./CreditCheckedPopup.compiled.css";
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { CreditCheckedFloatingToolbarButton } from './CreditCheckedFloatingToolbarButton';
3
+
4
+ /** Wraps a floating toolbar button so it is credit checked, keeping its own appearance and handlers. */
5
+ export var getCreditCheckedFloatingToolbarItem = function getCreditCheckedFloatingToolbarItem(_ref) {
6
+ var areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled,
7
+ button = _ref.button,
8
+ creditCheck = _ref.creditCheck,
9
+ getAICreditStatus = _ref.getAICreditStatus;
10
+ return {
11
+ type: 'custom',
12
+ fallback: [],
13
+ render: function render(view, idx) {
14
+ return /*#__PURE__*/React.createElement(CreditCheckedFloatingToolbarButton, {
15
+ key: idx,
16
+ areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled,
17
+ button: button,
18
+ creditCheck: creditCheck,
19
+ getAICreditStatus: getAICreditStatus,
20
+ view: view
21
+ });
22
+ }
23
+ };
24
+ };
@@ -1,4 +1,4 @@
1
- /* ViewMore.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* ViewMore.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./ViewMore.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* ExtensionFloatingLabel.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* ExtensionFloatingLabel.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./ExtensionFloatingLabel.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* GeneratedContentReveal.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* GeneratedContentReveal.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import "./GeneratedContentReveal.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* UnknownMacroPlaceholder.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* UnknownMacroPlaceholder.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import "./UnknownMacroPlaceholder.compiled.css";
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- /* PanelErrorIcon.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* PanelErrorIcon.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./PanelErrorIcon.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* PanelInfoIcon.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* PanelInfoIcon.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./PanelInfoIcon.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* PanelNoteIcon.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* PanelNoteIcon.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./PanelNoteIcon.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* PanelSuccessIcon.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* PanelSuccessIcon.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./PanelSuccessIcon.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* PanelWarningIcon.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* PanelWarningIcon.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./PanelWarningIcon.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
19
19
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "134.11.2";
22
+ var packageVersion = "134.12.0";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -1,4 +1,4 @@
1
- /* CompactQuickInsertMenuItem.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* CompactQuickInsertMenuItem.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import "./CompactQuickInsertMenuItem.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* ElementBrowserQuickInsertMenuItem.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* ElementBrowserQuickInsertMenuItem.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./ElementBrowserQuickInsertMenuItem.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useId, useMemo } from 'react';
@@ -1,4 +1,4 @@
1
- /* QuickInsertHoverPreview.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* QuickInsertHoverPreview.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import "./QuickInsertHoverPreview.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* QuickInsertPreviewContent.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* QuickInsertPreviewContent.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import "./QuickInsertPreviewContent.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* QuickInsertShortcut.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* QuickInsertShortcut.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./QuickInsertShortcut.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* SkillTag.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* SkillTag.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./SkillTag.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* NewSortingIcon.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* NewSortingIcon.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./NewSortingIcon.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "134.11.2";
23
+ var packageVersion = "134.12.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -18,6 +18,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
18
18
  var title = _ref.title,
19
19
  icon = _ref.icon,
20
20
  iconAfter = _ref.iconAfter,
21
+ id = _ref.id,
21
22
  onClick = _ref.onClick,
22
23
  onKeyDown = _ref.onKeyDown,
23
24
  onMouseEnter = _ref.onMouseEnter,
@@ -109,6 +110,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
109
110
  })), areAnyNewToolbarFlagsEnabled ? customSizeAndPadding : {})
110
111
  }, rest);
111
112
  },
113
+ id: id,
112
114
  "aria-label": ariaLabel || title,
113
115
  "aria-pressed": ariaPressed,
114
116
  "aria-checked": ariaChecked,
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* index.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./index.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* ButtonGroup.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* ButtonGroup.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./ButtonGroup.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* DropdownTriggerWrapper.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* DropdownTriggerWrapper.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./DropdownTriggerWrapper.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* DropdownWrapper.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* DropdownWrapper.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./DropdownWrapper.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* ExpandIcon.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* ExpandIcon.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./ExpandIcon.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* Separator.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* Separator.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./Separator.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ import type { Command } from '../types/command';
4
+ import type { FloatingToolbarButton } from '../types/floating-toolbar';
5
+ import type { AICreditCheck, GetAICreditStatus } from './types';
6
+ /**
7
+ * A confirm dialog needs the floating toolbar's own state, and a link would navigate before the
8
+ * credit check, so neither can be credit checked.
9
+ */
10
+ type UnsupportedButtonProps = 'confirmDialog' | 'href' | 'target';
11
+ export type CreditCheckableFloatingToolbarButton = Omit<FloatingToolbarButton<Command>, UnsupportedButtonProps> & {
12
+ [Prop in UnsupportedButtonProps]?: never;
13
+ };
14
+ export type CreditCheckedFloatingToolbarButtonProps = {
15
+ areAnyNewToolbarFlagsEnabled: boolean;
16
+ button: CreditCheckableFloatingToolbarButton;
17
+ creditCheck: AICreditCheck;
18
+ getAICreditStatus: GetAICreditStatus;
19
+ view?: EditorView;
20
+ };
21
+ /**
22
+ * A floating toolbar button that checks AI credits before running its action, and anchors the
23
+ * product's credits popup to itself when credits are blocked. Matches the floating toolbar's own buttons.
24
+ */
25
+ export declare const CreditCheckedFloatingToolbarButton: ({ areAnyNewToolbarFlagsEnabled, button, creditCheck, getAICreditStatus, view, }: CreditCheckedFloatingToolbarButtonProps) => React.JSX.Element;
26
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { Command } from '../types/command';
2
+ import type { FloatingToolbarCustom } from '../types/floating-toolbar';
3
+ import { type CreditCheckedFloatingToolbarButtonProps } from './CreditCheckedFloatingToolbarButton';
4
+ /** Wraps a floating toolbar button so it is credit checked, keeping its own appearance and handlers. */
5
+ export declare const getCreditCheckedFloatingToolbarItem: ({ areAnyNewToolbarFlagsEnabled, button, creditCheck, getAICreditStatus, }: Omit<CreditCheckedFloatingToolbarButtonProps, 'view'>) => FloatingToolbarCustom<Command>;
@@ -16,6 +16,7 @@ export interface Props {
16
16
  href?: string;
17
17
  icon?: React.ReactElement<any>;
18
18
  iconAfter?: React.ReactElement<any>;
19
+ id?: string;
19
20
  interactionName?: string;
20
21
  isLoading?: boolean;
21
22
  isRadioButton?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "134.12.0",
3
+ "version": "134.13.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/activity-provider": "^3.1.0",
32
32
  "@atlaskit/adf-schema": "^57.7.0",
33
33
  "@atlaskit/adf-utils": "^20.9.0",
34
- "@atlaskit/afm-i18n-platform-editor-editor-common": "2.305.0",
34
+ "@atlaskit/afm-i18n-platform-editor-editor-common": "2.306.0",
35
35
  "@atlaskit/analytics-listeners": "^11.4.0",
36
36
  "@atlaskit/analytics-namespaced-context": "^8.2.0",
37
37
  "@atlaskit/analytics-next": "^12.6.0",
@@ -50,7 +50,7 @@
50
50
  "@atlaskit/editor-toolbar": "^2.10.0",
51
51
  "@atlaskit/editor-toolbar-model": "^1.2.0",
52
52
  "@atlaskit/editor-ui-control-model": "^3.0.0",
53
- "@atlaskit/emoji": "^73.5.0",
53
+ "@atlaskit/emoji": "^73.6.0",
54
54
  "@atlaskit/feature-gate-js-client": "^8.0.0",
55
55
  "@atlaskit/icon": "^38.0.0",
56
56
  "@atlaskit/link": "^5.1.0",
@@ -63,9 +63,9 @@
63
63
  "@atlaskit/media-common": "^14.7.0",
64
64
  "@atlaskit/media-file-preview": "^2.0.0",
65
65
  "@atlaskit/media-picker": "^73.3.0",
66
- "@atlaskit/media-ui": "^31.8.0",
66
+ "@atlaskit/media-ui": "^31.9.0",
67
67
  "@atlaskit/media-viewer": "^54.12.0",
68
- "@atlaskit/mention": "^30.8.0",
68
+ "@atlaskit/mention": "^30.9.0",
69
69
  "@atlaskit/menu": "^11.0.0",
70
70
  "@atlaskit/object": "^2.3.0",
71
71
  "@atlaskit/onboarding": "^15.4.0",
@@ -83,7 +83,7 @@
83
83
  "@atlaskit/smart-card": "^46.13.0",
84
84
  "@atlaskit/smart-user-picker": "^12.11.0",
85
85
  "@atlaskit/spinner": "^20.4.0",
86
- "@atlaskit/task-decision": "^21.15.0",
86
+ "@atlaskit/task-decision": "^21.16.0",
87
87
  "@atlaskit/teams-app-config": "^3.1.0",
88
88
  "@atlaskit/textfield": "^10.3.0",
89
89
  "@atlaskit/tmp-editor-statsig": "^260.0.0",