@atlaskit/adf-schema 52.2.1 → 52.2.3

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,19 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 52.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`bf1bed54d14bd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bf1bed54d14bd) -
8
+ Remove platform_editor_safe_url_trim_fix feature flag
9
+ - Updated dependencies
10
+
11
+ ## 52.2.2
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 52.2.1
4
18
 
5
19
  ### Patch Changes
@@ -1,6 +1,7 @@
1
- import { createTransformer } from '@atlaskit/codemod-utils';
1
+ import { createTransformer, type API, type FileInfo, type Options } from '@atlaskit/codemod-utils';
2
2
  import { updateImportEntryPointsForBitbucketSchema } from './migrates/update-bitbucket-schema-entry-points';
3
3
 
4
- const transformer = createTransformer(updateImportEntryPointsForBitbucketSchema);
4
+ const transformer: (fileInfo: FileInfo, { jscodeshift }: API, options: Options) => string =
5
+ createTransformer(updateImportEntryPointsForBitbucketSchema);
5
6
 
6
7
  export default transformer;
@@ -1,6 +1,7 @@
1
- import { createTransformer } from '@atlaskit/codemod-utils';
1
+ import { createTransformer, type API, type FileInfo, type Options } from '@atlaskit/codemod-utils';
2
2
  import { updateImportEntryPointsForConfluenceSchema } from './migrates/update-confluence-schema-entry-points';
3
3
 
4
- const transformer = createTransformer(updateImportEntryPointsForConfluenceSchema);
4
+ const transformer: (fileInfo: FileInfo, { jscodeshift }: API, options: Options) => string =
5
+ createTransformer(updateImportEntryPointsForConfluenceSchema);
5
6
 
6
7
  export default transformer;
@@ -1,6 +1,7 @@
1
- import { createTransformer } from '@atlaskit/codemod-utils';
1
+ import { createTransformer, type API, type FileInfo, type Options } from '@atlaskit/codemod-utils';
2
2
  import { updateImportEntryPointsForDefaultSchema } from './migrates/update-default-schema-entry-points';
3
3
 
4
- const transformer = createTransformer(updateImportEntryPointsForDefaultSchema);
4
+ const transformer: (fileInfo: FileInfo, { jscodeshift }: API, options: Options) => string =
5
+ createTransformer(updateImportEntryPointsForDefaultSchema);
5
6
 
6
7
  export default transformer;
@@ -1,6 +1,7 @@
1
- import { createTransformer } from '@atlaskit/codemod-utils';
1
+ import { createTransformer, type API, type FileInfo, type Options } from '@atlaskit/codemod-utils';
2
2
  import { updateImportEntryPointsForJiraSchema } from './migrates/update-jira-schema-entry-points';
3
3
 
4
- const transformer = createTransformer(updateImportEntryPointsForJiraSchema);
4
+ const transformer: (fileInfo: FileInfo, { jscodeshift }: API, options: Options) => string =
5
+ createTransformer(updateImportEntryPointsForJiraSchema);
5
6
 
6
7
  export default transformer;
@@ -1,6 +1,9 @@
1
- import { changeImportEntryPoint } from '@atlaskit/codemod-utils';
1
+ import { changeImportEntryPoint, type JSCodeshift, type Collection } from '@atlaskit/codemod-utils';
2
2
 
3
- export const updateImportEntryPointsForBitbucketSchema = [
3
+ export const updateImportEntryPointsForBitbucketSchema: ((
4
+ j: JSCodeshift,
5
+ root: Collection<Node>,
6
+ ) => void)[] = [
4
7
  changeImportEntryPoint(
5
8
  '@atlaskit/adf-schema',
6
9
  'bitbucketSchema',
@@ -1,6 +1,9 @@
1
- import { changeImportEntryPoint } from '@atlaskit/codemod-utils';
1
+ import { changeImportEntryPoint, type JSCodeshift, type Collection } from '@atlaskit/codemod-utils';
2
2
 
3
- export const updateImportEntryPointsForConfluenceSchema = [
3
+ export const updateImportEntryPointsForConfluenceSchema: ((
4
+ j: JSCodeshift,
5
+ root: Collection<Node>,
6
+ ) => void)[] = [
4
7
  changeImportEntryPoint(
5
8
  '@atlaskit/adf-schema',
6
9
  'confluenceSchema',
@@ -1,6 +1,9 @@
1
- import { changeImportEntryPoint } from '@atlaskit/codemod-utils';
1
+ import { changeImportEntryPoint, type JSCodeshift, type Collection } from '@atlaskit/codemod-utils';
2
2
 
3
- export const updateImportEntryPointsForDefaultSchema = [
3
+ export const updateImportEntryPointsForDefaultSchema: ((
4
+ j: JSCodeshift,
5
+ root: Collection<Node>,
6
+ ) => void)[] = [
4
7
  changeImportEntryPoint(
5
8
  '@atlaskit/adf-schema',
6
9
  'defaultSchema',
@@ -1,6 +1,9 @@
1
- import { changeImportEntryPoint } from '@atlaskit/codemod-utils';
1
+ import { changeImportEntryPoint, type JSCodeshift, type Collection } from '@atlaskit/codemod-utils';
2
2
 
3
- export const updateImportEntryPointsForJiraSchema = [
3
+ export const updateImportEntryPointsForJiraSchema: ((
4
+ j: JSCodeshift,
5
+ root: Collection<Node>,
6
+ ) => void)[] = [
4
7
  changeImportEntryPoint(
5
8
  '@atlaskit/adf-schema',
6
9
  'createJIRASchema',
@@ -10,7 +10,6 @@ exports.isRootRelative = isRootRelative;
10
10
  exports.linkifyMatch = exports.linkify = exports.isSafeUrl = void 0;
11
11
  exports.normalizeUrl = normalizeUrl;
12
12
  var _linkifyIt = _interopRequireDefault(require("linkify-it"));
13
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
13
  /**
15
14
  * This file has been partially duplicated in packages/linking-platform/linking-common/src/url.ts
16
15
  * Any changes made here should be mirrored there.
@@ -29,11 +28,9 @@ var whitelistedURLPatterns = [/^http[s\u017F]?:\/\//im, /^ftp[s\u017F]?:\/\//im,
29
28
  */
30
29
  var isSafeUrl = exports.isSafeUrl = function isSafeUrl(url) {
31
30
  var urlTrimmed = url === null || url === void 0 ? void 0 : url.trim();
32
- if (urlTrimmed === undefined && (0, _expValEquals.expValEquals)('platform_editor_safe_url_trim_fix', 'isEnabled', true)) {
31
+ if (urlTrimmed === undefined) {
33
32
  return true;
34
33
  }
35
-
36
- // remove cast to string once we remove the experiment, as urlTrimmed will never be undefined at that point
37
34
  if (urlTrimmed.length === 0) {
38
35
  return true;
39
36
  }
@@ -1,4 +1,4 @@
1
- import { MarkExcludesNone, adfMark } from '@atlaskit/adf-schema-generator';
1
+ import { adfMark, MarkExcludesNone } from '@atlaskit/adf-schema-generator';
2
2
  export const fragment = adfMark('fragment').define({
3
3
  inclusive: false,
4
4
  excludes: MarkExcludesNone,
@@ -5,7 +5,6 @@
5
5
  * Ticket for fixing linkification of filename-like urls: https://product-fabric.atlassian.net/browse/EDM-7190
6
6
  */
7
7
  import LinkifyIt from 'linkify-it';
8
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
8
  const whitelistedURLPatterns = [/^https?:\/\//imu, /^ftps?:\/\//imu, /^gopher:\/\//imu, /^integrity:\/\//imu, /^file:\/\//imu, /^smb:\/\//imu, /^dynamicsnav:\/\//imu, /^jamfselfservice:\/\//imu, /^\//imu, /^mailto:/imu, /^skype:/imu, /^callto:/imu, /^facetime:/imu, /^git:/imu, /^irc6?:/imu, /^news:/imu, /^nntp:/imu, /^feed:/imu, /^cvs:/imu, /^svn:/imu, /^mvn:/imu, /^ssh:/imu, /^scp:\/\//imu, /^sftp:\/\//imu, /^itms:/imu,
10
9
  // This is not a valid notes link, but we support this pattern for backwards compatibility
11
10
  /^notes:/imu, /^notes:\/\//imu, /^hipchat:\/\//imu,
@@ -17,11 +16,9 @@ const whitelistedURLPatterns = [/^https?:\/\//imu, /^ftps?:\/\//imu, /^gopher:\/
17
16
  */
18
17
  export const isSafeUrl = url => {
19
18
  const urlTrimmed = url === null || url === void 0 ? void 0 : url.trim();
20
- if (urlTrimmed === undefined && expValEquals('platform_editor_safe_url_trim_fix', 'isEnabled', true)) {
19
+ if (urlTrimmed === undefined) {
21
20
  return true;
22
21
  }
23
-
24
- // remove cast to string once we remove the experiment, as urlTrimmed will never be undefined at that point
25
22
  if (urlTrimmed.length === 0) {
26
23
  return true;
27
24
  }
@@ -1,4 +1,4 @@
1
- import { MarkExcludesNone, adfMark } from '@atlaskit/adf-schema-generator';
1
+ import { adfMark, MarkExcludesNone } from '@atlaskit/adf-schema-generator';
2
2
  export var fragment = adfMark('fragment').define({
3
3
  inclusive: false,
4
4
  excludes: MarkExcludesNone,
@@ -5,7 +5,6 @@
5
5
  * Ticket for fixing linkification of filename-like urls: https://product-fabric.atlassian.net/browse/EDM-7190
6
6
  */
7
7
  import LinkifyIt from 'linkify-it';
8
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
8
  var whitelistedURLPatterns = [/^http[s\u017F]?:\/\//im, /^ftp[s\u017F]?:\/\//im, /^gopher:\/\//im, /^integrity:\/\//im, /^file:\/\//im, /^[s\u017F]mb:\/\//im, /^dynamic[s\u017F]nav:\/\//im, /^jamf[s\u017F]elf[s\u017F]ervice:\/\//im, /^\//im, /^mailto:/im, /^[s\u017F][k\u212A]ype:/im, /^callto:/im, /^facetime:/im, /^git:/im, /^irc6?:/im, /^new[s\u017F]:/im, /^nntp:/im, /^feed:/im, /^cv[s\u017F]:/im, /^[s\u017F]vn:/im, /^mvn:/im, /^[s\u017F][s\u017F]h:/im, /^[s\u017F]cp:\/\//im, /^[s\u017F]ftp:\/\//im, /^itm[s\u017F]:/im,
10
9
  // This is not a valid notes link, but we support this pattern for backwards compatibility
11
10
  /^note[s\u017F]:/im, /^note[s\u017F]:\/\//im, /^hipchat:\/\//im,
@@ -17,11 +16,9 @@ var whitelistedURLPatterns = [/^http[s\u017F]?:\/\//im, /^ftp[s\u017F]?:\/\//im,
17
16
  */
18
17
  export var isSafeUrl = function isSafeUrl(url) {
19
18
  var urlTrimmed = url === null || url === void 0 ? void 0 : url.trim();
20
- if (urlTrimmed === undefined && expValEquals('platform_editor_safe_url_trim_fix', 'isEnabled', true)) {
19
+ if (urlTrimmed === undefined) {
21
20
  return true;
22
21
  }
23
-
24
- // remove cast to string once we remove the experiment, as urlTrimmed will never be undefined at that point
25
22
  if (urlTrimmed.length === 0) {
26
23
  return true;
27
24
  }
@@ -1,3 +1,4 @@
1
+ import { type ADFMark, type ADFMarkSpec } from '@atlaskit/adf-schema-generator';
1
2
  /**
2
3
  * fontSize mark - applies size styling to block-level content
3
4
  *
@@ -13,4 +14,4 @@
13
14
  * }
14
15
  * ```
