@atlaskit/editor-common 114.24.0 → 114.25.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,22 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 114.25.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ded95ac7efcc4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ded95ac7efcc4) -
8
+ Persist code block wrap state in ADF, default code blocks created across editor runtime paths to
9
+ wrapped, and update the wrap toolbar tooltip behind platform_editor_code_block_q4_lovability.
10
+ - Updated dependencies
11
+
12
+ ## 114.25.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [`136d15a32935f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/136d15a32935f) -
17
+ [ux] Adding initial scaffolding (non-functional) for agent-managed blocks as an editor
18
+ extension/plugin and use in Confluence
19
+
3
20
  ## 114.24.0
4
21
 
5
22
  ### Minor Changes
@@ -1,17 +1,57 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
- exports.updateCodeBlockWrappedStateNodeKeys = exports.transferCodeBlockWrappedValue = exports.setCodeBlockFoldState = exports.isCodeBlockWordWrapEnabled = exports.getCodeBlockFoldState = exports.defaultWordWrapState = exports.codeBlockWrappedStates = void 0;
7
+ exports.updateCodeBlockWrappedStateNodeKeys = exports.transferCodeBlockWrappedValue = exports.setCodeBlockFoldState = exports.isCodeBlockWordWrapEnabled = exports.getDefaultCodeBlockAttrs = exports.getCodeBlockFoldState = exports.defaultWrapForMarkdownCodeBlocksInSlice = exports.defaultWordWrapState = exports.codeBlockWrappedStates = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
9
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
10
+ var _slice = require("../utils/slice");
11
+ 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; }
12
+ 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; }
8
13
  var defaultWordWrapState = exports.defaultWordWrapState = false;
14
+
15
+ // Remove the wrap WeakMap fallback when cleaning up platform_editor_code_block_q4_lovability
9
16
  var codeBlockWrappedStates = exports.codeBlockWrappedStates = new WeakMap();
