@vendure/admin-ui 2.2.6 → 2.3.0

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 (42) hide show
  1. package/catalog/components/product-variant-list/product-variant-list.component.d.ts +1 -1
  2. package/core/common/generated-types.d.ts +6 -1
  3. package/core/common/version.d.ts +1 -1
  4. package/core/extension/components/angular-route.component.d.ts +20 -0
  5. package/core/extension/components/route.component.d.ts +9 -2
  6. package/core/extension/register-route-component.d.ts +4 -0
  7. package/core/shared/components/order-state-label/order-state-label.component.d.ts +1 -1
  8. package/core/shared/dynamic-form-inputs/default-form-inputs.d.ts +1 -1
  9. package/core/shared/providers/routing/can-deactivate-detail-guard.d.ts +2 -4
  10. package/esm2022/catalog/components/create-product-variant-dialog/create-product-variant-dialog.component.mjs +2 -2
  11. package/esm2022/catalog/components/facet-detail/facet-detail.component.mjs +8 -8
  12. package/esm2022/catalog/components/generate-product-variants/generate-product-variants.component.mjs +2 -1
  13. package/esm2022/core/common/generated-types.mjs +1 -1
  14. package/esm2022/core/common/introspection-result.mjs +1 -1
  15. package/esm2022/core/common/version.mjs +2 -2
  16. package/esm2022/core/data/utils/is-entity-create-or-update-mutation.mjs +1 -1
  17. package/esm2022/core/data/utils/remove-readonly-custom-fields.mjs +1 -1
  18. package/esm2022/core/extension/components/angular-route.component.mjs +51 -6
  19. package/esm2022/core/extension/components/route.component.mjs +32 -11
  20. package/esm2022/core/extension/register-data-table-component.mjs +1 -1
  21. package/esm2022/core/extension/register-route-component.mjs +4 -2
  22. package/esm2022/core/shared/components/facet-value-selector/facet-value-selector.component.mjs +1 -1
  23. package/esm2022/core/shared/components/rich-text-editor/rich-text-editor.component.mjs +2 -2
  24. package/esm2022/core/shared/components/timeline-entry/timeline-entry.component.mjs +1 -1
  25. package/esm2022/core/shared/providers/routing/can-deactivate-detail-guard.mjs +6 -8
  26. package/esm2022/core/shared/shared.module.mjs +1 -1
  27. package/esm2022/customer/customer.routes.mjs +1 -1
  28. package/esm2022/react/components/react-route.component.mjs +2 -2
  29. package/esm2022/react/react-components/RichTextEditor.mjs +8 -4
  30. package/esm2022/react/react-hooks/use-query.mjs +22 -8
  31. package/fesm2022/vendure-admin-ui-catalog.mjs +9 -8
  32. package/fesm2022/vendure-admin-ui-catalog.mjs.map +1 -1
  33. package/fesm2022/vendure-admin-ui-core.mjs +84 -19
  34. package/fesm2022/vendure-admin-ui-core.mjs.map +1 -1
  35. package/fesm2022/vendure-admin-ui-customer.mjs.map +1 -1
  36. package/fesm2022/vendure-admin-ui-react.mjs +29 -11
  37. package/fesm2022/vendure-admin-ui-react.mjs.map +1 -1
  38. package/package.json +15 -15
  39. package/react/react-components/RichTextEditor.d.ts +2 -0
  40. package/react/react-hooks/use-query.d.ts +9 -5
  41. package/static/styles/component/prosemirror.scss +511 -0
  42. package/static/styles/styles.scss +2 -0
