@mdzip/editor 1.3.8 → 1.3.12
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/README.md +122 -0
- package/dist/asset-cache.d.ts +11 -0
- package/dist/asset-cache.d.ts.map +1 -1
- package/dist/asset-cache.js +27 -0
- package/dist/asset-cache.js.map +1 -1
- package/dist/library-info.d.ts +2 -2
- package/dist/library-info.js +2 -2
- package/dist/library-info.js.map +1 -1
- package/dist/mermaid.d.ts +46 -0
- package/dist/mermaid.d.ts.map +1 -0
- package/dist/mermaid.js +107 -0
- package/dist/mermaid.js.map +1 -0
- package/dist/rendering.d.ts +38 -1
- package/dist/rendering.d.ts.map +1 -1
- package/dist/rendering.js +34 -11
- package/dist/rendering.js.map +1 -1
- package/dist/view-css.d.ts.map +1 -1
- package/dist/view-css.js +281 -53
- package/dist/view-css.js.map +1 -1
- package/dist/view.d.ts +103 -2
- package/dist/view.d.ts.map +1 -1
- package/dist/view.js +575 -38
- package/dist/view.js.map +1 -1
- package/dist/workspace-view.d.ts +1 -1
- package/dist/workspace-view.d.ts.map +1 -1
- package/dist/workspace-view.js +38 -3
- package/dist/workspace-view.js.map +1 -1
- package/dist/workspace.d.ts +1 -0
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +17 -5
- package/dist/workspace.js.map +1 -1
- package/package.json +14 -2
package/dist/rendering.js
CHANGED
|
@@ -20,13 +20,26 @@ function resolvePurifier() {
|
|
|
20
20
|
purifier = DOMPurify(globalWindow);
|
|
21
21
|
return purifier;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
const BASE_FORBID_TAGS = ['base', 'embed', 'form', 'iframe', 'input', 'link', 'meta', 'object', 'script', 'style'];
|
|
24
|
+
const BASE_FORBID_ATTR = ['style'];
|
|
25
|
+
function lower(value) {
|
|
26
|
+
return value.toLowerCase();
|
|
27
|
+
}
|
|
28
|
+
function buildSanitizeOptions(contributions) {
|
|
29
|
+
const allowSvg = contributions.some((contribution) => contribution.allowSvg);
|
|
30
|
+
const addTags = [...new Set(contributions.flatMap((contribution) => contribution.addTags ?? []))];
|
|
31
|
+
const addAttr = ['class', ...new Set(contributions.flatMap((contribution) => contribution.addAttr ?? []))];
|
|
32
|
+
const unforbidTags = new Set(contributions.flatMap((contribution) => contribution.unforbidTags ?? []).map(lower));
|
|
33
|
+
const unforbidAttr = new Set(contributions.flatMap((contribution) => contribution.unforbidAttr ?? []).map(lower));
|
|
34
|
+
return {
|
|
35
|
+
USE_PROFILES: allowSvg ? { html: true, svg: true, svgFilters: true } : { html: true },
|
|
36
|
+
ADD_TAGS: addTags,
|
|
37
|
+
ADD_ATTR: addAttr,
|
|
38
|
+
FORBID_TAGS: BASE_FORBID_TAGS.filter((tag) => !unforbidTags.has(tag)),
|
|
39
|
+
FORBID_ATTR: BASE_FORBID_ATTR.filter((attr) => !unforbidAttr.has(attr)),
|
|
40
|
+
ALLOW_DATA_ATTR: false
|
|
41
|
+
};
|
|
42
|
+
}
|
|
30
43
|
/**
|
|
31
44
|
* Sanitizes rendered HTML with the editor's default DOMPurify policy.
|
|
32
45
|
*
|
|
@@ -34,9 +47,12 @@ const SANITIZE_OPTIONS = {
|
|
|
34
47
|
* extensions that need to find placeholders again in `mount()` should use
|
|
35
48
|
* class or id markers and carry payloads out-of-band (e.g. a side map keyed
|
|
36
49
|
* by marker id), not element attributes.
|
|
50
|
+
*
|
|
51
|
+
* Pass `contributions` (an extension's {@link MdzipSanitizeContribution}s) to
|
|
52
|
+
* widen the policy just enough for richer output such as inline SVG.
|
|
37
53
|
*/
|
|
38
|
-
export function sanitizeMdzipHtml(html) {
|
|
39
|
-
return resolvePurifier().sanitize(html,
|
|
54
|
+
export function sanitizeMdzipHtml(html, contributions = []) {
|
|
55
|
+
return resolvePurifier().sanitize(html, buildSanitizeOptions(contributions));
|
|
40
56
|
}
|
|
41
57
|
/** Predicate matching one or more exact archive paths (case-insensitive). */
|
|
42
58
|
export function mdzipPathMatcher(...paths) {
|
|
@@ -68,7 +84,11 @@ const marked = new Marked({
|
|
|
68
84
|
// Fall through to escaped plain code.
|
|
69
85
|
}
|
|
70
86
|
}
|
|
71
|
-
|
|
87
|
+
// Preserve the requested language as a class even when it is not a
|
|
88
|
+
// highlightable language (e.g. `mermaid`), so render extensions and
|
|
89
|
+
// client-side highlighters can still find and claim the block.
|
|
90
|
+
const className = requestedLanguage ? ` class="language-${escapeHtml(requestedLanguage)}"` : '';
|
|
91
|
+
return `<pre><code${className}>${escapeHtml(token.text)}</code></pre>`;
|
|
72
92
|
},
|
|
73
93
|
table(token) {
|
|
74
94
|
const renderCell = (cell) => {
|
|
@@ -170,7 +190,10 @@ export class MdzipRenderingService {
|
|
|
170
190
|
}
|
|
171
191
|
const skipSanitize = htmlTransforms.length === 0 && this.renderer.sanitizesOutput === true;
|
|
172
192
|
if (!skipSanitize) {
|
|
173
|
-
|
|
193
|
+
const contributions = this.extensions
|
|
194
|
+
.map((ext) => ext.sanitize)
|
|
195
|
+
.filter((contribution) => contribution !== undefined);
|
|
196
|
+
value = chainRenderStage(value, (html) => sanitizeMdzipHtml(html, contributions), context.signal);
|
|
174
197
|
}
|
|
175
198
|
return value;
|
|
176
199
|
}
|
package/dist/rendering.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rendering.js","sourceRoot":"","sources":["../src/rendering.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,EAAE,MAAM,EAAe,MAAM,QAAQ,CAAC;AAS7C,0EAA0E;AAC1E,8EAA8E;AAC9E,2DAA2D;AAC3D,IAAI,QAAQ,GAA4B,IAAI,CAAC;AAE7C,SAAS,eAAe;IACtB,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,QAAQ,CAAC;IAClB,C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AAC"}
|
package/dist/view-css.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-css.d.ts","sourceRoot":"","sources":["../src/view-css.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"view-css.d.ts","sourceRoot":"","sources":["../src/view-css.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,aAAa,QAkuDzB,CAAC"}
|
package/dist/view-css.js
CHANGED
|
@@ -26,6 +26,49 @@ export const WORKSPACE_CSS = `
|
|
|
26
26
|
box-sizing: border-box;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
.mdzip-root.toolbar-density-compact {
|
|
30
|
+
--mdzip-density-toolbar-padding: 3px 10px;
|
|
31
|
+
--mdzip-density-toolbar-gap: 6px;
|
|
32
|
+
--mdzip-density-toolbar-start-gap: 8px;
|
|
33
|
+
--mdzip-density-toolbar-group-padding: 2px;
|
|
34
|
+
--mdzip-density-toolbar-button-width: 34px;
|
|
35
|
+
--mdzip-density-toolbar-button-height: 30px;
|
|
36
|
+
--mdzip-density-toolbar-compact-button-size: 28px;
|
|
37
|
+
--mdzip-density-toolbar-icon-size: 15px;
|
|
38
|
+
--mdzip-density-toolbar-icon-large-size: 19px;
|
|
39
|
+
--mdzip-density-toolbar-icon-extra-large-size: 22px;
|
|
40
|
+
--mdzip-density-theme-icon-size: 16px;
|
|
41
|
+
--mdzip-density-format-toolbar-gap: 4px;
|
|
42
|
+
--mdzip-density-format-toolbar-group-gap: 1px;
|
|
43
|
+
--mdzip-density-format-button-size: 28px;
|
|
44
|
+
--mdzip-density-format-menu-button-width: 36px;
|
|
45
|
+
--mdzip-density-format-icon-size: 15px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.mdzip-root.toolbar-density-dense {
|
|
49
|
+
--mdzip-density-toolbar-padding: 2px 8px;
|
|
50
|
+
--mdzip-density-toolbar-gap: 4px;
|
|
51
|
+
--mdzip-density-toolbar-start-gap: 6px;
|
|
52
|
+
--mdzip-density-toolbar-group-padding: 1px;
|
|
53
|
+
--mdzip-density-toolbar-button-width: 30px;
|
|
54
|
+
--mdzip-density-toolbar-button-height: 28px;
|
|
55
|
+
--mdzip-density-toolbar-compact-button-size: 26px;
|
|
56
|
+
--mdzip-density-toolbar-icon-size: 14px;
|
|
57
|
+
--mdzip-density-toolbar-icon-large-size: 18px;
|
|
58
|
+
--mdzip-density-toolbar-icon-extra-large-size: 20px;
|
|
59
|
+
--mdzip-density-theme-icon-size: 15px;
|
|
60
|
+
--mdzip-density-format-toolbar-gap: 3px;
|
|
61
|
+
--mdzip-density-format-toolbar-group-gap: 1px;
|
|
62
|
+
--mdzip-density-format-button-size: 26px;
|
|
63
|
+
--mdzip-density-format-menu-button-width: 34px;
|
|
64
|
+
--mdzip-density-format-icon-size: 14px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.mdzip-root.content-density-compact {
|
|
68
|
+
--mdzip-density-editor-content-padding: 20px 28px;
|
|
69
|
+
--mdzip-density-preview-content-padding: 20px 24px 32px;
|
|
70
|
+
}
|
|
71
|
+
|
|
29
72
|
.mdzip-root.mdzip-theme-light {
|
|
30
73
|
color-scheme: light;
|
|
31
74
|
${MDZIP_LIGHT_DEFAULTS_CSS}
|
|
@@ -63,11 +106,14 @@ export const WORKSPACE_CSS = `
|
|
|
63
106
|
}
|
|
64
107
|
|
|
65
108
|
.mdzip-root .toolbar {
|
|
109
|
+
--view-mode-min-left: calc(var(--editor-pane-offset) + 520px);
|
|
110
|
+
--view-mode-max-left: calc(100% - 170px);
|
|
111
|
+
|
|
66
112
|
display: grid;
|
|
67
113
|
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
68
114
|
align-items: center;
|
|
69
115
|
column-gap: 12px;
|
|
70
|
-
padding: 4px 12px;
|
|
116
|
+
padding: var(--mdzip-toolbar-padding, var(--mdzip-density-toolbar-padding, 4px 12px));
|
|
71
117
|
background: var(--mdzip-toolbar-background-color);
|
|
72
118
|
border-bottom: 1px solid var(--mdzip-border-color);
|
|
73
119
|
min-height: 48px;
|
|
@@ -81,7 +127,7 @@ export const WORKSPACE_CSS = `
|
|
|
81
127
|
display: flex;
|
|
82
128
|
align-items: center;
|
|
83
129
|
min-width: 0;
|
|
84
|
-
gap: 10px;
|
|
130
|
+
gap: var(--mdzip-toolbar-gap, var(--mdzip-density-toolbar-gap, 10px));
|
|
85
131
|
}
|
|
86
132
|
|
|
87
133
|
.mdzip-root .toolbar-start {
|
|
@@ -89,7 +135,7 @@ export const WORKSPACE_CSS = `
|
|
|
89
135
|
align-items: center;
|
|
90
136
|
justify-self: start;
|
|
91
137
|
min-width: 0;
|
|
92
|
-
gap: 12px;
|
|
138
|
+
gap: var(--mdzip-toolbar-start-gap, var(--mdzip-density-toolbar-start-gap, 12px));
|
|
93
139
|
}
|
|
94
140
|
|
|
95
141
|
.mdzip-root.navigation-pane-visible {
|
|
@@ -174,7 +220,7 @@ export const WORKSPACE_CSS = `
|
|
|
174
220
|
align-items: center;
|
|
175
221
|
gap: 4px;
|
|
176
222
|
justify-self: center;
|
|
177
|
-
padding: 3px;
|
|
223
|
+
padding: var(--mdzip-toolbar-group-padding, var(--mdzip-density-toolbar-group-padding, 3px));
|
|
178
224
|
border: 1px solid var(--mdzip-widget-border-color);
|
|
179
225
|
border-radius: 8px;
|
|
180
226
|
background: var(--mdzip-widget-background-color);
|
|
@@ -182,7 +228,11 @@ export const WORKSPACE_CSS = `
|
|
|
182
228
|
|
|
183
229
|
.mdzip-root .view-mode-toggle-group {
|
|
184
230
|
position: absolute;
|
|
185
|
-
left:
|
|
231
|
+
left: clamp(
|
|
232
|
+
var(--view-mode-min-left),
|
|
233
|
+
calc((100% + var(--workspace-pane-offset)) / 2),
|
|
234
|
+
var(--view-mode-max-left)
|
|
235
|
+
);
|
|
186
236
|
top: 50%;
|
|
187
237
|
transform: translate(-50%, -50%);
|
|
188
238
|
gap: 2px;
|
|
@@ -193,8 +243,8 @@ export const WORKSPACE_CSS = `
|
|
|
193
243
|
}
|
|
194
244
|
|
|
195
245
|
.mdzip-root .icon-toggle {
|
|
196
|
-
width: 42px;
|
|
197
|
-
height: 36px;
|
|
246
|
+
width: var(--mdzip-toolbar-button-width, var(--mdzip-toolbar-button-size, var(--mdzip-density-toolbar-button-width, 42px)));
|
|
247
|
+
height: var(--mdzip-toolbar-button-height, var(--mdzip-toolbar-button-size, var(--mdzip-density-toolbar-button-height, 36px)));
|
|
198
248
|
padding: 0;
|
|
199
249
|
cursor: pointer;
|
|
200
250
|
background: transparent;
|
|
@@ -221,16 +271,16 @@ export const WORKSPACE_CSS = `
|
|
|
221
271
|
}
|
|
222
272
|
|
|
223
273
|
.mdzip-root .toggle-icon {
|
|
224
|
-
width: 17px;
|
|
225
|
-
height: 17px;
|
|
274
|
+
width: var(--mdzip-toolbar-icon-size, var(--mdzip-density-toolbar-icon-size, 17px));
|
|
275
|
+
height: var(--mdzip-toolbar-icon-size, var(--mdzip-density-toolbar-icon-size, 17px));
|
|
226
276
|
fill: none;
|
|
227
277
|
stroke: currentColor;
|
|
228
278
|
}
|
|
229
279
|
|
|
230
280
|
.mdzip-root .view-mode-toggle {
|
|
231
281
|
position: relative;
|
|
232
|
-
width: 32px;
|
|
233
|
-
height: 32px;
|
|
282
|
+
width: var(--mdzip-toolbar-compact-button-size, var(--mdzip-density-toolbar-compact-button-size, 32px));
|
|
283
|
+
height: var(--mdzip-toolbar-compact-button-size, var(--mdzip-density-toolbar-compact-button-size, 32px));
|
|
234
284
|
border-radius: 6px;
|
|
235
285
|
color: var(--mdzip-control-foreground-color);
|
|
236
286
|
}
|
|
@@ -257,13 +307,13 @@ export const WORKSPACE_CSS = `
|
|
|
257
307
|
}
|
|
258
308
|
|
|
259
309
|
.mdzip-root .view-mode-toggle .toggle-icon {
|
|
260
|
-
width: 1.5em;
|
|
261
|
-
height: 1.5em;
|
|
310
|
+
width: var(--mdzip-toolbar-icon-large-size, var(--mdzip-density-toolbar-icon-large-size, 1.5em));
|
|
311
|
+
height: var(--mdzip-toolbar-icon-large-size, var(--mdzip-density-toolbar-icon-large-size, 1.5em));
|
|
262
312
|
}
|
|
263
313
|
|
|
264
314
|
.mdzip-root .nav-toggle {
|
|
265
|
-
width: 32px;
|
|
266
|
-
height: 32px;
|
|
315
|
+
width: var(--mdzip-toolbar-compact-button-size, var(--mdzip-density-toolbar-compact-button-size, 32px));
|
|
316
|
+
height: var(--mdzip-toolbar-compact-button-size, var(--mdzip-density-toolbar-compact-button-size, 32px));
|
|
267
317
|
border-radius: 6px;
|
|
268
318
|
}
|
|
269
319
|
|
|
@@ -272,14 +322,22 @@ export const WORKSPACE_CSS = `
|
|
|
272
322
|
color: var(--mdzip-link-color);
|
|
273
323
|
}
|
|
274
324
|
|
|
325
|
+
.mdzip-root .nav-toggle.convert-mdz-toggle {
|
|
326
|
+
color: var(--mdzip-link-color);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.mdzip-root .nav-toggle.convert-mdz-toggle:hover:not(:disabled) {
|
|
330
|
+
background: var(--mdzip-control-hover-background-color);
|
|
331
|
+
}
|
|
332
|
+
|
|
275
333
|
.mdzip-root .nav-toggle .toggle-icon {
|
|
276
|
-
width: 1.9em;
|
|
277
|
-
height: 1.9em;
|
|
334
|
+
width: var(--mdzip-toolbar-icon-extra-large-size, var(--mdzip-density-toolbar-icon-extra-large-size, 1.9em));
|
|
335
|
+
height: var(--mdzip-toolbar-icon-extra-large-size, var(--mdzip-density-toolbar-icon-extra-large-size, 1.9em));
|
|
278
336
|
}
|
|
279
337
|
|
|
280
338
|
.mdzip-root .zoom-toggle .toggle-icon {
|
|
281
|
-
width: 1.5em;
|
|
282
|
-
height: 1.5em;
|
|
339
|
+
width: var(--mdzip-toolbar-icon-large-size, var(--mdzip-density-toolbar-icon-large-size, 1.5em));
|
|
340
|
+
height: var(--mdzip-toolbar-icon-large-size, var(--mdzip-density-toolbar-icon-large-size, 1.5em));
|
|
283
341
|
}
|
|
284
342
|
|
|
285
343
|
.mdzip-root .zoom-toggle.active {
|
|
@@ -291,15 +349,15 @@ export const WORKSPACE_CSS = `
|
|
|
291
349
|
display: flex;
|
|
292
350
|
align-items: center;
|
|
293
351
|
gap: 2px;
|
|
294
|
-
padding: 3px;
|
|
352
|
+
padding: var(--mdzip-toolbar-group-padding, var(--mdzip-density-toolbar-group-padding, 3px));
|
|
295
353
|
border: 1px solid var(--mdzip-widget-border-color);
|
|
296
354
|
border-radius: 8px;
|
|
297
355
|
background: var(--mdzip-widget-background-color);
|
|
298
356
|
}
|
|
299
357
|
|
|
300
358
|
.mdzip-root .theme-toggle {
|
|
301
|
-
width: 32px;
|
|
302
|
-
height: 32px;
|
|
359
|
+
width: var(--mdzip-toolbar-compact-button-size, var(--mdzip-density-toolbar-compact-button-size, 32px));
|
|
360
|
+
height: var(--mdzip-toolbar-compact-button-size, var(--mdzip-density-toolbar-compact-button-size, 32px));
|
|
303
361
|
border-radius: 6px;
|
|
304
362
|
}
|
|
305
363
|
|
|
@@ -309,8 +367,8 @@ export const WORKSPACE_CSS = `
|
|
|
309
367
|
}
|
|
310
368
|
|
|
311
369
|
.mdzip-root .theme-toggle .toggle-icon {
|
|
312
|
-
width: 18px;
|
|
313
|
-
height: 18px;
|
|
370
|
+
width: var(--mdzip-theme-icon-size, var(--mdzip-density-theme-icon-size, 18px));
|
|
371
|
+
height: var(--mdzip-theme-icon-size, var(--mdzip-density-theme-icon-size, 18px));
|
|
314
372
|
}
|
|
315
373
|
|
|
316
374
|
.mdzip-root .workspace-shell {
|
|
@@ -412,7 +470,10 @@ export const WORKSPACE_CSS = `
|
|
|
412
470
|
gap: 9px;
|
|
413
471
|
width: 100%;
|
|
414
472
|
min-height: 34px;
|
|
415
|
-
padding:
|
|
473
|
+
/* No vertical padding: row height comes from min-height, and zero top/bottom
|
|
474
|
+
padding lets the stretched .nav-indent guide cells fill the full row so the
|
|
475
|
+
per-row rails meet between siblings instead of leaving padding-sized gaps. */
|
|
476
|
+
padding: 0 9px;
|
|
416
477
|
border: none;
|
|
417
478
|
border-radius: 4px;
|
|
418
479
|
background: transparent;
|
|
@@ -431,34 +492,73 @@ export const WORKSPACE_CSS = `
|
|
|
431
492
|
background: var(--mdzip-hover-background-color);
|
|
432
493
|
}
|
|
433
494
|
|
|
495
|
+
/* Indentation comes from per-row guide cells (.nav-indent), not container
|
|
496
|
+
margins, so each row owns its guide lines. */
|
|
434
497
|
.mdzip-root .nav-directory-children {
|
|
435
498
|
position: relative;
|
|
436
|
-
margin-left: 19px;
|
|
437
|
-
padding-left: 14px;
|
|
438
499
|
}
|
|
439
500
|
|
|
440
|
-
|
|
441
|
-
|
|
501
|
+
/* One guide cell per ancestor depth, prepended to each nested row. Fixed width
|
|
502
|
+
gives the indentation; the rails/elbow are painted within the cell at the
|
|
503
|
+
row's own height, so they never overshoot an expanded last subfolder.
|
|
504
|
+
|
|
505
|
+
--nav-guide-x positions the rail so it drops straight from the parent
|
|
506
|
+
folder's icon: the icon sits 19px (caret 10px + the 9px row gap) right of its
|
|
507
|
+
disclosure column, and because the per-level step (cell 16px + 9px gap = 25)
|
|
508
|
+
equals the rail-to-icon distance, the same offset keeps every depth aligned. */
|
|
509
|
+
.mdzip-root .nav-indent {
|
|
510
|
+
flex: 0 0 16px;
|
|
511
|
+
align-self: stretch;
|
|
442
512
|
position: relative;
|
|
513
|
+
--nav-guide-x: 19px;
|
|
443
514
|
}
|
|
444
515
|
|
|
445
|
-
|
|
446
|
-
.mdzip-root .nav-
|
|
516
|
+
/* Ancestor column with more siblings below: continuous full-height rail. */
|
|
517
|
+
.mdzip-root .nav-indent-rail::before {
|
|
447
518
|
content: "";
|
|
448
519
|
position: absolute;
|
|
449
|
-
left:
|
|
520
|
+
left: var(--nav-guide-x);
|
|
450
521
|
top: 0;
|
|
451
522
|
bottom: 0;
|
|
452
|
-
width:
|
|
523
|
+
width: 1px;
|
|
524
|
+
background: var(--mdzip-tree-guide-color);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/* Connector to this row: vertical down to the row center (elbow └), extended
|
|
528
|
+
full-height for a tee (├) when the row's folder has siblings below. */
|
|
529
|
+
.mdzip-root .nav-indent-connector::before {
|
|
530
|
+
content: "";
|
|
531
|
+
position: absolute;
|
|
532
|
+
left: var(--nav-guide-x);
|
|
533
|
+
top: 0;
|
|
534
|
+
height: 50%;
|
|
535
|
+
width: 1px;
|
|
453
536
|
background: var(--mdzip-tree-guide-color);
|
|
454
|
-
-webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 22 34' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.5 0 V17.5 H22' fill='none' stroke='black' stroke-width='1'/%3E%3C/svg%3E") left top / 22px 100% no-repeat;
|
|
455
|
-
mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 22 34' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.5 0 V17.5 H22' fill='none' stroke='black' stroke-width='1'/%3E%3C/svg%3E") left top / 22px 100% no-repeat;
|
|
456
537
|
}
|
|
457
538
|
|
|
458
|
-
.mdzip-root .nav-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
539
|
+
.mdzip-root .nav-indent-connector.nav-indent-continues::before {
|
|
540
|
+
height: 100%;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/* Horizontal arm from the connector rail to the row's caret/icon. Reaches the
|
|
544
|
+
disclosure triangle that sits one row-gap past the cell (folders). */
|
|
545
|
+
.mdzip-root .nav-indent-connector::after {
|
|
546
|
+
content: "";
|
|
547
|
+
position: absolute;
|
|
548
|
+
left: var(--nav-guide-x);
|
|
549
|
+
right: -9px;
|
|
550
|
+
top: 50%;
|
|
551
|
+
height: 1px;
|
|
552
|
+
background: var(--mdzip-tree-guide-color);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/* Files have no disclosure triangle in the caret slot, so extend the arm across
|
|
556
|
+
it (the empty 10px caret plus the 9px row gaps on either side) to meet the
|
|
557
|
+
file icon; folders keep the short arm because their triangle already sits at
|
|
558
|
+
the cell edge. The right offset is measured from the cell edge, so this holds
|
|
559
|
+
regardless of where --nav-guide-x places the rail. */
|
|
560
|
+
.mdzip-root .nav-file > .nav-indent-connector::after {
|
|
561
|
+
right: calc(-1 * (10px + 2 * 9px));
|
|
462
562
|
}
|
|
463
563
|
|
|
464
564
|
.mdzip-root .nav-caret {
|
|
@@ -746,7 +846,7 @@ export const WORKSPACE_CSS = `
|
|
|
746
846
|
.mdzip-root .edit-toolbar {
|
|
747
847
|
display: flex;
|
|
748
848
|
align-items: center;
|
|
749
|
-
gap: 7px;
|
|
849
|
+
gap: var(--mdzip-format-toolbar-gap, var(--mdzip-density-format-toolbar-gap, 7px));
|
|
750
850
|
min-height: 32px;
|
|
751
851
|
padding: 0;
|
|
752
852
|
overflow: visible;
|
|
@@ -768,7 +868,7 @@ export const WORKSPACE_CSS = `
|
|
|
768
868
|
.mdzip-root .edit-toolbar-group {
|
|
769
869
|
display: flex;
|
|
770
870
|
align-items: center;
|
|
771
|
-
gap: 2px;
|
|
871
|
+
gap: var(--mdzip-format-toolbar-group-gap, var(--mdzip-density-format-toolbar-group-gap, 2px));
|
|
772
872
|
flex: 0 0 auto;
|
|
773
873
|
}
|
|
774
874
|
|
|
@@ -777,8 +877,8 @@ export const WORKSPACE_CSS = `
|
|
|
777
877
|
align-items: center;
|
|
778
878
|
justify-content: center;
|
|
779
879
|
gap: 2px;
|
|
780
|
-
width: 32px;
|
|
781
|
-
height: 32px;
|
|
880
|
+
width: var(--mdzip-format-button-size, var(--mdzip-density-format-button-size, 32px));
|
|
881
|
+
height: var(--mdzip-format-button-size, var(--mdzip-density-format-button-size, 32px));
|
|
782
882
|
padding: 0;
|
|
783
883
|
border: 0;
|
|
784
884
|
border-radius: 5px;
|
|
@@ -803,7 +903,7 @@ export const WORKSPACE_CSS = `
|
|
|
803
903
|
}
|
|
804
904
|
|
|
805
905
|
.mdzip-root .edit-toolbar .format-menu-toggle {
|
|
806
|
-
width: 42px;
|
|
906
|
+
width: var(--mdzip-format-menu-button-width, var(--mdzip-density-format-menu-button-width, 42px));
|
|
807
907
|
gap: 2px;
|
|
808
908
|
}
|
|
809
909
|
|
|
@@ -854,8 +954,8 @@ export const WORKSPACE_CSS = `
|
|
|
854
954
|
}
|
|
855
955
|
|
|
856
956
|
.mdzip-root .format-icon {
|
|
857
|
-
width: 17px;
|
|
858
|
-
height: 17px;
|
|
957
|
+
width: var(--mdzip-format-icon-size, var(--mdzip-density-format-icon-size, 17px));
|
|
958
|
+
height: var(--mdzip-format-icon-size, var(--mdzip-density-format-icon-size, 17px));
|
|
859
959
|
fill: none;
|
|
860
960
|
stroke: currentColor;
|
|
861
961
|
}
|
|
@@ -906,7 +1006,7 @@ export const WORKSPACE_CSS = `
|
|
|
906
1006
|
.mdzip-root .preview-content {
|
|
907
1007
|
max-width: 900px;
|
|
908
1008
|
margin: 0 auto;
|
|
909
|
-
padding: 36px 32px 48px;
|
|
1009
|
+
padding: var(--mdzip-preview-content-padding, var(--mdzip-density-preview-content-padding, 36px 32px 48px));
|
|
910
1010
|
line-height: 1.55;
|
|
911
1011
|
font-size: calc(16px * var(--mdz-zoom));
|
|
912
1012
|
}
|
|
@@ -1027,6 +1127,24 @@ export const WORKSPACE_CSS = `
|
|
|
1027
1127
|
border-radius: 4px;
|
|
1028
1128
|
}
|
|
1029
1129
|
|
|
1130
|
+
.mdzip-root .preview-content img.mdzip-image-left,
|
|
1131
|
+
.mdzip-root .preview-content img.mdzip-image-wrap-left {
|
|
1132
|
+
float: left;
|
|
1133
|
+
margin: 0.25em 1em 0.75em 0;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
.mdzip-root .preview-content img.mdzip-image-right,
|
|
1137
|
+
.mdzip-root .preview-content img.mdzip-image-wrap-right {
|
|
1138
|
+
float: right;
|
|
1139
|
+
margin: 0.25em 0 0.75em 1em;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
.mdzip-root .preview-content img.mdzip-image-center {
|
|
1143
|
+
display: block;
|
|
1144
|
+
margin-left: auto;
|
|
1145
|
+
margin-right: auto;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1030
1148
|
/* Progressive image hydration. Each archive image mounts inside a collapsed
|
|
1031
1149
|
slot so the text stays compact and immediately readable; when the image
|
|
1032
1150
|
resolves, the slot eases open (0fr -> 1fr) to the height reserved from its
|
|
@@ -1044,10 +1162,24 @@ export const WORKSPACE_CSS = `
|
|
|
1044
1162
|
grid-template-rows: 1fr;
|
|
1045
1163
|
}
|
|
1046
1164
|
|
|
1165
|
+
.mdzip-root .preview-content .mdzip-image-slot.mdzip-image-animation-off {
|
|
1166
|
+
transition: none;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1047
1169
|
.mdzip-root .preview-content .mdzip-image-slot > img {
|
|
1048
1170
|
min-height: 0;
|
|
1049
1171
|
}
|
|
1050
1172
|
|
|
1173
|
+
.mdzip-root .preview-content .mdzip-image-slot.mdzip-image-align-left {
|
|
1174
|
+
float: left;
|
|
1175
|
+
margin: 0.25em 1em 0.75em 0;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
.mdzip-root .preview-content .mdzip-image-slot.mdzip-image-align-right {
|
|
1179
|
+
float: right;
|
|
1180
|
+
margin: 0.25em 0 0.75em 1em;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1051
1183
|
.mdzip-root .preview-content img.mdzip-image-loading {
|
|
1052
1184
|
background: var(--mdzip-control-background-color, rgba(127, 127, 127, 0.12));
|
|
1053
1185
|
animation: mdzip-image-pulse 1.2s ease-in-out infinite;
|
|
@@ -1067,6 +1199,30 @@ export const WORKSPACE_CSS = `
|
|
|
1067
1199
|
}
|
|
1068
1200
|
}
|
|
1069
1201
|
|
|
1202
|
+
.mdzip-root .preview-content .mdzip-mermaid {
|
|
1203
|
+
display: flex;
|
|
1204
|
+
justify-content: center;
|
|
1205
|
+
margin: 1em 0;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
.mdzip-root .preview-content .mdzip-mermaid > svg {
|
|
1209
|
+
max-width: 100%;
|
|
1210
|
+
height: auto;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
.mdzip-root .preview-content .mdzip-mermaid-error {
|
|
1214
|
+
margin: 1em 0;
|
|
1215
|
+
padding: 0.75em 1em;
|
|
1216
|
+
border-radius: 6px;
|
|
1217
|
+
border: 1px solid var(--mdzip-error-border-color, rgba(220, 70, 70, 0.5));
|
|
1218
|
+
background: var(--mdzip-error-background-color, rgba(220, 70, 70, 0.08));
|
|
1219
|
+
color: var(--mdzip-error-color, #b03030);
|
|
1220
|
+
font-family: "Cascadia Code", Consolas, monospace;
|
|
1221
|
+
font-size: 0.85em;
|
|
1222
|
+
white-space: pre-wrap;
|
|
1223
|
+
word-break: break-word;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1070
1226
|
.mdzip-root .plain-text-preview {
|
|
1071
1227
|
margin: 0;
|
|
1072
1228
|
white-space: pre-wrap;
|
|
@@ -1210,6 +1366,29 @@ export const WORKSPACE_CSS = `
|
|
|
1210
1366
|
font-size: 13px;
|
|
1211
1367
|
}
|
|
1212
1368
|
|
|
1369
|
+
.mdzip-root .title-dialog select {
|
|
1370
|
+
width: 100%;
|
|
1371
|
+
border: 1px solid var(--mdzip-widget-border-color);
|
|
1372
|
+
background: var(--mdzip-editor-background-color);
|
|
1373
|
+
color: var(--mdzip-editor-foreground-color);
|
|
1374
|
+
border-radius: 4px;
|
|
1375
|
+
padding: 6px 8px;
|
|
1376
|
+
font-size: 13px;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
.mdzip-root .title-dialog input:disabled,
|
|
1380
|
+
.mdzip-root .title-dialog select:disabled {
|
|
1381
|
+
border-color: var(--mdzip-border-color);
|
|
1382
|
+
background: var(--mdzip-secondary-background-color);
|
|
1383
|
+
color: var(--mdzip-muted-foreground-color);
|
|
1384
|
+
opacity: 0.72;
|
|
1385
|
+
cursor: not-allowed;
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
.mdzip-root .title-dialog input:disabled::placeholder {
|
|
1389
|
+
color: var(--mdzip-muted-foreground-color);
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1213
1392
|
.mdzip-root .title-dialog-validation {
|
|
1214
1393
|
color: #cf222e !important;
|
|
1215
1394
|
}
|
|
@@ -1241,6 +1420,57 @@ export const WORKSPACE_CSS = `
|
|
|
1241
1420
|
color: var(--mdzip-accent-foreground-color);
|
|
1242
1421
|
}
|
|
1243
1422
|
|
|
1423
|
+
.mdzip-root .image-insert-dialog {
|
|
1424
|
+
width: min(460px, calc(100vw - 32px));
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
.mdzip-root .image-insert-options {
|
|
1428
|
+
display: grid;
|
|
1429
|
+
gap: 6px;
|
|
1430
|
+
margin: 10px 0;
|
|
1431
|
+
padding: 10px;
|
|
1432
|
+
border: 1px solid var(--mdzip-widget-border-color);
|
|
1433
|
+
border-radius: 4px;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
.mdzip-root .image-insert-options legend {
|
|
1437
|
+
padding: 0 4px;
|
|
1438
|
+
color: var(--mdzip-muted-foreground-color);
|
|
1439
|
+
font-size: 12px;
|
|
1440
|
+
font-weight: 600;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
.mdzip-root .image-insert-options label,
|
|
1444
|
+
.mdzip-root .image-insert-field {
|
|
1445
|
+
display: grid;
|
|
1446
|
+
gap: 4px;
|
|
1447
|
+
font-size: 12px;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
.mdzip-root .image-insert-options label {
|
|
1451
|
+
grid-template-columns: auto 1fr;
|
|
1452
|
+
align-items: center;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
.mdzip-root .image-insert-options input {
|
|
1456
|
+
width: auto;
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
.mdzip-root .image-insert-grid {
|
|
1460
|
+
display: grid;
|
|
1461
|
+
grid-template-columns: 1fr 1fr;
|
|
1462
|
+
gap: 8px;
|
|
1463
|
+
margin-top: 8px;
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
.mdzip-root .image-insert-field {
|
|
1467
|
+
margin-top: 8px;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
.mdzip-root .image-insert-field.field-disabled {
|
|
1471
|
+
color: var(--mdzip-muted-foreground-color);
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1244
1474
|
.mdzip-root .metadata-dialog dl {
|
|
1245
1475
|
margin: 12px 0 0;
|
|
1246
1476
|
}
|
|
@@ -1331,11 +1561,9 @@ export const WORKSPACE_CSS = `
|
|
|
1331
1561
|
.mdzip-root { --nav-pane-width: 220px; }
|
|
1332
1562
|
}
|
|
1333
1563
|
|
|
1334
|
-
/* Stack the formatting toolbar
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
280px) navigation pane open everything shifts right, so stack earlier. */
|
|
1338
|
-
@media (max-width: 1000px) {
|
|
1564
|
+
/* Stack the formatting toolbar only once the pushed-right view-mode toggle no
|
|
1565
|
+
longer has enough room between the edit tools and the right-side controls. */
|
|
1566
|
+
@media (max-width: 760px) {
|
|
1339
1567
|
.mdzip-root .toolbar {
|
|
1340
1568
|
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
1341
1569
|
row-gap: 4px;
|
|
@@ -1364,7 +1592,7 @@ export const WORKSPACE_CSS = `
|
|
|
1364
1592
|
}
|
|
1365
1593
|
}
|
|
1366
1594
|
|
|
1367
|
-
@media (max-width:
|
|
1595
|
+
@media (max-width: 1100px) {
|
|
1368
1596
|
.mdzip-root.navigation-pane-visible .toolbar {
|
|
1369
1597
|
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
1370
1598
|
row-gap: 4px;
|
package/dist/view-css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-css.js","sourceRoot":"","sources":["../src/view-css.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,MAAM,wBAAwB,GAAG,qBAAqB,CAAC,UAAU,CAC/D,UAAU,EACV,kBAAkB,CACnB,CAAC;AACF,MAAM,uBAAuB,GAAG,oBAAoB,CAAC,UAAU,CAC7D,UAAU,EACV,kBAAkB,CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;IAUzB,mBAAmB
|
|
1
|
+
{"version":3,"file":"view-css.js","sourceRoot":"","sources":["../src/view-css.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,MAAM,wBAAwB,GAAG,qBAAqB,CAAC,UAAU,CAC/D,UAAU,EACV,kBAAkB,CACnB,CAAC;AACF,MAAM,uBAAuB,GAAG,oBAAoB,CAAC,UAAU,CAC7D,UAAU,EACV,kBAAkB,CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;IAUzB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4DnB,wBAAwB;;;;;IAKxB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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