@atlaskit/editor-ssr-renderer 2.1.1 → 2.1.3

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,17 @@
1
1
  # @atlaskit/editor-ssr-renderer
2
2
 
3
+ ## 2.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 2.1.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 2.1.1
4
16
 
5
17
  ### Patch Changes
@@ -20,6 +20,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
20
20
  var _model = require("@atlaskit/editor-prosemirror/model");
21
21
  var _eventDispatcher = require("@atlaskit/editor-common/event-dispatcher");
22
22
  var _providerFactory = require("@atlaskit/editor-common/provider-factory");
23
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
23
24
  var _excluded = ["plugins", "schema", "doc", "portalProviderAPI", "intl", "onEditorStateChanged"];
24
25
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
25
26
  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; }
@@ -377,13 +378,17 @@ function EditorSSRRenderer(_ref) {
377
378
  return /*#__PURE__*/_react.default.createElement("div", {
378
379
  ref: containerRef,
379
380
  id: divProps.id
381
+ // For some reason on SSR, the result `class` has a trailing space, that broke UFO,
382
+ // because ReactEditorView produces a div with `class` without space.
380
383
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
381
384
  ,
382
- className: divProps.className,
385
+ className: divProps.className.trim(),
383
386
  "aria-label": divProps['aria-label'],
384
387
  "aria-describedby": divProps['aria-describedby'],
385
388
  "data-editor-id": divProps['data-editor-id'],
386
389
  "data-vc-ignore-if-no-layout-shift": true,
390
+ "data-ssr-placeholder": (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? 'editor-view' : undefined,
391
+ "data-ssr-placeholder-replace": (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? 'editor-view' : undefined,
387
392
  "aria-multiline": true,
388
393
  role: "textbox"
389
394
  // @ts-expect-error - contenteditable is not exist in div attributes
@@ -4,6 +4,7 @@ import { EditorState } from '@atlaskit/editor-prosemirror/state';
4
4
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
5
5
  import { EventDispatcher, createDispatch } from '@atlaskit/editor-common/event-dispatcher';
6
6
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
7
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
8
 
8
9
  // The copy of type from prosemirror-view.
9
10
  // Probably, we need to fix this package exports and add `NodeViewConstructor` and `MarkViewConstructor` types here.
@@ -286,13 +287,17 @@ export function EditorSSRRenderer({
286
287
  return /*#__PURE__*/React.createElement("div", {
287
288
  ref: containerRef,
288
289
  id: divProps.id
290
+ // For some reason on SSR, the result `class` has a trailing space, that broke UFO,
291
+ // because ReactEditorView produces a div with `class` without space.
289
292
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
290
293
  ,
291
- className: divProps.className,
294
+ className: divProps.className.trim(),
292
295
  "aria-label": divProps['aria-label'],
293
296
  "aria-describedby": divProps['aria-describedby'],
294
297
  "data-editor-id": divProps['data-editor-id'],
295
298
  "data-vc-ignore-if-no-layout-shift": true,
299
+ "data-ssr-placeholder": expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? 'editor-view' : undefined,
300
+ "data-ssr-placeholder-replace": expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? 'editor-view' : undefined,
296
301
  "aria-multiline": true,
297
302
  role: "textbox"
298
303
  // @ts-expect-error - contenteditable is not exist in div attributes
@@ -17,6 +17,7 @@ import { EditorState } from '@atlaskit/editor-prosemirror/state';
17
17
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
18
18
  import { EventDispatcher, createDispatch } from '@atlaskit/editor-common/event-dispatcher';
19
19
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
20
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
20
21
 
21
22
  // The copy of type from prosemirror-view.
22
23
  // Probably, we need to fix this package exports and add `NodeViewConstructor` and `MarkViewConstructor` types here.
@@ -369,13 +370,17 @@ export function EditorSSRRenderer(_ref) {
369
370
  return /*#__PURE__*/React.createElement("div", {
370
371
  ref: containerRef,
371
372
  id: divProps.id
373
+ // For some reason on SSR, the result `class` has a trailing space, that broke UFO,
374
+ // because ReactEditorView produces a div with `class` without space.
372
375
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
373
376
  ,
374
- className: divProps.className,
377
+ className: divProps.className.trim(),
375
378
  "aria-label": divProps['aria-label'],
376
379
  "aria-describedby": divProps['aria-describedby'],
377
380
  "data-editor-id": divProps['data-editor-id'],
378
381
  "data-vc-ignore-if-no-layout-shift": true,
382
+ "data-ssr-placeholder": expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? 'editor-view' : undefined,
383
+ "data-ssr-placeholder-replace": expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? 'editor-view' : undefined,
379
384
  "aria-multiline": true,
380
385
  role: "textbox"
381
386
  // @ts-expect-error - contenteditable is not exist in div attributes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-ssr-renderer",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "SSR Renderer based on Editor",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "atlassian": {
@@ -29,6 +29,7 @@
29
29
  "dependencies": {
30
30
  "@atlaskit/adf-schema": "^51.5.0",
31
31
  "@atlaskit/editor-prosemirror": "^7.3.0",
32
+ "@atlaskit/tmp-editor-statsig": "^22.0.0",
32
33
  "@babel/runtime": "^7.0.0",
33
34
  "react-intl-next": "npm:react-intl@^5.18.1"
34
35
  },