@@ -0,0 +1,511 @@
1
+ label.rich-text-label {
2
+ font-size: var(--font-size-sm);
3
+ color: var(--font-weight-700);
4
+ }
5
+
6
+ .ProseMirror-menubar {
7
+ position: sticky;
8
+ border: 1px solid var(--color-weight-200);
9
+ border-bottom: none;
10
+ background-color: var(--color-component-bg-200);
11
+ color: var(--color-icon-button);
12
+ border-radius: var(--border-radius-input) var(--border-radius-input) 0 0;
13
+ padding: 6px 12px;
14
+ display: flex;
15
+ flex-wrap: wrap;
16
+ }
17
+
18
+ .vdr-prosemirror {
19
+ background: var(--color-form-input-bg);
20
+ color: var(--color-text-100);
21
+ min-height: 128px;
22
+ max-height: 600px;
23
+ min-width: 200px;
24
+ border: 1px solid var(--color-weight-200);
25
+ border-radius: 0 0 var(--border-radius-input) var(--border-radius-input);
26
+ transition: border-color 0.2s;
27
+ overflow: auto;
28
+ text-align: initial;
29
+
30
+ &:focus {
31
+ border-color: var(--color-primary-500) !important;
32
+ box-shadow: 0 0 1px 1px var(--color-primary-100);
33
+ }
34
+
35
+ /* Add space around the hr to make clicking it easier */
36
+
37
+ hr {
38
+ padding: 2px 10px;
39
+ border: none;
40
+ margin: 1em 0;
41
+ }
42
+
43
+ hr:after {
44
+ content: '';
45
+ display: block;
46
+ height: 1px;
47
+ background-color: silver;
48
+ line-height: 2px;
49
+ }
50
+
51
+ img {
52
+ cursor: default;
53
+ max-width: 100%;
54
+ }
55
+
56
+ a:link,
57
+ a:visited {
58
+ color: var(--color-primary-700);
59
+ text-decoration: none;
60
+ }
61
+
62
+ .iframe-wrapper {
63
+ width: 100%;
64
+ text-align: center;
65
+ padding: 6px;
66
+ transition: background-color 0.3s;
67
+ &:hover {
68
+ background-color: var(--color-primary-100);
69
+ }
70
+ }
71
+ }
72
+
73
+
74
+ .ProseMirror {
75
+ position: relative;
76
+ }
77
+
78
+ .ProseMirror {
79
+ word-wrap: break-word;
80
+ white-space: pre-wrap;
81
+ -webkit-font-variant-ligatures: none;
82
+ font-variant-ligatures: none;
83
+ }
84
+
85
+ .ProseMirror pre {
86
+ white-space: pre-wrap;
87
+ }
88
+
89
+ .ProseMirror li {
90
+ position: relative;
91
+ }
92
+
93
+ .ProseMirror-hideselection *::selection {
94
+ background: transparent;
95
+ }
96
+
97
+ .ProseMirror-hideselection *::-moz-selection {
98
+ background: transparent;
99
+ }
100
+
101
+ .ProseMirror-hideselection {
102
+ caret-color: transparent;
103
+ }
104
+
105
+ .ProseMirror-selectednode {
106
+ outline: 2px solid var(--color-primary-500);
107
+ }
108
+
109
+ /* Make sure li selections wrap around markers */
110
+
111
+ li.ProseMirror-selectednode {
112
+ outline: none;
113
+ }
114
+
115
+ li.ProseMirror-selectednode:after {
116
+ content: '';
117
+ position: absolute;
118
+ left: -32px;
119
+ right: -2px;
120
+ top: -2px;
121
+ bottom: -2px;
122
+ border: 2px solid var(--color-primary-500);
123
+ pointer-events: none;
124
+ }
125
+
126
+ .ProseMirror-textblock-dropdown {
127
+ min-width: 3em;
128
+ }
129
+
130
+ .ProseMirror-menu {
131
+ margin: 0 -4px;
132
+ line-height: 1;
133
+ }
134
+
135
+ .ProseMirror-tooltip .ProseMirror-menu {
136
+ width: -webkit-fit-content;
137
+ width: fit-content;
138
+ white-space: pre;
139
+ }
140
+
141
+ .ProseMirror-menuitem {
142
+ margin-inline-end: 3px;
143
+ display: inline-block;
144
+ }
145
+
146
+ .ProseMirror-menuseparator {
147
+ border-inline-end: 1px solid var(--color-component-border-200);
148
+ margin: 0 12px 0 8px;
149
+ height: 18px;
150
+ }
151
+
152
+ .ProseMirror-menu-dropdown,
153
+ .ProseMirror-menu-dropdown-menu {
154
+ font-size: 90%;
155
+ white-space: nowrap;
156
+ border-radius: var(--border-radius-input);
157
+ }
158
+
159
+ .ProseMirror-menu-dropdown {
160
+ vertical-align: 1px;
161
+ cursor: pointer;
162
+ position: relative;
163
+ padding-inline-end: 15px;
164
+ }
165
+
166
+ .ProseMirror-menu-dropdown-wrap {
167
+ padding: 1px 3px 1px 6px;
168
+ display: inline-block;
169
+ position: relative;
170
+ }
171
+
172
+ .ProseMirror-menu-dropdown:after {
173
+ content: '';
174
+ border-inline-start: 4px solid transparent;
175
+ border-inline-end: 4px solid transparent;
176
+ border-top: 4px solid currentColor;
177
+ opacity: 0.6;
178
+ position: absolute;
179
+ right: 4px;
180
+ top: calc(50% - 2px);
181
+ }
182
+
183
+ .ProseMirror-menu-dropdown-menu,
184
+ .ProseMirror-menu-submenu {
185
+ position: absolute;
186
+ background: var(--color-component-bg-100);
187
+ border: 1px solid var(--color-component-border-200);
188
+ padding: 2px;
189
+ }
190
+
191
+ .ProseMirror-menu-dropdown-menu {
192
+ z-index: 15;
193
+ min-width: 6em;
194
+ color: var(--color-text-200);
195
+ }
196
+
197
+ .ProseMirror-menu-dropdown-item {
198
+ cursor: pointer;
199
+ padding: 2px 8px 2px 4px;
200
+ }
201
+
202
+ .ProseMirror-menu-dropdown-item:hover {
203
+ background: var(--color-component-bg-200);
204
+ }
205
+
206
+ .ProseMirror-menu-submenu-wrap {
207
+ position: relative;
208
+ margin-inline-end: 4px;
209
+ }
210
+
211
+ .ProseMirror-menu-submenu-label:after {
212
+ content: '';
213
+ border-top: 4px solid transparent;
214
+ border-bottom: 4px solid transparent;
215
+ border-inline-start: 4px solid currentColor;
216
+ opacity: 0.6;
217
+ position: absolute;
218
+ right: -8px;
219
+ top: calc(50% - 4px);
220
+ }
221
+
222
+ .ProseMirror-menu-submenu {
223
+ display: none;
224
+ min-width: 4em;
225
+ left: 100%;
226
+ top: -3px;
227
+ }
228
+
229
+ .ProseMirror-menu-active {
230
+ background: var(--color-component-bg-100);
231
+ border-radius: 4px;
232
+ }
233
+
234
+ .ProseMirror-menu-active {
235
+ background: var(--color-component-bg-100);
236
+ border-radius: 4px;
237
+ }
238
+
239
+ .ProseMirror-menu-disabled {
240
+ opacity: 0.3;
241
+ }
242
+
243
+ .ProseMirror-menu-submenu-wrap:hover .ProseMirror-menu-submenu,
244
+ .ProseMirror-menu-submenu-wrap-active .ProseMirror-menu-submenu {
245
+ display: block;
246
+ }
247
+
248
+ .ProseMirror-menubar {
249
+ border-top-left-radius: inherit;
250
+ border-top-right-radius: inherit;
251
+ position: relative;
252
+ min-height: 1em;
253
+ color: var(--color-grey-600);
254
+ padding: 1px 6px;
255
+ top: 0;
256
+ left: 0;
257
+ right: 0;
258
+ background: var(--color-component-bg-100);
259
+ z-index: 10;
260
+ -moz-box-sizing: border-box;
261
+ box-sizing: border-box;
262
+ overflow: visible;
263
+ align-items: center;
264
+ }
265
+
266
+ .ProseMirror-icon {
267
+ display: inline-block;
268
+ line-height: 0.8;
269
+ vertical-align: -2px; /* Compensate for padding */
270
+ padding: 2px 8px;
271
+ cursor: pointer;
272
+ }
273
+
274
+ .ProseMirror-menu-disabled.ProseMirror-icon {
275
+ cursor: default;
276
+ }
277
+
278
+ .ProseMirror-icon svg {
279
+ fill: currentColor;
280
+ height: 1em;
281
+ }
282
+
283
+ .ProseMirror-icon span {
284
+ vertical-align: text-top;
285
+ }
286
+
287
+ .ProseMirror-gapcursor {
288
+ display: none;
289
+ pointer-events: none;
290
+ position: absolute;
291
+ }
292
+
293
+ .ProseMirror-gapcursor:after {
294
+ content: '';
295
+ display: block;
296
+ position: absolute;
297
+ top: -2px;
298
+ width: 20px;
299
+ border-top: 1px solid black;
300
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
301
+ }
302
+
303
+ @keyframes ProseMirror-cursor-blink {
304
+ to {
305
+ visibility: hidden;
306
+ }
307
+ }
308
+
309
+ .ProseMirror-focused .ProseMirror-gapcursor {
310
+ display: block;
311
+ }
312
+
313
+ .ProseMirror ul,
314
+ .ProseMirror ol {
315
+ padding-inline-start: 30px;
316
+ list-style-position: initial;
317
+ }
318
+
319
+ .ProseMirror blockquote {
320
+ padding-inline-start: 1em;
321
+ border-inline-start: 3px solid var(--color-grey-100);
322
+ margin-inline-start: 0;
323
+ margin-inline-end: 0;
324
+ }
325
+
326
+ .ProseMirror-prompt {
327
+ background: white;
328
+ padding: 5px 10px 5px 15px;
329
+ border: 1px solid silver;
330
+ position: fixed;
331
+ border-radius: 3px;
332
+ z-index: 11;
333
+ box-shadow: -0.5px 2px 5px rgba(0, 0, 0, 0.2);
334
+ }
335
+
336
+ .ProseMirror-prompt h5 {
337
+ margin: 0;
338
+ font-weight: normal;
339
+ font-size: 100%;
340
+ color: var(--color-grey-500);
341
+ }
342
+
343
+ .ProseMirror-prompt input[type='text'],
344
+ .ProseMirror-prompt textarea {
345
+ background: var(--color-component-bg-100);
346
+ border: none;
347
+ outline: none;
348
+ }
349
+
350
+ .ProseMirror-prompt input[type='text'] {
351
+ padding: 0 4px;
352
+ }
353
+
354
+ .ProseMirror-prompt-close {
355
+ position: absolute;
356
+ left: 2px;
357
+ top: 1px;
358
+ color: var(--color-grey-400);
359
+ border: none;
360
+ background: transparent;
361
+ padding: 0;
362
+ }
363
+
364
+ .ProseMirror-prompt-close:after {
365
+ content: '✕';
366
+ font-size: 12px;
367
+ }
368
+
369
+ .ProseMirror-invalid {
370
+ background: var(--color-warning-200);
371
+ border: 1px solid var(--color-warning-300);
372
+ border-radius: 4px;
373
+ padding: 5px 10px;
374
+ position: absolute;
375
+ min-width: 10em;
376
+ }
377
+
378
+ .ProseMirror-prompt-buttons {
379
+ margin-top: 5px;
380
+ display: none;
381
+ }
382
+
383
+ #editor,
384
+ .editor {
385
+ background: var(--color-form-input-bg);
386
+ color: black;
387
+ background-clip: padding-box;
388
+ border-radius: 4px;
389
+ border: 2px solid rgba(0, 0, 0, 0.2);
390
+ padding: 5px 0;
391
+ margin-bottom: 23px;
392
+ }
393
+
394
+ .ProseMirror p:first-child,
395
+ .ProseMirror h1:first-child,
396
+ .ProseMirror h2:first-child,
397
+ .ProseMirror h3:first-child,
398
+ .ProseMirror h4:first-child,
399
+ .ProseMirror h5:first-child,
400
+ .ProseMirror h6:first-child {
401
+ margin-top: 10px;
402
+ }
403
+
404
+ .ProseMirror {
405
+ padding: 4px 8px 4px 14px;
406
+ line-height: 1.2;
407
+ outline: none;
408
+ }
409
+
410
+ .ProseMirror p {
411
+ margin-bottom: 0.5rem;
412
+ color: var(--color-text-100) !important;
413
+ }
414
+
415
+ .ProseMirror .tableWrapper {
416
+ td,
417
+ th {
418
+ border: 1px solid var(--color-grey-300);
419
+ padding: 3px 6px;
420
+ }
421
+
422
+ td p,
423
+ th p {
424
+ margin-top: 0;
425
+ }
426
+
427
+ th,
428
+ th p {
429
+ font-weight: bold;
430
+ }
431
+ }
432
+
433
+ .ProseMirror table {
434
+ border-collapse: collapse;
435
+ table-layout: fixed;
436
+ width: 100%;
437
+ overflow: hidden;
438
+ }
439
+
440
+ .ProseMirror td,
441
+ .ProseMirror th {
442
+ vertical-align: top;
443
+ box-sizing: border-box;
444
+ position: relative;
445
+ }
446
+
447
+ .ProseMirror .column-resize-handle {
448
+ position: absolute;
449
+ right: -2px;
450
+ top: 0;
451
+ bottom: 0;
452
+ width: 4px;
453
+ z-index: 20;
454
+ background-color: #adf;
455
+ pointer-events: none;
456
+ }
457
+
458
+ .ProseMirror.resize-cursor {
459
+ cursor: ew-resize;
460
+ cursor: col-resize;
461
+ }
462
+
463
+ /* Give selected cells a blue overlay */
464
+ .ProseMirror .selectedCell:after {
465
+ z-index: 2;
466
+ position: absolute;
467
+ content: '';
468
+ left: 0;
469
+ right: 0;
470
+ top: 0;
471
+ bottom: 0;
472
+ background: #afdaf355;
473
+ pointer-events: none;
474
+ }
475
+
476
+
477
+ .menu-separator {
478
+ border-bottom: 1px solid var(--color-grey-400);
479
+ height: 0;
480
+ margin: 6px 0;
481
+ pointer-events: none;
482
+ }
483
+
484
+ .menu-item-with-icon {
485
+ display: flex;
486
+ align-items: center;
487
+
488
+ clr-icon,
489
+ .custom-icon {
490
+ margin-inline-end: 4px;
491
+ color: var(--color-text-200);
492
+ }
493
+
494
+ .hr-icon {
495
+ width: 13px;
496
+ height: 8px;
497
+ border-bottom: 2px solid var(--color-text-100);
498
+ margin: -8px 5px 0 2px;
499
+ }
500
+
501
+ .h-icon {
502
+ width: 16px;
503
+ text-align: center;
504
+ font-weight: bold;
505
+ font-size: 12px;
506
+ }
507
+ }
508
+
509
+ .context-menu {
510
+ position: fixed;
511
+ }
@@ -11,6 +11,8 @@
11
11
  @import "fonts";
12
12
  @import "global/global";
13
13
 
14
+ @import "component/prosemirror";
15
+
14
16
  @import 'theme/default';
15
17
  @import 'theme/dark';
16
18