@atlaskit/editor-common 107.3.2 → 107.4.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 107.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#177157](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/177157)
8
+ [`6bcf8912217df`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6bcf8912217df) -
9
+ ED-27284 additional integration with user preference plugin
10
+
3
11
  ## 107.3.2
4
12
 
5
13
  ### Patch Changes
@@ -0,0 +1,174 @@
1
+ {
2
+ "extends": "../../../../tsconfig.entry-points.volt.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "target": "es5",
6
+ "outDir": "../../../../../volt/tsDist/@atlaskit__editor-common/app",
7
+ "rootDir": "../",
8
+ "composite": true
9
+ },
10
+ "include": [
11
+ "../src/**/*.ts",
12
+ "../src/**/*.tsx"
13
+ ],
14
+ "exclude": [
15
+ "../src/**/__tests__/*",
16
+ "../src/**/*.test.*",
17
+ "../src/**/test.*"
18
+ ],
19
+ "references": [
20
+ {
21
+ "path": "../../activity-provider/afm-volt/tsconfig.json"
22
+ },
23
+ {
24
+ "path": "../../adf-utils/afm-volt/tsconfig.json"
25
+ },
26
+ {
27
+ "path": "../../../analytics/analytics-listeners/afm-volt/tsconfig.json"
28
+ },
29
+ {
30
+ "path": "../../../analytics/analytics-namespaced-context/afm-volt/tsconfig.json"
31
+ },
32
+ {
33
+ "path": "../../../analytics/analytics-next/afm-volt/tsconfig.json"
34
+ },
35
+ {
36
+ "path": "../../../uip/atlassian-context/afm-volt/tsconfig.json"
37
+ },
38
+ {
39
+ "path": "../../../design-system/button/afm-volt/tsconfig.json"
40
+ },
41
+ {
42
+ "path": "../../../design-system/code/afm-volt/tsconfig.json"
43
+ },
44
+ {
45
+ "path": "../../../monorepo-tooling/codemod-utils/afm-volt/tsconfig.json"
46
+ },
47
+ {
48
+ "path": "../../../design-system/css/afm-volt/tsconfig.json"
49
+ },
50
+ {
51
+ "path": "../../custom-steps/afm-volt/tsconfig.json"
52
+ },
53
+ {
54
+ "path": "../../../design-system/dropdown-menu/afm-volt/tsconfig.json"
55
+ },
56
+ {
57
+ "path": "../../editor-json-transformer/afm-volt/tsconfig.json"
58
+ },
59
+ {
60
+ "path": "../../editor-palette/afm-volt/tsconfig.json"
61
+ },
62
+ {
63
+ "path": "../../editor-shared-styles/afm-volt/tsconfig.json"
64
+ },
65
+ {
66
+ "path": "../../editor-tables/afm-volt/tsconfig.json"
67
+ },
68
+ {
69
+ "path": "../../../elements/emoji/afm-volt/tsconfig.json"
70
+ },
71
+ {
72
+ "path": "../../../design-system/icon/afm-volt/tsconfig.json"
73
+ },
74
+ {
75
+ "path": "../../../design-system/icon-object/afm-volt/tsconfig.json"
76
+ },
77
+ {
78
+ "path": "../../../design-system/link/afm-volt/tsconfig.json"
79
+ },
80
+ {
81
+ "path": "../../../linking-platform/link-datasource/afm-volt/tsconfig.json"
82
+ },
83
+ {
84
+ "path": "../../../linking-platform/link-picker/afm-volt/tsconfig.json"
85
+ },
86
+ {
87
+ "path": "../../../media/media-card/afm-volt/tsconfig.json"
88
+ },
89
+ {
90
+ "path": "../../../media/media-client/afm-volt/tsconfig.json"
91
+ },
92
+ {
93
+ "path": "../../../media/media-client-react/afm-volt/tsconfig.json"
94
+ },
95
+ {
96
+ "path": "../../../media/media-common/afm-volt/tsconfig.json"
97
+ },
98
+ {
99
+ "path": "../../../media/media-file-preview/afm-volt/tsconfig.json"
100
+ },
101
+ {
102
+ "path": "../../../media/media-picker/afm-volt/tsconfig.json"
103
+ },
104
+ {
105
+ "path": "../../../media/media-ui/afm-volt/tsconfig.json"
106
+ },
107
+ {
108
+ "path": "../../../media/media-viewer/afm-volt/tsconfig.json"
109
+ },
110
+ {
111
+ "path": "../../../elements/mention/afm-volt/tsconfig.json"
112
+ },
113
+ {
114
+ "path": "../../../design-system/menu/afm-volt/tsconfig.json"
115
+ },
116
+ {
117
+ "path": "../../../design-system/onboarding/afm-volt/tsconfig.json"
118
+ },
119
+ {
120
+ "path": "../../../platform/feature-flags/afm-volt/tsconfig.json"
121
+ },
122
+ {
123
+ "path": "../../../platform/feature-flags-react/afm-volt/tsconfig.json"
124
+ },
125
+ {
126
+ "path": "../../../design-system/popper/afm-volt/tsconfig.json"
127
+ },
128
+ {
129
+ "path": "../../../design-system/primitives/afm-volt/tsconfig.json"
130
+ },
131
+ {
132
+ "path": "../../../people-and-teams/profilecard/afm-volt/tsconfig.json"
133
+ },
134
+ {
135
+ "path": "../../../react-ufo/atlaskit/afm-volt/tsconfig.json"
136
+ },
137
+ {
138
+ "path": "../../../design-system/section-message/afm-volt/tsconfig.json"
139
+ },
140
+ {
141
+ "path": "../../../linking-platform/smart-card/afm-volt/tsconfig.json"
142
+ },
143
+ {
144
+ "path": "../../../smart-experiences/smart-user-picker/afm-volt/tsconfig.json"
145
+ },
146
+ {
147
+ "path": "../../../design-system/spinner/afm-volt/tsconfig.json"
148
+ },
149
+ {
150
+ "path": "../../../elements/task-decision/afm-volt/tsconfig.json"
151
+ },
152
+ {
153
+ "path": "../../../design-system/textfield/afm-volt/tsconfig.json"
154
+ },
155
+ {
156
+ "path": "../../../design-system/theme/afm-volt/tsconfig.json"
157
+ },
158
+ {
159
+ "path": "../../tmp-editor-statsig/afm-volt/tsconfig.json"
160
+ },
161
+ {
162
+ "path": "../../../design-system/tokens/afm-volt/tsconfig.json"
163
+ },
164
+ {
165
+ "path": "../../../design-system/tooltip/afm-volt/tsconfig.json"
166
+ },
167
+ {
168
+ "path": "../../../design-system/width-detector/afm-volt/tsconfig.json"
169
+ },
170
+ {
171
+ "path": "../../../media/media-core/afm-volt/tsconfig.json"
172
+ }
173
+ ]
174
+ }
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "107.3.1";
19
+ var packageVersion = "107.3.2";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // Ignored via go/ees007
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "107.3.1";
26
+ var packageVersion = "107.3.2";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -37,9 +37,10 @@ var UserPreferencesProvider = exports.UserPreferencesProvider = /*#__PURE__*/fun
37
37
  var initialUserPreferences = (_this$persistenceAPI$ = (_this$persistenceAPI = this.persistenceAPI).getInitialUserPreferences) === null || _this$persistenceAPI$ === void 0 ? void 0 : _this$persistenceAPI$.call(_this$persistenceAPI);
