@beyondwork/docx-react-component 1.0.98 → 1.0.99

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@beyondwork/docx-react-component",
3
3
  "publisher": "beyondwork",
4
- "version": "1.0.98",
4
+ "version": "1.0.99",
5
5
  "description": "Embeddable React Word (docx) editor with review, comments, tracked changes, and round-trip OOXML fidelity.",
6
6
  "type": "module",
7
7
  "sideEffects": [
@@ -133,6 +133,13 @@ export function normalizeMarkupDisplay(
133
133
  }
134
134
  }
135
135
 
136
+ const COMMENT_ACTIVE_MARKER_CLASS =
137
+ "bg-comment-soft underline decoration-comment decoration-2 underline-offset-4 decoration-solid box-decoration-clone rounded-[2px] shadow-[inset_0_-2px_0_var(--color-comment)]";
138
+ const COMMENT_OPEN_MARKER_CLASS =
139
+ "bg-comment-soft underline decoration-comment decoration-2 underline-offset-4 decoration-solid box-decoration-clone rounded-[2px]";
140
+ const COMMENT_RESOLVED_MARKER_CLASS =
141
+ "bg-comment-soft underline decoration-comment/60 decoration-1 underline-offset-4 decoration-solid box-decoration-clone rounded-[2px]";
142
+
136
143
  export function getCommentHighlightClass(
137
144
  model: CommentDecorationModel | undefined,
138
145
  from: number,
@@ -147,23 +154,29 @@ export function getCommentHighlightClass(
147
154
  switch (normalizeMarkupDisplay(markupDisplay)) {
148
155
  case "no-markup":
149
156
  case "original":
150
- return state.hasActive ? "bg-comment-soft" : "";
157
+ if (state.hasActive) {
158
+ return COMMENT_ACTIVE_MARKER_CLASS;
159
+ }
160
+ if (state.hasOpen) {
161
+ return COMMENT_OPEN_MARKER_CLASS;
162
+ }
163
+ return COMMENT_RESOLVED_MARKER_CLASS;
151
164
  case "simple-markup":
152
165
  if (state.hasActive) {
153
- return "underline decoration-comment decoration-2 underline-offset-4";
166
+ return COMMENT_ACTIVE_MARKER_CLASS;
154
167
  }
155
168
  if (state.hasOpen) {
156
- return "underline decoration-comment/60 decoration-1 underline-offset-4";
169
+ return COMMENT_OPEN_MARKER_CLASS;
157
170
  }
158
- return "underline decoration-comment/40 decoration-1 underline-offset-4";
171
+ return COMMENT_RESOLVED_MARKER_CLASS;
159
172
  case "all-markup":
160
173
  if (state.hasActive) {
161
- return "bg-comment-strong";
174
+ return COMMENT_ACTIVE_MARKER_CLASS;
162
175
  }
163
176
  if (state.hasOpen) {
164
- return "bg-comment-soft";
177
+ return COMMENT_OPEN_MARKER_CLASS;
165
178
  }
166
- return "bg-comment-soft opacity-60";
179
+ return COMMENT_RESOLVED_MARKER_CLASS;
167
180
  }
168
181
  }
169
182