15
16
  */
16
- export declare const fontSize: import("@atlaskit/adf-schema-generator").ADFMark<import("@atlaskit/adf-schema-generator").ADFMarkSpec>;
17
+ export declare const fontSize: ADFMark<ADFMarkSpec>;
@@ -1,2 +1,2 @@
1
- import type { ADFMark, ADFMarkSpec } from '@atlaskit/adf-schema-generator';
1
+ import { type ADFMark, type ADFMarkSpec } from '@atlaskit/adf-schema-generator';
2
2
  export declare const fragment: ADFMark<ADFMarkSpec>;
@@ -1,3 +1,4 @@
1
+ import { type ADFMark, type ADFMarkSpec } from '@atlaskit/adf-schema-generator';
1
2
  /**
2
3
  * fontSize mark - applies size styling to block-level content
3
4
  *
@@ -13,4 +14,4 @@
13
14
  * }
14
15
  * ```
15
16
  */
16
- export declare const fontSize: import("@atlaskit/adf-schema-generator").ADFMark<import("@atlaskit/adf-schema-generator").ADFMarkSpec>;
17
+ export declare const fontSize: ADFMark<ADFMarkSpec>;
@@ -1,2 +1,2 @@
1
- import type { ADFMark, ADFMarkSpec } from '@atlaskit/adf-schema-generator';
1
+ import { type ADFMark, type ADFMarkSpec } from '@atlaskit/adf-schema-generator';
2
2
  export declare const fragment: ADFMark<ADFMarkSpec>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "52.2.1",
