slexkit 0.2.0 → 0.3.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.
- package/CHANGELOG.md +52 -0
- package/LICENSE +21 -21
- package/dist/ai/llms-authoring.txt +2 -0
- package/dist/ai/llms-capabilities.txt +126 -0
- package/dist/ai/llms-components.txt +27 -6
- package/dist/ai/llms-full.txt +1729 -4
- package/dist/ai/llms-runtime.txt +7 -1
- package/dist/ai/llms.txt +22 -1
- package/dist/ai/slexkit-ai-manifest.json +674 -23
- package/dist/base.css +359 -359
- package/dist/chunks/{accordion-cfjyxw93.js → button-53ccjq5p.js} +11 -11
- package/dist/chunks/{accordion-nw12ytps.js → button-cr1fhsa7.js} +48 -2
- package/dist/chunks/{accordion-5f0nvjjm.js → button-dsftwzvg.js} +4 -3
- package/dist/chunks/{accordion-hzyrngd6.js → button-faf563xf.js} +2 -2
- package/dist/chunks/{accordion-ehnhpeca.js → button-jxv4c65t.js} +2 -2
- package/dist/chunks/{accordion-cw5r75jm.js → button-xv2dz7vn.js} +1 -1
- package/dist/chunks/{accordion-830dw78f.js → button-z5yv24ks.js} +2 -2
- package/dist/components/accordion.js +2 -2
- package/dist/components/badge.js +2 -2
- package/dist/components/button.css +101 -101
- package/dist/components/button.js +3 -3
- package/dist/components/callout.js +4 -4
- package/dist/components/card.js +2 -2
- package/dist/components/checkbox.js +2 -2
- package/dist/components/choice.css +151 -151
- package/dist/components/code-block.js +2 -2
- package/dist/components/collapsible.js +2 -2
- package/dist/components/column.js +1 -1
- package/dist/components/content.css +273 -250
- package/dist/components/divider.js +2 -2
- package/dist/components/grid.js +1 -1
- package/dist/components/index.js +13945 -26
- package/dist/components/input.css +777 -777
- package/dist/components/input.js +8 -8
- package/dist/components/link.js +2 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/radio-group.js +2 -2
- package/dist/components/row.js +1 -1
- package/dist/components/section.js +2 -2
- package/dist/components/select.css +178 -178
- package/dist/components/select.js +3 -3
- package/dist/components/slider.css +116 -116
- package/dist/components/slider.js +2 -2
- package/dist/components/specs.js +32 -0
- package/dist/components/stat.js +2 -2
- package/dist/components/submit.css +8 -8
- package/dist/components/submit.js +1 -1
- package/dist/components/switch.css +105 -105
- package/dist/components/switch.js +3 -3
- package/dist/components/table.js +4 -4
- package/dist/components/tabs.css +95 -95
- package/dist/components/tabs.js +4 -4
- package/dist/components/text-input.css +23 -23
- package/dist/components/text.js +1 -1
- package/dist/components/toast.js +4 -4
- package/dist/components/tooling.js +73 -8
- package/dist/runtime.cjs +1590 -14
- package/dist/runtime.js +1589 -13
- package/dist/slexkit.cjs +28254 -13848
- package/dist/slexkit.css +1538 -1515
- package/dist/slexkit.js +28253 -13847
- package/dist/tooling.js +117 -11
- package/dist/types/components/svelte/helpers.d.ts +8 -1
- package/dist/types/engine/capabilities.d.ts +54 -0
- package/dist/types/engine/index.d.ts +6 -0
- package/dist/types/engine/secure-runtime.d.ts +9 -1
- package/dist/types/engine/stdlib.d.ts +30 -0
- package/dist/types/engine/types.d.ts +1 -0
- package/dist/types/engine/validation.d.ts +28 -0
- package/dist/types/index.d.ts +6 -3
- package/dist/types/runtime.d.ts +6 -3
- package/dist/types/version.d.ts +2 -2
- package/dist/umd/slexkit.tooling.umd.js +45016 -44626
- package/dist/umd/slexkit.umd.js +28255 -13849
- package/package.json +3 -2
- package/src/components/svelte/content/Formula.svelte +27 -0
- package/src/components/svelte/content/Table.svelte +1 -1
- package/src/components/svelte/helpers.ts +56 -1
- package/src/components/svelte/input/Input.svelte +7 -7
- package/src/components/svelte/input/Select.svelte +2 -2
- package/src/components/svelte/input/Switch.svelte +1 -1
- package/src/components/svelte/input/Tabs.svelte +7 -7
- package/src/components/svelte/tooling/PlaygroundMarkdown.svelte +84 -2
- package/src/styles/components/button.css +101 -101
- package/src/styles/components/choice.css +152 -152
- package/src/styles/components/select.css +178 -178
- package/src/styles/components/slider.css +116 -116
- package/src/styles/components/submit.css +8 -8
- package/src/styles/components/switch.css +105 -105
- package/src/styles/components/tabs.css +95 -95
- package/src/styles/components/text-input.css +23 -23
- package/src/styles/content.css +274 -251
- package/src/styles/input.css +8 -8
- package/src/styles/layout.css +360 -360
package/dist/components/tabs.css
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
.slex-tabs {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
width: 100%;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.slex-tabs[data-orientation="vertical"] {
|
|
8
|
-
flex-direction: row;
|
|
9
|
-
}
|
|
10
|
-
|
|
1
|
+
.slex-tabs {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.slex-tabs[data-orientation="vertical"] {
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
11
|
.slex-tabs-list {
|
|
12
12
|
--slex-tabs-indicator-inline-inset: 12px;
|
|
13
13
|
--slex-tabs-indicator-block-inset: 8px;
|
|
14
14
|
position: relative;
|
|
15
15
|
display: flex;
|
|
16
|
-
gap: 0;
|
|
17
|
-
margin: 0;
|
|
18
|
-
padding: 0;
|
|
19
|
-
list-style: none;
|
|
20
|
-
overflow: hidden;
|
|
21
|
-
border-bottom: 1px solid var(--border);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.slexkit-root .slex-tabs-list {
|
|
25
|
-
display: flex;
|
|
26
|
-
gap: 0;
|
|
27
|
-
margin: 0;
|
|
28
|
-
padding: 0;
|
|
29
|
-
list-style: none;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.slexkit-root .slex-tabs-list li {
|
|
33
|
-
margin: 0;
|
|
34
|
-
padding: 0;
|
|
35
|
-
color: inherit;
|
|
36
|
-
font: inherit;
|
|
37
|
-
line-height: inherit;
|
|
38
|
-
list-style: none;
|
|
39
|
-
}
|
|
40
|
-
|
|
16
|
+
gap: 0;
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
list-style: none;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
border-bottom: 1px solid var(--border);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.slexkit-root .slex-tabs-list {
|
|
25
|
+
display: flex;
|
|
26
|
+
gap: 0;
|
|
27
|
+
margin: 0;
|
|
28
|
+
padding: 0;
|
|
29
|
+
list-style: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.slexkit-root .slex-tabs-list li {
|
|
33
|
+
margin: 0;
|
|
34
|
+
padding: 0;
|
|
35
|
+
color: inherit;
|
|
36
|
+
font: inherit;
|
|
37
|
+
line-height: inherit;
|
|
38
|
+
list-style: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
41
|
.slex-tabs-selected-indicator {
|
|
42
42
|
position: absolute;
|
|
43
43
|
z-index: 20;
|
|
@@ -63,25 +63,25 @@
|
|
|
63
63
|
.slex-tabs[data-orientation="vertical"] .slex-tabs-list {
|
|
64
64
|
flex-direction: column;
|
|
65
65
|
border-right: 1px solid var(--border);
|
|
66
|
-
border-bottom: none;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.slex-tabs-trigger {
|
|
70
|
-
position: relative;
|
|
71
|
-
padding: 0.5rem 1rem;
|
|
72
|
-
border: none;
|
|
73
|
-
border-radius: 0;
|
|
74
|
-
background: transparent;
|
|
75
|
-
color: var(--muted-foreground);
|
|
76
|
-
font-family: inherit;
|
|
77
|
-
font-size: 0.875rem;
|
|
78
|
-
font-weight: 500;
|
|
79
|
-
white-space: nowrap;
|
|
66
|
+
border-bottom: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.slex-tabs-trigger {
|
|
70
|
+
position: relative;
|
|
71
|
+
padding: 0.5rem 1rem;
|
|
72
|
+
border: none;
|
|
73
|
+
border-radius: 0;
|
|
74
|
+
background: transparent;
|
|
75
|
+
color: var(--muted-foreground);
|
|
76
|
+
font-family: inherit;
|
|
77
|
+
font-size: 0.875rem;
|
|
78
|
+
font-weight: 500;
|
|
79
|
+
white-space: nowrap;
|
|
80
80
|
cursor: pointer;
|
|
81
81
|
outline: none;
|
|
82
82
|
user-select: none;
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
.slex-tabs-trigger--icon {
|
|
86
86
|
display: inline-grid;
|
|
87
87
|
width: var(--slex-control-height, 2.25rem);
|
|
@@ -123,17 +123,17 @@
|
|
|
123
123
|
.slex-tabs-trigger.slex-tabs-trigger--selected:hover:not([data-disabled]) {
|
|
124
124
|
color: var(--primary);
|
|
125
125
|
}
|
|
126
|
-
|
|
127
|
-
.slex-tabs-trigger[data-disabled] {
|
|
128
|
-
opacity: 0.4;
|
|
129
|
-
cursor: not-allowed;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.slex-tabs-trigger:focus-visible {
|
|
133
|
-
outline: 2px solid var(--ring);
|
|
134
|
-
outline-offset: -2px;
|
|
135
|
-
}
|
|
136
|
-
|
|
126
|
+
|
|
127
|
+
.slex-tabs-trigger[data-disabled] {
|
|
128
|
+
opacity: 0.4;
|
|
129
|
+
cursor: not-allowed;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.slex-tabs-trigger:focus-visible {
|
|
133
|
+
outline: 2px solid var(--ring);
|
|
134
|
+
outline-offset: -2px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
137
|
.slex-tabs-content {
|
|
138
138
|
margin-top: 0.75rem !important;
|
|
139
139
|
border-radius: 0 !important;
|
|
@@ -155,38 +155,38 @@
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
@keyframes slex-tabs-content-in {
|
|
158
|
-
from {
|
|
159
|
-
opacity: 0;
|
|
160
|
-
transform: translateY(2px);
|
|
161
|
-
}
|
|
162
|
-
to {
|
|
163
|
-
opacity: 1;
|
|
164
|
-
transform: translateY(0);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.slex-tabs-content[hidden] {
|
|
169
|
-
display: none;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
@media (max-width: 640px) {
|
|
173
|
-
.slex-tabs-list {
|
|
174
|
-
overflow-x: auto;
|
|
175
|
-
scrollbar-width: none;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.slex-tabs-list::-webkit-scrollbar {
|
|
179
|
-
display: none;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.slex-tabs[data-orientation="vertical"] {
|
|
183
|
-
flex-direction: column;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.slex-tabs[data-orientation="vertical"] .slex-tabs-list {
|
|
187
|
-
flex-direction: row;
|
|
188
|
-
border-right: 0;
|
|
189
|
-
border-bottom: 1px solid var(--border);
|
|
190
|
-
}
|
|
191
|
-
|
|
158
|
+
from {
|
|
159
|
+
opacity: 0;
|
|
160
|
+
transform: translateY(2px);
|
|
161
|
+
}
|
|
162
|
+
to {
|
|
163
|
+
opacity: 1;
|
|
164
|
+
transform: translateY(0);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.slex-tabs-content[hidden] {
|
|
169
|
+
display: none;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@media (max-width: 640px) {
|
|
173
|
+
.slex-tabs-list {
|
|
174
|
+
overflow-x: auto;
|
|
175
|
+
scrollbar-width: none;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.slex-tabs-list::-webkit-scrollbar {
|
|
179
|
+
display: none;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.slex-tabs[data-orientation="vertical"] {
|
|
183
|
+
flex-direction: column;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.slex-tabs[data-orientation="vertical"] .slex-tabs-list {
|
|
187
|
+
flex-direction: row;
|
|
188
|
+
border-right: 0;
|
|
189
|
+
border-bottom: 1px solid var(--border);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
192
|
}
|
package/dist/components/tabs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Tabs
|
|
3
|
-
} from "../chunks/
|
|
4
|
-
import"../chunks/
|
|
5
|
-
import"../chunks/
|
|
3
|
+
} from "../chunks/button-53ccjq5p.js";
|
|
4
|
+
import"../chunks/button-faf563xf.js";
|
|
5
|
+
import"../chunks/button-xv2dz7vn.js";
|
|
6
6
|
import {
|
|
7
7
|
createSvelteRenderer
|
|
8
|
-
} from "../chunks/
|
|
8
|
+
} from "../chunks/button-cr1fhsa7.js";
|
|
9
9
|
|
|
10
10
|
// src/components/entries/tabs.ts
|
|
11
11
|
import { register } from "../runtime.js";
|
|
@@ -25,10 +25,13 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.slex-input-control {
|
|
28
|
+
position: relative;
|
|
28
29
|
display: flex;
|
|
29
30
|
align-items: stretch;
|
|
30
31
|
width: 100%;
|
|
31
32
|
min-width: 0;
|
|
33
|
+
border-radius: var(--radius);
|
|
34
|
+
transition: box-shadow 150ms ease;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
.slex-input {
|
|
@@ -82,11 +85,11 @@
|
|
|
82
85
|
.slex-input-controls {
|
|
83
86
|
box-sizing: border-box;
|
|
84
87
|
display: inline-grid;
|
|
85
|
-
grid-template-
|
|
88
|
+
grid-template-rows: repeat(2, minmax(0, 1fr));
|
|
86
89
|
align-items: stretch;
|
|
87
90
|
flex: 0 0 auto;
|
|
88
|
-
width:
|
|
89
|
-
min-width:
|
|
91
|
+
width: 1.875rem;
|
|
92
|
+
min-width: 1.875rem;
|
|
90
93
|
min-height: 2.5625rem;
|
|
91
94
|
overflow: hidden;
|
|
92
95
|
border: 1px solid var(--input);
|
|
@@ -103,15 +106,15 @@
|
|
|
103
106
|
justify-content: center;
|
|
104
107
|
width: 100%;
|
|
105
108
|
min-width: 0;
|
|
106
|
-
min-height:
|
|
109
|
+
min-height: 0;
|
|
107
110
|
padding: 0;
|
|
108
111
|
border: 0;
|
|
109
|
-
border-
|
|
112
|
+
border-top: 1px solid var(--input);
|
|
110
113
|
border-radius: 0;
|
|
111
114
|
background: transparent;
|
|
112
115
|
color: var(--foreground);
|
|
113
116
|
font: inherit;
|
|
114
|
-
font-size: 0.
|
|
117
|
+
font-size: 0.75rem;
|
|
115
118
|
font-weight: 600;
|
|
116
119
|
line-height: 1;
|
|
117
120
|
cursor: pointer;
|
|
@@ -119,7 +122,7 @@
|
|
|
119
122
|
}
|
|
120
123
|
|
|
121
124
|
.slex-input-step:first-child {
|
|
122
|
-
border-
|
|
125
|
+
border-top: 0;
|
|
123
126
|
}
|
|
124
127
|
|
|
125
128
|
.slex-input-step:last-child {
|
|
@@ -132,9 +135,9 @@
|
|
|
132
135
|
|
|
133
136
|
.slex-input-step:focus-visible {
|
|
134
137
|
z-index: 1;
|
|
135
|
-
border-color: var(--ring);
|
|
136
138
|
outline: none;
|
|
137
|
-
|
|
139
|
+
background: color-mix(in oklab, var(--muted) 58%, var(--background));
|
|
140
|
+
box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ring) 34%, transparent);
|
|
138
141
|
}
|
|
139
142
|
|
|
140
143
|
.slex-input-step:disabled {
|
|
@@ -148,7 +151,7 @@
|
|
|
148
151
|
|
|
149
152
|
.slex-input:focus {
|
|
150
153
|
border-color: var(--ring);
|
|
151
|
-
box-shadow:
|
|
154
|
+
box-shadow: none;
|
|
152
155
|
}
|
|
153
156
|
|
|
154
157
|
.slex-input[type="number"] {
|
|
@@ -172,21 +175,21 @@
|
|
|
172
175
|
|
|
173
176
|
.slex-input-field[data-invalid="true"] .slex-input:focus {
|
|
174
177
|
border-color: var(--destructive);
|
|
175
|
-
box-shadow:
|
|
178
|
+
box-shadow: none;
|
|
176
179
|
}
|
|
177
180
|
|
|
178
|
-
.slex-input-control:focus-within
|
|
179
|
-
border-color: var(--ring);
|
|
181
|
+
.slex-input-control:focus-within {
|
|
180
182
|
box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 16%, transparent);
|
|
181
183
|
}
|
|
182
184
|
|
|
183
|
-
.slex-input-control:focus-within .slex-input
|
|
185
|
+
.slex-input-control:focus-within .slex-input,
|
|
186
|
+
.slex-input-control:focus-within .slex-input-unit,
|
|
187
|
+
.slex-input-control:focus-within .slex-input-controls {
|
|
184
188
|
border-color: var(--ring);
|
|
185
189
|
}
|
|
186
190
|
|
|
187
|
-
.slex-input-control:focus-within .slex-input-
|
|
191
|
+
.slex-input-control:focus-within .slex-input-step {
|
|
188
192
|
border-color: var(--ring);
|
|
189
|
-
box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 16%, transparent);
|
|
190
193
|
}
|
|
191
194
|
|
|
192
195
|
.slex-input-field[data-invalid="true"] .slex-input-unit {
|
|
@@ -202,20 +205,17 @@
|
|
|
202
205
|
border-color: color-mix(in oklab, var(--destructive) 72%, var(--input));
|
|
203
206
|
}
|
|
204
207
|
|
|
205
|
-
.slex-input-field[data-invalid="true"] .slex-input-control:focus-within
|
|
206
|
-
border-color: var(--destructive);
|
|
208
|
+
.slex-input-field[data-invalid="true"] .slex-input-control:focus-within {
|
|
207
209
|
box-shadow: 0 0 0 2px color-mix(in oklab, var(--destructive) 18%, transparent);
|
|
208
210
|
}
|
|
209
211
|
|
|
212
|
+
.slex-input-field[data-invalid="true"] .slex-input-control:focus-within .slex-input,
|
|
213
|
+
.slex-input-field[data-invalid="true"] .slex-input-control:focus-within .slex-input-unit,
|
|
214
|
+
.slex-input-field[data-invalid="true"] .slex-input-control:focus-within .slex-input-controls,
|
|
210
215
|
.slex-input-field[data-invalid="true"] .slex-input-control:focus-within .slex-input-step {
|
|
211
216
|
border-color: var(--destructive);
|
|
212
217
|
}
|
|
213
218
|
|
|
214
|
-
.slex-input-field[data-invalid="true"] .slex-input-control:focus-within .slex-input-controls {
|
|
215
|
-
border-color: var(--destructive);
|
|
216
|
-
box-shadow: 0 0 0 2px color-mix(in oklab, var(--destructive) 18%, transparent);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
219
|
.slex-input[disabled] {
|
|
220
220
|
opacity: 0.5;
|
|
221
221
|
cursor: not-allowed;
|
package/dist/components/text.js
CHANGED
package/dist/components/toast.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Toast
|
|
3
|
-
} from "../chunks/
|
|
4
|
-
import"../chunks/
|
|
3
|
+
} from "../chunks/button-jxv4c65t.js";
|
|
4
|
+
import"../chunks/button-faf563xf.js";
|
|
5
5
|
import {
|
|
6
6
|
InlineIcon
|
|
7
|
-
} from "../chunks/
|
|
7
|
+
} from "../chunks/button-xv2dz7vn.js";
|
|
8
8
|
import {
|
|
9
9
|
append,
|
|
10
10
|
bindPropStore,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
text1 as text,
|
|
32
32
|
user_derived,
|
|
33
33
|
user_effect
|
|
34
|
-
} from "../chunks/
|
|
34
|
+
} from "../chunks/button-cr1fhsa7.js";
|
|
35
35
|
|
|
36
36
|
// src/components/entries/toast.ts
|
|
37
37
|
import { register } from "../runtime.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Tabs
|
|
3
|
-
} from "../chunks/
|
|
3
|
+
} from "../chunks/button-53ccjq5p.js";
|
|
4
|
+
import"../chunks/button-faf563xf.js";
|
|
4
5
|
import {
|
|
5
6
|
Select
|
|
6
|
-
} from "../chunks/
|
|
7
|
+
} from "../chunks/button-dsftwzvg.js";
|
|
7
8
|
import {
|
|
8
9
|
Button
|
|
9
|
-
} from "../chunks/
|
|
10
|
-
import"../chunks/
|
|
11
|
-
import"../chunks/accordion-cw5r75jm.js";
|
|
10
|
+
} from "../chunks/button-z5yv24ks.js";
|
|
11
|
+
import"../chunks/button-xv2dz7vn.js";
|
|
12
12
|
import {
|
|
13
13
|
action,
|
|
14
14
|
append,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
unmount,
|
|
63
63
|
user_derived,
|
|
64
64
|
user_effect
|
|
65
|
-
} from "../chunks/
|
|
65
|
+
} from "../chunks/button-cr1fhsa7.js";
|
|
66
66
|
|
|
67
67
|
// src/components/tooling.ts
|
|
68
68
|
import { register } from "../runtime.js";
|
|
@@ -48112,11 +48112,72 @@ function PlaygroundSlexCode($$anchor, $$props) {
|
|
|
48112
48112
|
}
|
|
48113
48113
|
|
|
48114
48114
|
// src/components/svelte/tooling/PlaygroundMarkdown.svelte
|
|
48115
|
-
var root101 = from_html(`<div class="slex-doc-streamdown"><!></div>`);
|
|
48115
|
+
var root101 = from_html(`<div class="slex-doc-prose slex-doc-streamdown"><!></div>`);
|
|
48116
48116
|
function PlaygroundMarkdown($$anchor, $$props) {
|
|
48117
48117
|
push($$props, true);
|
|
48118
48118
|
const extensions = [markedKatex({ singleDollarInline: true })];
|
|
48119
48119
|
const renderers = { inlineKatex: KatexRenderer, blockKatex: KatexRenderer };
|
|
48120
|
+
const options = { headerIds: false };
|
|
48121
|
+
function stripFrontmatter(value) {
|
|
48122
|
+
const raw = String(value ?? "").replace(/^\uFEFF/, "").replace(/\r\n/g, `
|
|
48123
|
+
`);
|
|
48124
|
+
if (!raw.startsWith("---"))
|
|
48125
|
+
return raw;
|
|
48126
|
+
const end = raw.indexOf(`
|
|
48127
|
+
---`, 3);
|
|
48128
|
+
if (end === -1)
|
|
48129
|
+
return raw;
|
|
48130
|
+
const closeEnd = raw.indexOf(`
|
|
48131
|
+
`, end + 1);
|
|
48132
|
+
return raw.slice(closeEnd === -1 ? raw.length : closeEnd + 1).trimStart();
|
|
48133
|
+
}
|
|
48134
|
+
function escapeHtml(value) {
|
|
48135
|
+
return String(value).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
48136
|
+
}
|
|
48137
|
+
function stripInlineMarkdown(value) {
|
|
48138
|
+
return String(value).replace(/\s+\{#[A-Za-z0-9_-]+\}\s*$/, "").replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/<[^>]+>/g, "").replace(/\s+#+\s*$/, "").trim();
|
|
48139
|
+
}
|
|
48140
|
+
function slugText(value) {
|
|
48141
|
+
const slug2 = String(value).toLowerCase().replace(/[`"'\u2018\u2019\u201c\u201d]/g, "").replace(/[^a-z0-9\u4e00-\u9fa5]+/g, "-").replace(/^-+|-+$/g, "");
|
|
48142
|
+
return slug2 || "section";
|
|
48143
|
+
}
|
|
48144
|
+
function createHeadingIdGenerator() {
|
|
48145
|
+
const counts = new Map;
|
|
48146
|
+
return (rawTitle) => {
|
|
48147
|
+
const explicit = rawTitle.match(/\s+\{#([A-Za-z0-9_-]+)\}\s*$/)?.[1] ?? "";
|
|
48148
|
+
const base2 = explicit || slugText(stripInlineMarkdown(rawTitle));
|
|
48149
|
+
const count2 = counts.get(base2) ?? 0;
|
|
48150
|
+
counts.set(base2, count2 + 1);
|
|
48151
|
+
return count2 ? `${base2}-${count2 + 1}` : base2;
|
|
48152
|
+
};
|
|
48153
|
+
}
|
|
48154
|
+
function normalizeHeadingAnchors(markdown2) {
|
|
48155
|
+
const nextId = createHeadingIdGenerator();
|
|
48156
|
+
let fence = null;
|
|
48157
|
+
return String(markdown2 ?? "").split(/\n/).map((line) => {
|
|
48158
|
+
const marker = String(line).match(/^[ \t]{0,3}(`{3,}|~{3,})/);
|
|
48159
|
+
if (fence) {
|
|
48160
|
+
if (marker && marker[1][0] === fence.char && marker[1].length >= fence.length)
|
|
48161
|
+
fence = null;
|
|
48162
|
+
return line;
|
|
48163
|
+
}
|
|
48164
|
+
if (marker) {
|
|
48165
|
+
fence = { char: marker[1][0], length: marker[1].length };
|
|
48166
|
+
return line;
|
|
48167
|
+
}
|
|
48168
|
+
const heading2 = String(line).match(/^(#{1,6})[ \t]+(.+)$/);
|
|
48169
|
+
if (!heading2)
|
|
48170
|
+
return line;
|
|
48171
|
+
const rawTitle = heading2[2].replace(/\s+#+\s*$/, "");
|
|
48172
|
+
const renderedTitle = rawTitle.replace(/\s+\{#[A-Za-z0-9_-]+\}\s*$/, "").trim();
|
|
48173
|
+
return `<span id="${escapeHtml(nextId(rawTitle))}" class="slex-doc-heading-anchor"></span>
|
|
48174
|
+
${heading2[1]} ${renderedTitle}`;
|
|
48175
|
+
}).join(`
|
|
48176
|
+
`);
|
|
48177
|
+
}
|
|
48178
|
+
function previewMarkdown(value) {
|
|
48179
|
+
return normalizeHeadingAnchors(stripFrontmatter(value));
|
|
48180
|
+
}
|
|
48120
48181
|
var div = root101();
|
|
48121
48182
|
var node = child(div);
|
|
48122
48183
|
{
|
|
@@ -48135,9 +48196,10 @@ function PlaygroundMarkdown($$anchor, $$props) {
|
|
|
48135
48196
|
}
|
|
48136
48197
|
});
|
|
48137
48198
|
};
|
|
48199
|
+
let $0 = user_derived(() => previewMarkdown($$props.content));
|
|
48138
48200
|
dist_default(node, {
|
|
48139
48201
|
get source() {
|
|
48140
|
-
return
|
|
48202
|
+
return get($0);
|
|
48141
48203
|
},
|
|
48142
48204
|
get extensions() {
|
|
48143
48205
|
return extensions;
|
|
@@ -48145,6 +48207,9 @@ function PlaygroundMarkdown($$anchor, $$props) {
|
|
|
48145
48207
|
get renderers() {
|
|
48146
48208
|
return renderers;
|
|
48147
48209
|
},
|
|
48210
|
+
get options() {
|
|
48211
|
+
return options;
|
|
48212
|
+
},
|
|
48148
48213
|
code: code2,
|
|
48149
48214
|
$$slots: { code: true }
|
|
48150
48215
|
});
|