@atlaskit/editor-plugin-indentation 1.8.8 → 1.8.9

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/{commands → editor-commands}/index.js +1 -1
  3. package/dist/cjs/{plugin.js → indentationPlugin.js} +7 -8
  4. package/dist/cjs/indentationPluginType.js +5 -0
  5. package/dist/cjs/index.js +2 -3
  6. package/dist/cjs/pm-plugins/keymap.js +4 -4
  7. package/dist/es2019/{commands → editor-commands}/index.js +1 -1
  8. package/dist/es2019/{plugin.js → indentationPlugin.js} +3 -4
  9. package/dist/es2019/indentationPluginType.js +1 -0
  10. package/dist/es2019/index.js +4 -1
  11. package/dist/es2019/pm-plugins/keymap.js +1 -1
  12. package/dist/esm/{commands → editor-commands}/index.js +1 -1
  13. package/dist/esm/{plugin.js → indentationPlugin.js} +3 -4
  14. package/dist/esm/indentationPluginType.js +1 -0
  15. package/dist/esm/index.js +4 -1
  16. package/dist/esm/pm-plugins/keymap.js +1 -1
  17. package/dist/{types-ts4.5 → types/editor-commands}/getAttrsWithChangesRecorder.d.ts +1 -10
  18. package/dist/{types-ts4.5/commands → types/editor-commands}/utils.d.ts +1 -1
  19. package/dist/types/indentationPlugin.d.ts +2 -0
  20. package/dist/types/{plugin.d.ts → indentationPluginType.d.ts} +13 -3
  21. package/dist/types/index.d.ts +3 -3
  22. package/dist/{types → types-ts4.5/editor-commands}/getAttrsWithChangesRecorder.d.ts +1 -10
  23. package/dist/{types/commands → types-ts4.5/editor-commands}/utils.d.ts +1 -1
  24. package/dist/types-ts4.5/indentationPlugin.d.ts +2 -0
  25. package/dist/types-ts4.5/{plugin.d.ts → indentationPluginType.d.ts} +13 -3
  26. package/dist/types-ts4.5/index.d.ts +3 -3
  27. package/package.json +5 -2
  28. /package/dist/cjs/{getAttrsWithChangesRecorder.js → editor-commands/getAttrsWithChangesRecorder.js} +0 -0
  29. /package/dist/cjs/{commands → editor-commands}/utils.js +0 -0
  30. /package/dist/es2019/{getAttrsWithChangesRecorder.js → editor-commands/getAttrsWithChangesRecorder.js} +0 -0
  31. /package/dist/es2019/{commands → editor-commands}/utils.js +0 -0
  32. /package/dist/esm/{getAttrsWithChangesRecorder.js → editor-commands/getAttrsWithChangesRecorder.js} +0 -0
  33. /package/dist/esm/{commands → editor-commands}/utils.js +0 -0
  34. /package/dist/types/{commands → editor-commands}/index.d.ts +0 -0
  35. /package/dist/types-ts4.5/{commands → editor-commands}/index.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-indentation
2
2
 
3
+ ## 1.8.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#177206](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/177206)
8
+ [`8584b1acd8d81`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8584b1acd8d81) -
9
+ updated indentation plugin to meet EES 003
10
+
3
11
  ## 1.8.8
4
12
 
5
13
  ### Patch Changes
@@ -8,7 +8,7 @@ exports.removeIndentation = exports.isIndentationAllowed = exports.getOutdentCom
8
8
  var _analytics = require("@atlaskit/editor-common/analytics");
9
9
  var _commands = require("@atlaskit/editor-common/commands");
10
10
  var _indentation = require("@atlaskit/editor-common/indentation");
11
- var _getAttrsWithChangesRecorder = _interopRequireDefault(require("../getAttrsWithChangesRecorder"));
11
+ var _getAttrsWithChangesRecorder = _interopRequireDefault(require("./getAttrsWithChangesRecorder"));
12
12
  var _utils = require("./utils");