17
+ var getDefaultCodeBlockAttrs = exports.getDefaultCodeBlockAttrs = function getDefaultCodeBlockAttrs(attrs) {
18
+ if (!(0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
19
+ return attrs;
20
+ }
21
+
22
+ // attrs.wrap is already set (either true or false) — respect the caller's intent.
23
+ if ((attrs === null || attrs === void 0 ? void 0 : attrs.wrap) !== undefined) {
24
+ return attrs;
25
+ }
26
+ return _objectSpread(_objectSpread({}, attrs), {}, {
27
+ wrap: true
28
+ });
29
+ };
30
+ var defaultWrapForMarkdownCodeBlocksInSlice = exports.defaultWrapForMarkdownCodeBlocksInSlice = function defaultWrapForMarkdownCodeBlocksInSlice(slice, schema) {
31
+ if (!(0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
32
+ return slice;
33
+ }
34
+ return (0, _slice.mapSlice)(slice, function (node) {
35
+ if (node.type !== schema.nodes.codeBlock || node.attrs.wrap === true) {
36
+ return node;
37
+ }
38
+
39
+ // Markdown conversion uses MarkdownParser token mappings and creates code block nodes
40
+ // with the schema-default wrap:false. Since Markdown has no wrap syntax, treat that
41
+ // default as missing user intent and change it to wrap:true.
42
+ return node.type.create(_objectSpread(_objectSpread({}, node.attrs), {}, {
43
+ wrap: true
44
+ }), node.content, node.marks);
45
+ });
46
+ };
10
47
 
11
48
  // Code folding state management - similar to word wrapping
12
49
 
13
50
  var codeBlockFoldStates = new WeakMap();
14
51
  var isCodeBlockWordWrapEnabled = exports.isCodeBlockWordWrapEnabled = function isCodeBlockWordWrapEnabled(codeBlockNode) {
52
+ if ((0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
53
+ return Boolean(codeBlockNode.attrs.wrap);
54
+ }
15
55
  var currentNodeWordWrapState = codeBlockWrappedStates.get(codeBlockNode);
16
56
  return currentNodeWordWrapState !== undefined ? currentNodeWordWrapState : defaultWordWrapState;
17
57
  };
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.NATIVE_EMBED_EXTENSION_TYPE = exports.NATIVE_EMBED_EXTENSION_KEY = exports.FORGE_EXTENSION_TYPE = void 0;
7
+ exports.NATIVE_EMBED_EXTENSION_TYPE = exports.NATIVE_EMBED_EXTENSION_KEY = exports.FORGE_EXTENSION_TYPE = exports.AGENT_MANAGED_EXTENSION_KEY = void 0;
8
8
  exports.buildAction = buildAction;
9
9
  exports.buildExtensionKeyAndNodeKey = void 0;
10
10
  exports.buildNode = buildNode;
@@ -18,6 +18,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
18
18
  var FORGE_EXTENSION_TYPE = exports.FORGE_EXTENSION_TYPE = 'com.atlassian.ecosystem';
19
19
  var NATIVE_EMBED_EXTENSION_TYPE = exports.NATIVE_EMBED_EXTENSION_TYPE = 'com.atlassian.confluence.macro.core';
20
20
  var NATIVE_EMBED_EXTENSION_KEY = exports.NATIVE_EMBED_EXTENSION_KEY = 'native-embed';
21
+ var AGENT_MANAGED_EXTENSION_KEY = exports.AGENT_MANAGED_EXTENSION_KEY = 'agent-managed-block';
21
22
  var getExtensionKeyAndNodeKey = exports.getExtensionKeyAndNodeKey = function getExtensionKeyAndNodeKey(extensionKey, extensionType) {
22
23
  // Forge macro extensionKey has a user generated string, so splitting on
23
24
  // a colon is unstable for their particular use case. They only have one
@@ -4,6 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ Object.defineProperty(exports, "AGENT_MANAGED_EXTENSION_KEY", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _manifestHelpers.AGENT_MANAGED_EXTENSION_KEY;
11
+ }
12
+ });
7
13
  Object.defineProperty(exports, "DefaultExtensionProvider", {
8
14
  enumerable: true,
9
15
  get: function get() {
@@ -16,6 +16,8 @@ var codeBlockButtonMessages = exports.codeBlockButtonMessages = (0, _reactIntl.d
16
16
  defaultMessage: 'Copied!',
17
17
  description: 'Copied the content of the code block as text to clipboard'
18
18
  },
19
+ // Remove wrapCode/unwrapCode and use wrapCodeLabel/unwrapCodeLabel
20
+ // when cleaning up platform_editor_code_block_q4_lovability.
19
21
  wrapCode: {
20
22
  id: 'fabric.editor.codeBlockWrapButton.wrapCodeBlock',
21
23
  defaultMessage: 'Turn on wrap',
@@ -26,6 +28,16 @@ var codeBlockButtonMessages = exports.codeBlockButtonMessages = (0, _reactIntl.d
26
28
  defaultMessage: 'Turn off wrap',
27
29
  description: 'Label for a toolbar button in the code block that disables line wrapping so long lines of code extend horizontally without breaking.'
28
30
  },
31
+ wrapCodeLabel: {
32
+ id: 'fabric.editor.codeBlockWrapButton.wrapCode',
33
+ defaultMessage: 'Wrap code',
34
+ description: 'Tooltip for a code block toolbar button that turns on line wrapping. This is shown when code is not wrapped.'
35
+ },
36
+ unwrapCodeLabel: {
37
+ id: 'fabric.editor.codeBlockWrapButton.unwrapCode',
38
+ defaultMessage: 'Unwrap code',
39
+ description: 'Tooltip for a code block toolbar button that turns off line wrapping. This is shown when code is wrapped.'
40
+ },
29
41
  selectLanguage: {
30
42
  id: 'fabric.editor.selectLanguage',
31
43
  defaultMessage: 'Select language',
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
19
19
  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); }
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "114.23.0";
22
+ var packageVersion = "114.25.0";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "114.23.0";
27
+ var packageVersion = "114.25.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -1,11 +1,49 @@
1
1
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
2
+ import { mapSlice } from '../utils/slice';
2
3
  export const defaultWordWrapState = false;
4
+
5
+ // Remove the wrap WeakMap fallback when cleaning up platform_editor_code_block_q4_lovability
3
6
  export const codeBlockWrappedStates = new WeakMap();
7
+ export const getDefaultCodeBlockAttrs = attrs => {
8
+ if (!expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
9
+ return attrs;
10
+ }
11
+
12
+ // attrs.wrap is already set (either true or false) — respect the caller's intent.
13
+ if ((attrs === null || attrs === void 0 ? void 0 : attrs.wrap) !== undefined) {
14
+ return attrs;
15
+ }
16
+ return {
17
+ ...attrs,
18
+ wrap: true
19
+ };
20
+ };
21
+ export const defaultWrapForMarkdownCodeBlocksInSlice = (slice, schema) => {
22
+ if (!expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
23
+ return slice;
24
+ }
25
+ return mapSlice(slice, node => {
26
+ if (node.type !== schema.nodes.codeBlock || node.attrs.wrap === true) {
27
+ return node;
28
+ }
29
+
30
+ // Markdown conversion uses MarkdownParser token mappings and creates code block nodes
31
+ // with the schema-default wrap:false. Since Markdown has no wrap syntax, treat that
32
+ // default as missing user intent and change it to wrap:true.
33
+ return node.type.create({
34
+ ...node.attrs,
35
+ wrap: true
36
+ }, node.content, node.marks);
37
+ });
38
+ };
4
39
 
5
40
  // Code folding state management - similar to word wrapping
6
41
 
7
42
  const codeBlockFoldStates = new WeakMap();
8
43
  export const isCodeBlockWordWrapEnabled = codeBlockNode => {
44
+ if (expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
45
+ return Boolean(codeBlockNode.attrs.wrap);
46
+ }
9
47
  const currentNodeWordWrapState = codeBlockWrappedStates.get(codeBlockNode);
10
48
  return currentNodeWordWrapState !== undefined ? currentNodeWordWrapState : defaultWordWrapState;
11
49
  };
@@ -1,6 +1,7 @@
1
1
  export const FORGE_EXTENSION_TYPE = 'com.atlassian.ecosystem';
2
2
  export const NATIVE_EMBED_EXTENSION_TYPE = 'com.atlassian.confluence.macro.core';
3
3
  export const NATIVE_EMBED_EXTENSION_KEY = 'native-embed';
4
+ export const AGENT_MANAGED_EXTENSION_KEY = 'agent-managed-block';
4
5
  export const getExtensionKeyAndNodeKey = (extensionKey, extensionType) => {
5
6
  // Forge macro extensionKey has a user generated string, so splitting on
6
7
  // a colon is unstable for their particular use case. They only have one
@@ -5,7 +5,7 @@ export { isFieldset, isTabGroup, isTabField, isExpand, isDateRange } from './ext
5
5
  export { createAutoConverterRunner, getExtensionAutoConvertersFromProvider, getQuickInsertItemsFromModule, getContextualToolbarItemsFromModule, buildMenuItem } from './extensions/module-helpers';
6
6
  export { default as DefaultExtensionProvider } from './extensions/default-extension-provider';
7
7
  export { default as combineExtensionProviders } from './extensions/combine-extension-providers';
8
- export { getExtensionKeyAndNodeKey, NATIVE_EMBED_EXTENSION_TYPE, NATIVE_EMBED_EXTENSION_KEY, resolveImport } from './extensions/manifest-helpers';
8
+ export { AGENT_MANAGED_EXTENSION_KEY, getExtensionKeyAndNodeKey, NATIVE_EMBED_EXTENSION_TYPE, NATIVE_EMBED_EXTENSION_KEY, resolveImport } from './extensions/manifest-helpers';
9
9
  export { getExtensionModuleNode, getNodeRenderer, getExtensionModuleNodePrivateProps, getExtensionManifest } from './extensions/extension-handlers';
10
10
  export { getCustomFieldResolver, getFieldSerializer, getFieldDeserializer, getUserFieldContextProvider } from './extensions/extension-fields-helpers';
11
11
  export { configPanelMessages, messages } from './extensions/messages';
@@ -10,6 +10,8 @@ export const codeBlockButtonMessages = defineMessages({
10
10
  defaultMessage: 'Copied!',
11
11
  description: 'Copied the content of the code block as text to clipboard'
12
12
  },
13
+ // Remove wrapCode/unwrapCode and use wrapCodeLabel/unwrapCodeLabel
14
+ // when cleaning up platform_editor_code_block_q4_lovability.
13
15
  wrapCode: {
14
16
  id: 'fabric.editor.codeBlockWrapButton.wrapCodeBlock',
15
17
  defaultMessage: 'Turn on wrap',
@@ -20,6 +22,16 @@ export const codeBlockButtonMessages = defineMessages({
20
22
  defaultMessage: 'Turn off wrap',
21
23
  description: 'Label for a toolbar button in the code block that disables line wrapping so long lines of code extend horizontally without breaking.'
22
24
  },
25
+ wrapCodeLabel: {
26
+ id: 'fabric.editor.codeBlockWrapButton.wrapCode',
27
+ defaultMessage: 'Wrap code',
28
+ description: 'Tooltip for a code block toolbar button that turns on line wrapping. This is shown when code is not wrapped.'
29
+ },
30
+ unwrapCodeLabel: {
31
+ id: 'fabric.editor.codeBlockWrapButton.unwrapCode',
32
+ defaultMessage: 'Unwrap code',
33
+ description: 'Tooltip for a code block toolbar button that turns off line wrapping. This is shown when code is wrapped.'
34
+ },
23
35
  selectLanguage: {
24
36
  id: 'fabric.editor.selectLanguage',
25
37
  defaultMessage: 'Select language',
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
4
4
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
5
5
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
6
6
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
7
- const packageVersion = "114.23.0";
7
+ const packageVersion = "114.25.0";
8
8
  const sanitiseSentryEvents = (data, _hint) => {
9
9
  // Remove URL as it has UGC
10
10
  // Ignored via go/ees007
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "114.23.0";
17
+ const packageVersion = "114.25.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -1,11 +1,50 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ 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; }
3
+ 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) { _defineProperty(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; }
1
4
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
+ import { mapSlice } from '../utils/slice';
2
6
  export var defaultWordWrapState = false;
7
+
8
+ // Remove the wrap WeakMap fallback when cleaning up platform_editor_code_block_q4_lovability
3
9
  export var codeBlockWrappedStates = new WeakMap();
10
+ export var getDefaultCodeBlockAttrs = function getDefaultCodeBlockAttrs(attrs) {
11
+ if (!expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
12
+ return attrs;
13
+ }
14
+
15
+ // attrs.wrap is already set (either true or false) — respect the caller's intent.
16
+ if ((attrs === null || attrs === void 0 ? void 0 : attrs.wrap) !== undefined) {
17
+ return attrs;
18
+ }
19
+ return _objectSpread(_objectSpread({}, attrs), {}, {
20
+ wrap: true
21
+ });
22
+ };
23
+ export var defaultWrapForMarkdownCodeBlocksInSlice = function defaultWrapForMarkdownCodeBlocksInSlice(slice, schema) {
24
+ if (!expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
25
+ return slice;
26
+ }
27
+ return mapSlice(slice, function (node) {
28
+ if (node.type !== schema.nodes.codeBlock || node.attrs.wrap === true) {
29
+ return node;
30
+ }
31
+
32
+ // Markdown conversion uses MarkdownParser token mappings and creates code block nodes
33
+ // with the schema-default wrap:false. Since Markdown has no wrap syntax, treat that
34
+ // default as missing user intent and change it to wrap:true.
35
+ return node.type.create(_objectSpread(_objectSpread({}, node.attrs), {}, {
36
+ wrap: true
37
+ }), node.content, node.marks);
38
+ });
39
+ };
4
40
 
5
41
  // Code folding state management - similar to word wrapping
6
42
 
7
43
  var codeBlockFoldStates = new WeakMap();
8
44
  export var isCodeBlockWordWrapEnabled = function isCodeBlockWordWrapEnabled(codeBlockNode) {
45
+ if (expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
46
+ return Boolean(codeBlockNode.attrs.wrap);
47
+ }
9
48
  var currentNodeWordWrapState = codeBlockWrappedStates.get(codeBlockNode);
10
49
  return currentNodeWordWrapState !== undefined ? currentNodeWordWrapState : defaultWordWrapState;
11
50
  };
@@ -7,6 +7,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
7
7
  export var FORGE_EXTENSION_TYPE = 'com.atlassian.ecosystem';
8
8
  export var NATIVE_EMBED_EXTENSION_TYPE = 'com.atlassian.confluence.macro.core';
9
9
  export var NATIVE_EMBED_EXTENSION_KEY = 'native-embed';
10
+ export var AGENT_MANAGED_EXTENSION_KEY = 'agent-managed-block';
10
11
  export var getExtensionKeyAndNodeKey = function getExtensionKeyAndNodeKey(extensionKey, extensionType) {
11
12
  // Forge macro extensionKey has a user generated string, so splitting on
12
13
  // a colon is unstable for their particular use case. They only have one
@@ -5,7 +5,7 @@ export { isFieldset, isTabGroup, isTabField, isExpand, isDateRange } from './ext
5
5
  export { createAutoConverterRunner, getExtensionAutoConvertersFromProvider, getQuickInsertItemsFromModule, getContextualToolbarItemsFromModule, buildMenuItem } from './extensions/module-helpers';
6
6
  export { default as DefaultExtensionProvider } from './extensions/default-extension-provider';
7
7
  export { default as combineExtensionProviders } from './extensions/combine-extension-providers';
8
- export { getExtensionKeyAndNodeKey, NATIVE_EMBED_EXTENSION_TYPE, NATIVE_EMBED_EXTENSION_KEY, resolveImport } from './extensions/manifest-helpers';
8
+ export { AGENT_MANAGED_EXTENSION_KEY, getExtensionKeyAndNodeKey, NATIVE_EMBED_EXTENSION_TYPE, NATIVE_EMBED_EXTENSION_KEY, resolveImport } from './extensions/manifest-helpers';
9
9
  export { getExtensionModuleNode, getNodeRenderer, getExtensionModuleNodePrivateProps, getExtensionManifest } from './extensions/extension-handlers';
10
10
  export { getCustomFieldResolver, getFieldSerializer, getFieldDeserializer, getUserFieldContextProvider } from './extensions/extension-fields-helpers';
11
11
  export { configPanelMessages, messages } from './extensions/messages';
@@ -10,6 +10,8 @@ export var codeBlockButtonMessages = defineMessages({
10
10
  defaultMessage: 'Copied!',
11
11
  description: 'Copied the content of the code block as text to clipboard'
12
12
  },
13
+ // Remove wrapCode/unwrapCode and use wrapCodeLabel/unwrapCodeLabel
14
+ // when cleaning up platform_editor_code_block_q4_lovability.
13
15
  wrapCode: {
14
16
  id: 'fabric.editor.codeBlockWrapButton.wrapCodeBlock',
15
17
  defaultMessage: 'Turn on wrap',
@@ -20,6 +22,16 @@ export var codeBlockButtonMessages = defineMessages({
20
22
  defaultMessage: 'Turn off wrap',
21
23
  description: 'Label for a toolbar button in the code block that disables line wrapping so long lines of code extend horizontally without breaking.'
22
24
  },
25
+ wrapCodeLabel: {
26
+ id: 'fabric.editor.codeBlockWrapButton.wrapCode',
27
+ defaultMessage: 'Wrap code',
28
+ description: 'Tooltip for a code block toolbar button that turns on line wrapping. This is shown when code is not wrapped.'
29
+ },
30
+ unwrapCodeLabel: {
31
+ id: 'fabric.editor.codeBlockWrapButton.unwrapCode',
32
+ defaultMessage: 'Unwrap code',
33
+ description: 'Tooltip for a code block toolbar button that turns off line wrapping. This is shown when code is wrapped.'
34
+ },
23
35
  selectLanguage: {
24
36
  id: 'fabric.editor.selectLanguage',
25
37
  defaultMessage: 'Select language',
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
10
10
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
11
11
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
12
12
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
13
- var packageVersion = "114.23.0";
13
+ var packageVersion = "114.25.0";
14
14
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
15
15
  // Remove URL as it has UGC
16
16
  // Ignored via go/ees007
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "114.23.0";
24
+ var packageVersion = "114.25.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -1,8 +1,12 @@
1
- import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
1
+ import type { CodeBlockAttrs } from '@atlaskit/adf-schema';
2
+ import type { Node as PmNode, Schema, Slice } from '@atlaskit/editor-prosemirror/model';
2
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
4
  import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
4
5
  export declare const defaultWordWrapState = false;
5
6
  export declare const codeBlockWrappedStates: WeakMap<PmNode, boolean | undefined>;
7
+ type OptionalCodeBlockAttrs = CodeBlockAttrs | undefined;
8
+ export declare const getDefaultCodeBlockAttrs: (attrs?: CodeBlockAttrs) => OptionalCodeBlockAttrs;
9
+ export declare const defaultWrapForMarkdownCodeBlocksInSlice: (slice: Slice, schema: Schema) => Slice;
6
10
  export interface FoldRange {
7
11
  from: number;
8
12
  to: number;
@@ -20,3 +24,4 @@ export declare const transferCodeBlockWrappedValue: (oldCodeBlockNode: PmNode, n
20
24
  * This function takes all the given nodes, finds their old nodes from the old state and updates these old node keys.
21
25
  */
22
26
  export declare const updateCodeBlockWrappedStateNodeKeys: (newCodeBlockNodes: NodeWithPos[], oldState: EditorState) => void;
27
+ export {};
@@ -4,6 +4,7 @@ import type { Parameters } from './types/extension-parameters';
4
4
  export declare const FORGE_EXTENSION_TYPE = "com.atlassian.ecosystem";
5
5
  export declare const NATIVE_EMBED_EXTENSION_TYPE = "com.atlassian.confluence.macro.core";
6
6
  export declare const NATIVE_EMBED_EXTENSION_KEY = "native-embed";
7
+ export declare const AGENT_MANAGED_EXTENSION_KEY = "agent-managed-block";
7
8
  export declare const getExtensionKeyAndNodeKey: (extensionKey: ExtensionKey, extensionType: ExtensionType) => string[];
8
9
  export declare const buildExtensionKeyAndNodeKey: (extensionKey: ExtensionKey, nodeKey?: ExtensionModuleKey) => string;
9
10
  export declare function buildAction<T extends Parameters>(action: ExtensionModuleAction<T>, manifest: ExtensionManifest<T>): ADFEntity | ExtensionModuleActionHandler | undefined;
@@ -2,7 +2,7 @@ export { isFieldset, isTabGroup, isTabField, isExpand, isDateRange, } from './ex
2
2
  export { createAutoConverterRunner, getExtensionAutoConvertersFromProvider, getQuickInsertItemsFromModule, getContextualToolbarItemsFromModule, buildMenuItem, } from './extensions/module-helpers';
3
3
  export { default as DefaultExtensionProvider } from './extensions/default-extension-provider';
4
4
  export { default as combineExtensionProviders } from './extensions/combine-extension-providers';
5
- export { getExtensionKeyAndNodeKey, NATIVE_EMBED_EXTENSION_TYPE, NATIVE_EMBED_EXTENSION_KEY, resolveImport, } from './extensions/manifest-helpers';
5
+ export { AGENT_MANAGED_EXTENSION_KEY, getExtensionKeyAndNodeKey, NATIVE_EMBED_EXTENSION_TYPE, NATIVE_EMBED_EXTENSION_KEY, resolveImport, } from './extensions/manifest-helpers';
6
6
  export { getExtensionModuleNode, getNodeRenderer, getExtensionModuleNodePrivateProps, getExtensionManifest, } from './extensions/extension-handlers';
7
7
  export { getCustomFieldResolver, getFieldSerializer, getFieldDeserializer, getUserFieldContextProvider, } from './extensions/extension-fields-helpers';
8
8
  export { configPanelMessages, messages } from './extensions/messages';
@@ -1,27 +1,37 @@
1
1
  export declare const codeBlockButtonMessages: {
2
- copyCodeToClipboard: {
3
- id: string;
2
+ copiedCodeToClipboard: {
4
3
  defaultMessage: string;
5
4
  description: string;
6
- };
7
- copiedCodeToClipboard: {
8
5
  id: string;
6
+ };
7
+ copyCodeToClipboard: {
9
8
  defaultMessage: string;
10
9
  description: string;
11
- };
12
- wrapCode: {
13
10
  id: string;
11
+ };
12
+ selectLanguage: {
14
13
  defaultMessage: string;
15
14
  description: string;
15
+ id: string;
16
16
  };
17
17
  unwrapCode: {
18
+ defaultMessage: string;
19
+ description: string;
18
20
  id: string;
21
+ };
22
+ unwrapCodeLabel: {
19
23
  defaultMessage: string;
20
24
  description: string;
25
+ id: string;
21
26
  };
22
- selectLanguage: {
27
+ wrapCode: {
28
+ defaultMessage: string;
29
+ description: string;
23
30
  id: string;
31
+ };
32
+ wrapCodeLabel: {
24
33
  defaultMessage: string;
25
34
  description: string;
35
+ id: string;
26
36
  };
27
37
  };
@@ -1,8 +1,12 @@
1
- import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
1
+ import type { CodeBlockAttrs } from '@atlaskit/adf-schema';
2
+ import type { Node as PmNode, Schema, Slice } from '@atlaskit/editor-prosemirror/model';
2
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
4
  import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
4
5
  export declare const defaultWordWrapState = false;
5
6
  export declare const codeBlockWrappedStates: WeakMap<PmNode, boolean | undefined>;
7
+ type OptionalCodeBlockAttrs = CodeBlockAttrs | undefined;
8
+ export declare const getDefaultCodeBlockAttrs: (attrs?: CodeBlockAttrs) => OptionalCodeBlockAttrs;
9
+ export declare const defaultWrapForMarkdownCodeBlocksInSlice: (slice: Slice, schema: Schema) => Slice;
6
10
  export interface FoldRange {
7
11
  from: number;
8
12
  to: number;
@@ -20,3 +24,4 @@ export declare const transferCodeBlockWrappedValue: (oldCodeBlockNode: PmNode, n
20
24
  * This function takes all the given nodes, finds their old nodes from the old state and updates these old node keys.
21
25
  */
22
26
  export declare const updateCodeBlockWrappedStateNodeKeys: (newCodeBlockNodes: NodeWithPos[], oldState: EditorState) => void;
27
+ export {};
@@ -4,6 +4,7 @@ import type { Parameters } from './types/extension-parameters';
4
4
  export declare const FORGE_EXTENSION_TYPE = "com.atlassian.ecosystem";
5
5
  export declare const NATIVE_EMBED_EXTENSION_TYPE = "com.atlassian.confluence.macro.core";
6
6
  export declare const NATIVE_EMBED_EXTENSION_KEY = "native-embed";
7
+ export declare const AGENT_MANAGED_EXTENSION_KEY = "agent-managed-block";
7
8
  export declare const getExtensionKeyAndNodeKey: (extensionKey: ExtensionKey, extensionType: ExtensionType) => string[];
8
9
  export declare const buildExtensionKeyAndNodeKey: (extensionKey: ExtensionKey, nodeKey?: ExtensionModuleKey) => string;
9
10
  export declare function buildAction<T extends Parameters>(action: ExtensionModuleAction<T>, manifest: ExtensionManifest<T>): ADFEntity | ExtensionModuleActionHandler | undefined;
@@ -2,7 +2,7 @@ export { isFieldset, isTabGroup, isTabField, isExpand, isDateRange, } from './ex
2
2
  export { createAutoConverterRunner, getExtensionAutoConvertersFromProvider, getQuickInsertItemsFromModule, getContextualToolbarItemsFromModule, buildMenuItem, } from './extensions/module-helpers';
3
3
  export { default as DefaultExtensionProvider } from './extensions/default-extension-provider';
4
4
  export { default as combineExtensionProviders } from './extensions/combine-extension-providers';
5
- export { getExtensionKeyAndNodeKey, NATIVE_EMBED_EXTENSION_TYPE, NATIVE_EMBED_EXTENSION_KEY, resolveImport, } from './extensions/manifest-helpers';
5
+ export { AGENT_MANAGED_EXTENSION_KEY, getExtensionKeyAndNodeKey, NATIVE_EMBED_EXTENSION_TYPE, NATIVE_EMBED_EXTENSION_KEY, resolveImport, } from './extensions/manifest-helpers';
6
6
  export { getExtensionModuleNode, getNodeRenderer, getExtensionModuleNodePrivateProps, getExtensionManifest, } from './extensions/extension-handlers';
7
7
  export { getCustomFieldResolver, getFieldSerializer, getFieldDeserializer, getUserFieldContextProvider, } from './extensions/extension-fields-helpers';
8
8
  export { configPanelMessages, messages } from './extensions/messages';
@@ -1,27 +1,37 @@
1
1
  export declare const codeBlockButtonMessages: {
2
- copyCodeToClipboard: {
3
- id: string;
2
+ copiedCodeToClipboard: {
4
3
  defaultMessage: string;
5
4
  description: string;
6
- };
7
- copiedCodeToClipboard: {
8
5
  id: string;
6
+ };
7
+ copyCodeToClipboard: {
9
8
  defaultMessage: string;
10
9
  description: string;
11
- };
12
- wrapCode: {
13
10
  id: string;
11
+ };
12
+ selectLanguage: {
14
13
  defaultMessage: string;
15
14
  description: string;
15
+ id: string;
16
16
  };
17
17
  unwrapCode: {
18
+ defaultMessage: string;
19
+ description: string;
18
20
  id: string;
21
+ };
22
+ unwrapCodeLabel: {
19
23
  defaultMessage: string;
20
24
  description: string;
25
+ id: string;
21
26
  };
22
- selectLanguage: {
27
+ wrapCode: {
28
+ defaultMessage: string;
29
+ description: string;
23
30
  id: string;
31
+ };
32
+ wrapCodeLabel: {
24
33
  defaultMessage: string;
25
34
  description: string;
35
+ id: string;
26
36
  };
27
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "114.24.0",
3
+ "version": "114.25.1",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -81,7 +81,7 @@
81
81
  "@atlaskit/prosemirror-history": "^0.2.0",
82
82
  "@atlaskit/react-ufo": "^5.19.0",
83
83
  "@atlaskit/section-message": "^8.12.0",
84
- "@atlaskit/smart-card": "^44.8.0",
84
+ "@atlaskit/smart-card": "^44.9.0",
85
85
  "@atlaskit/smart-user-picker": "^10.0.0",
86
86
  "@atlaskit/spinner": "^19.1.0",
87
87
  "@atlaskit/task-decision": "^20.0.0",