@atlaskit/editor-slack-transformer 3.0.0 → 3.1.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,11 @@
1
1
  # @atlaskit/editor-slack-transformer
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`95c8a998ef1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/95c8a998ef1) - Inline cards with url type attributes are sent as links. Adding a new row after embedded card
8
+
3
9
  ## 3.0.0
4
10
 
5
11
  ### Major Changes
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.marks = exports.nodes = exports.MarkdownSerializer = exports.MarkdownSerializerState = void 0;
8
+ exports.nodes = exports.marks = exports.MarkdownSerializerState = exports.MarkdownSerializer = void 0;
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
@@ -97,11 +97,17 @@ var unsupportedNodes = {
97
97
  state.write('[block card]');
98
98
  state.closeBlock(node);
99
99
  },
100
- embedCard: function embedCard(state) {
100
+ embedCard: function embedCard(state, node) {
101
101
  state.write('[embedded card]');
102
+ state.closeBlock(node);
102
103
  },
103
- inlineCard: function inlineCard(state) {
104
- state.write('[inline card]');
104
+
105
+ /**
106
+ * Inline cards with url type attributes will be sent as a link
107
+ */
108
+ inlineCard: function inlineCard(state, node) {
109
+ var content = node.attrs.url ? "[<".concat(node.attrs.url, "|inline card>]") : '[inline card]';
110
+ state.write(content);
105
111
  },
106
112
  inlineExtension: function inlineExtension(state) {
107
113
  state.write('[inline extension]');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-slack-transformer",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "sideEffects": false
5
5
  }
@@ -37,12 +37,17 @@ const unsupportedNodes = {
37
37
  state.closeBlock(node);
38
38
  },
39
39
 
40
- embedCard(state) {
40
+ embedCard(state, node) {
41
41
  state.write('[embedded card]');
42
+ state.closeBlock(node);
42
43
  },
43
44
 
44
- inlineCard(state) {
45
- state.write('[inline card]');
45
+ /**
46
+ * Inline cards with url type attributes will be sent as a link
47
+ */
48
+ inlineCard(state, node) {
49
+ const content = node.attrs.url ? `[<${node.attrs.url}|inline card>]` : '[inline card]';
50
+ state.write(content);
46
51
  },
47
52
 
48
53
  inlineExtension(state) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-slack-transformer",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "sideEffects": false
5
5
  }
@@ -80,11 +80,17 @@ var unsupportedNodes = {
80
80
  state.write('[block card]');
81
81
  state.closeBlock(node);
82
82
  },
83
- embedCard: function embedCard(state) {
83
+ embedCard: function embedCard(state, node) {
84
84
  state.write('[embedded card]');
85
+ state.closeBlock(node);
85
86
  },
86
- inlineCard: function inlineCard(state) {
87
- state.write('[inline card]');
87
+
88
+ /**
89
+ * Inline cards with url type attributes will be sent as a link
90
+ */
91
+ inlineCard: function inlineCard(state, node) {
92
+ var content = node.attrs.url ? "[<".concat(node.attrs.url, "|inline card>]") : '[inline card]';
93
+ state.write(content);
88
94
  },
89
95
  inlineExtension: function inlineExtension(state) {
90
96
  state.write('[inline extension]');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-slack-transformer",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "sideEffects": false
5
5
  }
@@ -11,8 +11,11 @@ export declare class MarkdownSerializer extends PMMarkdownSerializer {
11
11
  export declare const nodes: {
12
12
  table(state: MarkdownSerializerState, node: PMNode): void;
13
13
  blockCard(state: MarkdownSerializerState, node: PMNode): void;
14
- embedCard(state: MarkdownSerializerState): void;
15
- inlineCard(state: MarkdownSerializerState): void;
14
+ embedCard(state: MarkdownSerializerState, node: PMNode): void;
15
+ /**
16
+ * Inline cards with url type attributes will be sent as a link
17
+ */
18
+ inlineCard(state: MarkdownSerializerState, node: PMNode): void;
16
19
  inlineExtension(state: MarkdownSerializerState): void;
17
20
  mediaInline(state: MarkdownSerializerState): void;
18
21
  extension(state: MarkdownSerializerState, node: PMNode): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-slack-transformer",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Editor Slack transformer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -15,7 +15,7 @@
15
15
  "sideEffects": false,
16
16
  "atlaskit:src": "src/index.ts",
17
17
  "atlassian": {
18
- "team": "ADF Systems",
18
+ "team": "Editor Services",
19
19
  "inPublicMirror": true,
20
20
  "releaseModel": "continuous",
21
21
  "website": {
@@ -32,13 +32,13 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@atlaskit/activity": "^1.0.1",
35
- "@atlaskit/adf-schema": "^20.0.0",
35
+ "@atlaskit/adf-schema": "^20.1.0",
36
36
  "@atlaskit/docs": "*",
37
- "@atlaskit/editor-common": "^61.0.0",
38
- "@atlaskit/editor-core": "^152.0.0",
39
- "@atlaskit/editor-test-helpers": "^15.6.0",
40
- "@atlaskit/emoji": "^63.1.0",
41
- "@atlaskit/smart-card": "^16.3.0",
37
+ "@atlaskit/editor-common": "^62.1.0",
38
+ "@atlaskit/editor-core": "^153.1.0",
39
+ "@atlaskit/editor-test-helpers": "^16.0.0",
40
+ "@atlaskit/emoji": "^64.0.0",
41
+ "@atlaskit/smart-card": "^17.0.0",
42
42
  "@atlaskit/theme": "^12.0.0",
43
43
  "@atlaskit/util-data-test": "^17.0.0",
44
44
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",