lexxy 0.1.1.beta
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.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +289 -0
- data/Rakefile +8 -0
- data/app/assets/javascript/lexxy.js +8463 -0
- data/app/assets/javascript/lexxy.js.br +0 -0
- data/app/assets/javascript/lexxy.js.gz +0 -0
- data/app/assets/javascript/lexxy.min.js +10 -0
- data/app/assets/javascript/lexxy.min.js.br +0 -0
- data/app/assets/javascript/lexxy.min.js.gz +0 -0
- data/app/assets/stylesheets/lexxy-content.css +347 -0
- data/app/assets/stylesheets/lexxy-editor.css +255 -0
- data/app/assets/stylesheets/lexxy-variables.css +51 -0
- data/app/assets/stylesheets/lexxy.css +2 -0
- data/app/controllers/actiontext/lexical/application_controller.rb +6 -0
- data/app/helpers/actiontext/lexical/application_helper.rb +6 -0
- data/app/jobs/actiontext/lexical/application_job.rb +6 -0
- data/app/mailers/actiontext/lexical/application_mailer.rb +8 -0
- data/app/models/actiontext/lexical/application_record.rb +7 -0
- data/app/views/layouts/actiontext/lexical/application.html.erb +17 -0
- data/app/views/people/_person.html.erb +1 -0
- data/app/views/people/_prompt_item.html.erb +6 -0
- data/app/views/people/index.html.erb +3 -0
- data/config/routes.rb +2 -0
- data/lib/active_storage/blob_with_preview_url.rb +18 -0
- data/lib/lexxy/action_text_tag.rb +18 -0
- data/lib/lexxy/engine.rb +43 -0
- data/lib/lexxy/form_builder.rb +9 -0
- data/lib/lexxy/form_helper.rb +9 -0
- data/lib/lexxy/rich_text_area_tag.rb +38 -0
- data/lib/lexxy/version.rb +3 -0
- data/lib/lexxy.rb +6 -0
- data/lib/tasks/actiontext/lexical_tasks.rake +4 -0
- metadata +173 -0
Binary file
|
Binary file
|
@@ -0,0 +1,347 @@
|
|
1
|
+
@import url("lexxy-variables.css");
|
2
|
+
|
3
|
+
/* Text styles
|
4
|
+
/* -------------------------------------------------------------------------- */
|
5
|
+
|
6
|
+
:where(.lexxy-content) {
|
7
|
+
color: var(--lexxy-color-ink);
|
8
|
+
|
9
|
+
h1, h2, h3, h4, h5, h6 {
|
10
|
+
display: block;
|
11
|
+
font-weight: bold;
|
12
|
+
hyphens: auto;
|
13
|
+
margin-block: 0 var(--lexxy-content-margin);
|
14
|
+
overflow-wrap: break-word;
|
15
|
+
text-wrap: balance;
|
16
|
+
}
|
17
|
+
|
18
|
+
h1 { font-size: 2rem; }
|
19
|
+
h2 { font-size: 1.5rem; }
|
20
|
+
h3 { font-size: 1.25rem; }
|
21
|
+
h4 { font-size: 1rem; }
|
22
|
+
h5 { font-size: 0.875rem; }
|
23
|
+
h6 { font-size: 0.75rem; }
|
24
|
+
|
25
|
+
p,
|
26
|
+
ul,
|
27
|
+
ol,
|
28
|
+
dl,
|
29
|
+
blockquote,
|
30
|
+
figure,
|
31
|
+
.attachment {
|
32
|
+
margin-block: 0 var(--lexxy-content-margin);
|
33
|
+
|
34
|
+
&:not(lexxy-editor &) {
|
35
|
+
overflow-wrap: break-word;
|
36
|
+
text-wrap: pretty;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
blockquote {
|
41
|
+
border-inline-start: 0.25em solid var(--lexxy-color-ink-lighter);
|
42
|
+
font-style: italic;
|
43
|
+
margin: var(--lexxy-content-margin) 0;
|
44
|
+
padding: 0.5lh 2ch;
|
45
|
+
}
|
46
|
+
|
47
|
+
p:empty {
|
48
|
+
display: none;
|
49
|
+
}
|
50
|
+
|
51
|
+
img,
|
52
|
+
video,
|
53
|
+
embed,
|
54
|
+
object {
|
55
|
+
inline-size: auto;
|
56
|
+
margin-inline: auto;
|
57
|
+
max-block-size: 32rem;
|
58
|
+
object-fit: contain;
|
59
|
+
|
60
|
+
a:has(&) {
|
61
|
+
display: inline-block;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
code, pre {
|
66
|
+
background-color: var(--lexxy-color-ink-lightest);
|
67
|
+
border-radius: var(--lexxy-radius);
|
68
|
+
color: var(--lexxy-color-ink);
|
69
|
+
font-family: var(--lexxy-font-mono);
|
70
|
+
font-size: 0.9em;
|
71
|
+
padding: 0.25ch 0.5ch;
|
72
|
+
|
73
|
+
&:is(pre),
|
74
|
+
&[data-language] {
|
75
|
+
border-radius: var(--lexxy-radius);
|
76
|
+
display: block;
|
77
|
+
hyphens: none;
|
78
|
+
margin-block: 0 var(--lexxy-content-margin);
|
79
|
+
overflow-x: auto;
|
80
|
+
padding: 1ch;
|
81
|
+
tab-size: 2;
|
82
|
+
text-wrap: nowrap;
|
83
|
+
white-space: pre;
|
84
|
+
word-break: break-word;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
> :last-child {
|
89
|
+
margin-block-end: 0;
|
90
|
+
}
|
91
|
+
|
92
|
+
/* Keywords and attributes */
|
93
|
+
.code-token__attr,
|
94
|
+
.token.atrule,
|
95
|
+
.token.attr,
|
96
|
+
.token.keyword {
|
97
|
+
color: var(--lexxy-color-code-token-att);
|
98
|
+
}
|
99
|
+
|
100
|
+
/* Constants, booleans, numbers, properties, tags */
|
101
|
+
.code-token__property,
|
102
|
+
.token.boolean,
|
103
|
+
.token.constant,
|
104
|
+
.token.deleted,
|
105
|
+
.token.number,
|
106
|
+
.token.property,
|
107
|
+
.token.symbol,
|
108
|
+
.token.tag {
|
109
|
+
color: var(--lexxy-color-code-token-property);
|
110
|
+
}
|
111
|
+
|
112
|
+
/* Strings, selectors, and built-in constructs */
|
113
|
+
.code-token__selector,
|
114
|
+
.token.builtin,
|
115
|
+
.token.char,
|
116
|
+
.token.inserted,
|
117
|
+
.token.selector,
|
118
|
+
.token.string {
|
119
|
+
color: var(--lexxy-color-code-token-selector);
|
120
|
+
}
|
121
|
+
|
122
|
+
/* Comments and meta information */
|
123
|
+
.code-token__comment,
|
124
|
+
.token.cdata,
|
125
|
+
.token.comment,
|
126
|
+
.token.doctype,
|
127
|
+
.token.prolog {
|
128
|
+
color: var(--lexxy-color-code-token-comment);
|
129
|
+
font-style: italic;
|
130
|
+
}
|
131
|
+
|
132
|
+
/* Operators and symbolic entities */
|
133
|
+
.code-token__operator,
|
134
|
+
.token.entity,
|
135
|
+
.token.operator,
|
136
|
+
.token.url {
|
137
|
+
color: var(--lexxy-color-code-token-operator);
|
138
|
+
}
|
139
|
+
|
140
|
+
/* Functions and class names */
|
141
|
+
.code-token__function,
|
142
|
+
.token.class,
|
143
|
+
.token.class-name,
|
144
|
+
.token.function {
|
145
|
+
color: var(--lexxy-color-code-token-function);
|
146
|
+
}
|
147
|
+
|
148
|
+
/* Variables, regex, namespaces, important */
|
149
|
+
.code-token__variable,
|
150
|
+
.token.important,
|
151
|
+
.token.namespace,
|
152
|
+
.token.regex,
|
153
|
+
.token.variable {
|
154
|
+
color: var(--lexxy-color-code-token-variable);
|
155
|
+
}
|
156
|
+
|
157
|
+
/* Punctuation */
|
158
|
+
.code-token__punctuation,
|
159
|
+
.token.punctuation {
|
160
|
+
color: var(--lexxy-color-code-token-punctuation);
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
:where([data-lexical-cursor]) {
|
165
|
+
animation: blink 1s step-end infinite;
|
166
|
+
block-size: 1lh;
|
167
|
+
border-inline-start: 1px solid currentColor;
|
168
|
+
line-height: inherit;
|
169
|
+
margin-block: 1em;
|
170
|
+
}
|
171
|
+
|
172
|
+
/* Attachments
|
173
|
+
/* ------------------------------------------------------------------------ */
|
174
|
+
|
175
|
+
:where(.attachment) {
|
176
|
+
block-size: auto;
|
177
|
+
display: block;
|
178
|
+
inline-size: fit-content;
|
179
|
+
position: relative;
|
180
|
+
margin-inline: auto;
|
181
|
+
max-inline-size: 100%;
|
182
|
+
text-align: center;
|
183
|
+
|
184
|
+
:where(progress) {
|
185
|
+
inline-size: 100%;
|
186
|
+
margin: auto;
|
187
|
+
}
|
188
|
+
}
|
189
|
+
|
190
|
+
:where(.attachment__caption) {
|
191
|
+
color: var(--lexxy-color-text-subtle);
|
192
|
+
font-size: var(--lexxy-text-small);
|
193
|
+
|
194
|
+
input {
|
195
|
+
color: inherit;
|
196
|
+
border: none;
|
197
|
+
inline-size: 100%;
|
198
|
+
max-inline-size: 100%;
|
199
|
+
text-align: center;
|
200
|
+
|
201
|
+
&:focus {
|
202
|
+
outline: none;
|
203
|
+
}
|
204
|
+
|
205
|
+
@supports (field-sizing: content) {
|
206
|
+
field-sizing: content;
|
207
|
+
inline-size: auto;
|
208
|
+
min-inline-size: 20ch;
|
209
|
+
}
|
210
|
+
}
|
211
|
+
}
|
212
|
+
|
213
|
+
:where(.attachment__icon) {
|
214
|
+
aspect-ratio: 4/5;
|
215
|
+
background-color: color-mix(var(--lexxy-attachment-icon-color), transparent 90%);
|
216
|
+
block-size: 3lh;
|
217
|
+
border: 2px solid var(--lexxy-attachment-icon-color);
|
218
|
+
border-block-start-width: 1ch;
|
219
|
+
border-radius: var(--lexxy-radius);
|
220
|
+
box-sizing: border-box;
|
221
|
+
color: var(--lexxy-attachment-icon-color);
|
222
|
+
display: grid;
|
223
|
+
font-size: var(--lexxy-text-small);
|
224
|
+
font-weight: bold;
|
225
|
+
inline-size: auto;
|
226
|
+
place-content: center;
|
227
|
+
text-transform: uppercase;
|
228
|
+
}
|
229
|
+
|
230
|
+
:where(.attachment--preview) {
|
231
|
+
border-radius: var(--lexxy-radius);
|
232
|
+
|
233
|
+
img, video {
|
234
|
+
block-size: auto;
|
235
|
+
display: block;
|
236
|
+
margin-inline: auto;
|
237
|
+
max-inline-size: 100%;
|
238
|
+
user-select: none;
|
239
|
+
}
|
240
|
+
|
241
|
+
> a {
|
242
|
+
display: block;
|
243
|
+
}
|
244
|
+
|
245
|
+
.attachment__caption {
|
246
|
+
margin-block-start: 1ch;
|
247
|
+
}
|
248
|
+
}
|
249
|
+
|
250
|
+
:where(.attachment--file) {
|
251
|
+
--lexxy-attachment-icon-color: var(--lexxy-color-text-subtle);
|
252
|
+
|
253
|
+
align-items: center;
|
254
|
+
display: flex;
|
255
|
+
flex-wrap: wrap;
|
256
|
+
gap: 1ch;
|
257
|
+
inline-size: auto;
|
258
|
+
|
259
|
+
.attachment__caption {
|
260
|
+
display: grid;
|
261
|
+
flex: 1;
|
262
|
+
text-align: start;
|
263
|
+
}
|
264
|
+
|
265
|
+
.attachment__name {
|
266
|
+
color: var(--lexxy-color-ink);
|
267
|
+
font-weight: bold;
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
271
|
+
:where(
|
272
|
+
.attachment--psd,
|
273
|
+
.attachment--key,
|
274
|
+
.attachment--sketch,
|
275
|
+
.attachment--ai,
|
276
|
+
.attachment--eps,
|
277
|
+
.attachment--indd,
|
278
|
+
.attachment--svg,
|
279
|
+
.attachment--ppt,
|
280
|
+
.attachment--pptx
|
281
|
+
) {
|
282
|
+
--lexxy-attachment-icon-color: var(--lexxy-color-red);
|
283
|
+
}
|
284
|
+
|
285
|
+
:where(
|
286
|
+
.attachment--css,
|
287
|
+
.attachment--php,
|
288
|
+
.attachment--json,
|
289
|
+
.attachment--htm,
|
290
|
+
.attachment--html,
|
291
|
+
.attachment--rb,
|
292
|
+
.attachment--erb,
|
293
|
+
.attachment--ts,
|
294
|
+
.attachment--js
|
295
|
+
) {
|
296
|
+
--lexxy-attachment-icon-color: var(--lexxy-color-purple);
|
297
|
+
}
|
298
|
+
|
299
|
+
:where (
|
300
|
+
.attachment--txt,
|
301
|
+
.attachment--pages,
|
302
|
+
.attachment--rtf,
|
303
|
+
.attachment--md,
|
304
|
+
.attachment--doc,
|
305
|
+
.attachment--docx
|
306
|
+
) {
|
307
|
+
--lexxy-attachment-icon-color: var(--lexxy-color-blue);
|
308
|
+
}
|
309
|
+
|
310
|
+
:where(
|
311
|
+
.attachment--csv,
|
312
|
+
.attachment--numbers,
|
313
|
+
.attachment--xls,
|
314
|
+
.attachment--xlsx
|
315
|
+
) {
|
316
|
+
--lexxy-attachment-icon-color: var(--lexxy-color-green);
|
317
|
+
}
|
318
|
+
|
319
|
+
/* Custom attachments such as mentions, etc. */
|
320
|
+
:where(action-text-attachment[content-type^="application/vnd.actiontext"]) {
|
321
|
+
--lexxy-attachment-bg-color: transparent;
|
322
|
+
--lexxy-attachment-image-size: 1em;
|
323
|
+
--lexxy-attachment-text-color: currentColor;
|
324
|
+
|
325
|
+
align-items: center;
|
326
|
+
background: var(--lexxy-attachment-bg-color);
|
327
|
+
border-radius: var(--lexxy-radius);
|
328
|
+
box-shadow: -0.25ch 0 0 var(--lexxy-attachment-bg-color), 0.5ch 0 0 var(--lexxy-attachment-bg-color);
|
329
|
+
color: var(--lexxy-attachment-text-color);
|
330
|
+
display: inline-flex;
|
331
|
+
gap: 0.25ch;
|
332
|
+
margin: 0;
|
333
|
+
padding: 0;
|
334
|
+
position: relative;
|
335
|
+
white-space: normal;
|
336
|
+
|
337
|
+
img {
|
338
|
+
block-size: var(--lexxy-attachment-image-size);
|
339
|
+
border-radius: 50%;
|
340
|
+
inline-size: var(--lexxy-attachment-image-size);
|
341
|
+
}
|
342
|
+
|
343
|
+
&.node--selected {
|
344
|
+
--lexxy-attachment-bg-color: var(--lexxy-color-accent-dark);
|
345
|
+
--lexxy-attachment-text-color: var(--lexxy-color-ink-inverted);
|
346
|
+
}
|
347
|
+
}
|
@@ -0,0 +1,255 @@
|
|
1
|
+
@import url("lexxy-variables.css");
|
2
|
+
|
3
|
+
:where(lexxy-editor) {
|
4
|
+
--lexxy-editor-padding: 1ch;
|
5
|
+
--lexxy-toolbar-gap: 2px;
|
6
|
+
|
7
|
+
border: 1px solid var(--lexxy-color-ink-lighter);
|
8
|
+
border-radius: calc(var(--lexxy-radius) + var(--lexxy-toolbar-gap));
|
9
|
+
display: block;
|
10
|
+
overflow: visible;
|
11
|
+
position: relative;
|
12
|
+
transition: opacity 150ms;
|
13
|
+
|
14
|
+
&:not(:has(lexxy-toolbar)) {
|
15
|
+
opacity: 0;
|
16
|
+
}
|
17
|
+
|
18
|
+
input,
|
19
|
+
button {
|
20
|
+
&:focus-visible {
|
21
|
+
outline-color: var(--lexxy-focus-ring-color);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
button {
|
26
|
+
-webkit-appearance: none;
|
27
|
+
appearance: none;
|
28
|
+
background: var(--lexxy-color-canvas);
|
29
|
+
border: none;
|
30
|
+
border-radius: var(--lexxy-radius);
|
31
|
+
cursor: pointer;
|
32
|
+
font-size: inherit;
|
33
|
+
inline-size: auto;
|
34
|
+
|
35
|
+
@media(any-hover: hover) {
|
36
|
+
&:hover {
|
37
|
+
filter: brightness(0.9);
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
.node--selected {
|
43
|
+
&:has(img) img,
|
44
|
+
&:not(:has(img)) {
|
45
|
+
outline: var(--lexxy-focus-ring-size) solid var(--lexxy-focus-ring-color);
|
46
|
+
outline-offset: var(--lexxy-focus-ring-offset);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
action-text-attachment {
|
51
|
+
cursor: pointer;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
/* Placeholder */
|
56
|
+
:where(.lexxy-editor--empty) {
|
57
|
+
.lexxy-editor__content:not(:has(ul, ol))::before {
|
58
|
+
content: attr(placeholder);
|
59
|
+
color: currentColor;
|
60
|
+
cursor: text;
|
61
|
+
opacity: 0.66;
|
62
|
+
pointer-events: none;
|
63
|
+
position: absolute;
|
64
|
+
white-space: pre-line;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
:where(.lexxy-editor__content) {
|
69
|
+
min-block-size: 8lh;
|
70
|
+
outline: 0;
|
71
|
+
padding: var(--lexxy-editor-padding);
|
72
|
+
}
|
73
|
+
|
74
|
+
:where(.lexxy-editor--drag-over) {
|
75
|
+
background-color: var(--lexxy-color-selected);
|
76
|
+
border-radius: var(--lexxy-radius);
|
77
|
+
outline: 2px dashed var(--lexxy-color-selected-dark);
|
78
|
+
}
|
79
|
+
|
80
|
+
/* Toolbar
|
81
|
+
/* -------------------------------------------------------------------------- */
|
82
|
+
|
83
|
+
:where(lexxy-toolbar) {
|
84
|
+
border-block-end: 1px solid var(--lexxy-color-ink-lighter);
|
85
|
+
color: currentColor;
|
86
|
+
display: flex;
|
87
|
+
font-size: inherit;
|
88
|
+
gap: var(--lexxy-toolbar-gap);
|
89
|
+
max-inline-size: 100%;
|
90
|
+
padding: 2px;
|
91
|
+
position: relative;
|
92
|
+
|
93
|
+
> button {
|
94
|
+
aspect-ratio: 1;
|
95
|
+
block-size: 2lh;
|
96
|
+
color: currentColor;
|
97
|
+
display: grid;
|
98
|
+
place-items: center;
|
99
|
+
|
100
|
+
svg {
|
101
|
+
-webkit-touch-callout: none;
|
102
|
+
block-size: 0.85em;
|
103
|
+
fill: currentColor;
|
104
|
+
grid-area: 1/1;
|
105
|
+
inline-size: auto;
|
106
|
+
user-select: none;
|
107
|
+
}
|
108
|
+
|
109
|
+
&:is(:active) {
|
110
|
+
background-color: var(--lexxy-color-selected);
|
111
|
+
}
|
112
|
+
|
113
|
+
&[aria-pressed="true"] {
|
114
|
+
background-color: var(--lexxy-color-selected);
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
/* Link dialog
|
120
|
+
/* -------------------------------------------------------------------------- */
|
121
|
+
|
122
|
+
:where(.lexxy-link-dialog) {
|
123
|
+
dialog {
|
124
|
+
background-color: var(--lexxy-color-canvas);
|
125
|
+
border: 1px solid var(--lexxy-color-ink-lighter);
|
126
|
+
border-radius: var(--lexxy-radius);
|
127
|
+
box-shadow: var(--lexxy-shadow);
|
128
|
+
color: var(--lexxy-color-ink);
|
129
|
+
padding: 1ch;
|
130
|
+
position: absolute;
|
131
|
+
z-index: 1;
|
132
|
+
}
|
133
|
+
|
134
|
+
.lexxy-dialog-actions {
|
135
|
+
display: flex;
|
136
|
+
font-size: var(--lexxy-text-small);
|
137
|
+
flex: 1 1 0%;
|
138
|
+
gap: 1ch;
|
139
|
+
margin-block-start: 1ch;
|
140
|
+
}
|
141
|
+
|
142
|
+
input[type="url"],
|
143
|
+
button {
|
144
|
+
line-height: 1.5lh;
|
145
|
+
padding-inline: 1ch;
|
146
|
+
}
|
147
|
+
|
148
|
+
input[type="url"] {
|
149
|
+
border: 1px solid var(--lexxy-color-ink-lighter);
|
150
|
+
border-radius: var(--lexxy-radius);
|
151
|
+
min-inline-size: 30ch;
|
152
|
+
}
|
153
|
+
|
154
|
+
button {
|
155
|
+
background-color: var(--lexxy-color-ink-lightest);
|
156
|
+
inline-size: 100%;
|
157
|
+
justify-content: center;
|
158
|
+
}
|
159
|
+
|
160
|
+
button[type="submit"] {
|
161
|
+
background-color: var(--lexxy-color-accent-dark);
|
162
|
+
color: var(--lexxy-color-ink-inverted);
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
/* Language picker
|
167
|
+
/* -------------------------------------------------------------------------- */
|
168
|
+
|
169
|
+
:where(.lexxy-code-language-picker) {
|
170
|
+
-webkit-appearance: none;
|
171
|
+
appearance: none;
|
172
|
+
background-color: var(--lexxy-color-canvas);
|
173
|
+
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 19.5c-.7 0-1.3-.3-1.7-.8l-9.8-11.1c-.7-.8-.6-1.9.2-2.6.8-.6 1.9-.6 2.5.2l8.6 9.8c0 .1.2.1.4 0l8.6-9.8c.7-.8 1.8-.9 2.6-.2s.9 1.8.2 2.6l-9.8 11.1c-.4.5-1.1.8-1.7.8z' fill='%23000'/%3E%3C/svg%3E");
|
174
|
+
background-position: center right 1ch;
|
175
|
+
background-repeat: no-repeat;
|
176
|
+
background-size: 1ch;
|
177
|
+
block-size: 1.5lh;
|
178
|
+
border: 1px solid var(--lexxy-color-ink-lighter);
|
179
|
+
border-radius: var(--lexxy-radius);
|
180
|
+
color: var(--lexxy-color-ink);
|
181
|
+
font-family: var(--lexxy-font-base);
|
182
|
+
font-size: var(--lexxy-text-small);
|
183
|
+
font-weight: normal;
|
184
|
+
inset-inline-end: var(--lexxy-editor-padding);
|
185
|
+
margin: 0.5ch 0.5ch 0 -0.5ch;
|
186
|
+
padding: 0 2ch 0 1ch;
|
187
|
+
text-align: start;
|
188
|
+
|
189
|
+
@media (prefers-color-scheme: dark) {
|
190
|
+
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 19.5c-.7 0-1.3-.3-1.7-.8l-9.8-11.1c-.7-.8-.6-1.9.2-2.6.8-.6 1.9-.6 2.5.2l8.6 9.8c0 .1.2.1.4 0l8.6-9.8c.7-.8 1.8-.9 2.6-.2s.9 1.8.2 2.6l-9.8 11.1c-.4.5-1.1.8-1.7.8z' fill='%23fff'/%3E%3C/svg%3E");
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
194
|
+
/* Prompt
|
195
|
+
/* ------------------------------------------------------------------------ */
|
196
|
+
|
197
|
+
:where(.lexxy-prompt-menu) {
|
198
|
+
--lexxy-prompt-avatar-size: 24px;
|
199
|
+
--lexxy-prompt-min-width: 20ch;
|
200
|
+
--lexxy-prompt-padding: 0.5ch;
|
201
|
+
|
202
|
+
background-color: var(--lexxy-color-canvas);
|
203
|
+
border-radius: calc(var(--lexxy-prompt-padding) * 2);
|
204
|
+
box-shadow: var(--lexxy-shadow);
|
205
|
+
color: var(--lexxy-color-ink);
|
206
|
+
font-family: var(--lexxy-font-base);
|
207
|
+
font-size: var(--lexxy-text-small);
|
208
|
+
list-style: none;
|
209
|
+
margin: 0;
|
210
|
+
max-block-size: 200px;
|
211
|
+
min-inline-size: var(--lexxy-prompt-min-width);
|
212
|
+
overflow: auto;
|
213
|
+
padding: var(--lexxy-prompt-padding);
|
214
|
+
visibility: hidden;
|
215
|
+
z-index: var(--lexxy-z-popup);
|
216
|
+
}
|
217
|
+
|
218
|
+
:where(.lexxy-prompt-menu--visible) {
|
219
|
+
visibility: initial;
|
220
|
+
}
|
221
|
+
|
222
|
+
:where(.lexxy-prompt-menu__item) {
|
223
|
+
align-items: center;
|
224
|
+
border-radius: var(--lexxy-radius);
|
225
|
+
cursor: pointer;
|
226
|
+
display: flex;
|
227
|
+
gap: var(--lexxy-prompt-padding);
|
228
|
+
padding: var(--lexxy-prompt-padding);
|
229
|
+
white-space: nowrap;
|
230
|
+
|
231
|
+
&:hover {
|
232
|
+
background-color: var(--lexxy-color-ink-lightest);
|
233
|
+
}
|
234
|
+
|
235
|
+
&[aria-selected] {
|
236
|
+
background-color: var(--lexxy-color-selected);
|
237
|
+
}
|
238
|
+
|
239
|
+
img {
|
240
|
+
block-size: var(--lexxy-prompt-avatar-size);
|
241
|
+
border-radius: 50%;
|
242
|
+
flex-shrink: 0;
|
243
|
+
inline-size: var(--lexxy-prompt-avatar-size);
|
244
|
+
margin: 0;
|
245
|
+
}
|
246
|
+
|
247
|
+
+ & {
|
248
|
+
margin-top: 2px;
|
249
|
+
}
|
250
|
+
}
|
251
|
+
|
252
|
+
:where(.lexxy-prompt-menu__item--empty) {
|
253
|
+
color: var(--lexxy-color-ink-medium);
|
254
|
+
padding: var(--lexxy-prompt-padding);
|
255
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
:root {
|
2
|
+
/* Colors */
|
3
|
+
--lexxy-color-ink: oklch(20% 0 0);
|
4
|
+
--lexxy-color-ink-medium: oklch(40% 0 0);
|
5
|
+
--lexxy-color-ink-light: oklch(60% 0 0);
|
6
|
+
--lexxy-color-ink-lighter: oklch(85% 0 0);
|
7
|
+
--lexxy-color-ink-lightest: oklch(96% 0 0);
|
8
|
+
--lexxy-color-ink-inverted: white;
|
9
|
+
|
10
|
+
--lexxy-color-accent-dark: oklch(57% 0.19 260);
|
11
|
+
--lexxy-color-accent-medium: oklch(66% 0.196 258);
|
12
|
+
--lexxy-color-accent-lightest: oklch(92% 0.026 254);
|
13
|
+
|
14
|
+
--lexxy-color-red: oklch(60% 0.15 27);
|
15
|
+
--lexxy-color-green: oklch(60% 0.15 145);
|
16
|
+
--lexxy-color-blue: oklch(66% 0.196 258);
|
17
|
+
--lexxy-color-purple: oklch(60% 0.15 305);
|
18
|
+
|
19
|
+
--lexxy-color-code-token-att: #d73a49;
|
20
|
+
--lexxy-color-code-token-comment: #6a737d;
|
21
|
+
--lexxy-color-code-token-function: #6f42c1;
|
22
|
+
--lexxy-color-code-token-operator: #d73a49;
|
23
|
+
--lexxy-color-code-token-property: #005cc5;
|
24
|
+
--lexxy-color-code-token-punctuation: #24292e;
|
25
|
+
--lexxy-color-code-token-selector: #22863a;
|
26
|
+
--lexxy-color-code-token-variable: #e36209;
|
27
|
+
|
28
|
+
--lexxy-color-canvas: var(--lexxy-color-ink-inverted);
|
29
|
+
--lexxy-color-text: var(--lexxy-color-ink);
|
30
|
+
--lexxy-color-text-subtle: var(--lexxy-color-ink-medium);
|
31
|
+
--lexxy-color-link: var(--lexxy-color-accent-dark);
|
32
|
+
--lexxy-color-selected: var(--lexxy-color-accent-lightest);
|
33
|
+
--lexxy-color-selected-dark: var(--lexxy-color-blue-medium);
|
34
|
+
--lexxy-color-code-bg: var(--lexxy-color-ink-lightest);
|
35
|
+
|
36
|
+
/* Typography */
|
37
|
+
--lexxy-font-base: system-ui, sans-serif;
|
38
|
+
--lexxy-font-mono: ui-monospace, "Menlo", "Monaco", Consolas, monospace;
|
39
|
+
--lexxy-text-small: 0.875rem;
|
40
|
+
--lexxy-content-margin: 1rem;
|
41
|
+
|
42
|
+
/* Focus ring */
|
43
|
+
--lexxy-focus-ring-color: var(--lexxy-color-accent-dark);
|
44
|
+
--lexxy-focus-ring-offset: 2px;
|
45
|
+
--lexxy-focus-ring-size: 2px;
|
46
|
+
|
47
|
+
/* Misc */
|
48
|
+
--lexxy-radius: 0.5ch;
|
49
|
+
--lexxy-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
50
|
+
--lexxy-z-popup: 1000;
|
51
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Actiontext lexical</title>
|
5
|
+
<%= csrf_meta_tags %>
|
6
|
+
<%= csp_meta_tag %>
|
7
|
+
|
8
|
+
<%= yield :head %>
|
9
|
+
|
10
|
+
<%= stylesheet_link_tag "actiontext/lexical/application", media: "all" %>
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
|
14
|
+
<%= yield %>
|
15
|
+
|
16
|
+
</body>
|
17
|
+
</html>
|