@atlaskit/renderer 114.11.0 → 114.11.2

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/actions/index.js +165 -3
  3. package/dist/cjs/react/marks/alignment.js +3 -15
  4. package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +3 -10
  5. package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +8 -53
  6. package/dist/cjs/react/nodes/layoutColumn.js +3 -11
  7. package/dist/cjs/react/nodes/media/index.js +28 -58
  8. package/dist/cjs/react/nodes/panel.js +2 -26
  9. package/dist/cjs/react/nodes/table/sticky.js +3 -57
  10. package/dist/cjs/ui/Expand.js +12 -62
  11. package/dist/cjs/ui/Renderer/RendererStyleContainer.js +20 -43
  12. package/dist/cjs/ui/Renderer/index.js +14 -9
  13. package/dist/cjs/ui/Renderer/style.js +2 -208
  14. package/dist/cjs/ui/annotations/draft/component.js +2 -17
  15. package/dist/cjs/ui/annotations/element/mark.js +12 -61
  16. package/dist/cjs/ui/annotations/selection/mounter.js +16 -0
  17. package/dist/es2019/actions/index.js +163 -1
  18. package/dist/es2019/react/marks/alignment.js +2 -17
  19. package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +2 -39
  20. package/dist/es2019/react/nodes/codeBlock/components/lightWeightCodeBlock.js +5 -50
  21. package/dist/es2019/react/nodes/layoutColumn.js +4 -12
  22. package/dist/es2019/react/nodes/media/index.js +3 -36
  23. package/dist/es2019/react/nodes/panel.js +2 -41
  24. package/dist/es2019/react/nodes/table/sticky.js +3 -70
  25. package/dist/es2019/ui/Expand.js +11 -67
  26. package/dist/es2019/ui/Renderer/RendererStyleContainer.js +21 -44
  27. package/dist/es2019/ui/Renderer/index.js +12 -9
  28. package/dist/es2019/ui/Renderer/style.js +1 -889
  29. package/dist/es2019/ui/annotations/draft/component.js +2 -15
  30. package/dist/es2019/ui/annotations/element/mark.js +9 -71
  31. package/dist/es2019/ui/annotations/selection/mounter.js +16 -0
  32. package/dist/esm/actions/index.js +165 -3
  33. package/dist/esm/react/marks/alignment.js +2 -16
  34. package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +2 -11
  35. package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +7 -52
  36. package/dist/esm/react/nodes/layoutColumn.js +4 -12
  37. package/dist/esm/react/nodes/media/index.js +28 -58
  38. package/dist/esm/react/nodes/panel.js +3 -27
  39. package/dist/esm/react/nodes/table/sticky.js +3 -57
  40. package/dist/esm/ui/Expand.js +12 -62
  41. package/dist/esm/ui/Renderer/RendererStyleContainer.js +21 -44
  42. package/dist/esm/ui/Renderer/index.js +14 -9
  43. package/dist/esm/ui/Renderer/style.js +1 -203
  44. package/dist/esm/ui/annotations/draft/component.js +2 -17
  45. package/dist/esm/ui/annotations/element/mark.js +9 -56
  46. package/dist/esm/ui/annotations/selection/mounter.js +16 -0
  47. package/dist/types/actions/index.d.ts +1 -0
  48. package/dist/types/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +1 -1
  49. package/dist/types/ui/Renderer/style.d.ts +0 -11
  50. package/dist/types/ui/annotations/element/mark.d.ts +30 -6
  51. package/dist/types-ts4.5/actions/index.d.ts +1 -0
  52. package/dist/types-ts4.5/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +1 -1
  53. package/dist/types-ts4.5/ui/Renderer/style.d.ts +0 -11
  54. package/dist/types-ts4.5/ui/annotations/element/mark.d.ts +30 -6
  55. package/package.json +13 -10