13
13
  var isIndentationAllowed = exports.isIndentationAllowed = function isIndentationAllowed(schema, node) {
14
14
  var _schema$nodes = schema.nodes,
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.indentationPlugin = void 0;
7
7
  var _adfSchema = require("@atlaskit/adf-schema");
8
8
  var _indentation = require("@atlaskit/editor-common/indentation");
9
- var _commands = require("./commands");
9
+ var _editorCommands = require("./editor-commands");
10
10
  var _keymap = require("./pm-plugins/keymap");
11
- var indentationPlugin = function indentationPlugin(_ref) {
11
+ var indentationPlugin = exports.indentationPlugin = function indentationPlugin(_ref) {
12
12
  var _api$analytics, _api$analytics2;
13
13
  var api = _ref.api;
14
14
  return {
@@ -20,8 +20,8 @@ var indentationPlugin = function indentationPlugin(_ref) {
20
20
  }];
21
21
  },
22
22
  actions: {
23
- indentParagraphOrHeading: (0, _commands.getIndentCommand)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions),
24
- outdentParagraphOrHeading: (0, _commands.getOutdentCommand)(api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions)
23
+ indentParagraphOrHeading: (0, _editorCommands.getIndentCommand)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions),
24
+ outdentParagraphOrHeading: (0, _editorCommands.getOutdentCommand)(api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions)
25
25
  },
26
26
  getSharedState: function getSharedState(editorState) {
27
27
  var _ref2;
@@ -35,7 +35,7 @@ var indentationPlugin = function indentationPlugin(_ref) {
35
35
  return mark.type === indentation;
36
36
  });
37
37
  return {
38
- isIndentationAllowed: (0, _commands.isIndentationAllowed)(editorState.schema, node),
38
+ isIndentationAllowed: (0, _editorCommands.isIndentationAllowed)(editorState.schema, node),
39
39
  indentDisabled: (_ref2 = (indentationMark === null || indentationMark === void 0 ? void 0 : indentationMark.attrs.level) >= _indentation.MAX_INDENTATION_LEVEL) !== null && _ref2 !== void 0 ? _ref2 : false,
40
40
  outdentDisabled: !indentationMark
41
41
  };
@@ -50,5 +50,4 @@ var indentationPlugin = function indentationPlugin(_ref) {
50
50
  }];
51
51
  }
52
52
  };
53
- };
54
- var _default = exports.default = indentationPlugin;
53
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/dist/cjs/index.js CHANGED
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  Object.defineProperty(exports, "indentationPlugin", {
8
7
  enumerable: true,
9
8
  get: function get() {
10
- return _plugin.default;
9
+ return _indentationPlugin.indentationPlugin;
11
10
  }
12
11
  });
13
- var _plugin = _interopRequireDefault(require("./plugin"));
12
+ var _indentationPlugin = require("./indentationPlugin");
@@ -9,15 +9,15 @@ var _analytics = require("@atlaskit/editor-common/analytics");
9
9
  var _keymaps = require("@atlaskit/editor-common/keymaps");
10
10
  var _utils = require("@atlaskit/editor-common/utils");
11
11
  var _keymap = require("@atlaskit/editor-prosemirror/keymap");
12
- var _commands = require("../commands");
12
+ var _editorCommands = require("../editor-commands");
13
13
  function keymapPlugin(editorAnalyticsAPI) {
14
14
  var list = {};
15
- (0, _keymaps.bindKeymapWithCommand)((0, _keymaps.findShortcutByKeymap)(_keymaps.indent), (0, _commands.getIndentCommand)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD), list);
16
- (0, _keymaps.bindKeymapWithCommand)((0, _keymaps.findShortcutByKeymap)(_keymaps.outdent), (0, _commands.getOutdentCommand)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD), list);
15
+ (0, _keymaps.bindKeymapWithCommand)((0, _keymaps.findShortcutByKeymap)(_keymaps.indent), (0, _editorCommands.getIndentCommand)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD), list);
16
+ (0, _keymaps.bindKeymapWithCommand)((0, _keymaps.findShortcutByKeymap)(_keymaps.outdent), (0, _editorCommands.getOutdentCommand)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD), list);
17
17
  (0, _keymaps.bindKeymapWithCommand)((0, _keymaps.findShortcutByKeymap)(_keymaps.backspace), function (state, dispatch) {
18
18
  var selection = state.selection;
19
19
  if ((0, _utils.isTextSelection)(selection) && selection.$cursor && selection.$cursor.parentOffset === 0) {
20
- return dispatch ? (0, _commands.getOutdentCommand)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD)(state, dispatch) : false;
20
+ return dispatch ? (0, _editorCommands.getOutdentCommand)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD)(state, dispatch) : false;
21
21
  }