38
38
  if (initialUserPreferences) {
39
39
  this.setUserPreferences(initialUserPreferences);
40
- } else {
41
- this.loadPreferences();
42
40
  }
41
+ // the initial user preferences might come from the local cache,
42
+ // so we need to always load the preferences
43
+ this.loadPreferences();
43
44
  }
44
45
 
45
46
  /**
@@ -183,11 +184,11 @@ var UserPreferencesProvider = exports.UserPreferencesProvider = /*#__PURE__*/fun
183
184
  this.userPreferences = userPreferences;
184
185
  var hasUpdated = this.resolveUserPreferences();
185
186
  if (hasUpdated || !this.initialized) {
187
+ if (!this.initialized) {
188
+ this.initialized = true;
189
+ }
186
190
  this.notifyUserPreferencesUpdated();
187
191
  }
188
- if (!this.initialized) {
189
- this.initialized = true;
190
- }
191
192
  }
192
193
 
193
194
  /**
@@ -7,13 +7,18 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.mergeUserPreferences = exports.areUserPreferencesEqual = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _userPreferences = require("./user-preferences");
10
11
  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
12
  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
13
  var mergeUserPreferences = exports.mergeUserPreferences = function mergeUserPreferences(userPreferences, defaultPreferences) {
13
14
  var newResolvedUserPreferences = _objectSpread(_objectSpread({}, defaultPreferences), Object.fromEntries(Object.entries(userPreferences).filter(function (_ref) {
14
15
  var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
15
- v = _ref2[1];
16
- return v !== undefined && v !== null;
16
+ key = _ref2[0],
17
+ value = _ref2[1];
18
+ if (key === 'toolbarDockingPosition') {
19
+ return _userPreferences.TOOLBAR_DOCKING_POSITIONS.includes(value);
20
+ }
21
+ return value !== undefined && value !== null;
17
22
  })));
18
23
  return newResolvedUserPreferences;
19
24
  };
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "107.3.1";
4
+ const packageVersion = "107.3.2";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "107.3.1";
16
+ const packageVersion = "107.3.2";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -25,9 +25,10 @@ export class UserPreferencesProvider {
25
25
  const initialUserPreferences = (_this$persistenceAPI$ = (_this$persistenceAPI = this.persistenceAPI).getInitialUserPreferences) === null || _this$persistenceAPI$ === void 0 ? void 0 : _this$persistenceAPI$.call(_this$persistenceAPI);
26
26
  if (initialUserPreferences) {
27
27
  this.setUserPreferences(initialUserPreferences);
28
- } else {
29
- this.loadPreferences();
30
28
  }
29
+ // the initial user preferences might come from the local cache,
30
+ // so we need to always load the preferences
31
+ this.loadPreferences();
31
32
  }
32
33
 
33
34
  /**
@@ -116,11 +117,11 @@ export class UserPreferencesProvider {
116
117
  this.userPreferences = userPreferences;
117
118
  const hasUpdated = this.resolveUserPreferences();
118
119
  if (hasUpdated || !this.initialized) {
120
+ if (!this.initialized) {
121
+ this.initialized = true;
122
+ }
119
123
  this.notifyUserPreferencesUpdated();
120
124
  }
121
- if (!this.initialized) {
122
- this.initialized = true;
123
- }
124
125
  }
125
126
 
126
127
  /**
@@ -1,7 +1,13 @@
1
+ import { TOOLBAR_DOCKING_POSITIONS } from './user-preferences';
1
2
  export const mergeUserPreferences = (userPreferences, defaultPreferences) => {
2
3
  const newResolvedUserPreferences = {
3
4
  ...defaultPreferences,
4
- ...Object.fromEntries(Object.entries(userPreferences).filter(([, v]) => v !== undefined && v !== null))
5
+ ...Object.fromEntries(Object.entries(userPreferences).filter(([key, value]) => {
6
+ if (key === 'toolbarDockingPosition') {
7
+ return TOOLBAR_DOCKING_POSITIONS.includes(value);
8
+ }
9
+ return value !== undefined && value !== null;
10
+ }))
5
11
  };
6
12
  return newResolvedUserPreferences;
7
13
  };
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "107.3.1";
10
+ var packageVersion = "107.3.2";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "107.3.1";
23
+ var packageVersion = "107.3.2";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -30,9 +30,10 @@ export var UserPreferencesProvider = /*#__PURE__*/function () {
30
30
  var initialUserPreferences = (_this$persistenceAPI$ = (_this$persistenceAPI = this.persistenceAPI).getInitialUserPreferences) === null || _this$persistenceAPI$ === void 0 ? void 0 : _this$persistenceAPI$.call(_this$persistenceAPI);
31
31
  if (initialUserPreferences) {
32
32
  this.setUserPreferences(initialUserPreferences);
33
- } else {
34
- this.loadPreferences();
35
33
  }
34
+ // the initial user preferences might come from the local cache,
35
+ // so we need to always load the preferences
36
+ this.loadPreferences();
36
37
  }