@@ -1,204 +1,2 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
3
- /* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation */
4
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
- import { css } from '@emotion/react';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
- // Ignored via go/ees005
10
- // eslint-disable-next-line import/no-namespace
11
- import * as colors from '@atlaskit/theme/colors';
12
- import { N60A, Y300, Y75, N40A } from '@atlaskit/theme/colors';
13
- import { getGlobalTheme } from '@atlaskit/tokens';
14
- import { mediaInlineImageStyles } from '@atlaskit/editor-common/media-inline';
15
- import { tableSharedStyle, columnLayoutSharedStyle, columnLayoutResponsiveSharedStyle, columnLayoutResponsiveRendererStyles, blockquoteSharedStyles, headingsSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, getSmartCardSharedStyles, smartCardSharedStyles, tableCellPadding, textColorStyles, backgroundColorStyles, codeBlockInListSafariFix, SmartCardSharedCssClassName } from '@atlaskit/editor-common/styles';
16
- import { shadowClassNames, shadowObserverClassNames } from '@atlaskit/editor-common/ui';
17
- import { browser } from '@atlaskit/editor-common/browser';
18
- import { editorFontSize, blockNodesVerticalMargin, akEditorTableToolbar, akEditorTableBorder, akEditorTableNumberColumnWidth, gridMediumMaxWidth, akEditorFullWidthLayoutWidth, akEditorStickyHeaderZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
19
- import { RendererCssClassName } from '../../consts';
20
- import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
21
- import { getLightWeightCodeBlockStylesForRootRendererStyleSheet } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
22
- import { isTableResizingEnabled, isStickyScrollbarEnabled } from '../../react/nodes/table';
23
- import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
24
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
25
1
  export var FullPagePadding = 32;
26
- var tableShadowWidth = 32;
27
- export var TELEPOINTER_ID = 'ai-streaming-telepointer';
28
- var telepointerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t#", " {\n\t\tdisplay: inline-block;\n\t\tposition: relative;\n\t\twidth: 1.5px;\n\t\theight: 25px;\n\t\tbackground-color: ", ";\n\t\tmargin-left: ", ";\n\n\t\t&::after {\n\t\t\tcontent: 'AI';\n\t\t\tposition: absolute;\n\t\t\tdisplay: block;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tfont-size: 10px;\n\t\t\tfont-weight: ", ";\n\t\t\twidth: 12.5px;\n\t\t\theight: 13px;\n\t\t\tpadding-top: 1px;\n\t\t\tpadding-left: 1.5px;\n\t\t\tline-height: initial;\n\t\t\tborder-radius: 0px 2px 2px 0px;\n\t\t\tcolor: ", ";\n\t\t\tbackground-color: ", ";\n\t\t}\n\t}\n"])), TELEPOINTER_ID, "var(--ds-background-brand-bold, #0C66E4)", "var(--ds-space-025, 2px)", "var(--ds-font-weight-bold, 700)", "var(--ds-text-inverse, white)", "var(--ds-background-brand-bold, #0C66E4)");
29
-
30
- /**
31
- * **DEPRECATED**
32
- *
33
- * Originally defined in `@atlaskit/theme/typography`, but moved here as it has since been deleted in favor of typography tokens.
34
- * This should be removed as part of editor token work. More info:
35
- * https://atlassian.slack.com/archives/C075G5D7ZP1/p1733449725865539?thread_ts=1732159801.409789&cid=C075G5D7ZP1
36
- * */
37
- var headingSizesImport = {
38
- h900: {
39
- size: 35,
40
- lineHeight: 40
41
- },
42
- h800: {
43
- size: 29,
44
- lineHeight: 32
45
- },
46
- h700: {
47
- size: 24,
48
- lineHeight: 28
49
- },
50
- h600: {
51
- size: 20,
52
- lineHeight: 24
53
- },
54
- h500: {
55
- size: 16,
56
- lineHeight: 20
57
- },
58
- h400: {
59
- size: 14,
60
- lineHeight: 16
61
- },
62
- h300: {
63
- size: 12,
64
- lineHeight: 16
65
- },
66
- h200: {
67
- size: 12,
68
- lineHeight: 16
69
- },
70
- h100: {
71
- size: 11,
72
- lineHeight: 16
73
- }
74
- };
75
- var getLineHeight = function getLineHeight(fontCode) {
76
- return headingSizesImport[fontCode].lineHeight / headingSizesImport[fontCode].size;
77
- };
78
- var headingSizes = {
79
- h1: {
80
- lineHeight: getLineHeight('h700')
81
- },
82
- h2: {
83
- lineHeight: getLineHeight('h600')
84
- },
85
- h3: {
86
- lineHeight: getLineHeight('h500')
87
- },
88
- h4: {
89
- lineHeight: getLineHeight('h400')
90
- },
91
- h5: {
92
- lineHeight: getLineHeight('h300')
93
- },
94
- h6: {
95
- lineHeight: getLineHeight('h100')
96
- }
97
- };
98
- var headingAnchorStyle = function headingAnchorStyle(headingTag) {
99
- return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t/**\n * The copy link button doesn't reserve space in the DOM so that\n * the text alignment isn't impacted by the button/icon's space.\n */\n\t.", " {\n\t\tposition: absolute;\n\t\theight: ", "em;\n\n\t\tmargin-left: ", ";\n\n\t\tbutton {\n\t\t\tpadding-left: 0;\n\t\t\tpadding-right: 0;\n\t\t}\n\t}\n\n\t/**\n * Applies hover effects to the heading anchor link button\n * to fade in when the user rolls over the heading.\n *\n * The link is persistent on mobile, so we use feature detection\n * to enable hover effects for systems that support it (desktop).\n *\n * @see https://caniuse.com/mdn-css_at-rules_media_hover\n */\n\t@media (hover: hover) and (pointer: fine) {\n\t\t.", " {\n\t\t\t> button {\n\t\t\t\topacity: 0;\n\t\t\t\ttransform: translate(-8px, 0px);\n\t\t\t\ttransition:\n\t\t\t\t\topacity 0.2s ease 0s,\n\t\t\t\t\ttransform 0.2s ease 0s;\n\t\t\t}\n\t\t}\n\n\t\t&:hover {\n\t\t\t.", " > button {\n\t\t\t\topacity: 1;\n\t\t\t\ttransform: none !important;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n * Adds the visibility of the button when in focus through keyboard navigation.\n */\n\t.", " {\n\t\tbutton:focus {\n\t\t\topacity: 1;\n\t\t\ttransform: none !important;\n\t\t}\n\t}\n"])), HeadingAnchorWrapperClassName, headingSizes[headingTag].lineHeight, "var(--ds-space-075, 6px)", HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName);
100
- };
101
- var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
102
- var allowNestedHeaderLinks = _ref.allowNestedHeaderLinks;
103
- if (!allowNestedHeaderLinks) {
104
- return '';
105
- }
106
- return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t\t.fabric-editor-block-mark[data-align] > {\n\t\t\th1,\n\t\t\th2,\n\t\t\th3,\n\t\t\th4,\n\t\t\th5,\n\t\t\th6 {\n\t\t\t\tposition: relative;\n\t\t\t}\n\t\t}\n\n\t\t/**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n\t\t.fabric-editor-block-mark:not([data-align='center'])[data-align] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", " 0 0;\n\t\t\t\t// If the anchor is right aligned then the left side of the heading\n\t\t\t\t// is aligned with the left side of the anchor.\n\t\t\t\t// In order to align as expected we transform it the width of the element (plus our expected 6px)\n\t\t\t\t// to the left\n\t\t\t\ttransform: translateX(calc(-100% - ", "));\n\t\t\t}\n\n\t\t\t@media (hover: hover) and (pointer: fine) {\n\t\t\t\t.", " > button {\n\t\t\t\t\ttransform: translate(8px, 0px);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t"])), HeadingAnchorWrapperClassName, "var(--ds-space-075, 6px)", "var(--ds-space-075, 6px)", HeadingAnchorWrapperClassName);
107
- };
108
- var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
109
- var allowColumnSorting = _ref2.allowColumnSorting,
110
- allowNestedHeaderLinks = _ref2.allowNestedHeaderLinks;
111
- if (!allowColumnSorting) {
112
- return '';
113
- }
114
- var headingsCss = '';
115
- if (allowNestedHeaderLinks) {
116
- headingsCss = "\n /**\n * When the sort button is enabled we want the heading's copy link button\n * to reserve space so that it can prematurely wrap to avoid the button\n * being displayed underneath the sort button (hidden or obscured).\n *\n * The two buttons fight each other since the sort button is displayed\n * on hover of the <th /> and the copy link button is displayed on hover\n * of the heading.\n *\n * Note that this can break the WYSIWYG experience in the case where\n * a heading fills the width of the table cell and the only thing which\n * wraps is the copy link button. This is hopefully a rare fringe case.\n */\n .".concat(HeadingAnchorWrapperClassName, " {\n position: unset;\n }\n > {\n h1, h2, h3, h4, h5, h6 {\n margin-right: 30px;\n }\n }\n ");
117
- }
118
- return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n\t\t.", " {\n\t\t\tpadding: 0;\n\n\t\t\t.", " {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tpadding: ", "px;\n\t\t\t\tborder-width: 1.5px;\n\t\t\t\tborder-style: solid;\n\t\t\t\tborder-color: transparent;\n\n\t\t\t\t> *:first-child {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + span + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + span + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t@supports selector(:focus-visible) {\n\t\t\t\t\t&:focus {\n\t\t\t\t\t\toutline: unset;\n\t\t\t\t\t}\n\t\t\t\t\t&:focus-visible {\n\t\t\t\t\t\tborder-color: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t", "\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\t"])), RendererCssClassName.SORTABLE_COLUMN_WRAPPER, RendererCssClassName.SORTABLE_COLUMN, tableCellPadding, "var(--ds-border-focused, ".concat(colors.B300, ")"), headingsCss, css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n\t\t\t\t// New styles\n\t\t\t\t> .", "\n\t\t\t\t\t> .", " {\n\t\t\t\t\tmargin: 0;\n\n\t\t\t\t\t.", " {\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\ttransition: opacity 0.2s ease-in-out;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t> .", "\n\t\t\t\t\t> .", " {\n\t\t\t\t\t.", " {\n\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t\t&:focus {\n\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t&:hover:not(\n\t\t\t\t\t\t:has(\n\t\t\t\t\t\t\t\t.", "\n\t\t\t\t\t\t\t\t\t.", ":hover\n\t\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t> .", "\n\t\t\t\t\t> .", " {\n\t\t\t\t\t.", " {\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN_ICON_WRAPPER, SORTABLE_COLUMN_ICON_CLASSNAME, RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, SORTABLE_COLUMN_ICON_CLASSNAME, RendererCssClassName.SORTABLE_COLUMN_WRAPPER, RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, SORTABLE_COLUMN_ICON_CLASSNAME));
119
- };
120
- var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
121
- var appearance = _ref3.appearance;
122
- var theme = _ref4.theme;
123
- if (appearance !== 'full-page') {
124
- return '';
125
- }
126
- return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n\t\tmax-width: ", ";\n\t\tmargin: 0 auto;\n\t\tpadding: 0 ", "px;\n\t"])), theme && theme.layoutMaxWidth ? "".concat(theme.layoutMaxWidth, "px") : 'none', appearance === 'full-page' ? FullPagePadding : 0);
127
- };
128
- var fullWidthStyles = function fullWidthStyles(_ref5) {
129
- var appearance = _ref5.appearance;
130
- if (appearance !== 'full-width') {
131
- return '';
132
- }
133
- return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n\t\tmax-width: ", "px;\n\t\tmargin: 0 auto;\n\n\t\t/* don't override if the breakout mark has width attribute defined */\n\t\t.fabric-editor-breakout-mark:not([data-has-width='true']),\n\t\t.ak-renderer-extension {\n\t\t\twidth: 100% !important;\n\t\t}\n\n\t\t", "\n\t"])), akEditorFullWidthLayoutWidth, isTableResizingEnabled(appearance) ? '' : "\n .pm-table-container {\n width: 100% !important;\n }\n ");
134
- };
135
- var breakoutWidthStyle = function breakoutWidthStyle() {
136
- return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n\t\t*:not([data-mark-type='fragment']) .", " {\n\t\t\t// Ignored via go/ees007\n\t\t\t// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format\n\t\t\t// TODO - improve inline style logic on table container so important styles aren't required here\n\t\t\twidth: 100% !important;\n\t\t\tleft: 0 !important;\n\t\t}\n\n\t\t[data-mark-type='fragment'] * .", " {\n\t\t\t// Ignored via go/ees007\n\t\t\t// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format\n\t\t\t// TODO - improve inline style logic on table container so important styles aren't required here\n\t\t\twidth: 100% !important;\n\t\t\tleft: 0 !important;\n\t\t}\n\t"])), TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_CONTAINER);
137
- };
138
- var getShadowOverrides = function getShadowOverrides() {
139
- return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n\t\t/** Shadow overrides */\n\t\t&.", "::after, &.", "::before {\n\t\t\twidth: ", "px;\n\t\t\tbackground: linear-gradient(\n\t\t\t\t\tto left,\n\t\t\t\t\ttransparent 0,\n\t\t\t\t\t", " 140%\n\t\t\t\t),\n\t\t\t\tlinear-gradient(\n\t\t\t\t\tto right,\n\t\t\t\t\t", " 0px,\n\t\t\t\t\ttransparent 1px\n\t\t\t\t);\n\t\t}\n\n\t\t&.", "::after {\n\t\t\tbackground: linear-gradient(\n\t\t\t\t\tto right,\n\t\t\t\t\ttransparent 0,\n\t\t\t\t\t", " 140%\n\t\t\t\t),\n\t\t\t\tlinear-gradient(\n\t\t\t\t\tto left,\n\t\t\t\t\t", " 0px,\n\t\t\t\t\ttransparent 1px\n\t\t\t\t);\n\t\t\tright: 0px;\n\t\t}\n\t"])), shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableShadowWidth, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), "var(--ds-shadow-overflow-perimeter, transparent)", shadowClassNames.RIGHT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), "var(--ds-shadow-overflow-perimeter, transparent)");
140
- };
141
- function getAnnotationStyles(_ref6) {
142
- var allowAnnotations = _ref6.allowAnnotations;
143
- if (!fg('editor_inline_comments_on_inline_nodes')) {
144
- return '';
145
- }
146
- if (fg('annotations_align_editor_and_renderer_styles')) {
147
- return css({
148
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
149
- '& [data-annotation-draft-mark][data-annotation-inline-node]': {
150
- borderBottom: '2px solid transparent',
151
- cursor: 'pointer',
152
- padding: '1px 0 2px',
153
- background: "var(--ds-background-accent-yellow-subtler, ".concat(Y75, ")"),
154
- borderBottomColor: "var(--ds-border-accent-yellow, ".concat(Y300, ")"),
155
- boxShadow: "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(N60A, ", -1px 2px 3px ").concat(N60A), ")")
156
- },
157
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
158
- '& [data-annotation-draft-mark][data-annotation-inline-node][data-inline-card]': {
159
- padding: '5px 0 3px 0'
160
- },
161
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
162
- '& [data-annotation-draft-mark][data-annotation-inline-node].date-lozenger-container': {
163
- paddingTop: "var(--ds-space-025, 2px)"
164
- }
165
- });
166
- }
167
- return css({
168
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
169
- "& [data-mark-type='annotation'][data-mark-annotation-state='active'] [data-annotation-mark], & [data-annotation-draft-mark][data-annotation-inline-node]": {
170
- background: "var(--ds-background-accent-yellow-subtler, ".concat(Y75, ")"),
171
- borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, ".concat(Y300, ")")),
172
- boxShadow: "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(N60A, ", -1px 2px 3px ").concat(N60A), ")"),
173
- cursor: 'pointer',
174
- padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-025, 2px)")
175
- }
176
- });
177
- }
178
- var tableRowHeight = 44;
179
- var stickyScrollbarStyles = "\n\tposition: relative;\n\tflex-direction: column;\n\n\t> .".concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER, " {\n\t width: 100%;\n\t display: block;\n\t visibility: hidden;\n\t overflow-x: auto;\n\t position: sticky;\n\t bottom: ", "var(--ds-space-0, 0px)", ";\n\t z-index: 1;\n\t}\n\n\t> .").concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM, ",\n\t> .").concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP, " {\n\t position: absolute;\n\t width: 100%;\n\t height: 1px;\n\t margin-top: -1px;\n\t // need this to avoid sentinel being focused via keyboard\n\t // this still allows it to be detected by intersection observer\n\t visibility: hidden;\n\t }\n\t > .").concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP, " {\n\t top: ").concat(tableRowHeight * 3, "px;\n\t }\n\t > .").concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM, " {\n\t bottom: ", "var(--ds-space-250, 20px)", "; // MAX_BROWSER_SCROLLBAR_HEIGHT = 20;\n\t }\n ");
180
-
181
- // Ignored via go/ees005
182
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
183
- export var rendererStyles = function rendererStyles(wrapperProps) {
184
- return function (theme) {
185
- var _getGlobalTheme = getGlobalTheme(),
186
- typography = _getGlobalTheme.typography;
187
- // This is required to be compatible with styled-components prop structure.
188
- var themeProps = {
189
- theme: theme
190
- };
191
- var useBlockRenderForCodeBlock = wrapperProps.useBlockRenderForCodeBlock,
192
- appearance = wrapperProps.appearance;
193
- var isAdvancedLayoutsOn = editorExperiment('advanced_layouts', true);
194
-
195
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/design-system/no-css-tagged-template-expression
196
- return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n\t\tfont-size: ", "px;\n\t\tline-height: 1.5rem;\n\t\tcolor: ", ";\n\n\t\t.", "::after {\n\t\t\t// we add a clearfix after ak-renderer-document in order to\n\t\t\t// contain internal floats (such as media images that are \"wrap-left\")\n\t\t\t// to just the renderer (and not spill outside of it)\n\t\t\tcontent: '';\n\t\t\tvisibility: hidden;\n\t\t\tdisplay: block;\n\t\t\theight: 0;\n\t\t\tclear: both;\n\t\t}\n\n\t\t", "\n\t\t", "\n\n .", " {\n\t\t\t", "\n\t\t}\n\n\t\t& h1 {\n\t\t\t", "\n\t\t}\n\n\t\t& h2 {\n\t\t\t", "\n\t\t}\n\n\t\t& h3 {\n\t\t\t", "\n\t\t}\n\n\t\t& h4 {\n\t\t\t", "\n\t\t}\n\n\t\t& h5 {\n\t\t\t", "\n\t\t}\n\n\t\t& h6 {\n\t\t\t", "\n\t\t}\n\n\t\t& span.akActionMark {\n\t\t\tcolor: ", ";\n\t\t\ttext-decoration: none;\n\n\t\t\t&:hover {\n\t\t\t\tcolor: ", ";\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\n\t\t\t&:active {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\t\t}\n\n\t\t& span.akActionMark {\n\t\t\tcursor: pointer;\n\t\t}\n\n\t\t& span[data-placeholder] {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t", "\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", "\n\t\t", "\n\n\t\t& .UnknownBlock {\n\t\t\tfont-family: ", ";\n\t\t\tfont-size: ", ";\n\t\t\tfont-weight: ", ";\n\t\t\twhite-space: pre-wrap;\n\t\t\tword-wrap: break-word;\n\t\t}\n\n\t\t& span.date-node {\n\t\t\tbackground: ", ";\n\t\t\tborder-radius: ", ";\n\t\t\tcolor: ", ";\n\t\t\tpadding: ", " ", ";\n\t\t\tmargin: 0 1px;\n\t\t\ttransition: background 0.3s;\n\t\t}\n\n\t\t& span.date-node-highlighted {\n\t\t\tbackground: ", ";\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t& .renderer-image {\n\t\t\tmax-width: 100%;\n\t\t\tdisplay: block;\n\t\t\tmargin: ", " 0;\n\t\t}\n\n\t\t.", ".rich-media-wrapped + .", ":not(.rich-media-wrapped) {\n\t\t\tclear: both;\n\t\t}\n\n\t\t& .code-block,\n\t\t& blockquote,\n\t\t& hr,\n\t\t& > div > div:not(.rich-media-wrapped),\n\t\t.", ".rich-media-wrapped + .rich-media-wrapped + *:not(.rich-media-wrapped),\n\t\t.", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n\t\t.", ".image-align-start,\n\t\t\t.", ".image-center,\n\t\t\t.", ".image-align-end {\n\t\t\tclear: both;\n\t\t}\n\n\t\t& .rich-media-wrapped {\n\t\t\t& + h1,\n\t\t\t& + h2,\n\t\t\t& + h3,\n\t\t\t& + h4,\n\t\t\t& + h5,\n\t\t\t& + h6 {\n\t\t\t\tmargin-top: ", ";\n\t\t\t}\n\t\t}\n\n\t\t", "\n\t\t/* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n\t\t\tmargin-left: 0;\n\t\t\tmargin-right: 0;\n\t\t}\n\n\t\t/* Breakout for tables and extensions */\n\t\t.", " > {\n\t\t\t", "\n\n\t\t\t* .", " {\n\t\t\t\toverflow-x: auto;\n\t\t\t}\n\n\t\t\t& .", ":first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\t.", " {\n\t\t\t\tmargin-top: ", ";\n\t\t\t}\n\n\t\t\t.", " {\n\t\t\t\tmargin-left: 50%;\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t}\n\n\t\t\t.", " {\n\t\t\t\toverflow-x: auto;\n\t\t\t}\n\n\t\t\t.", " .", " {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t}\n\n\t\t", "\n\n\t\t.", " .", " {\n\t\t\tz-index: 0;\n\t\t\ttransition: all 0.1s linear;\n\t\t\tdisplay: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n\t\t\t/** Shadow overrides */\n\t\t\t&.", "::after, &.", "::before {\n\t\t\t\ttop: ", "px;\n\t\t\t\theight: calc(100% - ", "px);\n\t\t\t\tz-index: ", ";\n\t\t\t}\n\n\t\t\t", "\n\n\t\t\t", "\n\n\t\t\t&\n .", ",\n &\n .", " {\n\t\t\t\theight: calc(100% - ", "px);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * A hack for making all the <th /> heights equal in case some have shorter\n\t\t\t * content than others.\n\t\t\t *\n\t\t\t * This is done to make sort buttons fill entire <th />.\n\t\t\t*/\n\t\t\t", " {\n\t\t\t\theight: 1px; /* will be ignored */\n\t\t\t\t", ";\n\t\t\t\tmargin-left: 0;\n\t\t\t\tmargin-right: 0;\n\t\t\t}\n\n\t\t\t", " {\n\t\t\t\theight: 100%;\n\n\t\t\t\ttd,\n\t\t\t\tth {\n\t\t\t\t\tposition: relative;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttable[data-number-column='true'] {\n\t\t\t\t.", " {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\tborder-right: 1px solid\n\t\t\t\t\t\t", ";\n\t\t\t\t\twidth: ", "px;\n\t\t\t\t\ttext-align: center;\n\t\t\t\t\tcolor: ", ";\n\t\t\t\t\tfont-size: ", ";\n\t\t\t\t}\n\n\t\t\t\t.fixed .", " {\n\t\t\t\t\tborder-right: 0px none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttr[data-header-row].fixed {\n\t\t\tposition: fixed !important;\n\t\t\tdisplay: flex;\n\t\t\toverflow: hidden;\n\t\t\tz-index: ", ";\n\n\t\t\tborder-right: 1px solid ", ";\n\t\t\tborder-bottom: 1px solid ", ";\n\n\t\t\t/* this is to compensate for the table border */\n\t\t\ttransform: translateX(-1px);\n\t\t}\n\n\t\t.sticky > th {\n\t\t\tz-index: ", ";\n\t\t\tposition: sticky !important;\n\t\t\ttop: 0;\n\t\t}\n\n\t\t/* Make the number column header sticky */\n\t\t.sticky > td {\n\t\t\tposition: sticky !important;\n\t\t\ttop: 0;\n\t\t}\n\n\t\t/* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n\t\t.sticky th,\n\t\t.sticky td {\n\t\t\tbox-shadow:\n\t\t\t\t0px 1px ", ",\n\t\t\t\t0px -0.5px ", ",\n\t\t\t\tinset -1px 0px ", ",\n\t\t\t\t0px -1px ", ";\n\t\t}\n\n\t\t/* this will remove jumpiness caused in Chrome for sticky headers */\n\t\t.fixed + tr {\n\t\t\tmin-height: 0px;\n\t\t}\n\n\t\t/*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n\t\t& .code-block {\n\t\t\tmax-width: 100%;\n\t\t\t/* -ms- properties are necessary until MS supports the latest version of the grid spec */\n\t\t\t/* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n\t\t\tdisplay: block;\n\t\t\t/* stylelint-enable */\n\n\t\t\tposition: relative;\n\t\t\tborder-radius: ", ";\n\n\t\t\t/*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n\t\t\tword-wrap: normal;\n\t\t}\n\n\t\t& .MediaGroup,\n\t\t& .code-block {\n\t\t\tmargin-top: ", ";\n\n\t\t\t&:first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\n\t\t", "\n\n\t\t", "\n\n ", ";\n\t\t", ";\n\t\t& [data-layout-section] {\n\t\t\tmargin-top: ", ";\n\t\t\t& > div + div {\n\t\t\t\tmargin-left: ", ";\n\t\t\t}\n\n\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t& > div + div {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t& .MediaGroup,\n\t\t\t& .code-block {\n\t\t\t\tmargin-top: ", ";\n\n\t\t\t\t&:first-child {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t& li {\n\t\t\t> .code-block {\n\t\t\t\tmargin: ", " 0 0 0;\n\t\t\t}\n\t\t\t> .code-block:first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\n\t\t\t> div:last-of-type.code-block {\n\t\t\t\tmargin-bottom: ", ";\n\t\t\t}\n\t\t}\n\n\t\t&:not([data-node-type='decisionList']) > li,\n // This prevents https://product-fabric.atlassian.net/browse/ED-20924\n &:not(.", ") > li {\n\t\t\t", "\n\t\t}\n\t"])), editorFontSize(themeProps), "var(--ds-text, ".concat(colors.N800, ")"), RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), RendererCssClassName.DOCUMENT, mediaInlineImageStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), "var(--ds-link, ".concat(colors.B400, ")"), "var(--ds-link, ".concat(colors.B300, ")"), "var(--ds-link-pressed, ".concat(colors.B500, ")"), "var(--ds-text-subtlest, ".concat(colors.N200, ")"), telepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles(typography), ruleSharedStyles(), paragraphSharedStyles(typography), listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles(), shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles(), tasksAndDecisionsStyles, fg('platform-linking-visual-refresh-v1') ? getSmartCardSharedStyles() : smartCardSharedStyles, getAnnotationStyles(wrapperProps), "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)", relativeFontSizeToBase16(14), "var(--ds-font-weight-regular, 400)", "var(--ds-background-neutral, ".concat(colors.N30A, ")"), "var(--ds-border-radius-100, 3px)", "var(--ds-text, ".concat(colors.N800, ")"), "var(--ds-space-025, 2px)", "var(--ds-space-050, 4px)", "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-text-danger, ".concat(colors.R500, ")"), "var(--ds-space-300, 24px)", richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, "var(--ds-space-100, 8px)", alignedHeadingAnchorStyle(wrapperProps), mediaSingleSharedStyle, RendererCssClassName.DOCUMENT, breakoutWidthStyle(), RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, RendererCssClassName.EXTENSION, RendererCssClassName.DOCUMENT, RendererCssClassName.EXTENSION, blockNodesVerticalMargin, RendererCssClassName.EXTENSION_CENTER_ALIGN, TableSharedCssClassName.TABLE_NODE_WRAPPER, shadowObserverClassNames.SHADOW_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableSharedStyle(), RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableMarginTop - 1, tableMarginTop, akEditorStickyHeaderZIndex, getShadowOverrides(), isStickyScrollbarEnabled(appearance) ? stickyScrollbarStyles : '', shadowObserverClassNames.SENTINEL_LEFT, shadowObserverClassNames.SENTINEL_RIGHT, tableMarginTop, fg('platform_editor_renderer_table_header_styles') ? ".".concat(TableSharedCssClassName.TABLE_NODE_WRAPPER, " > table, .").concat(TableSharedCssClassName.TABLE_STICKY_WRAPPER, " > table") : 'table', tableSortableColumnStyle(wrapperProps), fg('platform_editor_renderer_table_header_styles') ? ".".concat(TableSharedCssClassName.TABLE_NODE_WRAPPER, " > table > tbody > tr:first-of-type, .").concat(TableSharedCssClassName.TABLE_STICKY_WRAPPER, " > table > tbody > tr:first-of-type") : 'table tr:first-of-type', RendererCssClassName.NUMBER_COLUMN, fg('platform_editor_tables_numbered_column_correction') ? "var(--ds-background-accent-gray-subtlest, #F1F2F4)" : "var(--ds-background-neutral, ".concat(akEditorTableToolbar, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), akEditorTableNumberColumnWidth, "var(--ds-text-subtlest, ".concat(colors.N200, ")"), relativeFontSizeToBase16(14), RendererCssClassName.NUMBER_COLUMN, akEditorStickyHeaderZIndex, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), akEditorStickyHeaderZIndex, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableToolbar, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableToolbar, ")"), "var(--ds-border-radius-100, 3px)", blockNodesVerticalMargin, useGridRenderForCodeBlock(useBlockRenderForCodeBlock), getLightWeightCodeBlockStylesForRootRendererStyleSheet(), isAdvancedLayoutsOn ? columnLayoutResponsiveSharedStyle : columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, "var(--ds-space-250, 20px)", isAdvancedLayoutsOn ? 0 : "var(--ds-space-400, 32px)", gridMediumMaxWidth, blockNodesVerticalMargin, blockNodesVerticalMargin, blockNodesVerticalMargin, SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, browser.safari ? codeBlockInListSafariFix : '');
197
- };
198
- };
199
- var useGridRenderForCodeBlock = function useGridRenderForCodeBlock(codeBlockRenderAsBlock) {
200
- if (codeBlockRenderAsBlock) {
201
- return '';
202
- }
203
- return "& .code-block {\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }";
204
- };
2
+ export var TELEPOINTER_ID = 'ai-streaming-telepointer';
@@ -12,26 +12,11 @@ import { AnnotationsDraftContext } from '../context';
12
12
  import { splitText, calcTextSplitOffset, findTextString } from './text';
13
13
  import { calcInsertDraftPositionOnText } from './position';
14
14
  import { dataAttributes } from './dom';
15
- import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
16
15
  import { segmentText } from '../../../react/utils/segment-text';
17
16
  import { renderTextSegments } from '../../../react/utils/render-text-segments';
18
- import { fg } from '@atlaskit/platform-feature-flags';
19
-
20
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
21
- var markStyles = function markStyles() {
22
- return css({
23
- color: 'inherit',
24
- backgroundColor: 'unset',
25
- WebkitTapHighlightColor: 'transparent'
26
- },
27
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
28
- AnnotationSharedCSSByState().common,
29
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
30
- AnnotationSharedCSSByState().focus);
31
- };
32
17
 
33
18
  // Localized AnnotationSharedCSSByState().common and AnnotationSharedCSSByState().focus
34
- var markStylesNew = css({
19
+ var markStyles = css({
35
20
  color: 'inherit',
36
21
  backgroundColor: 'unset',
37
22
  WebkitTapHighlightColor: 'transparent',
@@ -58,7 +43,7 @@ export var AnnotationDraft = function AnnotationDraft(_ref) {
58
43
  // Ignored via go/ees005
59
44
  // eslint-disable-next-line react/jsx-props-no-spreading
60
45
  }, dataAttributes(draftPosition), {
61
- css: fg('platform_editor_emotion_refactor_renderer') ? markStylesNew : markStyles
46
+ css: markStyles
62
47
  }), children);
63
48
  };
64
49
  export var getAnnotationIndex = function getAnnotationIndex(annotationPosition, fragmentCount) {
@@ -1,7 +1,5 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
4
- var _templateObject;
5
3
  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; }
6
4
  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; }
7
5
  /**
@@ -12,16 +10,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
12
10
  import { useMemo, useCallback } from 'react';
13
11
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
12
  import { css, jsx } from '@emotion/react';
15
- import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
16
13
  import { AnnotationMarkStates } from '@atlaskit/adf-schema';
17
14
  import { fg } from '@atlaskit/platform-feature-flags';
18
15
  import { useIntl } from 'react-intl-next';
19
16
  import { inlineCommentMessages } from '../../../messages';
20
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState` is not object-safe
21
- var markStylesOld = function markStylesOld() {
22
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tcolor: inherit;\n\tbackground-color: unset;\n\t-webkit-tap-highlight-color: transparent;\n\n\t&[data-mark-annotation-state='", "'] {\n\t\t", "\n\t\t", "\n\n\t\t&:focus,\n\t\t\t&[data-has-focus='true'] {\n\t\t\t", "\n\t\t}\n\t\t&[data-is-hovered='true']:not([data-has-focus='true']) {\n\t\t\t", "\n\t\t}\n\t}\n"])), AnnotationMarkStates.ACTIVE, fg('editor_inline_comments_on_inline_nodes') ? AnnotationSharedCSSByState().common : '', AnnotationSharedCSSByState().blur, AnnotationSharedCSSByState().focus, fg('confluence-frontend-comments-panel') ? AnnotationSharedCSSByState().hover : '');
23
- };
24
- var markStylesNew = css(_defineProperty({
17
+ var markStyles = css(_defineProperty({
25
18
  color: 'inherit',
26
19
  backgroundColor: 'unset',
27
20
  WebkitTapHighlightColor: 'transparent'
@@ -59,7 +52,7 @@ var markStylesWithUpdatedShadow = css(_defineProperty({}, "&[data-mark-annotatio
59
52
  boxShadow: "var(--ds-shadow-raised, 0px 1px 1px #091E4240, 0px 0px 1px #091E424f)"
60
53
  }
61
54
  }));
62
- var markStylesNewWithInlineComments = css(_defineProperty({}, "&[data-mark-annotation-state='".concat(AnnotationMarkStates.ACTIVE, "']"), {
55
+ var markStylesWithInlineComments = css(_defineProperty({}, "&[data-mark-annotation-state='".concat(AnnotationMarkStates.ACTIVE, "']"), {
63
56
  // was from common in AnnotationSharedCSSByState().common
64
57
  borderBottom: '2px solid transparent',
65
58
  cursor: 'pointer',
@@ -83,7 +76,7 @@ var markStylesNewWithInlineComments = css(_defineProperty({}, "&[data-mark-annot
83
76
  boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px #091E4226, 0px 0px 1px #091E424f)"
84
77
  }
85
78
  }));
86
- var markStylesNewWithCommentsPanel = css(_defineProperty({}, "&[data-mark-annotation-state='".concat(AnnotationMarkStates.ACTIVE, "']"), {
79
+ var markStylesWithCommentsPanel = css(_defineProperty({}, "&[data-mark-annotation-state='".concat(AnnotationMarkStates.ACTIVE, "']"), {
87
80
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
88
81
  '&[data-is-hovered="true"]:not([data-has-focus="true"])': {
89
82
  background: "var(--ds-background-accent-yellow-subtlest-hovered, #F8E6A0)",
@@ -96,28 +89,7 @@ var isMobile = function isMobile() {
96
89
  // eslint-disable-next-line require-unicode-regexp
97
90
  return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
98
91
  };
99
- var accessibilityStylesOld = function accessibilityStylesOld(startMarker, endMarker) {
100
- return css({
101
- '&::before, &::after': {
102
- clipPath: 'inset(100%)',
103
- clip: 'rect(1px, 1px, 1px, 1px)',
104
- height: '1px',
105
- overflow: 'hidden',
106
- position: 'absolute',
107
- whiteSpace: 'nowrap',
108
- width: '1px'
109
- },
110
- '&::before': {
111
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
112
- content: "' [".concat(startMarker, "] '")
113
- },
114
- '&::after': {
115
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
116
- content: "' [".concat(endMarker, "] '")
117
- }
118
- });
119
- };
120
- var accessibilityStylesNew = css({
92
+ var accessibilityStyles = css({
121
93
  '&::before, &::after': {
122
94
  clipPath: 'inset(100%)',
123
95
  clip: 'rect(1px, 1px, 1px, 1px)',
@@ -207,32 +179,13 @@ export var MarkComponent = function MarkComponent(_ref) {
207
179
  } : _objectSpread({
208
180
  'aria-details': annotationIds.join(', ')
209
181
  }, desktopAccessibilityAttributes);
210
- var getAccessibilityStylesOld = function getAccessibilityStylesOld() {
211
- if (isMobile()) {
212
- return {};
213
- }
214
- if (state !== AnnotationMarkStates.RESOLVED) {
215
- var startMarker = intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerStart);
216
- var endMarker = intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerEnd);
217
- return accessibilityStylesOld(startMarker, endMarker);
218
- } else {
219
- return {};
220
- }
221
- };
222
- if (fg('platform_editor_emotion_refactor_renderer')) {
223
- return jsx(useBlockLevel ? 'div' : 'mark', _objectSpread(_objectSpread(_objectSpread(_defineProperty({
224
- id: id
225
- }, fg('editor_inline_comments_on_inline_nodes') ? 'onClickCapture' : 'onClick', onMarkClick), accessibility), overriddenData), !useBlockLevel && {
226
- css: [markStylesNew, fg('platform_renderer_nested_annotation_styling') && markStylesLayeringFix, fg('editor_inline_comments_on_inline_nodes') && markStylesNewWithInlineComments, fg('confluence-frontend-comments-panel') && markStylesNewWithCommentsPanel, !isMobile() && accessibilityStylesNew, markStylesWithUpdatedShadow],
227
- style: {
228
- '--ak-renderer-annotation-startmarker': intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerStart),
229
- '--ak-renderer-annotation-endmarker': intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerEnd)
230
- }
231
- }), children);
232
- }
233
182
  return jsx(useBlockLevel ? 'div' : 'mark', _objectSpread(_objectSpread(_objectSpread(_defineProperty({
234
183
  id: id
235
184
  }, fg('editor_inline_comments_on_inline_nodes') ? 'onClickCapture' : 'onClick', onMarkClick), accessibility), overriddenData), !useBlockLevel && {
236
- css: [markStylesOld, getAccessibilityStylesOld()]
185
+ css: [markStyles, fg('platform_renderer_nested_annotation_styling') && markStylesLayeringFix, fg('editor_inline_comments_on_inline_nodes') && markStylesWithInlineComments, fg('confluence-frontend-comments-panel') && markStylesWithCommentsPanel, !isMobile() && accessibilityStyles, markStylesWithUpdatedShadow],
186
+ style: {
187
+ '--ak-renderer-annotation-startmarker': intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerStart),
188
+ '--ak-renderer-annotation-endmarker': intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerEnd)
189
+ }
237
190
  }), children);
238
191
  };
@@ -53,6 +53,22 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
53
53
  // but we want to prioritize draft positions if they are being used by consumers
54
54
  var positionToAnnotate = draftDocumentPosition || documentPosition;
55
55
  if (!positionToAnnotate || !applyAnnotation) {
56
+ // TODO: EDITOR-595 - This analytic event is temporary and should be removed once the following issue
57
+ // has been identified and fixed: https://atlassian.slack.com/archives/C08JK0WSCH5/p1745902609966999
58
+ if (createAnalyticsEvent && fg('platform_renderer_annotations_create_debug_logging')) {
59
+ createAnalyticsEvent({
60
+ action: 'failed',
61
+ actionSubject: 'applyAnnotation',
62
+ actionSubjectId: 'inlineCommentFailureReason',
63
+ attributes: {
64
+ reason: 'Annotation Position invalid',
65
+ draftDocumentPosition: draftDocumentPosition,
66
+ documentPosition: documentPosition,
67
+ applyAnnotation: !!applyAnnotation
68
+ },
69
+ eventType: EVENT_TYPE.OPERATIONAL
70
+ }).fire(FabricChannel.editor);
71
+ }
56
72
  return false;
57
73
  }
58
74
 
@@ -45,6 +45,7 @@ export default class RendererActions implements RendererActionsOptions, Annotati
45
45
  * Validate whether we can create an annotation between two positions
46
46
  */
47
47
  _privateValidatePositionsForAnnotation(from: number, to: number): boolean;
48
+ _privateWhyCannotApplyAnnotationOnRange: (pos: Position, doc: Node, schema: Schema) => string;
48
49
  deleteAnnotation(annotationId: string, annotationType: 'inlineComment'): false | {
49
50
  step: Step;
50
51
  doc: JSONDocNode;
@@ -12,5 +12,5 @@ export declare const LightWeightCodeBlockCssClassName: {
12
12
  * @deprecated styles are moved to RendererStyleContainer
13
13
  */
14
14
  export declare const getLightWeightCodeBlockStylesForRootRendererStyleSheet: () => import("@emotion/react").SerializedStyles;
15
- declare const LightWeightCodeBlock: React.FC<Omit<Pick<CodeBlockProps, "text" | "className" | "codeBidiWarningTooltipEnabled"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
+ declare const LightWeightCodeBlock: React.ForwardRefExoticComponent<Pick<CodeBlockProps, "text" | "className" | "codeBidiWarningTooltipEnabled"> & React.RefAttributes<HTMLDivElement>>;
16
16
  export default LightWeightCodeBlock;
@@ -1,13 +1,2 @@
1
- import type { RendererAppearance } from './types';
2
1
  export declare const FullPagePadding = 32;
3
- type RendererWrapperProps = {
4
- allowAnnotations?: boolean;
5
- appearance?: RendererAppearance;
6
- allowNestedHeaderLinks: boolean;
7
- allowColumnSorting: boolean;
8
- useBlockRenderForCodeBlock: boolean;
9
- allowTableResizing?: boolean;
10
- };
11
2
  export declare const TELEPOINTER_ID = "ai-streaming-telepointer";
12
- export declare const rendererStyles: (wrapperProps: RendererWrapperProps) => (theme: any) => import("@emotion/react").SerializedStyles;
13
- export {};
@@ -17,7 +17,11 @@ type MarkComponentProps = {
17
17
  useBlockLevel?: boolean;
18
18
  };
19
19
  export declare const MarkComponent: ({ annotationParentIds, children, dataAttributes, id, state, hasFocus, isHovered, onClick, useBlockLevel, }: React.PropsWithChildren<MarkComponentProps>) => React.ReactElement<{
20
- css?: {}[] | undefined;
20
+ css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
21
+ style?: {
22
+ '--ak-renderer-annotation-startmarker': string;
23
+ '--ak-renderer-annotation-endmarker': string;
24
+ } | undefined;
21
25
  'data-mark-type': string;
22
26
  'data-mark-annotation-type': import("@atlaskit/adf-schema").AnnotationTypes;
23
27
  'data-id': string;
@@ -25,7 +29,11 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
25
29
  'aria-disabled': boolean;
26
30
  id: string;
27
31
  } | {
28
- css?: {}[] | undefined;
32
+ css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
33
+ style?: {
34
+ '--ak-renderer-annotation-startmarker': string;
35
+ '--ak-renderer-annotation-endmarker': string;
36
+ } | undefined;
29
37
  'data-mark-annotation-state': AnnotationMarkStates;
30
38
  'data-has-focus': boolean;
31
39
  'data-is-hovered': boolean;
@@ -35,7 +43,11 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
35
43
  'aria-disabled': boolean;
36
44
  id: string;
37
45
  } | {
38
- css?: {}[] | undefined;
46
+ css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
47
+ style?: {
48
+ '--ak-renderer-annotation-startmarker': string;
49
+ '--ak-renderer-annotation-endmarker': string;
50
+ } | undefined;
39
51
  'data-mark-type': string;
40
52
  'data-mark-annotation-type': import("@atlaskit/adf-schema").AnnotationTypes;
41
53
  'data-id': string;
@@ -48,7 +60,11 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
48
60
  'aria-disabled'?: undefined;
49
61
  id: string;
50
62
  } | {
51
- css?: {}[] | undefined;
63
+ css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
64
+ style?: {
65
+ '--ak-renderer-annotation-startmarker': string;
66
+ '--ak-renderer-annotation-endmarker': string;
67
+ } | undefined;
52
68
  'data-mark-annotation-state': AnnotationMarkStates;
53
69
  'data-has-focus': boolean;
54
70
  'data-is-hovered': boolean;
@@ -63,7 +79,11 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
63
79
  'aria-disabled'?: undefined;
64
80
  id: string;
65
81
  } | {
66
- css?: {}[] | undefined;
82
+ css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
83
+ style?: {
84
+ '--ak-renderer-annotation-startmarker': string;
85
+ '--ak-renderer-annotation-endmarker': string;
86
+ } | undefined;
67
87
  'data-mark-type': string;
68
88
  'data-mark-annotation-type': import("@atlaskit/adf-schema").AnnotationTypes;
69
89
  'data-id': string;
@@ -76,7 +96,11 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
76
96
  'aria-disabled'?: undefined;
77
97
  id: string;
78
98
  } | {
79
- css?: {}[] | undefined;
99
+ css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
100
+ style?: {
101
+ '--ak-renderer-annotation-startmarker': string;
102
+ '--ak-renderer-annotation-endmarker': string;
103
+ } | undefined;
80
104
  'data-mark-annotation-state': AnnotationMarkStates;
81
105
  'data-has-focus': boolean;
82
106
  'data-is-hovered': boolean;
@@ -45,6 +45,7 @@ export default class RendererActions implements RendererActionsOptions, Annotati
45
45
  * Validate whether we can create an annotation between two positions
46
46
  */
47
47
  _privateValidatePositionsForAnnotation(from: number, to: number): boolean;
48
+ _privateWhyCannotApplyAnnotationOnRange: (pos: Position, doc: Node, schema: Schema) => string;
48
49
  deleteAnnotation(annotationId: string, annotationType: 'inlineComment'): false | {
49
50
  step: Step;
50
51
  doc: JSONDocNode;
@@ -12,5 +12,5 @@ export declare const LightWeightCodeBlockCssClassName: {
12
12
  * @deprecated styles are moved to RendererStyleContainer
13
13
  */
14
14
  export declare const getLightWeightCodeBlockStylesForRootRendererStyleSheet: () => import("@emotion/react").SerializedStyles;
15
- declare const LightWeightCodeBlock: React.FC<Omit<Pick<CodeBlockProps, "text" | "className" | "codeBidiWarningTooltipEnabled"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
+ declare const LightWeightCodeBlock: React.ForwardRefExoticComponent<Pick<CodeBlockProps, "text" | "className" | "codeBidiWarningTooltipEnabled"> & React.RefAttributes<HTMLDivElement>>;
16
16
  export default LightWeightCodeBlock;
@@ -1,13 +1,2 @@
1
- import type { RendererAppearance } from './types';
2
1
  export declare const FullPagePadding = 32;
3
- type RendererWrapperProps = {
4
- allowAnnotations?: boolean;
5
- appearance?: RendererAppearance;
6
- allowNestedHeaderLinks: boolean;
7
- allowColumnSorting: boolean;
8
- useBlockRenderForCodeBlock: boolean;
9
- allowTableResizing?: boolean;
10
- };
11
2
  export declare const TELEPOINTER_ID = "ai-streaming-telepointer";
12
- export declare const rendererStyles: (wrapperProps: RendererWrapperProps) => (theme: any) => import("@emotion/react").SerializedStyles;
13
- export {};