@atlaskit/editor-plugin-ufo 1.0.0 → 1.0.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-ufo
2
2
 
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#180148](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/180148)
8
+ [`15b8dada9a3cf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/15b8dada9a3cf) -
9
+ [ED-26066] Disable the plugin for SSR enviroments
10
+
3
11
  ## 1.0.0
4
12
 
5
13
  ### Major Changes
@@ -0,0 +1,30 @@
1
+ {
2
+ "extends": "../../../../tsconfig.entry-points.jira.json",
3
+ "compilerOptions": {
4
+ "target": "es5",
5
+ "outDir": "../../../../../tsDist/@atlaskit__editor-plugin-ufo/app",
6
+ "rootDir": "../",
7
+ "composite": true
8
+ },
9
+ "include": [
10
+ "../src/**/*.ts",
11
+ "../src/**/*.tsx"
12
+ ],
13
+ "exclude": [
14
+ "../src/**/__tests__/*",
15
+ "../src/**/*.test.*",
16
+ "../src/**/test.*",
17
+ "../src/**/examples.*"
18
+ ],
19
+ "references": [
20
+ {
21
+ "path": "../../editor-common/afm-jira/tsconfig.json"
22
+ },
23
+ {
24
+ "path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
25
+ },
26
+ {
27
+ "path": "../../../react-ufo/atlaskit/afm-jira/tsconfig.json"
28
+ }
29
+ ]
30
+ }
@@ -43,6 +43,9 @@ var ttvcAbort = function ttvcAbort() {
43
43
  vc.abortCalculation();
44
44
  };
45
45
  var disableTTVCOnFirstUserInteraction = exports.disableTTVCOnFirstUserInteraction = function disableTTVCOnFirstUserInteraction() {
46
+ if (typeof window.AbortController !== 'function') {
47
+ return;
48
+ }
46
49
  var unbindCallbacks = new Set();
47
50
  var controller = new AbortController();
48
51
  var unbindFirstInteractionEvents = function unbindFirstInteractionEvents() {
@@ -6,11 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.ufoPlugin = void 0;
7
7
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
8
8
  var _disableTTVCOnFirstUserInteraction = require("./pm-plugins/disableTTVCOnFirstUserInteraction");
9
+ var _process;
10
+ var isSSR = Boolean((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.REACT_SSR);
9
11
  var ufoPlugin = exports.ufoPlugin = function ufoPlugin() {
10
12
  return {
11
13
  name: 'ufo',
12
14
  pmPlugins: function pmPlugins() {
13
- if (!(0, _platformFeatureFlags.fg)('platform_editor_abort_ttvc_on_user_interaction')) {
15
+ // We don't need to use this code for Serve Side Rendering
16
+ if (isSSR || !(0, _platformFeatureFlags.fg)('platform_editor_abort_ttvc_on_user_interaction')) {
14
17
  return [];
15
18
  }
16
19
  return [{
@@ -36,6 +36,9 @@ const ttvcAbort = () => {
36
36
  vc.abortCalculation();
37
37
  };
38
38
  export const disableTTVCOnFirstUserInteraction = () => {
39
+ if (typeof window.AbortController !== 'function') {
40
+ return;
41
+ }
39
42
  const unbindCallbacks = new Set();
40
43
  const controller = new AbortController();
41
44
  const unbindFirstInteractionEvents = () => {
@@ -1,9 +1,12 @@
1
+ var _process, _process$env;
1
2
  import { fg } from '@atlaskit/platform-feature-flags';
2
3
  import { disableTTVCOnFirstUserInteraction } from './pm-plugins/disableTTVCOnFirstUserInteraction';
4
+ const isSSR = Boolean((_process = process) === null || _process === void 0 ? void 0 : (_process$env = _process.env) === null || _process$env === void 0 ? void 0 : _process$env.REACT_SSR);
3
5
  export const ufoPlugin = () => ({
4
6
  name: 'ufo',
5
7
  pmPlugins() {
6
- if (!fg('platform_editor_abort_ttvc_on_user_interaction')) {
8
+ // We don't need to use this code for Serve Side Rendering
9
+ if (isSSR || !fg('platform_editor_abort_ttvc_on_user_interaction')) {
7
10
  return [];
8
11
  }
9
12
  return [{
@@ -36,6 +36,9 @@ var ttvcAbort = function ttvcAbort() {
36
36
  vc.abortCalculation();
37
37
  };
38
38
  export var disableTTVCOnFirstUserInteraction = function disableTTVCOnFirstUserInteraction() {
39
+ if (typeof window.AbortController !== 'function') {
40
+ return;
41
+ }
39
42
  var unbindCallbacks = new Set();
40
43
  var controller = new AbortController();
41
44
  var unbindFirstInteractionEvents = function unbindFirstInteractionEvents() {
@@ -1,10 +1,13 @@
1
+ var _process;
1
2
  import { fg } from '@atlaskit/platform-feature-flags';
2
3
  import { disableTTVCOnFirstUserInteraction } from './pm-plugins/disableTTVCOnFirstUserInteraction';
4
+ var isSSR = Boolean((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.REACT_SSR);
3
5
  export var ufoPlugin = function ufoPlugin() {
4
6
  return {
5
7
  name: 'ufo',
6
8
  pmPlugins: function pmPlugins() {
7
- if (!fg('platform_editor_abort_ttvc_on_user_interaction')) {
9
+ // We don't need to use this code for Serve Side Rendering
10
+ if (isSSR || !fg('platform_editor_abort_ttvc_on_user_interaction')) {
8
11
  return [];
9
12
  }
10
13
  return [{
@@ -1,2 +1,2 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- export declare const disableTTVCOnFirstUserInteraction: () => SafePlugin<any>;
2
+ export declare const disableTTVCOnFirstUserInteraction: () => SafePlugin<any> | undefined;
@@ -1,2 +1,2 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- export declare const disableTTVCOnFirstUserInteraction: () => SafePlugin<any>;
2
+ export declare const disableTTVCOnFirstUserInteraction: () => SafePlugin<any> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-ufo",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Ufo plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -70,6 +70,9 @@ const ttvcAbort = () => {
70
70
  };
71
71
 
72
72
  export const disableTTVCOnFirstUserInteraction = () => {
73
+ if (typeof window.AbortController !== 'function') {
74
+ return;
75
+ }
73
76
  const unbindCallbacks: Set<() => void> = new Set();
74
77
  const controller = new AbortController();
75
78
  const unbindFirstInteractionEvents = () => {
package/src/ufoPlugin.tsx CHANGED
@@ -3,11 +3,14 @@ import { fg } from '@atlaskit/platform-feature-flags';
3
3
  import { disableTTVCOnFirstUserInteraction } from './pm-plugins/disableTTVCOnFirstUserInteraction';
4
4
  import type { UfoPlugin } from './ufoPluginType';
5
5
 
6
+ const isSSR = Boolean(process?.env?.REACT_SSR);
7
+
6
8
  export const ufoPlugin: UfoPlugin = () => ({
7
9
  name: 'ufo',
8
10
 
9
11
  pmPlugins() {
10
- if (!fg('platform_editor_abort_ttvc_on_user_interaction')) {
12
+ // We don't need to use this code for Serve Side Rendering
13
+ if (isSSR || !fg('platform_editor_abort_ttvc_on_user_interaction')) {
11
14
  return [];
12
15
  }
13
16
 
@@ -0,0 +1,45 @@
1
+ {
2
+ "extends": "../../../tsconfig.base.json",
3
+ "include": ["./src/**/*.ts", "./src/**/*.tsx"],
4
+ "exclude": [
5
+ "**/docs/**/*",
6
+ "**/__tests__/**/*",
7
+ "**/vr-tests/**/*",
8
+ "**/__perf__/**/*",
9
+ "**/*.test.*",
10
+ "**/test.*",
11
+ "**/test-*",
12
+ "**/examples.ts",
13
+ "**/examples.tsx",
14
+ "**/examples/*.ts",
15
+ "**/examples/*.tsx",
16
+ "**/examples/**/*.ts",
17
+ "**/examples/**/*.tsx",
18
+ "**/storybook/**/*",
19
+ "**/constellation/**/*",
20
+ ".storybook/*",
21
+ "./__fixtures__/**/*",
22
+ "./__generated__/**/*",
23
+ "./mocks/**/*",
24
+ "./__mocks__/**/*",
25
+ "**/mock.*",
26
+ "**/codemods/**/*.ts",
27
+ "**/codemods/**/*.tsx"
28
+ ],
29
+ "compilerOptions": {
30
+ "baseUrl": "",
31
+ "composite": true,
32
+ "outDir": "../../../tsDist/@atlaskit__editor-plugin-ufo/app"
33
+ },
34
+ "references": [
35
+ {
36
+ "path": "../editor-common/tsconfig.app.json"
37
+ },
38
+ {
39
+ "path": "../../platform/feature-flags/tsconfig.app.json"
40
+ },
41
+ {
42
+ "path": "../../react-ufo/atlaskit/tsconfig.app.json"
43
+ }
44
+ ]
45
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "extends": "../../../tsconfig.base.json",
3
+ "include": [
4
+ "**/docs/**/*",
5
+ "**/__tests__/**/*",
6
+ "**/vr-tests/**/*",
7
+ "**/__perf__/**/*",
8
+ "**/*.test.*",
9
+ "**/test.*",
10
+ "**/test-*",
11
+ "**/examples.ts",
12
+ "**/examples.tsx",
13
+ "**/examples/*.ts",
14
+ "**/examples/*.tsx",
15
+ "**/examples/**/*.ts",
16
+ "**/examples/**/*.tsx",
17
+ "**/storybook/**/*",
18
+ "**/constellation/**/*",
19
+ ".storybook/*",
20
+ "./__fixtures__/**/*",
21
+ "./__generated__/**/*",
22
+ "./mocks/**/*",
23
+ "./__mocks__/**/*",
24
+ "**/mock.*",
25
+ "**/codemods/**/*.ts",
26
+ "**/codemods/**/*.tsx"
27
+ ],
28
+ "exclude": ["./dist/**/*", "./build/**/*", "./node_modules/**/*"],
29
+ "compilerOptions": {
30
+ "baseUrl": "",
31
+ "composite": true,
32
+ "outDir": "../../../tsDist/@atlaskit__editor-plugin-ufo/dev"
33
+ },
34
+ "references": [
35
+ {
36
+ "path": "./tsconfig.app.json"
37
+ }
38
+ ]
39
+ }