3
+ "version": "52.2.3",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "@atlaskit/adf-schema-generator": "^2.1.0",
44
44
  "@atlaskit/editor-prosemirror": "^7.3.0",
45
- "@atlaskit/tmp-editor-statsig": "^34.0.0",
45
+ "@atlaskit/tmp-editor-statsig": "^35.10.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "css-color-names": "0.0.4",
48
48
  "linkify-it": "^3.0.3",
@@ -1,4 +1,7 @@
1
- export const filterAndSortMarks = (marks: string, excluded: string[] = []) => {
1
+ export const filterAndSortMarks: (marks: string, excluded?: string[]) => string = (
2
+ marks: string,
3
+ excluded: string[] = [],
4
+ ) => {
2
5
  return marks
3
6
  .split(' ')
4
7
  .filter((v) => !excluded.includes(v))
@@ -110,7 +113,10 @@ const expFormatter =
110
113
  * @param skipLists a list contains node name can be removed from contents string
111
114
  * @returns sorted content string, without node defined in skipList
112
115
  */
113
- export const formatContent = (content: string, skipLists: string[] = []) => {
116
+ export const formatContent: (content: string, skipLists?: string[]) => string = (
117
+ content: string,
118
+ skipLists: string[] = [],
119
+ ) => {
114
120
  const result = content.replace(/\s*\|\s*/gu, '|');
115
121
  if (result.includes(' ')) {
116
122
  return result.split(' ').map(expFormatter(skipLists)).join(' ').trim();