22
22
  return false;
23
23
  }, list);
@@ -1,7 +1,7 @@
1
1
  import { INDENT_DIRECTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import { toggleBlockMark } from '@atlaskit/editor-common/commands';
3
3
  import { MAX_INDENTATION_LEVEL } from '@atlaskit/editor-common/indentation';
4
- import getAttrsWithChangesRecorder from '../getAttrsWithChangesRecorder';
4
+ import { default as getAttrsWithChangesRecorder } from './getAttrsWithChangesRecorder';
5
5
  import { createAnalyticsDispatch } from './utils';
6
6
  export const isIndentationAllowed = (schema, node) => {
7
7
  const {
@@ -1,8 +1,8 @@
1
1
  import { indentation } from '@atlaskit/adf-schema';
2
2
  import { MAX_INDENTATION_LEVEL } from '@atlaskit/editor-common/indentation';
3
- import { getIndentCommand, getOutdentCommand, isIndentationAllowed } from './commands';
3
+ import { getIndentCommand, getOutdentCommand, isIndentationAllowed } from './editor-commands';
4
4
  import { keymapPlugin } from './pm-plugins/keymap';
5
- const indentationPlugin = ({
5
+ export const indentationPlugin = ({
6
6
  api
7
7
  }) => {
8
8
  var _api$analytics, _api$analytics2;
@@ -51,5 +51,4 @@ const indentationPlugin = ({
51
51
  }];
52
52
  }
53
53
  };
54
- };
55
- export default indentationPlugin;
54
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,4 @@
1
- export { default as indentationPlugin } from './plugin';
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ // Entry file in package.json
3
+
4
+ export { indentationPlugin } from './indentationPlugin';
@@ -2,7 +2,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import { backspace, bindKeymapWithCommand, findShortcutByKeymap, indent, outdent } from '@atlaskit/editor-common/keymaps';
3
3
  import { isTextSelection } from '@atlaskit/editor-common/utils';
4
4
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
5
- import { getIndentCommand, getOutdentCommand } from '../commands';
5
+ import { getIndentCommand, getOutdentCommand } from '../editor-commands';
6
6
  export function keymapPlugin(editorAnalyticsAPI) {
7
7
  const list = {};
8
8
  bindKeymapWithCommand(findShortcutByKeymap(indent), getIndentCommand(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), list);
@@ -1,7 +1,7 @@
1
1
  import { INDENT_DIRECTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import { toggleBlockMark } from '@atlaskit/editor-common/commands';
3
3
  import { MAX_INDENTATION_LEVEL } from '@atlaskit/editor-common/indentation';
4
- import getAttrsWithChangesRecorder from '../getAttrsWithChangesRecorder';
4
+ import { default as getAttrsWithChangesRecorder } from './getAttrsWithChangesRecorder';
5
5
  import { createAnalyticsDispatch } from './utils';
6
6
  export var isIndentationAllowed = function isIndentationAllowed(schema, node) {
7
7
  var _schema$nodes = schema.nodes,
@@ -1,8 +1,8 @@
1
1
  import { indentation } from '@atlaskit/adf-schema';
2
2
  import { MAX_INDENTATION_LEVEL } from '@atlaskit/editor-common/indentation';
3
- import { getIndentCommand, getOutdentCommand, isIndentationAllowed } from './commands';
3
+ import { getIndentCommand, getOutdentCommand, isIndentationAllowed } from './editor-commands';
4
4
  import { keymapPlugin } from './pm-plugins/keymap';
5
- var indentationPlugin = function indentationPlugin(_ref) {
5
+ export var indentationPlugin = function indentationPlugin(_ref) {
6
6
  var _api$analytics, _api$analytics2;
7
7
  var api = _ref.api;
8
8
  return {
@@ -44,5 +44,4 @@ var indentationPlugin = function indentationPlugin(_ref) {
44
44
  }];
45
45
  }
46
46
  };
47
- };
48
- export default indentationPlugin;
47
+ };
@@ -0,0 +1 @@
1
+ export {};
package/dist/esm/index.js CHANGED
@@ -1 +1,4 @@
1
- export { default as indentationPlugin } from './plugin';
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ // Entry file in package.json
3
+
4
+ export { indentationPlugin } from './indentationPlugin';
@@ -2,7 +2,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import { backspace, bindKeymapWithCommand, findShortcutByKeymap, indent, outdent } from '@atlaskit/editor-common/keymaps';
3
3
  import { isTextSelection } from '@atlaskit/editor-common/utils';
4
4
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
5
- import { getIndentCommand, getOutdentCommand } from '../commands';
5
+ import { getIndentCommand, getOutdentCommand } from '../editor-commands';
6
6
  export function keymapPlugin(editorAnalyticsAPI) {
7
7
  var list = {};
8
8
  bindKeymapWithCommand(findShortcutByKeymap(indent), getIndentCommand(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), list);
@@ -1,14 +1,5 @@
1
1
  import type { Node } from '@atlaskit/editor-prosemirror/model';
2
- export interface GetAttrsChange<T, V> {
3
- node: Node;
4
- prevAttrs?: T;
5
- newAttrs: T | false | undefined;
6
- options: V;
7
- }
8
- export type GetAttrsWithChangesRecorder<T, V> = {
9
- getAttrs(prevAttrs?: T | undefined, node?: Node): T | false | undefined;
10
- getAndResetAttrsChanges(): GetAttrsChange<T, V>[];
11
- };
2
+ import type { GetAttrsWithChangesRecorder } from '../indentationPluginType';
12
3
  /**
13
4
  * Create a new getAttrs handler who will wrap the original function,
14
5
  * and store the changes internally to be used for other
@@ -1,7 +1,7 @@
1
1
  import type { IndentationMarkAttributes } from '@atlaskit/adf-schema';
2
2
  import type { EditorAnalyticsAPI, INDENT_DIRECTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
4
- import type { GetAttrsChange } from '../getAttrsWithChangesRecorder';
4
+ import type { GetAttrsChange } from '../indentationPluginType';
5
5
  export type PrevAttributes = IndentationMarkAttributes | undefined;
6
6
  export type NewAttributes = IndentationMarkAttributes | undefined | false;
7
7
  export type IndentationChangesOptions = {
@@ -0,0 +1,2 @@
1
+ import type { IndentationPlugin } from './indentationPluginType';
2
+ export declare const indentationPlugin: IndentationPlugin;
@@ -1,6 +1,7 @@
1
1
  import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
- import type { IndentationInputMethod } from './commands/utils';
3
+ import type { Node } from '@atlaskit/editor-prosemirror/model';
4
+ import type { IndentationInputMethod } from './editor-commands/utils';
4
5
  type IndentationPluginSharedState = {
5
6
  isIndentationAllowed: boolean;
6
7
  indentDisabled: boolean;
@@ -14,5 +15,14 @@ export type IndentationPlugin = NextEditorPlugin<'indentation', {
14
15
  };
15
16
  sharedState: IndentationPluginSharedState | undefined;
16
17
  }>;
17
- declare const indentationPlugin: IndentationPlugin;
18
- export default indentationPlugin;
18
+ export interface GetAttrsChange<T, V> {
19
+ node: Node;
20
+ prevAttrs?: T;
21
+ newAttrs: T | false | undefined;
22
+ options: V;
23
+ }
24
+ export type GetAttrsWithChangesRecorder<T, V> = {
25
+ getAttrs(prevAttrs?: T | undefined, node?: Node): T | false | undefined;
26
+ getAndResetAttrsChanges(): GetAttrsChange<T, V>[];
27
+ };
28
+ export {};
@@ -1,3 +1,3 @@
1
- export { default as indentationPlugin } from './plugin';
2
- export type { IndentationPlugin } from './plugin';
3
- export type { IndentationInputMethod } from './commands/utils';
1
+ export { indentationPlugin } from './indentationPlugin';
2
+ export type { IndentationPlugin } from './indentationPluginType';
3
+ export type { IndentationInputMethod } from './editor-commands/utils';
@@ -1,14 +1,5 @@
1
1
  import type { Node } from '@atlaskit/editor-prosemirror/model';
2
- export interface GetAttrsChange<T, V> {
3
- node: Node;
4
- prevAttrs?: T;
5
- newAttrs: T | false | undefined;
6
- options: V;
7
- }
8
- export type GetAttrsWithChangesRecorder<T, V> = {
9
- getAttrs(prevAttrs?: T | undefined, node?: Node): T | false | undefined;
10
- getAndResetAttrsChanges(): GetAttrsChange<T, V>[];
11
- };
2
+ import type { GetAttrsWithChangesRecorder } from '../indentationPluginType';
12
3
  /**
13
4
  * Create a new getAttrs handler who will wrap the original function,
14
5
  * and store the changes internally to be used for other
@@ -1,7 +1,7 @@
1
1
  import type { IndentationMarkAttributes } from '@atlaskit/adf-schema';
2
2
  import type { EditorAnalyticsAPI, INDENT_DIRECTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
4
- import type { GetAttrsChange } from '../getAttrsWithChangesRecorder';
4
+ import type { GetAttrsChange } from '../indentationPluginType';
5
5
  export type PrevAttributes = IndentationMarkAttributes | undefined;
6
6
  export type NewAttributes = IndentationMarkAttributes | undefined | false;
7
7
  export type IndentationChangesOptions = {
@@ -0,0 +1,2 @@
1
+ import type { IndentationPlugin } from './indentationPluginType';
2
+ export declare const indentationPlugin: IndentationPlugin;
@@ -1,6 +1,7 @@
1
1
  import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
- import type { IndentationInputMethod } from './commands/utils';
3
+ import type { Node } from '@atlaskit/editor-prosemirror/model';
4
+ import type { IndentationInputMethod } from './editor-commands/utils';
4
5
  type IndentationPluginSharedState = {
5
6
  isIndentationAllowed: boolean;
6
7
  indentDisabled: boolean;
@@ -16,5 +17,14 @@ export type IndentationPlugin = NextEditorPlugin<'indentation', {
16
17
  };
17
18
  sharedState: IndentationPluginSharedState | undefined;
18
19
  }>;
19
- declare const indentationPlugin: IndentationPlugin;
20
- export default indentationPlugin;
20
+ export interface GetAttrsChange<T, V> {
21
+ node: Node;
22
+ prevAttrs?: T;
23
+ newAttrs: T | false | undefined;
24
+ options: V;
25
+ }
26
+ export type GetAttrsWithChangesRecorder<T, V> = {
27
+ getAttrs(prevAttrs?: T | undefined, node?: Node): T | false | undefined;
28
+ getAndResetAttrsChanges(): GetAttrsChange<T, V>[];
29
+ };
30
+ export {};
@@ -1,3 +1,3 @@
1
- export { default as indentationPlugin } from './plugin';
2
- export type { IndentationPlugin } from './plugin';
3
- export type { IndentationInputMethod } from './commands/utils';
1
+ export { indentationPlugin } from './indentationPlugin';
2
+ export type { IndentationPlugin } from './indentationPluginType';
3
+ export type { IndentationInputMethod } from './editor-commands/utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-indentation",
3
- "version": "1.8.8",
3
+ "version": "1.8.9",
4
4
  "description": "Indentation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^46.1.0",
35
- "@atlaskit/editor-common": "^96.0.0",
35
+ "@atlaskit/editor-common": "^96.5.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
37
37
  "@atlaskit/editor-prosemirror": "6.2.1",
38
38
  "@babel/runtime": "^7.0.0"
@@ -57,6 +57,9 @@
57
57
  ],
58
58
  "circular-dependencies": [
59
59
  "file-and-folder-level"
60
+ ],
61
+ "code-structure": [
62
+ "editor-plugin"
60
63
  ]
61
64
  },
62
65
  "@repo/internal": {
File without changes
File without changes