@atlaskit/adf-schema 35.1.0 → 35.2.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 +12 -0
- package/dist/cjs/schema/default-schema.js +3 -1
- package/dist/cjs/schema/marks/border.js +5 -3
- package/dist/es2019/schema/default-schema.js +4 -2
- package/dist/es2019/schema/marks/border.js +5 -3
- package/dist/esm/schema/default-schema.js +4 -2
- package/dist/esm/schema/marks/border.js +5 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 35.2.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- b241b07: Add inline support for border mark
|
8
|
+
|
9
|
+
## 35.1.1
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- 2023f5a: ED-20070: Added multiBodiedExtension and extensionFrame as defaultSchema customNodeSpecs for stage-0
|
14
|
+
|
3
15
|
## 35.1.0
|
4
16
|
|
5
17
|
### Minor Changes
|
@@ -24,7 +24,9 @@ var getSchemaBasedOnStage = (0, _memoizeOne.default)(function () {
|
|
24
24
|
var defaultSchemaConfig = getDefaultSchemaConfig();
|
25
25
|
if (stage === 'stage0') {
|
26
26
|
defaultSchemaConfig.customNodeSpecs = {
|
27
|
-
layoutSection: _nodes.layoutSectionWithSingleColumn
|
27
|
+
layoutSection: _nodes.layoutSectionWithSingleColumn,
|
28
|
+
multiBodiedExtension: _nodes.multiBodiedExtension,
|
29
|
+
extensionFrame: _nodes.extensionFrame
|
28
30
|
};
|
29
31
|
}
|
30
32
|
return (0, _createSchema.createSchema)(defaultSchemaConfig);
|
@@ -25,7 +25,7 @@ borderColorArrayPalette.forEach(function (_ref) {
|
|
25
25
|
var border = {
|
26
26
|
inclusive: false,
|
27
27
|
parseDOM: [{
|
28
|
-
tag: '
|
28
|
+
tag: '[data-mark-type="border"]',
|
29
29
|
getAttrs: function getAttrs(domNode) {
|
30
30
|
var _dom$getAttribute, _dom$getAttribute2;
|
31
31
|
var dom = domNode;
|
@@ -41,12 +41,14 @@ var border = {
|
|
41
41
|
color: {},
|
42
42
|
size: {}
|
43
43
|
},
|
44
|
-
toDOM: function toDOM(mark) {
|
44
|
+
toDOM: function toDOM(mark, isInline) {
|
45
|
+
var wrapperStyle = isInline ? 'span' : 'div';
|
46
|
+
|
45
47
|
// Note -- while there is no way to create custom colors using default tooling
|
46
48
|
// the editor does supported ad hoc color values -- and there may be content
|
47
49
|
// which has been migrated or created via apis which use such values.
|
48
50
|
var paletteColorValue = (0, _editorPalette.hexToEditorBorderPaletteColor)(mark.attrs.color) || mark.attrs.color;
|
49
|
-
return [
|
51
|
+
return [wrapperStyle, {
|
50
52
|
'data-mark-type': 'border',
|
51
53
|
'data-color': mark.attrs.color,
|
52
54
|
'data-size': mark.attrs.size,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
2
|
-
import { layoutSectionWithSingleColumn } from './nodes';
|
2
|
+
import { extensionFrame, layoutSectionWithSingleColumn, multiBodiedExtension } from './nodes';
|
3
3
|
import { createSchema } from './create-schema';
|
4
4
|
const getDefaultSchemaConfig = () => {
|
5
5
|
const defaultSchemaConfig = {
|
@@ -15,7 +15,9 @@ export const getSchemaBasedOnStage = memoizeOne((stage = 'final') => {
|
|
15
15
|
const defaultSchemaConfig = getDefaultSchemaConfig();
|
16
16
|
if (stage === 'stage0') {
|
17
17
|
defaultSchemaConfig.customNodeSpecs = {
|
18
|
-
layoutSection: layoutSectionWithSingleColumn
|
18
|
+
layoutSection: layoutSectionWithSingleColumn,
|
19
|
+
multiBodiedExtension: multiBodiedExtension,
|
20
|
+
extensionFrame: extensionFrame
|
19
21
|
};
|
20
22
|
}
|
21
23
|
return createSchema(defaultSchemaConfig);
|
@@ -12,7 +12,7 @@ borderColorArrayPalette.forEach(([color, label]) => borderColorPalette.set(color
|
|
12
12
|
export const border = {
|
13
13
|
inclusive: false,
|
14
14
|
parseDOM: [{
|
15
|
-
tag: '
|
15
|
+
tag: '[data-mark-type="border"]',
|
16
16
|
getAttrs: domNode => {
|
17
17
|
var _dom$getAttribute, _dom$getAttribute2;
|
18
18
|
const dom = domNode;
|
@@ -28,12 +28,14 @@ export const border = {
|
|
28
28
|
color: {},
|
29
29
|
size: {}
|
30
30
|
},
|
31
|
-
toDOM(mark) {
|
31
|
+
toDOM(mark, isInline) {
|
32
|
+
const wrapperStyle = isInline ? 'span' : 'div';
|
33
|
+
|
32
34
|
// Note -- while there is no way to create custom colors using default tooling
|
33
35
|
// the editor does supported ad hoc color values -- and there may be content
|
34
36
|
// which has been migrated or created via apis which use such values.
|
35
37
|
const paletteColorValue = hexToEditorBorderPaletteColor(mark.attrs.color) || mark.attrs.color;
|
36
|
-
return [
|
38
|
+
return [wrapperStyle, {
|
37
39
|
'data-mark-type': 'border',
|
38
40
|
'data-color': mark.attrs.color,
|
39
41
|
'data-size': mark.attrs.size,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
2
|
-
import { layoutSectionWithSingleColumn } from './nodes';
|
2
|
+
import { extensionFrame, layoutSectionWithSingleColumn, multiBodiedExtension } from './nodes';
|
3
3
|
import { createSchema } from './create-schema';
|
4
4
|
var getDefaultSchemaConfig = function getDefaultSchemaConfig() {
|
5
5
|
var defaultSchemaConfig = {
|
@@ -16,7 +16,9 @@ export var getSchemaBasedOnStage = memoizeOne(function () {
|
|
16
16
|
var defaultSchemaConfig = getDefaultSchemaConfig();
|
17
17
|
if (stage === 'stage0') {
|
18
18
|
defaultSchemaConfig.customNodeSpecs = {
|
19
|
-
layoutSection: layoutSectionWithSingleColumn
|
19
|
+
layoutSection: layoutSectionWithSingleColumn,
|
20
|
+
multiBodiedExtension: multiBodiedExtension,
|
21
|
+
extensionFrame: extensionFrame
|
20
22
|
};
|
21
23
|
}
|
22
24
|
return createSchema(defaultSchemaConfig);
|
@@ -18,7 +18,7 @@ borderColorArrayPalette.forEach(function (_ref) {
|
|
18
18
|
export var border = {
|
19
19
|
inclusive: false,
|
20
20
|
parseDOM: [{
|
21
|
-
tag: '
|
21
|
+
tag: '[data-mark-type="border"]',
|
22
22
|
getAttrs: function getAttrs(domNode) {
|
23
23
|
var _dom$getAttribute, _dom$getAttribute2;
|
24
24
|
var dom = domNode;
|
@@ -34,12 +34,14 @@ export var border = {
|
|
34
34
|
color: {},
|
35
35
|
size: {}
|
36
36
|
},
|
37
|
-
toDOM: function toDOM(mark) {
|
37
|
+
toDOM: function toDOM(mark, isInline) {
|
38
|
+
var wrapperStyle = isInline ? 'span' : 'div';
|
39
|
+
|
38
40
|
// Note -- while there is no way to create custom colors using default tooling
|
39
41
|
// the editor does supported ad hoc color values -- and there may be content
|
40
42
|
// which has been migrated or created via apis which use such values.
|
41
43
|
var paletteColorValue = hexToEditorBorderPaletteColor(mark.attrs.color) || mark.attrs.color;
|
42
|
-
return [
|
44
|
+
return [wrapperStyle, {
|
43
45
|
'data-mark-type': 'border',
|
44
46
|
'data-color': mark.attrs.color,
|
45
47
|
'data-size': mark.attrs.size,
|
package/package.json
CHANGED