@birdapi/velinstyle 1.2.1 → 1.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.
Files changed (156) hide show
  1. package/README.de.md +148 -11
  2. package/README.md +174 -16
  3. package/cli/__fixtures__/atelier-library/showcases/01-login/app.css +1 -0
  4. package/cli/__fixtures__/atelier-library/showcases/01-login/app.js +2 -0
  5. package/cli/__fixtures__/atelier-library/showcases/01-login/index.html +5 -0
  6. package/cli/__fixtures__/atelier-library/showcases/04-pricing/app.css +1 -0
  7. package/cli/__fixtures__/atelier-library/showcases/04-pricing/app.js +2 -0
  8. package/cli/__fixtures__/atelier-library/showcases/04-pricing/index.html +5 -0
  9. package/cli/__fixtures__/atelier-library/showcases/36-calendar/app.css +1 -0
  10. package/cli/__fixtures__/atelier-library/showcases/36-calendar/app.js +2 -0
  11. package/cli/__fixtures__/atelier-library/showcases/36-calendar/index.html +5 -0
  12. package/cli/atelier-catalog.json +1267 -0
  13. package/cli/atelier-formats.js +159 -0
  14. package/cli/atelier.js +382 -0
  15. package/cli/blueprints/empty-state.html +3 -5
  16. package/cli/cli-manifest.json +441 -161
  17. package/cli/docgen/extract-cli.js +2 -1
  18. package/cli/docs-generate.js +9 -0
  19. package/cli/experience.js +173 -0
  20. package/cli/index.js +1384 -361
  21. package/cli/motion.js +738 -0
  22. package/cli/production/component-graph.json +166 -0
  23. package/cli/production/explain.js +52 -0
  24. package/cli/production/extract.js +278 -0
  25. package/cli/production/graph.js +102 -0
  26. package/cli/production/report.js +168 -0
  27. package/cli/production/run.js +355 -0
  28. package/cli/production/trim-css.js +177 -0
  29. package/cli/production/trim-fonts.js +23 -0
  30. package/cli/production/trim-icons.js +38 -0
  31. package/cli/production/trim-js.js +48 -0
  32. package/cli/production/trim-motion.js +22 -0
  33. package/cli/production/trim-themes.js +50 -0
  34. package/cli/production/watch.js +38 -0
  35. package/cli/review.js +48 -1
  36. package/cli/scripts/write-atelier-fixtures.mjs +33 -0
  37. package/cli/security.js +190 -0
  38. package/cli/skills.js +53 -10
  39. package/cli/transparency.js +140 -41
  40. package/cli/workflow.js +32 -17
  41. package/components/index.js +3 -0
  42. package/components/runtime/component-loaders.js +3 -0
  43. package/components/velin-drawer.js +43 -4
  44. package/components/velin-empty-state.js +83 -0
  45. package/components/velin-modal.js +76 -15
  46. package/components/velin-otp-input.js +220 -0
  47. package/components/velin-password-strength.js +147 -0
  48. package/components/velin-sheet.js +49 -4
  49. package/components/velin-theme-toggle.js +15 -1
  50. package/core/a11y/component-contracts.json +391 -255
  51. package/core/attributes/registry.js +1 -1
  52. package/core/meta/knowledge/components.json +75 -3
  53. package/core/motion/analyze.js +38 -0
  54. package/core/motion/blueprint.js +51 -0
  55. package/core/motion/composer.js +114 -0
  56. package/core/motion/data/registry.json +352 -0
  57. package/core/motion/effects.js +17 -1
  58. package/core/motion/index.js +112 -9
  59. package/core/motion/optimize.js +44 -0
  60. package/core/motion/policy.js +77 -0
  61. package/core/motion/registry.js +131 -0
  62. package/core/motion/review.js +59 -0
  63. package/core/motion/scan.js +150 -0
  64. package/core/motion/timeline.js +68 -0
  65. package/core/motion/transitions.js +49 -0
  66. package/core/motion/triggers.js +168 -0
  67. package/core/security/checks/fs.js +92 -0
  68. package/core/security/detect.js +35 -0
  69. package/core/security/engine.js +116 -0
  70. package/core/security/index.js +18 -0
  71. package/core/security/registry.js +85 -0
  72. package/core/security/report/report.js +113 -0
  73. package/core/security/rules/ci/index.js +146 -0
  74. package/core/security/rules/consumer/index.js +174 -0
  75. package/core/security/rules/deps/index.js +182 -0
  76. package/core/security/rules/index.js +24 -0
  77. package/core/security/rules/publish/index.js +230 -0
  78. package/core/security/rules/repo/index.js +143 -0
  79. package/core/security/rules/secrets/index.js +133 -0
  80. package/core/security/score/dependency-health.js +53 -0
  81. package/core/security/score/release-health.js +66 -0
  82. package/core/security/score/score.js +102 -0
  83. package/core/security/timeline/timeline.js +76 -0
  84. package/dist/chunks/attributes-2ORR27KA.js +404 -0
  85. package/dist/chunks/attributes-HK7VIOLA.js +1080 -0
  86. package/dist/chunks/attributes-VRHHVNDO.js +1080 -0
  87. package/dist/chunks/chunk-MYKUI364.js +116 -0
  88. package/dist/chunks/chunk-NEVBPD5T.js +116 -0
  89. package/dist/chunks/chunk-Y6HN7HWX.js +116 -0
  90. package/dist/chunks/runtime-entry.js +1 -1
  91. package/dist/chunks/velin-drawer-A7Q7EBOS.js +162 -0
  92. package/dist/chunks/velin-empty-state-3NTUH2RF.js +81 -0
  93. package/dist/chunks/velin-modal-3MV4FYBK.js +231 -0
  94. package/dist/chunks/velin-otp-input-PSK42MM6.js +207 -0
  95. package/dist/chunks/velin-password-strength-TAXMLSED.js +136 -0
  96. package/dist/chunks/velin-sheet-N2VVYXFP.js +157 -0
  97. package/dist/chunks/velin-theme-toggle-J2NHC7IM.js +304 -0
  98. package/dist/llms.txt +4 -4
  99. package/dist/search-index.json +232 -5
  100. package/dist/velin-agent.json +433 -46
  101. package/dist/velinstyle-components.iife.js +3695 -2272
  102. package/dist/velinstyle-components.js +3698 -2271
  103. package/dist/velinstyle-components.min.js +262 -120
  104. package/dist/velinstyle.css +96 -13
  105. package/dist/velinstyle.d.ts +3 -0
  106. package/dist/velinstyle.min.css +1 -1
  107. package/package.json +19 -4
  108. package/packages/velinstyle-cli-core/package.json +11 -0
  109. package/packages/velinstyle-cli-core/src/config.js +84 -0
  110. package/packages/velinstyle-cli-core/src/contract.js +56 -0
  111. package/packages/velinstyle-cli-core/src/event-bus.js +50 -0
  112. package/packages/velinstyle-cli-core/src/index.js +18 -0
  113. package/packages/velinstyle-cli-core/src/lifecycle.js +33 -0
  114. package/packages/velinstyle-cli-core/src/runner.js +129 -0
  115. package/packages/velinstyle-cli-registry/data/commands.json +1216 -0
  116. package/packages/velinstyle-cli-registry/data/layouts.json +33 -0
  117. package/packages/velinstyle-cli-registry/data/widgets.json +35 -0
  118. package/packages/velinstyle-cli-registry/package.json +13 -0
  119. package/packages/velinstyle-cli-registry/src/index.js +88 -0
  120. package/packages/velinstyle-cli-renderer/package.json +8 -0
  121. package/packages/velinstyle-cli-renderer/src/index.js +286 -0
  122. package/packages/velinstyle-cli-theme/package.json +8 -0
  123. package/packages/velinstyle-cli-theme/src/index.js +84 -0
  124. package/packages/velinstyle-cli-ui/package.json +8 -0
  125. package/packages/velinstyle-cli-ui/src/index.js +34 -0
  126. package/packages/velinstyle-motion/README.md +81 -0
  127. package/packages/velinstyle-motion/package.json +37 -0
  128. package/packages/velinstyle-motion/src/ai/mini-prompt.js +119 -0
  129. package/packages/velinstyle-motion/src/ai/provider.js +59 -0
  130. package/packages/velinstyle-motion/src/ai/providers/pixverse-setup.js +402 -0
  131. package/packages/velinstyle-motion/src/ai/providers/pixverse.js +245 -0
  132. package/packages/velinstyle-motion/src/config.js +257 -0
  133. package/packages/velinstyle-motion/src/export/html-clip.js +141 -0
  134. package/packages/velinstyle-motion/src/index.js +304 -0
  135. package/packages/velinstyle-motion/src/jobs/cache.js +30 -0
  136. package/packages/velinstyle-motion/src/jobs/queue.js +69 -0
  137. package/packages/velinstyle-motion/src/jobs/usage.js +53 -0
  138. package/packages/velinstyle-motion/src/local/effects.js +139 -0
  139. package/packages/velinstyle-motion/src/local/engine.js +96 -0
  140. package/packages/velinstyle-motion/src/providers-catalog.js +44 -0
  141. package/packages/velinstyle-motion/src/registry/presets.js +25 -0
  142. package/packages/velinstyle-motion/src/registry/presets.json +85 -0
  143. package/packages/velinstyle-motion/src/ux/cost-gate.js +37 -0
  144. package/packages/velinstyle-motion/src/ux/pixverse-gate.js +153 -0
  145. package/packages/velinstyle-motion/src/ux/wizard.js +171 -0
  146. package/packages/velinstyle-motion/src/validate-image.js +91 -0
  147. package/packages/velinstyle-skills/catalog.json +1 -1
  148. package/packages/velinstyle-skills/registry.json +1 -142
  149. package/packages/velinstyle-skills/skills/velin-motion-reduced-safe/SKILL.md +1 -1
  150. package/packages/velinstyle-skills/skills/velin-motion-reveal-feedback/SKILL.md +1 -1
  151. package/src/components/data-table.css +19 -0
  152. package/src/components/empty-auth.css +33 -0
  153. package/src/components/table.css +16 -6
  154. package/src/tokens/motion.css +7 -0
  155. package/src/utilities/scroll-animation.css +66 -0
  156. package/src/velinstyle.css +1 -0
