@atlaskit/editor-plugin-placeholder 1.2.13 → 1.3.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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/editor-plugin-placeholder
2
2
 
3
+ ## 1.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#180725](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/180725)
14
+ [`70657a7f9cb2f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/70657a7f9cb2f) -
15
+ Refactored folder structure to confirm to new editor standards
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 1.2.13
4
22
 
5
23
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "placeholderPlugin", {
7
7
  enumerable: true,
8
8
  get: function get() {
9
- return _plugin.placeholderPlugin;
9
+ return _placeholderPlugin.placeholderPlugin;
10
10
  }
11
11
  });
12
- var _plugin = require("./plugin");
12
+ var _placeholderPlugin = require("./placeholderPlugin");
@@ -57,6 +57,9 @@ function setPlaceHolderState(placeholderText, pos) {
57
57
  var emptyPlaceholder = {
58
58
  hasPlaceholder: false
59
59
  };
60
+
61
+ // Ignored via go/ees005
62
+ // eslint-disable-next-line @typescript-eslint/max-params
60
63
  function createPlaceHolderStateFrom(isEditorFocused, editorState, isTypeAheadOpen, defaultPlaceholderText, bracketPlaceholderText) {
61
64
  if (isTypeAheadOpen !== null && isTypeAheadOpen !== void 0 && isTypeAheadOpen(editorState)) {
62
65
  return emptyPlaceholder;
@@ -83,6 +86,8 @@ function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api) {
83
86
  var _api$focus, _api$typeAhead;
84
87
  return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 || (_api$focus = api.focus) === null || _api$focus === void 0 || (_api$focus = _api$focus.sharedState.currentState()) === null || _api$focus === void 0 ? void 0 : _api$focus.hasFocus), state, api === null || api === void 0 || (_api$typeAhead = api.typeAhead) === null || _api$typeAhead === void 0 ? void 0 : _api$typeAhead.actions.isOpen, defaultPlaceholderText, bracketPlaceholderText);
85
88
  },
89
+ // Ignored via go/ees005
90
+ // eslint-disable-next-line @typescript-eslint/max-params
86
91
  apply: function apply(tr, _oldPluginState, _oldEditorState, newEditorState) {
87
92
  var _api$focus2, _api$typeAhead3;
88
93
  var meta = tr.getMeta(pluginKey);
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1 +1,4 @@
1
- export { placeholderPlugin } from './plugin';
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ // Entry file in package.json
3
+
4
+ export { placeholderPlugin } from './placeholderPlugin';
@@ -48,6 +48,9 @@ function setPlaceHolderState(placeholderText, pos) {
48
48
  const emptyPlaceholder = {
49
49
  hasPlaceholder: false
50
50
  };
51
+
52
+ // Ignored via go/ees005
53
+ // eslint-disable-next-line @typescript-eslint/max-params
51
54
  function createPlaceHolderStateFrom(isEditorFocused, editorState, isTypeAheadOpen, defaultPlaceholderText, bracketPlaceholderText) {
52
55
  if (isTypeAheadOpen !== null && isTypeAheadOpen !== void 0 && isTypeAheadOpen(editorState)) {
53
56
  return emptyPlaceholder;
@@ -76,6 +79,8 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
76
79
  var _api$focus, _api$focus$sharedStat, _api$typeAhead;
77
80
  return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$focus = api.focus) === null || _api$focus === void 0 ? void 0 : (_api$focus$sharedStat = _api$focus.sharedState.currentState()) === null || _api$focus$sharedStat === void 0 ? void 0 : _api$focus$sharedStat.hasFocus), state, api === null || api === void 0 ? void 0 : (_api$typeAhead = api.typeAhead) === null || _api$typeAhead === void 0 ? void 0 : _api$typeAhead.actions.isOpen, defaultPlaceholderText, bracketPlaceholderText);
78
81
  },
82
+ // Ignored via go/ees005
83
+ // eslint-disable-next-line @typescript-eslint/max-params
79
84
  apply: (tr, _oldPluginState, _oldEditorState, newEditorState) => {
80
85
  var _api$focus2, _api$focus2$sharedSta, _api$typeAhead3;
81
86
  const meta = tr.getMeta(pluginKey);
@@ -0,0 +1 @@
1
+ export {};
package/dist/esm/index.js CHANGED
@@ -1 +1,4 @@
1
- export { placeholderPlugin } from './plugin';
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ // Entry file in package.json
3
+
4
+ export { placeholderPlugin } from './placeholderPlugin';
@@ -49,6 +49,9 @@ function setPlaceHolderState(placeholderText, pos) {
49
49
  var emptyPlaceholder = {
50
50
  hasPlaceholder: false
51
51
  };
52
+
53
+ // Ignored via go/ees005
54
+ // eslint-disable-next-line @typescript-eslint/max-params
52
55
  function createPlaceHolderStateFrom(isEditorFocused, editorState, isTypeAheadOpen, defaultPlaceholderText, bracketPlaceholderText) {
53
56
  if (isTypeAheadOpen !== null && isTypeAheadOpen !== void 0 && isTypeAheadOpen(editorState)) {
54
57
  return emptyPlaceholder;
@@ -75,6 +78,8 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
75
78
  var _api$focus, _api$typeAhead;
76
79
  return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 || (_api$focus = api.focus) === null || _api$focus === void 0 || (_api$focus = _api$focus.sharedState.currentState()) === null || _api$focus === void 0 ? void 0 : _api$focus.hasFocus), state, api === null || api === void 0 || (_api$typeAhead = api.typeAhead) === null || _api$typeAhead === void 0 ? void 0 : _api$typeAhead.actions.isOpen, defaultPlaceholderText, bracketPlaceholderText);
77
80
  },
81
+ // Ignored via go/ees005
82
+ // eslint-disable-next-line @typescript-eslint/max-params
78
83
  apply: function apply(tr, _oldPluginState, _oldEditorState, newEditorState) {
79
84
  var _api$focus2, _api$typeAhead3;
80
85
  var meta = tr.getMeta(pluginKey);
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,2 @@
1
- export type { PlaceholderPlugin, PlaceholderPluginOptions } from './plugin';
2
- export { placeholderPlugin } from './plugin';
1
+ export type { PlaceholderPlugin, PlaceholderPluginOptions } from './placeholderPluginType';
2
+ export { placeholderPlugin } from './placeholderPlugin';
@@ -1,25 +1,11 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { ExtractInjectionAPI, NextEditorPlugin } from '@atlaskit/editor-common/types';
3
- import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
4
- import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
5
- import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
7
4
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
8
5
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
6
+ import type { PlaceholderPlugin } from './placeholderPluginType';
9
7
  export declare const pluginKey: PluginKey<any>;
10
8
  export declare const placeholderTestId = "placeholder-test-id";
11
9
  export declare function createPlaceholderDecoration(editorState: EditorState, placeholderText: string, pos?: number): DecorationSet;
12
10
  export declare function createPlugin(defaultPlaceholderText?: string, bracketPlaceholderText?: string, api?: ExtractInjectionAPI<PlaceholderPlugin>): SafePlugin | undefined;
13
- export interface PlaceholderPluginOptions {
14
- placeholder?: string;
15
- placeholderBracketHint?: string;
16
- }
17
- export type PlaceholderPlugin = NextEditorPlugin<'placeholder', {
18
- pluginConfiguration: PlaceholderPluginOptions | undefined;
19
- dependencies: [
20
- FocusPlugin,
21
- CompositionPlugin,
22
- TypeAheadPlugin
23
- ];
24
- }>;
25
11
  export declare const placeholderPlugin: PlaceholderPlugin;
@@ -0,0 +1,12 @@
1
+ import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
+ import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
3
+ import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
4
+ import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
5
+ export interface PlaceholderPluginOptions {
6
+ placeholder?: string;
7
+ placeholderBracketHint?: string;
8
+ }
9
+ export type PlaceholderPlugin = NextEditorPlugin<'placeholder', {
10
+ pluginConfiguration: PlaceholderPluginOptions | undefined;
11
+ dependencies: [FocusPlugin, CompositionPlugin, TypeAheadPlugin];
12
+ }>;
@@ -1,2 +1,2 @@
1
- export type { PlaceholderPlugin, PlaceholderPluginOptions } from './plugin';
2
- export { placeholderPlugin } from './plugin';
1
+ export type { PlaceholderPlugin, PlaceholderPluginOptions } from './placeholderPluginType';
2
+ export { placeholderPlugin } from './placeholderPlugin';
@@ -1,21 +1,11 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { ExtractInjectionAPI, NextEditorPlugin } from '@atlaskit/editor-common/types';
3
- import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
4
- import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
5
- import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
7
4
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
8
5
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
6
+ import type { PlaceholderPlugin } from './placeholderPluginType';
9
7
  export declare const pluginKey: PluginKey<any>;
10
8
  export declare const placeholderTestId = "placeholder-test-id";
11
9
  export declare function createPlaceholderDecoration(editorState: EditorState, placeholderText: string, pos?: number): DecorationSet;
12
10
  export declare function createPlugin(defaultPlaceholderText?: string, bracketPlaceholderText?: string, api?: ExtractInjectionAPI<PlaceholderPlugin>): SafePlugin | undefined;
13
- export interface PlaceholderPluginOptions {
14
- placeholder?: string;
15
- placeholderBracketHint?: string;
16
- }
17
- export type PlaceholderPlugin = NextEditorPlugin<'placeholder', {
18
- pluginConfiguration: PlaceholderPluginOptions | undefined;
19
- dependencies: [FocusPlugin, CompositionPlugin, TypeAheadPlugin];
20
- }>;
21
11
  export declare const placeholderPlugin: PlaceholderPlugin;
@@ -0,0 +1,16 @@
1
+ import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
+ import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
3
+ import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
4
+ import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
5
+ export interface PlaceholderPluginOptions {
6
+ placeholder?: string;
7
+ placeholderBracketHint?: string;
8
+ }
9
+ export type PlaceholderPlugin = NextEditorPlugin<'placeholder', {
10
+ pluginConfiguration: PlaceholderPluginOptions | undefined;
11
+ dependencies: [
12
+ FocusPlugin,
13
+ CompositionPlugin,
14
+ TypeAheadPlugin
15
+ ];
16
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-placeholder",
3
- "version": "1.2.13",
3
+ "version": "1.3.1",
4
4
  "description": "Placeholder plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/editor-common": "^96.0.0",
34
+ "@atlaskit/editor-common": "^98.0.0",
35
35
  "@atlaskit/editor-plugin-composition": "^1.2.0",
36
36
  "@atlaskit/editor-plugin-focus": "^1.4.0",
37
37
  "@atlaskit/editor-plugin-type-ahead": "^1.11.0",
@@ -53,6 +53,9 @@
53
53
  ],
54
54
  "circular-dependencies": [
55
55
  "file-and-folder-level"
56
+ ],
57
+ "code-structure": [
58
+ "editor-plugin"
56
59
  ]
57
60
  },
58
61
  "@repo/internal": {