@atlaskit/editor-plugin-extension 33.1.0 → 33.1.1
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 +9 -0
- package/dist/cjs/ui/ConfigPanel/Fields/Boolean.js +19 -1
- package/dist/cjs/ui/ConfigPanel/FormContent.js +1 -0
- package/dist/es2019/ui/ConfigPanel/Fields/Boolean.js +20 -2
- package/dist/es2019/ui/ConfigPanel/FormContent.js +1 -0
- package/dist/esm/ui/ConfigPanel/Fields/Boolean.js +20 -2
- package/dist/esm/ui/ConfigPanel/FormContent.js +1 -0
- package/dist/types/ui/ConfigPanel/Fields/Boolean.d.ts +3 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-extension
|
|
2
2
|
|
|
3
|
+
## 33.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`57ad371c701cd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/57ad371c701cd) -
|
|
8
|
+
Behind `platform_editor_config_panel_field_analytics`, tag the ConfigPanel's `checkbox changed`
|
|
9
|
+
analytics event with the field name and the extension key and type.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 33.1.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -12,6 +12,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
13
|
var _checkbox = require("@atlaskit/checkbox/checkbox");
|
|
14
14
|
var _field = _interopRequireDefault(require("@atlaskit/form/field"));
|
|
15
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
15
16
|
var _text = require("@atlaskit/primitives/compiled/text");
|
|
16
17
|
var _toggle = _interopRequireDefault(require("@atlaskit/toggle/toggle"));
|
|
17
18
|
var _FieldMessages = _interopRequireDefault(require("../FieldMessages"));
|
|
@@ -57,6 +58,7 @@ function handleOnChange(onChange, onFieldChange, event) {
|
|
|
57
58
|
function Checkbox(_ref) {
|
|
58
59
|
var name = _ref.name,
|
|
59
60
|
field = _ref.field,
|
|
61
|
+
extensionManifest = _ref.extensionManifest,
|
|
60
62
|
onFieldChange = _ref.onFieldChange;
|
|
61
63
|
var label = field.label,
|
|
62
64
|
description = field.description,
|
|
@@ -65,6 +67,19 @@ function Checkbox(_ref) {
|
|
|
65
67
|
_field$defaultValue = field.defaultValue,
|
|
66
68
|
defaultValue = _field$defaultValue === void 0 ? false : _field$defaultValue,
|
|
67
69
|
isDisabled = field.isDisabled;
|
|
70
|
+
var extensionKey = extensionManifest.key,
|
|
71
|
+
extensionType = extensionManifest.type;
|
|
72
|
+
// Without this, the checkbox's `checkbox changed` event has only `source: 'ConfigPanel'`, so it
|
|
73
|
+
// cannot say which field of which extension changed.
|
|
74
|
+
var analyticsContext = (0, _react.useMemo)(function () {
|
|
75
|
+
return (0, _fg.fg)('platform_editor_config_panel_field_analytics') ? {
|
|
76
|
+
attributes: {
|
|
77
|
+
fieldName: name,
|
|
78
|
+
extensionKey: extensionKey,
|
|
79
|
+
extensionType: extensionType
|
|
80
|
+
}
|
|
81
|
+
} : undefined;
|
|
82
|
+
}, [name, extensionKey, extensionType]);
|
|
68
83
|
return (0, _react2.jsx)(_field.default, {
|
|
69
84
|
name: name,
|
|
70
85
|
isRequired: isRequired
|
|
@@ -84,7 +99,8 @@ function Checkbox(_ref) {
|
|
|
84
99
|
// Ignored via go/ees005
|
|
85
100
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
86
101
|
, (0, _extends2.default)({}, restFieldProps, {
|
|
87
|
-
label: label
|
|
102
|
+
label: label,
|
|
103
|
+
analyticsContext: analyticsContext
|
|
88
104
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
89
105
|
,
|
|
90
106
|
onChange: function onChange(event) {
|
|
@@ -154,6 +170,7 @@ function Toggle(_ref3) {
|
|
|
154
170
|
function Boolean(_ref5) {
|
|
155
171
|
var name = _ref5.name,
|
|
156
172
|
field = _ref5.field,
|
|
173
|
+
extensionManifest = _ref5.extensionManifest,
|
|
157
174
|
onFieldChange = _ref5.onFieldChange;
|
|
158
175
|
if (field.style === 'toggle') {
|
|
159
176
|
return (0, _react2.jsx)(Toggle, {
|
|
@@ -165,6 +182,7 @@ function Boolean(_ref5) {
|
|
|
165
182
|
return (0, _react2.jsx)(Checkbox, {
|
|
166
183
|
name: name,
|
|
167
184
|
field: field,
|
|
185
|
+
extensionManifest: extensionManifest,
|
|
168
186
|
onFieldChange: onFieldChange
|
|
169
187
|
});
|
|
170
188
|
}
|
|
@@ -3,12 +3,13 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
* @jsxRuntime classic
|
|
4
4
|
* @jsx jsx
|
|
5
5
|
*/
|
|
6
|
-
import React, { Fragment } from 'react';
|
|
6
|
+
import React, { Fragment, useMemo } from 'react';
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { Checkbox as AKCheckbox } from '@atlaskit/checkbox/checkbox';
|
|
11
11
|
import Field from '@atlaskit/form/field';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
12
13
|
import { Text } from '@atlaskit/primitives/compiled/text';
|
|
13
14
|
import AKToggle from '@atlaskit/toggle/toggle';
|
|
14
15
|
import FieldMessages from '../FieldMessages';
|
|
@@ -46,6 +47,7 @@ function handleOnChange(onChange, onFieldChange, event) {
|
|
|
46
47
|
function Checkbox({
|
|
47
48
|
name,
|
|
48
49
|
field,
|
|
50
|
+
extensionManifest,
|
|
49
51
|
onFieldChange
|
|
50
52
|
}) {
|
|
51
53
|
const {
|
|
@@ -55,6 +57,19 @@ function Checkbox({
|
|
|
55
57
|
defaultValue = false,
|
|
56
58
|
isDisabled
|
|
57
59
|
} = field;
|
|
60
|
+
const {
|
|
61
|
+
key: extensionKey,
|
|
62
|
+
type: extensionType
|
|
63
|
+
} = extensionManifest;
|
|
64
|
+
// Without this, the checkbox's `checkbox changed` event has only `source: 'ConfigPanel'`, so it
|
|
65
|
+
// cannot say which field of which extension changed.
|
|
66
|
+
const analyticsContext = useMemo(() => fg('platform_editor_config_panel_field_analytics') ? {
|
|
67
|
+
attributes: {
|
|
68
|
+
fieldName: name,
|
|
69
|
+
extensionKey,
|
|
70
|
+
extensionType
|
|
71
|
+
}
|
|
72
|
+
} : undefined, [name, extensionKey, extensionType]);
|
|
58
73
|
return jsx(Field, {
|
|
59
74
|
name: name,
|
|
60
75
|
isRequired: isRequired
|
|
@@ -75,7 +90,8 @@ function Checkbox({
|
|
|
75
90
|
// Ignored via go/ees005
|
|
76
91
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
77
92
|
, _extends({}, restFieldProps, {
|
|
78
|
-
label: label
|
|
93
|
+
label: label,
|
|
94
|
+
analyticsContext: analyticsContext
|
|
79
95
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
80
96
|
,
|
|
81
97
|
onChange: event => handleOnChange(fieldProps.onChange, onFieldChange, event),
|
|
@@ -143,6 +159,7 @@ function Toggle({
|
|
|
143
159
|
export default function Boolean({
|
|
144
160
|
name,
|
|
145
161
|
field,
|
|
162
|
+
extensionManifest,
|
|
146
163
|
onFieldChange
|
|
147
164
|
}) {
|
|
148
165
|
if (field.style === 'toggle') {
|
|
@@ -155,6 +172,7 @@ export default function Boolean({
|
|
|
155
172
|
return jsx(Checkbox, {
|
|
156
173
|
name: name,
|
|
157
174
|
field: field,
|
|
175
|
+
extensionManifest: extensionManifest,
|
|
158
176
|
onFieldChange: onFieldChange
|
|
159
177
|
});
|
|
160
178
|
}
|
|
@@ -6,12 +6,13 @@ var _excluded = ["value"],
|
|
|
6
6
|
* @jsxRuntime classic
|
|
7
7
|
* @jsx jsx
|
|
8
8
|
*/
|
|
9
|
-
import React, { Fragment } from 'react';
|
|
9
|
+
import React, { Fragment, useMemo } from 'react';
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
12
12
|
import { css, jsx } from '@emotion/react';
|
|
13
13
|
import { Checkbox as AKCheckbox } from '@atlaskit/checkbox/checkbox';
|
|
14
14
|
import Field from '@atlaskit/form/field';
|
|
15
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
15
16
|
import { Text } from '@atlaskit/primitives/compiled/text';
|
|
16
17
|
import AKToggle from '@atlaskit/toggle/toggle';
|
|
17
18
|
import FieldMessages from '../FieldMessages';
|
|
@@ -49,6 +50,7 @@ function handleOnChange(onChange, onFieldChange, event) {
|
|
|
49
50
|
function Checkbox(_ref) {
|
|
50
51
|
var name = _ref.name,
|
|
51
52
|
field = _ref.field,
|
|
53
|
+
extensionManifest = _ref.extensionManifest,
|
|
52
54
|
onFieldChange = _ref.onFieldChange;
|
|
53
55
|
var label = field.label,
|
|
54
56
|
description = field.description,
|
|
@@ -57,6 +59,19 @@ function Checkbox(_ref) {
|
|
|
57
59
|
_field$defaultValue = field.defaultValue,
|
|
58
60
|
defaultValue = _field$defaultValue === void 0 ? false : _field$defaultValue,
|
|
59
61
|
isDisabled = field.isDisabled;
|
|
62
|
+
var extensionKey = extensionManifest.key,
|
|
63
|
+
extensionType = extensionManifest.type;
|
|
64
|
+
// Without this, the checkbox's `checkbox changed` event has only `source: 'ConfigPanel'`, so it
|
|
65
|
+
// cannot say which field of which extension changed.
|
|
66
|
+
var analyticsContext = useMemo(function () {
|
|
67
|
+
return fg('platform_editor_config_panel_field_analytics') ? {
|
|
68
|
+
attributes: {
|
|
69
|
+
fieldName: name,
|
|
70
|
+
extensionKey: extensionKey,
|
|
71
|
+
extensionType: extensionType
|
|
72
|
+
}
|
|
73
|
+
} : undefined;
|
|
74
|
+
}, [name, extensionKey, extensionType]);
|
|
60
75
|
return jsx(Field, {
|
|
61
76
|
name: name,
|
|
62
77
|
isRequired: isRequired
|
|
@@ -76,7 +91,8 @@ function Checkbox(_ref) {
|
|
|
76
91
|
// Ignored via go/ees005
|
|
77
92
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
78
93
|
, _extends({}, restFieldProps, {
|
|
79
|
-
label: label
|
|
94
|
+
label: label,
|
|
95
|
+
analyticsContext: analyticsContext
|
|
80
96
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
81
97
|
,
|
|
82
98
|
onChange: function onChange(event) {
|
|
@@ -146,6 +162,7 @@ function Toggle(_ref3) {
|
|
|
146
162
|
export default function Boolean(_ref5) {
|
|
147
163
|
var name = _ref5.name,
|
|
148
164
|
field = _ref5.field,
|
|
165
|
+
extensionManifest = _ref5.extensionManifest,
|
|
149
166
|
onFieldChange = _ref5.onFieldChange;
|
|
150
167
|
if (field.style === 'toggle') {
|
|
151
168
|
return jsx(Toggle, {
|
|
@@ -157,6 +174,7 @@ export default function Boolean(_ref5) {
|
|
|
157
174
|
return jsx(Checkbox, {
|
|
158
175
|
name: name,
|
|
159
176
|
field: field,
|
|
177
|
+
extensionManifest: extensionManifest,
|
|
160
178
|
onFieldChange: onFieldChange
|
|
161
179
|
});
|
|
162
180
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
|
+
import type { ExtensionManifest } from '@atlaskit/editor-common/extensions/extension-manifest';
|
|
2
3
|
import type { BooleanField } from '@atlaskit/editor-common/extensions/field-definitions';
|
|
3
4
|
import type { OnFieldChange } from '../types';
|
|
4
|
-
export default function Boolean({ name, field, onFieldChange, }: {
|
|
5
|
+
export default function Boolean({ name, field, extensionManifest, onFieldChange, }: {
|
|
6
|
+
extensionManifest: ExtensionManifest;
|
|
5
7
|
field: BooleanField;
|
|
6
8
|
name: string;
|
|
7
9
|
onFieldChange: OnFieldChange;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-extension",
|
|
3
|
-
"version": "33.1.
|
|
3
|
+
"version": "33.1.1",
|
|
4
4
|
"description": "editor-plugin-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/empty-state": "^12.2.0",
|
|
54
54
|
"@atlaskit/form": "^18.3.0",
|
|
55
55
|
"@atlaskit/heading": "^8.0.0",
|
|
56
|
-
"@atlaskit/icon": "^38.
|
|
56
|
+
"@atlaskit/icon": "^38.1.0",
|
|
57
57
|
"@atlaskit/link": "^5.1.0",
|
|
58
58
|
"@atlaskit/mention": "^30.9.0",
|
|
59
59
|
"@atlaskit/menu": "^11.0.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@atlaskit/primitives": "^22.7.0",
|
|
63
63
|
"@atlaskit/radio": "^10.2.0",
|
|
64
64
|
"@atlaskit/react-select": "^4.12.0",
|
|
65
|
-
"@atlaskit/section-message": "^10.
|
|
65
|
+
"@atlaskit/section-message": "^10.3.0",
|
|
66
66
|
"@atlaskit/select": "^23.2.0",
|
|
67
67
|
"@atlaskit/smart-user-picker": "^12.12.0",
|
|
68
68
|
"@atlaskit/spinner": "^20.4.0",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@atlaskit/textfield": "^10.3.0",
|
|
72
72
|
"@atlaskit/tmp-editor-statsig": "^262.0.0",
|
|
73
73
|
"@atlaskit/toggle": "^17.3.0",
|
|
74
|
-
"@atlaskit/tokens": "^20.
|
|
74
|
+
"@atlaskit/tokens": "^20.12.0",
|
|
75
75
|
"@atlaskit/tooltip": "^24.4.0",
|
|
76
76
|
"@atlaskit/user-picker": "^14.8.0",
|
|
77
77
|
"@babel/runtime": "^7.0.0",
|
|
@@ -85,12 +85,12 @@
|
|
|
85
85
|
"uuid": "^11.1.1"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@atlaskit/editor-common": "^134.
|
|
88
|
+
"@atlaskit/editor-common": "^134.19.0",
|
|
89
89
|
"react": "^18.2.0 || ^19.2.0",
|
|
90
90
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@atlaskit/editor-common": "^134.
|
|
93
|
+
"@atlaskit/editor-common": "^134.19.0",
|
|
94
94
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
95
95
|
"@atlassian/workbench": "workspace:*",
|
|
96
96
|
"react": "^19.2.0",
|