@bitcobblers/wod-wiki-ui 0.50.2186 → 0.50.2188
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/{chunk-DKPPJXUH.mjs → chunk-UAIJTD74.mjs} +4 -73
- package/dist/chunk-UAIJTD74.mjs.map +1 -0
- package/dist/extensions/index.cjs +1 -70
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.mjs +1 -1
- package/dist/index.cjs +7 -76
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -0
- package/package.json +4 -4
- package/dist/chunk-DKPPJXUH.mjs.map +0 -1
|
@@ -952,40 +952,6 @@ var SectionGeometryPlugin = class {
|
|
|
952
952
|
}
|
|
953
953
|
};
|
|
954
954
|
var sectionGeometry = view.ViewPlugin.fromClass(SectionGeometryPlugin);
|
|
955
|
-
var WorkoutFooterWidget = class extends view.WidgetType {
|
|
956
|
-
eq(_other) {
|
|
957
|
-
return true;
|
|
958
|
-
}
|
|
959
|
-
toDOM() {
|
|
960
|
-
const el = document.createElement("div");
|
|
961
|
-
el.className = "cm-wod-block-footer";
|
|
962
|
-
return el;
|
|
963
|
-
}
|
|
964
|
-
get estimatedHeight() {
|
|
965
|
-
return 28;
|
|
966
|
-
}
|
|
967
|
-
get block() {
|
|
968
|
-
return true;
|
|
969
|
-
}
|
|
970
|
-
};
|
|
971
|
-
var WorkoutInsertSpacerWidget = class extends view.WidgetType {
|
|
972
|
-
eq(_other) {
|
|
973
|
-
return true;
|
|
974
|
-
}
|
|
975
|
-
toDOM() {
|
|
976
|
-
const el = document.createElement("div");
|
|
977
|
-
el.className = "cm-wod-insert-spacer";
|
|
978
|
-
return el;
|
|
979
|
-
}
|
|
980
|
-
get estimatedHeight() {
|
|
981
|
-
return 28;
|
|
982
|
-
}
|
|
983
|
-
get block() {
|
|
984
|
-
return true;
|
|
985
|
-
}
|
|
986
|
-
};
|
|
987
|
-
var footerWidget = new WorkoutFooterWidget();
|
|
988
|
-
var insertSpacerWidget = new WorkoutInsertSpacerWidget();
|
|
989
955
|
var fenceOpenDeco = view.Decoration.line({
|
|
990
956
|
attributes: { class: "cm-wod-fence cm-wod-fence-open" }
|
|
991
957
|
});
|
|
@@ -998,11 +964,8 @@ var workoutInnerDeco = view.Decoration.line({
|
|
|
998
964
|
function buildWorkoutDecorations(state$1) {
|
|
999
965
|
const builder = new state.RangeSetBuilder();
|
|
1000
966
|
const { sections } = state$1.field(sectionField);
|
|
1001
|
-
const cursorHead = state$1.selection.main.head;
|
|
1002
|
-
const cursorLineNum = state$1.doc.lineAt(cursorHead).number;
|
|
1003
967
|
for (const section of sections) {
|
|
1004
968
|
if (section.type !== "time" && section.type !== "log") continue;
|
|
1005
|
-
const isCursorInside = cursorLineNum > section.startLine && cursorLineNum < section.endLine;
|
|
1006
969
|
const startLine = state$1.doc.line(section.startLine);
|
|
1007
970
|
const endLine = state$1.doc.line(section.endLine);
|
|
1008
971
|
if (section.endLine <= section.startLine) {
|
|
@@ -1013,20 +976,6 @@ function buildWorkoutDecorations(state$1) {
|
|
|
1013
976
|
for (let l = section.startLine + 1; l < section.endLine; l++) {
|
|
1014
977
|
const line = state$1.doc.line(l);
|
|
1015
978
|
builder.add(line.from, line.from, workoutInnerDeco);
|
|
1016
|
-
if (isCursorInside && l === cursorLineNum) {
|
|
1017
|
-
builder.add(
|
|
1018
|
-
line.to,
|
|
1019
|
-
line.to,
|
|
1020
|
-
view.Decoration.widget({ widget: insertSpacerWidget, block: true, side: 1 })
|
|
1021
|
-
);
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
if (!isCursorInside) {
|
|
1025
|
-
builder.add(
|
|
1026
|
-
endLine.from,
|
|
1027
|
-
endLine.from,
|
|
1028
|
-
view.Decoration.widget({ widget: footerWidget, block: true, side: -1 })
|
|
1029
|
-
);
|
|
1030
979
|
}
|
|
1031
980
|
builder.add(endLine.from, endLine.from, fenceCloseDeco);
|
|
1032
981
|
}
|
|
@@ -1037,9 +986,7 @@ var scriptBlockDecoField = state.StateField.define({
|
|
|
1037
986
|
return buildWorkoutDecorations(state);
|
|
1038
987
|
},
|
|
1039
988
|
update(deco, tr) {
|
|
1040
|
-
if (tr.docChanged
|
|
1041
|
-
return buildWorkoutDecorations(tr.state);
|
|
1042
|
-
}
|
|
989
|
+
if (tr.docChanged) return buildWorkoutDecorations(tr.state);
|
|
1043
990
|
return deco;
|
|
1044
991
|
},
|
|
1045
992
|
provide: (f) => view.EditorView.decorations.from(f)
|
|
@@ -1081,22 +1028,6 @@ var scriptBlockBaseTheme = view.EditorView.baseTheme({
|
|
|
1081
1028
|
borderLeft: "1px solid hsl(var(--border) / 0.5)",
|
|
1082
1029
|
borderRight: "1px solid hsl(var(--border) / 0.5)",
|
|
1083
1030
|
boxSizing: "border-box"
|
|
1084
|
-
},
|
|
1085
|
-
".cm-wod-block-footer": {
|
|
1086
|
-
height: "28px",
|
|
1087
|
-
backgroundColor: "rgba(128, 128, 128, 0.05)",
|
|
1088
|
-
borderLeft: "1px solid hsl(var(--border) / 0.5)",
|
|
1089
|
-
borderRight: "1px solid hsl(var(--border) / 0.5)",
|
|
1090
|
-
boxSizing: "border-box",
|
|
1091
|
-
pointerEvents: "none"
|
|
1092
|
-
},
|
|
1093
|
-
".cm-wod-insert-spacer": {
|
|
1094
|
-
height: "28px",
|
|
1095
|
-
backgroundColor: "rgba(128, 128, 128, 0.05)",
|
|
1096
|
-
borderLeft: "1px solid hsl(var(--border) / 0.5)",
|
|
1097
|
-
borderRight: "1px solid hsl(var(--border) / 0.5)",
|
|
1098
|
-
boxSizing: "border-box",
|
|
1099
|
-
pointerEvents: "none"
|
|
1100
1031
|
}
|
|
1101
1032
|
});
|
|
1102
1033
|
var previewDecorations = [
|