vanilla-jui 1.7.1 → 1.7.3
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/dist/index.d.ts +39 -20
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/accordion.ts +6 -12
- package/src/components/flow.ts +17 -26
- package/src/components/form.ts +11 -28
- package/src/components/menu.ts +7 -13
- package/src/components/modal.ts +40 -26
- package/src/components/offcanvas.ts +6 -12
- package/src/components/pagination.ts +10 -24
- package/src/components/swiper.ts +7 -13
- package/src/components/tabs.ts +6 -12
- package/src/components/toc.ts +5 -8
- package/src/css/editor.css +98 -16
- package/src/css/form.css +33 -36
- package/src/css/themes/default/editor.css +1 -4
- package/src/css/themes/default/form.css +23 -8
- package/src/css/themes/default/menu.css +1 -1
- package/src/css/themes/default/tip.css +3 -4
- package/src/css/themes/default/toolbar.css +10 -5
- package/src/css/tip.css +6 -5
- package/src/css/toolbar.css +0 -5
- package/src/index.ts +4 -1
- package/src/primitives/drop.ts +5 -8
- package/src/primitives/parabola.ts +6 -12
- package/src/primitives/popup.ts +3 -3
- package/src/primitives/sticky.ts +3 -3
- package/src/primitives/theme.ts +29 -14
- package/src/primitives/toast.ts +17 -12
- package/src/primitives/tooltip.ts +5 -19
- package/src/utilities/config.ts +158 -0
- package/src/utilities/id.ts +109 -108
- package/src/utilities/merge.ts +97 -0
- package/src/utilities/types.ts +3 -82
- package/src/utilities/validator.ts +6 -17
package/src/css/editor.css
CHANGED
|
@@ -48,9 +48,16 @@
|
|
|
48
48
|
.j-editor h5,
|
|
49
49
|
.j-editor h6 {
|
|
50
50
|
outline: none;
|
|
51
|
-
font-weight: 600;
|
|
52
51
|
position: relative;
|
|
52
|
+
font-weight: 600;
|
|
53
53
|
color: var(--editor-heading-fg);
|
|
54
|
+
margin-bottom: var(--editor-block-space);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.j-editor h2,
|
|
58
|
+
.j-editor h3,
|
|
59
|
+
.j-editor h4 {
|
|
60
|
+
line-height: 1.33333;
|
|
54
61
|
}
|
|
55
62
|
|
|
56
63
|
.j-editor h1 {
|
|
@@ -63,40 +70,33 @@
|
|
|
63
70
|
.j-editor h2 {
|
|
64
71
|
font-size: 1.5em;
|
|
65
72
|
letter-spacing: -0.02em;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
line-height: 1.33333;
|
|
70
|
-
border-top: 1px solid var(--editor-border-subtle);
|
|
73
|
+
margin-top: 2.25rem;
|
|
74
|
+
/* padding-top: 1.5rem; */
|
|
75
|
+
/* border-top: 1px solid var(--editor-border-subtle); */
|
|
71
76
|
}
|
|
72
77
|
|
|
73
78
|
.j-editor h3 {
|
|
74
79
|
font-size: 1.25em;
|
|
75
80
|
letter-spacing: -0.01em;
|
|
76
81
|
margin-top: 2rem;
|
|
77
|
-
margin-bottom: var(--editor-block-space);
|
|
78
|
-
line-height: 1.4;
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
.j-editor h4 {
|
|
82
85
|
font-size: 1.125em;
|
|
83
86
|
letter-spacing: -0.01em;
|
|
84
87
|
margin-top: 1.75rem;
|
|
85
|
-
margin-bottom: var(--editor-block-space);
|
|
86
|
-
line-height: 1.33333;
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
.j-editor h5,
|
|
90
91
|
.j-editor h6 {
|
|
91
92
|
font-size: 1em;
|
|
92
93
|
margin-top: 1.5rem;
|
|
93
|
-
|
|
94
|
-
line-height: 1.5;
|
|
94
|
+
line-height: 1.4;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
.j-editor p {
|
|
98
98
|
margin-block: var(--editor-block-space);
|
|
99
|
-
line-height: var(--editor-
|
|
99
|
+
line-height: var(--editor-line-height);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
/* ============================================
|
|
@@ -426,6 +426,10 @@
|
|
|
426
426
|
display: none;
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
+
.code-block .code-header select:focus-visible {
|
|
430
|
+
outline: 0;
|
|
431
|
+
}
|
|
432
|
+
|
|
429
433
|
.j-editor pre code[class*='language-'] {
|
|
430
434
|
display: block;
|
|
431
435
|
padding: 1.25em 1.5em;
|
|
@@ -672,16 +676,29 @@
|
|
|
672
676
|
|
|
673
677
|
.j-editor progress {
|
|
674
678
|
max-width: 100%;
|
|
675
|
-
height: 0.5em;
|
|
676
|
-
margin: 0.5em 0;
|
|
677
679
|
border-radius: 9999px;
|
|
678
680
|
overflow: hidden;
|
|
681
|
+
height: 0.625em;
|
|
682
|
+
margin-block: 0.25em;
|
|
679
683
|
}
|
|
680
684
|
|
|
681
685
|
.j-editor meter {
|
|
682
686
|
max-width: 100%;
|
|
683
687
|
height: 1em;
|
|
684
|
-
margin: 0.
|
|
688
|
+
margin-block: 0.125em;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
.j-editor progress::-webkit-progress-value,
|
|
692
|
+
.j-editor meter::-webkit-meter-optimum-value {
|
|
693
|
+
background-color: var(--tone-solid);
|
|
694
|
+
border-radius: 9999px;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.j-editor progress::-webkit-progress-bar,
|
|
698
|
+
.j-editor meter::-webkit-meter-bar {
|
|
699
|
+
background-color: var(--tone-border);
|
|
700
|
+
border: none;
|
|
701
|
+
border-radius: 9999px;
|
|
685
702
|
}
|
|
686
703
|
|
|
687
704
|
/* ============================================
|
|
@@ -723,4 +740,69 @@
|
|
|
723
740
|
scrollbar-color: var(--ui-border) transparent;
|
|
724
741
|
display: block;
|
|
725
742
|
}
|
|
743
|
+
|
|
744
|
+
/* ============================================
|
|
745
|
+
* tasklist
|
|
746
|
+
* ========================================= */
|
|
747
|
+
.j-editor ul[data-type='taskList'] {
|
|
748
|
+
list-style: none;
|
|
749
|
+
padding: 0;
|
|
750
|
+
margin: 0;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
.j-editor ul[data-type='taskList'] li {
|
|
754
|
+
display: flex;
|
|
755
|
+
align-items: center;
|
|
756
|
+
gap: 0.25rem;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
.j-editor ul[data-type='taskList'] li label,
|
|
760
|
+
.j-editor ul[data-type='taskList'] li div {
|
|
761
|
+
display: flex;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.j-editor ul[data-type='taskList'] li > label {
|
|
765
|
+
flex: none;
|
|
766
|
+
-webkit-user-select: none;
|
|
767
|
+
-moz-user-select: none;
|
|
768
|
+
-ms-user-select: none;
|
|
769
|
+
user-select: none;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
.j-editor ul[data-type='taskList'] li div {
|
|
773
|
+
flex: auto;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
.j-editor ul[data-type='taskList'] li div p {
|
|
777
|
+
line-height: 1.5;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
.j-editor input[type='checkbox'] {
|
|
781
|
+
border: 1px solid var(--ui-border);
|
|
782
|
+
border-radius: var(--radius-sm);
|
|
783
|
+
background: var(--ui-bg);
|
|
784
|
+
clear: none;
|
|
785
|
+
cursor: pointer;
|
|
786
|
+
display: inline-block;
|
|
787
|
+
width: 1rem;
|
|
788
|
+
height: 1rem;
|
|
789
|
+
margin: 0;
|
|
790
|
+
-webkit-appearance: none;
|
|
791
|
+
-moz-appearance: none;
|
|
792
|
+
appearance: none;
|
|
793
|
+
transition: all 0.05s ease-in-out;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
.j-editor input[type='checkbox']:checked {
|
|
797
|
+
background: var(--tone-solid);
|
|
798
|
+
border-color: var(--tone-solid);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
.j-editor input[type='checkbox']:checked:before {
|
|
802
|
+
content: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%23ffffff%27%2F%3E%3C%2Fsvg%3E');
|
|
803
|
+
display: inline-block;
|
|
804
|
+
margin: -0.1875rem 0 0 -0.25rem;
|
|
805
|
+
width: 1.3125rem;
|
|
806
|
+
height: 1.3125rem;
|
|
807
|
+
}
|
|
726
808
|
}
|
package/src/css/form.css
CHANGED
|
@@ -127,7 +127,6 @@
|
|
|
127
127
|
border-inline-end-width: 1px;
|
|
128
128
|
border-radius: 0;
|
|
129
129
|
border-color: var(--ui-border);
|
|
130
|
-
/* background-color: var(--ui-surface-subtle); */
|
|
131
130
|
background-color: transparent;
|
|
132
131
|
margin: calc(var(--space) * -2);
|
|
133
132
|
font-size: var(--input-font-size);
|
|
@@ -153,6 +152,7 @@
|
|
|
153
152
|
border-right-color: transparent;
|
|
154
153
|
padding-left: 0;
|
|
155
154
|
padding-right: 0;
|
|
155
|
+
border-radius: 0;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
.j-input.is-ghost:not([type='checkbox']) {
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
.j-radio label {
|
|
192
192
|
display: flex;
|
|
193
193
|
align-items: center;
|
|
194
|
-
gap:
|
|
194
|
+
gap: calc(var(--space)*1.5);
|
|
195
195
|
font-size: var(--font-size-md);
|
|
196
196
|
padding: calc(var(--space)*2);
|
|
197
197
|
border-radius: var(--radius-md);
|
|
@@ -320,7 +320,7 @@
|
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
.j-radio.is-group.is-sm label span.radio-text {
|
|
323
|
-
--radio-group-padding: var(--space) var(--
|
|
323
|
+
--radio-group-padding: var(--space) calc(var(--space) * 2.5);
|
|
324
324
|
height: var(--el-height-sm);
|
|
325
325
|
}
|
|
326
326
|
|
|
@@ -329,7 +329,7 @@
|
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
.j-radio.is-group.is-lg label span.radio-text {
|
|
332
|
-
--radio-group-padding: var(--s3) var(--
|
|
332
|
+
--radio-group-padding: var(--s3) calc(var(--space) * 3.5);
|
|
333
333
|
height: var(--el-height-lg);
|
|
334
334
|
}
|
|
335
335
|
|
|
@@ -442,7 +442,6 @@
|
|
|
442
442
|
position: absolute;
|
|
443
443
|
border-radius: 50%;
|
|
444
444
|
background-color: #fff;
|
|
445
|
-
/* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); */
|
|
446
445
|
transition: all 0.3s ease;
|
|
447
446
|
}
|
|
448
447
|
|
|
@@ -545,7 +544,7 @@
|
|
|
545
544
|
|
|
546
545
|
/* input group */
|
|
547
546
|
.input-group {
|
|
548
|
-
display: flex;
|
|
547
|
+
/* display: flex; */
|
|
549
548
|
align-items: stretch;
|
|
550
549
|
}
|
|
551
550
|
|
|
@@ -556,16 +555,9 @@
|
|
|
556
555
|
min-width: 0;
|
|
557
556
|
}
|
|
558
557
|
|
|
559
|
-
.input-group
|
|
560
|
-
display: flex;
|
|
561
|
-
align-items: center;
|
|
562
|
-
white-space: nowrap;
|
|
558
|
+
.input-group .el-addon .is-text {
|
|
563
559
|
border-width: 1px;
|
|
564
560
|
border-style: solid;
|
|
565
|
-
-webkit-user-select: none;
|
|
566
|
-
-moz-user-select: none;
|
|
567
|
-
-ms-user-select: none;
|
|
568
|
-
user-select: none;
|
|
569
561
|
}
|
|
570
562
|
|
|
571
563
|
/* input inner group */
|
|
@@ -573,37 +565,25 @@
|
|
|
573
565
|
.input-inner-group {
|
|
574
566
|
position: relative;
|
|
575
567
|
width: 100%;
|
|
568
|
+
display: flex;
|
|
569
|
+
flex-wrap: nowrap;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
.input-inner-group {
|
|
573
|
+
border: 1px solid var(--ui-border);
|
|
574
|
+
border-radius: var(--radius-md);
|
|
576
575
|
}
|
|
577
576
|
|
|
578
|
-
.input-inner-group input.j-input
|
|
577
|
+
.input-inner-group input.j-input,
|
|
578
|
+
.input-inner-group select.j-select {
|
|
579
579
|
width: 100%;
|
|
580
580
|
letter-spacing: 0.4px;
|
|
581
581
|
}
|
|
582
582
|
|
|
583
583
|
.input-inner-group .el-addon {
|
|
584
|
-
position: absolute;
|
|
585
|
-
top: 0;
|
|
586
|
-
bottom: 0;
|
|
587
|
-
left: 0;
|
|
588
584
|
display: flex;
|
|
589
585
|
align-items: center;
|
|
590
586
|
justify-content: center;
|
|
591
|
-
min-width: var(--el-height-md);
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
.input-inner-group .el-addon:last-child {
|
|
595
|
-
right: 0;
|
|
596
|
-
left: auto;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
.input-inner-group
|
|
600
|
-
.el-addon:first-child.inner-wrap:has(.j-button:not(.is-icon)) {
|
|
601
|
-
left: var(--space);
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
.input-inner-group
|
|
605
|
-
.el-addon:last-child.inner-wrap:has(.j-button:not(.is-icon)) {
|
|
606
|
-
right: var(--space);
|
|
607
587
|
}
|
|
608
588
|
|
|
609
589
|
.input-inner-group .el-addon svg {
|
|
@@ -611,9 +591,20 @@
|
|
|
611
591
|
height: var(--font-size-xl);
|
|
612
592
|
}
|
|
613
593
|
|
|
614
|
-
.input-
|
|
594
|
+
.input-group .el-addon .is-text,
|
|
595
|
+
.input-inner-group .el-addon.is-text {
|
|
615
596
|
display: flex;
|
|
597
|
+
align-items: center;
|
|
598
|
+
padding-inline: var(--s2);
|
|
599
|
+
-webkit-user-select: none;
|
|
600
|
+
-moz-user-select: none;
|
|
601
|
+
-ms-user-select: none;
|
|
602
|
+
user-select: none;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.input-inner-group .el-addon.inner-wrap {
|
|
616
606
|
gap: var(--space);
|
|
607
|
+
padding-inline: var(--space);
|
|
617
608
|
}
|
|
618
609
|
|
|
619
610
|
/* status active */
|
|
@@ -653,6 +644,12 @@
|
|
|
653
644
|
outline-offset: 1px;
|
|
654
645
|
}
|
|
655
646
|
|
|
647
|
+
.input-inner-group input.j-input,
|
|
648
|
+
.input-inner-group select.j-select {
|
|
649
|
+
border: 0;
|
|
650
|
+
box-shadow: none;
|
|
651
|
+
}
|
|
652
|
+
|
|
656
653
|
/* status readonly */
|
|
657
654
|
.j-input:not([type='file']):not(.is-line):not(.is-blank)[readonly],
|
|
658
655
|
.j-textarea[readonly] {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
.j-editor {
|
|
12
12
|
--editor-font-size: var(--font-size-lg);
|
|
13
|
-
--editor-
|
|
13
|
+
--editor-line-height: 1.75;
|
|
14
14
|
--editor-word-space: 0.02em;
|
|
15
15
|
--editor-letter-space: 0.01em;
|
|
16
16
|
--editor-block-space: 1.25rem;
|
|
@@ -36,18 +36,15 @@
|
|
|
36
36
|
|
|
37
37
|
.j-editor.is-sm {
|
|
38
38
|
--editor-font-size: var(--font-size-md);
|
|
39
|
-
--editor-p-line-height: 1.75;
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
.j-editor.is-lg {
|
|
43
42
|
--editor-font-size: var(--font-size-xl);
|
|
44
|
-
--editor-p-line-height: 1.8;
|
|
45
43
|
--editor-block-space: 1.5rem;
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
.j-editor.is-xl {
|
|
49
47
|
--editor-font-size: var(--font-size-2xl);
|
|
50
|
-
--editor-p-line-height: 1.8;
|
|
51
48
|
--editor-block-space: 1.5rem;
|
|
52
49
|
}
|
|
53
50
|
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
.j-input[type='month'],
|
|
53
53
|
.j-input[type='file'],
|
|
54
54
|
.j-input[type='color'] {
|
|
55
|
-
/* --input-font-size: var(--font-size-sm); */
|
|
56
55
|
--input-fg: var(--ui-fg-muted);
|
|
57
56
|
}
|
|
58
57
|
|
|
@@ -83,17 +82,16 @@
|
|
|
83
82
|
--input-font-size: var(--font-size-lg);
|
|
84
83
|
}
|
|
85
84
|
|
|
86
|
-
.input-group .
|
|
85
|
+
.input-group .j-button {
|
|
87
86
|
--btn-border-color: var(--ui-border);
|
|
88
87
|
--btn-fg: var(--ui-fg-muted);
|
|
89
88
|
--btn-bg: var(--ui-bg-muted);
|
|
90
89
|
--btn-padding: 0 var(--s2);
|
|
91
|
-
--btn-box-shadow: none;
|
|
90
|
+
/* --btn-box-shadow: none; */
|
|
92
91
|
}
|
|
93
92
|
|
|
94
93
|
.input-group .el-addon .is-text {
|
|
95
94
|
font-size: var(--font-size-md);
|
|
96
|
-
line-height: var(--line-height);
|
|
97
95
|
color: var(--ui-fg-muted);
|
|
98
96
|
background-color: var(--ui-bg-muted);
|
|
99
97
|
padding: var(--s2);
|
|
@@ -140,18 +138,35 @@
|
|
|
140
138
|
--btn-box-shadow: none;
|
|
141
139
|
}
|
|
142
140
|
|
|
143
|
-
.input-inner-group
|
|
144
|
-
padding-
|
|
141
|
+
.input-inner-group .el-addon + .j-input {
|
|
142
|
+
padding-inline: var(--space);
|
|
145
143
|
}
|
|
146
144
|
|
|
147
|
-
.input-inner-group
|
|
148
|
-
padding-
|
|
145
|
+
.input-inner-group .el-addon + .j-select {
|
|
146
|
+
-webkit-padding-start: 2px;
|
|
147
|
+
padding-inline-start: 2px;
|
|
149
148
|
}
|
|
150
149
|
|
|
151
150
|
.input-inner-group .el-addon {
|
|
152
151
|
color: var(--ui-fg-muted);
|
|
153
152
|
}
|
|
154
153
|
|
|
154
|
+
.input-inner-group .el-addon .j-button:not(.is-icon) {
|
|
155
|
+
--btn-height: var(--el-height-sm);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.input-inner-group .el-addon .j-button.is-xs:not(.is-icon),
|
|
159
|
+
.input-inner-group .el-addon .j-button.is-sm:not(.is-icon) {
|
|
160
|
+
height: inherit;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.input-group .j-button:active,
|
|
164
|
+
.input-inner-group:has(input:focus),
|
|
165
|
+
.input-inner-group:has(select:focus) {
|
|
166
|
+
border-color: var(--tone-solid);
|
|
167
|
+
box-shadow: 0 0 0 4px var(--tone-ring);
|
|
168
|
+
}
|
|
169
|
+
|
|
155
170
|
.mobile .j-input[type='file']::file-selector-button {
|
|
156
171
|
padding: var(--s3);
|
|
157
172
|
margin: calc(var(--space) * -1.7);
|
|
@@ -30,14 +30,13 @@
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.j-tip .tip-title {
|
|
33
|
-
line-height: var(--line-height-paragraph);
|
|
33
|
+
/* line-height: var(--line-height-paragraph); */
|
|
34
34
|
font-weight: var(--font-medium);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.j-tip .tip-content {
|
|
38
|
-
gap: var(--s2);
|
|
37
|
+
/* .j-tip .tip-content {
|
|
39
38
|
line-height: var(--line-height-paragraph);
|
|
40
|
-
}
|
|
39
|
+
} */
|
|
41
40
|
|
|
42
41
|
.j-tip.is-success {
|
|
43
42
|
--tip-border-color: var(--state-success);
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
align-self: center;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.heading-drop-menu,
|
|
27
|
+
/* .heading-drop-menu,
|
|
28
28
|
.editor-size-menu,
|
|
29
29
|
.color-drop-menu,
|
|
30
30
|
.editor-drop-heading,
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
border: 1px solid var(--ui-border);
|
|
36
36
|
border-radius: var(--radius-sm);
|
|
37
37
|
font-size: var(--font-size-md);
|
|
38
|
-
}
|
|
38
|
+
} */
|
|
39
39
|
|
|
40
|
-
.editor-drop-color {
|
|
40
|
+
/* .editor-drop-color {
|
|
41
41
|
padding: var(--space);
|
|
42
|
-
}
|
|
42
|
+
} */
|
|
43
43
|
|
|
44
44
|
.editor-drop-color .color-panel {
|
|
45
|
-
padding:
|
|
45
|
+
padding: var(--space);
|
|
46
46
|
gap: 0.5rem;
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -56,6 +56,11 @@
|
|
|
56
56
|
border: 1px solid var(--ui-border);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
.editor-drop-color .color-panel .color-btn:last-of-type {
|
|
60
|
+
grid-column: span 5;
|
|
61
|
+
width: auto;
|
|
62
|
+
}
|
|
63
|
+
|
|
59
64
|
.editor-drop-color .color-panel button.color-btn.color-btn-clear::after {
|
|
60
65
|
content: '🚫';
|
|
61
66
|
height: 30px;
|
package/src/css/tip.css
CHANGED
|
@@ -29,12 +29,13 @@
|
|
|
29
29
|
|
|
30
30
|
.j-tip .tip-content {
|
|
31
31
|
grid-column-start: 2;
|
|
32
|
-
display: grid;
|
|
33
|
-
justify-items: start;
|
|
34
|
-
margin: 0;
|
|
35
32
|
}
|
|
36
33
|
|
|
37
|
-
.j-tip .tip-content >
|
|
38
|
-
margin: 0;
|
|
34
|
+
.j-tip .tip-content > *:first-child {
|
|
35
|
+
margin-top: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.j-tip .tip-content > *:last-child {
|
|
39
|
+
margin-bottom: 0;
|
|
39
40
|
}
|
|
40
41
|
}
|
package/src/css/toolbar.css
CHANGED
package/src/index.ts
CHANGED
|
@@ -7,10 +7,13 @@ export * from './utilities/id.ts';
|
|
|
7
7
|
export * from './utilities/dom.ts';
|
|
8
8
|
export * from './utilities/events.ts';
|
|
9
9
|
export * from './utilities/http.ts';
|
|
10
|
-
export
|
|
10
|
+
// do not export any function from locale.ts
|
|
11
|
+
// export * from './utilities/locale.ts';
|
|
11
12
|
export * from './utilities/object.ts';
|
|
12
13
|
export * from './utilities/timer.ts';
|
|
13
14
|
export * from './utilities/types.ts';
|
|
15
|
+
export * from './utilities/merge.ts';
|
|
16
|
+
export * from './utilities/config.ts';
|
|
14
17
|
export * from './utilities/state.ts';
|
|
15
18
|
export * from './utilities/refs.ts';
|
|
16
19
|
export * from './utilities/validator.ts';
|
package/src/primitives/drop.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from '../utilities/dom.ts';
|
|
9
9
|
import { createEventManager } from '../utilities/events.ts';
|
|
10
10
|
import { randomId } from '../utilities/id.ts';
|
|
11
|
-
import { type
|
|
11
|
+
import { type ConfigSchema, resolveConfig } from '../utilities/config.ts';
|
|
12
12
|
import { createLoading } from './loading.ts';
|
|
13
13
|
|
|
14
14
|
type DropMode = 'hover' | 'click';
|
|
@@ -144,11 +144,8 @@ const DROP_PROPS_SCHEMA = {
|
|
|
144
144
|
},
|
|
145
145
|
className: {
|
|
146
146
|
default: DEFAULT_CLASS_NAMES,
|
|
147
|
-
type: '
|
|
148
|
-
|
|
149
|
-
...DEFAULT_CLASS_NAMES,
|
|
150
|
-
...(value && typeof value === 'object' ? value : {}),
|
|
151
|
-
}),
|
|
147
|
+
type: 'plainObject',
|
|
148
|
+
merge: 'shallow',
|
|
152
149
|
},
|
|
153
150
|
id: {
|
|
154
151
|
default: null,
|
|
@@ -166,10 +163,10 @@ const DROP_PROPS_SCHEMA = {
|
|
|
166
163
|
hoverIntent: { default: true, type: 'boolean' },
|
|
167
164
|
onShown: { default: null, types: ['function', 'null'] },
|
|
168
165
|
onHidden: { default: null, types: ['function', 'null'] },
|
|
169
|
-
} satisfies
|
|
166
|
+
} satisfies ConfigSchema<DropProps>;
|
|
170
167
|
|
|
171
168
|
function normalizeProps(input: DropProps): ResolvedDropProps {
|
|
172
|
-
const props =
|
|
169
|
+
const props = resolveConfig(input, DROP_PROPS_SCHEMA, 'Drop');
|
|
173
170
|
return {
|
|
174
171
|
name: props.name as string | null,
|
|
175
172
|
mode: props.mode as DropMode,
|
|
@@ -3,7 +3,7 @@ import { insert, jsx } from 'vanilla-signal';
|
|
|
3
3
|
import { type DOMReference, resolveElement } from '../utilities/dom.ts';
|
|
4
4
|
import { randomId } from '../utilities/id.ts';
|
|
5
5
|
import { timer } from '../utilities/timer.ts';
|
|
6
|
-
import { type
|
|
6
|
+
import { type ConfigSchema, resolveConfig } from '../utilities/config.ts';
|
|
7
7
|
|
|
8
8
|
type ParabolaDirection =
|
|
9
9
|
| 'center'
|
|
@@ -81,10 +81,7 @@ const PARABOLA_PROPS_SCHEMA = {
|
|
|
81
81
|
ball: {
|
|
82
82
|
default: DEFAULT_BALL,
|
|
83
83
|
type: 'plainObject',
|
|
84
|
-
|
|
85
|
-
...DEFAULT_BALL,
|
|
86
|
-
...(value && typeof value === 'object' ? value : {}),
|
|
87
|
-
}),
|
|
84
|
+
merge: 'shallow',
|
|
88
85
|
shape: {
|
|
89
86
|
color: 'string',
|
|
90
87
|
size: 'string',
|
|
@@ -92,11 +89,8 @@ const PARABOLA_PROPS_SCHEMA = {
|
|
|
92
89
|
},
|
|
93
90
|
className: {
|
|
94
91
|
default: DEFAULT_CLASS_NAMES,
|
|
95
|
-
type: '
|
|
96
|
-
|
|
97
|
-
...DEFAULT_CLASS_NAMES,
|
|
98
|
-
...(value && typeof value === 'object' ? value : {}),
|
|
99
|
-
}),
|
|
92
|
+
type: 'plainObject',
|
|
93
|
+
merge: 'shallow',
|
|
100
94
|
},
|
|
101
95
|
from: { default: null, ...ELEMENT_REF_RULE },
|
|
102
96
|
to: { default: null, ...ELEMENT_REF_RULE },
|
|
@@ -108,10 +102,10 @@ const PARABOLA_PROPS_SCHEMA = {
|
|
|
108
102
|
showDelay: { default: 0, type: 'number' },
|
|
109
103
|
onShow: { default: null, types: ['function', 'null'] },
|
|
110
104
|
onHidden: { default: null, types: ['function', 'null'] },
|
|
111
|
-
} satisfies
|
|
105
|
+
} satisfies ConfigSchema<ParabolaProps>;
|
|
112
106
|
|
|
113
107
|
function normalizeProps(input: ParabolaProps): ResolvedParabolaProps {
|
|
114
|
-
const props =
|
|
108
|
+
const props = resolveConfig(input, PARABOLA_PROPS_SCHEMA, 'Parabola.props');
|
|
115
109
|
return {
|
|
116
110
|
ball: props.ball as ParabolaBallProps,
|
|
117
111
|
className: props.className as ParabolaClassNames,
|
package/src/primitives/popup.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ElementProps, jsx } from 'vanilla-signal';
|
|
2
2
|
|
|
3
3
|
import { asRenderable, type RenderableContent } from '../utilities/dom.ts';
|
|
4
|
-
import { type
|
|
4
|
+
import { type ConfigSchema, resolveConfig } from '../utilities/config.ts';
|
|
5
5
|
|
|
6
6
|
export interface PopupProps extends Record<string, unknown> {
|
|
7
7
|
className?: string;
|
|
@@ -28,10 +28,10 @@ const POPUP_PROPS_SCHEMA = {
|
|
|
28
28
|
default: '',
|
|
29
29
|
type: 'renderable',
|
|
30
30
|
},
|
|
31
|
-
} satisfies
|
|
31
|
+
} satisfies ConfigSchema<PopupProps>;
|
|
32
32
|
|
|
33
33
|
function normalizeProps(input: PopupProps): ResolvedPopupProps {
|
|
34
|
-
const props =
|
|
34
|
+
const props = resolveConfig(input, POPUP_PROPS_SCHEMA, 'Popup');
|
|
35
35
|
|
|
36
36
|
return {
|
|
37
37
|
className: props.className as string,
|
package/src/primitives/sticky.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createDeepStore, flushSync } from 'vanilla-signal';
|
|
2
2
|
import { randomId } from '../utilities/id.ts';
|
|
3
3
|
import { type DOMReference, all, requireContainer } from '../utilities/dom.ts';
|
|
4
|
-
import { type
|
|
4
|
+
import { type ConfigSchema, resolveConfig } from '../utilities/config.ts';
|
|
5
5
|
|
|
6
6
|
type StickyOverflow = 'destroy' | 'ignore';
|
|
7
7
|
|
|
@@ -91,10 +91,10 @@ const STICKY_PROPS_SCHEMA = {
|
|
|
91
91
|
},
|
|
92
92
|
reactive: { default: false, type: 'boolean' },
|
|
93
93
|
onReBuild: { default: null, types: ['function', 'null'] },
|
|
94
|
-
} satisfies
|
|
94
|
+
} satisfies ConfigSchema<StickyProps>;
|
|
95
95
|
|
|
96
96
|
function normalizeProps(input: StickyProps): ResolvedStickyProps {
|
|
97
|
-
const props =
|
|
97
|
+
const props = resolveConfig(input, STICKY_PROPS_SCHEMA, 'Sticky.props');
|
|
98
98
|
return {
|
|
99
99
|
target: props.target as DOMReference,
|
|
100
100
|
parent: props.parent as DOMReference,
|