@@ -0,0 +1,404 @@
1
+ import {
2
+ disconnectInViewObserver,
3
+ observeInView
4
+ } from "./chunk-7MCGPHVC.js";
5
+ import {
6
+ lazyDefine
7
+ } from "./chunk-Y6HN7HWX.js";
8
+
9
+ // core/motion/effects.js
10
+ var VISIBLE_CLASS = "velin-in-view";
11
+ var EFFECT_MAP = {
12
+ reveal: ["velin-animate-on-scroll"],
13
+ fade: ["velin-animate-on-scroll", "velin-animate-on-scroll--fade"],
14
+ slide: ["velin-animate-on-scroll", "velin-animate-on-scroll--slide-up"],
15
+ "slide-up": ["velin-animate-on-scroll", "velin-animate-on-scroll--slide-up"],
16
+ "slide-down": ["velin-animate-on-scroll", "velin-animate-on-scroll--slide-down"],
17
+ "slide-left": ["velin-animate-on-scroll", "velin-animate-on-scroll--slide-left"],
18
+ "slide-right": ["velin-animate-on-scroll", "velin-animate-on-scroll--slide-right"],
19
+ scale: ["velin-animate-on-scroll", "velin-animate-on-scroll--scale"],
20
+ parallax: ["velin-parallax"],
21
+ "parallax-slow": ["velin-parallax", "velin-parallax--slow"],
22
+ hover: ["velin-animate-hover"],
23
+ "hover-lift": ["velin-animate-hover"],
24
+ flip: ["velin-animate-scale-in"],
25
+ blur: ["velin-animate-fade-in"]
26
+ };
27
+ function applyEffects(el, attrs = {}) {
28
+ const classes = /* @__PURE__ */ new Set();
29
+ for (const [name, value] of Object.entries(attrs)) {
30
+ if (value === "false" || value === "off") continue;
31
+ const mapped = EFFECT_MAP[name];
32
+ if (mapped) mapped.forEach((c) => classes.add(c));
33
+ if (name === "slide" && value && value !== "true" && value !== "") {
34
+ const key = `slide-${value}`;
35
+ EFFECT_MAP[key]?.forEach((c) => classes.add(c));
36
+ }
37
+ }
38
+ classes.forEach((c) => el.classList.add(c));
39
+ if (!el.classList.contains("velin-animate-on-scroll") && attrs.reveal !== void 0) {
40
+ el.classList.add("velin-animate-on-scroll");
41
+ }
42
+ return [...classes];
43
+ }
44
+ function markVisible(el) {
45
+ el.classList.add(VISIBLE_CLASS);
46
+ el.dataset.velinVisible = "true";
47
+ }
48
+ function prefersReducedMotion() {
49
+ return typeof window !== "undefined" && window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
50
+ }
51
+
52
+ // core/motion/stagger.js
53
+ var STAGGER_ATTR = "velin-stagger";
54
+ function applyStagger(listEl, value = "true") {
55
+ const base = value === "true" || value === "" ? 60 : parseInt(value, 10) || 60;
56
+ const children = [...listEl.children];
57
+ children.forEach((child, i) => {
58
+ child.style.setProperty("--velin-stagger-delay", `${i * base}ms`);
59
+ child.classList.add("velin-stagger-item");
60
+ });
61
+ listEl.classList.add("velin-stagger");
62
+ }
63
+ function enhanceStagger(root = document) {
64
+ root.querySelectorAll(`[${STAGGER_ATTR}]`).forEach((el) => {
65
+ if (el.dataset.velinStaggerDone) return;
66
+ el.dataset.velinStaggerDone = "1";
67
+ applyStagger(el, el.getAttribute(STAGGER_ATTR) || "true");
68
+ });
69
+ }
70
+
71
+ // core/motion/scroll.js
72
+ function smoothScrollTo(target, options = {}) {
73
+ const reduced = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
74
+ const el = typeof target === "string" ? document.querySelector(target) : target;
75
+ if (!el) return;
76
+ el.scrollIntoView({
77
+ behavior: reduced || options.instant ? "auto" : "smooth",
78
+ block: options.block || "start",
79
+ inline: options.inline || "nearest"
80
+ });
81
+ if (el.tabIndex < 0 && !el.hasAttribute("tabindex")) {
82
+ el.setAttribute("tabindex", "-1");
83
+ }
84
+ el.focus({ preventScroll: true });
85
+ }
86
+ function bindSmoothScroll(root = document) {
87
+ root.querySelectorAll("[velin-scroll]").forEach((link) => {
88
+ if (link.dataset.velinScrollBound) return;
89
+ link.dataset.velinScrollBound = "1";
90
+ link.addEventListener("click", (e) => {
91
+ const href = link.getAttribute("href");
92
+ if (!href || !href.startsWith("#")) return;
93
+ const target = document.querySelector(href);
94
+ if (!target) return;
95
+ e.preventDefault();
96
+ smoothScrollTo(target);
97
+ });
98
+ });
99
+ }
100
+
101
+ // core/motion/index.js
102
+ var MOTION_ATTRS = ["velin-reveal", "velin-fade", "velin-slide", "velin-scale", "velin-parallax", "velin-hover"];
103
+ var teardownFns = [];
104
+ function initMotion(options = {}) {
105
+ const root = options.root || (typeof document !== "undefined" ? document : null);
106
+ if (!root) return () => {
107
+ };
108
+ const selector = options.selector || [
109
+ "[velin-reveal]",
110
+ "[velin-fade]",
111
+ "[velin-slide]",
112
+ "[velin-scale]",
113
+ "[velin-parallax]",
114
+ "[velin-hover]",
115
+ ".velin-animate-on-scroll"
116
+ ].join(",");
117
+ const elements = root.querySelectorAll(selector);
118
+ const reduced = prefersReducedMotion();
119
+ for (const el of elements) {
120
+ if (el.dataset.velinMotionInit) continue;
121
+ el.dataset.velinMotionInit = "1";
122
+ const attrs = {};
123
+ for (const name of MOTION_ATTRS) {
124
+ if (el.hasAttribute(name)) attrs[name.replace("velin-", "")] = el.getAttribute(name) || "true";
125
+ }
126
+ applyEffects(el, attrs);
127
+ if (reduced) {
128
+ markVisible(el);
129
+ continue;
130
+ }
131
+ const stop = observeInView(el, (node) => markVisible(node));
132
+ teardownFns.push(stop);
133
+ }
134
+ enhanceStagger(root);
135
+ bindSmoothScroll(root);
136
+ return () => {
137
+ teardownFns.forEach((fn) => fn());
138
+ teardownFns = [];
139
+ disconnectInViewObserver();
140
+ };
141
+ }
142
+
143
+ // core/attributes/registry.js
144
+ var registry = /* @__PURE__ */ new Map();
145
+ function registerAttribute(name, handler) {
146
+ registry.set(name, handler);
147
+ }
148
+ function getAttributeHandler(name) {
149
+ return registry.get(name);
150
+ }
151
+ function bridgeComponent(el, tag, attrs = {}) {
152
+ el.setAttribute("data-velin-component", tag);
153
+ for (const [k, v] of Object.entries(attrs)) {
154
+ if (v != null) el.setAttribute(k, v);
155
+ }
156
+ return lazyDefine(tag);
157
+ }
158
+ function registerBuiltins() {
159
+ registerAttribute("velin-modal", {
160
+ enhance(el) {
161
+ bridgeComponent(el, "velin-modal", { open: el.getAttribute("velin-modal") || "" });
162
+ }
163
+ });
164
+ registerAttribute("velin-tabs", { enhance: (el) => bridgeComponent(el, "velin-tabs") });
165
+ registerAttribute("velin-accordion", { enhance: (el) => bridgeComponent(el, "velin-accordion") });
166
+ registerAttribute("velin-tooltip", {
167
+ enhance(el) {
168
+ const tip = el.getAttribute("velin-tooltip") || el.getAttribute("title") || "";
169
+ if (tip && el.hasAttribute("title")) el.removeAttribute("title");
170
+ if (el.tagName === "VELIN-TOOLTIP" || el.tagName === "VELIN-TOOLTIP-WC") {
171
+ el.setAttribute("content", tip);
172
+ return lazyDefine("velin-tooltip");
173
+ }
174
+ const wc = document.createElement("velin-tooltip");
175
+ wc.setAttribute("content", tip);
176
+ const parent = el.parentElement;
177
+ if (parent) {
178
+ parent.insertBefore(wc, el);
179
+ wc.appendChild(el);
180
+ }
181
+ return lazyDefine("velin-tooltip");
182
+ }
183
+ });
184
+ registerAttribute("velin-copy", {
185
+ enhance(el) {
186
+ const text = el.getAttribute("velin-copy") || el.textContent?.trim() || "";
187
+ if (!el.querySelector("velin-copy")) {
188
+ const wc = document.createElement("velin-copy");
189
+ wc.setAttribute("value", text);
190
+ if (el.tagName === "BUTTON") {
191
+ wc.append(...el.childNodes);
192
+ el.replaceWith(wc);
193
+ return lazyDefine("velin-copy");
194
+ }
195
+ el.appendChild(wc);
196
+ }
197
+ return lazyDefine("velin-copy");
198
+ }
199
+ });
200
+ registerAttribute("velin-counter", {
201
+ enhance(el) {
202
+ bridgeComponent(el, "velin-counter", {
203
+ value: el.getAttribute("velin-counter") || "0"
204
+ });
205
+ }
206
+ });
207
+ registerAttribute("velin-notify", {
208
+ async enhance(el) {
209
+ await lazyDefine("velin-toast");
210
+ el.addEventListener("click", () => {
211
+ const msg = el.getAttribute("velin-notify") || el.textContent || "";
212
+ document.dispatchEvent(
213
+ new CustomEvent("velin-toast-show", { detail: { message: msg, variant: el.dataset.variant || "info" } })
214
+ );
215
+ });
216
+ }
217
+ });
218
+ registerAttribute("velin-theme", {
219
+ enhance(el) {
220
+ const theme = el.getAttribute("velin-theme") || "toggle";
221
+ if (theme === "toggle") {
222
+ if (!el.querySelector("velin-theme-toggle")) {
223
+ el.appendChild(document.createElement("velin-theme-toggle"));
224
+ }
225
+ return lazyDefine("velin-theme-toggle");
226
+ }
227
+ document.documentElement.setAttribute("data-velin-theme", theme);
228
+ }
229
+ });
230
+ registerAttribute("velin-scroll-top", {
231
+ enhance(el) {
232
+ const raw = el.getAttribute("velin-scroll-top");
233
+ const threshold = raw && raw !== "true" ? raw : "300";
234
+ if (el.tagName === "VELIN-SCROLL-TOP") {
235
+ if (raw && raw !== "true") el.setAttribute("threshold", threshold);
236
+ return lazyDefine("velin-scroll-top");
237
+ }
238
+ let wc = document.querySelector("velin-scroll-top");
239
+ if (!wc) {
240
+ wc = document.createElement("velin-scroll-top");
241
+ wc.setAttribute("threshold", threshold);
242
+ (el === document.body || el === document.documentElement ? document.body : el).appendChild(wc);
243
+ }
244
+ return lazyDefine("velin-scroll-top");
245
+ }
246
+ });
247
+ registerAttribute("velin-progress", {
248
+ enhance(el) {
249
+ const ring = el.hasAttribute("ring");
250
+ if (ring) return bridgeComponent(el, "velin-progress-ring");
251
+ el.classList.add("velin-progress");
252
+ const val = parseInt(el.getAttribute("velin-progress") || "0", 10);
253
+ el.setAttribute("role", "progressbar");
254
+ el.setAttribute("aria-valuenow", String(val));
255
+ el.style.setProperty("--velin-progress", `${Math.min(100, val)}%`);
256
+ }
257
+ });
258
+ registerAttribute("velin-search", {
259
+ async enhance(el) {
260
+ if (el.tagName !== "VELIN-SEARCH") {
261
+ const host = document.createElement("velin-search");
262
+ host.setAttribute("index", el.getAttribute("data-search-index") || "/search-index.json");
263
+ el.replaceWith(host);
264
+ host.appendChild(el);
265
+ }
266
+ return lazyDefine("velin-search");
267
+ }
268
+ });
269
+ registerAttribute("velin-lazy", {
270
+ enhance(el) {
271
+ if (el.tagName === "IMG") {
272
+ el.loading = "lazy";
273
+ el.decoding = "async";
274
+ if (el.hasAttribute("velin-skeleton") || el.dataset.velinSkeleton) {
275
+ el.classList.add("velin-skeleton", "velin-skeleton--image");
276
+ el.addEventListener("load", () => el.classList.remove("velin-skeleton", "velin-skeleton--image"), { once: true });
277
+ }
278
+ }
279
+ }
280
+ });
281
+ registerAttribute("velin-skeleton", {
282
+ enhance(el) {
283
+ const variant = el.getAttribute("velin-skeleton") || "text";
284
+ el.classList.add("velin-skeleton", `velin-skeleton--${variant}`);
285
+ const hasText = Boolean(el.textContent?.trim()) && el.children.length > 0;
286
+ if (!hasText && !el.textContent?.trim()) {
287
+ el.setAttribute("aria-hidden", "true");
288
+ }
289
+ }
290
+ });
291
+ registerAttribute("velin-loading", {
292
+ enhance(el) {
293
+ el.classList.add("velin-spinner");
294
+ el.setAttribute("aria-busy", "true");
295
+ el.setAttribute("role", "status");
296
+ if (!el.getAttribute("aria-label")?.trim()) {
297
+ el.setAttribute("aria-label", "Loading");
298
+ }
299
+ }
300
+ });
301
+ registerAttribute("velin-grid", {
302
+ enhance(el) {
303
+ const cols = el.getAttribute("velin-grid") || "auto";
304
+ el.classList.add("velin-grid");
305
+ if (cols !== "auto") el.style.setProperty("--velin-grid-cols", cols);
306
+ }
307
+ });
308
+ registerAttribute("velin-anchor", {
309
+ enhance(el) {
310
+ if (!el.id && el.getAttribute("velin-anchor")) el.id = el.getAttribute("velin-anchor");
311
+ el.setAttribute("tabindex", "-1");
312
+ }
313
+ });
314
+ registerAttribute("velin-code", {
315
+ async enhance(el) {
316
+ const lang = el.getAttribute("velin-code") || el.getAttribute("language") || el.getAttribute("data-language") || "";
317
+ el.classList.add("velin-code-block");
318
+ if (lang && lang !== "true") {
319
+ el.dataset.language = lang;
320
+ if (!el.getAttribute("language")) el.setAttribute("language", lang);
321
+ }
322
+ if (!el.querySelector("[data-velin-copy]")) {
323
+ const btn = document.createElement("button");
324
+ btn.type = "button";
325
+ btn.className = "velin-code-block__copy velin-btn velin-btn--sm";
326
+ btn.textContent = "Copy";
327
+ btn.setAttribute("data-velin-copy", "");
328
+ btn.setAttribute("velin-copy", el.querySelector("code")?.textContent || el.textContent || "");
329
+ el.style.position = "relative";
330
+ el.appendChild(btn);
331
+ }
332
+ await lazyDefine("velin-copy");
333
+ const { initHighlight, highlightElement } = await import("./highlight-M2ELQNYK.js");
334
+ const immediate = el.getAttribute("data-velin-highlight") === "immediate" || typeof matchMedia !== "undefined" && matchMedia("(prefers-reduced-motion: reduce)").matches;
335
+ if (immediate) {
336
+ await highlightElement(el);
337
+ } else {
338
+ initHighlight(el, { root: el });
339
+ }
340
+ }
341
+ });
342
+ registerAttribute("velin-quote", {
343
+ enhance(el) {
344
+ if (el.tagName === "BLOCKQUOTE" || el.tagName === "Q") {
345
+ el.classList.add("velin-quote");
346
+ }
347
+ }
348
+ });
349
+ registerAttribute("velin-highlight", {
350
+ enhance(el) {
351
+ el.classList.add("velin-highlight");
352
+ }
353
+ });
354
+ registerAttribute("velin-transparency", {
355
+ async enhance(el) {
356
+ const { attach } = await import("./attach-H2ZSEAE6.js");
357
+ attach(el);
358
+ }
359
+ });
360
+ registerAttribute("velin-disclosure", {
361
+ async enhance(el) {
362
+ const { attach } = await import("./attach-H2ZSEAE6.js");
363
+ if (!el.hasAttribute("velin-transparency")) el.setAttribute("velin-transparency", "");
364
+ attach(el);
365
+ }
366
+ });
367
+ for (const motion of ["velin-reveal", "velin-fade", "velin-slide", "velin-scale", "velin-parallax", "velin-hover", "velin-stagger", "velin-scroll"]) {
368
+ registerAttribute(motion, { enhance() {
369
+ } });
370
+ }
371
+ }
372
+ registerBuiltins();
373
+ var enhanced = /* @__PURE__ */ new WeakSet();
374
+ async function bootAttributes(root = document) {
375
+ const selector = [...registry.keys()].map((a) => `[${a}]`).join(",");
376
+ const elements = root.querySelectorAll(selector);
377
+ for (const el of elements) {
378
+ if (enhanced.has(el)) continue;
379
+ for (const attr of registry.keys()) {
380
+ if (!el.hasAttribute(attr)) continue;
381
+ const handler = registry.get(attr);
382
+ if (handler?.enhance) await handler.enhance(el);
383
+ }
384
+ enhanced.add(el);
385
+ }
386
+ initMotion({ root });
387
+ if (typeof HTMLElement !== "undefined") {
388
+ const { bindDeclarativeSearch } = await import("./velin-search-L3UG6NDQ.js");
389
+ bindDeclarativeSearch(root);
390
+ if (!document.querySelector("velin-announcer")) {
391
+ const { getAnnouncer } = await import("./a11y-utils-IRC7LOPF.js");
392
+ getAnnouncer();
393
+ }
394
+ }
395
+ }
396
+ function listRegisteredAttributes() {
397
+ return [...registry.keys()];
398
+ }
399
+ export {
400
+ bootAttributes,
401
+ getAttributeHandler,
402
+ listRegisteredAttributes,
403
+ registerAttribute
404
+ };