@atlaskit/editor-plugin-synced-block 5.1.9 → 5.1.10

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 (55) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/editor-commands/index.js +2 -2
  3. package/dist/cjs/pm-plugins/experience-tracking/create-reference-experience.js +26 -26
  4. package/dist/cjs/pm-plugins/experience-tracking/create-source-experience.js +14 -30
  5. package/dist/cjs/pm-plugins/experience-tracking/delete-reference-experience.js +175 -0
  6. package/dist/cjs/pm-plugins/experience-tracking/delete-source-experience.js +103 -0
  7. package/dist/cjs/pm-plugins/experience-tracking/get-experience-tracking-plugins.js +30 -0
  8. package/dist/cjs/pm-plugins/experience-tracking/provider-only-experiences.js +128 -0
  9. package/dist/cjs/pm-plugins/utils/experience-tracking-utils.js +85 -0
  10. package/dist/cjs/types/index.js +5 -2
  11. package/dist/cjs/ui/CreateSyncedBlockDropdownItem.js +40 -8
  12. package/dist/cjs/ui/DeleteConfirmationModal.js +3 -1
  13. package/dist/cjs/ui/floating-toolbar.js +4 -2
  14. package/dist/es2019/editor-commands/index.js +2 -2
  15. package/dist/es2019/pm-plugins/experience-tracking/create-reference-experience.js +27 -23
  16. package/dist/es2019/pm-plugins/experience-tracking/create-source-experience.js +14 -27
  17. package/dist/es2019/pm-plugins/experience-tracking/delete-reference-experience.js +181 -0
  18. package/dist/es2019/pm-plugins/experience-tracking/delete-source-experience.js +98 -0
  19. package/dist/es2019/pm-plugins/experience-tracking/get-experience-tracking-plugins.js +24 -0
  20. package/dist/es2019/pm-plugins/experience-tracking/provider-only-experiences.js +127 -0
  21. package/dist/es2019/pm-plugins/utils/experience-tracking-utils.js +65 -0
  22. package/dist/es2019/types/index.js +4 -1
  23. package/dist/es2019/ui/CreateSyncedBlockDropdownItem.js +38 -3
  24. package/dist/es2019/ui/DeleteConfirmationModal.js +3 -1
  25. package/dist/es2019/ui/floating-toolbar.js +3 -1
  26. package/dist/esm/editor-commands/index.js +2 -2
  27. package/dist/esm/pm-plugins/experience-tracking/create-reference-experience.js +26 -25
  28. package/dist/esm/pm-plugins/experience-tracking/create-source-experience.js +14 -29
  29. package/dist/esm/pm-plugins/experience-tracking/delete-reference-experience.js +169 -0
  30. package/dist/esm/pm-plugins/experience-tracking/delete-source-experience.js +97 -0
  31. package/dist/esm/pm-plugins/experience-tracking/get-experience-tracking-plugins.js +30 -0
  32. package/dist/esm/pm-plugins/experience-tracking/provider-only-experiences.js +122 -0
  33. package/dist/esm/pm-plugins/utils/experience-tracking-utils.js +79 -0
  34. package/dist/esm/types/index.js +4 -1
  35. package/dist/esm/ui/CreateSyncedBlockDropdownItem.js +40 -8
  36. package/dist/esm/ui/DeleteConfirmationModal.js +3 -1
  37. package/dist/esm/ui/floating-toolbar.js +4 -2
  38. package/dist/types/pm-plugins/experience-tracking/create-reference-experience.d.ts +2 -9
  39. package/dist/types/pm-plugins/experience-tracking/create-source-experience.d.ts +4 -15
  40. package/dist/types/pm-plugins/experience-tracking/delete-reference-experience.d.ts +13 -0
  41. package/dist/types/pm-plugins/experience-tracking/delete-source-experience.d.ts +12 -0
  42. package/dist/types/pm-plugins/experience-tracking/get-experience-tracking-plugins.d.ts +2 -13
  43. package/dist/types/pm-plugins/experience-tracking/provider-only-experiences.d.ts +3 -0
  44. package/dist/types/pm-plugins/utils/experience-tracking-utils.d.ts +9 -0
  45. package/dist/types/types/index.d.ts +15 -0
  46. package/dist/types-ts4.5/pm-plugins/experience-tracking/create-reference-experience.d.ts +2 -9
  47. package/dist/types-ts4.5/pm-plugins/experience-tracking/create-source-experience.d.ts +4 -15
  48. package/dist/types-ts4.5/pm-plugins/experience-tracking/delete-reference-experience.d.ts +13 -0
  49. package/dist/types-ts4.5/pm-plugins/experience-tracking/delete-source-experience.d.ts +12 -0
  50. package/dist/types-ts4.5/pm-plugins/experience-tracking/get-experience-tracking-plugins.d.ts +2 -13
  51. package/dist/types-ts4.5/pm-plugins/experience-tracking/provider-only-experiences.d.ts +3 -0
  52. package/dist/types-ts4.5/pm-plugins/utils/experience-tracking-utils.d.ts +9 -0
  53. package/dist/types-ts4.5/types/index.d.ts +15 -0
  54. package/package.json +5 -5
  55. package/build/tsconfig.json +0 -22
