@humanspeak/svelte-markdown 0.6.1 → 0.7.0

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.
Files changed (111) hide show
  1. package/README.md +63 -53
  2. package/dist/Parser.svelte +12 -7
  3. package/dist/SvelteMarkdown.svelte +34 -8
  4. package/dist/SvelteMarkdown.svelte.d.ts +27 -7
  5. package/dist/renderers/Blockquote.svelte.d.ts +3 -3
  6. package/dist/renderers/Br.svelte.d.ts +3 -3
  7. package/dist/renderers/Code.svelte.d.ts +2 -2
  8. package/dist/renderers/Codespan.svelte.d.ts +2 -2
  9. package/dist/renderers/Del.svelte.d.ts +3 -3
  10. package/dist/renderers/Em.svelte.d.ts +3 -3
  11. package/dist/renderers/Heading.svelte.d.ts +4 -4
  12. package/dist/renderers/Image.svelte.d.ts +2 -2
  13. package/dist/renderers/Link.svelte.d.ts +3 -3
  14. package/dist/renderers/List.svelte.d.ts +3 -3
  15. package/dist/renderers/ListItem.svelte.d.ts +3 -3
  16. package/dist/renderers/Paragraph.svelte.d.ts +3 -3
  17. package/dist/renderers/Strong.svelte.d.ts +3 -3
  18. package/dist/renderers/Table.svelte.d.ts +3 -3
  19. package/dist/renderers/TableBody.svelte.d.ts +3 -3
  20. package/dist/renderers/TableCell.svelte.d.ts +3 -3
  21. package/dist/renderers/TableHead.svelte.d.ts +3 -3
  22. package/dist/renderers/TableRow.svelte.d.ts +3 -3
  23. package/dist/renderers/Text.svelte.d.ts +3 -3
  24. package/dist/renderers/html/A.svelte +1 -1
  25. package/dist/renderers/html/Abbr.svelte +1 -1
  26. package/dist/renderers/html/Address.svelte +1 -1
  27. package/dist/renderers/html/Article.svelte +1 -1
  28. package/dist/renderers/html/Aside.svelte +1 -1
  29. package/dist/renderers/html/Audio.svelte +1 -1
  30. package/dist/renderers/html/B.svelte +1 -1
  31. package/dist/renderers/html/Bdi.svelte +1 -1
  32. package/dist/renderers/html/Bdo.svelte +1 -1
  33. package/dist/renderers/html/Blockquote.svelte +1 -1
  34. package/dist/renderers/html/Button.svelte +1 -1
  35. package/dist/renderers/html/Canvas.svelte +1 -1
  36. package/dist/renderers/html/Cite.svelte +1 -1
  37. package/dist/renderers/html/Code.svelte +1 -1
  38. package/dist/renderers/html/Datalist.svelte +1 -1
  39. package/dist/renderers/html/Dd.svelte +1 -1
  40. package/dist/renderers/html/Del.svelte +1 -1
  41. package/dist/renderers/html/Details.svelte +1 -1
  42. package/dist/renderers/html/Dfn.svelte +1 -1
  43. package/dist/renderers/html/Dialog.svelte +1 -1
  44. package/dist/renderers/html/Div.svelte +1 -1
  45. package/dist/renderers/html/Dl.svelte +1 -1
  46. package/dist/renderers/html/Dt.svelte +1 -1
  47. package/dist/renderers/html/Em.svelte +1 -1
  48. package/dist/renderers/html/Embed.svelte +1 -1
  49. package/dist/renderers/html/Fieldset.svelte +1 -1
  50. package/dist/renderers/html/Footer.svelte +1 -1
  51. package/dist/renderers/html/Form.svelte +1 -1
  52. package/dist/renderers/html/H1.svelte +1 -1
  53. package/dist/renderers/html/H2.svelte +1 -1
  54. package/dist/renderers/html/H3.svelte +1 -1
  55. package/dist/renderers/html/H4.svelte +1 -1
  56. package/dist/renderers/html/H5.svelte +1 -1
  57. package/dist/renderers/html/H6.svelte +1 -1
  58. package/dist/renderers/html/Header.svelte +1 -1
  59. package/dist/renderers/html/Hgroup.svelte +1 -1
  60. package/dist/renderers/html/Hr.svelte +1 -3
  61. package/dist/renderers/html/I.svelte +1 -1
  62. package/dist/renderers/html/Iframe.svelte +1 -1
  63. package/dist/renderers/html/Img.svelte +1 -3
  64. package/dist/renderers/html/Input.svelte +1 -1
  65. package/dist/renderers/html/Kbd.svelte +1 -1
  66. package/dist/renderers/html/Label.svelte +1 -1
  67. package/dist/renderers/html/Legend.svelte +1 -1
  68. package/dist/renderers/html/Li.svelte +1 -1
  69. package/dist/renderers/html/Main.svelte +1 -1
  70. package/dist/renderers/html/Mark.svelte +1 -1
  71. package/dist/renderers/html/Menu.svelte +1 -1
  72. package/dist/renderers/html/Meter.svelte +1 -1
  73. package/dist/renderers/html/Nav.svelte +1 -1
  74. package/dist/renderers/html/Ol.svelte +1 -1
  75. package/dist/renderers/html/Optgroup.svelte +1 -1
  76. package/dist/renderers/html/Option.svelte +1 -1
  77. package/dist/renderers/html/Output.svelte +1 -1
  78. package/dist/renderers/html/P.svelte +1 -1
  79. package/dist/renderers/html/Param.svelte +1 -1
  80. package/dist/renderers/html/Picture.svelte +1 -1
  81. package/dist/renderers/html/Pre.svelte +1 -1
  82. package/dist/renderers/html/Progress.svelte +1 -1
  83. package/dist/renderers/html/S.svelte +1 -1
  84. package/dist/renderers/html/Samp.svelte +1 -1
  85. package/dist/renderers/html/Section.svelte +1 -1
  86. package/dist/renderers/html/Select.svelte +1 -1
  87. package/dist/renderers/html/Small.svelte +1 -1
  88. package/dist/renderers/html/Source.svelte +1 -1
  89. package/dist/renderers/html/Span.svelte +1 -1
  90. package/dist/renderers/html/Strong.svelte +1 -1
  91. package/dist/renderers/html/Sub.svelte +1 -1
  92. package/dist/renderers/html/Summary.svelte +1 -1
  93. package/dist/renderers/html/Table.svelte +1 -1
  94. package/dist/renderers/html/Tbody.svelte +1 -1
  95. package/dist/renderers/html/Td.svelte +1 -1
  96. package/dist/renderers/html/Textarea.svelte +1 -3
  97. package/dist/renderers/html/Tfoot.svelte +1 -1
  98. package/dist/renderers/html/Th.svelte +1 -1
  99. package/dist/renderers/html/Thead.svelte +1 -1
  100. package/dist/renderers/html/Tr.svelte +1 -1
  101. package/dist/renderers/html/Track.svelte +1 -1
  102. package/dist/renderers/html/U.svelte +1 -1
  103. package/dist/renderers/html/Ul.svelte +1 -1
  104. package/dist/renderers/html/Var.svelte +1 -1
  105. package/dist/renderers/html/index.js +0 -2
  106. package/dist/utils/markdown-parser.d.ts +28 -3
  107. package/dist/utils/token-cleanup.d.ts +11 -0
  108. package/dist/utils/token-cleanup.js +90 -15
  109. package/package.json +27 -24
  110. package/dist/renderers/html/Object.svelte +0 -12
  111. package/dist/renderers/html/Object.svelte.d.ts +0 -7
