@volverjs/ui-vue 0.0.13-beta.7 → 0.0.13-beta.9

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 (141) hide show
  1. package/README.md +81 -2
  2. package/bin/icons.cjs +2 -2
  3. package/bin/icons.js +45 -51
  4. package/dist/components/VvAccordion/VvAccordion.es.js +431 -192
  5. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  6. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +2 -2
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +529 -395
  8. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  9. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +2 -2
  10. package/dist/components/VvAction/VvAction.es.js +346 -138
  11. package/dist/components/VvAction/VvAction.umd.js +1 -1
  12. package/dist/components/VvAction/VvAction.vue.d.ts +2 -2
  13. package/dist/components/VvAction/index.d.ts +1 -1
  14. package/dist/components/VvAlert/VvAlert.es.js +443 -283
  15. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  16. package/dist/components/VvAlert/VvAlert.vue.d.ts +5 -5
  17. package/dist/components/VvAlert/index.d.ts +1 -1
  18. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +485 -373
  19. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  20. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +3 -3
  21. package/dist/components/VvAvatar/VvAvatar.es.js +353 -48
  22. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  23. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +380 -125
  24. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  25. package/dist/components/VvBadge/VvBadge.es.js +345 -49
  26. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  27. package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
  28. package/dist/components/VvBadge/index.d.ts +1 -1
  29. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +390 -223
  30. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  31. package/dist/components/VvButton/VvButton.es.js +553 -495
  32. package/dist/components/VvButton/VvButton.umd.js +1 -1
  33. package/dist/components/VvButton/VvButton.vue.d.ts +13 -13
  34. package/dist/components/VvButton/index.d.ts +5 -5
  35. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +379 -100
  36. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  37. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
  38. package/dist/components/VvCard/VvCard.es.js +351 -59
  39. package/dist/components/VvCard/VvCard.umd.js +1 -1
  40. package/dist/components/VvCheckbox/VvCheckbox.es.js +529 -418
  41. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  42. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +16 -16
  43. package/dist/components/VvCheckbox/index.d.ts +6 -6
  44. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +586 -584
  45. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  46. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +11 -11
  47. package/dist/components/VvCheckboxGroup/index.d.ts +2 -2
  48. package/dist/components/VvCombobox/VvCombobox.es.js +1463 -2198
  49. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  50. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +7 -7
  51. package/dist/components/VvCombobox/index.d.ts +14 -14
  52. package/dist/components/VvDialog/VvDialog.es.js +404 -152
  53. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  54. package/dist/components/VvDialog/VvDialog.vue.d.ts +3 -3
  55. package/dist/components/VvDialog/index.d.ts +1 -1
  56. package/dist/components/VvDropdown/VvDropdown.es.js +536 -408
  57. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  58. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +25 -15
  59. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +3 -3
  60. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +2 -2
  61. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +1 -1
  62. package/dist/components/VvDropdown/index.d.ts +1 -1
  63. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +454 -245
  64. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  65. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +389 -47
  66. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  67. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +336 -34
  68. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  69. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +413 -129
  70. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  71. package/dist/components/VvIcon/VvIcon.es.js +42 -59
  72. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  73. package/dist/components/VvInputFile/VvInputFile.es.js +906 -1018
  74. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
  75. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +11 -11
  76. package/dist/components/VvInputFile/index.d.ts +4 -4
  77. package/dist/components/VvInputText/VvInputText.es.js +1065 -1591
  78. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  79. package/dist/components/VvInputText/VvInputText.vue.d.ts +25 -25
  80. package/dist/components/VvInputText/index.d.ts +10 -10
  81. package/dist/components/VvNav/VvNav.es.js +406 -239
  82. package/dist/components/VvNav/VvNav.umd.js +1 -1
  83. package/dist/components/VvNavItem/VvNavItem.es.js +367 -168
  84. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  85. package/dist/components/VvNavSeparator/VvNavSeparator.es.js +10 -15
  86. package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -1
  87. package/dist/components/VvProgress/VvProgress.es.js +348 -66
  88. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  89. package/dist/components/VvProgress/VvProgress.vue.d.ts +5 -5
  90. package/dist/components/VvProgress/index.d.ts +2 -2
  91. package/dist/components/VvRadio/VvRadio.es.js +502 -369
  92. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  93. package/dist/components/VvRadio/VvRadio.vue.d.ts +14 -14
  94. package/dist/components/VvRadio/index.d.ts +5 -5
  95. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +557 -533
  96. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  97. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +11 -11
  98. package/dist/components/VvRadioGroup/index.d.ts +2 -2
  99. package/dist/components/VvSelect/VvSelect.es.js +578 -626
  100. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  101. package/dist/components/VvSelect/VvSelect.vue.d.ts +5 -5
  102. package/dist/components/VvSelect/index.d.ts +10 -10
  103. package/dist/components/VvTab/VvTab.es.js +459 -339
  104. package/dist/components/VvTab/VvTab.umd.js +1 -1
  105. package/dist/components/VvTextarea/VvTextarea.es.js +827 -1194
  106. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  107. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +21 -21
  108. package/dist/components/VvTextarea/index.d.ts +8 -8
  109. package/dist/components/VvTooltip/VvTooltip.es.js +349 -65
  110. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  111. package/dist/components/VvVirtualScroll/VvVirtualScroll.es.js +74 -76
  112. package/dist/components/VvVirtualScroll/VvVirtualScroll.umd.js +1 -1
  113. package/dist/components/common/VvInputClearAction.d.ts +1 -1
  114. package/dist/components/index.es.js +3392 -5638
  115. package/dist/components/index.umd.js +1 -1
  116. package/dist/composables/index.es.js +559 -169
  117. package/dist/composables/index.umd.js +420 -1
  118. package/dist/composables/useBlurhash.d.ts +1 -1
  119. package/dist/directives/index.es.js +835 -155
  120. package/dist/directives/index.umd.js +420 -1
  121. package/dist/directives/v-contextmenu.es.js +475 -77
  122. package/dist/directives/v-contextmenu.umd.js +420 -1
  123. package/dist/directives/v-tooltip.es.js +360 -78
  124. package/dist/directives/v-tooltip.umd.js +1 -1
  125. package/dist/icons.es.js +26 -21
  126. package/dist/icons.umd.js +1 -1
  127. package/dist/index.es.js +96 -118
  128. package/dist/index.umd.js +1 -1
  129. package/dist/json-render/catalog.d.ts +395 -0
  130. package/dist/json-render/components.d.ts +111 -0
  131. package/dist/json-render/definitions.d.ts +697 -0
  132. package/dist/json-render/index.d.ts +55 -0
  133. package/dist/json-render/index.es.js +5329 -0
  134. package/dist/json-render/index.umd.js +1 -0
  135. package/dist/json-render/registry.d.ts +34 -0
  136. package/dist/props/index.d.ts +19 -19
  137. package/dist/resolvers/unplugin.es.js +85 -100
  138. package/dist/resolvers/unplugin.umd.js +1 -1
  139. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +79 -79
  140. package/dist/utils/DateUtilities.d.ts +0 -17
  141. package/package.json +55 -37
