@nine-lab/nine-ux 0.1.170 → 0.1.172
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/css/nineMenu.css
CHANGED
|
@@ -95,208 +95,228 @@
|
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
nine-side-menu-item {
|
|
98
|
+
padding: 0;
|
|
99
|
+
margin: 0;
|
|
100
|
+
position: relative;
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: unset;
|
|
103
|
+
--background-color: #333;
|
|
104
|
+
background-color: unset;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
max-height: 64px; /* 기본 높이 */
|
|
107
|
+
opacity: 1;
|
|
108
|
+
transition: max-height 0.5s ease-in-out, opacity 0.5s ease-in-out;
|
|
109
|
+
|
|
110
|
+
.menubar {
|
|
111
|
+
display: inline-block;
|
|
112
|
+
--padding-left: 16px;
|
|
113
|
+
--margin-left: 16px;
|
|
114
|
+
white-space: nowrap;
|
|
115
|
+
overflow: hidden;
|
|
116
|
+
text-overflow: ellipsis;
|
|
117
|
+
transition: height 0.5s ease-out, padding 0.5s ease-out;
|
|
118
|
+
text-align: left;
|
|
119
|
+
--width: calc(100% - 36px);
|
|
120
|
+
--margin: 0;
|
|
121
|
+
}
|
|
98
122
|
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
123
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
124
|
+
li {
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
padding: 0;
|
|
128
|
+
margin: 0;
|
|
129
|
+
position: relative;
|
|
130
|
+
color: unset;
|
|
131
|
+
font-weight: bold;
|
|
132
|
+
width: calc(100% + 36px);
|
|
133
|
+
}
|
|
112
134
|
|
|
113
135
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
136
|
+
.icon {
|
|
137
|
+
position: relative;
|
|
138
|
+
left: 0;
|
|
139
|
+
--top: 50%;
|
|
140
|
+
--transform: translateY(-50%);
|
|
141
|
+
width: 16px;
|
|
142
|
+
height: 16px;
|
|
143
|
+
background-repeat: no-repeat;
|
|
144
|
+
background-position: center center;
|
|
145
|
+
background-size: contain;
|
|
146
|
+
--margin-right: 16px;
|
|
147
|
+
transition: width 0.5s ease-out, height 0.5s ease-out;
|
|
148
|
+
margin-left: 8px;
|
|
149
|
+
}
|
|
119
150
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
151
|
+
.icon-home {
|
|
152
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="lightgray" viewBox="0 0 16 16"><path d="M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5"/></svg>');
|
|
153
|
+
}
|
|
123
154
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
155
|
+
.icon-base {
|
|
156
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" viewBox="0 0 16 16"><path d="M0 .5A.5.5 0 0 1 .5 0h15a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5H14v2h1.5a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5H14v2h1.5a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5H.5a.5.5 0 0 1-.5-.5v-3a.5.5 0 0 1 .5-.5H2v-2H.5a.5.5 0 0 1-.5-.5v-3A.5.5 0 0 1 .5 6H2V4H.5a.5.5 0 0 1-.5-.5zM3 4v2h4.5V4zm5.5 0v2H13V4zM3 10v2h4.5v-2zm5.5 0v2H13v-2zM1 1v2h3.5V1zm4.5 0v2h5V1zm6 0v2H15V1zM1 7v2h3.5V7zm4.5 0v2h5V7zm6 0v2H15V7zM1 13v2h3.5v-2zm4.5 0v2h5v-2zm6 0v2H15v-2z"/></svg>');
|
|
157
|
+
}
|
|
127
158
|
|
|
159
|
+
.menubar {
|
|
160
|
+
margin-left: 8px;
|
|
161
|
+
}
|
|
128
162
|
|
|
129
|
-
::slotted([slot="body-content"]) {
|
|
130
|
-
width: 100%;
|
|
131
|
-
padding: 0;
|
|
132
|
-
}
|
|
133
163
|
|
|
164
|
+
.expand-icon {
|
|
165
|
+
width: 8px;
|
|
166
|
+
height: 8px;
|
|
167
|
+
--border-left: 4px solid transparent;
|
|
168
|
+
--border-right: 4px solid transparent;
|
|
169
|
+
--border-top: 4px solid #ccc;
|
|
170
|
+
position: absolute;
|
|
171
|
+
right: 16px;
|
|
172
|
+
background-repeat: no-repeat;
|
|
173
|
+
background-position: center;
|
|
174
|
+
background-size: auto;
|
|
175
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" fill="white" class="bi bi-caret-down-fill" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>');
|
|
176
|
+
animation: rotate-out 0.3s ease-in-out forwards;
|
|
177
|
+
}
|
|
134
178
|
|
|
135
179
|
|
|
180
|
+
a {
|
|
181
|
+
color: #999; /* 금색 */
|
|
182
|
+
text-decoration: none; /* 밑줄 제거 */
|
|
183
|
+
}
|
|
136
184
|
|
|
185
|
+
a:hover {
|
|
186
|
+
color: #ccc; /* 주황색 */
|
|
187
|
+
text-decoration: underline; /* 호버 시 밑줄 추가 */
|
|
188
|
+
}
|
|
137
189
|
|
|
190
|
+
&.collapse:not(.hover) .expand-icon {
|
|
191
|
+
display: none;
|
|
192
|
+
}
|
|
193
|
+
&:not(.group) .expand-icon {
|
|
194
|
+
display: none;
|
|
195
|
+
}
|
|
138
196
|
|
|
197
|
+
&.group {
|
|
198
|
+
height: 48px;
|
|
199
|
+
}
|
|
200
|
+
&:not(.group) {
|
|
201
|
+
height: 32px;
|
|
202
|
+
}
|
|
139
203
|
|
|
204
|
+
&.active {
|
|
205
|
+
--background-color: #999;
|
|
206
|
+
color: #9FF2FF;
|
|
207
|
+
}
|
|
140
208
|
|
|
141
|
-
:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
display: flex;
|
|
146
|
-
align-items: unset;
|
|
147
|
-
--background-color: #333;
|
|
148
|
-
background-color: unset;
|
|
149
|
-
cursor: pointer;
|
|
150
|
-
transition: opacity 0.5s ease-out, height 0.5s ease-out;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
.menubar {
|
|
154
|
-
display: inline-block;
|
|
155
|
-
--padding-left: 16px;
|
|
156
|
-
--margin-left: 16px;
|
|
157
|
-
white-space: nowrap;
|
|
158
|
-
overflow: hidden;
|
|
159
|
-
text-overflow: ellipsis;
|
|
160
|
-
transition: height 0.5s ease-out, padding 0.5s ease-out;
|
|
161
|
-
text-align: left;
|
|
162
|
-
--width: calc(100% - 36px);
|
|
163
|
-
--margin: 0;
|
|
164
|
-
}
|
|
209
|
+
&.collapse:not(.group):not(.hover) {
|
|
210
|
+
opacity: 0;
|
|
211
|
+
height: 0;
|
|
212
|
+
}
|
|
165
213
|
|
|
214
|
+
&:hover {
|
|
215
|
+
filter: brightness(90%);
|
|
216
|
+
}
|
|
166
217
|
|
|
167
|
-
li {
|
|
168
|
-
display: flex;
|
|
169
|
-
align-items: center;
|
|
170
|
-
padding: 0;
|
|
171
|
-
margin: 0;
|
|
172
|
-
position: relative;
|
|
173
|
-
color: unset;
|
|
174
|
-
font-weight: bold;
|
|
175
|
-
width: calc(100% + 36px);
|
|
176
|
-
}
|
|
177
218
|
|
|
178
219
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
transition: width 0.5s ease-out, height 0.5s ease-out;
|
|
191
|
-
}
|
|
220
|
+
&.group .menubar {
|
|
221
|
+
font-weight: 700;
|
|
222
|
+
}
|
|
223
|
+
&:not(.group) .menubar {
|
|
224
|
+
font-weight: 400;
|
|
225
|
+
}
|
|
226
|
+
&.collapse:not(.hover) .menubar {
|
|
227
|
+
transition: width 0.5s ease-out, padding-left 0.5s ease-out;
|
|
228
|
+
width: 0;
|
|
229
|
+
padding-left: unset;
|
|
230
|
+
}
|
|
192
231
|
|
|
193
|
-
.icon-home {
|
|
194
|
-
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="lightgray" viewBox="0 0 16 16"><path d="M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5"/></svg>');
|
|
195
|
-
}
|
|
196
232
|
|
|
197
|
-
|
|
198
|
-
|
|
233
|
+
&.collapse:not(.hover)) li {
|
|
234
|
+
justify-content: center;
|
|
199
235
|
}
|
|
200
236
|
|
|
201
|
-
.menubar {
|
|
202
|
-
margin-left: 8px;
|
|
203
|
-
}
|
|
204
237
|
|
|
238
|
+
&.group li {
|
|
239
|
+
list-style-type: none;
|
|
240
|
+
}
|
|
241
|
+
&:not(.group) li {
|
|
242
|
+
list-style-type: unset;
|
|
243
|
+
}
|
|
244
|
+
:host(nine-side-menu-item:not(.group)) li::before {
|
|
245
|
+
content: '•';
|
|
246
|
+
margin-right: 8px;
|
|
247
|
+
margin-left: 16px;
|
|
248
|
+
}
|
|
205
249
|
|
|
206
|
-
.expand-icon {
|
|
207
|
-
width: 8px;
|
|
208
|
-
height: 8px;
|
|
209
|
-
--border-left: 4px solid transparent;
|
|
210
|
-
--border-right: 4px solid transparent;
|
|
211
|
-
--border-top: 4px solid #ccc;
|
|
212
|
-
position: absolute;
|
|
213
|
-
right: 16px;
|
|
214
|
-
background-repeat: no-repeat;
|
|
215
|
-
background-position: center;
|
|
216
|
-
background-size: auto;
|
|
217
|
-
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" fill="white" class="bi bi-caret-down-fill" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>');
|
|
218
|
-
animation: rotate-out 0.3s ease-in-out forwards;
|
|
219
|
-
}
|
|
220
250
|
|
|
221
251
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
252
|
+
&.collapse:not(.hover) .icon {
|
|
253
|
+
width: 20px;
|
|
254
|
+
height: 20px;
|
|
255
|
+
}
|
|
256
|
+
&.collapse:not(.hover) .menubar,
|
|
257
|
+
&.collapse:not(.hover) .expand-icon {
|
|
258
|
+
display: none;
|
|
259
|
+
}
|
|
226
260
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
:host(nine-side-menu-item.group) {
|
|
233
|
-
height: 48px;
|
|
234
|
-
}
|
|
235
|
-
:host(nine-side-menu-item:not(.group)) {
|
|
236
|
-
height: 32px;
|
|
237
|
-
}
|
|
261
|
+
&:not(.expand) .expand-icon {
|
|
262
|
+
transform: rotate(180deg);
|
|
263
|
+
animation: rotate-in 0.3s ease-in-out forwards;
|
|
264
|
+
}
|
|
238
265
|
|
|
239
|
-
:host(nine-side-menu-item.active) {
|
|
240
|
-
--background-color: #999;
|
|
241
|
-
color: #9FF2FF;
|
|
242
|
-
}
|
|
243
266
|
|
|
244
|
-
:host(nine-side-menu-item.collapse:not(.group):not(.hover)) {
|
|
245
|
-
opacity: 0;
|
|
246
|
-
height: 0;
|
|
247
|
-
}
|
|
248
267
|
|
|
249
|
-
:
|
|
250
|
-
|
|
251
|
-
|
|
268
|
+
&.collapse:not(.hover) {
|
|
269
|
+
.icon {
|
|
270
|
+
margin-left: 4px;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
252
273
|
|
|
253
274
|
|
|
275
|
+
&.hide {
|
|
276
|
+
--display: none;
|
|
277
|
+
max-height: 0;
|
|
278
|
+
opacity: 0;
|
|
279
|
+
padding: 0;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
254
283
|
|
|
255
|
-
:host(nine-side-menu
|
|
256
|
-
|
|
284
|
+
:host(nine-side-menu.collapse) {
|
|
285
|
+
width: var(--min-width);
|
|
257
286
|
}
|
|
258
|
-
:host(nine-side-menu
|
|
259
|
-
|
|
287
|
+
:host(nine-side-menu:not(.collapse)) {
|
|
288
|
+
width: var(--max-width);
|
|
260
289
|
}
|
|
261
|
-
:host(nine-side-menu
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
padding-left: unset;
|
|
290
|
+
:host(nine-side-menu.collapse:hover) {
|
|
291
|
+
width: var(--max-width);
|
|
292
|
+
--animation: bounce 0.5s ease-in-out 1;
|
|
265
293
|
}
|
|
266
294
|
|
|
267
295
|
|
|
268
|
-
|
|
269
|
-
|
|
296
|
+
@keyframes bounce {
|
|
297
|
+
0%, 20%, 50%, 80%, 100% { transform: translateX(0); }
|
|
298
|
+
40% { transform: translateX(-10px); }
|
|
299
|
+
60% { left: -10px; transform: translateX(10px); }
|
|
270
300
|
}
|
|
271
301
|
|
|
272
|
-
|
|
273
|
-
:
|
|
274
|
-
list-style-type: none;
|
|
302
|
+
:host(nine-side-menu.collapse) {
|
|
303
|
+
--width: var(--min-width);
|
|
275
304
|
}
|
|
276
|
-
|
|
277
|
-
|
|
305
|
+
|
|
306
|
+
:host(nine-side-menu:not(.collapse)) {
|
|
307
|
+
width: var(--max-width);
|
|
278
308
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
::slotted([slot="body-content"]) {
|
|
312
|
+
width: 100%;
|
|
313
|
+
padding: 0;
|
|
283
314
|
}
|
|
284
315
|
|
|
285
316
|
|
|
286
317
|
|
|
287
|
-
:host(nine-side-menu-item.collapse:not(.hover)) .icon {
|
|
288
|
-
width: 20px;
|
|
289
|
-
height: 20px;
|
|
290
|
-
}
|
|
291
|
-
:host(nine-side-menu-item.collapse:not(.hover)) .menubar,
|
|
292
|
-
:host(nine-side-menu-item.collapse:not(.hover)) .expand-icon {
|
|
293
|
-
display: none;
|
|
294
|
-
}
|
|
295
318
|
|
|
296
|
-
|
|
297
|
-
transform: rotate(180deg);
|
|
298
|
-
animation: rotate-in 0.3s ease-in-out forwards;
|
|
299
|
-
}
|
|
319
|
+
|
|
300
320
|
@keyframes rotate-in {
|
|
301
321
|
from {
|
|
302
322
|
transform: rotate(0deg);
|
|
@@ -314,43 +334,11 @@
|
|
|
314
334
|
}
|
|
315
335
|
}
|
|
316
336
|
|
|
317
|
-
:host(nine-side-menu-item.collapse:not(.hover)) .expand-icon {
|
|
318
|
-
display: none;
|
|
319
|
-
}
|
|
320
|
-
:host(nine-side-menu-item:not(.group)) .expand-icon {
|
|
321
|
-
display: none;
|
|
322
|
-
}
|
|
323
337
|
|
|
324
338
|
|
|
325
|
-
:host(:not(.group)) {
|
|
326
|
-
.icon {
|
|
327
|
-
display: none;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
339
|
|
|
331
|
-
:host(nine-side-menu-item) {
|
|
332
|
-
.icon {
|
|
333
|
-
margin-left: 8px;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
:host(nine-side-menu-item.collapse:not(.hover)) {
|
|
337
|
-
.icon {
|
|
338
|
-
margin-left: 4px;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
340
|
|
|
342
|
-
|
|
343
|
-
--overflow: hidden;
|
|
344
|
-
max-height: 64px; /* 기본 높이 */
|
|
345
|
-
opacity: 1;
|
|
346
|
-
transition: max-height 0.5s ease-in-out, opacity 0.5s ease-in-out;
|
|
347
|
-
}
|
|
348
|
-
:host(nine-side-menu-item.hide) {
|
|
349
|
-
--display: none;
|
|
350
|
-
max-height: 0;
|
|
351
|
-
opacity: 0;
|
|
352
|
-
padding: 0;
|
|
353
|
-
}
|
|
341
|
+
|
|
354
342
|
|
|
355
343
|
|
|
356
344
|
/* 💡 부모 상태(collapse)에 따른 헤더 내부 엘리먼트 제어 명세 */
|
|
@@ -14087,7 +14087,7 @@ vS = function() {
|
|
|
14087
14087
|
const e = K2.getComponentCssPath("nineEditor.css"), r = e ? `@import "${e}";` : "";
|
|
14088
14088
|
this.shadowRoot.innerHTML = `
|
|
14089
14089
|
<style>
|
|
14090
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.
|
|
14090
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.172/dist/css/nineEditor.css";
|
|
14091
14091
|
${r}
|
|
14092
14092
|
</style>
|
|
14093
14093
|
|
|
@@ -14234,7 +14234,7 @@ bd = new WeakMap(), yd = new WeakMap(), va = new WeakSet(), uR = async function(
|
|
|
14234
14234
|
const e = this.getAttribute("lang") || "Bash", r = this.getAttribute("code") || this.textContent.trim() || "", s = this.getAttribute("css-path");
|
|
14235
14235
|
y(this, yd).innerHTML = `
|
|
14236
14236
|
<style>
|
|
14237
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.
|
|
14237
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.172/dist/css/nine-code-block.css";
|
|
14238
14238
|
${s ? `@import "${s}";` : ""}
|
|
14239
14239
|
</style>
|
|
14240
14240
|
|
|
@@ -88002,7 +88002,7 @@ class JQ extends zn {
|
|
|
88002
88002
|
return e.deserialize({ ...t, _type: "prompt" });
|
|
88003
88003
|
}
|
|
88004
88004
|
case "few_shot": {
|
|
88005
|
-
const { FewShotPromptTemplate: e } = await import("./few_shot-
|
|
88005
|
+
const { FewShotPromptTemplate: e } = await import("./few_shot-CqXX4yUV.js");
|
|
88006
88006
|
return e.deserialize(t);
|
|
88007
88007
|
}
|
|
88008
88008
|
default:
|
|
@@ -88902,14 +88902,14 @@ class Eee extends HTMLElement {
|
|
|
88902
88902
|
return r ? r.querySelectorAll(e) : [];
|
|
88903
88903
|
});
|
|
88904
88904
|
Q(this, Db, (e) => {
|
|
88905
|
-
this.classList.add(e), this.shadowRoot.querySelectorAll("nine-side-menu-head,nine-side-menu-foot,nine-side-menu-body,nine-side-menu-custom").forEach((r) => {
|
|
88905
|
+
this.classList.add(e), this.shadowRoot.querySelectorAll("nine-side-menu-item,nine-side-menu-head,nine-side-menu-foot,nine-side-menu-body,nine-side-menu-custom").forEach((r) => {
|
|
88906
88906
|
r.classList.add(e);
|
|
88907
88907
|
}), y(this, jb).call(this, "nine-side-menu-item").forEach((r) => {
|
|
88908
88908
|
r.classList.add(e);
|
|
88909
88909
|
});
|
|
88910
88910
|
});
|
|
88911
88911
|
Q(this, Bb, (e) => {
|
|
88912
|
-
this.classList.remove(e), this.shadowRoot.querySelectorAll("nine-side-menu-head,nine-side-menu-foot,nine-side-menu-body,nine-side-menu-custom").forEach((r) => {
|
|
88912
|
+
this.classList.remove(e), this.shadowRoot.querySelectorAll("nine-side-menu-item,nine-side-menu-head,nine-side-menu-foot,nine-side-menu-body,nine-side-menu-custom").forEach((r) => {
|
|
88913
88913
|
r.classList.remove(e);
|
|
88914
88914
|
}), y(this, jb).call(this, "nine-side-menu-item").forEach((r) => {
|
|
88915
88915
|
r.classList.remove(e);
|
|
@@ -88921,7 +88921,7 @@ class Eee extends HTMLElement {
|
|
|
88921
88921
|
const r = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
88922
88922
|
this.shadowRoot.innerHTML = `
|
|
88923
88923
|
<style>
|
|
88924
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.
|
|
88924
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.172/dist/css/nineMenu.css";
|
|
88925
88925
|
${r}
|
|
88926
88926
|
|
|
88927
88927
|
:host {
|
package/dist/nine-ux.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import "@nine-lab/nine-util";
|
|
2
|
-
import "./index-
|
|
2
|
+
import "./index-CTgNusJH.js";
|
package/dist/nine-ux.umd.js
CHANGED
|
@@ -93,7 +93,7 @@ img.ProseMirror-separator {
|
|
|
93
93
|
`},addCommands(){return{setHardBreak:()=>({commands:n,chain:t,state:e,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:s,storedMarks:i}=e;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,l=i||s.$to.parentOffset&&s.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&a){const h=l.filter(d=>o.includes(d.type.name));c.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),eL=zi.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:t}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Gn(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:n=>({commands:t})=>this.options.levels.includes(n.level)?t.setNode(this.name,n):!1,toggleHeading:n=>({commands:t})=>this.options.levels.includes(n.level)?t.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,t)=>({...n,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(n=>N2({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Xy=200,Kn=function(){};Kn.prototype.append=function(t){return t.length?(t=Kn.from(t),!this.length&&t||t.length<Xy&&this.leafAppend(t)||this.length<Xy&&t.leafPrepend(this)||this.appendInner(t)):this},Kn.prototype.prepend=function(t){return t.length?Kn.from(t).append(this):this},Kn.prototype.appendInner=function(t){return new tL(this,t)},Kn.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?Kn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Kn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Kn.prototype.forEach=function(t,e,r){e===void 0&&(e=0),r===void 0&&(r=this.length),e<=r?this.forEachInner(t,e,r,0):this.forEachInvertedInner(t,e,r,0)},Kn.prototype.map=function(t,e,r){e===void 0&&(e=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,a){return s.push(t(i,a))},e,r),s},Kn.from=function(t){return t instanceof Kn?t:t&&t.length?new J4(t):Kn.empty};var J4=function(n){function t(r){n.call(this),this.values=r}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new t(this.values.slice(s,i))},t.prototype.getInner=function(s){return this.values[s]},t.prototype.forEachInner=function(s,i,a,o){for(var l=i;l<a;l++)if(s(this.values[l],o+l)===!1)return!1},t.prototype.forEachInvertedInner=function(s,i,a,o){for(var l=i-1;l>=a;l--)if(s(this.values[l],o+l)===!1)return!1},t.prototype.leafAppend=function(s){if(this.length+s.length<=Xy)return new t(this.values.concat(s.flatten()))},t.prototype.leafPrepend=function(s){if(this.length+s.length<=Xy)return new t(s.flatten().concat(this.values))},e.length.get=function(){return this.values.length},e.depth.get=function(){return 0},Object.defineProperties(t.prototype,e),t}(Kn);Kn.empty=new J4([]);var tL=function(n){function t(e,r){n.call(this),this.left=e,this.right=r,this.length=e.length+r.length,this.depth=Math.max(e.depth,r.depth)+1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,s,i,a){var o=this.left.length;if(s<o&&this.left.forEachInner(r,s,Math.min(i,o),a)===!1||i>o&&this.right.forEachInner(r,Math.max(s-o,0),Math.min(this.length,i)-o,a+o)===!1)return!1},t.prototype.forEachInvertedInner=function(r,s,i,a){var o=this.left.length;if(s>o&&this.right.forEachInvertedInner(r,s-o,Math.max(i,o)-o,a+o)===!1||i<o&&this.left.forEachInvertedInner(r,Math.min(s,o),i,a)===!1)return!1},t.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var i=this.left.length;return s<=i?this.left.slice(r,s):r>=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},t.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new t(this.left,s)},t.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new t(s,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(Kn);const rL=500;class sa{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;e&&(s=this.remapping(r,this.items.length),i=s.maps.length);let a=t.tr,o,l,c=[],u=[];return this.items.forEach((h,d)=>{if(!h.step){s||(s=this.remapping(r,d+1),i=s.maps.length),i--,u.push(h);return}if(s){u.push(new Ia(h.map));let f=h.step.map(s.slice(i)),p;f&&a.maybeStep(f).doc&&(p=a.mapping.maps[a.mapping.maps.length-1],c.push(new Ia(p,void 0,void 0,c.length+u.length))),i--,p&&s.appendMap(p,i)}else a.maybeStep(h.step);if(h.selection)return o=s?h.selection.map(s.slice(i)):h.selection,l=new sa(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:a,selection:o}}addTransform(t,e,r,s){let i=[],a=this.eventCount,o=this.items,l=!s&&o.length?o.get(o.length-1):null;for(let u=0;u<t.steps.length;u++){let h=t.steps[u].invert(t.docs[u]),d=new Ia(t.mapping.maps[u],h,e),f;(f=l&&l.merge(d))&&(d=f,u?i.pop():o=o.slice(0,o.length-1)),i.push(d),e&&(a++,e=void 0),s||(l=d)}let c=a-r.depth;return c>sL&&(o=nL(o,c),a-=c),new sa(o.append(i),a)}remapping(t,e){let r=new wf;return this.items.forEach((s,i)=>{let a=s.mirrorOffset!=null&&i-s.mirrorOffset>=t?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,a)},t,e),r}addMaps(t){return this.eventCount==0?this:new sa(this.items.append(t.map(e=>new Ia(e))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-e),i=t.mapping,a=t.steps.length,o=this.eventCount;this.items.forEach(d=>{d.selection&&o--},s);let l=e;this.items.forEach(d=>{let f=i.getMirror(--l);if(f==null)return;a=Math.min(a,f);let p=i.maps[f];if(d.step){let g=t.steps[f].invert(t.docs[f]),m=d.selection&&d.selection.map(i.slice(l+1,f));m&&o++,r.push(new Ia(p,g,m))}else r.push(new Ia(p))},s);let c=[];for(let d=e;d<a;d++)c.push(new Ia(i.maps[d]));let u=this.items.slice(0,s).append(c).append(r),h=new sa(u,o);return h.emptyItemCount()>rL&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let t=0;return this.items.forEach(e=>{e.step||t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),r=e.maps.length,s=[],i=0;return this.items.forEach((a,o)=>{if(o>=t)s.push(a),a.selection&&i++;else if(a.step){let l=a.step.map(e.slice(r)),c=l&&l.getMap();if(r--,c&&e.appendMap(c,r),l){let u=a.selection&&a.selection.map(e.slice(r));u&&i++;let h=new Ia(c.invert(),l,u),d,f=s.length-1;(d=s.length&&s[f].merge(h))?s[f]=d:s.push(h)}}else a.map&&r--},this.items.length,0),new sa(Kn.from(s.reverse()),i)}}sa.empty=new sa(Kn.empty,0);function nL(n,t){let e;return n.forEach((r,s)=>{if(r.selection&&t--==0)return e=s,!1}),n.slice(e)}class Ia{constructor(t,e,r,s){this.map=t,this.step=e,this.selection=r,this.mirrorOffset=s}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new Ia(e.getMap().invert(),e,this.selection)}}}class gl{constructor(t,e,r,s,i){this.done=t,this.undone=e,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const sL=20;function iL(n,t,e,r){let s=e.getMeta(Bc),i;if(s)return s.historyState;e.getMeta(lL)&&(n=new gl(n.done,n.undone,null,0,-1));let a=e.getMeta("appendedTransaction");if(e.steps.length==0)return n;if(a&&a.getMeta(Bc))return a.getMeta(Bc).redo?new gl(n.done.addTransform(e,void 0,r,Yy(t)),n.undone,Z4(e.mapping.maps),n.prevTime,n.prevComposition):new gl(n.done,n.undone.addTransform(e,void 0,r,Yy(t)),null,n.prevTime,n.prevComposition);if(e.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let o=e.getMeta("composition"),l=n.prevTime==0||!a&&n.prevComposition!=o&&(n.prevTime<(e.time||0)-r.newGroupDelay||!aL(e,n.prevRanges)),c=a?$2(n.prevRanges,e.mapping):Z4(e.mapping.maps);return new gl(n.done.addTransform(e,l?t.selection.getBookmark():void 0,r,Yy(t)),sa.empty,c,e.time,o??n.prevComposition)}else return(i=e.getMeta("rebased"))?new gl(n.done.rebased(e,i),n.undone.rebased(e,i),$2(n.prevRanges,e.mapping),n.prevTime,n.prevComposition):new gl(n.done.addMaps(e.mapping.maps),n.undone.addMaps(e.mapping.maps),$2(n.prevRanges,e.mapping),n.prevTime,n.prevComposition)}function aL(n,t){if(!t)return!1;if(!n.docChanged)return!0;let e=!1;return n.mapping.maps[0].forEach((r,s)=>{for(let i=0;i<t.length;i+=2)r<=t[i+1]&&s>=t[i]&&(e=!0)}),e}function Z4(n){let t=[];for(let e=n.length-1;e>=0&&t.length==0;e--)n[e].forEach((r,s,i,a)=>t.push(i,a));return t}function $2(n,t){if(!n)return null;let e=[];for(let r=0;r<n.length;r+=2){let s=t.map(n[r],1),i=t.map(n[r+1],-1);s<=i&&e.push(s,i)}return e}function oL(n,t,e){let r=Yy(t),s=Bc.get(t).spec.config,i=(e?n.undone:n.done).popEvent(t,r);if(!i)return null;let a=i.selection.resolve(i.transform.doc),o=(e?n.done:n.undone).addTransform(i.transform,t.selection.getBookmark(),s,r),l=new gl(e?o:i.remaining,e?i.remaining:o,null,0,-1);return i.transform.setSelection(a).setMeta(Bc,{redo:e,historyState:l})}let L2=!1,Q4=null;function Yy(n){let t=n.plugins;if(Q4!=t){L2=!1,Q4=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){L2=!0;break}}return L2}const Bc=new rn("history"),lL=new rn("closeHistory");function eA(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Nr({key:Bc,state:{init(){return new gl(sa.empty,sa.empty,null,0,-1)},apply(t,e,r){return iL(e,r,t,n)}},config:n,props:{handleDOMEvents:{beforeinput(t,e){let r=e.inputType,s=r=="historyUndo"?j2:r=="historyRedo"?D2:null;return!s||!t.editable?!1:(e.preventDefault(),s(t.state,t.dispatch))}}}})}function tA(n,t){return(e,r)=>{let s=Bc.getState(e);if(!s||(n?s.undone:s.done).eventCount==0)return!1;if(r){let i=oL(s,e,n);i&&r(t?i.scrollIntoView():i)}return!0}}const j2=tA(!1,!0),D2=tA(!0,!0),cL=Vs.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:t})=>j2(n,t),redo:()=>({state:n,dispatch:t})=>D2(n,t)}},addProseMirrorPlugins(){return[eA(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),uL=zi.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",Gn(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:t})=>{if(!T$(t,t.schema.nodes[this.name]))return!1;const{selection:e}=t,{$from:r,$to:s}=e,i=n();return r.parentOffset===0?i.insertContentAt({from:Math.max(r.pos-1,0),to:s.pos},{type:this.name}):s$(e)?i.insertContentAt(s.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:a,dispatch:o})=>{var l;if(o){const{$to:c}=a.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(vt.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(Tt.create(a.doc,c.pos)):a.setSelection(vt.create(a.doc,c.pos));else{const h=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();h&&(a.insert(u,h),a.setSelection(vt.create(a.doc,u+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[V4({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),dL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,hL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,fL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,pL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,mL=$c.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",Gn(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[jc({find:dL,type:this.type}),jc({find:fL,type:this.type})]},addPasteRules(){return[Dc({find:hL,type:this.type}),Dc({find:pL,type:this.type})]}}),gL=zi.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Gn(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),bL="listItem",rA="textStyle",nA=/^(\d+)\.\s$/,yL=zi.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:t,...e}=n;return t===1?["ol",Gn(this.options.HTMLAttributes,e),0]:["ol",Gn(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(bL,this.editor.getAttributes(rA)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=$f({find:nA,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=$f({find:nA,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(rA)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[n]}}),wL=zi.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Gn(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),vL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,_L=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,xL=$c.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",Gn(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[jc({find:vL,type:this.type})]},addPasteRules(){return[Dc({find:_L,type:this.type})]}}),SL=zi.create({name:"text",group:"inline"}),kL=Vs.create({name:"starterKit",addExtensions(){const n=[];return this.options.bold!==!1&&n.push(P$.configure(this.options.bold)),this.options.blockquote!==!1&&n.push(R$.configure(this.options.blockquote)),this.options.bulletList!==!1&&n.push(L$.configure(this.options.bulletList)),this.options.code!==!1&&n.push(B$.configure(this.options.code)),this.options.codeBlock!==!1&&n.push(H$.configure(this.options.codeBlock)),this.options.document!==!1&&n.push(q$.configure(this.options.document)),this.options.dropcursor!==!1&&n.push(V$.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&n.push(Z$.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&n.push(Q$.configure(this.options.hardBreak)),this.options.heading!==!1&&n.push(eL.configure(this.options.heading)),this.options.history!==!1&&n.push(cL.configure(this.options.history)),this.options.horizontalRule!==!1&&n.push(uL.configure(this.options.horizontalRule)),this.options.italic!==!1&&n.push(mL.configure(this.options.italic)),this.options.listItem!==!1&&n.push(gL.configure(this.options.listItem)),this.options.orderedList!==!1&&n.push(yL.configure(this.options.orderedList)),this.options.paragraph!==!1&&n.push(wL.configure(this.options.paragraph)),this.options.strike!==!1&&n.push(xL.configure(this.options.strike)),this.options.text!==!1&&n.push(SL.configure(this.options.text)),n}}),EL=n=>{if(!n.children.length)return;const t=n.querySelectorAll("span");t&&t.forEach(e=>{var r,s;const i=e.getAttribute("style"),a=(s=(r=e.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||s===void 0?void 0:s.getAttribute("style");e.setAttribute("style",`${a};${i}`)})},CL=$c.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&EL(n),{}):!1}]},renderHTML({HTMLAttributes:n}){return["span",Gn(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:n})=>{const{selection:t}=n;return n.doc.nodesBetween(t.from,t.to,(e,r)=>{if(e.isTextblock)return!0;e.marks.filter(s=>s.type===this.type).some(s=>Object.values(s.attrs).some(i=>!!i))||n.removeMark(r,r+e.nodeSize,this.type)}),!0}}}}),TL=Vs.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:n=>{var t;return(t=n.style.color)===null||t===void 0?void 0:t.replace(/['"]+/g,"")},renderHTML:n=>n.color?{style:`color: ${n.color}`}:{}}}}]},addCommands(){return{setColor:n=>({chain:t})=>t().setMark("textStyle",{color:n}).run(),unsetColor:()=>({chain:n})=>n().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),AL=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,RL=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,OL=$c.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",Gn(this.options.HTMLAttributes,n),0]},addCommands(){return{setHighlight:n=>({commands:t})=>t.setMark(this.name,n),toggleHighlight:n=>({commands:t})=>t.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[jc({find:AL,type:this.type})]},addPasteRules(){return[Dc({find:RL,type:this.type})]}}),ML=Vs.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>{const t=n.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:n=>n.textAlign?{style:`text-align: ${n.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:n=>({commands:t})=>this.options.alignments.includes(n)?this.options.types.map(e=>t.updateAttributes(e,{textAlign:n})).every(e=>e):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(t=>n.resetAttributes(t,"textAlign")).every(t=>t),toggleTextAlign:n=>({editor:t,commands:e})=>this.options.alignments.includes(n)?t.isActive({textAlign:n})?e.unsetTextAlign():e.setTextAlign(n):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),IL=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,NL=zi.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:n}){return["img",Gn(this.options.HTMLAttributes,n)]},addCommands(){return{setImage:n=>({commands:t})=>t.insertContent({type:this.name,attrs:n})}},addInputRules(){return[V4({find:IL,type:this.type,getAttributes:n=>{const[,,t,e,r]=n;return{src:e,alt:t,title:r}}})]}});class PL extends xx{constructor(){super();Q(this,xi);Q(this,ei,null);Q(this,Qp,null);Q(this,em,null)}connectedCallback(){super.connectedCallback()&&(Lt(this,xi,EI).call(this),Lt(this,xi,CI).call(this),Lt(this,xi,z3).call(this))}get value(){return y(this,ei).getHTML()}set value(e){let r=e||"";r&&!/<\/?[a-z][^>]*>/i.test(r)&&(r=r.split(`
|
|
94
94
|
`).map(s=>`<p>${s}</p>`).join("")),y(this,ei)?y(this,ei).commands.setContent(r,!1):oe(this,em,r)}get id(){return this.getAttribute("id")}set id(e){this.setAttribute("id",e)}get name(){return this.getAttribute("name")}set name(e){this.setAttribute("name",e)}get readonly(){return this.hasAttribute("readonly")}set readonly(e){e?this.setAttribute("readonly",""):this.removeAttribute("readonly"),Lt(this,xi,z3).call(this)}disconnectedCallback(){y(this,ei)&&(y(this,ei).destroy(),oe(this,ei,null))}}ei=new WeakMap,Qp=new WeakMap,em=new WeakMap,xi=new WeakSet,z3=function(){if(y(this,ei)){const e=this.readonly;y(this,ei).setEditable(!e);const r=this.shadowRoot.querySelector(".menu-bar");r&&(r.style.display=e?"none":"flex")}},EI=function(){const e=rl.getComponentCssPath("nineEditor.css"),r=e?`@import "${e}";`:"";this.shadowRoot.innerHTML=`
|
|
95
95
|
<style>
|
|
96
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.
|
|
96
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.172/dist/css/nineEditor.css";
|
|
97
97
|
${r}
|
|
98
98
|
</style>
|
|
99
99
|
|
|
@@ -130,7 +130,7 @@ img.ProseMirror-separator {
|
|
|
130
130
|
<div id="editor-container"></div>
|
|
131
131
|
`,oe(this,Qp,this.shadowRoot.querySelector("#editor-container")),this.shadowRoot.querySelector("#font-size").onchange=s=>{const i=s.target.value;console.log(s.target,i),y(this,ei).chain().focus().setMark("textStyle",{fontSize:i}).run()}},CI=function(){oe(this,ei,new C$({element:y(this,Qp),editable:!this.readonly,extensions:[kL,TL,OL.configure({multicolor:!0}),ML.configure({types:["heading","paragraph"]}),NL.configure({inline:!0,allowBase64:!0}),CL.extend({addAttributes(){return{fontSize:{default:null,parseHTML:e=>e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}})],content:y(this,em)||this.originContents||"",onUpdate:({editor:e})=>{this.dispatchEvent(new CustomEvent("change",{detail:e.getHTML()}))},onSelectionUpdate:({editor:e})=>{this.readonly||Lt(this,xi,TI).call(this,e)}})),Lt(this,xi,AI).call(this)},TI=function(e){this.shadowRoot.querySelectorAll("[data-cmd]").forEach(a=>{e.isActive(a.dataset.cmd)?a.classList.add("is-active"):a.classList.remove("is-active")}),this.shadowRoot.querySelectorAll("[data-align]").forEach(a=>{e.isActive({textAlign:a.dataset.align})?a.classList.add("is-active"):a.classList.remove("is-active")});const r=e.getAttributes("textStyle"),s=this.shadowRoot.querySelector("#font-size");s&&(s.value=r.fontSize||"14px");const i=this.shadowRoot.querySelector("#color-picker");i&&(i.value=r.color||"#000000")},AI=function(){const e=y(this,ei);this.shadowRoot.querySelectorAll("[data-cmd]").forEach(r=>{r.onclick=()=>{const s=r.dataset.cmd;s==="bold"&&e.chain().focus().toggleBold().run(),s==="italic"&&e.chain().focus().toggleItalic().run(),s==="underline"&&e.chain().focus().toggleUnderline().run(),s==="strike"&&e.chain().focus().toggleStrike().run(),s==="highlight"&&e.chain().focus().toggleHighlight().run(),s==="bulletList"&&e.chain().focus().toggleBulletList().run(),s==="orderedList"&&e.chain().focus().toggleOrderedList().run(),s==="undo"&&e.chain().focus().undo().run(),s==="redo"&&e.chain().focus().redo().run()}}),this.shadowRoot.querySelector("#color-picker").oninput=r=>{e.chain().focus().setColor(r.target.value).run()},this.shadowRoot.querySelectorAll("[data-align]").forEach(r=>{r.onclick=()=>e.chain().focus().setTextAlign(r.dataset.align).run()}),this.shadowRoot.querySelector("#img-btn").onclick=()=>{const r=window.prompt("Image URL");r&&e.chain().focus().setImage({src:r}).run()}};const vo=typeof window<"u"&&window.nine?window.nine:kr.nine,sA={alert:window.alert,confirm:window.confirm},iA=()=>{var e;console.log(vo,window.nine);const{nativeOverride:n}=((e=vo==null?void 0:vo.config)==null?void 0:e.ux)||{},t=Array.isArray(n)?n:n===!0?["alert","confirm"]:[];console.log(vo,t),window.alert=t.includes("alert")?r=>rl.alert(r):sA.alert,window.confirm=t.includes("confirm")?async r=>await rl.confirm(r):sA.confirm,vo.config.debug&&t.length>0&&console.log(`[nine-ux] Native API Overridden: ${t.join(", ")}`)};(()=>{iA(),vo==null||vo.subscribeConfig(n=>{(n==="ux"||n==="config")&&iA()})})();class $L extends HTMLElement{constructor(){super();Q(this,ga);Q(this,Bd,!1);Q(this,Fd);oe(this,Fd,this.attachShadow({mode:"open"}))}static get observedAttributes(){return["lang","code"]}connectedCallback(){!this.getAttribute("code")&&this.textContent.trim()&&this.setAttribute("code",this.textContent.trim()),Lt(this,ga,iy).call(this)}attributeChangedCallback(){Lt(this,ga,iy).call(this)}}Bd=new WeakMap,Fd=new WeakMap,ga=new WeakSet,RI=async function(){const e=this.getAttribute("code")||"";try{await navigator.clipboard.writeText(e),oe(this,Bd,!0),Lt(this,ga,iy).call(this),setTimeout(()=>{oe(this,Bd,!1),Lt(this,ga,iy).call(this)},2e3)}catch(r){console.error("Code copy failed:",r)}},iy=function(){const e=this.getAttribute("lang")||"Bash",r=this.getAttribute("code")||this.textContent.trim()||"",s=this.getAttribute("css-path");y(this,Fd).innerHTML=`
|
|
132
132
|
<style>
|
|
133
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.
|
|
133
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.172/dist/css/nine-code-block.css";
|
|
134
134
|
${s?`@import "${s}";`:""}
|
|
135
135
|
</style>
|
|
136
136
|
|
|
@@ -2317,9 +2317,9 @@ context: `;s.forEach(p=>{u+=`${p.desc} `}),u+=`
|
|
|
2317
2317
|
href="${r.path||""}"
|
|
2318
2318
|
title="${r.name}">
|
|
2319
2319
|
${r.name}${a}
|
|
2320
|
-
</nine-side-menu-item>`}).join("")});de(this,"expand",()=>{y(this,Kb).call(this,"collapse"),document.body.style.width=`calc(100% - ${y(this,of)}px)`});de(this,"collapse",()=>{y(this,Gb).call(this,"collapse"),document.body.style.width=`calc(100% - ${y(this,af)}px)`,this.shadowRoot.host.style.width="var(--min-width)",setTimeout(()=>{this.shadowRoot.host.style.width=""},300)});Q(this,Wb,e=>{const r=this.shadowRoot.querySelector("nine-side-menu-body");return r?r.querySelectorAll(e):[]});Q(this,Gb,e=>{this.classList.add(e),this.shadowRoot.querySelectorAll("nine-side-menu-head,nine-side-menu-foot,nine-side-menu-body,nine-side-menu-custom").forEach(r=>{r.classList.add(e)}),y(this,Wb).call(this,"nine-side-menu-item").forEach(r=>{r.classList.add(e)})});Q(this,Kb,e=>{this.classList.remove(e),this.shadowRoot.querySelectorAll("nine-side-menu-head,nine-side-menu-foot,nine-side-menu-body,nine-side-menu-custom").forEach(r=>{r.classList.remove(e)}),y(this,Wb).call(this,"nine-side-menu-item").forEach(r=>{r.classList.remove(e)})});Q(this,cx,()=>{const e=this.innerHTML.trim();this.innerHTML="",oe(this,af,Number(this.getAttribute("min-width")||48)),oe(this,of,Number(this.getAttribute("max-width")||256));const r=this.getAttribute("css-path")?`@import "${this.getAttribute("css-path")}";`:"";this.shadowRoot.innerHTML=`
|
|
2320
|
+
</nine-side-menu-item>`}).join("")});de(this,"expand",()=>{y(this,Kb).call(this,"collapse"),document.body.style.width=`calc(100% - ${y(this,of)}px)`});de(this,"collapse",()=>{y(this,Gb).call(this,"collapse"),document.body.style.width=`calc(100% - ${y(this,af)}px)`,this.shadowRoot.host.style.width="var(--min-width)",setTimeout(()=>{this.shadowRoot.host.style.width=""},300)});Q(this,Wb,e=>{const r=this.shadowRoot.querySelector("nine-side-menu-body");return r?r.querySelectorAll(e):[]});Q(this,Gb,e=>{this.classList.add(e),this.shadowRoot.querySelectorAll("nine-side-menu-item,nine-side-menu-head,nine-side-menu-foot,nine-side-menu-body,nine-side-menu-custom").forEach(r=>{r.classList.add(e)}),y(this,Wb).call(this,"nine-side-menu-item").forEach(r=>{r.classList.add(e)})});Q(this,Kb,e=>{this.classList.remove(e),this.shadowRoot.querySelectorAll("nine-side-menu-item,nine-side-menu-head,nine-side-menu-foot,nine-side-menu-body,nine-side-menu-custom").forEach(r=>{r.classList.remove(e)}),y(this,Wb).call(this,"nine-side-menu-item").forEach(r=>{r.classList.remove(e)})});Q(this,cx,()=>{const e=this.innerHTML.trim();this.innerHTML="",oe(this,af,Number(this.getAttribute("min-width")||48)),oe(this,of,Number(this.getAttribute("max-width")||256));const r=this.getAttribute("css-path")?`@import "${this.getAttribute("css-path")}";`:"";this.shadowRoot.innerHTML=`
|
|
2321
2321
|
<style>
|
|
2322
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.
|
|
2322
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.172/dist/css/nineMenu.css";
|
|
2323
2323
|
${r}
|
|
2324
2324
|
|
|
2325
2325
|
:host {
|