slexkit 0.2.0 → 0.3.1

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 (104) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/LICENSE +21 -21
  3. package/README.md +4 -3
  4. package/README.zh-CN.md +4 -3
  5. package/dist/ai/llms-authoring.txt +2 -0
  6. package/dist/ai/llms-capabilities.txt +126 -0
  7. package/dist/ai/llms-components.txt +29 -7
  8. package/dist/ai/llms-full.txt +1909 -153
  9. package/dist/ai/llms-runtime.txt +18 -13
  10. package/dist/ai/llms.txt +22 -1
  11. package/dist/ai/slexkit-ai-manifest.json +717 -62
  12. package/dist/base.css +359 -359
  13. package/dist/chunks/{accordion-cfjyxw93.js → button-53ccjq5p.js} +11 -11
  14. package/dist/chunks/{accordion-nw12ytps.js → button-cr1fhsa7.js} +48 -2
  15. package/dist/chunks/{accordion-5f0nvjjm.js → button-dsftwzvg.js} +4 -3
  16. package/dist/chunks/{accordion-hzyrngd6.js → button-faf563xf.js} +2 -2
  17. package/dist/chunks/{accordion-ehnhpeca.js → button-jxv4c65t.js} +2 -2
  18. package/dist/chunks/{accordion-cw5r75jm.js → button-xv2dz7vn.js} +1 -1
  19. package/dist/chunks/{accordion-830dw78f.js → button-z5yv24ks.js} +2 -2
  20. package/dist/components/accordion.js +2 -2
  21. package/dist/components/badge.js +2 -2
  22. package/dist/components/button.css +101 -101
  23. package/dist/components/button.js +3 -3
  24. package/dist/components/callout.js +4 -4
  25. package/dist/components/card.js +2 -2
  26. package/dist/components/checkbox.js +3 -2
  27. package/dist/components/choice.css +151 -151
  28. package/dist/components/code-block.js +2 -2
  29. package/dist/components/collapsible.js +2 -2
  30. package/dist/components/column.js +1 -1
  31. package/dist/components/content.css +273 -250
  32. package/dist/components/display.css +1 -1
  33. package/dist/components/divider.js +2 -2
  34. package/dist/components/grid.js +1 -1
  35. package/dist/components/index.js +13994 -172
  36. package/dist/components/input.css +786 -852
  37. package/dist/components/input.js +34 -144
  38. package/dist/components/link.js +2 -2
  39. package/dist/components/progress.js +2 -2
  40. package/dist/components/radio-group.js +3 -2
  41. package/dist/components/row.js +1 -1
  42. package/dist/components/section.js +2 -2
  43. package/dist/components/select.css +175 -181
  44. package/dist/components/select.js +3 -3
  45. package/dist/components/slider.css +125 -116
  46. package/dist/components/slider.js +2 -2
  47. package/dist/components/specs.js +34 -1
  48. package/dist/components/stat.js +2 -2
  49. package/dist/components/submit.css +8 -8
  50. package/dist/components/submit.js +1 -1
  51. package/dist/components/switch.css +105 -105
  52. package/dist/components/switch.js +4 -3
  53. package/dist/components/table.js +4 -4
  54. package/dist/components/tabs.css +95 -95
  55. package/dist/components/tabs.js +4 -4
  56. package/dist/components/text-input.css +26 -95
  57. package/dist/components/text.js +13 -1
  58. package/dist/components/toast.js +4 -4
  59. package/dist/components/tooling.css +0 -1
  60. package/dist/components/tooling.js +73 -8
  61. package/dist/runtime.cjs +1610 -17
  62. package/dist/runtime.js +1609 -16
  63. package/dist/slexkit.cjs +28191 -13865
  64. package/dist/slexkit.css +1525 -1569
  65. package/dist/slexkit.js +28190 -13864
  66. package/dist/tooling.js +117 -11
  67. package/dist/types/components/svelte/helpers.d.ts +8 -1
  68. package/dist/types/engine/capabilities.d.ts +54 -0
  69. package/dist/types/engine/index.d.ts +6 -0
  70. package/dist/types/engine/secure-runtime.d.ts +9 -1
  71. package/dist/types/engine/stdlib.d.ts +30 -0
  72. package/dist/types/engine/types.d.ts +1 -0
  73. package/dist/types/engine/validation.d.ts +28 -0
  74. package/dist/types/index.d.ts +6 -3
  75. package/dist/types/runtime.d.ts +6 -3
  76. package/dist/types/version.d.ts +2 -2
  77. package/dist/umd/slexkit.tooling.umd.js +45084 -44775
  78. package/dist/umd/slexkit.umd.js +28191 -13865
  79. package/package.json +5 -3
  80. package/skills/slexkit-host-integration/SKILL.md +1 -1
  81. package/src/components/svelte/content/Formula.svelte +27 -0
  82. package/src/components/svelte/content/Table.svelte +1 -1
  83. package/src/components/svelte/display/Text.svelte +14 -1
  84. package/src/components/svelte/helpers.ts +56 -1
  85. package/src/components/svelte/input/Checkbox.svelte +1 -1
  86. package/src/components/svelte/input/Input.svelte +0 -110
  87. package/src/components/svelte/input/RadioGroup.svelte +1 -1
  88. package/src/components/svelte/input/Select.svelte +2 -2
  89. package/src/components/svelte/input/Switch.svelte +2 -2
  90. package/src/components/svelte/input/Tabs.svelte +7 -7
  91. package/src/components/svelte/tooling/PlaygroundMarkdown.svelte +84 -2
  92. package/src/styles/components/button.css +101 -101
  93. package/src/styles/components/choice.css +152 -152
  94. package/src/styles/components/select.css +175 -181
  95. package/src/styles/components/slider.css +125 -116
  96. package/src/styles/components/submit.css +8 -8
  97. package/src/styles/components/switch.css +105 -105
  98. package/src/styles/components/tabs.css +95 -95
  99. package/src/styles/components/text-input.css +26 -95
  100. package/src/styles/content.css +274 -251
  101. package/src/styles/display.css +1 -1
  102. package/src/styles/input.css +8 -8
  103. package/src/styles/layout.css +360 -360
  104. package/src/styles/tooling.css +0 -1
