@atlaskit/editor-synced-block-renderer 5.3.0 → 5.3.2

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-synced-block-renderer
2
2
 
3
+ ## 5.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7f41011a1b0ff`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7f41011a1b0ff) -
8
+ EDITOR-1665 update sync block experience events to use general experience ids, keep existing error
9
+ events and add success events
10
+ - Updated dependencies
11
+
12
+ ## 5.3.1
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 5.3.0
4
19
 
5
20
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "../../../../tsconfig.entry-points.jira.json",
2
+ "extends": "../../../../tsconfig.local-consumption.json",
3
3
  "compilerOptions": {
4
4
  "target": "es5",
5
5
  "outDir": "../../../../../jira/tsDist/@atlaskit__editor-synced-block-renderer/app",
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "../../../../tsconfig.entry-points.products.json",
2
+ "extends": "../../../../tsconfig.local-consumption.json",
3
3
  "compilerOptions": {
4
4
  "target": "es5",
5
5
  "outDir": "../../../../../tsDist/@atlaskit__editor-synced-block-renderer/app",
@@ -10,8 +10,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _syncBlock = require("@atlaskit/editor-common/sync-block");
12
12
  var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider");
13
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
- var _experienceTracking = require("../utils/experience-tracking");
15
13
  var _AKRendererWrapper = require("./AKRendererWrapper");
16
14
  var _SyncedBlockErrorComponent = require("./SyncedBlockErrorComponent");
17
15
  var _SyncedBlockLoadingState = require("./SyncedBlockLoadingState");
@@ -23,9 +21,6 @@ var SyncedBlockNodeComponentRenderer = exports.SyncedBlockNodeComponentRenderer
23
21
  localId = nodeProps.localId,
24
22
  fireAnalyticsEvent = nodeProps.fireAnalyticsEvent;
25
23
  syncBlockStoreManager.referenceManager.updateFireAnalyticsEvent(fireAnalyticsEvent);
26
- if ((0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding')) {
27
- (0, _experienceTracking.setupExperienceTracking)(syncBlockStoreManager, fireAnalyticsEvent);
28
- }
29
24
  var _useFetchSyncBlockDat = (0, _editorSyncedBlockProvider.useFetchSyncBlockData)(syncBlockStoreManager, resourceId, localId, fireAnalyticsEvent),
30
25
  syncBlockInstance = _useFetchSyncBlockDat.syncBlockInstance,
31
26
  isLoading = _useFetchSyncBlockDat.isLoading,
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SyncBlockSharedCssClassName, SyncBlockRendererDataAttributeName } from '@atlaskit/editor-common/sync-block';
3
3
  import { SyncBlockError, useFetchSyncBlockData } from '@atlaskit/editor-synced-block-provider';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
- import { setupExperienceTracking } from '../utils/experience-tracking';
6
4
  import { AKRendererWrapper } from './AKRendererWrapper';
7
5
  import { SyncedBlockErrorComponent } from './SyncedBlockErrorComponent';
8
6
  import { SyncedBlockLoadingState } from './SyncedBlockLoadingState';
@@ -17,9 +15,6 @@ export const SyncedBlockNodeComponentRenderer = ({
17
15
  fireAnalyticsEvent
18
16
  } = nodeProps;
19
17
  syncBlockStoreManager.referenceManager.updateFireAnalyticsEvent(fireAnalyticsEvent);
20
- if (fg('platform_synced_block_dogfooding')) {
21
- setupExperienceTracking(syncBlockStoreManager, fireAnalyticsEvent);
22
- }
23
18
  const {
24
19
  syncBlockInstance,
25
20
  isLoading,
@@ -3,8 +3,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import React from 'react';
4
4
  import { SyncBlockSharedCssClassName, SyncBlockRendererDataAttributeName } from '@atlaskit/editor-common/sync-block';
5
5
  import { SyncBlockError, useFetchSyncBlockData } from '@atlaskit/editor-synced-block-provider';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
- import { setupExperienceTracking } from '../utils/experience-tracking';
8
6
  import { AKRendererWrapper } from './AKRendererWrapper';
9
7
  import { SyncedBlockErrorComponent } from './SyncedBlockErrorComponent';
10
8
  import { SyncedBlockLoadingState } from './SyncedBlockLoadingState';
@@ -16,9 +14,6 @@ export var SyncedBlockNodeComponentRenderer = function SyncedBlockNodeComponentR
16
14
  localId = nodeProps.localId,
17
15
  fireAnalyticsEvent = nodeProps.fireAnalyticsEvent;
18
16
  syncBlockStoreManager.referenceManager.updateFireAnalyticsEvent(fireAnalyticsEvent);
19
- if (fg('platform_synced_block_dogfooding')) {
20
- setupExperienceTracking(syncBlockStoreManager, fireAnalyticsEvent);
21
- }
22
17
  var _useFetchSyncBlockDat = useFetchSyncBlockData(syncBlockStoreManager, resourceId, localId, fireAnalyticsEvent),
23
18
  syncBlockInstance = _useFetchSyncBlockDat.syncBlockInstance,
24
19
  isLoading = _useFetchSyncBlockDat.isLoading,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-synced-block-renderer",
3
- "version": "5.3.0",
3
+ "version": "5.3.2",
4
4
  "description": "SyncedBlockRenderer for @atlaskit/editor-plugin-synced-block",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,17 +30,17 @@
30
30
  "dependencies": {
31
31
  "@atlaskit/button": "^23.9.0",
32
32
  "@atlaskit/css": "^0.19.0",
33
- "@atlaskit/editor-plugin-synced-block": "^5.1.0",
34
- "@atlaskit/editor-synced-block-provider": "^3.7.0",
33
+ "@atlaskit/editor-plugin-synced-block": "^5.2.0",
34
+ "@atlaskit/editor-synced-block-provider": "^3.12.0",
35
35
  "@atlaskit/heading": "^5.2.0",
36
36
  "@atlaskit/icon": "^29.4.0",
37
37
  "@atlaskit/icon-lab": "^5.14.0",
38
38
  "@atlaskit/image": "^3.0.0",
39
39
  "@atlaskit/platform-feature-flags": "^1.1.0",
40
40
  "@atlaskit/primitives": "^17.1.0",
41
- "@atlaskit/renderer": "^125.4.0",
41
+ "@atlaskit/renderer": "^126.1.0",
42
42
  "@atlaskit/spinner": "^19.0.0",
43
- "@atlaskit/tokens": "^9.1.0",
43
+ "@atlaskit/tokens": "^10.1.0",
44
44
  "@atlaskit/tooltip": "^20.14.0",
45
45
  "@babel/runtime": "^7.0.0",
46
46
  "react-relay": "npm:atl-react-relay@0.0.0-main-39e79f66",
@@ -1,74 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.setupExperienceTracking = exports.getSaveReferenceExperience = exports.getFetchSourceInfoExperience = exports.getFetchExperience = exports.createExperienceDispatcher = void 0;
7
- var _analytics = require("@atlaskit/editor-common/analytics");
8
- var _experiences = require("@atlaskit/editor-common/experiences");
9
- var setupExperienceTracking = exports.setupExperienceTracking = function setupExperienceTracking(syncBlockStoreManager, fireAnalyticsEvent) {
10
- if (!fireAnalyticsEvent) {
11
- return;
12
- }
13
- var dispatchAnalyticsEvent = createExperienceDispatcher(fireAnalyticsEvent);
14
- syncBlockStoreManager.referenceManager.setExperiences(getFetchExperience(dispatchAnalyticsEvent), getFetchSourceInfoExperience(dispatchAnalyticsEvent), getSaveReferenceExperience(dispatchAnalyticsEvent));
15
- };
16
- var createExperienceDispatcher = exports.createExperienceDispatcher = function createExperienceDispatcher(fireAnalyticsEvent) {
17
- return function (payload) {
18
- // Runtime type guard - only forward experience events
19
- if (payload.action === 'experienceMeasured' || payload.action === 'experienceSampled') {
20
- fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent(payload);
21
- }
22
- };
23
- };
24
-
25
- /**
26
- * This experience tracks when a reference sync block data is fetched from the BE.
27
- *
28
- * Start: When the fetchNodesData function is called.
29
- * Success: When the fetching the data is successful within 1500ms of start.
30
- * Failure: When 1500ms passes without the data being successfully fetched, or the fetch fails
31
- */
32
- var getFetchExperience = exports.getFetchExperience = function getFetchExperience(dispatchAnalyticsEvent) {
33
- return new _experiences.Experience(_analytics.ACTION_SUBJECT.SYNCED_BLOCK, {
34
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.SYNCED_BLOCK_FETCH,
35
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
36
- checks: [new _experiences.ExperienceCheckTimeout({
37
- durationMs: 1500
38
- })]
39
- });
40
- };
41
-
42
- /**
43
- * This experience tracks when a reference sync block source info data (title, url) is fetched from the BE.
44
- *
45
- * Start: When the fetchSourceInfo function is called.
46
- * Success: When the fetching the data is successful within 2500ms of start.
47
- * Failure: When 2500ms passes without the data being successfully fetched, or the fetch fails
48
- */
49
- var getFetchSourceInfoExperience = exports.getFetchSourceInfoExperience = function getFetchSourceInfoExperience(dispatchAnalyticsEvent) {
50
- return new _experiences.Experience(_analytics.ACTION_SUBJECT.SYNCED_BLOCK, {
51
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.SYNCED_BLOCK_GET_SOURCE_INFO,
52
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
53
- checks: [new _experiences.ExperienceCheckTimeout({
54
- durationMs: 2500
55
- })]
56
- });
57
- };
58
-
59
- /**
60
- * This experience tracks when a reference sync block is saved to the BE.
61
- *
62
- * Start: When the flush sync block function is called.
63
- * Success: When the sync block save is successful within 1500ms of start.
64
- * Failure: When 1500ms passes before the sync block save is marked as successful
65
- */
66
- var getSaveReferenceExperience = exports.getSaveReferenceExperience = function getSaveReferenceExperience(dispatchAnalyticsEvent) {
67
- return new _experiences.Experience(_analytics.ACTION_SUBJECT.SYNCED_BLOCK, {
68
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.REFERENCE_SYNCED_BLOCK_UPDATE,
69
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
70
- checks: [new _experiences.ExperienceCheckTimeout({
71
- durationMs: 1500
72
- })]
73
- });
74
- };
@@ -1,68 +0,0 @@
1
- import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
2
- import { Experience, ExperienceCheckTimeout } from '@atlaskit/editor-common/experiences';
3
- export const setupExperienceTracking = (syncBlockStoreManager, fireAnalyticsEvent) => {
4
- if (!fireAnalyticsEvent) {
5
- return;
6
- }
7
- const dispatchAnalyticsEvent = createExperienceDispatcher(fireAnalyticsEvent);
8
- syncBlockStoreManager.referenceManager.setExperiences(getFetchExperience(dispatchAnalyticsEvent), getFetchSourceInfoExperience(dispatchAnalyticsEvent), getSaveReferenceExperience(dispatchAnalyticsEvent));
9
- };
10
- export const createExperienceDispatcher = fireAnalyticsEvent => {
11
- return payload => {
12
- // Runtime type guard - only forward experience events
13
- if (payload.action === 'experienceMeasured' || payload.action === 'experienceSampled') {
14
- fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 ? void 0 : fireAnalyticsEvent(payload);
15
- }
16
- };
17
- };
18
-
19
- /**
20
- * This experience tracks when a reference sync block data is fetched from the BE.
21
- *
22
- * Start: When the fetchNodesData function is called.
23
- * Success: When the fetching the data is successful within 1500ms of start.
24
- * Failure: When 1500ms passes without the data being successfully fetched, or the fetch fails
25
- */
26
- export const getFetchExperience = dispatchAnalyticsEvent => {
27
- return new Experience(ACTION_SUBJECT.SYNCED_BLOCK, {
28
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_FETCH,
29
- dispatchAnalyticsEvent,
30
- checks: [new ExperienceCheckTimeout({
31
- durationMs: 1500
32
- })]
33
- });
34
- };
35
-
36
- /**
37
- * This experience tracks when a reference sync block source info data (title, url) is fetched from the BE.
38
- *
39
- * Start: When the fetchSourceInfo function is called.
40
- * Success: When the fetching the data is successful within 2500ms of start.
41
- * Failure: When 2500ms passes without the data being successfully fetched, or the fetch fails
42
- */
43
- export const getFetchSourceInfoExperience = dispatchAnalyticsEvent => {
44
- return new Experience(ACTION_SUBJECT.SYNCED_BLOCK, {
45
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_GET_SOURCE_INFO,
46
- dispatchAnalyticsEvent,
47
- checks: [new ExperienceCheckTimeout({
48
- durationMs: 2500
49
- })]
50
- });
51
- };
52
-
53
- /**
54
- * This experience tracks when a reference sync block is saved to the BE.
55
- *
56
- * Start: When the flush sync block function is called.
57
- * Success: When the sync block save is successful within 1500ms of start.
58
- * Failure: When 1500ms passes before the sync block save is marked as successful
59
- */
60
- export const getSaveReferenceExperience = dispatchAnalyticsEvent => {
61
- return new Experience(ACTION_SUBJECT.SYNCED_BLOCK, {
62
- actionSubjectId: ACTION_SUBJECT_ID.REFERENCE_SYNCED_BLOCK_UPDATE,
63
- dispatchAnalyticsEvent,
64
- checks: [new ExperienceCheckTimeout({
65
- durationMs: 1500
66
- })]
67
- });
68
- };
@@ -1,68 +0,0 @@
1
- import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
2
- import { Experience, ExperienceCheckTimeout } from '@atlaskit/editor-common/experiences';
3
- export var setupExperienceTracking = function setupExperienceTracking(syncBlockStoreManager, fireAnalyticsEvent) {
4
- if (!fireAnalyticsEvent) {
5
- return;
6
- }
7
- var dispatchAnalyticsEvent = createExperienceDispatcher(fireAnalyticsEvent);
8
- syncBlockStoreManager.referenceManager.setExperiences(getFetchExperience(dispatchAnalyticsEvent), getFetchSourceInfoExperience(dispatchAnalyticsEvent), getSaveReferenceExperience(dispatchAnalyticsEvent));
9
- };
10
- export var createExperienceDispatcher = function createExperienceDispatcher(fireAnalyticsEvent) {
11
- return function (payload) {
12
- // Runtime type guard - only forward experience events
13
- if (payload.action === 'experienceMeasured' || payload.action === 'experienceSampled') {
14
- fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent(payload);
15
- }
16
- };
17
- };
18
-
19
- /**
20
- * This experience tracks when a reference sync block data is fetched from the BE.
21
- *
22
- * Start: When the fetchNodesData function is called.
23
- * Success: When the fetching the data is successful within 1500ms of start.
24
- * Failure: When 1500ms passes without the data being successfully fetched, or the fetch fails
25
- */
26
- export var getFetchExperience = function getFetchExperience(dispatchAnalyticsEvent) {
27
- return new Experience(ACTION_SUBJECT.SYNCED_BLOCK, {
28
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_FETCH,
29
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
30
- checks: [new ExperienceCheckTimeout({
31
- durationMs: 1500
32
- })]
33
- });
34
- };
35
-
36
- /**
37
- * This experience tracks when a reference sync block source info data (title, url) is fetched from the BE.
38
- *
39
- * Start: When the fetchSourceInfo function is called.
40
- * Success: When the fetching the data is successful within 2500ms of start.
41
- * Failure: When 2500ms passes without the data being successfully fetched, or the fetch fails
42
- */
43
- export var getFetchSourceInfoExperience = function getFetchSourceInfoExperience(dispatchAnalyticsEvent) {
44
- return new Experience(ACTION_SUBJECT.SYNCED_BLOCK, {
45
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_GET_SOURCE_INFO,
46
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
47
- checks: [new ExperienceCheckTimeout({
48
- durationMs: 2500
49
- })]
50
- });
51
- };
52
-
53
- /**
54
- * This experience tracks when a reference sync block is saved to the BE.
55
- *
56
- * Start: When the flush sync block function is called.
57
- * Success: When the sync block save is successful within 1500ms of start.
58
- * Failure: When 1500ms passes before the sync block save is marked as successful
59
- */
60
- export var getSaveReferenceExperience = function getSaveReferenceExperience(dispatchAnalyticsEvent) {
61
- return new Experience(ACTION_SUBJECT.SYNCED_BLOCK, {
62
- actionSubjectId: ACTION_SUBJECT_ID.REFERENCE_SYNCED_BLOCK_UPDATE,
63
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
64
- checks: [new ExperienceCheckTimeout({
65
- durationMs: 1500
66
- })]
67
- });
68
- };
@@ -1,30 +0,0 @@
1
- import { type DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
- import { Experience } from '@atlaskit/editor-common/experiences';
3
- import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
4
- import type { AnalyticsEventPayload as RendererAnalyticsEventPayload } from '@atlaskit/renderer';
5
- export declare const setupExperienceTracking: (syncBlockStoreManager: SyncBlockStoreManager, fireAnalyticsEvent?: ((payload: RendererAnalyticsEventPayload) => void)) => void;
6
- export declare const createExperienceDispatcher: (fireAnalyticsEvent?: ((payload: RendererAnalyticsEventPayload) => void)) => DispatchAnalyticsEvent;
7
- /**
8
- * This experience tracks when a reference sync block data is fetched from the BE.
9
- *
10
- * Start: When the fetchNodesData function is called.
11
- * Success: When the fetching the data is successful within 1500ms of start.
12
- * Failure: When 1500ms passes without the data being successfully fetched, or the fetch fails
13
- */
14
- export declare const getFetchExperience: (dispatchAnalyticsEvent: DispatchAnalyticsEvent) => Experience;
15
- /**
16
- * This experience tracks when a reference sync block source info data (title, url) is fetched from the BE.
17
- *
18
- * Start: When the fetchSourceInfo function is called.
19
- * Success: When the fetching the data is successful within 2500ms of start.
20
- * Failure: When 2500ms passes without the data being successfully fetched, or the fetch fails
21
- */
22
- export declare const getFetchSourceInfoExperience: (dispatchAnalyticsEvent: DispatchAnalyticsEvent) => Experience;
23
- /**
24
- * This experience tracks when a reference sync block is saved to the BE.
25
- *
26
- * Start: When the flush sync block function is called.
27
- * Success: When the sync block save is successful within 1500ms of start.
28
- * Failure: When 1500ms passes before the sync block save is marked as successful
29
- */
30
- export declare const getSaveReferenceExperience: (dispatchAnalyticsEvent: DispatchAnalyticsEvent) => Experience;
@@ -1,30 +0,0 @@
1
- import { type DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
- import { Experience } from '@atlaskit/editor-common/experiences';
3
- import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
4
- import type { AnalyticsEventPayload as RendererAnalyticsEventPayload } from '@atlaskit/renderer';
5
- export declare const setupExperienceTracking: (syncBlockStoreManager: SyncBlockStoreManager, fireAnalyticsEvent?: ((payload: RendererAnalyticsEventPayload) => void)) => void;
6
- export declare const createExperienceDispatcher: (fireAnalyticsEvent?: ((payload: RendererAnalyticsEventPayload) => void)) => DispatchAnalyticsEvent;
7
- /**
8
- * This experience tracks when a reference sync block data is fetched from the BE.
9
- *
10
- * Start: When the fetchNodesData function is called.
11
- * Success: When the fetching the data is successful within 1500ms of start.
12
- * Failure: When 1500ms passes without the data being successfully fetched, or the fetch fails
13
- */
14
- export declare const getFetchExperience: (dispatchAnalyticsEvent: DispatchAnalyticsEvent) => Experience;
15
- /**
16
- * This experience tracks when a reference sync block source info data (title, url) is fetched from the BE.
17
- *
18
- * Start: When the fetchSourceInfo function is called.
19
- * Success: When the fetching the data is successful within 2500ms of start.
20
- * Failure: When 2500ms passes without the data being successfully fetched, or the fetch fails
21
- */
22
- export declare const getFetchSourceInfoExperience: (dispatchAnalyticsEvent: DispatchAnalyticsEvent) => Experience;
23
- /**
24
- * This experience tracks when a reference sync block is saved to the BE.
25
- *
26
- * Start: When the flush sync block function is called.
27
- * Success: When the sync block save is successful within 1500ms of start.
28
- * Failure: When 1500ms passes before the sync block save is marked as successful
29
- */
30
- export declare const getSaveReferenceExperience: (dispatchAnalyticsEvent: DispatchAnalyticsEvent) => Experience;