package/README.md CHANGED
@@ -192,7 +192,7 @@ export type Alert = {
192
192
  }
193
193
  ```
194
194
 
195
- ##### Usage
195
+ #### Usage
196
196
 
197
197
  ```typescript
198
198
  import { useAlert } from '@volverjs/ui-vue/composables'
@@ -224,7 +224,7 @@ function showSuccess() {
224
224
 
225
225
  Used to create blurred preview image ([blurhash](https://blurha.sh/))
226
226
 
227
- ##### Example
227
+ #### Example
228
228
 
229
229
  ```typescript
230
230
  import { useBlurhash } from '@volverjs/ui-vue/composables'
@@ -328,12 +328,91 @@ The following features are planned for the next releases:
328
328
  - [x] (v0.0.6) Alerts, notifications and toasts with `VvAlert` and `VvAlertGroup` component;
329
329
  - [x] (v0.0.10) Multiple uploads with `VvInputFile`;
330
330
  - [x] (v0.0.10) `useBlurhash` composable;
331
+ - [x] (v0.0.13) Generative UI with [json-render](https://json-render.dev) catalog & registry;
331
332
  - [ ] Image crop and file previews;
332
333
  - [ ] Loaders with `VvLoader` and `VvSkeleton`;
333
334
  - [ ] `VvTable` component with sort, filters, pagination and cell editing;
334
335
  - [ ] Carousel and galleries with `VvCarousel` component;
335
336
  - [ ] Calendar and date picker with `VvCalendar` component.
336
337
 
338
+ ## Generative UI (json-render)
339
+
340
+ `@volverjs/ui-vue` ships with a built-in [json-render](https://json-render.dev) catalog and registry, enabling LLMs to generate UIs using Volver components.
341
+
342
+ ### Quick start
343
+
344
+ ```typescript
345
+ import { catalog, registry } from '@volverjs/ui-vue/json-render'
346
+
347
+ // Generate a system prompt for your AI model
348
+ const systemPrompt = catalog.prompt()
349
+ ```
350
+
351
+ The `catalog` declares **26 components** (layout, data display, actions, navigation, forms) with Zod-validated props and AI-friendly descriptions. The `registry` maps each catalog type to the real Vue component.
352
+
353
+ ### Rendering AI-generated specs
354
+
355
+ ```vue
356
+ <script setup lang="ts">
357
+ import {
358
+ Renderer,
359
+ StateProvider,
360
+ VisibilityProvider,
361
+ } from '@json-render/vue'
362
+ import { registry } from '@volverjs/ui-vue/json-render'
363
+
364
+ const spec = ref(null)
365
+ </script>
366
+
367
+ <template>
368
+ <StateProvider :initial-state="{}">
369
+ <VisibilityProvider>
370
+ <Renderer :spec="spec" :registry="registry" />
371
+ </VisibilityProvider>
372
+ </StateProvider>
373
+ </template>
374
+ ```
375
+
376
+ ### Custom catalog (subset of components)
377
+
378
+ You can build a custom catalog with only the components you need:
379
+
380
+ ```typescript
381
+ import { defineCatalog } from '@json-render/core'
382
+ import { defineRegistry, schema } from '@json-render/vue'
383
+ import {
384
+ volverComponentDefinitions,
385
+ volverComponents,
386
+ } from '@volverjs/ui-vue/json-render'
387
+
388
+ // Pick only the components you need
389
+ const myCatalog = defineCatalog(schema, {
390
+ components: {
391
+ Button: volverComponentDefinitions.Button,
392
+ Card: volverComponentDefinitions.Card,
393
+ InputText: volverComponentDefinitions.InputText,
394
+ },
395
+ actions: {},
396
+ })
397
+
398
+ // Create a matching registry
399
+ const { registry } = defineRegistry(myCatalog, {
400
+ components: {
401
+ Button: volverComponents.Button,
402
+ Card: volverComponents.Card,
403
+ InputText: volverComponents.InputText,
404
+ },
405
+ })
406
+ ```
407
+
408
+ ### Peer dependencies
409
+
410
+ To use the json-render integration, install the required peer dependencies:
411
+
412
+ ```bash
413
+ pnpm add @json-render/core @json-render/vue zod
414
+ ```
415
+
337
416
  ## Documentation
338
417
 
339
418
  To learn more about `@volverjs/ui-vue`, check [its documentation](https://volverjs.github.io/ui-vue).
package/bin/icons.cjs CHANGED
@@ -1,2 +1,2 @@
1
- (function(e,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("node:fs"),require("node:path"),require("yargs"),require("yargs/helpers"),require("@iconify/tools"),require("@iconify/utils"),require("chokidar")):typeof define=="function"&&define.amd?define(["exports","node:fs","node:path","yargs","yargs/helpers","@iconify/tools","@iconify/utils","chokidar"],i):(e=typeof globalThis<"u"?globalThis:e||self,i(e["generate-icons"]={},e.fileSystem,e.path,e.yargs,e.helpers,e.tools,e.utils,e.chokidar))})(this,(function(e,i,l,m,C,c,I,q){"use strict";function w(o,s="iconify",r={}){return i.readdirSync(o).forEach(n=>{i.statSync(`${o}/${n}`).isDirectory()?r=w(`${o}/${n}`,n,r):n.includes(".svg")&&(r[s]?r[s].push(l.join(o,"/",n)):r[s]=[l.join(o,"/",n)])}),r}async function O(o,s,r,a){const n=c.blankIconSet(o);for(const y of s)try{const k=await i.promises.readFile(y,{encoding:"utf-8"}),h=new c.SVG(k);await c.cleanupSVG(h),a?.keepColors||await c.parseColors(h,{defaultColor:"currentColor",callback:(x,S,$)=>!$||c.isEmptyColor($)||S.includes("var(")?S:"currentColor"}),await c.runSVGO(h);const j=y.replace(/^.*[\\/]/,"").split(".")[0].replace(/ /g,"-").replace(/[^a-z0-9-]/gi,"");n.fromSVG(j,h)}catch(k){console.error(k)}const g=n.export();try{I.validateIconSet(g)}catch(y){throw new Error(`Icon set is not valid: ${y?.message}`)}const v=`${r}/${g.prefix}.json`;i.mkdirSync(l.dirname(v),{recursive:!0}),i.writeFileSync(v,JSON.stringify(g))}function f(o,s,r){const a=w(o,r?.prefix);Object.keys(a).length?Object.keys(a).forEach(n=>{O(n,a[n],s,r),console.info(`Icons generated in: ${s}/${n}.json
2
- `)}):console.error(`There are no files in ${o}`)}const u=m(C.hideBin(process.argv)).argv,t=u.srcPath,d=u.destPath||t;(!t||!d)&&(console.error("Please specify the srcPath and destPath with --srcPath and --destPath"),process.exit());const p={prefix:u.prefix,keepColors:u.keepColors};u.watch?(f(t,d,p),q.watch(t,{ignoreInitial:!0}).on("add",()=>{f(t,d,p)}).on("change",()=>{f(t,d,p)})):f(t,d,p),e.createIconifyJsonFiles=f,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(a,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("node:fs"),require("node:path"),require("yargs"),require("yargs/helpers"),require("@iconify/tools"),require("@iconify/utils"),require("chokidar")):typeof define=="function"&&define.amd?define(["exports","node:fs","node:path","yargs","yargs/helpers","@iconify/tools","@iconify/utils","chokidar"],o):(a=typeof globalThis<"u"?globalThis:a||self,o(a["generate-icons"]={},a.node_fs,a.node_path,a.yargs,a.yargs_helpers,a._iconify_tools,a._iconify_utils,a.chokidar))})(this,function(a,o,p,w,I,f,b,P){Object.defineProperty(a,Symbol.toStringTag,{value:"Module"});var q=Object.create,S=Object.defineProperty,m=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,E=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty,G=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(var s=_(r),l=0,O=s.length,i;l<O;l++)i=s[l],!x.call(e,i)&&i!==t&&S(e,i,{get:(c=>r[c]).bind(null,i),enumerable:!(n=m(r,i))||n.enumerable});return e},v=(e,r,t)=>(t=e!=null?q(E(e)):{},G(r||!e||!e.__esModule?S(t,"default",{value:e,enumerable:!0}):t,e));o=v(o),p=v(p),w=v(w),P=v(P);function j(e,r="iconify",t={}){return o.default.readdirSync(e).forEach(n=>{o.default.statSync(`${e}/${n}`).isDirectory()?t=j(`${e}/${n}`,n,t):n.includes(".svg")&&(t[r]?t[r].push(p.default.join(e,"/",n)):t[r]=[p.default.join(e,"/",n)])}),t}async function J(e,r,t,n){const s=(0,f.blankIconSet)(e);for(const i of r)try{const c=new f.SVG(await o.default.promises.readFile(i,{encoding:"utf-8"}));await(0,f.cleanupSVG)(c),n?.keepColors||await(0,f.parseColors)(c,{defaultColor:"currentColor",callback:(T,$,C)=>!C||(0,f.isEmptyColor)(C)||$.includes("var(")?$:"currentColor"}),await(0,f.runSVGO)(c);const N=i.replace(/^.*[\\/]/,"").split(".")[0].replace(/ /g,"-").replace(/[^a-z0-9-]/gi,"");s.fromSVG(N,c)}catch(c){console.error(c)}const l=s.export();try{(0,b.validateIconSet)(l)}catch(i){throw new Error(`Icon set is not valid: ${i?.message}`)}const O=`${t}/${l.prefix}.json`;o.default.mkdirSync(p.default.dirname(O),{recursive:!0}),o.default.writeFileSync(O,JSON.stringify(l))}function d(e,r,t){const n=j(e,t?.prefix);Object.keys(n).length?Object.keys(n).forEach(s=>{J(s,n[s],r,t),console.info(`Icons generated in: ${r}/${s}.json
2
+ `)}):console.error(`There are no files in ${e}`)}var y=(0,w.default)((0,I.hideBin)(process.argv)).argv,u=y.srcPath,h=y.destPath||u;(!u||!h)&&(console.error("Please specify the srcPath and destPath with --srcPath and --destPath"),process.exit());var g={prefix:y.prefix,keepColors:y.keepColors};y.watch?(d(u,h,g),P.default.watch(u,{ignoreInitial:!0}).on("add",()=>{d(u,h,g)}).on("change",()=>{d(u,h,g)})):d(u,h,g),a.createIconifyJsonFiles=d});
package/bin/icons.js CHANGED
@@ -1,62 +1,56 @@
1
1
  #!/usr/bin/env node
2
- import i from "node:fs";
3
- import u from "node:path";
4
- import $ from "yargs";
5
- import { hideBin as k } from "yargs/helpers";
6
- import { blankIconSet as C, SVG as I, cleanupSVG as E, parseColors as G, isEmptyColor as O, runSVGO as V } from "@iconify/tools";
7
- import { validateIconSet as x } from "@iconify/utils";
8
- import J from "chokidar";
9
- function w(r, n = "iconify", o = {}) {
10
- return i.readdirSync(r).forEach((e) => {
11
- i.statSync(`${r}/${e}`).isDirectory() ? o = w(`${r}/${e}`, e, o) : e.includes(".svg") && (o[n] ? o[n].push(u.join(r, "/", e)) : o[n] = [u.join(r, "/", e)]);
12
- }), o;
2
+ import c from "node:fs";
3
+ import h from "node:path";
4
+ import w from "yargs";
5
+ import { hideBin as $ } from "yargs/helpers";
6
+ import { SVG as k, blankIconSet as C, cleanupSVG as I, isEmptyColor as E, parseColors as G, runSVGO as O } from "@iconify/tools";
7
+ import { validateIconSet as V } from "@iconify/utils";
8
+ import x from "chokidar";
9
+ function v(o, n = "iconify", e = {}) {
10
+ return c.readdirSync(o).forEach((r) => {
11
+ c.statSync(`${o}/${r}`).isDirectory() ? e = v(`${o}/${r}`, r, e) : r.includes(".svg") && (e[n] ? e[n].push(h.join(o, "/", r)) : e[n] = [h.join(o, "/", r)]);
12
+ }), e;
13
13
  }
14
- async function P(r, n, o, s) {
15
- const e = C(r);
16
- for (const l of n)
17
- try {
18
- const h = await i.promises.readFile(l, {
19
- encoding: "utf-8"
20
- }), f = new I(h);
21
- await E(f), s?.keepColors || await G(f, {
22
- defaultColor: "currentColor",
23
- callback: (j, g, S) => !S || O(S) || g.includes("var(") ? g : "currentColor"
24
- }), await V(f);
25
- const v = l.replace(/^.*[\\/]/, "").split(".")[0].replace(/ /g, "-").replace(/[^a-z0-9-]/gi, "");
26
- e.fromSVG(v, f);
27
- } catch (h) {
28
- console.error(h);
29
- }
30
- const d = e.export();
14
+ async function J(o, n, e, r) {
15
+ const a = C(o);
16
+ for (const f of n) try {
17
+ const s = new k(await c.promises.readFile(f, { encoding: "utf-8" }));
18
+ await I(s), r?.keepColors || await G(s, {
19
+ defaultColor: "currentColor",
20
+ callback: (P, y, g) => !g || E(g) || y.includes("var(") ? y : "currentColor"
21
+ }), await O(s);
22
+ const S = f.replace(/^.*[\\/]/, "").split(".")[0].replace(/ /g, "-").replace(/[^a-z0-9-]/gi, "");
23
+ a.fromSVG(S, s);
24
+ } catch (s) {
25
+ console.error(s);
26
+ }
27
+ const d = a.export();
31
28
  try {
32
- x(d);
33
- } catch (l) {
34
- throw new Error(
35
- `Icon set is not valid: ${l?.message}`
36
- );
29
+ V(d);
30
+ } catch (f) {
31
+ throw new Error(`Icon set is not valid: ${f?.message}`);
37
32
  }
38
- const y = `${o}/${d.prefix}.json`;
39
- i.mkdirSync(u.dirname(y), { recursive: !0 }), i.writeFileSync(y, JSON.stringify(d));
33
+ const u = `${e}/${d.prefix}.json`;
34
+ c.mkdirSync(h.dirname(u), { recursive: !0 }), c.writeFileSync(u, JSON.stringify(d));
40
35
  }
41
- function p(r, n, o) {
42
- const s = w(r, o?.prefix);
43
- Object.keys(s).length ? Object.keys(s).forEach((e) => {
44
- P(e, s[e], n, o), console.info(`Icons generated in: ${n}/${e}.json
36
+ function p(o, n, e) {
37
+ const r = v(o, e?.prefix);
38
+ Object.keys(r).length ? Object.keys(r).forEach((a) => {
39
+ J(a, r[a], n, e), console.info(`Icons generated in: ${n}/${a}.json
45
40
  `);
46
- }) : console.error(`There are no files in ${r}`);
41
+ }) : console.error(`There are no files in ${o}`);
47
42
  }
48
- const a = $(k(process.argv)).argv, t = a.srcPath, c = a.destPath || t;
49
- (!t || !c) && (console.error(
50
- "Please specify the srcPath and destPath with --srcPath and --destPath"
51
- ), process.exit());
52
- const m = { prefix: a.prefix, keepColors: a.keepColors };
53
- a.watch ? (p(t, c, m), J.watch(t, {
54
- ignoreInitial: !0
55
- }).on("add", () => {
56
- p(t, c, m);
43
+ var l = w($(process.argv)).argv, t = l.srcPath, i = l.destPath || t;
44
+ (!t || !i) && (console.error("Please specify the srcPath and destPath with --srcPath and --destPath"), process.exit());
45
+ var m = {
46
+ prefix: l.prefix,
47
+ keepColors: l.keepColors
48
+ };
49
+ l.watch ? (p(t, i, m), x.watch(t, { ignoreInitial: !0 }).on("add", () => {
50
+ p(t, i, m);
57
51
  }).on("change", () => {
58
- p(t, c, m);
59
- })) : p(t, c, m);
52
+ p(t, i, m);
53
+ })) : p(t, i, m);
60
54
  export {
61
55
  p as createIconifyJsonFiles
62
56
  };