@@ -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 {
@@ -42,16 +45,18 @@
42
45
  border: 1px solid var(--input);
43
46
  border-radius: var(--radius);
44
47
  background: var(--background);
48
+ background-clip: padding-box;
45
49
  color: var(--foreground);
46
50
  font-family: inherit;
47
51
  font-size: 0.875rem;
48
52
  line-height: 1.5;
49
53
  outline: none;
54
+ -webkit-appearance: none;
55
+ appearance: none;
50
56
  transition: border-color 150ms ease, box-shadow 150ms ease;
51
57
  }
52
58
 
53
- .slex-input-control[data-has-unit="true"] .slex-input,
54
- .slex-input-control[data-has-controls="true"] .slex-input {
59
+ .slex-input-control[data-has-unit="true"] .slex-input {
55
60
  border-top-right-radius: 0;
56
61
  border-bottom-right-radius: 0;
57
62
  }
@@ -75,80 +80,17 @@
75
80
  transition: border-color 150ms ease, box-shadow 150ms ease;
76
81
  }
77
82
 
78
- .slex-input-control[data-has-controls="true"] .slex-input-unit {
79
- border-radius: 0;
80
- }
81
-
82
- .slex-input-controls {
83
- box-sizing: border-box;
84
- display: inline-grid;
85
- grid-template-columns: repeat(2, minmax(0, 1fr));
86
- align-items: stretch;
87
- flex: 0 0 auto;
88
- width: 3.75rem;
89
- min-width: 3.75rem;
90
- min-height: 2.5625rem;
91
- overflow: hidden;
92
- border: 1px solid var(--input);
93
- border-left: 0;
94
- border-radius: 0 var(--radius) var(--radius) 0;
95
- background: var(--background);
96
- transition: border-color 150ms ease, box-shadow 150ms ease;
97
- }
98
-
99
- .slex-input-step {
100
- box-sizing: border-box;
101
- display: inline-flex;
102
- align-items: center;
103
- justify-content: center;
104
- width: 100%;
105
- min-width: 0;
106
- min-height: 100%;
107
- padding: 0;
108
- border: 0;
109
- border-left: 1px solid var(--input);
110
- border-radius: 0;
111
- background: transparent;
112
- color: var(--foreground);
113
- font: inherit;
114
- font-size: 0.875rem;
115
- font-weight: 600;
116
- line-height: 1;
117
- cursor: pointer;
118
- transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
119
- }
120
-
121
- .slex-input-step:first-child {
122
- border-left: 0;
123
- }
124
-
125
- .slex-input-step:last-child {
126
- border-radius: 0;
127
- }
128
-
129
- .slex-input-step:hover:not(:disabled) {
130
- background: color-mix(in oklab, var(--muted) 52%, var(--background));
131
- }
132
-
133
- .slex-input-step:focus-visible {
134
- z-index: 1;
135
- border-color: var(--ring);
136
- outline: none;
137
- box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 16%, transparent);
138
- }
139
-
140
- .slex-input-step:disabled {
141
- opacity: 0.45;
142
- cursor: not-allowed;
143
- }
144
-
145
83
  .slex-input::placeholder {
146
84
  color: var(--muted-foreground);
147
85
  }
