@elgap/edukaai 0.1.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/.output/nitro.json +15 -0
- package/.output/public/_nuxt/BHDzAs85.js +1 -0
- package/.output/public/_nuxt/BJzbfdL_.js +1 -0
- package/.output/public/_nuxt/BKGLlKXk.js +6 -0
- package/.output/public/_nuxt/BLuXzJk3.js +1 -0
- package/.output/public/_nuxt/BNOzzLI3.js +1 -0
- package/.output/public/_nuxt/BO5GMwXh.js +1 -0
- package/.output/public/_nuxt/BQRbsFGy.js +1 -0
- package/.output/public/_nuxt/Be4MVdOg.js +1 -0
- package/.output/public/_nuxt/Bu4d3Z1T.js +1 -0
- package/.output/public/_nuxt/BwpBBNv4.js +1 -0
- package/.output/public/_nuxt/C1Og9-6n.js +97 -0
- package/.output/public/_nuxt/C3CjAhtj.js +1 -0
- package/.output/public/_nuxt/C6E3Ty3z.js +1 -0
- package/.output/public/_nuxt/COct4B42.js +1 -0
- package/.output/public/_nuxt/CQ6g2dtj.js +1 -0
- package/.output/public/_nuxt/CURSW5TV.js +246 -0
- package/.output/public/_nuxt/CW57JW4s.js +1 -0
- package/.output/public/_nuxt/Cg2fM61o.js +18 -0
- package/.output/public/_nuxt/CgGOeWta.js +1 -0
- package/.output/public/_nuxt/CoyYbT7u.js +1 -0
- package/.output/public/_nuxt/D11MHbGc.js +133 -0
- package/.output/public/_nuxt/D24dz0S8.js +1 -0
- package/.output/public/_nuxt/D3EFPr8x.js +1 -0
- package/.output/public/_nuxt/Dvt4ZHil.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -0
- package/.output/public/_nuxt/builds/meta/ab87ba0e-6d0d-4466-8b12-00d44f8fb9d3.json +1 -0
- package/.output/public/_nuxt/default.C1K1-g4D.css +1 -0
- package/.output/public/_nuxt/entry.CH8k-Mga.css +1 -0
- package/.output/public/_nuxt/error-404.C-Ezrlz-.css +1 -0
- package/.output/public/_nuxt/error-500.DBWf9FGj.css +1 -0
- package/.output/public/_nuxt/first-training.wFDD65zm.css +1 -0
- package/.output/public/_nuxt/import.cUKYdCrq.css +1 -0
- package/.output/public/_nuxt/index.D-2VHyHA.css +1 -0
- package/.output/public/_nuxt/index.D4J_vHmL.css +1 -0
- package/.output/public/_nuxt/mPJeLIz7.js +1 -0
- package/.output/server/chunks/_/error-500.mjs +19 -0
- package/.output/server/chunks/_/error-500.mjs.map +1 -0
- package/.output/server/chunks/build/ExampleCard-styles.BUOJhEg0.mjs +8 -0
- package/.output/server/chunks/build/ExampleCard-styles.BUOJhEg0.mjs.map +1 -0
- package/.output/server/chunks/build/ExampleForm-Bcpl0CfL.mjs +238 -0
- package/.output/server/chunks/build/ExampleForm-Bcpl0CfL.mjs.map +1 -0
- package/.output/server/chunks/build/ImportPreview-styles.CFmMl5Ok.mjs +8 -0
- package/.output/server/chunks/build/ImportPreview-styles.CFmMl5Ok.mjs.map +1 -0
- package/.output/server/chunks/build/_id_-BUSGcL-H.mjs +113 -0
- package/.output/server/chunks/build/_id_-BUSGcL-H.mjs.map +1 -0
- package/.output/server/chunks/build/axolotl-C-EXGgM8.mjs +112 -0
- package/.output/server/chunks/build/axolotl-C-EXGgM8.mjs.map +1 -0
- package/.output/server/chunks/build/best-practices-DsadorHb.mjs +38 -0
- package/.output/server/chunks/build/best-practices-DsadorHb.mjs.map +1 -0
- package/.output/server/chunks/build/client.precomputed.mjs +4 -0
- package/.output/server/chunks/build/client.precomputed.mjs.map +1 -0
- package/.output/server/chunks/build/default-DPkqqHOE.mjs +354 -0
- package/.output/server/chunks/build/default-DPkqqHOE.mjs.map +1 -0
- package/.output/server/chunks/build/default-styles.DsqVVS7k.mjs +8 -0
- package/.output/server/chunks/build/default-styles.DsqVVS7k.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-K4UfZNck.mjs +97 -0
- package/.output/server/chunks/build/error-404-K4UfZNck.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-styles.DuDrf-v0.mjs +8 -0
- package/.output/server/chunks/build/error-404-styles.DuDrf-v0.mjs.map +1 -0
- package/.output/server/chunks/build/error-500-CA7TEPNg.mjs +79 -0
- package/.output/server/chunks/build/error-500-CA7TEPNg.mjs.map +1 -0
- package/.output/server/chunks/build/error-500-styles.8IYEHzz6.mjs +8 -0
- package/.output/server/chunks/build/error-500-styles.8IYEHzz6.mjs.map +1 -0
- package/.output/server/chunks/build/examples-BHK8MDrs.mjs +134 -0
- package/.output/server/chunks/build/examples-BHK8MDrs.mjs.map +1 -0
- package/.output/server/chunks/build/export-BzxFqqfP.mjs +233 -0
- package/.output/server/chunks/build/export-BzxFqqfP.mjs.map +1 -0
- package/.output/server/chunks/build/faq-DKch73dS.mjs +112 -0
- package/.output/server/chunks/build/faq-DKch73dS.mjs.map +1 -0
- package/.output/server/chunks/build/field-guide-qbukT8F0.mjs +38 -0
- package/.output/server/chunks/build/field-guide-qbukT8F0.mjs.map +1 -0
- package/.output/server/chunks/build/first-training-BbEOBcEW.mjs +343 -0
- package/.output/server/chunks/build/first-training-BbEOBcEW.mjs.map +1 -0
- package/.output/server/chunks/build/first-training-styles.BzOa_KRD.mjs +8 -0
- package/.output/server/chunks/build/first-training-styles.BzOa_KRD.mjs.map +1 -0
- package/.output/server/chunks/build/glossary-CxSGCJoH.mjs +397 -0
- package/.output/server/chunks/build/glossary-CxSGCJoH.mjs.map +1 -0
- package/.output/server/chunks/build/huggingface-TSmyUzZU.mjs +128 -0
- package/.output/server/chunks/build/huggingface-TSmyUzZU.mjs.map +1 -0
- package/.output/server/chunks/build/import-C0kYhRv9.mjs +247 -0
- package/.output/server/chunks/build/import-C0kYhRv9.mjs.map +1 -0
- package/.output/server/chunks/build/index-C1ntBEWd.mjs +235 -0
- package/.output/server/chunks/build/index-C1ntBEWd.mjs.map +1 -0
- package/.output/server/chunks/build/index-D3CxihcX.mjs +320 -0
- package/.output/server/chunks/build/index-D3CxihcX.mjs.map +1 -0
- package/.output/server/chunks/build/index-DgKa1cy0.mjs +360 -0
- package/.output/server/chunks/build/index-DgKa1cy0.mjs.map +1 -0
- package/.output/server/chunks/build/index-cG54gaKX.mjs +513 -0
- package/.output/server/chunks/build/index-cG54gaKX.mjs.map +1 -0
- package/.output/server/chunks/build/index-styles.BX2SZiiS.mjs +8 -0
- package/.output/server/chunks/build/index-styles.BX2SZiiS.mjs.map +1 -0
- package/.output/server/chunks/build/llm-training-DIqc0eiM.mjs +91 -0
- package/.output/server/chunks/build/llm-training-DIqc0eiM.mjs.map +1 -0
- package/.output/server/chunks/build/new-b3338aLF.mjs +92 -0
- package/.output/server/chunks/build/new-b3338aLF.mjs.map +1 -0
- package/.output/server/chunks/build/nuxt-link-Ceyd90PQ.mjs +290 -0
- package/.output/server/chunks/build/nuxt-link-Ceyd90PQ.mjs.map +1 -0
- package/.output/server/chunks/build/sample-datasets-CVLWMQUA.mjs +45 -0
- package/.output/server/chunks/build/sample-datasets-CVLWMQUA.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +1979 -0
- package/.output/server/chunks/build/server.mjs.map +1 -0
- package/.output/server/chunks/build/styles.mjs +20 -0
- package/.output/server/chunks/build/styles.mjs.map +1 -0
- package/.output/server/chunks/build/test-router-BYM6Cpst.mjs +105 -0
- package/.output/server/chunks/build/test-router-BYM6Cpst.mjs.map +1 -0
- package/.output/server/chunks/nitro/nitro.mjs +5800 -0
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
- package/.output/server/chunks/routes/renderer.mjs +481 -0
- package/.output/server/chunks/routes/renderer.mjs.map +1 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
- package/.output/server/index.mjs +12 -0
- package/.output/server/index.mjs.map +1 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/api.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/app.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/component.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/context.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/hooks.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/index.js +22 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/util.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/const.js +5 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/env.js +17 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/index.js +45 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/plugin.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/proxy.js +111 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/time.js +28 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/package.json +37 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@7.7.9/dist/index.cjs +42 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@7.7.9/package.json +32 -0
- package/.output/server/node_modules/.nitro/hookable@5.5.3/dist/index.cjs +299 -0
- package/.output/server/node_modules/.nitro/hookable@5.5.3/package.json +49 -0
- package/.output/server/node_modules/.nitro/hookable@6.0.1/dist/index.mjs +266 -0
- package/.output/server/node_modules/.nitro/hookable@6.0.1/package.json +52 -0
- package/.output/server/node_modules/.nitro/perfect-debounce@1.0.0/dist/index.cjs +59 -0
- package/.output/server/node_modules/.nitro/perfect-debounce@1.0.0/package.json +44 -0
- package/.output/server/node_modules/.nitro/perfect-debounce@2.1.0/dist/index.mjs +89 -0
- package/.output/server/node_modules/.nitro/perfect-debounce@2.1.0/package.json +41 -0
- package/.output/server/node_modules/@babel/parser/lib/index.js +14582 -0
- package/.output/server/node_modules/@babel/parser/package.json +50 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/index.js +292 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.js +702 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/common.js +76 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/format.js +40 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icon.js +52 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icons.js +133 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.js +20 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.js +15 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.js +18 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.js +18 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.js +31 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +80 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.js +102 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/data.js +29 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/format.js +60 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.js +50 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +204 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +35 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +134 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +167 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +81 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +94 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.js +78 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +68 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.js +47 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +105 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +38 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +94 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +64 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.js +26 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/merge.js +18 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/name.js +58 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/square.js +34 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.js +13 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +126 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.js +21 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +38 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.js +93 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.js +48 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.js +24 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +44 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.js +125 -0
- package/.output/server/node_modules/@iconify/utils/lib/index.js +53 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/custom.js +32 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/loader.js +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/modern.js +42 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/utils.js +63 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/objects.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/strings.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/title.js +10 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/build.js +115 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/defs.js +32 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +15 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/html.js +10 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/id.js +42 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.js +23 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/parse.js +69 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.js +55 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/size.js +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/trim.js +8 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/url.js +23 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.js +9 -0
- package/.output/server/node_modules/@iconify/utils/package.json +118 -0
- package/.output/server/node_modules/@iconify/vue/dist/iconify.mjs +1893 -0
- package/.output/server/node_modules/@iconify/vue/package.json +64 -0
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6763 -0
- package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +689 -0
- package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1413 -0
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/.output/server/node_modules/@vue/devtools-kit/dist/index.cjs +6850 -0
- package/.output/server/node_modules/@vue/devtools-kit/package.json +44 -0
- package/.output/server/node_modules/@vue/devtools-shared/dist/index.cjs +378 -0
- package/.output/server/node_modules/@vue/devtools-shared/package.json +34 -0
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1870 -0
- package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6810 -0
- package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1750 -0
- package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +883 -0
- package/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +604 -0
- package/.output/server/node_modules/@vue/shared/package.json +47 -0
- package/.output/server/node_modules/birpc/dist/index.cjs +296 -0
- package/.output/server/node_modules/birpc/package.json +57 -0
- package/.output/server/node_modules/consola/dist/chunks/prompt.mjs +280 -0
- package/.output/server/node_modules/consola/dist/core.mjs +512 -0
- package/.output/server/node_modules/consola/dist/index.mjs +651 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
- package/.output/server/node_modules/consola/package.json +136 -0
- package/.output/server/node_modules/devalue/index.js +4 -0
- package/.output/server/node_modules/devalue/package.json +37 -0
- package/.output/server/node_modules/devalue/src/base64.js +110 -0
- package/.output/server/node_modules/devalue/src/constants.js +7 -0
- package/.output/server/node_modules/devalue/src/parse.js +246 -0
- package/.output/server/node_modules/devalue/src/stringify.js +350 -0
- package/.output/server/node_modules/devalue/src/uneval.js +490 -0
- package/.output/server/node_modules/devalue/src/utils.js +148 -0
- package/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
- package/.output/server/node_modules/entities/dist/commonjs/decode.js +568 -0
- package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
- package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
- package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
- package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
- package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/entities/package.json +120 -0
- package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
- package/.output/server/node_modules/estree-walker/package.json +37 -0
- package/.output/server/node_modules/pinia/dist/pinia.prod.cjs +719 -0
- package/.output/server/node_modules/pinia/package.json +94 -0
- package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
- package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
- package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
- package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
- package/.output/server/node_modules/source-map-js/package.json +71 -0
- package/.output/server/node_modules/source-map-js/source-map.js +8 -0
- package/.output/server/node_modules/tailwindcss/dist/chunk-X4GG3EDV.mjs +1 -0
- package/.output/server/node_modules/tailwindcss/dist/colors.mjs +1 -0
- package/.output/server/node_modules/tailwindcss/package.json +89 -0
- package/.output/server/node_modules/ufo/dist/index.mjs +645 -0
- package/.output/server/node_modules/ufo/package.json +48 -0
- package/.output/server/node_modules/unhead/dist/index.mjs +9 -0
- package/.output/server/node_modules/unhead/dist/parser.mjs +508 -0
- package/.output/server/node_modules/unhead/dist/plugins.mjs +101 -0
- package/.output/server/node_modules/unhead/dist/scripts.mjs +30 -0
- package/.output/server/node_modules/unhead/dist/server.mjs +180 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BPM0-cfG.mjs +44 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BYvz9V1x.mjs +43 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BnoAbrHA.mjs +269 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +148 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CbpEuj3y.mjs +71 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.D_nrZZPH.mjs +182 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.ckV6dpEQ.mjs +166 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.fVVqDC1O.mjs +203 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
- package/.output/server/node_modules/unhead/dist/utils.mjs +5 -0
- package/.output/server/node_modules/unhead/package.json +105 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
- package/.output/server/node_modules/vue/index.js +7 -0
- package/.output/server/node_modules/vue/index.mjs +1 -0
- package/.output/server/node_modules/vue/package.json +112 -0
- package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
- package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +301 -0
- package/.output/server/node_modules/vue-bundle-renderer/package.json +55 -0
- package/.output/server/node_modules/vue-router/dist/devtools-EWN81iOl.mjs +1220 -0
- package/.output/server/node_modules/vue-router/dist/vue-router.mjs +1557 -0
- package/.output/server/node_modules/vue-router/package.json +153 -0
- package/.output/server/node_modules/vue-router/vue-router.node.mjs +2 -0
- package/.output/server/package.json +37 -0
- package/LICENSE +21 -0
- package/README.md +132 -0
- package/bin/cli.js +75 -0
- package/package.json +71 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expression to test part of icon name.
|
|
3
|
+
*
|
|
4
|
+
* Used when loading icons from Iconify API due to project naming convension.
|
|
5
|
+
* Ignored when using custom icon sets - convension does not apply.
|
|
6
|
+
*/
|
|
7
|
+
const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
8
|
+
/**
|
|
9
|
+
* Convert string icon name to IconifyIconName object.
|
|
10
|
+
*/
|
|
11
|
+
const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
|
|
12
|
+
const colonSeparated = value.split(":");
|
|
13
|
+
if (value.slice(0, 1) === "@") {
|
|
14
|
+
if (colonSeparated.length < 2 || colonSeparated.length > 3) return null;
|
|
15
|
+
provider = colonSeparated.shift().slice(1);
|
|
16
|
+
}
|
|
17
|
+
if (colonSeparated.length > 3 || !colonSeparated.length) return null;
|
|
18
|
+
if (colonSeparated.length > 1) {
|
|
19
|
+
const name$1 = colonSeparated.pop();
|
|
20
|
+
const prefix = colonSeparated.pop();
|
|
21
|
+
const result = {
|
|
22
|
+
provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
|
|
23
|
+
prefix,
|
|
24
|
+
name: name$1
|
|
25
|
+
};
|
|
26
|
+
return validate && !validateIconName(result) ? null : result;
|
|
27
|
+
}
|
|
28
|
+
const name = colonSeparated[0];
|
|
29
|
+
const dashSeparated = name.split("-");
|
|
30
|
+
if (dashSeparated.length > 1) {
|
|
31
|
+
const result = {
|
|
32
|
+
provider,
|
|
33
|
+
prefix: dashSeparated.shift(),
|
|
34
|
+
name: dashSeparated.join("-")
|
|
35
|
+
};
|
|
36
|
+
return validate && !validateIconName(result) ? null : result;
|
|
37
|
+
}
|
|
38
|
+
if (allowSimpleName && provider === "") {
|
|
39
|
+
const result = {
|
|
40
|
+
provider,
|
|
41
|
+
prefix: "",
|
|
42
|
+
name
|
|
43
|
+
};
|
|
44
|
+
return validate && !validateIconName(result, allowSimpleName) ? null : result;
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Check if icon is valid.
|
|
50
|
+
*
|
|
51
|
+
* This function is not part of stringToIcon because validation is not needed for most code.
|
|
52
|
+
*/
|
|
53
|
+
const validateIconName = (icon, allowSimpleName) => {
|
|
54
|
+
if (!icon) return false;
|
|
55
|
+
return !!((allowSimpleName && icon.prefix === "" || !!icon.prefix) && !!icon.name);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { matchIconName, stringToIcon, validateIconName };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make icon square
|
|
3
|
+
*/
|
|
4
|
+
function makeIconSquare(icon) {
|
|
5
|
+
if (icon.width !== icon.height) {
|
|
6
|
+
const max = Math.max(icon.width, icon.height);
|
|
7
|
+
return {
|
|
8
|
+
...icon,
|
|
9
|
+
width: max,
|
|
10
|
+
height: max,
|
|
11
|
+
left: icon.left - (max - icon.width) / 2,
|
|
12
|
+
top: icon.top - (max - icon.height) / 2
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return icon;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Make icon viewBox square
|
|
19
|
+
*/
|
|
20
|
+
function makeViewBoxSquare(viewBox) {
|
|
21
|
+
const [left, top, width, height] = viewBox;
|
|
22
|
+
if (width !== height) {
|
|
23
|
+
const max = Math.max(width, height);
|
|
24
|
+
return [
|
|
25
|
+
left - (max - width) / 2,
|
|
26
|
+
top - (max - height) / 2,
|
|
27
|
+
max,
|
|
28
|
+
max
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
return viewBox;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { makeIconSquare, makeViewBoxSquare };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge transformations
|
|
3
|
+
*/
|
|
4
|
+
function mergeIconTransformations(obj1, obj2) {
|
|
5
|
+
const result = {};
|
|
6
|
+
if (!obj1.hFlip !== !obj2.hFlip) result.hFlip = true;
|
|
7
|
+
if (!obj1.vFlip !== !obj2.vFlip) result.vFlip = true;
|
|
8
|
+
const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
|
|
9
|
+
if (rotate) result.rotate = rotate;
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { mergeIconTransformations };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
const minDisplayHeight = 16;
|
|
2
|
+
const maxDisplayHeight = 24;
|
|
3
|
+
/**
|
|
4
|
+
* Check if displayHeight value is valid, returns 0 on failure
|
|
5
|
+
*/
|
|
6
|
+
function validateDisplayHeight(value) {
|
|
7
|
+
while (value < minDisplayHeight) value *= 2;
|
|
8
|
+
while (value > maxDisplayHeight) value /= 2;
|
|
9
|
+
return value === Math.round(value) && value >= minDisplayHeight && value <= maxDisplayHeight ? value : 0;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Convert data to valid CollectionInfo
|
|
13
|
+
*/
|
|
14
|
+
function convertIconSetInfo(data, expectedPrefix = "") {
|
|
15
|
+
if (typeof data !== "object" || data === null) return null;
|
|
16
|
+
const source = data;
|
|
17
|
+
const getSourceNestedString = (field, key, defaultValue = "") => {
|
|
18
|
+
if (typeof source[field] !== "object") return defaultValue;
|
|
19
|
+
const obj = source[field];
|
|
20
|
+
return typeof obj[key] === "string" ? obj[key] : defaultValue;
|
|
21
|
+
};
|
|
22
|
+
let name;
|
|
23
|
+
if (typeof source.name === "string") name = source.name;
|
|
24
|
+
else if (typeof source.title === "string") name = source.title;
|
|
25
|
+
else return null;
|
|
26
|
+
if (expectedPrefix !== "" && typeof source.prefix === "string" && source.prefix !== expectedPrefix) return null;
|
|
27
|
+
const info = { name };
|
|
28
|
+
switch (typeof source.total) {
|
|
29
|
+
case "number":
|
|
30
|
+
info.total = source.total;
|
|
31
|
+
break;
|
|
32
|
+
case "string": {
|
|
33
|
+
const num = parseInt(source.total);
|
|
34
|
+
if (num > 0) info.total = num;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (typeof source.version === "string") info.version = source.version;
|
|
39
|
+
info.author = { name: getSourceNestedString("author", "name", typeof source.author === "string" ? source.author : "") };
|
|
40
|
+
if (typeof source.author === "object") {
|
|
41
|
+
const sourceAuthor = source.author;
|
|
42
|
+
if (typeof sourceAuthor.url === "string") info.author.url = sourceAuthor.url;
|
|
43
|
+
}
|
|
44
|
+
info.license = { title: getSourceNestedString("license", "title", typeof source.license === "string" ? source.license : "") };
|
|
45
|
+
if (typeof source.license === "object") {
|
|
46
|
+
const sourceLicense = source.license;
|
|
47
|
+
if (typeof sourceLicense.spdx === "string") info.license.spdx = sourceLicense.spdx;
|
|
48
|
+
if (typeof sourceLicense.url === "string") info.license.url = sourceLicense.url;
|
|
49
|
+
}
|
|
50
|
+
if (source.samples instanceof Array) {
|
|
51
|
+
const samples = [];
|
|
52
|
+
source.samples.forEach((item) => {
|
|
53
|
+
if (typeof item === "string" && !samples.includes(item)) samples.push(item);
|
|
54
|
+
});
|
|
55
|
+
if (samples.length) info.samples = samples;
|
|
56
|
+
}
|
|
57
|
+
if (typeof source.height === "number" || typeof source.height === "string") {
|
|
58
|
+
const num = parseInt(source.height);
|
|
59
|
+
if (num > 0) info.height = num;
|
|
60
|
+
}
|
|
61
|
+
if (source.height instanceof Array) {
|
|
62
|
+
source.height.forEach((item) => {
|
|
63
|
+
const num = parseInt(item);
|
|
64
|
+
if (num > 0) {
|
|
65
|
+
if (!(info.height instanceof Array)) info.height = [];
|
|
66
|
+
info.height.push(num);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
switch (info.height.length) {
|
|
70
|
+
case 0:
|
|
71
|
+
delete info.height;
|
|
72
|
+
break;
|
|
73
|
+
case 1: info.height = info.height[0];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (typeof info.height === "number") {
|
|
77
|
+
const displayHeight = validateDisplayHeight(info.height);
|
|
78
|
+
if (displayHeight && displayHeight !== info.height) info.displayHeight = displayHeight;
|
|
79
|
+
}
|
|
80
|
+
["samplesHeight", "displayHeight"].forEach((prop) => {
|
|
81
|
+
const value = source[prop];
|
|
82
|
+
if (typeof value === "number" || typeof value === "string") {
|
|
83
|
+
const displayHeight = validateDisplayHeight(parseInt(value));
|
|
84
|
+
if (displayHeight) info.displayHeight = displayHeight;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
if (typeof source.category === "string") info.category = source.category;
|
|
88
|
+
if (source.tags instanceof Array) info.tags = source.tags;
|
|
89
|
+
switch (typeof source.palette) {
|
|
90
|
+
case "boolean":
|
|
91
|
+
info.palette = source.palette;
|
|
92
|
+
break;
|
|
93
|
+
case "string":
|
|
94
|
+
switch (source.palette.toLowerCase()) {
|
|
95
|
+
case "colorless":
|
|
96
|
+
case "false":
|
|
97
|
+
info.palette = false;
|
|
98
|
+
break;
|
|
99
|
+
case "colorful":
|
|
100
|
+
case "true": info.palette = true;
|
|
101
|
+
}
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (source.hidden === true) info.hidden = true;
|
|
105
|
+
Object.keys(source).forEach((key) => {
|
|
106
|
+
const value = source[key];
|
|
107
|
+
if (typeof value !== "string") return;
|
|
108
|
+
switch (key) {
|
|
109
|
+
case "url":
|
|
110
|
+
case "uri":
|
|
111
|
+
info.author.url = value;
|
|
112
|
+
break;
|
|
113
|
+
case "licenseURL":
|
|
114
|
+
case "licenseURI":
|
|
115
|
+
info.license.url = value;
|
|
116
|
+
break;
|
|
117
|
+
case "licenseID":
|
|
118
|
+
case "licenseSPDX":
|
|
119
|
+
info.license.spdx = value;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
return info;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export { convertIconSetInfo };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defaultIconDimensions } from "../icon/defaults.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Expand minified icon set
|
|
5
|
+
*
|
|
6
|
+
* Opposite of minifyIconSet() from ./minify.ts
|
|
7
|
+
*/
|
|
8
|
+
function expandIconSet(data) {
|
|
9
|
+
const icons = Object.keys(data.icons);
|
|
10
|
+
Object.keys(defaultIconDimensions).forEach((prop) => {
|
|
11
|
+
if (typeof data[prop] !== typeof defaultIconDimensions[prop]) return;
|
|
12
|
+
const value = data[prop];
|
|
13
|
+
icons.forEach((name) => {
|
|
14
|
+
const item = data.icons[name];
|
|
15
|
+
if (!(prop in item)) item[prop] = value;
|
|
16
|
+
});
|
|
17
|
+
delete data[prop];
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { expandIconSet };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { mergeIconData } from "../icon/merge.js";
|
|
2
|
+
import { getIconsTree } from "./tree.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Get icon data, using prepared aliases tree
|
|
6
|
+
*/
|
|
7
|
+
function internalGetIconData(data, name, tree) {
|
|
8
|
+
const icons = data.icons;
|
|
9
|
+
const aliases = data.aliases || Object.create(null);
|
|
10
|
+
let currentProps = {};
|
|
11
|
+
function parse(name$1) {
|
|
12
|
+
currentProps = mergeIconData(icons[name$1] || aliases[name$1], currentProps);
|
|
13
|
+
}
|
|
14
|
+
parse(name);
|
|
15
|
+
tree.forEach(parse);
|
|
16
|
+
return mergeIconData(data, currentProps);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get data for icon
|
|
20
|
+
*/
|
|
21
|
+
function getIconData(data, name) {
|
|
22
|
+
if (data.icons[name]) return internalGetIconData(data, name, []);
|
|
23
|
+
const tree = getIconsTree(data, [name])[name];
|
|
24
|
+
return tree ? internalGetIconData(data, name, tree) : null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { getIconData, internalGetIconData };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defaultIconDimensions } from "../icon/defaults.js";
|
|
2
|
+
import { getIconsTree } from "./tree.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Optional properties that must be copied when copying icon set
|
|
6
|
+
*/
|
|
7
|
+
const propsToCopy = Object.keys(defaultIconDimensions).concat(["provider"]);
|
|
8
|
+
/**
|
|
9
|
+
* Extract icons from icon set
|
|
10
|
+
*/
|
|
11
|
+
function getIcons(data, names, not_found) {
|
|
12
|
+
const icons = Object.create(null);
|
|
13
|
+
const aliases = Object.create(null);
|
|
14
|
+
const result = {
|
|
15
|
+
prefix: data.prefix,
|
|
16
|
+
icons
|
|
17
|
+
};
|
|
18
|
+
const sourceIcons = data.icons;
|
|
19
|
+
const sourceAliases = data.aliases || Object.create(null);
|
|
20
|
+
if (data.lastModified) result.lastModified = data.lastModified;
|
|
21
|
+
const tree = getIconsTree(data, names);
|
|
22
|
+
let empty = true;
|
|
23
|
+
for (const name in tree) if (!tree[name]) {
|
|
24
|
+
if (not_found && names.indexOf(name) !== -1) (result.not_found || (result.not_found = [])).push(name);
|
|
25
|
+
} else if (sourceIcons[name]) {
|
|
26
|
+
icons[name] = { ...sourceIcons[name] };
|
|
27
|
+
empty = false;
|
|
28
|
+
} else {
|
|
29
|
+
aliases[name] = { ...sourceAliases[name] };
|
|
30
|
+
result.aliases = aliases;
|
|
31
|
+
}
|
|
32
|
+
propsToCopy.forEach((attr) => {
|
|
33
|
+
if (attr in data) result[attr] = data[attr];
|
|
34
|
+
});
|
|
35
|
+
return empty && not_found !== true ? null : result;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { getIcons, propsToCopy };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { defaultIconDimensions } from "../icon/defaults.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Minify icon set
|
|
5
|
+
*
|
|
6
|
+
* Function finds common values for few numeric properties, such as 'width' and 'height' (see defaultIconDimensions keys for list of properties),
|
|
7
|
+
* removes entries from icons and sets default entry in root of icon set object.
|
|
8
|
+
*
|
|
9
|
+
* For example, this:
|
|
10
|
+
* {
|
|
11
|
+
* icons: {
|
|
12
|
+
* foo: {
|
|
13
|
+
* body: '<g />',
|
|
14
|
+
* width: 24
|
|
15
|
+
* },
|
|
16
|
+
* bar: {
|
|
17
|
+
* body: '<g />',
|
|
18
|
+
* width: 24
|
|
19
|
+
* },
|
|
20
|
+
* baz: {
|
|
21
|
+
* body: '<g />',
|
|
22
|
+
* width: 16
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
* is changed to this:
|
|
27
|
+
* {
|
|
28
|
+
* icons: {
|
|
29
|
+
* foo: {
|
|
30
|
+
* body: '<g />'
|
|
31
|
+
* },
|
|
32
|
+
* bar: {
|
|
33
|
+
* body: '<g />'
|
|
34
|
+
* },
|
|
35
|
+
* baz: {
|
|
36
|
+
* body: '<g />',
|
|
37
|
+
* width: 16
|
|
38
|
+
* }
|
|
39
|
+
* },
|
|
40
|
+
* width: 24
|
|
41
|
+
* }
|
|
42
|
+
*/
|
|
43
|
+
function minifyIconSet(data) {
|
|
44
|
+
const icons = Object.keys(data.icons);
|
|
45
|
+
Object.keys(defaultIconDimensions).forEach((prop) => {
|
|
46
|
+
if (data[prop] === defaultIconDimensions[prop]) delete data[prop];
|
|
47
|
+
const defaultValue = defaultIconDimensions[prop];
|
|
48
|
+
const propType = typeof defaultValue;
|
|
49
|
+
const hasMinifiedDefault = typeof data[prop] === propType && data[prop] !== defaultValue;
|
|
50
|
+
let maxCount = 0;
|
|
51
|
+
let maxValue = null;
|
|
52
|
+
const counters = /* @__PURE__ */ new Map();
|
|
53
|
+
for (let i = 0; i < icons.length; i++) {
|
|
54
|
+
const item = data.icons[icons[i]];
|
|
55
|
+
let value;
|
|
56
|
+
if (typeof item[prop] === propType) value = item[prop];
|
|
57
|
+
else if (hasMinifiedDefault) value = data[prop];
|
|
58
|
+
else value = defaultIconDimensions[prop];
|
|
59
|
+
if (i === 0) {
|
|
60
|
+
maxCount = 1;
|
|
61
|
+
maxValue = value;
|
|
62
|
+
counters.set(value, 1);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (!counters.has(value)) {
|
|
66
|
+
counters.set(value, 1);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const count = counters.get(value) + 1;
|
|
70
|
+
counters.set(value, count);
|
|
71
|
+
if (count > maxCount) {
|
|
72
|
+
maxCount = count;
|
|
73
|
+
maxValue = value;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const canMinify = maxValue !== null && maxCount > 1;
|
|
77
|
+
const oldDefault = hasMinifiedDefault ? data[prop] : null;
|
|
78
|
+
const newDefault = canMinify ? maxValue : oldDefault;
|
|
79
|
+
if (newDefault === defaultValue) delete data[prop];
|
|
80
|
+
else if (canMinify) data[prop] = newDefault;
|
|
81
|
+
icons.forEach((key) => {
|
|
82
|
+
const item = data.icons[key];
|
|
83
|
+
const value = prop in item ? item[prop] : hasMinifiedDefault ? oldDefault : defaultValue;
|
|
84
|
+
if (value === newDefault || newDefault === null && value === defaultValue) {
|
|
85
|
+
delete item[prop];
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (canMinify && !(prop in item)) item[prop] = value;
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { minifyIconSet };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { getIconsTree } from "./tree.js";
|
|
2
|
+
import { internalGetIconData } from "./get-icon.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Extract icons from an icon set
|
|
6
|
+
*
|
|
7
|
+
* Returns list of icons that were found in icon set
|
|
8
|
+
*/
|
|
9
|
+
function parseIconSet(data, callback) {
|
|
10
|
+
const names = [];
|
|
11
|
+
if (typeof data !== "object" || typeof data.icons !== "object") return names;
|
|
12
|
+
if (data.not_found instanceof Array) data.not_found.forEach((name) => {
|
|
13
|
+
callback(name, null);
|
|
14
|
+
names.push(name);
|
|
15
|
+
});
|
|
16
|
+
const tree = getIconsTree(data);
|
|
17
|
+
for (const name in tree) {
|
|
18
|
+
const item = tree[name];
|
|
19
|
+
if (item) {
|
|
20
|
+
callback(name, internalGetIconData(data, name, item));
|
|
21
|
+
names.push(name);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return names;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Async version of parseIconSet()
|
|
28
|
+
*/
|
|
29
|
+
async function parseIconSetAsync(data, callback) {
|
|
30
|
+
const names = [];
|
|
31
|
+
if (typeof data !== "object" || typeof data.icons !== "object") return names;
|
|
32
|
+
if (data.not_found instanceof Array) for (let i = 0; i < data.not_found.length; i++) {
|
|
33
|
+
const name = data.not_found[i];
|
|
34
|
+
await callback(name, null);
|
|
35
|
+
names.push(name);
|
|
36
|
+
}
|
|
37
|
+
const tree = getIconsTree(data);
|
|
38
|
+
for (const name in tree) {
|
|
39
|
+
const item = tree[name];
|
|
40
|
+
if (item) {
|
|
41
|
+
await callback(name, internalGetIconData(data, name, item));
|
|
42
|
+
names.push(name);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return names;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { parseIconSet, parseIconSetAsync };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve icon set icons
|
|
3
|
+
*
|
|
4
|
+
* Returns parent icon for each icon
|
|
5
|
+
*/
|
|
6
|
+
function getIconsTree(data, names) {
|
|
7
|
+
const icons = data.icons;
|
|
8
|
+
const aliases = data.aliases || Object.create(null);
|
|
9
|
+
const resolved = Object.create(null);
|
|
10
|
+
function resolve(name) {
|
|
11
|
+
if (icons[name]) return resolved[name] = [];
|
|
12
|
+
if (!(name in resolved)) {
|
|
13
|
+
resolved[name] = null;
|
|
14
|
+
const parent = aliases[name] && aliases[name].parent;
|
|
15
|
+
const value = parent && resolve(parent);
|
|
16
|
+
if (value) resolved[name] = [parent].concat(value);
|
|
17
|
+
}
|
|
18
|
+
return resolved[name];
|
|
19
|
+
}
|
|
20
|
+
(names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
|
|
21
|
+
return resolved;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { getIconsTree };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { defaultExtendedIconProps, defaultIconDimensions } from "../icon/defaults.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Optional properties
|
|
5
|
+
*/
|
|
6
|
+
const optionalPropertyDefaults = {
|
|
7
|
+
provider: "",
|
|
8
|
+
aliases: {},
|
|
9
|
+
not_found: {},
|
|
10
|
+
...defaultIconDimensions
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Check props
|
|
14
|
+
*/
|
|
15
|
+
function checkOptionalProps(item, defaults) {
|
|
16
|
+
for (const prop in defaults) if (prop in item && typeof item[prop] !== typeof defaults[prop]) return false;
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Validate icon set, return it as IconifyJSON on success, null on failure
|
|
21
|
+
*
|
|
22
|
+
* Unlike validateIconSet(), this function is very basic.
|
|
23
|
+
* It does not throw exceptions, it does not check metadata, it does not fix stuff.
|
|
24
|
+
*/
|
|
25
|
+
function quicklyValidateIconSet(obj) {
|
|
26
|
+
if (typeof obj !== "object" || obj === null) return null;
|
|
27
|
+
const data = obj;
|
|
28
|
+
if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") return null;
|
|
29
|
+
if (!checkOptionalProps(obj, optionalPropertyDefaults)) return null;
|
|
30
|
+
const icons = data.icons;
|
|
31
|
+
for (const name in icons) {
|
|
32
|
+
const icon = icons[name];
|
|
33
|
+
if (!name || typeof icon.body !== "string" || !checkOptionalProps(icon, defaultExtendedIconProps)) return null;
|
|
34
|
+
}
|
|
35
|
+
const aliases = data.aliases || Object.create(null);
|
|
36
|
+
for (const name in aliases) {
|
|
37
|
+
const icon = aliases[name];
|
|
38
|
+
const parent = icon.parent;
|
|
39
|
+
if (!name || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(icon, defaultExtendedIconProps)) return null;
|
|
40
|
+
}
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { quicklyValidateIconSet };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { defaultExtendedIconProps } from "../icon/defaults.js";
|
|
2
|
+
import { getIconsTree } from "./tree.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Match character
|
|
6
|
+
*/
|
|
7
|
+
const matchChar = /^[a-f0-9]+(-[a-f0-9]+)*$/;
|
|
8
|
+
/**
|
|
9
|
+
* Validate icon
|
|
10
|
+
*
|
|
11
|
+
* Returns name of property that failed validation or null on success
|
|
12
|
+
*/
|
|
13
|
+
function validateIconProps(item, fix, checkOtherProps) {
|
|
14
|
+
for (const key in item) {
|
|
15
|
+
const attr = key;
|
|
16
|
+
const type = typeof item[attr];
|
|
17
|
+
if (type === "undefined") {
|
|
18
|
+
delete item[attr];
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const expectedType = typeof defaultExtendedIconProps[attr];
|
|
22
|
+
if (expectedType !== "undefined") {
|
|
23
|
+
if (type !== expectedType) {
|
|
24
|
+
if (fix) {
|
|
25
|
+
delete item[attr];
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
return attr;
|
|
29
|
+
}
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (checkOtherProps && type === "object") if (fix) delete item[attr];
|
|
33
|
+
else return key;
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Validate icon set
|
|
39
|
+
* @returns param obj as IconifyJSON type on success, throw error on failure
|
|
40
|
+
*/
|
|
41
|
+
function validateIconSet(obj, options) {
|
|
42
|
+
const fix = !!(options && options.fix);
|
|
43
|
+
if (typeof obj !== "object" || obj === null || typeof obj.icons !== "object" || !obj.icons) throw new Error("Bad icon set");
|
|
44
|
+
const data = obj;
|
|
45
|
+
if (options && typeof options.prefix === "string") data.prefix = options.prefix;
|
|
46
|
+
else if (typeof data.prefix !== "string" || !data.prefix) throw new Error("Invalid prefix");
|
|
47
|
+
if (options && typeof options.provider === "string") data.provider = options.provider;
|
|
48
|
+
else if (data.provider !== void 0) {
|
|
49
|
+
if (typeof data.provider !== "string") if (fix) delete data.provider;
|
|
50
|
+
else throw new Error("Invalid provider");
|
|
51
|
+
}
|
|
52
|
+
if (data.aliases !== void 0) {
|
|
53
|
+
if (typeof data.aliases !== "object" || data.aliases === null) if (fix) delete data.aliases;
|
|
54
|
+
else throw new Error("Invalid aliases list");
|
|
55
|
+
}
|
|
56
|
+
const tree = getIconsTree(data);
|
|
57
|
+
const icons = data.icons;
|
|
58
|
+
const aliases = data.aliases || Object.create(null);
|
|
59
|
+
for (const name in tree) {
|
|
60
|
+
const treeItem = tree[name];
|
|
61
|
+
const isAlias = !icons[name];
|
|
62
|
+
const parentObj = isAlias ? aliases : icons;
|
|
63
|
+
if (!treeItem) {
|
|
64
|
+
if (fix) {
|
|
65
|
+
delete parentObj[name];
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
throw new Error(`Invalid alias: ${name}`);
|
|
69
|
+
}
|
|
70
|
+
if (!name) {
|
|
71
|
+
if (fix) {
|
|
72
|
+
delete parentObj[name];
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
throw new Error(`Invalid icon name: "${name}"`);
|
|
76
|
+
}
|
|
77
|
+
const item = parentObj[name];
|
|
78
|
+
if (!isAlias) {
|
|
79
|
+
if (typeof item.body !== "string") {
|
|
80
|
+
if (fix) {
|
|
81
|
+
delete parentObj[name];
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
throw new Error(`Invalid icon: "${name}"`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const requiredProp = isAlias ? "parent" : "body";
|
|
88
|
+
const key = typeof item[requiredProp] !== "string" ? requiredProp : validateIconProps(item, fix, true);
|
|
89
|
+
if (key !== null) throw new Error(`Invalid property "${key}" in "${name}"`);
|
|
90
|
+
}
|
|
91
|
+
if (data.not_found !== void 0 && !(data.not_found instanceof Array)) if (fix) delete data.not_found;
|
|
92
|
+
else throw new Error("Invalid not_found list");
|
|
93
|
+
if (!Object.keys(data.icons).length && !(data.not_found && data.not_found.length)) throw new Error("Icon set is empty");
|
|
94
|
+
if (fix && !Object.keys(aliases).length) delete data.aliases;
|
|
95
|
+
const failedOptionalProp = validateIconProps(data, false, false);
|
|
96
|
+
if (failedOptionalProp) throw new Error(`Invalid value type for "${failedOptionalProp}"`);
|
|
97
|
+
if (data.chars !== void 0) {
|
|
98
|
+
if (typeof data.chars !== "object" || data.chars === null) if (fix) delete data.chars;
|
|
99
|
+
else throw new Error("Invalid characters map");
|
|
100
|
+
}
|
|
101
|
+
if (typeof data.chars === "object") {
|
|
102
|
+
const chars = data.chars;
|
|
103
|
+
Object.keys(chars).forEach((char) => {
|
|
104
|
+
if (!matchChar.exec(char) || typeof chars[char] !== "string") {
|
|
105
|
+
if (fix) {
|
|
106
|
+
delete chars[char];
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
throw new Error(`Invalid character "${char}"`);
|
|
110
|
+
}
|
|
111
|
+
const target = chars[char];
|
|
112
|
+
if (!data.icons[target] && (!data.aliases || !data.aliases[target])) {
|
|
113
|
+
if (fix) {
|
|
114
|
+
delete chars[char];
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
throw new Error(`Character "${char}" points to missing icon "${target}"`);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
if (fix && !Object.keys(data.chars).length) delete data.chars;
|
|
121
|
+
}
|
|
122
|
+
return data;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export { matchChar, validateIconSet };
|