@atlaskit/editor-plugin-metrics 12.0.15 → 12.0.16

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 (31) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/metrics-plugin/package.json +1 -8
  3. package/metrics-plugin-type/package.json +1 -8
  4. package/metrics-state-type/package.json +1 -8
  5. package/package.json +2 -2
  6. package/dist/types-ts4.5/entry-points/metrics-plugin-type.d.ts +0 -1
  7. package/dist/types-ts4.5/entry-points/metrics-plugin.d.ts +0 -1
  8. package/dist/types-ts4.5/entry-points/metrics-state-type.d.ts +0 -1
  9. package/dist/types-ts4.5/index.d.ts +0 -3
  10. package/dist/types-ts4.5/metricsPlugin.d.ts +0 -6
  11. package/dist/types-ts4.5/metricsPluginType.d.ts +0 -28
  12. package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -34
  13. package/dist/types-ts4.5/pm-plugins/utils/active-session-timer.d.ts +0 -9
  14. package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +0 -8
  15. package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/check-tr-action-type.d.ts +0 -3
  16. package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-content-moved.d.ts +0 -4
  17. package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-deleting-content.d.ts +0 -4
  18. package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-empty-line-added-or-deleted.d.ts +0 -4
  19. package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-list-type-node-changed.d.ts +0 -4
  20. package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-mark-changed.d.ts +0 -3
  21. package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-node-attribute-changed.d.ts +0 -4
  22. package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-status-changed.d.ts +0 -3
  23. package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-table-column-resized.d.ts +0 -3
  24. package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-text-input.d.ts +0 -4
  25. package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/types.d.ts +0 -44
  26. package/dist/types-ts4.5/pm-plugins/utils/get-new-plugin-state.d.ts +0 -58
  27. package/dist/types-ts4.5/pm-plugins/utils/get-node-changes.d.ts +0 -6
  28. package/dist/types-ts4.5/pm-plugins/utils/is-non-text-undo.d.ts +0 -2
  29. package/dist/types-ts4.5/pm-plugins/utils/is-safe-insert.d.ts +0 -3
  30. package/dist/types-ts4.5/pm-plugins/utils/is-tr-with-doc-changes.d.ts +0 -2
  31. package/dist/types-ts4.5/pm-plugins/utils/should-skip-tr.d.ts +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-metrics
2
2
 
3
+ ## 12.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 12.0.15
4
10
 
5
11
  ### Patch Changes
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/metrics-plugin.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/metrics-plugin.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/metrics-plugin.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/metrics-plugin.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/metrics-plugin.d.ts"
15
8
  }
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/metrics-plugin-type.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/metrics-plugin-type.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/metrics-plugin-type.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/metrics-plugin-type.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/metrics-plugin-type.d.ts"
15
8
  }
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/metrics-state-type.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/metrics-state-type.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/metrics-state-type.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/metrics-state-type.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/metrics-state-type.d.ts"
15
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-metrics",
3
- "version": "12.0.15",
3
+ "version": "12.0.16",
4
4
  "description": "Metrics plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  "@atlaskit/editor-plugin-user-preferences": "^9.0.0",
34
34
  "@atlaskit/editor-prosemirror": "^7.3.0",
35
35
  "@atlaskit/platform-feature-flags": "^1.1.0",
36
- "@atlaskit/tmp-editor-statsig": "^102.0.0",
36
+ "@atlaskit/tmp-editor-statsig": "^103.0.0",
37
37
  "@babel/runtime": "^7.0.0",
38
38
  "bind-event-listener": "^3.0.0"
39
39
  },