148
86
 
149
87
  .slex-input:focus {
150
88
  border-color: var(--ring);
151
- box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 16%, transparent);
89
+ box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 18%, transparent);
90
+ }
91
+
92
+ .slex-input-control[data-has-unit="true"] .slex-input:focus {
93
+ box-shadow: none;
152
94
  }
153
95
 
154
96
  .slex-input[type="number"] {
@@ -175,18 +117,21 @@
175
117
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--destructive) 18%, transparent);
176
118
  }
177
119
 
178
- .slex-input-control:focus-within .slex-input-unit {
179
- border-color: var(--ring);
120
+ .slex-input-field[data-invalid="true"] .slex-input-control[data-has-unit="true"] .slex-input:focus {
121
+ box-shadow: none;
122
+ }
123
+
124
+ .slex-input-control:focus-within {
180
125
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 16%, transparent);
181
126
  }
182
127
 
183
- .slex-input-control:focus-within .slex-input-step {
184
- border-color: var(--ring);
128
+ .slex-input-control:not([data-has-unit]):focus-within {
129
+ box-shadow: none;
185
130
  }
186
131
 
187
- .slex-input-control:focus-within .slex-input-controls {
132
+ .slex-input-control:focus-within .slex-input,
133
+ .slex-input-control:focus-within .slex-input-unit {
188
134
  border-color: var(--ring);
189
- box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 16%, transparent);
190
135
  }
191
136
 
192
137
  .slex-input-field[data-invalid="true"] .slex-input-unit {
@@ -194,26 +139,17 @@
194
139
  color: color-mix(in oklab, var(--destructive) 84%, var(--muted-foreground));
195
140
  }
196
141
 
197
- .slex-input-field[data-invalid="true"] .slex-input-step {
198
- border-color: color-mix(in oklab, var(--destructive) 72%, var(--input));
199
- }
200
-
201
- .slex-input-field[data-invalid="true"] .slex-input-controls {
202
- border-color: color-mix(in oklab, var(--destructive) 72%, var(--input));
203
- }
204
-
205
- .slex-input-field[data-invalid="true"] .slex-input-control:focus-within .slex-input-unit {
206
- border-color: var(--destructive);
142
+ .slex-input-field[data-invalid="true"] .slex-input-control:focus-within {
207
143
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--destructive) 18%, transparent);
208
144
  }
209
145
 
