@atlaskit/editor-plugin-placeholder 2.0.8 → 2.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-placeholder
2
2
 
3
+ ## 2.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#131399](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/131399)
8
+ [`3e2bb97c408f7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3e2bb97c408f7) -
9
+ Add className to nested nodes for placeholder text to selectively apply truncation on long text
10
+
3
11
  ## 2.0.8
4
12
 
5
13
  ### Patch Changes
@@ -49,6 +49,13 @@ function createPlaceholderDecoration(editorState, placeholderText) {
49
49
  buffNode.textContent = ' ';
50
50
  placeholderDecoration.appendChild(buffNode);
51
51
  }
52
+ var isTargetNested = editorState.doc.resolve(pos).depth > 1;
53
+
54
+ // only truncate text for nested nodes, otherwise applying 'overflow: hidden;' to top level nodes
55
+ // creates issues with quick insert button
56
+ if (isTargetNested && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
57
+ placeholderDecoration.classList.add('placeholder-decoration-hide-overflow');
58
+ }
52
59
  return _view.DecorationSet.create(editorState.doc, [_view.Decoration.widget(pos, placeholderDecoration, {
53
60
  side: 0,
54
61
  key: "placeholder ".concat(placeholderText)
@@ -40,6 +40,13 @@ export function createPlaceholderDecoration(editorState, placeholderText, pos =
40
40
  buffNode.textContent = ' ';
41
41
  placeholderDecoration.appendChild(buffNode);
42
42
  }
43
+ const isTargetNested = editorState.doc.resolve(pos).depth > 1;
44
+
45
+ // only truncate text for nested nodes, otherwise applying 'overflow: hidden;' to top level nodes
46
+ // creates issues with quick insert button
47
+ if (isTargetNested && editorExperiment('platform_editor_controls', 'variant1')) {
48
+ placeholderDecoration.classList.add('placeholder-decoration-hide-overflow');
49
+ }
43
50
  return DecorationSet.create(editorState.doc, [Decoration.widget(pos, placeholderDecoration, {
44
51
  side: 0,
45
52
  key: `placeholder ${placeholderText}`
@@ -41,6 +41,13 @@ export function createPlaceholderDecoration(editorState, placeholderText) {
41
41
  buffNode.textContent = ' ';
42
42
  placeholderDecoration.appendChild(buffNode);
43
43
  }
44
+ var isTargetNested = editorState.doc.resolve(pos).depth > 1;
45
+
46
+ // only truncate text for nested nodes, otherwise applying 'overflow: hidden;' to top level nodes
47
+ // creates issues with quick insert button
48
+ if (isTargetNested && editorExperiment('platform_editor_controls', 'variant1')) {
49
+ placeholderDecoration.classList.add('placeholder-decoration-hide-overflow');
50
+ }
44
51
  return DecorationSet.create(editorState.doc, [Decoration.widget(pos, placeholderDecoration, {
45
52
  side: 0,
46
53
  key: "placeholder ".concat(placeholderText)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-placeholder",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "description": "Placeholder plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,12 +31,12 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/editor-common": "^102.12.0",
34
+ "@atlaskit/editor-common": "^102.13.0",
35
35
  "@atlaskit/editor-plugin-composition": "^1.3.0",
36
36
  "@atlaskit/editor-plugin-focus": "^1.5.0",
37
- "@atlaskit/editor-plugin-type-ahead": "^2.1.0",
37
+ "@atlaskit/editor-plugin-type-ahead": "^2.2.0",
38
38
  "@atlaskit/editor-prosemirror": "7.0.0",
39
- "@atlaskit/tmp-editor-statsig": "^4.1.0",
39
+ "@atlaskit/tmp-editor-statsig": "^4.4.0",
40
40
  "@babel/runtime": "^7.0.0"
41
41
  },
42
42
  "peerDependencies": {