@@ -3,7 +3,7 @@
3
3
 
4
4
  interface Props {
5
5
  children?: Snippet
6
- attributes?: Record<string, any>
6
+ attributes?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
7
7
  }
8
8
 
9
9
  const { children, attributes }: Props = $props()
@@ -3,7 +3,7 @@
3
3
 
4
4
  interface Props {
5
5
  children?: Snippet
6
- attributes?: Record<string, any>
6
+ attributes?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
7
7
  }
8
8
 
9
9
  const { children, attributes }: Props = $props()
@@ -3,7 +3,7 @@
3
3
 
4
4
  interface Props {
5
5
  children?: Snippet
6
- attributes?: Record<string, any>
6
+ attributes?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
7
7
  }
8
8
 
9
9
  const { children, attributes }: Props = $props()
@@ -3,7 +3,7 @@
3
3
 
4
4
  interface Props {
5
5
  children?: Snippet
6
- attributes?: Record<string, any>
6
+ attributes?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
7
7
  }
8
8
 
9
9
  const { children, attributes }: Props = $props()
@@ -1,8 +1,6 @@
1
1
  <script lang="ts">
2
- import type { Snippet } from 'svelte'
3
-
4
2
  interface Props {
5
- attributes?: Record<string, any>
3
+ attributes?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
6
4
  }
