@inkandswitch/patchwork-pkg-base 0.0.46 → 0.0.48
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/package.json +1 -1
- package/packages/codemirror-markdown/dist/extensions/markdown.js +57 -26
- package/packages/codemirror-markdown/dist/extensions/markdown.js.map +2 -2
- package/packages/theming/dist/{chunk-U7SC4JPE.js → chunk-GIPQLUDU.js} +2 -2
- package/packages/theming/dist/{chunk-U7SC4JPE.js.map → chunk-GIPQLUDU.js.map} +1 -1
- package/packages/theming/dist/main.js +1 -1
- package/packages/theming/dist/{theme-editor-datatype-CIXRKEFF.js → theme-editor-datatype-TMYH7U2S.js} +2 -2
- package/packages/theming/dist/theme-editor.js +1 -1
- /package/packages/theming/dist/{theme-editor-datatype-CIXRKEFF.js.map → theme-editor-datatype-TMYH7U2S.js.map} +0 -0
package/package.json
CHANGED
|
@@ -3070,34 +3070,52 @@ import { EditorView as EditorView4, keymap } from "@codemirror/view";
|
|
|
3070
3070
|
|
|
3071
3071
|
// src/extensions/formatting.ts
|
|
3072
3072
|
import { EditorSelection as EditorSelection3 } from "@codemirror/state";
|
|
3073
|
+
var MARKS = ["**", "__", "~~", "*", "_", "`"];
|
|
3073
3074
|
var toggleWrap = (mark) => ({ state, dispatch }) => {
|
|
3074
3075
|
const selection = state.changeByRange((range) => {
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3076
|
+
let from = range.from;
|
|
3077
|
+
let to = range.to;
|
|
3078
|
+
for (; ; ) {
|
|
3079
|
+
const found = MARKS.find(
|
|
3080
|
+
(m) => state.sliceDoc(from - m.length, from) === m && state.sliceDoc(to, to + m.length) === m
|
|
3081
|
+
);
|
|
3082
|
+
if (!found) break;
|
|
3083
|
+
if (found === mark) {
|
|
3084
|
+
return {
|
|
3085
|
+
changes: [
|
|
3086
|
+
{ from: from - mark.length, to: from },
|
|
3087
|
+
{ from: to, to: to + mark.length }
|
|
3088
|
+
],
|
|
3089
|
+
range: EditorSelection3.range(
|
|
3090
|
+
range.from - mark.length,
|
|
3091
|
+
range.to - mark.length
|
|
3092
|
+
)
|
|
3093
|
+
};
|
|
3094
|
+
}
|
|
3095
|
+
from -= found.length;
|
|
3096
|
+
to += found.length;
|
|
3089
3097
|
}
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3098
|
+
from = range.from;
|
|
3099
|
+
to = range.to;
|
|
3100
|
+
for (; ; ) {
|
|
3101
|
+
const found = MARKS.find(
|
|
3102
|
+
(m) => to - from >= m.length * 2 && state.sliceDoc(from, from + m.length) === m && state.sliceDoc(to - m.length, to) === m
|
|
3103
|
+
);
|
|
3104
|
+
if (!found) break;
|
|
3105
|
+
if (found === mark) {
|
|
3106
|
+
return {
|
|
3107
|
+
changes: [
|
|
3108
|
+
{ from, to: from + mark.length },
|
|
3109
|
+
{ from: to - mark.length, to }
|
|
3110
|
+
],
|
|
3111
|
+
range: EditorSelection3.range(
|
|
3112
|
+
range.from,
|
|
3113
|
+
range.to - mark.length * 2
|
|
3114
|
+
)
|
|
3115
|
+
};
|
|
3116
|
+
}
|
|
3117
|
+
from += found.length;
|
|
3118
|
+
to -= found.length;
|
|
3101
3119
|
}
|
|
3102
3120
|
return {
|
|
3103
3121
|
changes: [
|
|
@@ -3173,6 +3191,20 @@ var markdownStyles = (style) => ({
|
|
|
3173
3191
|
".cm-content li": {
|
|
3174
3192
|
marginBottom: 0
|
|
3175
3193
|
},
|
|
3194
|
+
".cm-bullet": {
|
|
3195
|
+
display: "inline-block",
|
|
3196
|
+
width: "1ch"
|
|
3197
|
+
},
|
|
3198
|
+
".cm-bullet::before": {
|
|
3199
|
+
content: '""',
|
|
3200
|
+
display: "inline-block",
|
|
3201
|
+
width: "0.4em",
|
|
3202
|
+
height: "0.4em",
|
|
3203
|
+
borderRadius: "50%",
|
|
3204
|
+
background: "currentColor",
|
|
3205
|
+
color: "var(--text-editor-line)",
|
|
3206
|
+
verticalAlign: "0.15em"
|
|
3207
|
+
},
|
|
3176
3208
|
".cm-activeLine": {
|
|
3177
3209
|
backgroundColor: "inherit"
|
|
3178
3210
|
},
|
|
@@ -3370,7 +3402,6 @@ var bullets = ViewPlugin2.fromClass(
|
|
|
3370
3402
|
var BulletWidget = class extends WidgetType {
|
|
3371
3403
|
toDOM() {
|
|
3372
3404
|
const span = document.createElement("span");
|
|
3373
|
-
span.textContent = "\u2022";
|
|
3374
3405
|
span.className = "cm-bullet";
|
|
3375
3406
|
return span;
|
|
3376
3407
|
}
|