@atlaskit/editor-plugin-card 16.8.2 → 16.9.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 +34 -0
- package/dist/cjs/cardPlugin.js +14 -3
- package/dist/es2019/cardPlugin.js +14 -3
- package/dist/esm/cardPlugin.js +14 -3
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 16.9.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 16.9.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`2e9c8b4281869`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2e9c8b4281869) -
|
|
14
|
+
[EDITOR-6965] Add `onlyInlineCards` option to the card plugin and enable inline Smart Links in the
|
|
15
|
+
Confluence markdown preset.
|
|
16
|
+
- `@atlaskit/editor-common`: add optional `onlyInlineCards?: boolean` to `CardOptions`. Defaults
|
|
17
|
+
to `false` (back-compat). When `true`, the card plugin contributes only the `inlineCard` node to
|
|
18
|
+
the schema and forces `allowBlockCards` / `allowEmbeds` to `false` at runtime regardless of
|
|
19
|
+
their explicit values.
|
|
20
|
+
- `@atlaskit/editor-plugin-card`: honour `onlyInlineCards` in both `nodes()` (skip `blockCard` /
|
|
21
|
+
`embedCard` entirely) and `pmPlugins()` (force the runtime gates so schema and runtime stay in
|
|
22
|
+
sync).
|
|
23
|
+
- `@atlassian/confluence-presets`: `markdownPreset` now `.maybeAdd`s `cardPlugin` after the
|
|
24
|
+
annotation block when `pluginOptions.card` is supplied, hard-coding `onlyInlineCards: true` so
|
|
25
|
+
the preset itself guarantees the inline-only constraint. Adds `'card'` to
|
|
26
|
+
`MarkdownPluginOptionsKeys` and `CardPlugin` to `MarkdownPresetPluginsReversed`. `cardPlugin` is
|
|
27
|
+
removed from the "intentionally excluded" comment block.
|
|
28
|
+
|
|
29
|
+
Existing callers of `cardPlugin` and `markdownPreset` are unaffected: `onlyInlineCards` defaults
|
|
30
|
+
to `false`, and `cardPlugin` is only added to the markdown preset when callers supply
|
|
31
|
+
`pluginOptions.card`.
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
|
|
3
37
|
## 16.8.2
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/dist/cjs/cardPlugin.js
CHANGED
|
@@ -66,10 +66,17 @@ var cardPlugin = exports.cardPlugin = function cardPlugin(_ref) {
|
|
|
66
66
|
var nodes = [{
|
|
67
67
|
name: 'inlineCard',
|
|
68
68
|
node: (0, _inlineCard.inlineCardSpecWithFixedToDOM)()
|
|
69
|
-
}
|
|
69
|
+
}];
|
|
70
|
+
|
|
71
|
+
// `onlyInlineCards` is a hard gate: when set, blockCard/embedCard
|
|
72
|
+
// stay out of the schema regardless of allowBlockCards/allowEmbeds.
|
|
73
|
+
if (options.onlyInlineCards) {
|
|
74
|
+
return nodes;
|
|
75
|
+
}
|
|
76
|
+
nodes.push({
|
|
70
77
|
name: 'blockCard',
|
|
71
78
|
node: (0, _blockCard.blockCardSpecWithFixedToDOM)()
|
|
72
|
-
}
|
|
79
|
+
});
|
|
73
80
|
if (options.allowEmbeds) {
|
|
74
81
|
nodes.push({
|
|
75
82
|
name: 'embedCard',
|
|
@@ -80,7 +87,10 @@ var cardPlugin = exports.cardPlugin = function cardPlugin(_ref) {
|
|
|
80
87
|
},
|
|
81
88
|
pmPlugins: function pmPlugins() {
|
|
82
89
|
var _options$allowBlockCa, _options$allowResizin, _options$useAlternati, _options$allowWrappin, _options$allowAlignme, _options$allowDatasou, _options$showUpgradeD;
|
|
83
|
-
|
|
90
|
+
// onlyInlineCards forces block/embed off regardless of caller-passed flags,
|
|
91
|
+
// keeping the schema gate (in nodes()) and the runtime gate in sync.
|
|
92
|
+
var allowBlockCards = options.onlyInlineCards ? false : (_options$allowBlockCa = options.allowBlockCards) !== null && _options$allowBlockCa !== void 0 ? _options$allowBlockCa : true;
|
|
93
|
+
var allowEmbeds = options.onlyInlineCards ? false : options.allowEmbeds;
|
|
84
94
|
var allowResizing = (_options$allowResizin = options.allowResizing) !== null && _options$allowResizin !== void 0 ? _options$allowResizin : true;
|
|
85
95
|
var useAlternativePreloader = (_options$useAlternati = options.useAlternativePreloader) !== null && _options$useAlternati !== void 0 ? _options$useAlternati : true;
|
|
86
96
|
var allowWrapping = (_options$allowWrappin = options.allowWrapping) !== null && _options$allowWrappin !== void 0 ? _options$allowWrappin : true;
|
|
@@ -91,6 +101,7 @@ var cardPlugin = exports.cardPlugin = function cardPlugin(_ref) {
|
|
|
91
101
|
name: 'card',
|
|
92
102
|
plugin: (0, _main.createPlugin)(_objectSpread(_objectSpread({}, options), {}, {
|
|
93
103
|
allowBlockCards: allowBlockCards,
|
|
104
|
+
allowEmbeds: allowEmbeds,
|
|
94
105
|
allowResizing: allowResizing,
|
|
95
106
|
useAlternativePreloader: useAlternativePreloader,
|
|
96
107
|
allowWrapping: allowWrapping,
|
|
@@ -61,10 +61,17 @@ export const cardPlugin = ({
|
|
|
61
61
|
const nodes = [{
|
|
62
62
|
name: 'inlineCard',
|
|
63
63
|
node: inlineCardSpecWithFixedToDOM()
|
|
64
|
-
}
|
|
64
|
+
}];
|
|
65
|
+
|
|
66
|
+
// `onlyInlineCards` is a hard gate: when set, blockCard/embedCard
|
|
67
|
+
// stay out of the schema regardless of allowBlockCards/allowEmbeds.
|
|
68
|
+
if (options.onlyInlineCards) {
|
|
69
|
+
return nodes;
|
|
70
|
+
}
|
|
71
|
+
nodes.push({
|
|
65
72
|
name: 'blockCard',
|
|
66
73
|
node: blockCardSpecWithFixedToDOM()
|
|
67
|
-
}
|
|
74
|
+
});
|
|
68
75
|
if (options.allowEmbeds) {
|
|
69
76
|
nodes.push({
|
|
70
77
|
name: 'embedCard',
|
|
@@ -75,7 +82,10 @@ export const cardPlugin = ({
|
|
|
75
82
|
},
|
|
76
83
|
pmPlugins() {
|
|
77
84
|
var _options$allowBlockCa, _options$allowResizin, _options$useAlternati, _options$allowWrappin, _options$allowAlignme, _options$allowDatasou, _options$showUpgradeD;
|
|
78
|
-
|
|
85
|
+
// onlyInlineCards forces block/embed off regardless of caller-passed flags,
|
|
86
|
+
// keeping the schema gate (in nodes()) and the runtime gate in sync.
|
|
87
|
+
const allowBlockCards = options.onlyInlineCards ? false : (_options$allowBlockCa = options.allowBlockCards) !== null && _options$allowBlockCa !== void 0 ? _options$allowBlockCa : true;
|
|
88
|
+
const allowEmbeds = options.onlyInlineCards ? false : options.allowEmbeds;
|
|
79
89
|
const allowResizing = (_options$allowResizin = options.allowResizing) !== null && _options$allowResizin !== void 0 ? _options$allowResizin : true;
|
|
80
90
|
const useAlternativePreloader = (_options$useAlternati = options.useAlternativePreloader) !== null && _options$useAlternati !== void 0 ? _options$useAlternati : true;
|
|
81
91
|
const allowWrapping = (_options$allowWrappin = options.allowWrapping) !== null && _options$allowWrappin !== void 0 ? _options$allowWrappin : true;
|
|
@@ -87,6 +97,7 @@ export const cardPlugin = ({
|
|
|
87
97
|
plugin: createPlugin({
|
|
88
98
|
...options,
|
|
89
99
|
allowBlockCards,
|
|
100
|
+
allowEmbeds,
|
|
90
101
|
allowResizing,
|
|
91
102
|
useAlternativePreloader,
|
|
92
103
|
allowWrapping,
|
package/dist/esm/cardPlugin.js
CHANGED
|
@@ -60,10 +60,17 @@ export var cardPlugin = function cardPlugin(_ref) {
|
|
|
60
60
|
var nodes = [{
|
|
61
61
|
name: 'inlineCard',
|
|
62
62
|
node: inlineCardSpecWithFixedToDOM()
|
|
63
|
-
}
|
|
63
|
+
}];
|
|
64
|
+
|
|
65
|
+
// `onlyInlineCards` is a hard gate: when set, blockCard/embedCard
|
|
66
|
+
// stay out of the schema regardless of allowBlockCards/allowEmbeds.
|
|
67
|
+
if (options.onlyInlineCards) {
|
|
68
|
+
return nodes;
|
|
69
|
+
}
|
|
70
|
+
nodes.push({
|
|
64
71
|
name: 'blockCard',
|
|
65
72
|
node: blockCardSpecWithFixedToDOM()
|
|
66
|
-
}
|
|
73
|
+
});
|
|
67
74
|
if (options.allowEmbeds) {
|
|
68
75
|
nodes.push({
|
|
69
76
|
name: 'embedCard',
|
|
@@ -74,7 +81,10 @@ export var cardPlugin = function cardPlugin(_ref) {
|
|
|
74
81
|
},
|
|
75
82
|
pmPlugins: function pmPlugins() {
|
|
76
83
|
var _options$allowBlockCa, _options$allowResizin, _options$useAlternati, _options$allowWrappin, _options$allowAlignme, _options$allowDatasou, _options$showUpgradeD;
|
|
77
|
-
|
|
84
|
+
// onlyInlineCards forces block/embed off regardless of caller-passed flags,
|
|
85
|
+
// keeping the schema gate (in nodes()) and the runtime gate in sync.
|
|
86
|
+
var allowBlockCards = options.onlyInlineCards ? false : (_options$allowBlockCa = options.allowBlockCards) !== null && _options$allowBlockCa !== void 0 ? _options$allowBlockCa : true;
|
|
87
|
+
var allowEmbeds = options.onlyInlineCards ? false : options.allowEmbeds;
|
|
78
88
|
var allowResizing = (_options$allowResizin = options.allowResizing) !== null && _options$allowResizin !== void 0 ? _options$allowResizin : true;
|
|
79
89
|
var useAlternativePreloader = (_options$useAlternati = options.useAlternativePreloader) !== null && _options$useAlternati !== void 0 ? _options$useAlternati : true;
|
|
80
90
|
var allowWrapping = (_options$allowWrappin = options.allowWrapping) !== null && _options$allowWrappin !== void 0 ? _options$allowWrappin : true;
|
|
@@ -85,6 +95,7 @@ export var cardPlugin = function cardPlugin(_ref) {
|
|
|
85
95
|
name: 'card',
|
|
86
96
|
plugin: createPlugin(_objectSpread(_objectSpread({}, options), {}, {
|
|
87
97
|
allowBlockCards: allowBlockCards,
|
|
98
|
+
allowEmbeds: allowEmbeds,
|
|
88
99
|
allowResizing: allowResizing,
|
|
89
100
|
useAlternativePreloader: useAlternativePreloader,
|
|
90
101
|
allowWrapping: allowWrapping,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.9.1",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"@atlaskit/editor-shared-styles": "^3.11.0",
|
|
49
49
|
"@atlaskit/editor-smart-link-draggable": "^0.5.0",
|
|
50
50
|
"@atlaskit/frontend-utilities": "^3.3.0",
|
|
51
|
-
"@atlaskit/icon": "^
|
|
51
|
+
"@atlaskit/icon": "^35.0.0",
|
|
52
52
|
"@atlaskit/link": "^3.4.0",
|
|
53
53
|
"@atlaskit/link-analytics": "^11.0.0",
|
|
54
54
|
"@atlaskit/link-client-extension": "^6.0.0",
|
|
55
55
|
"@atlaskit/link-datasource": "^5.2.0",
|
|
56
|
-
"@atlaskit/link-extractors": "^2.
|
|
56
|
+
"@atlaskit/link-extractors": "^2.6.0",
|
|
57
57
|
"@atlaskit/linking-common": "^9.11.0",
|
|
58
58
|
"@atlaskit/linking-types": "^14.3.0",
|
|
59
59
|
"@atlaskit/menu": "^8.5.0",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"@atlaskit/platform-feature-flags-react": "^0.5.0",
|
|
62
62
|
"@atlaskit/primitives": "^19.0.0",
|
|
63
63
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
64
|
-
"@atlaskit/smart-card": "^44.
|
|
65
|
-
"@atlaskit/tmp-editor-statsig": "^81.
|
|
64
|
+
"@atlaskit/smart-card": "^44.12.0",
|
|
65
|
+
"@atlaskit/tmp-editor-statsig": "^81.1.0",
|
|
66
66
|
"@atlaskit/tokens": "^13.0.0",
|
|
67
67
|
"@babel/runtime": "^7.0.0",
|
|
68
68
|
"@emotion/react": "^11.7.1",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"uuid": "^3.1.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@atlaskit/editor-common": "^114.
|
|
75
|
+
"@atlaskit/editor-common": "^114.35.0",
|
|
76
76
|
"@atlaskit/link-provider": "^4.4.0",
|
|
77
77
|
"react": "^18.2.0",
|
|
78
78
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|