@dosgato/dialog 1.5.0 → 1.5.2
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/Icon.svelte
CHANGED
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
export { className as class }
|
|
22
22
|
|
|
23
23
|
function replaceIDs (body: string): string {
|
|
24
|
-
const matches = body.matchAll(/\sid="(\S+)"/
|
|
24
|
+
const matches = body.matchAll(/\sid="(\S+)"/g)
|
|
25
25
|
const ids = Array.from(matches).map(m => m[1])
|
|
26
26
|
if (!ids.length) return body
|
|
27
27
|
|
|
28
28
|
// Replace with unique ids
|
|
29
29
|
ids.forEach(id => {
|
|
30
|
-
const escapedID = id.replace(/[
|
|
30
|
+
const escapedID = id.replace(/[.*+?^${}()\]\\]/g, '\\$&')
|
|
31
31
|
|
|
32
32
|
body = body.replace(
|
|
33
33
|
// Allowed characters before id: [#;"]
|
|
34
34
|
// Allowed characters after id: [)"], .[a-z]
|
|
35
|
-
new RegExp('([#;"])(' + escapedID + ')([
|
|
35
|
+
new RegExp('([#;"])(' + escapedID + ')([)"]|\\.[a-z])', 'g'),
|
|
36
36
|
'$1' + randomid() + '$3'
|
|
37
37
|
)
|
|
38
38
|
})
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
$: iconLabel = messageLabels[message.type] ?? messageLabels.error
|
|
14
14
|
|
|
15
15
|
function addMarkup (msg: string) {
|
|
16
|
-
const lines = msg.split(/\r?\n/
|
|
16
|
+
const lines = msg.split(/\r?\n/)
|
|
17
17
|
const output: string[] = []
|
|
18
18
|
for (const line of lines) {
|
|
19
|
-
const splitLinks = line.split(/((?:\[[^\]]+\])?\([
|
|
19
|
+
const splitLinks = line.split(/((?:\[[^\]]+\])?\([^)]+\))/)
|
|
20
20
|
const replaced: string[] = []
|
|
21
21
|
for (const segment of splitLinks) {
|
|
22
|
-
const m = segment.match(/(?:\[([^\]]+)\])?\(([
|
|
22
|
+
const m = segment.match(/(?:\[([^\]]+)\])?\(([^)]+)\)/)
|
|
23
23
|
if (m) {
|
|
24
24
|
try {
|
|
25
25
|
const url = new URL(m[2])
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
{ indentOnInput },
|
|
40
40
|
{ javascript },
|
|
41
41
|
{ tsFacet, tsSync, tsHover },
|
|
42
|
-
|
|
42
|
+
tsModule,
|
|
43
43
|
{ createDefaultMapFromCDN, createSystem, createVirtualTypeScriptEnvironment }
|
|
44
44
|
] = await Promise.all([
|
|
45
45
|
import('codemirror'),
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
import('typescript'),
|
|
53
53
|
import('@typescript/vfs')
|
|
54
54
|
])
|
|
55
|
+
const ts = tsModule.default ?? tsModule
|
|
55
56
|
|
|
56
57
|
const compilerOptions: CompilerOptions = {
|
|
57
58
|
target: ts.ScriptTarget.ES2024,
|
|
@@ -84,8 +85,8 @@
|
|
|
84
85
|
if (!content) return null
|
|
85
86
|
const line = context.state.doc.lineAt(context.pos)
|
|
86
87
|
const textBefore = line.text.slice(0, context.pos - line.from)
|
|
87
|
-
const wordMatch = textBefore.match(/\w*$/
|
|
88
|
-
const dotMatch = textBefore.match(/\.\s*$/
|
|
88
|
+
const wordMatch = textBefore.match(/\w*$/)
|
|
89
|
+
const dotMatch = textBefore.match(/\.\s*$/)
|
|
89
90
|
if (!wordMatch?.[0] && !dotMatch && !context.explicit) return null
|
|
90
91
|
const from = context.pos - (wordMatch?.[0].length ?? 0)
|
|
91
92
|
const completions = env.languageService.getCompletionsAtPosition(FILE_PATH, context.pos, {})
|
|
@@ -100,7 +101,7 @@
|
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
const { linter } = await import('@codemirror/lint')
|
|
103
|
-
const importPattern = /\b(import|require)\s*(\(|['"]|\{?\s*['"])/
|
|
104
|
+
const importPattern = /\b(import|require)\s*(\(|['"]|\{?\s*['"])/g
|
|
104
105
|
const sandboxLinter = linter(view => {
|
|
105
106
|
if (!sandbox) return []
|
|
106
107
|
const diagnostics: Diagnostic[] = []
|
package/package.json
CHANGED