@@ -1 +0,0 @@
1
- export type { MetricsPlugin, MetricsPluginOptions } from '../metricsPluginType';
@@ -1 +0,0 @@
1
- export { metricsPlugin } from '../metricsPlugin';
@@ -1 +0,0 @@
1
- export type { MetricsState } from '../pm-plugins/main';
@@ -1,3 +0,0 @@
1
- export { metricsPlugin } from './metricsPlugin';
2
- export type { MetricsPlugin, MetricsPluginOptions } from './metricsPluginType';
3
- export type { MetricsState } from './pm-plugins/main';
@@ -1,6 +0,0 @@
1
- import type { MetricsPlugin } from './metricsPluginType';
2
- /**
3
- * Metrics plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
4
- * from `@atlaskit/editor-core`.
5
- */
6
- export declare const metricsPlugin: MetricsPlugin;
@@ -1,28 +0,0 @@
1
- import type { EditorCommand, NextEditorPlugin, OptionalPlugin, UserPreferencesProvider } from '@atlaskit/editor-common/types';
2
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
- import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
4
- import type { Selection } from '@atlaskit/editor-prosemirror/state';
5
- import type { MetricsState } from './pm-plugins/main';
6
- type handleIntentToStartEditProps = {
7
- newSelection?: Selection;
8
- shouldPersistActiveSession?: boolean;
9
- shouldStartTimer?: boolean;
10
- };
11
- export type MetricsPluginOptions = {
12
- userPreferencesProvider?: UserPreferencesProvider;
13
- };
14
- export type MetricsPlugin = NextEditorPlugin<'metrics', {
15
- commands: {
16
- handleIntentToStartEdit: ({ newSelection, shouldStartTimer, shouldPersistActiveSession, }: handleIntentToStartEditProps) => EditorCommand;
17
- setContentMoved: () => EditorCommand;
18
- startActiveSessionTimer: () => EditorCommand;
19
- stopActiveSession: () => EditorCommand;
20
- };
21
- dependencies: [
22
- OptionalPlugin<AnalyticsPlugin>,
23
- OptionalPlugin<UserPreferencesPlugin>
24
- ];
25
- pluginConfiguration?: MetricsPluginOptions;
26
- sharedState: MetricsState;
27
- }>;
28
- export {};
@@ -1,34 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { UserPreferencesProvider, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { Fragment } from '@atlaskit/editor-prosemirror/model';
4
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
5
- import type { Selection } from '@atlaskit/editor-prosemirror/state';
6
- import type { MetricsPlugin } from '../metricsPluginType';
7
- import type { TrActionType } from './utils/check-tr-actions/types';
8
- export declare const metricsKey: PluginKey;
9
- export type MetricsState = {
10
- actionTypeCount: ActionByType;
11
- activeSessionTime: number;
12
- contentSizeChanged: number;
13
- initialContent?: Fragment;
14
- intentToStartEditTime?: number;
15
- lastSelection?: Selection;
16
- previousTrType?: TrActionType;
17
- repeatedActionCount: number;
18
- safeInsertCount: number;
19
- shouldPersistActiveSession?: boolean;
20
- timeOfLastTextInput?: number;
21
- totalActionCount: number;
22
- };
23
- export type ActionByType = {
24
- contentDeletedCount: number;
25
- contentMovedCount: number;
26
- markChangeCount: number;
27
- nodeAttributeChangeCount: number;
28
- nodeDeletionCount: number;
29
- nodeInsertionCount: number;
30
- textInputCount: number;
31
- undoCount: number;
32
- };
33
- export declare const initialPluginState: MetricsState;
34
- export declare const createPlugin: (api: ExtractInjectionAPI<MetricsPlugin> | undefined, userPreferencesProvider?: UserPreferencesProvider) => SafePlugin<MetricsState>;
@@ -1,9 +0,0 @@
1
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { MetricsPlugin } from '../../metricsPluginType';
3
- export declare class ActiveSessionTimer {
4
- private timerId;
5
- private api;
6
- constructor(api: ExtractInjectionAPI<MetricsPlugin> | undefined);
7
- startTimer: () => void;
8
- cleanupTimer: () => void;
9
- }
@@ -1,8 +0,0 @@
1
- import type { ActiveSessionEventPayload } from '@atlaskit/editor-common/analytics';
2
- import type { Fragment } from '@atlaskit/editor-prosemirror/model';
3
- import type { MetricsState } from '../main';
4
- export declare const getAnalyticsPayload: ({ currentContent, pluginState, toolbarDocking, }: {
5
- currentContent: Fragment;
6
- pluginState: MetricsState;
7
- toolbarDocking?: "top" | "none";
8
- }) => ActiveSessionEventPayload;
@@ -1,3 +0,0 @@
1
- import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
2
- import type { TrActionType } from './types';
3
- export declare const checkTrActionType: (tr: ReadonlyTransaction) => TrActionType;
@@ -1,4 +0,0 @@
1
- import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
2
- import { ActionType } from '../types';
3
- import type { TrAction } from '../types';
4
- export declare const checkContentPastedOrMoved: (tr: ReadonlyTransaction) => TrAction<ActionType.MOVING_CONTENT | ActionType.PASTING_CONTENT> | undefined;
@@ -1,4 +0,0 @@
1
- import type { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
2
- import { ActionType } from '../types';
3
- import type { TrAction } from '../types';
4
- export declare const checkDeletingContent: (step: ReplaceStep) => TrAction<ActionType.DELETING_CONTENT> | undefined;
@@ -1,4 +0,0 @@
1
- import type { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
2
- import { ActionType } from '../types';
3
- import type { TrAction } from '../types';
4
- export declare const checkEmptyLineAddedOrDeleted: (step: ReplaceStep) => TrAction<ActionType.EMPTY_LINE_ADDED_OR_DELETED> | undefined;
@@ -1,4 +0,0 @@
1
- import type { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
2
- import { ActionType } from '../types';
3
- import type { TrAction } from '../types';
4
- export declare const checkListTypeNodeChanged: (step: ReplaceStep | ReplaceAroundStep) => TrAction<ActionType.INSERTING_NEW_LIST_TYPE_NODE | ActionType.UPDATING_NEW_LIST_TYPE_ITEM> | undefined;
@@ -1,3 +0,0 @@
1
- import type { Step } from '@atlaskit/editor-prosemirror/transform';
2
- import type { MarkChangeAction } from '../types';
3
- export declare const checkMarkChanged: (step: Step) => MarkChangeAction | undefined;
@@ -1,4 +0,0 @@
1
- import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
2
- import type { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
3
- import type { AttrChangeAction } from '../types';
4
- export declare const checkNodeAttributeChanged: (tr: ReadonlyTransaction, step: ReplaceAroundStep | ReplaceStep) => AttrChangeAction | undefined;
@@ -1,3 +0,0 @@
1
- import type { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
2
- import type { StatusChangeAction } from '../types';
3
- export declare const checkStatusChanged: (step: ReplaceStep) => StatusChangeAction | undefined;
@@ -1,3 +0,0 @@
1
- import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
2
- import type { AttrChangeAction } from '../types';
3
- export declare const checkTableColumnResized: (tr: ReadonlyTransaction) => AttrChangeAction | undefined;
@@ -1,4 +0,0 @@
1
- import type { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
2
- import { ActionType } from '../types';
3
- import type { TrAction } from '../types';
4
- export declare const checkTextInput: (step: ReplaceStep) => TrAction<ActionType.TEXT_INPUT> | undefined;
@@ -1,44 +0,0 @@
1
- import type { Slice } from '@atlaskit/editor-prosemirror/model';
2
- import type { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
3
- export interface DetailedReplaceStep extends ReplaceStep {
4
- from: number;
5
- slice: Slice;
6
- to: number;
7
- }
8
- export declare enum ActionType {
9
- TEXT_INPUT = "textInput",
10
- EMPTY_LINE_ADDED_OR_DELETED = "emptyLineAddedOrDeleted",
11
- INSERTED_FROM_TYPE_AHEAD = "insertedFromTypeAhead",
12
- INSERTING_NEW_LIST_TYPE_NODE = "insertingNewListTypeNode",
13
- UPDATING_NEW_LIST_TYPE_ITEM = "updatingNewListItem",
14
- ADDING_LINK = "addingLink",
15
- UPDATING_STATUS = "updatingStatus",
16
- CHANGING_MARK = "changingMark",
17
- CHANGING_ATTRS = "changingAttrs",
18
- MOVING_CONTENT = "contentMoved",
19
- PASTING_CONTENT = "contentPasted",
20
- DELETING_CONTENT = "deletingContent",
21
- SAFE_INSERT = "safeInsert",
22
- UNDO = "undo"
23
- }
24
- export type AttrChangeAction = {
25
- extraData: {
26
- attr: string;
27
- from: number;
28
- to: number;
29
- };
30
- type: ActionType.CHANGING_ATTRS;
31
- };
32
- export type MarkChangeAction = {
33
- type: ActionType.CHANGING_MARK;
34
- };
35
- export type StatusChangeAction = {
36
- extraData: {
37
- statusId: string;
38
- };
39
- type: ActionType.UPDATING_STATUS;
40
- };
41
- export type TrAction<T extends Exclude<ActionType, ActionType.CHANGING_ATTRS | ActionType.CHANGING_MARK | ActionType.UPDATING_STATUS>> = {
42
- type: T;
43
- };
44
- export type TrActionType = AttrChangeAction | MarkChangeAction | StatusChangeAction | TrAction<ActionType.TEXT_INPUT> | TrAction<ActionType.EMPTY_LINE_ADDED_OR_DELETED> | TrAction<ActionType.INSERTED_FROM_TYPE_AHEAD> | TrAction<ActionType.INSERTING_NEW_LIST_TYPE_NODE> | TrAction<ActionType.UPDATING_NEW_LIST_TYPE_ITEM> | TrAction<ActionType.ADDING_LINK> | TrAction<ActionType.MOVING_CONTENT> | TrAction<ActionType.PASTING_CONTENT> | TrAction<ActionType.DELETING_CONTENT> | TrAction<ActionType.SAFE_INSERT> | TrAction<ActionType.UNDO> | undefined;
@@ -1,58 +0,0 @@
1
- import type { Fragment } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorState, ReadonlyTransaction, Selection } from '@atlaskit/editor-prosemirror/state';
3
- import type { MetricsState } from '../main';
4
- import { ActionType } from './check-tr-actions/types';
5
- import type { AttrChangeAction, MarkChangeAction, StatusChangeAction, TrAction } from './check-tr-actions/types';
6
- export declare const getNewPluginState: ({ now, intentToStartEditTime, shouldPersistActiveSession, tr, pluginState, oldState, newState, }: {
7
- intentToStartEditTime: number;
8
- newState: EditorState;
9
- now: number;
10
- oldState: EditorState;
11
- pluginState: MetricsState;
12
- shouldPersistActiveSession: boolean;
13
- tr: ReadonlyTransaction;
14
- }) => {
15
- actionTypeCount: {
16
- contentDeletedCount: number;
17
- contentMovedCount: number;
18
- markChangeCount: number;
19
- nodeAttributeChangeCount: number;
20
- nodeDeletionCount: number;
21
- nodeInsertionCount: number;
22
- textInputCount: number;
23
- undoCount: number;
24
- };
25
- activeSessionTime: number;
26
- contentSizeChanged: number;
27
- initialContent?: Fragment;
28
- intentToStartEditTime: number;
29
- lastSelection?: Selection;
30
- previousTrType: undefined;
31
- repeatedActionCount: number;
32
- safeInsertCount: number;
33
- shouldPersistActiveSession: boolean;
34
- timeOfLastTextInput: undefined;
35
- totalActionCount: number;
36
- } | {
37
- actionTypeCount: {
38
- contentDeletedCount: number;
39
- contentMovedCount: number;
40
- markChangeCount: number;
41
- nodeAttributeChangeCount: number;
42
- nodeDeletionCount: number;
43
- nodeInsertionCount: number;
44
- textInputCount: number;
45
- undoCount: number;
46
- };
47
- activeSessionTime: number;
48
- contentSizeChanged: number;
49
- initialContent?: Fragment;
50
- intentToStartEditTime: number;
51
- lastSelection?: Selection;
52
- previousTrType: AttrChangeAction | MarkChangeAction | StatusChangeAction | TrAction<ActionType.TEXT_INPUT> | TrAction<ActionType.EMPTY_LINE_ADDED_OR_DELETED> | TrAction<ActionType.INSERTED_FROM_TYPE_AHEAD> | TrAction<ActionType.INSERTING_NEW_LIST_TYPE_NODE> | TrAction<ActionType.UPDATING_NEW_LIST_TYPE_ITEM> | TrAction<ActionType.ADDING_LINK> | TrAction<ActionType.MOVING_CONTENT> | TrAction<ActionType.PASTING_CONTENT> | TrAction<ActionType.DELETING_CONTENT> | TrAction<ActionType.SAFE_INSERT> | TrAction<ActionType.UNDO>;
53
- repeatedActionCount: number;
54
- safeInsertCount: number;
55
- shouldPersistActiveSession: boolean;
56
- timeOfLastTextInput: number | undefined;
57
- totalActionCount: number;
58
- };
@@ -1,6 +0,0 @@
1
- import type { Fragment } from '@atlaskit/editor-prosemirror/model';
2
- import type { MetricsState } from '../main';
3
- export declare const getNodeChanges: ({ currentContent, pluginState, }: {
4
- currentContent: Fragment;
5
- pluginState?: MetricsState;
6
- }) => Record<string, number>;
@@ -1,2 +0,0 @@
1
- import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
2
- export declare const isNonTextUndo: (tr: ReadonlyTransaction) => boolean;
@@ -1,3 +0,0 @@
1
- import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
2
- import type { ActionType } from './check-tr-actions/types';
3
- export declare const isSafeInsert: (tr: ReadonlyTransaction, insertPos: number, trType?: ActionType) => boolean;
@@ -1,2 +0,0 @@
1
- import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
2
- export declare const isTrWithDocChanges: (tr: ReadonlyTransaction) => boolean;
@@ -1,2 +0,0 @@
1
- import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
2
- export declare const shouldSkipTr: (tr: ReadonlyTransaction) => boolean;