210
- .slex-input-field[data-invalid="true"] .slex-input-control:focus-within .slex-input-step {
211
- border-color: var(--destructive);
146
+ .slex-input-field[data-invalid="true"] .slex-input-control:not([data-has-unit]):focus-within {
147
+ box-shadow: none;
212
148
  }
213
149
 
214
- .slex-input-field[data-invalid="true"] .slex-input-control:focus-within .slex-input-controls {
150
+ .slex-input-field[data-invalid="true"] .slex-input-control:focus-within .slex-input,
151
+ .slex-input-field[data-invalid="true"] .slex-input-control:focus-within .slex-input-unit {
215
152
  border-color: var(--destructive);
216
- box-shadow: 0 0 0 2px color-mix(in oklab, var(--destructive) 18%, transparent);
217
153
  }
218
154
 
219
155
  .slex-input[disabled] {
@@ -226,11 +162,6 @@
226
162
  cursor: not-allowed;
227
163
  }
228
164
 
229
- .slex-input[disabled] ~ .slex-input-controls,
230
- .slex-input[readonly] ~ .slex-input-controls {
231
- opacity: 0.6;
232
- }
233
-
234
165
  .slex-input-description {
235
166
  color: var(--muted-foreground);
236
167
  font-size: 0.75rem;
@@ -11,12 +11,14 @@ import {
11
11
  reset,
12
12
  set,
13
13
  set_class,
14
+ set_style,
14
15
  set_text,
15
16
  state,
16
17
  template_effect,
17
18
  text1 as text,
19
+ user_derived,
18
20
  user_effect
19
- } from "../chunks/accordion-nw12ytps.js";
21
+ } from "../chunks/button-cr1fhsa7.js";
20
22
 
21
23
  // src/components/entries/text.ts
22
24
  import { register } from "../runtime.js";
@@ -27,11 +29,21 @@ function Text($$anchor, $$props) {
27
29
  push($$props, true);
28
30
  let p = state(proxy({}));
29
31
  user_effect(() => bindPropStore($$props.props, (next) => set(p, next, true)));
32
+ const color = user_derived(() => get(p).color == null || get(p).color === "" ? undefined : text(get(p).color));
33
+ const size = user_derived(() => cssLength(get(p).size));
34
+ function cssLength(value) {
35
+ if (value == null || value === "")
36
+ return;
37
+ const rendered = text(value);
38
+ return /^-?\d+(\.\d+)?$/.test(rendered) ? `${rendered}px` : rendered;
39
+ }
30
40
  var div = root();
41
+ let styles;
31
42
  var text_1 = child(div, true);
32
43
  reset(div);
33
44
  template_effect(($0, $1) => {
34
45
  set_class(div, 1, $0);
46
+ styles = set_style(div, "", styles, { color: get(color), "font-size": get(size) });
35
47
  set_text(text_1, $1);
36
48
  }, [
37
49
  () => `slex-text${get(p).variant ? ` slex-text--${text(get(p).variant)}` : ""}${get(p).class ? ` ${text(get(p).class)}` : ""}`,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Toast
3
- } from "../chunks/accordion-ehnhpeca.js";
4
- import"../chunks/accordion-hzyrngd6.js";
3
+ } from "../chunks/button-jxv4c65t.js";
4
+ import"../chunks/button-faf563xf.js";
5
5
  import {
6
6
  InlineIcon
7
- } from "../chunks/accordion-cw5r75jm.js";
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/accordion-nw12ytps.js";
34
+ } from "../chunks/button-cr1fhsa7.js";
35
35
 
36
36
  // src/components/entries/toast.ts
37
37
  import { register } from "../runtime.js";
@@ -572,7 +572,6 @@
572
572
  overflow: hidden;
573
573
  clip: rect(0 0 0 0);
574
574
  white-space: nowrap;
575
- clip-path: inset(50%);
576
575
  }
577
576
 
578
577
  .slex-playground-error {
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  Tabs
3
- } from "../chunks/accordion-cfjyxw93.js";
3
+ } from "../chunks/button-53ccjq5p.js";
4
+ import"../chunks/button-faf563xf.js";
4
5
  import {
5
6
  Select
6
- } from "../chunks/accordion-5f0nvjjm.js";
7
+ } from "../chunks/button-dsftwzvg.js";
7
8
  import {
8
9
  Button
9
- } from "../chunks/accordion-830dw78f.js";
10
- import"../chunks/accordion-hzyrngd6.js";
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/accordion-nw12ytps.js";
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, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
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 $$props.content;
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
  });