@atlaskit/editor-plugin-analytics 0.1.7 → 0.2.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 +10 -0
- package/README.md +25 -2
- package/dist/cjs/analytics-api/map-attributes.js +2 -2
- package/dist/cjs/plugin.js +6 -2
- package/dist/cjs/undo-redo-input-source.js +2 -2
- package/dist/es2019/plugin.js +4 -0
- package/dist/esm/analytics-api/map-attributes.js +2 -2
- package/dist/esm/plugin.js +6 -2
- package/dist/esm/undo-redo-input-source.js +2 -2
- package/dist/types/plugin.d.ts +4 -0
- package/dist/types-ts4.5/plugin.d.ts +4 -0
- package/package.json +4 -4
- package/report.api.md +1 -1
- package/tmp/api-report-tmp.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-analytics
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`ad3c5c21079`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ad3c5c21079) - Updating all plugins with minor version to correct issue with semver.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 0.1.7
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Editor plugin analytics
|
|
2
2
|
|
|
3
3
|
Analytics plugin for @atlaskit/editor-core
|
|
4
4
|
|
|
5
|
+
**Note:** This component is designed for internal Atlassian development.
|
|
6
|
+
External contributors will be able to use this component but will not be able to submit issues.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
---
|
|
10
|
+
- **Install** - *yarn add @atlaskit/editor-plugin-analytics*
|
|
11
|
+
- **npm** - [@atlaskit/editor-plugin-analytics](https://www.npmjs.com/package/@atlaskit/editor-plugin-analytics)
|
|
12
|
+
- **Source** - [Bitbucket](https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/editor/editor-plugin-analytics)
|
|
13
|
+
- **Bundle** - [unpkg.com](https://unpkg.com/@atlaskit/editor-plugin-analytics/dist/)
|
|
14
|
+
|
|
5
15
|
## Usage
|
|
16
|
+
---
|
|
17
|
+
**Internal use only**
|
|
18
|
+
|
|
19
|
+
@atlaskit/editor-plugin-analytics is intended for internal use by the @atlaskit/editor-core and as a plugin dependency of the Editor within your product.
|
|
20
|
+
|
|
21
|
+
Direct use of this component is not supported.
|
|
22
|
+
|
|
23
|
+
Please see [Atlaskit - Editor plugin analytics](https://atlaskit.atlassian.com/packages/editor/editor-plugin-analytics) for documentation and examples for this package.
|
|
6
24
|
|
|
7
|
-
|
|
25
|
+
## Support
|
|
26
|
+
---
|
|
27
|
+
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
|
|
28
|
+
## License
|
|
29
|
+
---
|
|
30
|
+
Please see [Atlassian Frontend - License](https://developer.atlassian.com/cloud/framework/atlassian-frontend/#license) for more licensing information.
|
|
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.mapActionSubjectIdToAttributes = mapActionSubjectIdToAttributes;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
|
-
function ownKeys(
|
|
11
|
-
function _objectSpread(
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
12
|
function mapActionSubjectIdToAttributes(payload) {
|
|
13
13
|
var documentInserted = payload.action === _analytics.ACTION.INSERTED && payload.actionSubject === _analytics.ACTION_SUBJECT.DOCUMENT;
|
|
14
14
|
var textFormatted = payload.action === _analytics.ACTION.FORMATTED && payload.actionSubject === _analytics.ACTION_SUBJECT.TEXT;
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -21,8 +21,8 @@ var _undoRedoInputSource = require("./undo-redo-input-source");
|
|
|
21
21
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
22
22
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
23
23
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
24
|
-
function ownKeys(
|
|
25
|
-
function _objectSpread(
|
|
24
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
26
|
function createPlugin(options, featureFlags) {
|
|
27
27
|
if (!options) {
|
|
28
28
|
return;
|
|
@@ -95,6 +95,10 @@ function createPlugin(options, featureFlags) {
|
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Analytics plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
100
|
+
* from `@atlaskit/editor-core`.
|
|
101
|
+
*/
|
|
98
102
|
var analyticsPlugin = function analyticsPlugin(_ref3) {
|
|
99
103
|
var _api$featureFlags;
|
|
100
104
|
var _ref3$config = _ref3.config,
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.generateUndoRedoInputSoucePayload = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
function ownKeys(
|
|
10
|
-
function _objectSpread(
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
11
|
var getUndoRedoInputSource = function getUndoRedoInputSource(tr) {
|
|
12
12
|
var _tr$getMeta;
|
|
13
13
|
// TODO: Please, do not copy or use this kind of code below
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -73,6 +73,10 @@ function createPlugin(options, featureFlags) {
|
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Analytics plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
78
|
+
* from `@atlaskit/editor-core`.
|
|
79
|
+
*/
|
|
76
80
|
const analyticsPlugin = ({
|
|
77
81
|
config: options = {},
|
|
78
82
|
api
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
export function mapActionSubjectIdToAttributes(payload) {
|
|
6
6
|
var documentInserted = payload.action === ACTION.INSERTED && payload.actionSubject === ACTION_SUBJECT.DOCUMENT;
|
package/dist/esm/plugin.js
CHANGED
|
@@ -3,8 +3,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
4
4
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
5
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
|
-
function ownKeys(
|
|
7
|
-
function _objectSpread(
|
|
6
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
import { useLayoutEffect } from 'react';
|
|
9
9
|
import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
|
|
10
10
|
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
@@ -87,6 +87,10 @@ function createPlugin(options, featureFlags) {
|
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Analytics plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
92
|
+
* from `@atlaskit/editor-core`.
|
|
93
|
+
*/
|
|
90
94
|
var analyticsPlugin = function analyticsPlugin(_ref3) {
|
|
91
95
|
var _api$featureFlags;
|
|
92
96
|
var _ref3$config = _ref3.config,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
var getUndoRedoInputSource = function getUndoRedoInputSource(tr) {
|
|
5
5
|
var _tr$getMeta;
|
|
6
6
|
// TODO: Please, do not copy or use this kind of code below
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -16,6 +16,10 @@ export type AnalyticsPlugin = NextEditorPlugin<'analytics', {
|
|
|
16
16
|
dependencies: [FeatureFlagsPlugin];
|
|
17
17
|
actions: EditorAnalyticsAPI;
|
|
18
18
|
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Analytics plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
21
|
+
* from `@atlaskit/editor-core`.
|
|
22
|
+
*/
|
|
19
23
|
declare const analyticsPlugin: AnalyticsPlugin;
|
|
20
24
|
export declare function extendPayload({ payload, duration, distortedDuration, }: {
|
|
21
25
|
payload: AnalyticsEventPayload;
|
|
@@ -18,6 +18,10 @@ export type AnalyticsPlugin = NextEditorPlugin<'analytics', {
|
|
|
18
18
|
];
|
|
19
19
|
actions: EditorAnalyticsAPI;
|
|
20
20
|
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Analytics plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
23
|
+
* from `@atlaskit/editor-core`.
|
|
24
|
+
*/
|
|
21
25
|
declare const analyticsPlugin: AnalyticsPlugin;
|
|
22
26
|
export declare function extendPayload({ payload, duration, distortedDuration, }: {
|
|
23
27
|
payload: AnalyticsEventPayload;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-analytics",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Analytics plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"registry": "https://registry.npmjs.org/"
|
|
9
9
|
},
|
|
10
10
|
"atlassian": {
|
|
11
|
-
"team": "Editor",
|
|
11
|
+
"team": "Editor: Lego",
|
|
12
12
|
"singleton": true,
|
|
13
13
|
"releaseModel": "continuous"
|
|
14
14
|
},
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@atlaskit/adf-schema": "28.1.2",
|
|
35
35
|
"@atlaskit/analytics-listeners": "^8.6.0",
|
|
36
36
|
"@atlaskit/analytics-next": "^9.0.0",
|
|
37
|
-
"@atlaskit/editor-common": "^74.
|
|
38
|
-
"@atlaskit/editor-plugin-feature-flags": "^0.
|
|
37
|
+
"@atlaskit/editor-common": "^74.55.0",
|
|
38
|
+
"@atlaskit/editor-plugin-feature-flags": "^0.2.0",
|
|
39
39
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
40
40
|
"@atlaskit/editor-tables": "^2.2.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0"
|
package/report.api.md
CHANGED
package/tmp/api-report-tmp.d.ts
CHANGED