7
5
 
8
6
  const { attributes }: Props = $props()
@@ -3,7 +3,7 @@
3
3
 
4
4
  interface Props {
5
5
  children?: Snippet
6
- attributes?: Record<string, any>
6
+ attributes?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
7
7
  }
8
8
 
9
9
  const { children, attributes }: Props = $props()
@@ -3,7 +3,7 @@
3
3
 
4
4
  interface Props {
5
5
  children?: Snippet
6
- attributes?: Record<string, any>
6
+ attributes?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
7
7
  }
8
8
 
9
9
  const { children, attributes }: Props = $props()
@@ -3,7 +3,7 @@
3
3
 
4
4
  interface Props {
5
5
  children?: Snippet
6
- attributes?: Record<string, any>
6
+ attributes?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
7
7
  }
8
8
 
9
9
  const { children, attributes }: Props = $props()
@@ -3,7 +3,7 @@
3
3
 
4
4
  interface Props {
5
5
  children?: Snippet
6
- attributes?: Record<string, any>
6
+ attributes?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
7
7
  }
8
8
 
9
9
  const { children, attributes }: Props = $props()
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  interface Props {
3
- attributes?: Record<string, any>
3
+ attributes?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
4
4
  }
5
5
 
6
6
  const { attributes }: Props = $props()
@@ -3,7 +3,7 @@
3
3
 
4
4
  interface Props {
5
5
  children?: Snippet
6
- attributes?: Record<string, any>
6
+ attributes?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
7
7
  }
8
8
 
9
9
  const { children, attributes }: Props = $props()
@@ -3,7 +3,7 @@
3
3
 
4
4
  interface Props {
5
5
  children?: Snippet
6
- attributes?: Record<string, any>
6
+ attributes?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
7
7
  }
8
8
 
9
9
  const { children, attributes }: Props = $props()
@@ -3,7 +3,7 @@
3
3
 
4
4
  interface Props {
5
5
  children?: Snippet
6
- attributes?: Record<string, any>
6
+ attributes?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
7
7
  }
8
8
 
9
9
  const { children, attributes }: Props = $props()
@@ -48,7 +48,6 @@ import Mark from './Mark.svelte';
48
48
  import Menu from './Menu.svelte';
49
49
  import Meter from './Meter.svelte';
50
50
  import Nav from './Nav.svelte';
51
- import Object from './Object.svelte';
52
51
  import Ol from './Ol.svelte';
53
52
  import Optgroup from './Optgroup.svelte';
54
53
  import Option from './Option.svelte';