@@ -0,0 +1,13 @@
1
+ import { Experience } from '@atlaskit/editor-common/experiences';
2
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
+ import { type ExperienceOptions, type ProviderExperienceOptions } from '../../types';
4
+ /**
5
+ * This experience tracks when a reference sync block is deleted.
6
+ *
7
+ * Start: When user deletes ref sync block from toolbar, presses delete when cursor is in front of ref sync block,
8
+ * presses any key with a ref sync block selected, cuts with a ref sync block selected, triggers undo/redo that deletes a ref sync block
9
+ * Success: When the sync block is removed from the DOM within 2000ms of start
10
+ * Failure: When 2000ms passes without the reference sync block being removed from the DOM
11
+ */
12
+ export declare const getDeleteReferenceExperiencePlugin: ({ refs, dispatchAnalyticsEvent, syncBlockStore, }: ProviderExperienceOptions) => SafePlugin<any>;
13
+ export declare const getDeleteReferenceExperience: ({ refs, dispatchAnalyticsEvent }: ExperienceOptions) => Experience;
@@ -0,0 +1,12 @@
1
+ import { Experience } from '@atlaskit/editor-common/experiences';
2
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
+ import { type ExperienceOptions, type ProviderExperienceOptions } from '../../types';
4
+ /**
5
+ * This experience tracks when a source sync block is deleted.
6
+ *
7
+ * Start: When user clicks the delete button in the delete modal
8
+ * Success: When the sync block is removed from the DOM within 2000ms of start
9
+ * Failure: When 2000ms passes without the source sync block being removed from the DOM
10
+ */
11
+ export declare const getDeleteSourceExperiencePlugin: ({ refs, dispatchAnalyticsEvent, syncBlockStore, }: ProviderExperienceOptions) => SafePlugin<any>;
12
+ export declare const getDeleteSourceExperience: ({ refs, dispatchAnalyticsEvent }: ExperienceOptions) => Experience;
@@ -1,16 +1,5 @@
1
- import type { DispatchAnalyticsEvent } from "@atlaskit/editor-common/analytics";
2
- import type { SyncBlockStoreManager } from "@atlaskit/editor-synced-block-provider";
3
- type ExperienceTrackingPluginsProps = {
4
- dispatchAnalyticsEvent: DispatchAnalyticsEvent;
5
- refs: {
6
- containerElement?: HTMLElement;
7
- popupsMountPoint?: HTMLElement;
8
- wrapperElement?: HTMLElement;
9
- };
10
- syncBlockStore: SyncBlockStoreManager;
11
- };
12
- export declare const getExperienceTrackingPlugins: ({ refs, dispatchAnalyticsEvent, syncBlockStore }: ExperienceTrackingPluginsProps) => {
1
+ import type { ProviderExperienceOptions } from "../../types";
2
+ export declare const getExperienceTrackingPlugins: ({ refs, dispatchAnalyticsEvent, syncBlockStore }: ProviderExperienceOptions) => {
13
3
  name: string;
14
4
  plugin: () => import("@atlaskit/editor-common/safe-plugin").SafePlugin<any>;
15
5
  }[];
16
- export {};
@@ -0,0 +1,3 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import { type ProviderExperienceOptions } from '../../types';
3
+ export declare const getProviderOnlyExperiencesPlugin: ({ refs, dispatchAnalyticsEvent, syncBlockStore }: ProviderExperienceOptions) => SafePlugin<any>;
@@ -0,0 +1,9 @@
1
+ import type { EditorState, Transaction } from "@atlaskit/editor-prosemirror/state";
2
+ export declare const getTarget: (containerElement: HTMLElement | undefined) => HTMLElement | null;
3
+ export declare const wasSyncBlockDeletedOrAddedByHistory: (tr: Transaction, oldState: EditorState, newState: EditorState) => {
4
+ hasAddedSyncBlock?: boolean;
5
+ hasDeletedSyncBlock?: boolean;
6
+ isUndo?: boolean;
7
+ };
8
+ export declare const getAddedResourceIds: (mutations: MutationRecord[], query: string) => string[];
9
+ export declare const getRemovedResourceIds: (mutations: MutationRecord[], query: string) => string[];
@@ -1,3 +1,4 @@
1
+ import type { DispatchAnalyticsEvent } from "@atlaskit/editor-common/analytics";
1
2
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
3
  import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
3
4
  export declare enum FLAG_ID {
@@ -40,4 +41,18 @@ export type SyncBlockInfo = {
40
41
  export type SyncBlockMap = {
41
42
  [key: string]: SyncBlockInfo;
42
43
  };
44
+ export type ExperienceOptions = {
45
+ dispatchAnalyticsEvent: DispatchAnalyticsEvent;
46
+ refs: {
47
+ containerElement?: HTMLElement;
48
+ popupsMountPoint?: HTMLElement;
49
+ wrapperElement?: HTMLElement;
50
+ };
51
+ };
52
+ export type ProviderExperienceOptions = ExperienceOptions & {
53
+ syncBlockStore: SyncBlockStoreManager;
54
+ };
55
+ export declare const EXPERIENCE_ABORT_REASON: {
56
+ EDITOR_DESTROYED: string;
57
+ };
43
58
  export {};
@@ -1,11 +1,5 @@
1
- import { type DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- type CreateReferenceExperienceOptions = {
4
- dispatchAnalyticsEvent: DispatchAnalyticsEvent;
5
- refs: {
6
- containerElement?: HTMLElement;
7
- };
8
- };
2
+ import { type ExperienceOptions } from '../../types';
9
3
  /**
10
4
  * This experience tracks when a reference sync block is inserted.
11
5
  *
@@ -13,5 +7,4 @@ type CreateReferenceExperienceOptions = {
13
7
  * Success: When the sync block is added to the DOM within 500ms of start
14
8
  * Failure: When 500ms passes without the reference sync block being added to the DOM
15
9
  */
16
- export declare const getCreateReferenceExperiencePlugin: ({ refs, dispatchAnalyticsEvent, }: CreateReferenceExperienceOptions) => SafePlugin<any>;
17
- export {};
10
+ export declare const getCreateReferenceExperiencePlugin: ({ refs, dispatchAnalyticsEvent, }: ExperienceOptions) => SafePlugin<any>;
@@ -1,21 +1,10 @@
1
- import { type DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
4
- type CreateSourceExperienceOptions = {
5
- dispatchAnalyticsEvent: DispatchAnalyticsEvent;
6
- refs: {
7
- containerElement?: HTMLElement;
8
- popupsMountPoint?: HTMLElement;
9
- wrapperElement?: HTMLElement;
10
- };
11
- syncBlockStore: SyncBlockStoreManager;
12
- };
2
+ import { type ProviderExperienceOptions } from '../../types';
13
3
  /**
14
4
  * This experience tracks when a source sync block is inserted.
15
5
  *
16
6
  * Start: When user inserts a sync block via block menu, quick insert or pinned toolbar
17
- * Success: When the sync block is added to the DOM within 2000ms of start
18
- * Failure: When 500ms passes without the source sync block being added to the DOM
7
+ * Success: When the sync block is added to the DOM within 3000ms of start
8
+ * Failure: When 3000ms passes without the source sync block being added to the DOM
19
9
  */
20
- export declare const getCreateSourceExperiencePlugin: ({ refs, dispatchAnalyticsEvent, syncBlockStore, }: CreateSourceExperienceOptions) => SafePlugin<any>;
21
- export {};
10
+ export declare const getCreateSourceExperiencePlugin: ({ refs, dispatchAnalyticsEvent, syncBlockStore, }: ProviderExperienceOptions) => SafePlugin<any>;
@@ -0,0 +1,13 @@
1
+ import { Experience } from '@atlaskit/editor-common/experiences';
2
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
+ import { type ExperienceOptions, type ProviderExperienceOptions } from '../../types';
4
+ /**
5
+ * This experience tracks when a reference sync block is deleted.
6
+ *
7
+ * Start: When user deletes ref sync block from toolbar, presses delete when cursor is in front of ref sync block,
8
+ * presses any key with a ref sync block selected, cuts with a ref sync block selected, triggers undo/redo that deletes a ref sync block
9
+ * Success: When the sync block is removed from the DOM within 2000ms of start
10
+ * Failure: When 2000ms passes without the reference sync block being removed from the DOM
11
+ */
12
+ export declare const getDeleteReferenceExperiencePlugin: ({ refs, dispatchAnalyticsEvent, syncBlockStore, }: ProviderExperienceOptions) => SafePlugin<any>;
13
+ export declare const getDeleteReferenceExperience: ({ refs, dispatchAnalyticsEvent }: ExperienceOptions) => Experience;
@@ -0,0 +1,12 @@
1
+ import { Experience } from '@atlaskit/editor-common/experiences';
2
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
+ import { type ExperienceOptions, type ProviderExperienceOptions } from '../../types';
4
+ /**
5
+ * This experience tracks when a source sync block is deleted.
6
+ *
7
+ * Start: When user clicks the delete button in the delete modal
8
+ * Success: When the sync block is removed from the DOM within 2000ms of start
9
+ * Failure: When 2000ms passes without the source sync block being removed from the DOM
10
+ */
11
+ export declare const getDeleteSourceExperiencePlugin: ({ refs, dispatchAnalyticsEvent, syncBlockStore, }: ProviderExperienceOptions) => SafePlugin<any>;
12
+ export declare const getDeleteSourceExperience: ({ refs, dispatchAnalyticsEvent }: ExperienceOptions) => Experience;
@@ -1,16 +1,5 @@
1
- import type { DispatchAnalyticsEvent } from "@atlaskit/editor-common/analytics";
2
- import type { SyncBlockStoreManager } from "@atlaskit/editor-synced-block-provider";
3
- type ExperienceTrackingPluginsProps = {
4
- dispatchAnalyticsEvent: DispatchAnalyticsEvent;
5
- refs: {
6
- containerElement?: HTMLElement;
7
- popupsMountPoint?: HTMLElement;
8
- wrapperElement?: HTMLElement;
9
- };
10
- syncBlockStore: SyncBlockStoreManager;
11
- };
12
- export declare const getExperienceTrackingPlugins: ({ refs, dispatchAnalyticsEvent, syncBlockStore }: ExperienceTrackingPluginsProps) => {
1
+ import type { ProviderExperienceOptions } from "../../types";
2
+ export declare const getExperienceTrackingPlugins: ({ refs, dispatchAnalyticsEvent, syncBlockStore }: ProviderExperienceOptions) => {
13
3
  name: string;
14
4
  plugin: () => import("@atlaskit/editor-common/safe-plugin").SafePlugin<any>;
15
5
  }[];
16
- export {};
@@ -0,0 +1,3 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import { type ProviderExperienceOptions } from '../../types';
3
+ export declare const getProviderOnlyExperiencesPlugin: ({ refs, dispatchAnalyticsEvent, syncBlockStore }: ProviderExperienceOptions) => SafePlugin<any>;
@@ -0,0 +1,9 @@
1
+ import type { EditorState, Transaction } from "@atlaskit/editor-prosemirror/state";
2
+ export declare const getTarget: (containerElement: HTMLElement | undefined) => HTMLElement | null;
3
+ export declare const wasSyncBlockDeletedOrAddedByHistory: (tr: Transaction, oldState: EditorState, newState: EditorState) => {
4
+ hasAddedSyncBlock?: boolean;
5
+ hasDeletedSyncBlock?: boolean;
6
+ isUndo?: boolean;
7
+ };
8
+ export declare const getAddedResourceIds: (mutations: MutationRecord[], query: string) => string[];
9
+ export declare const getRemovedResourceIds: (mutations: MutationRecord[], query: string) => string[];
@@ -1,3 +1,4 @@
1
+ import type { DispatchAnalyticsEvent } from "@atlaskit/editor-common/analytics";
1
2
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
3
  import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
3
4
  export declare enum FLAG_ID {
@@ -40,4 +41,18 @@ export type SyncBlockInfo = {
40
41
  export type SyncBlockMap = {
41
42
  [key: string]: SyncBlockInfo;
42
43
  };
44
+ export type ExperienceOptions = {
45
+ dispatchAnalyticsEvent: DispatchAnalyticsEvent;
46
+ refs: {
47
+ containerElement?: HTMLElement;
48
+ popupsMountPoint?: HTMLElement;
49
+ wrapperElement?: HTMLElement;
50
+ };
51
+ };
52
+ export type ProviderExperienceOptions = ExperienceOptions & {
53
+ syncBlockStore: SyncBlockStoreManager;
54
+ };
55
+ export declare const EXPERIENCE_ABORT_REASON: {
56
+ EDITOR_DESTROYED: string;
57
+ };
43
58
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-synced-block",
3
- "version": "5.1.9",
3
+ "version": "5.1.10",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,17 +39,17 @@
39
39
  "@atlaskit/editor-plugin-selection": "^7.0.0",
40
40
  "@atlaskit/editor-prosemirror": "^7.2.0",
41
41
  "@atlaskit/editor-shared-styles": "^3.10.0",
42
- "@atlaskit/editor-synced-block-provider": "^3.5.0",
42
+ "@atlaskit/editor-synced-block-provider": "^3.6.0",
43
43
  "@atlaskit/editor-tables": "^2.9.0",
44
44
  "@atlaskit/editor-toolbar": "^0.19.0",
45
45
  "@atlaskit/flag": "^17.8.0",
46
46
  "@atlaskit/icon": "29.4.1",
47
47
  "@atlaskit/icon-lab": "^5.14.0",
48
48
  "@atlaskit/lozenge": "^13.3.0",
49
- "@atlaskit/modal-dialog": "^14.9.0",
49
+ "@atlaskit/modal-dialog": "^14.10.0",
50
50
  "@atlaskit/platform-feature-flags": "^1.1.0",
51
51
  "@atlaskit/primitives": "^17.0.0",
52
- "@atlaskit/tmp-editor-statsig": "^16.18.0",
52
+ "@atlaskit/tmp-editor-statsig": "^16.19.0",
53
53
  "@atlaskit/tokens": "9.1.2",
54
54
  "@atlaskit/tooltip": "^20.14.0",
55
55
  "@atlaskit/visually-hidden": "^3.0.0",
@@ -58,7 +58,7 @@
58
58
  "react-intl-next": "npm:react-intl@^5.18.1"
59
59
  },
60
60
  "peerDependencies": {
61
- "@atlaskit/editor-common": "^111.7.0",
61
+ "@atlaskit/editor-common": "^111.8.0",
62
62
  "react": "^18.2.0"
63
63
  },
64
64
  "devDependencies": {
@@ -1,22 +0,0 @@
1
- {
2
- "extends": "../tsconfig",
3
- "compilerOptions": {
4
- "target": "es5",
5
- "paths": {}
6
- },
7
- "include": [
8
- "../src/**/*.ts",
9
- "../src/**/*.tsx"
10
- ],
11
- "exclude": [
12
- "../src/**/__tests__/*",
13
- "../src/**/*.test.*",
14
- "../src/**/test.*",
15
- "../src/**/examples.*",
16
- "../src/**/examples/*",
17
- "../src/**/examples/**/*",
18
- "../src/**/*.stories.*",
19
- "../src/**/stories/*",
20
- "../src/**/stories/**/*"
21
- ]
22
- }