@atlaskit/editor-plugin-placeholder 6.5.2 → 6.5.4

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,21 @@
1
1
  # @atlaskit/editor-plugin-placeholder
2
2
 
3
+ ## 6.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`55920a92e882a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/55920a92e882a) -
8
+ tsignores added for help-center local consumpton removed
9
+ - Updated dependencies
10
+
11
+ ## 6.5.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [`41a91a916c125`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/41a91a916c125) -
16
+ EDITOR-2846 Change platform_synced_block to use editorExperiment and add Jira experiment
17
+ - Updated dependencies
18
+
3
19
  ## 6.5.2
4
20
 
5
21
  ### Patch Changes
@@ -19,7 +19,6 @@ var _state = require("@atlaskit/editor-prosemirror/state");
19
19
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
20
20
  var _view = require("@atlaskit/editor-prosemirror/view");
21
21
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
23
22
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
24
23
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
24
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -68,8 +67,6 @@ var cycleThroughPlaceholderPrompts = function cycleThroughPlaceholderPrompts(pla
68
67
  var displayedText = '';
69
68
  var animationTimeouts = [];
70
69
  var clearAllTimeouts = function clearAllTimeouts() {
71
- // @ts-ignore - Workaround for help-center local consumption
72
-
73
70
  animationTimeouts.forEach(function (timeoutId) {
74
71
  return clearTimeout(timeoutId);
75
72
  });
@@ -142,14 +139,10 @@ function createPlaceholderDecoration(editorState, placeholderText, placeholderPr
142
139
  if (docNode) {
143
140
  // Extract only the inline content from paragraphs, avoiding block-level elements
144
141
  // that can interfere with cursor rendering
145
- // @ts-ignore - Workaround for help-center local consumption
146
-
147
142
  docNode.children.forEach(function (node) {
148
143
  // For paragraph nodes, serialize their content (inline elements) directly
149
144
  // without the wrapping <p> tag
150
145
  if (node.type.name === 'paragraph') {
151
- // @ts-ignore - Workaround for help-center local consumption
152
-
153
146
  node.content.forEach(function (inlineNode) {
154
147
  var inlineDOM = serializer.serializeNode(inlineNode);
155
148
  placeholderNodeWithText.append(inlineDOM);
@@ -161,8 +154,6 @@ function createPlaceholderDecoration(editorState, placeholderText, placeholderPr
161
154
  }
162
155
  });
163
156
  var markElements = placeholderNodeWithText.querySelectorAll('[data-prosemirror-content-type="mark"]');
164
- // @ts-ignore - Workaround for help-center local consumption
165
-
166
157
  markElements.forEach(function (markEl) {
167
158
  if (markEl instanceof HTMLElement) {
168
159
  markEl.style.setProperty('color', "var(--ds-text-subtlest, #6B6E76)");
@@ -170,8 +161,6 @@ function createPlaceholderDecoration(editorState, placeholderText, placeholderPr
170
161
  });
171
162
  // Ensure all child elements don't block pointer events or cursor
172
163
  var allElements = placeholderNodeWithText.querySelectorAll('*');
173
- // @ts-ignore - Workaround for help-center local consumption
174
-
175
164
  allElements.forEach(function (el) {
176
165
  if (el instanceof HTMLElement) {
177
166
  el.style.pointerEvents = 'none';
@@ -370,7 +359,7 @@ function createPlaceHolderStateFrom(_ref5) {
370
359
  userHadTyped: userHadTyped
371
360
  });
372
361
  }
373
- if (nodeTypesWithSyncBlockPlaceholderText.includes(parentType) && isEmptyNode && (0, _expValEquals.expValEquals)('platform_synced_block', 'isEnabled', true)) {
362
+ if (nodeTypesWithSyncBlockPlaceholderText.includes(parentType) && isEmptyNode && (0, _experiments.editorExperiment)('platform_synced_block', true)) {
374
363
  return setPlaceHolderState({
375
364
  placeholderText: intl.formatMessage(_messages.placeholderTextMessages.syncBlockPlaceholderText),
376
365
  pos: $from.pos,
@@ -430,8 +419,6 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
430
419
  var isDestroyed = false;
431
420
  var activeTypewriterTimeouts = [];
432
421
  var clearAllTypewriterTimeouts = function clearAllTypewriterTimeouts() {
433
- // @ts-ignore - Workaround for help-center local consumption
434
-
435
422
  activeTypewriterTimeouts.forEach(function (clearFn) {
436
423
  return clearFn();
437
424
  });
@@ -440,8 +427,6 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
440
427
  return new _safePlugin.SafePlugin({
441
428
  key: pluginKey,
442
429
  state: {
443
- // @ts-ignore - Workaround for help-center local consumption
444
-
445
430
  init: function init(_, state) {
446
431
  var _api$focus, _api$typeAhead;
447
432
  return createPlaceHolderStateFrom({
@@ -459,8 +444,6 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
459
444
  intl: intl
460
445
  });
461
446
  },
462
- // @ts-ignore - Workaround for help-center local consumption
463
-
464
447
  apply: function apply(tr, placeholderState, _oldEditorState, newEditorState) {
465
448
  var _api$focus2, _placeholderState$isP, _api$typeAhead2, _ref7, _meta$placeholderText, _ref8, _meta$placeholderProm, _meta$showOnEmptyPara;
466
449
  var meta = tr.getMeta(pluginKey);
@@ -507,7 +490,6 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
507
490
  }
508
491
  },
509
492
  props: {
510
- // @ts-ignore - Workaround for help-center local consumption
511
493
  decorations: function decorations(editorState) {
512
494
  var _api$composition, _api$showDiff;
513
495
  var _getPlaceholderState = getPlaceholderState(editorState),
@@ -533,7 +515,6 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
533
515
  return;
534
516
  }
535
517
  },
536
- // @ts-ignore - Workaround for help-center local consumption
537
518
  view: function view() {
538
519
  var timeoutId;
539
520
  function startEmptyParagraphTimeout(editorView) {
@@ -554,7 +535,6 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
554
535
  }
555
536
  }
556
537
  return {
557
- // @ts-ignore - Workaround for help-center local consumption
558
538
  update: function update(editorView, prevState) {
559
539
  if ((0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_beta_2') || (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_ga')) {
560
540
  var prevPluginState = getPlaceholderState(prevState);
@@ -578,7 +558,6 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
578
558
  }
579
559
  }
580
560
  },
581
- // @ts-ignore - Workaround for help-center local consumption
582
561
  destroy: function destroy() {
583
562
  clearAllTypewriterTimeouts();
584
563
  destroyEmptyParagraphTimeout();
@@ -8,7 +8,6 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
8
8
  import { findParentNode } from '@atlaskit/editor-prosemirror/utils';
9
9
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
10
10
  import { fg } from '@atlaskit/platform-feature-flags';
11
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
11
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
13
12
  // Typewriter animation timing constants
14
13
  const TYPEWRITER_TYPE_DELAY = 50; // Delay between typing each character
@@ -52,8 +51,6 @@ const cycleThroughPlaceholderPrompts = (placeholderPrompts, activeTypewriterTime
52
51
  let displayedText = '';
53
52
  let animationTimeouts = [];
54
53
  const clearAllTimeouts = () => {
55
- // @ts-ignore - Workaround for help-center local consumption
56
-
57
54
  animationTimeouts.forEach(timeoutId => clearTimeout(timeoutId));
58
55
  animationTimeouts = [];
59
56
  };
@@ -121,14 +118,10 @@ export function createPlaceholderDecoration(editorState, placeholderText, placeh
121
118
  if (docNode) {
122
119
  // Extract only the inline content from paragraphs, avoiding block-level elements
123
120
  // that can interfere with cursor rendering
124
- // @ts-ignore - Workaround for help-center local consumption
125
-
126
121
  docNode.children.forEach(node => {
127
122
  // For paragraph nodes, serialize their content (inline elements) directly
128
123
  // without the wrapping <p> tag
129
124
  if (node.type.name === 'paragraph') {
130
- // @ts-ignore - Workaround for help-center local consumption
131
-
132
125
  node.content.forEach(inlineNode => {
133
126
  const inlineDOM = serializer.serializeNode(inlineNode);
134
127
  placeholderNodeWithText.append(inlineDOM);
@@ -140,8 +133,6 @@ export function createPlaceholderDecoration(editorState, placeholderText, placeh
140
133
  }
141
134
  });
142
135
  const markElements = placeholderNodeWithText.querySelectorAll('[data-prosemirror-content-type="mark"]');
143
- // @ts-ignore - Workaround for help-center local consumption
144
-
145
136
  markElements.forEach(markEl => {
146
137
  if (markEl instanceof HTMLElement) {
147
138
  markEl.style.setProperty('color', "var(--ds-text-subtlest, #6B6E76)");
@@ -149,8 +140,6 @@ export function createPlaceholderDecoration(editorState, placeholderText, placeh
149
140
  });
150
141
  // Ensure all child elements don't block pointer events or cursor
151
142
  const allElements = placeholderNodeWithText.querySelectorAll('*');
152
- // @ts-ignore - Workaround for help-center local consumption
153
-
154
143
  allElements.forEach(el => {
155
144
  if (el instanceof HTMLElement) {
156
145
  el.style.pointerEvents = 'none';
@@ -351,7 +340,7 @@ function createPlaceHolderStateFrom({
351
340
  userHadTyped
352
341
  });
353
342
  }
354
- if (nodeTypesWithSyncBlockPlaceholderText.includes(parentType) && isEmptyNode && expValEquals('platform_synced_block', 'isEnabled', true)) {
343
+ if (nodeTypesWithSyncBlockPlaceholderText.includes(parentType) && isEmptyNode && editorExperiment('platform_synced_block', true)) {
355
344
  return setPlaceHolderState({
356
345
  placeholderText: intl.formatMessage(messages.syncBlockPlaceholderText),
357
346
  pos: $from.pos,
@@ -414,16 +403,12 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
414
403
  let isDestroyed = false;
415
404
  let activeTypewriterTimeouts = [];
416
405
  const clearAllTypewriterTimeouts = () => {
417
- // @ts-ignore - Workaround for help-center local consumption
418
-
419
406
  activeTypewriterTimeouts.forEach(clearFn => clearFn());
420
407
  activeTypewriterTimeouts = [];
421
408
  };
422
409
  return new SafePlugin({
423
410
  key: pluginKey,
424
411
  state: {
425
- // @ts-ignore - Workaround for help-center local consumption
426
-
427
412
  init: (_, state) => {
428
413
  var _api$focus, _api$focus$sharedStat, _api$typeAhead;
429
414
  return createPlaceHolderStateFrom({
@@ -441,8 +426,6 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
441
426
  intl
442
427
  });
443
428
  },
444
- // @ts-ignore - Workaround for help-center local consumption
445
-
446
429
  apply: (tr, placeholderState, _oldEditorState, newEditorState) => {
447
430
  var _api$focus2, _api$focus2$sharedSta, _placeholderState$isP, _api$typeAhead2, _ref, _meta$placeholderText, _ref2, _meta$placeholderProm, _meta$showOnEmptyPara;
448
431
  const meta = tr.getMeta(pluginKey);
@@ -490,8 +473,6 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
490
473
  }
491
474
  },
492
475
  props: {
493
- // @ts-ignore - Workaround for help-center local consumption
494
-
495
476
  decorations(editorState) {
496
477
  var _api$composition, _api$showDiff, _api$showDiff$sharedS;
497
478
  const {
@@ -518,8 +499,6 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
518
499
  return;
519
500
  }
520
501
  },
521
- // @ts-ignore - Workaround for help-center local consumption
522
-
523
502
  view() {
524
503
  let timeoutId;
525
504
  function startEmptyParagraphTimeout(editorView) {
@@ -540,8 +519,6 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
540
519
  }
541
520
  }
542
521
  return {
543
- // @ts-ignore - Workaround for help-center local consumption
544
-
545
522
  update(editorView, prevState) {
546
523
  if (fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga')) {
547
524
  const prevPluginState = getPlaceholderState(prevState);
@@ -565,8 +542,6 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
565
542
  }
566
543
  }
567
544
  },
568
- // @ts-ignore - Workaround for help-center local consumption
569
-
570
545
  destroy() {
571
546
  clearAllTypewriterTimeouts();
572
547
  destroyEmptyParagraphTimeout();
@@ -11,7 +11,6 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
11
11
  import { findParentNode } from '@atlaskit/editor-prosemirror/utils';
12
12
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
13
13
  import { fg } from '@atlaskit/platform-feature-flags';
14
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
14
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
16
15
  // Typewriter animation timing constants
17
16
  var TYPEWRITER_TYPE_DELAY = 50; // Delay between typing each character
@@ -58,8 +57,6 @@ var cycleThroughPlaceholderPrompts = function cycleThroughPlaceholderPrompts(pla
58
57
  var displayedText = '';
59
58
  var animationTimeouts = [];
60
59
  var clearAllTimeouts = function clearAllTimeouts() {
61
- // @ts-ignore - Workaround for help-center local consumption
62
-
63
60
  animationTimeouts.forEach(function (timeoutId) {
64
61
  return clearTimeout(timeoutId);
65
62
  });
@@ -132,14 +129,10 @@ export function createPlaceholderDecoration(editorState, placeholderText, placeh
132
129
  if (docNode) {
133
130
  // Extract only the inline content from paragraphs, avoiding block-level elements
134
131
  // that can interfere with cursor rendering
135
- // @ts-ignore - Workaround for help-center local consumption
136
-
137
132
  docNode.children.forEach(function (node) {
138
133
  // For paragraph nodes, serialize their content (inline elements) directly
139
134
  // without the wrapping <p> tag
140
135
  if (node.type.name === 'paragraph') {
141
- // @ts-ignore - Workaround for help-center local consumption
142
-
143
136
  node.content.forEach(function (inlineNode) {
144
137
  var inlineDOM = serializer.serializeNode(inlineNode);
145
138
  placeholderNodeWithText.append(inlineDOM);
@@ -151,8 +144,6 @@ export function createPlaceholderDecoration(editorState, placeholderText, placeh
151
144
  }
152
145
  });
153
146
  var markElements = placeholderNodeWithText.querySelectorAll('[data-prosemirror-content-type="mark"]');
154
- // @ts-ignore - Workaround for help-center local consumption
155
-
156
147
  markElements.forEach(function (markEl) {
157
148
  if (markEl instanceof HTMLElement) {
158
149
  markEl.style.setProperty('color', "var(--ds-text-subtlest, #6B6E76)");
@@ -160,8 +151,6 @@ export function createPlaceholderDecoration(editorState, placeholderText, placeh
160
151
  });
161
152
  // Ensure all child elements don't block pointer events or cursor
162
153
  var allElements = placeholderNodeWithText.querySelectorAll('*');
163
- // @ts-ignore - Workaround for help-center local consumption
164
-
165
154
  allElements.forEach(function (el) {
166
155
  if (el instanceof HTMLElement) {
167
156
  el.style.pointerEvents = 'none';
@@ -360,7 +349,7 @@ function createPlaceHolderStateFrom(_ref5) {
360
349
  userHadTyped: userHadTyped
361
350
  });
362
351
  }
363
- if (nodeTypesWithSyncBlockPlaceholderText.includes(parentType) && isEmptyNode && expValEquals('platform_synced_block', 'isEnabled', true)) {
352
+ if (nodeTypesWithSyncBlockPlaceholderText.includes(parentType) && isEmptyNode && editorExperiment('platform_synced_block', true)) {
364
353
  return setPlaceHolderState({
365
354
  placeholderText: intl.formatMessage(messages.syncBlockPlaceholderText),
366
355
  pos: $from.pos,
@@ -420,8 +409,6 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
420
409
  var isDestroyed = false;
421
410
  var activeTypewriterTimeouts = [];
422
411
  var clearAllTypewriterTimeouts = function clearAllTypewriterTimeouts() {
423
- // @ts-ignore - Workaround for help-center local consumption
424
-
425
412
  activeTypewriterTimeouts.forEach(function (clearFn) {
426
413
  return clearFn();
427
414
  });
@@ -430,8 +417,6 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
430
417
  return new SafePlugin({
431
418
  key: pluginKey,
432
419
  state: {
433
- // @ts-ignore - Workaround for help-center local consumption
434
-
435
420
  init: function init(_, state) {
436
421
  var _api$focus, _api$typeAhead;
437
422
  return createPlaceHolderStateFrom({
@@ -449,8 +434,6 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
449
434
  intl: intl
450
435
  });
451
436
  },
452
- // @ts-ignore - Workaround for help-center local consumption
453
-
454
437
  apply: function apply(tr, placeholderState, _oldEditorState, newEditorState) {
455
438
  var _api$focus2, _placeholderState$isP, _api$typeAhead2, _ref7, _meta$placeholderText, _ref8, _meta$placeholderProm, _meta$showOnEmptyPara;
456
439
  var meta = tr.getMeta(pluginKey);
@@ -497,7 +480,6 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
497
480
  }
498
481
  },
499
482
  props: {
500
- // @ts-ignore - Workaround for help-center local consumption
501
483
  decorations: function decorations(editorState) {
502
484
  var _api$composition, _api$showDiff;
503
485
  var _getPlaceholderState = getPlaceholderState(editorState),
@@ -523,7 +505,6 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
523
505
  return;
524
506
  }
525
507
  },
526
- // @ts-ignore - Workaround for help-center local consumption
527
508
  view: function view() {
528
509
  var timeoutId;
529
510
  function startEmptyParagraphTimeout(editorView) {
@@ -544,7 +525,6 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
544
525
  }
545
526
  }
546
527
  return {
547
- // @ts-ignore - Workaround for help-center local consumption
548
528
  update: function update(editorView, prevState) {
549
529
  if (fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga')) {
550
530
  var prevPluginState = getPlaceholderState(prevState);
@@ -568,7 +548,6 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
568
548
  }
569
549
  }
570
550
  },
571
- // @ts-ignore - Workaround for help-center local consumption
572
551
  destroy: function destroy() {
573
552
  clearAllTypewriterTimeouts();
574
553
  destroyEmptyParagraphTimeout();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-placeholder",
3
- "version": "6.5.2",
3
+ "version": "6.5.4",
4
4
  "description": "Placeholder plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,7 +34,7 @@
34
34
  "@atlaskit/editor-plugin-type-ahead": "^6.5.0",
35
35
  "@atlaskit/editor-prosemirror": "7.0.0",
36
36
  "@atlaskit/platform-feature-flags": "^1.1.0",
37
- "@atlaskit/tmp-editor-statsig": "^14.0.0",
37
+ "@atlaskit/tmp-editor-statsig": "^14.2.0",
38
38
  "@atlaskit/tokens": "^8.4.0",
39
39
  "@babel/runtime": "^7.0.0"
40
40
  },