@atlaskit/editor-core 207.2.0 → 207.2.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 +9 -0
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +27 -234
- package/dist/cjs/ui/EditorContentContainer/styles/ai-panel.js +97 -0
- package/dist/cjs/ui/EditorContentContainer/styles/layout.js +126 -0
- package/dist/cjs/ui/EditorContentContainer/styles/link.js +32 -0
- package/dist/cjs/ui/EditorContentContainer/styles/rule.js +29 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +19 -771
- package/dist/es2019/ui/EditorContentContainer/styles/ai-panel.js +213 -0
- package/dist/es2019/ui/EditorContentContainer/styles/layout.js +517 -0
- package/dist/es2019/ui/EditorContentContainer/styles/link.js +26 -0
- package/dist/es2019/ui/EditorContentContainer/styles/rule.js +22 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +29 -237
- package/dist/esm/ui/EditorContentContainer/styles/ai-panel.js +91 -0
- package/dist/esm/ui/EditorContentContainer/styles/layout.js +120 -0
- package/dist/esm/ui/EditorContentContainer/styles/link.js +26 -0
- package/dist/esm/ui/EditorContentContainer/styles/rule.js +21 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -11
- package/dist/types/ui/EditorContentContainer/styles/ai-panel.d.ts +2 -0
- package/dist/types/ui/EditorContentContainer/styles/layout.d.ts +2 -0
- package/dist/types/ui/EditorContentContainer/styles/link.d.ts +2 -0
- package/dist/types/ui/EditorContentContainer/styles/rule.d.ts +1 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -11
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/ai-panel.d.ts +2 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/layout.d.ts +2 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/link.d.ts +2 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/rule.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
+
import { css, keyframes } from "@emotion/react";
|
|
3
|
+
/**
|
|
4
|
+
* aiPanelStyles
|
|
5
|
+
* was imported from packages/editor/editor-core/src/ui/ContentStyles/ai-panels.ts
|
|
6
|
+
*/
|
|
7
|
+
const isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
8
|
+
const rotationAnimation = keyframes({
|
|
9
|
+
'0%': {
|
|
10
|
+
'--panel-gradient-angle': '0deg',
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
12
|
+
...(isFirefox ? {
|
|
13
|
+
backgroundPosition: '100%'
|
|
14
|
+
} : {})
|
|
15
|
+
},
|
|
16
|
+
'100%': {
|
|
17
|
+
'--panel-gradient-angle': '360deg',
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
19
|
+
...(isFirefox ? {
|
|
20
|
+
backgroundPosition: '-100%'
|
|
21
|
+
} : {})
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const aiPrismColor = {
|
|
25
|
+
['prism.border.step.1']: {
|
|
26
|
+
light: '#0065FF',
|
|
27
|
+
dark: '#0065FF80'
|
|
28
|
+
},
|
|
29
|
+
['prism.border.step.2']: {
|
|
30
|
+
light: '#0469FF',
|
|
31
|
+
dark: '#0469FF80'
|
|
32
|
+
},
|
|
33
|
+
['prism.border.step.3']: {
|
|
34
|
+
light: '#BF63F3',
|
|
35
|
+
dark: '#BF63F380'
|
|
36
|
+
},
|
|
37
|
+
['prism.border.step.4']: {
|
|
38
|
+
light: '#FFA900',
|
|
39
|
+
dark: '#FFA90080'
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const prismBorderAnimationStyles = css({
|
|
43
|
+
'&::before, &::after': {
|
|
44
|
+
animationName: rotationAnimation,
|
|
45
|
+
animationDuration: '2s',
|
|
46
|
+
animationTimingFunction: 'linear',
|
|
47
|
+
animationIterationCount: 'infinite',
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
49
|
+
...(isFirefox ? {
|
|
50
|
+
animationDirection: 'normal',
|
|
51
|
+
animationDuration: '1s'
|
|
52
|
+
} : {}),
|
|
53
|
+
'@media (prefers-reduced-motion)': {
|
|
54
|
+
animation: 'none'
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const prismBorderBaseStyles = css({
|
|
59
|
+
content: "''",
|
|
60
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
61
|
+
position: 'absolute',
|
|
62
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
63
|
+
zIndex: -1,
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
65
|
+
width: `calc(100% + 2px)`,
|
|
66
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
67
|
+
height: `calc(100% + 2px)`,
|
|
68
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
69
|
+
top: `-1px`,
|
|
70
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
71
|
+
left: `-1px`,
|
|
72
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
73
|
+
borderRadius: `calc(${"var(--ds-border-radius-100, 3px)"} + 1px)`,
|
|
74
|
+
transform: 'translate3d(0, 0, 0)',
|
|
75
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
76
|
+
...(isFirefox ? {
|
|
77
|
+
background: `linear-gradient(90deg,
|
|
78
|
+
${aiPrismColor['prism.border.step.1']['light']} 0%,
|
|
79
|
+
${aiPrismColor['prism.border.step.2']['light']} 12%,
|
|
80
|
+
${aiPrismColor['prism.border.step.3']['light']} 24%,
|
|
81
|
+
${aiPrismColor['prism.border.step.4']['light']} 48%,
|
|
82
|
+
${aiPrismColor['prism.border.step.3']['light']} 64%,
|
|
83
|
+
${aiPrismColor['prism.border.step.2']['light']} 80%,
|
|
84
|
+
${aiPrismColor['prism.border.step.1']['light']} 100%
|
|
85
|
+
)`,
|
|
86
|
+
backgroundSize: '200%'
|
|
87
|
+
} : {
|
|
88
|
+
background: `conic-gradient(
|
|
89
|
+
from var(--panel-gradient-angle, 270deg),
|
|
90
|
+
${aiPrismColor['prism.border.step.1']['light']} 0%,
|
|
91
|
+
${aiPrismColor['prism.border.step.2']['light']} 20%,
|
|
92
|
+
${aiPrismColor['prism.border.step.3']['light']} 50%,
|
|
93
|
+
${aiPrismColor['prism.border.step.4']['light']} 56%,
|
|
94
|
+
${aiPrismColor['prism.border.step.1']['light']} 100%
|
|
95
|
+
)`
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
const prismBorderDarkStyles = css({
|
|
99
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
100
|
+
...(isFirefox ? {
|
|
101
|
+
background: `linear-gradient(90deg,
|
|
102
|
+
${aiPrismColor['prism.border.step.1']['dark']} 0%,
|
|
103
|
+
${aiPrismColor['prism.border.step.2']['dark']} 12%,
|
|
104
|
+
${aiPrismColor['prism.border.step.3']['dark']} 24%,
|
|
105
|
+
${aiPrismColor['prism.border.step.4']['dark']} 48%,
|
|
106
|
+
${aiPrismColor['prism.border.step.3']['dark']} 64%,
|
|
107
|
+
${aiPrismColor['prism.border.step.2']['dark']} 80%,
|
|
108
|
+
${aiPrismColor['prism.border.step.1']['dark']} 100%
|
|
109
|
+
)`,
|
|
110
|
+
backgroundSize: '200%'
|
|
111
|
+
} : {
|
|
112
|
+
background: `conic-gradient(
|
|
113
|
+
from var(--panel-gradient-angle, 270deg),
|
|
114
|
+
${aiPrismColor['prism.border.step.1']['dark']} 0%,
|
|
115
|
+
${aiPrismColor['prism.border.step.2']['dark']} 20%,
|
|
116
|
+
${aiPrismColor['prism.border.step.3']['dark']} 50%,
|
|
117
|
+
${aiPrismColor['prism.border.step.4']['dark']} 56%,
|
|
118
|
+
${aiPrismColor['prism.border.step.1']['dark']} 100%
|
|
119
|
+
)`
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
const prismBorderHoverStyles = css({
|
|
123
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
124
|
+
background: "var(--ds-border-input, #8590A2)"
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
128
|
+
export const aiPanelBaseStyles = css`
|
|
129
|
+
@property --panel-gradient-angle {
|
|
130
|
+
syntax: '<angle>';
|
|
131
|
+
initial-value: 270deg;
|
|
132
|
+
inherits: false;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
div[extensionType='com.atlassian.ai-blocks'] {
|
|
136
|
+
/* This hides the label for the extension */
|
|
137
|
+
.extension-label {
|
|
138
|
+
display: none;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* This styles the ai panel correctly when its just sitting on the page and there
|
|
142
|
+
is no user interaction */
|
|
143
|
+
.extension-container {
|
|
144
|
+
position: relative;
|
|
145
|
+
box-shadow: none;
|
|
146
|
+
overflow: unset;
|
|
147
|
+
background-color: ${"var(--ds-surface, #FFFFFF)"} !important;
|
|
148
|
+
&::before,
|
|
149
|
+
&::after {
|
|
150
|
+
${prismBorderBaseStyles}
|
|
151
|
+
}
|
|
152
|
+
&.with-hover-border {
|
|
153
|
+
&::before,
|
|
154
|
+
&::after {
|
|
155
|
+
${prismBorderHoverStyles}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
& .with-margin-styles {
|
|
159
|
+
background-color: ${"var(--ds-surface, #FFFFFF)"} !important;
|
|
160
|
+
border-radius: ${"var(--ds-border-radius-100, 3px)"};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* This styles the ai panel correctly when its streaming */
|
|
166
|
+
div[extensionType='com.atlassian.ai-blocks']:has(.streaming) {
|
|
167
|
+
.extension-container {
|
|
168
|
+
box-shadow: none;
|
|
169
|
+
overflow: unset;
|
|
170
|
+
${prismBorderAnimationStyles}
|
|
171
|
+
&::before,
|
|
172
|
+
&::after {
|
|
173
|
+
${prismBorderBaseStyles}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* This styles the ai panel correctly when a user is hovering over the delete button in the floating panel */
|
|
179
|
+
div[extensionType='com.atlassian.ai-blocks'].danger {
|
|
180
|
+
.extension-container {
|
|
181
|
+
box-shadow: 0 0 0 1px ${"var(--ds-border-danger, #E2483D)"};
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* This removes the margin from the action list when inside an ai panel */
|
|
186
|
+
div[extensiontype='com.atlassian.ai-blocks'][extensionkey='ai-action-items-block:aiActionItemsBodiedExtension'] {
|
|
187
|
+
div[data-node-type='actionList'] {
|
|
188
|
+
margin: 0 !important;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
`;
|
|
192
|
+
|
|
193
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
194
|
+
export const aiPanelDarkStyles = css`
|
|
195
|
+
div[extensionType='com.atlassian.ai-blocks'] {
|
|
196
|
+
.extension-container {
|
|
197
|
+
&::before,
|
|
198
|
+
&::after {
|
|
199
|
+
${prismBorderDarkStyles}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* This styles the ai panel correctly when its streaming */
|
|
205
|
+
div[extensionType='com.atlassian.ai-blocks']:has(.streaming) {
|
|
206
|
+
.extension-container {
|
|
207
|
+
&::before,
|
|
208
|
+
&::after {
|
|
209
|
+
${prismBorderDarkStyles}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
`;
|