@changerawr/markdown 1.1.4 → 1.1.5

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.
@@ -81,7 +81,7 @@
81
81
  }
82
82
 
83
83
  @layer components {
84
- /* Alert components - all 6 types */
84
+ /* Alert components */
85
85
  .changerawr-alert {
86
86
  @apply border-l-4 p-4 mb-4 rounded-md transition-all duration-200;
87
87
  }
@@ -114,21 +114,7 @@
114
114
  border-left-color: #10b981;
115
115
  }
116
116
 
117
- .changerawr-alert-tip {
118
- background-color: color-mix(in srgb, #a855f7 10%, transparent);
119
- border-color: color-mix(in srgb, #a855f7 30%, transparent);
120
- color: #a855f7;
121
- border-left-color: #a855f7;
122
- }
123
-
124
- .changerawr-alert-note {
125
- background-color: color-mix(in srgb, #6b7280 10%, transparent);
126
- border-color: color-mix(in srgb, #6b7280 30%, transparent);
127
- color: #6b7280;
128
- border-left-color: #6b7280;
129
- }
130
-
131
- /* Button base component */
117
+ /* Button components */
132
118
  .changerawr-button {
133
119
  @apply inline-flex items-center justify-center px-4 py-2 rounded-lg transition-all duration-200 cursor-pointer;
134
120
  border: 1px solid transparent;
@@ -136,109 +122,13 @@
136
122
  text-decoration: none;
137
123
  }
138
124
 
139
- /* Button style variants - all 7 types */
140
- .changerawr-button-default {
141
- background-color: #475569;
142
- color: white;
143
- border-color: #64748b;
144
- }
145
-
146
- .changerawr-button-default:hover:not(:disabled) {
147
- background-color: #334155;
148
- border-color: #94a3b8;
149
- }
150
-
151
125
  .changerawr-button-primary {
152
126
  background-color: #3b82f6;
153
127
  color: white;
154
- border-color: #60a5fa;
155
128
  }
156
129
 
157
130
  .changerawr-button-primary:hover:not(:disabled) {
158
- background-color: #2563eb;
159
- border-color: #93c5fd;
160
- }
161
-
162
- .changerawr-button-secondary {
163
- background-color: #4b5563;
164
- color: white;
165
- border-color: #6b7280;
166
- }
167
-
168
- .changerawr-button-secondary:hover:not(:disabled) {
169
- background-color: #374151;
170
- border-color: #9ca3af;
171
- }
172
-
173
- .changerawr-button-success {
174
- background-color: #059669;
175
- color: white;
176
- border-color: #10b981;
177
- }
178
-
179
- .changerawr-button-success:hover:not(:disabled) {
180
- background-color: #047857;
181
- border-color: #34d399;
182
- }
183
-
184
- .changerawr-button-danger {
185
- background-color: #dc2626;
186
- color: white;
187
- border-color: #ef4444;
188
- }
189
-
190
- .changerawr-button-danger:hover:not(:disabled) {
191
- background-color: #b91c1c;
192
- border-color: #f87171;
193
- }
194
-
195
- .changerawr-button-outline {
196
- background-color: transparent;
197
- color: #3b82f6;
198
- border-color: #3b82f6;
199
- }
200
-
201
- .changerawr-button-outline:hover:not(:disabled) {
202
- background-color: #eff6ff;
203
- border-color: #1d4ed8;
204
- color: #1d4ed8;
205
- }
206
-
207
- .changerawr-button-ghost {
208
- background-color: transparent;
209
- color: #374151;
210
- border-color: transparent;
211
- }
212
-
213
- .changerawr-button-ghost:hover:not(:disabled) {
214
- background-color: #f3f4f6;
215
- color: #111827;
216
- }
217
-
218
- /* Button size variants */
219
- .changerawr-button-sm {
220
- padding: 0.375rem 0.75rem;
221
- font-size: 0.875rem;
222
- gap: 0.375rem;
223
- }
224
-
225
- .changerawr-button-md {
226
- padding: 0.5rem 1rem;
227
- font-size: 1rem;
228
- gap: 0.5rem;
229
- }
230
-
231
- .changerawr-button-lg {
232
- padding: 0.75rem 1.5rem;
233
- font-size: 1.125rem;
234
- gap: 0.625rem;
235
- }
236
-
237
- /* Button disabled state */
238
- .changerawr-button:disabled {
239
- opacity: 0.5;
240
- cursor: not-allowed;
241
- pointer-events: none;
131
+ background-color: color-mix(in srgb, #3b82f6 90%, black);
242
132
  }
243
133
  }
244
134
 
@@ -263,14 +153,4 @@
263
153
  color: #34d399;
264
154
  background-color: color-mix(in srgb, #10b981 20%, transparent);
265
155
  }
266
-
267
- .changerawr-alert-tip {
268
- color: #c084fc;
269
- background-color: color-mix(in srgb, #a855f7 20%, transparent);
270
- }
271
-
272
- .changerawr-alert-note {
273
- color: #9ca3af;
274
- background-color: color-mix(in srgb, #6b7280 20%, transparent);
275
- }
276
156
  }
package/dist/index.d.mts CHANGED
@@ -2,7 +2,7 @@ interface MarkdownToken {
2
2
  type: string;
3
3
  content: string;
4
4
  raw: string;
5
- attributes?: Record<string, string>;
5
+ attributes?: Record<string, string | number | boolean | Function | any>;
6
6
  children?: MarkdownToken[];
7
7
  }
8
8
  interface ParseRule {
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ interface MarkdownToken {
2
2
  type: string;
3
3
  content: string;
4
4
  raw: string;
5
- attributes?: Record<string, string>;
5
+ attributes?: Record<string, string | number | boolean | Function | any>;
6
6
  children?: MarkdownToken[];
7
7
  }
8
8
  interface ParseRule {
package/dist/index.js CHANGED
@@ -305,7 +305,7 @@ var MarkdownParser = class {
305
305
  return processed;
306
306
  }
307
307
  recursivelyParseBlockContent(token) {
308
- const blockTypes = ["alert", "blockquote"];
308
+ const blockTypes = ["alert", "blockquote", "list-item", "task-item"];
309
309
  if (blockTypes.includes(token.type) && token.content && token.content.trim()) {
310
310
  const children = this.parse(token.content);
311
311
  return {
@@ -1096,7 +1096,14 @@ var ListExtension = {
1096
1096
  renderRules: [
1097
1097
  {
1098
1098
  type: "list-item",
1099
- render: (token) => `<li>${escapeHtml(token.content)}</li>`
1099
+ render: (token) => {
1100
+ const format = token.attributes?.format || "tailwind";
1101
+ const content = token.attributes?.renderedChildren || escapeHtml(token.content);
1102
+ if (format === "html") {
1103
+ return `<li>${content}</li>`;
1104
+ }
1105
+ return `<li>${content}</li>`;
1106
+ }
1100
1107
  }
1101
1108
  ]
1102
1109
  };
@@ -1121,18 +1128,18 @@ var TaskListExtension = {
1121
1128
  type: "task-item",
1122
1129
  render: (token) => {
1123
1130
  const isChecked = token.attributes?.checked === "true";
1124
- const escapedContent = escapeHtml(token.content);
1131
+ const content = token.attributes?.renderedChildren || escapeHtml(token.content);
1125
1132
  const format = token.attributes?.format || "html";
1126
1133
  if (format === "html") {
1127
1134
  return `<div style="display: flex; align-items: center; gap: 8px; margin: 8px 0;">
1128
1135
  <input type="checkbox" ${isChecked ? "checked" : ""} disabled style="margin: 0;" />
1129
- <span${isChecked ? ' style="text-decoration: line-through; color: #6b7280;"' : ""}>${escapedContent}</span>
1136
+ <span${isChecked ? ' style="text-decoration: line-through; color: #6b7280;"' : ""}>${content}</span>
1130
1137
  </div>`;
1131
1138
  }
1132
1139
  return `<div class="flex items-center gap-2 my-2 task-list-item">
1133
- <input type="checkbox" ${isChecked ? "checked" : ""} disabled
1140
+ <input type="checkbox" ${isChecked ? "checked" : ""} disabled
1134
1141
  class="form-checkbox h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary" />
1135
- <span${isChecked ? ' class="line-through text-muted-foreground"' : ""}>${escapedContent}</span>
1142
+ <span${isChecked ? ' class="line-through text-muted-foreground"' : ""}>${content}</span>
1136
1143
  </div>`;
1137
1144
  }
1138
1145
  }
@@ -1200,7 +1207,7 @@ var AlertExtension = {
1200
1207
  parseRules: [
1201
1208
  {
1202
1209
  name: "alert",
1203
- pattern: /:::(\w+)(?:\s+(.*?))?\s*\n([\s\S]*?)\n:::/,
1210
+ pattern: /:::(\w+)(?: ([^\n]+))?\n([\s\S]*?)\n:::/,
1204
1211
  render: (match) => {
1205
1212
  return {
1206
1213
  type: "alert",
@@ -1208,7 +1215,7 @@ var AlertExtension = {
1208
1215
  raw: match[0] || "",
1209
1216
  attributes: {
1210
1217
  type: match[1] || "info",
1211
- title: match[2] || ""
1218
+ title: match[2]?.trim() || ""
1212
1219
  }
1213
1220
  };
1214
1221
  }