@@ -132,7 +131,6 @@ export const Html = {
132
131
  menu: Menu,
133
132
  meter: Meter,
134
133
  nav: Nav,
135
- object: Object,
136
134
  ol: Ol,
137
135
  optgroup: Optgroup,
138
136
  option: Option,
@@ -1,11 +1,36 @@
1
1
  export { default as Slugger } from 'github-slugger';
2
2
  export { Lexer, type Token, type Tokens, type TokensList } from 'marked';
3
- import { type HtmlRenderers } from '../renderers/html/index.js';
4
3
  import type { Component } from 'svelte';
4
+ import { type HtmlRenderers } from '../renderers/html/index.js';
5
+ /**
6
+ * Type definition for markdown renderers
7
+ * Maps each markdown element to its corresponding Svelte component
8
+ */
9
+ export type RendererComponent = Component<any, any, any> | undefined | null;
5
10
  export type Renderers = {
6
11
  html: HtmlRenderers;
7
- } & {
8
- [key: string]: Component<any> | null;
12
+ heading: RendererComponent;
13
+ paragraph: RendererComponent;
14
+ blockquote: RendererComponent;
15
+ code: RendererComponent;
16
+ list: RendererComponent;
17
+ listitem: RendererComponent;
18
+ hr: RendererComponent;
19
+ table: RendererComponent;
20
+ tablehead: RendererComponent;
21
+ tablebody: RendererComponent;
22
+ tablerow: RendererComponent;
23
+ tablecell: RendererComponent;
24
+ text: RendererComponent;
25
+ link: RendererComponent;
26
+ image: RendererComponent;
27
+ em: RendererComponent;
28
+ strong: RendererComponent;
29
+ codespan: RendererComponent;
30
+ br: RendererComponent;
31
+ del: RendererComponent;
32
+ orderedlistitem: RendererComponent;
33
+ unorderedlistitem: RendererComponent;
9
34
  };
10
35
  export declare const defaultRenderers: Renderers;
11
36
  export type SvelteMarkdownOptions = {
@@ -1,6 +1,17 @@
1
1
  import type { Token } from 'marked';
2
+ /**
3
+ * Determines if a string contains an HTML opening or closing tag
4
+ * @param raw - The string to check for HTML tags
5
+ * @returns Object containing the tag name and whether it's an opening tag, or null if no tag found
6
+ */
2
7
  export declare const isHtmlOpenTag: (raw: string) => {
3
8
  tag: string;
4
9
  isOpening: boolean;
5
10
  } | null;
11
+ /**
12
+ * Main function to process and shrink HTML tokens
13
+ * Breaks down complex HTML structures into manageable tokens
14
+ * @param tokens - Array of tokens to process
15
+ * @returns Processed array of tokens with nested structure
16
+ */
6
17
  export declare const shrinkHtmlTokens: (tokens: Token[]) => Token[];
@@ -1,31 +1,57 @@
1
1
  import { Parser } from 'htmlparser2';
2
- // Cache the regex pattern
2
+ /**
3
+ * Regular expression pattern to match HTML tags
4
+ * Matches both opening and closing tags with optional attributes
5
+ * Example matches: <div>, </div>, <img src="...">, <input type="text"/>
6
+ */
3
7
  const HTML_TAG_PATTERN = /<\/?([a-zA-Z][a-zA-Z0-9-]{0,})(?:\s+[^>]*)?>/;
4
8
  const htmlTagRegex = new RegExp(HTML_TAG_PATTERN);
9
+ /**
10
+ * Determines if a string contains an HTML opening or closing tag
11
+ * @param raw - The string to check for HTML tags
12
+ * @returns Object containing the tag name and whether it's an opening tag, or null if no tag found
13
+ */
5
14
  export const isHtmlOpenTag = (raw) => {
6
- // Use test() first as it's faster than match()
15
+ // First check if the string contains any HTML tags at all (faster than full regex match)
7
16
  if (!htmlTagRegex.test(raw))
8
17
  return null;
18
+ // If we found a tag, extract its name and check if it's an opening tag
9
19
  const match = raw.match(HTML_TAG_PATTERN);
10
20
  if (!match)
11
21
  return null;
12
22
  return { tag: match[1], isOpening: !raw.startsWith('</') };
13
23
  };
14
- function extractAttributes(raw) {
24
+ /**
25
+ * Extracts HTML attributes from a tag string
26
+ * @param raw - The raw HTML tag string (e.g., '<div class="example" id="test">')
27
+ * @returns An object containing key-value pairs of attributes
28
+ */
29
+ const extractAttributes = (raw) => {
15
30
  const attributes = {};
31
+ // Match pattern: attribute="value" or attribute='value'
16
32
  const attributeRegex = /(\w+)=["']([^"']*?)["']/g;
17
33
  let match;
34
+ // Continue finding matches until we've processed all attributes
18
35
  while ((match = attributeRegex.exec(raw)) !== null) {
19
36
  const [, key, value] = match;
20
37
  attributes[key] = value.trim();
21
38
  }
22
39
  return attributes;
23
- }
24
- function parseHtmlBlock(html) {
40
+ };
41
+ /**
42
+ * Parses an HTML string into an array of tokens
43
+ * Uses htmlparser2 to properly handle nested tags and text content
44
+ * @param html - The HTML string to parse
45
+ * @returns Array of tokens representing the HTML structure
46
+ */
47
+ const parseHtmlBlock = (html) => {
25
48
  const tokens = [];
49
+ // Buffer for accumulating text content between tags
26
50
  let currentText = '';
27
51
  const parser = new Parser({
28
- onopentag(name, attributes) {
52
+ // Called when an opening tag is encountered (<div>, <span>, etc.)
53
+ onopentag: (name, attributes) => {
54
+ // If we have accumulated any text, create a text token first
29
55
  if (currentText.trim()) {
30
56
  tokens.push({
31
57
  type: 'text',
@@ -34,6 +60,7 @@ function parseHtmlBlock(html) {
34
60
  });
35
61
  currentText = '';
36
62
  }
63
+ // Create a token for the opening tag with its attributes
37
64
  tokens.push({
38
65
  type: 'html',
39
66
  raw: `<${name}${Object.entries(attributes)
@@ -43,10 +70,13 @@ function parseHtmlBlock(html) {
43
70
  attributes
44
71
  });
45
72
  },
46
- ontext(text) {
73
+ // Called for text content between tags
74
+ ontext: (text) => {
47
75
  currentText += text;
48
76
  },
49
- onclosetag(name) {
77
+ // Called when a closing tag is encountered (</div>, </span>, etc.)
78
+ onclosetag: (name) => {
79
+ // Push any accumulated text before the closing tag
50
80
  if (currentText.trim()) {
51
81
  tokens.push({
52
82
  type: 'text',
@@ -55,6 +85,7 @@ function parseHtmlBlock(html) {
55
85
  });
56
86
  currentText = '';
57
87
  }
88
+ // Create a token for the closing tag
58
89
  tokens.push({
59
90
  type: 'html',
60
91
  raw: `</${name}>`,
@@ -62,16 +93,29 @@ function parseHtmlBlock(html) {
62
93
  });
63
94
  }
64
95
  });
96
+ // Process the HTML string
65
97
  parser.write(html);
66
98
  parser.end();
67
99
  return tokens;
68
- }
69
- function containsMultipleTags(html) {
100
+ };
101
+ /**
102
+ * Checks if an HTML string contains multiple tags
103
+ * Used to determine if further parsing is needed
104
+ * @param html - The HTML string to check
105
+ * @returns boolean indicating if multiple tags are present
106
+ */
107
+ const containsMultipleTags = (html) => {
70
108
  // Count the number of opening tags (excluding self-closing)
71
109
  const openingTags = html.match(/<[a-zA-Z][^>]*>/g) || [];
72
110
  const closingTags = html.match(/<\/[a-zA-Z][^>]*>/g) || [];
73
111
  return openingTags.length > 1 || closingTags.length > 1;
74
- }
112
+ };
113
+ /**
114
+ * Main function to process and shrink HTML tokens
115
+ * Breaks down complex HTML structures into manageable tokens
116
+ * @param tokens - Array of tokens to process
117
+ * @returns Processed array of tokens with nested structure
118
+ */
75
119
  export const shrinkHtmlTokens = (tokens) => {
76
120
  const result = [];
77
121
  for (const token of tokens) {
@@ -86,36 +130,65 @@ export const shrinkHtmlTokens = (tokens) => {
86
130
  // Then process the tokens as before
87
131
  return processHtmlTokens(result);
88
132
  };
89
- // Rename the existing shrinkHtmlTokens logic to processHtmlTokens
90
- function processHtmlTokens(tokens) {
133
+ /**
134
+ * Processes HTML tokens to create a nested structure
135
+ * Handles matching opening and closing tags, maintains proper nesting
136
+ * and preserves attributes
137
+ *
138
+ * @param tokens - Array of tokens to process
139
+ * @returns Processed array of tokens with proper nesting structure
140
+ *
141
+ * @example
142
+ * Input tokens: [
143
+ * { type: 'html', raw: '<div>' },
144
+ * { type: 'text', raw: 'Hello' },
145
+ * { type: 'html', raw: '</div>' }
146
+ * ]
147
+ * Output: [
148
+ * { type: 'html', tag: 'div', tokens: [
149
+ * { type: 'text', raw: 'Hello' }
150
+ * ]}
151
+ * ]
152
+ */
153
+ const processHtmlTokens = (tokens) => {
91
154
  const result = [];
155
+ // Stack to keep track of opening tags and their positions
92
156
  const stack = [];
93
157
  for (let i = 0; i < tokens.length; i++) {
94
158
  const token = tokens[i];
95
- // Recursively process any nested tokens first
159
+ // If token contains nested tokens, process them recursively
96
160
  if ('tokens' in token && Array.isArray(token.tokens)) {
97
161
  token.tokens = processHtmlTokens(token.tokens);
98
162
  }
99
163
  if (token.type === 'html') {
100
164
  const tagInfo = isHtmlOpenTag(token.raw);
101
165
  if (!tagInfo) {
166
+ // If we can't parse the tag, just add it as-is
102
167
  result.push(token);
103
168
  continue;
104
169
  }
105
170
  if (tagInfo.isOpening) {
171
+ // For opening tags, push to stack and add to result
106
172
  stack.push({ tag: tagInfo.tag, startIndex: result.length });
107
173
  result.push(token);
108
174
  }
109
175
  else {
176
+ // For closing tags, try to match with last opening tag
110
177
  const lastOpening = stack.pop();
111
178
  if (!lastOpening || lastOpening.tag !== tagInfo.tag) {
179
+ // If no matching opening tag, add closing tag as-is
112
180
  result.push(token);
113
181
  continue;
114
182
  }
183
+ // Found matching tags - create nested structure
115
184
  const startIndex = lastOpening.startIndex;
185
+ // Remove all tokens between opening and closing tags
116
186
  const innerTokens = result.splice(startIndex + 1, result.length - startIndex - 1);
187
+ // Remove the opening tag
117
188
  const openingToken = result.pop();
189
+ // Extract attributes from opening tag
118
190
  const attributes = extractAttributes(openingToken.raw);
191
+ // Create new nested token structure
119
192
  result.push({
120
193
  type: 'html',
121
194
  raw: openingToken.raw,
@@ -126,11 +199,13 @@ function processHtmlTokens(tokens) {
126
199
  }
127
200
  }
128
201
  else {
202
+ // Non-HTML tokens are added as-is
129
203
  result.push(token);
130
204
  }
131
205
  }
206
+ // If we have unclosed tags, return original tokens
132
207
  if (stack.length > 0) {
133
208
  return tokens;
134
209
  }
135
210
  return result;
136
- }
211
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@humanspeak/svelte-markdown",
3
3
  "description": "A markdown renderer for Svelte",
4
- "version": "0.6.1",
4
+ "version": "0.7.0",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run package",
@@ -30,7 +30,7 @@
30
30
  "svelte",
31
31
  "markdown"
32
32
  ],
33
- "homepage": "sveltemarkdown.com",
33
+ "homepage": "https://markdown.svelte.page",
34
34
  "files": [
35
35
  "dist",
36
36
  "!dist/**/*.test.*",
@@ -53,42 +53,45 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "github-slugger": "^2.0.0",
56
- "htmlparser2": "^9.1.0",
57
- "marked": "^15.0.0"
56
+ "htmlparser2": "^10.0.0",
57
+ "marked": "^15.0.5"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@eslint/eslintrc": "^3.2.0",
61
- "@eslint/js": "^9.15.0",
61
+ "@eslint/js": "^9.17.0",
62
62
  "@sveltejs/adapter-auto": "^3.3.1",
63
- "@sveltejs/kit": "^2.8.1",
63
+ "@sveltejs/kit": "^2.15.1",
64
64
  "@sveltejs/package": "^2.3.7",
65
- "@sveltejs/vite-plugin-svelte": "^4.0.1",
65
+ "@sveltejs/vite-plugin-svelte": "^5.0.3",
66
66
  "@testing-library/jest-dom": "^6.6.3",
67
- "@testing-library/svelte": "^5.2.4",
67
+ "@testing-library/svelte": "^5.2.6",
68
68
  "@testing-library/user-event": "^14.5.2",
69
- "@types/node": "^22.9.0",
70
- "@typescript-eslint/eslint-plugin": "^8.14.0",
71
- "@typescript-eslint/parser": "^8.14.0",
72
- "@vitest/coverage-v8": "^2.1.5",
73
- "eslint": "^9.15.0",
69
+ "@types/node": "^22.10.5",
70
+ "@typescript-eslint/eslint-plugin": "^8.19.0",
71
+ "@typescript-eslint/parser": "^8.19.0",
72
+ "@vitest/coverage-v8": "^2.1.8",
73
+ "eslint": "^9.17.0",
74
74
  "eslint-config-prettier": "^9.1.0",
75
- "eslint-plugin-svelte": "^2.46.0",
76
- "globals": "^15.12.0",
75
+ "eslint-plugin-svelte": "^2.46.1",
76
+ "globals": "^15.14.0",
77
77
  "jsdom": "^25.0.1",
78
- "prettier": "^3.3.3",
78
+ "prettier": "^3.4.2",
79
79
  "prettier-plugin-organize-imports": "^4.1.0",
80
- "prettier-plugin-svelte": "^3.2.8",
81
- "prettier-plugin-tailwindcss": "^0.6.8",
80
+ "prettier-plugin-svelte": "^3.3.2",
81
+ "prettier-plugin-tailwindcss": "^0.6.9",
82
82
  "publint": "^0.2.12",
83
- "svelte": "^5.2.2",
84
- "svelte-check": "^4.0.9",
85
- "typescript": "^5.6.3",
86
- "vite": "^5.4.11",
87
- "vitest": "^2.1.5"
83
+ "svelte": "^5.16.1",
84
+ "svelte-check": "^4.1.1",
85
+ "typescript": "^5.7.2",
86
+ "vite": "^6.0.7",
87
+ "vitest": "^2.1.8"
88
88
  },
89
89
  "overrides": {
90
90
  "@sveltejs/kit": {
91
91
  "cookie": "^0.7.0"
92
92
  }
93
+ },
94
+ "volta": {
95
+ "node": "22.12.0"
93
96
  }
94
- }
97
+ }
@@ -1,12 +0,0 @@
1
- <script lang="ts">
2
- import type { Snippet } from 'svelte'
3
-
4
- interface Props {
5
- children?: Snippet
6
- attributes?: Record<string, any>
7
- }
8
-
9
- const { children, attributes }: Props = $props()
10
- </script>
11
-
12
- <object {...attributes}>{@render children?.()}</object>
@@ -1,7 +0,0 @@
1
- import type { Snippet } from 'svelte';
2
- declare const Object: import("svelte").Component<{
3
- children?: Snippet;
4
- attributes?: Record<string, any>;
5
- }, {}, "">;
6
- type Object = ReturnType<typeof Object>;
7
- export default Object;