37
38
 
38
39
  /**
@@ -176,11 +177,11 @@ export var UserPreferencesProvider = /*#__PURE__*/function () {
176
177
  this.userPreferences = userPreferences;
177
178
  var hasUpdated = this.resolveUserPreferences();
178
179
  if (hasUpdated || !this.initialized) {
180
+ if (!this.initialized) {
181
+ this.initialized = true;
182
+ }
179
183
  this.notifyUserPreferencesUpdated();
180
184
  }
181
- if (!this.initialized) {
182
- this.initialized = true;
183
- }
184
185
  }
185
186
 
186
187
  /**
@@ -2,11 +2,16 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  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; }
4
4
  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; }
5
+ import { TOOLBAR_DOCKING_POSITIONS } from './user-preferences';
5
6
  export var mergeUserPreferences = function mergeUserPreferences(userPreferences, defaultPreferences) {
6
7
  var newResolvedUserPreferences = _objectSpread(_objectSpread({}, defaultPreferences), Object.fromEntries(Object.entries(userPreferences).filter(function (_ref) {
7
8
  var _ref2 = _slicedToArray(_ref, 2),
8
- v = _ref2[1];
9
- return v !== undefined && v !== null;
9
+ key = _ref2[0],
10
+ value = _ref2[1];
11
+ if (key === 'toolbarDockingPosition') {
12
+ return TOOLBAR_DOCKING_POSITIONS.includes(value);
13
+ }
14
+ return value !== undefined && value !== null;
10
15
  })));
11
16
  return newResolvedUserPreferences;
12
17
  };
@@ -1,4 +1,4 @@
1
- import type { ResolvedUserPreferences, UserPreferences } from './user-preferences';
1
+ import { type ResolvedUserPreferences, type UserPreferences } from './user-preferences';
2
2
  export declare const mergeUserPreferences: (userPreferences: UserPreferences, defaultPreferences: ResolvedUserPreferences) => ResolvedUserPreferences;
3
3
  /**
4
4
  * Compare two user preferences objects
@@ -1,4 +1,4 @@
1
- import type { ResolvedUserPreferences, UserPreferences } from './user-preferences';
1
+ import { type ResolvedUserPreferences, type UserPreferences } from './user-preferences';
2
2
  export declare const mergeUserPreferences: (userPreferences: UserPreferences, defaultPreferences: ResolvedUserPreferences) => ResolvedUserPreferences;
3
3
  /**
4
4
  * Compare two user preferences objects
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "107.3.2",
3
+ "version": "107.4.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -26,8 +26,7 @@
26
26
  "atlaskit:src": "src/index.ts",
27
27
  "atlassian": {
28
28
  "team": "Editor",
29
- "singleton": true,
30
- "runReact18": true
29
+ "singleton": true
31
30
  },
32
31
  "af:exports": {
33
32
  "./i18n": "./src/i18n/index.ts",
@@ -164,7 +163,7 @@
164
163
  "@atlaskit/profilecard": "^23.21.0",
165
164
  "@atlaskit/react-ufo": "^3.14.0",
166
165
  "@atlaskit/section-message": "^8.2.0",
167
- "@atlaskit/smart-card": "^38.19.0",
166
+ "@atlaskit/smart-card": "^38.20.0",
168
167
  "@atlaskit/smart-user-picker": "^8.0.0",
169
168
  "@atlaskit/spinner": "^18.0.0",
170
169
  "@atlaskit/task-decision": "^19.2.0",