@zuilib/text-editor 0.1.0 → 0.2.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.
package/dist/styles.css CHANGED
@@ -5,12 +5,153 @@
5
5
  overflow-y: auto;
6
6
  }
7
7
 
8
+ .zui-text-editor-body {
9
+ display: flex;
10
+ align-items: stretch;
11
+ min-height: 100%;
12
+ }
13
+
14
+ .zui-text-editor-main {
15
+ position: relative;
16
+ display: flex;
17
+ flex-direction: column;
18
+ flex: 1;
19
+ min-width: 0;
20
+ }
21
+
8
22
  .zui-text-editor-content {
23
+ flex: 1;
9
24
  min-height: 100%;
10
25
  padding: 1.5rem 2rem;
11
26
  outline: none;
12
27
  }
13
28
 
29
+ /* Outline (table of contents) sidebar */
30
+ .zui-text-editor-outline {
31
+ position: sticky;
32
+ top: 0.75rem;
33
+ align-self: flex-start;
34
+ flex-shrink: 0;
35
+ width: 220px;
36
+ max-height: min(70vh, 100%);
37
+ padding: 0.5rem 0.75rem 0.75rem 0.5rem;
38
+ overflow-y: auto;
39
+ }
40
+
41
+ .zui-text-editor:has(.zui-text-editor-toolbar) .zui-text-editor-outline {
42
+ top: 3.25rem;
43
+ }
44
+
45
+ .zui-text-editor-outline.is-collapsed {
46
+ width: auto;
47
+ }
48
+
49
+ .zui-text-editor-outline-toggle {
50
+ display: inline-flex;
51
+ align-items: center;
52
+ justify-content: center;
53
+ width: 1.5rem;
54
+ height: 1.5rem;
55
+ margin-bottom: 0.25rem;
56
+ border: none;
57
+ border-radius: 0.375rem;
58
+ background: transparent;
59
+ color: inherit;
60
+ opacity: 0.55;
61
+ cursor: pointer;
62
+ }
63
+
64
+ .zui-text-editor-outline-toggle:hover {
65
+ opacity: 1;
66
+ background: color-mix(in srgb, currentColor 8%, transparent);
67
+ }
68
+
69
+ .zui-text-editor-outline-list {
70
+ display: flex;
71
+ flex-direction: column;
72
+ gap: 1px;
73
+ border-left: 1px solid color-mix(in srgb, currentColor 12%, transparent);
74
+ }
75
+
76
+ .zui-text-editor-outline-item {
77
+ display: block;
78
+ width: 100%;
79
+ padding: 0.2rem 0.5rem;
80
+ border: none;
81
+ background: transparent;
82
+ color: inherit;
83
+ opacity: 0.6;
84
+ font-size: 0.8125rem;
85
+ line-height: 1.35;
86
+ text-align: left;
87
+ cursor: pointer;
88
+ overflow: hidden;
89
+ text-overflow: ellipsis;
90
+ white-space: nowrap;
91
+ }
92
+
93
+ .zui-text-editor-outline-item:hover {
94
+ opacity: 1;
95
+ }
96
+
97
+ .zui-text-editor-outline-item.is-active {
98
+ opacity: 1;
99
+ font-weight: 600;
100
+ box-shadow: inset 2px 0 0 #6965db;
101
+ }
102
+
103
+ .zui-text-editor-outline-empty {
104
+ padding: 0.2rem 0.5rem;
105
+ font-size: 0.8125rem;
106
+ opacity: 0.45;
107
+ }
108
+
109
+ /* Section folding */
110
+ .zui-text-editor-fold-gutter {
111
+ position: absolute;
112
+ inset: 0;
113
+ pointer-events: none;
114
+ }
115
+
116
+ .zui-text-editor-fold {
117
+ position: absolute;
118
+ left: 0.45rem;
119
+ display: inline-flex;
120
+ align-items: center;
121
+ justify-content: center;
122
+ width: 1.125rem;
123
+ height: 1.125rem;
124
+ border: none;
125
+ border-radius: 0.25rem;
126
+ background: transparent;
127
+ color: inherit;
128
+ opacity: 0;
129
+ cursor: pointer;
130
+ pointer-events: auto;
131
+ transition: opacity 120ms, transform 120ms;
132
+ }
133
+
134
+ .zui-text-editor-main:hover .zui-text-editor-fold {
135
+ opacity: 0.45;
136
+ }
137
+
138
+ .zui-text-editor-fold:hover {
139
+ opacity: 1 !important;
140
+ background: color-mix(in srgb, currentColor 8%, transparent);
141
+ }
142
+
143
+ .zui-text-editor-fold.is-folded {
144
+ opacity: 0.7;
145
+ transform: rotate(-90deg);
146
+ }
147
+
148
+ /* Folded heading: trailing ellipsis affordance */
149
+ .zui-heading-folded::after {
150
+ content: ' …';
151
+ opacity: 0.4;
152
+ font-weight: 400;
153
+ }
154
+
14
155
  .zui-text-editor-placeholder {
15
156
  position: absolute;
16
157
  top: 1.5rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuilib/text-editor",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "ZUI — A markdown editor component wrapping Lexical",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",