@bariskuran/base 0.0.0-stage → 0.0.2
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/LICENSE +21 -0
- package/README.md +114 -2
- package/package.json +93 -4
- package/src/.prettierrc.cjs +1 -0
- package/src/.vscode/launch.json +15 -0
- package/src/.vscode/settings.json +13 -0
- package/src/constants/API_RESPONSE_CODES.js +300 -0
- package/src/constants/COUNTRY_INFORMATION.js +8322 -0
- package/src/constants/COUNTRY_INFORMATION_dS.jsx +57 -0
- package/src/constants/DATE_DEFAULTS.js +10 -0
- package/src/constants/DEFAULT_BREAKPOINTS.js +8 -0
- package/src/constants/DEFAULT_GLOBAL_CORESTORE_VARIABLES.js +4 -0
- package/src/constants/DEFAULT_GLOBAL_STYLE.js +73 -0
- package/src/constants/DEFAULT_MAX_ASP_RATIO.js +1 -0
- package/src/constants/DEFAULT_MIN_ASP_RATIO.js +1 -0
- package/src/constants/DEFAULT_PRIMARY_FONT.js +10 -0
- package/src/constants/DEFAULT_REM_SETTINGS.js +22 -0
- package/src/constants/DEFAULT_THEME.js +10 -0
- package/src/constants/LANGUAGES.js +2396 -0
- package/src/constants/LANGUAGES_dS.jsx +37 -0
- package/src/constants/LOREM_VOCABULARY.js +177 -0
- package/src/constants/LOWER_CASE_ALPHABET.js +1 -0
- package/src/constants/LOWER_CASE_ALPHABET_dS.jsx +24 -0
- package/src/constants/NUMBERS.js +1 -0
- package/src/constants/NUMBERS_dS.jsx +24 -0
- package/src/constants/SYMBOLS.js +1 -0
- package/src/constants/SYMBOLS_dS.jsx +24 -0
- package/src/constants/SYS.js +3 -0
- package/src/constants/TEXT_LIBRARY.js +72 -0
- package/src/constants/UPPER_CASE_ALPHABET.js +1 -0
- package/src/constants/UPPER_CASE_ALPHABET_dS.jsx +24 -0
- package/src/constants/VALIDATION_RULES.js +1310 -0
- package/src/design-system.js +5 -0
- package/src/helpers/NestedBaseUi/_dS.jsx +70 -0
- package/src/helpers/NestedBaseUi/index.jsx +80 -0
- package/src/helpers/NotifierListener/DefaultVariant.js +47 -0
- package/src/helpers/NotifierListener/index.js +3 -0
- package/src/helpers/NotifierListener/tools/Base.jsx +51 -0
- package/src/helpers/NotifierListener/tools/Box.jsx +116 -0
- package/src/helpers/NotifierListener/tools/TimeBar.jsx +49 -0
- package/src/helpers/NotifierListener/tools/_styled.js +74 -0
- package/src/helpers/NotifierListener/tools/useDisplayQueue.js +85 -0
- package/src/helpers/NotifierListener/tools/useVars.js +33 -0
- package/src/helpers/componentCreator/index.jsx +111 -0
- package/src/helpers/getScrollParent/index.js +173 -0
- package/src/helpers/getScrollParent/useScrollTarget.js +102 -0
- package/src/helpers/useExportedData/index.js +36 -0
- package/src/index.js +184 -0
- package/src/libs/@Base/ErrorPage/_styled.js +98 -0
- package/src/libs/@Base/ErrorPage/index.jsx +109 -0
- package/src/libs/@Base/GlobalDataAndRouter/index.jsx +100 -0
- package/src/libs/@Base/GlobalDataProvider/index.js +277 -0
- package/src/libs/@Base/GlobalDataProvider/resolveLanguage.js +180 -0
- package/src/libs/@Base/LanguageManager/index.js +99 -0
- package/src/libs/@Base/Suspense/index.jsx +12 -0
- package/src/libs/@Base/_dS.jsx +54 -0
- package/src/libs/@Base/_dS_howToSetup.jsx +151 -0
- package/src/libs/@Base/_dS_projectSettings.jsx +370 -0
- package/src/libs/@Base/index.jsx +44 -0
- package/src/libs/@Base/loadingQueueManager/_tools.js +186 -0
- package/src/libs/@Base/loadingQueueManager/index.js +63 -0
- package/src/libs/@Base/loadingQueueManager/loadingApi.js +100 -0
- package/src/libs/@Base/prepareRoutes/index.js +176 -0
- package/src/libs/@Base/styling/GlobalStyle.js +7 -0
- package/src/libs/@Base/styling/fontCss.js +64 -0
- package/src/libs/@Base/styling/generateMediaFunctions.js +143 -0
- package/src/libs/@Base/styling/generateMediaFunctions.test.js +56 -0
- package/src/libs/@Base/styling/index.jsx +73 -0
- package/src/libs/@Base/styling/injectInitialRemAndBodyFontStyle.js +43 -0
- package/src/libs/@Base/styling/prepareRemSettings.js +6 -0
- package/src/libs/@Base/styling/useTheme.js +137 -0
- package/src/libs/@Base/useEffects/index.js +46 -0
- package/src/libs/BlockBuilder/Amedist/_styled.js +13 -0
- package/src/libs/BlockBuilder/Amedist/index.jsx +34 -0
- package/src/libs/BlockBuilder/_dS.jsx +85 -0
- package/src/libs/BlockBuilder/amedistHorizontalLeft/_styled.js +85 -0
- package/src/libs/BlockBuilder/amedistHorizontalLeft/index.jsx +43 -0
- package/src/libs/BlockBuilder/amedistHorizontalRight/_styled.js +85 -0
- package/src/libs/BlockBuilder/amedistHorizontalRight/index.jsx +43 -0
- package/src/libs/BlockBuilder/amedistVertical/_styled.js +112 -0
- package/src/libs/BlockBuilder/amedistVertical/index.jsx +56 -0
- package/src/libs/BlockBuilder/index.js +22 -0
- package/src/libs/Button/Amedist.js +50 -0
- package/src/libs/Button/AnimatedBg.js +50 -0
- package/src/libs/Button/Brackets.js +61 -0
- package/src/libs/Button/DefaultVariant.js +52 -0
- package/src/libs/Button/Plain.js +34 -0
- package/src/libs/Button/SquareOnRight.js +65 -0
- package/src/libs/Button/String.js +94 -0
- package/src/libs/Button/Underline.js +61 -0
- package/src/libs/Button/WithCopyIcon.js +22 -0
- package/src/libs/Button/_Base.jsx +151 -0
- package/src/libs/Button/_dS.jsx +787 -0
- package/src/libs/Button/index.js +59 -0
- package/src/libs/Button/tools/IconArea.jsx +109 -0
- package/src/libs/Button/tools/ScaleWrapper.jsx +29 -0
- package/src/libs/Button/tools/_styled.js +96 -0
- package/src/libs/Button/tools/backgroundFill.js +20 -0
- package/src/libs/Button/tools/generateColors.js +207 -0
- package/src/libs/Button/tools/useTimers.js +86 -0
- package/src/libs/Button/tools/useVars.js +461 -0
- package/src/libs/ButtonGroup/DefaultVariant.js +12 -0
- package/src/libs/ButtonGroup/PlainVariant.js +14 -0
- package/src/libs/ButtonGroup/_dS.jsx +280 -0
- package/src/libs/ButtonGroup/index.jsx +60 -0
- package/src/libs/ButtonGroup/tools/ScrollEdgeShadowLayers.jsx +76 -0
- package/src/libs/ButtonGroup/tools/_Base.jsx +129 -0
- package/src/libs/ButtonGroup/tools/useScrollEdgeShadow.js +82 -0
- package/src/libs/ButtonGroup/tools/useVars.js +54 -0
- package/src/libs/COLORS/_dS.jsx +93 -0
- package/src/libs/COLORS/_styled.js +62 -0
- package/src/libs/COLORS/index.js +6 -0
- package/src/libs/COLORS/themeScales.js +68 -0
- package/src/libs/Card/Amedist/_styled.js +161 -0
- package/src/libs/Card/Amedist/index.jsx +38 -0
- package/src/libs/Card/_Base.jsx +94 -0
- package/src/libs/Card/_dS.jsx +177 -0
- package/src/libs/Card/index.js +14 -0
- package/src/libs/Card/tools/useVars.js +95 -0
- package/src/libs/CardViewer/Grid.js +7 -0
- package/src/libs/CardViewer/Masonry.js +7 -0
- package/src/libs/CardViewer/_dS.jsx +214 -0
- package/src/libs/CardViewer/index.jsx +107 -0
- package/src/libs/CardViewer/index.test.jsx +13 -0
- package/src/libs/CardViewer/tools/_styled.js +94 -0
- package/src/libs/CardViewer/tools/useVars.js +34 -0
- package/src/libs/DesignSystem/ApiViewer/_dS.jsx +71 -0
- package/src/libs/DesignSystem/ApiViewer/_styled.js +58 -0
- package/src/libs/DesignSystem/ApiViewer/index.jsx +149 -0
- package/src/libs/DesignSystem/Block/_dS.jsx +62 -0
- package/src/libs/DesignSystem/Block/_styled.js +99 -0
- package/src/libs/DesignSystem/Block/index.jsx +104 -0
- package/src/libs/DesignSystem/CodeViewer/_dS.jsx +75 -0
- package/src/libs/DesignSystem/CodeViewer/_styled.js +39 -0
- package/src/libs/DesignSystem/CodeViewer/index.jsx +46 -0
- package/src/libs/DesignSystem/CodeViewer/tools/codeFormatters.jsx +558 -0
- package/src/libs/DesignSystem/Layout/_styled.js +40 -0
- package/src/libs/DesignSystem/Layout/index.jsx +107 -0
- package/src/libs/DesignSystem/Layout/tools/pageTitle.js +4 -0
- package/src/libs/DesignSystem/Layout/useVars.js +15 -0
- package/src/libs/DesignSystem/OutputArea/index.jsx +150 -0
- package/src/libs/DesignSystem/Page/index.jsx +56 -0
- package/src/libs/DesignSystem/Routes.jsx +27 -0
- package/src/libs/DesignSystem/VariantViewer/_styled.js +22 -0
- package/src/libs/DesignSystem/VariantViewer/index.jsx +20 -0
- package/src/libs/DesignSystem/_dS.jsx +60 -0
- package/src/libs/DesignSystem/_dS_welcome.jsx +48 -0
- package/src/libs/DesignSystem/formatJsonForDisplay.js +110 -0
- package/src/libs/DesignSystem/index.jsx +210 -0
- package/src/libs/DesignSystem/isJsxDescription.js +12 -0
- package/src/libs/DesignSystem/useOutputViewer/index.jsx +75 -0
- package/src/libs/Dropdown/_styled.js +24 -0
- package/src/libs/Dropdown/index.jsx +91 -0
- package/src/libs/Flag/_dS.jsx +73 -0
- package/src/libs/Flag/_dSLibrary.jsx +120 -0
- package/src/libs/Flag/flags/ad.js +1 -0
- package/src/libs/Flag/flags/ae.js +1 -0
- package/src/libs/Flag/flags/af.js +1 -0
- package/src/libs/Flag/flags/ag.js +1 -0
- package/src/libs/Flag/flags/ai.js +1 -0
- package/src/libs/Flag/flags/al.js +1 -0
- package/src/libs/Flag/flags/am.js +1 -0
- package/src/libs/Flag/flags/ao.js +1 -0
- package/src/libs/Flag/flags/aq.js +1 -0
- package/src/libs/Flag/flags/ar.js +1 -0
- package/src/libs/Flag/flags/as.js +1 -0
- package/src/libs/Flag/flags/at.js +1 -0
- package/src/libs/Flag/flags/au.js +1 -0
- package/src/libs/Flag/flags/aw.js +1 -0
- package/src/libs/Flag/flags/ax.js +1 -0
- package/src/libs/Flag/flags/az.js +1 -0
- package/src/libs/Flag/flags/ba.js +1 -0
- package/src/libs/Flag/flags/bb.js +1 -0
- package/src/libs/Flag/flags/bd.js +1 -0
- package/src/libs/Flag/flags/be.js +1 -0
- package/src/libs/Flag/flags/bf.js +1 -0
- package/src/libs/Flag/flags/bg.js +1 -0
- package/src/libs/Flag/flags/bh.js +1 -0
- package/src/libs/Flag/flags/bi.js +1 -0
- package/src/libs/Flag/flags/bj.js +1 -0
- package/src/libs/Flag/flags/bl.js +1 -0
- package/src/libs/Flag/flags/blank.js +1 -0
- package/src/libs/Flag/flags/bm.js +1 -0
- package/src/libs/Flag/flags/bn.js +1 -0
- package/src/libs/Flag/flags/bo.js +1 -0
- package/src/libs/Flag/flags/bq.js +1 -0
- package/src/libs/Flag/flags/br.js +1 -0
- package/src/libs/Flag/flags/bs.js +1 -0
- package/src/libs/Flag/flags/bt.js +1 -0
- package/src/libs/Flag/flags/bv.js +1 -0
- package/src/libs/Flag/flags/bw.js +1 -0
- package/src/libs/Flag/flags/by.js +1 -0
- package/src/libs/Flag/flags/bz.js +1 -0
- package/src/libs/Flag/flags/ca.js +1 -0
- package/src/libs/Flag/flags/cc.js +1 -0
- package/src/libs/Flag/flags/cd.js +1 -0
- package/src/libs/Flag/flags/cf.js +1 -0
- package/src/libs/Flag/flags/cg.js +1 -0
- package/src/libs/Flag/flags/ch.js +1 -0
- package/src/libs/Flag/flags/ci.js +1 -0
- package/src/libs/Flag/flags/ck.js +1 -0
- package/src/libs/Flag/flags/cl.js +1 -0
- package/src/libs/Flag/flags/cm.js +1 -0
- package/src/libs/Flag/flags/cn.js +1 -0
- package/src/libs/Flag/flags/co.js +1 -0
- package/src/libs/Flag/flags/cr.js +1 -0
- package/src/libs/Flag/flags/cu.js +1 -0
- package/src/libs/Flag/flags/cv.js +1 -0
- package/src/libs/Flag/flags/cw.js +1 -0
- package/src/libs/Flag/flags/cx.js +1 -0
- package/src/libs/Flag/flags/cy.js +1 -0
- package/src/libs/Flag/flags/cz.js +1 -0
- package/src/libs/Flag/flags/de.js +1 -0
- package/src/libs/Flag/flags/dj.js +1 -0
- package/src/libs/Flag/flags/dk.js +1 -0
- package/src/libs/Flag/flags/dm.js +1 -0
- package/src/libs/Flag/flags/do.js +1 -0
- package/src/libs/Flag/flags/dz.js +1 -0
- package/src/libs/Flag/flags/ec.js +1 -0
- package/src/libs/Flag/flags/ee.js +1 -0
- package/src/libs/Flag/flags/eg.js +1 -0
- package/src/libs/Flag/flags/eh.js +1 -0
- package/src/libs/Flag/flags/er.js +1 -0
- package/src/libs/Flag/flags/es.js +1 -0
- package/src/libs/Flag/flags/et.js +1 -0
- package/src/libs/Flag/flags/eu.js +1 -0
- package/src/libs/Flag/flags/fi.js +1 -0
- package/src/libs/Flag/flags/fj.js +1 -0
- package/src/libs/Flag/flags/fk.js +1 -0
- package/src/libs/Flag/flags/fm.js +1 -0
- package/src/libs/Flag/flags/fo.js +1 -0
- package/src/libs/Flag/flags/fr.js +1 -0
- package/src/libs/Flag/flags/ga.js +1 -0
- package/src/libs/Flag/flags/gb-eng.js +1 -0
- package/src/libs/Flag/flags/gb-nir.js +1 -0
- package/src/libs/Flag/flags/gb-sct.js +1 -0
- package/src/libs/Flag/flags/gb-wls.js +1 -0
- package/src/libs/Flag/flags/gb.js +1 -0
- package/src/libs/Flag/flags/gd.js +1 -0
- package/src/libs/Flag/flags/ge.js +1 -0
- package/src/libs/Flag/flags/gf.js +1 -0
- package/src/libs/Flag/flags/gg.js +1 -0
- package/src/libs/Flag/flags/gh.js +1 -0
- package/src/libs/Flag/flags/gi.js +1 -0
- package/src/libs/Flag/flags/gl.js +1 -0
- package/src/libs/Flag/flags/global.js +1 -0
- package/src/libs/Flag/flags/gm.js +1 -0
- package/src/libs/Flag/flags/gn.js +1 -0
- package/src/libs/Flag/flags/gp.js +1 -0
- package/src/libs/Flag/flags/gq.js +1 -0
- package/src/libs/Flag/flags/gr.js +1 -0
- package/src/libs/Flag/flags/gs.js +1 -0
- package/src/libs/Flag/flags/gt.js +1 -0
- package/src/libs/Flag/flags/gu.js +1 -0
- package/src/libs/Flag/flags/gw.js +1 -0
- package/src/libs/Flag/flags/gy.js +1 -0
- package/src/libs/Flag/flags/hk.js +1 -0
- package/src/libs/Flag/flags/hm.js +1 -0
- package/src/libs/Flag/flags/hn.js +1 -0
- package/src/libs/Flag/flags/hr.js +1 -0
- package/src/libs/Flag/flags/ht.js +1 -0
- package/src/libs/Flag/flags/hu.js +1 -0
- package/src/libs/Flag/flags/id.js +1 -0
- package/src/libs/Flag/flags/ie.js +1 -0
- package/src/libs/Flag/flags/il.js +1 -0
- package/src/libs/Flag/flags/im.js +1 -0
- package/src/libs/Flag/flags/in.js +1 -0
- package/src/libs/Flag/flags/io.js +1 -0
- package/src/libs/Flag/flags/iq.js +1 -0
- package/src/libs/Flag/flags/ir.js +1 -0
- package/src/libs/Flag/flags/is.js +1 -0
- package/src/libs/Flag/flags/it.js +1 -0
- package/src/libs/Flag/flags/je.js +1 -0
- package/src/libs/Flag/flags/jm.js +1 -0
- package/src/libs/Flag/flags/jo.js +1 -0
- package/src/libs/Flag/flags/jp.js +1 -0
- package/src/libs/Flag/flags/ke.js +1 -0
- package/src/libs/Flag/flags/kg.js +1 -0
- package/src/libs/Flag/flags/kh.js +1 -0
- package/src/libs/Flag/flags/ki.js +1 -0
- package/src/libs/Flag/flags/km.js +1 -0
- package/src/libs/Flag/flags/kn.js +1 -0
- package/src/libs/Flag/flags/kp.js +1 -0
- package/src/libs/Flag/flags/kr.js +1 -0
- package/src/libs/Flag/flags/kw.js +1 -0
- package/src/libs/Flag/flags/ky.js +1 -0
- package/src/libs/Flag/flags/kz.js +1 -0
- package/src/libs/Flag/flags/la.js +1 -0
- package/src/libs/Flag/flags/lb.js +1 -0
- package/src/libs/Flag/flags/lc.js +1 -0
- package/src/libs/Flag/flags/li.js +1 -0
- package/src/libs/Flag/flags/lk.js +1 -0
- package/src/libs/Flag/flags/lr.js +1 -0
- package/src/libs/Flag/flags/ls.js +1 -0
- package/src/libs/Flag/flags/lt.js +1 -0
- package/src/libs/Flag/flags/lu.js +1 -0
- package/src/libs/Flag/flags/lv.js +1 -0
- package/src/libs/Flag/flags/ly.js +1 -0
- package/src/libs/Flag/flags/ma.js +1 -0
- package/src/libs/Flag/flags/mc.js +1 -0
- package/src/libs/Flag/flags/md.js +1 -0
- package/src/libs/Flag/flags/me.js +1 -0
- package/src/libs/Flag/flags/mf.js +1 -0
- package/src/libs/Flag/flags/mg.js +1 -0
- package/src/libs/Flag/flags/mh.js +1 -0
- package/src/libs/Flag/flags/mk.js +1 -0
- package/src/libs/Flag/flags/ml.js +1 -0
- package/src/libs/Flag/flags/mm.js +1 -0
- package/src/libs/Flag/flags/mn.js +1 -0
- package/src/libs/Flag/flags/mo.js +1 -0
- package/src/libs/Flag/flags/mp.js +1 -0
- package/src/libs/Flag/flags/mq.js +1 -0
- package/src/libs/Flag/flags/mr.js +1 -0
- package/src/libs/Flag/flags/ms.js +1 -0
- package/src/libs/Flag/flags/mt.js +1 -0
- package/src/libs/Flag/flags/mu.js +1 -0
- package/src/libs/Flag/flags/mv.js +1 -0
- package/src/libs/Flag/flags/mw.js +1 -0
- package/src/libs/Flag/flags/mx.js +1 -0
- package/src/libs/Flag/flags/my.js +1 -0
- package/src/libs/Flag/flags/mz.js +1 -0
- package/src/libs/Flag/flags/na.js +1 -0
- package/src/libs/Flag/flags/nc.js +1 -0
- package/src/libs/Flag/flags/ne.js +1 -0
- package/src/libs/Flag/flags/nf.js +1 -0
- package/src/libs/Flag/flags/ng.js +1 -0
- package/src/libs/Flag/flags/ni.js +1 -0
- package/src/libs/Flag/flags/nl.js +1 -0
- package/src/libs/Flag/flags/no.js +1 -0
- package/src/libs/Flag/flags/np.js +1 -0
- package/src/libs/Flag/flags/nr.js +1 -0
- package/src/libs/Flag/flags/nu.js +1 -0
- package/src/libs/Flag/flags/nz.js +1 -0
- package/src/libs/Flag/flags/om.js +1 -0
- package/src/libs/Flag/flags/pa.js +1 -0
- package/src/libs/Flag/flags/pe.js +1 -0
- package/src/libs/Flag/flags/pf.js +1 -0
- package/src/libs/Flag/flags/pg.js +1 -0
- package/src/libs/Flag/flags/ph.js +1 -0
- package/src/libs/Flag/flags/pk.js +1 -0
- package/src/libs/Flag/flags/pl.js +1 -0
- package/src/libs/Flag/flags/pm.js +1 -0
- package/src/libs/Flag/flags/pn.js +1 -0
- package/src/libs/Flag/flags/po.js +1 -0
- package/src/libs/Flag/flags/pr.js +1 -0
- package/src/libs/Flag/flags/ps.js +1 -0
- package/src/libs/Flag/flags/pt.js +1 -0
- package/src/libs/Flag/flags/pw.js +1 -0
- package/src/libs/Flag/flags/py.js +1 -0
- package/src/libs/Flag/flags/qa.js +1 -0
- package/src/libs/Flag/flags/re.js +1 -0
- package/src/libs/Flag/flags/ro.js +1 -0
- package/src/libs/Flag/flags/rs.js +1 -0
- package/src/libs/Flag/flags/ru.js +1 -0
- package/src/libs/Flag/flags/rw.js +1 -0
- package/src/libs/Flag/flags/sa.js +1 -0
- package/src/libs/Flag/flags/sb.js +1 -0
- package/src/libs/Flag/flags/sc.js +1 -0
- package/src/libs/Flag/flags/sd.js +1 -0
- package/src/libs/Flag/flags/se.js +1 -0
- package/src/libs/Flag/flags/sg.js +1 -0
- package/src/libs/Flag/flags/sh.js +1 -0
- package/src/libs/Flag/flags/si.js +1 -0
- package/src/libs/Flag/flags/sj.js +1 -0
- package/src/libs/Flag/flags/sk.js +1 -0
- package/src/libs/Flag/flags/sl.js +1 -0
- package/src/libs/Flag/flags/sm.js +1 -0
- package/src/libs/Flag/flags/sn.js +1 -0
- package/src/libs/Flag/flags/so.js +1 -0
- package/src/libs/Flag/flags/sr.js +1 -0
- package/src/libs/Flag/flags/ss.js +1 -0
- package/src/libs/Flag/flags/st.js +1 -0
- package/src/libs/Flag/flags/sv.js +1 -0
- package/src/libs/Flag/flags/sx.js +1 -0
- package/src/libs/Flag/flags/sy.js +1 -0
- package/src/libs/Flag/flags/sz.js +1 -0
- package/src/libs/Flag/flags/tc.js +1 -0
- package/src/libs/Flag/flags/td.js +1 -0
- package/src/libs/Flag/flags/tf.js +1 -0
- package/src/libs/Flag/flags/tg.js +1 -0
- package/src/libs/Flag/flags/th.js +1 -0
- package/src/libs/Flag/flags/tj.js +1 -0
- package/src/libs/Flag/flags/tk.js +1 -0
- package/src/libs/Flag/flags/tl.js +1 -0
- package/src/libs/Flag/flags/tm.js +1 -0
- package/src/libs/Flag/flags/tn.js +1 -0
- package/src/libs/Flag/flags/to.js +1 -0
- package/src/libs/Flag/flags/tr.js +1 -0
- package/src/libs/Flag/flags/tt.js +1 -0
- package/src/libs/Flag/flags/tv.js +1 -0
- package/src/libs/Flag/flags/tw.js +1 -0
- package/src/libs/Flag/flags/tz.js +1 -0
- package/src/libs/Flag/flags/ua.js +1 -0
- package/src/libs/Flag/flags/ug.js +1 -0
- package/src/libs/Flag/flags/um.js +1 -0
- package/src/libs/Flag/flags/us.js +1 -0
- package/src/libs/Flag/flags/uy.js +1 -0
- package/src/libs/Flag/flags/uz.js +1 -0
- package/src/libs/Flag/flags/va.js +1 -0
- package/src/libs/Flag/flags/vc.js +1 -0
- package/src/libs/Flag/flags/ve.js +1 -0
- package/src/libs/Flag/flags/vg.js +1 -0
- package/src/libs/Flag/flags/vi.js +1 -0
- package/src/libs/Flag/flags/vn.js +1 -0
- package/src/libs/Flag/flags/vu.js +1 -0
- package/src/libs/Flag/flags/wf.js +1 -0
- package/src/libs/Flag/flags/ws.js +1 -0
- package/src/libs/Flag/flags/xk.js +1 -0
- package/src/libs/Flag/flags/ye.js +1 -0
- package/src/libs/Flag/flags/yt.js +1 -0
- package/src/libs/Flag/flags/za.js +1 -0
- package/src/libs/Flag/flags/zm.js +1 -0
- package/src/libs/Flag/flags/zw.js +1 -0
- package/src/libs/Flag/flags.js +37 -0
- package/src/libs/Flag/index.jsx +16 -0
- package/src/libs/Flex/_dS.jsx +610 -0
- package/src/libs/Flex/index.js +34 -0
- package/src/libs/Flex/tools/FlexTestPage.jsx +228 -0
- package/src/libs/Flex/tools/_Base.jsx +76 -0
- package/src/libs/Flex/tools/_styled.js +124 -0
- package/src/libs/Flex/tools/flexParentDetection.js +9 -0
- package/src/libs/Flex/tools/generateProps.js +826 -0
- package/src/libs/Flex/tools/getFlexDomRestProps.js +29 -0
- package/src/libs/Flex/tools/getNumber.js +4 -0
- package/src/libs/Flex/tools/mergeStyles.js +11 -0
- package/src/libs/Flex/tools/resolveFlexBorder.js +145 -0
- package/src/libs/Flex/tools/resolveFlexMotion.js +214 -0
- package/src/libs/Flex/tools/resolveFlexTypoWrap.js +20 -0
- package/src/libs/Flex/tools/splitUserStyle.js +57 -0
- package/src/libs/Flex/tools/sysDefaults.js +5 -0
- package/src/libs/Flex/tools/useVars.js +336 -0
- package/src/libs/FloatingUi/DefaultVariant.js +126 -0
- package/src/libs/FloatingUi/PlainVariant.js +111 -0
- package/src/libs/FloatingUi/_dS.jsx +307 -0
- package/src/libs/FloatingUi/_styled.js +8 -0
- package/src/libs/FloatingUi/index.js +12 -0
- package/src/libs/FloatingUi/tools/_Base.jsx +90 -0
- package/src/libs/FloatingUi/tools/floatingMountHost.js +106 -0
- package/src/libs/FloatingUi/tools/getPosition.js +307 -0
- package/src/libs/FloatingUi/tools/useVars.js +450 -0
- package/src/libs/GoogleMapViewer/_dS.jsx +69 -0
- package/src/libs/GoogleMapViewer/_styled.js +17 -0
- package/src/libs/GoogleMapViewer/index.jsx +26 -0
- package/src/libs/GoogleMapViewer/useVars.js +38 -0
- package/src/libs/Group/_dS.jsx +154 -0
- package/src/libs/Group/index.jsx +35 -0
- package/src/libs/HeaderCover/Amedist/_styled.js +185 -0
- package/src/libs/HeaderCover/Amedist/index.jsx +82 -0
- package/src/libs/HeaderCover/Amedist/useVars.js +81 -0
- package/src/libs/HeaderCover/index.js +11 -0
- package/src/libs/Icon/_dS.jsx +401 -0
- package/src/libs/Icon/_dSLibrary.jsx +145 -0
- package/src/libs/Icon/icons/abstract1.js +1 -0
- package/src/libs/Icon/icons/abstract10.js +1 -0
- package/src/libs/Icon/icons/abstract11.js +1 -0
- package/src/libs/Icon/icons/abstract12.js +1 -0
- package/src/libs/Icon/icons/abstract13.js +1 -0
- package/src/libs/Icon/icons/abstract14.js +1 -0
- package/src/libs/Icon/icons/abstract15.js +1 -0
- package/src/libs/Icon/icons/abstract16.js +1 -0
- package/src/libs/Icon/icons/abstract17.js +1 -0
- package/src/libs/Icon/icons/abstract18.js +1 -0
- package/src/libs/Icon/icons/abstract19.js +1 -0
- package/src/libs/Icon/icons/abstract2.js +1 -0
- package/src/libs/Icon/icons/abstract20.js +1 -0
- package/src/libs/Icon/icons/abstract21.js +1 -0
- package/src/libs/Icon/icons/abstract22.js +1 -0
- package/src/libs/Icon/icons/abstract23.js +1 -0
- package/src/libs/Icon/icons/abstract24.js +1 -0
- package/src/libs/Icon/icons/abstract25.js +1 -0
- package/src/libs/Icon/icons/abstract26.js +1 -0
- package/src/libs/Icon/icons/abstract27.js +1 -0
- package/src/libs/Icon/icons/abstract28.js +1 -0
- package/src/libs/Icon/icons/abstract29.js +1 -0
- package/src/libs/Icon/icons/abstract3.js +1 -0
- package/src/libs/Icon/icons/abstract30.js +1 -0
- package/src/libs/Icon/icons/abstract31.js +1 -0
- package/src/libs/Icon/icons/abstract32.js +1 -0
- package/src/libs/Icon/icons/abstract33.js +1 -0
- package/src/libs/Icon/icons/abstract34.js +1 -0
- package/src/libs/Icon/icons/abstract35.js +1 -0
- package/src/libs/Icon/icons/abstract36.js +1 -0
- package/src/libs/Icon/icons/abstract37.js +1 -0
- package/src/libs/Icon/icons/abstract38.js +1 -0
- package/src/libs/Icon/icons/abstract39.js +1 -0
- package/src/libs/Icon/icons/abstract4.js +1 -0
- package/src/libs/Icon/icons/abstract40.js +1 -0
- package/src/libs/Icon/icons/abstract41.js +1 -0
- package/src/libs/Icon/icons/abstract42.js +1 -0
- package/src/libs/Icon/icons/abstract43.js +1 -0
- package/src/libs/Icon/icons/abstract44.js +1 -0
- package/src/libs/Icon/icons/abstract45.js +1 -0
- package/src/libs/Icon/icons/abstract46.js +1 -0
- package/src/libs/Icon/icons/abstract47.js +1 -0
- package/src/libs/Icon/icons/abstract48.js +1 -0
- package/src/libs/Icon/icons/abstract49.js +1 -0
- package/src/libs/Icon/icons/abstract5.js +1 -0
- package/src/libs/Icon/icons/abstract50.js +1 -0
- package/src/libs/Icon/icons/abstract51.js +1 -0
- package/src/libs/Icon/icons/abstract52.js +1 -0
- package/src/libs/Icon/icons/abstract53.js +1 -0
- package/src/libs/Icon/icons/abstract54.js +1 -0
- package/src/libs/Icon/icons/abstract55.js +1 -0
- package/src/libs/Icon/icons/abstract56.js +1 -0
- package/src/libs/Icon/icons/abstract57.js +1 -0
- package/src/libs/Icon/icons/abstract58.js +1 -0
- package/src/libs/Icon/icons/abstract59.js +1 -0
- package/src/libs/Icon/icons/abstract6.js +1 -0
- package/src/libs/Icon/icons/abstract60.js +1 -0
- package/src/libs/Icon/icons/abstract61.js +1 -0
- package/src/libs/Icon/icons/abstract62.js +1 -0
- package/src/libs/Icon/icons/abstract63.js +1 -0
- package/src/libs/Icon/icons/abstract64.js +1 -0
- package/src/libs/Icon/icons/abstract65.js +1 -0
- package/src/libs/Icon/icons/abstract66.js +1 -0
- package/src/libs/Icon/icons/abstract67.js +1 -0
- package/src/libs/Icon/icons/abstract68.js +1 -0
- package/src/libs/Icon/icons/abstract69.js +1 -0
- package/src/libs/Icon/icons/abstract7.js +1 -0
- package/src/libs/Icon/icons/abstract70.js +1 -0
- package/src/libs/Icon/icons/abstract71.js +1 -0
- package/src/libs/Icon/icons/abstract72.js +1 -0
- package/src/libs/Icon/icons/abstract73.js +1 -0
- package/src/libs/Icon/icons/abstract74.js +1 -0
- package/src/libs/Icon/icons/abstract75.js +1 -0
- package/src/libs/Icon/icons/abstract8.js +1 -0
- package/src/libs/Icon/icons/abstract9.js +1 -0
- package/src/libs/Icon/icons/adNetworkIcon.js +1 -0
- package/src/libs/Icon/icons/add.js +1 -0
- package/src/libs/Icon/icons/addToBookmarks.js +1 -0
- package/src/libs/Icon/icons/addToFavs.js +1 -0
- package/src/libs/Icon/icons/all.js +1 -0
- package/src/libs/Icon/icons/ancient.js +1 -0
- package/src/libs/Icon/icons/android.js +1 -0
- package/src/libs/Icon/icons/apple.js +1 -0
- package/src/libs/Icon/icons/archieved.js +1 -0
- package/src/libs/Icon/icons/arrowDown.js +1 -0
- package/src/libs/Icon/icons/arrowLeft.js +1 -0
- package/src/libs/Icon/icons/arrowRight.js +1 -0
- package/src/libs/Icon/icons/arrowUp.js +1 -0
- package/src/libs/Icon/icons/asteriks.js +1 -0
- package/src/libs/Icon/icons/asteriks2.js +1 -0
- package/src/libs/Icon/icons/back.js +1 -0
- package/src/libs/Icon/icons/backFlip.js +1 -0
- package/src/libs/Icon/icons/backSpace.js +1 -0
- package/src/libs/Icon/icons/baseLogo.js +1 -0
- package/src/libs/Icon/icons/book.js +1 -0
- package/src/libs/Icon/icons/bookmarks.js +1 -0
- package/src/libs/Icon/icons/box.js +1 -0
- package/src/libs/Icon/icons/bracketLeft.js +1 -0
- package/src/libs/Icon/icons/bracketRight.js +1 -0
- package/src/libs/Icon/icons/bridge.js +1 -0
- package/src/libs/Icon/icons/building.js +1 -0
- package/src/libs/Icon/icons/campaign.js +1 -0
- package/src/libs/Icon/icons/cancel.js +1 -0
- package/src/libs/Icon/icons/car.js +1 -0
- package/src/libs/Icon/icons/castle.js +1 -0
- package/src/libs/Icon/icons/chart.js +1 -0
- package/src/libs/Icon/icons/check.js +1 -0
- package/src/libs/Icon/icons/chrome.js +1 -0
- package/src/libs/Icon/icons/close.js +1 -0
- package/src/libs/Icon/icons/closeThin.js +1 -0
- package/src/libs/Icon/icons/code.js +1 -0
- package/src/libs/Icon/icons/collapse.js +1 -0
- package/src/libs/Icon/icons/columns.js +1 -0
- package/src/libs/Icon/icons/compass.js +1 -0
- package/src/libs/Icon/icons/copy.js +1 -0
- package/src/libs/Icon/icons/description.js +1 -0
- package/src/libs/Icon/icons/desktopAll.js +1 -0
- package/src/libs/Icon/icons/desktopAll1.js +1 -0
- package/src/libs/Icon/icons/desktopApple.js +1 -0
- package/src/libs/Icon/icons/desktopLinux.js +1 -0
- package/src/libs/Icon/icons/desktopWin.js +1 -0
- package/src/libs/Icon/icons/dot.js +1 -0
- package/src/libs/Icon/icons/dotSmall.js +1 -0
- package/src/libs/Icon/icons/doubleArrow.js +1 -0
- package/src/libs/Icon/icons/dove.js +1 -0
- package/src/libs/Icon/icons/download.js +1 -0
- package/src/libs/Icon/icons/download2.js +1 -0
- package/src/libs/Icon/icons/drag.js +1 -0
- package/src/libs/Icon/icons/duplicate.js +1 -0
- package/src/libs/Icon/icons/edge.js +1 -0
- package/src/libs/Icon/icons/edit.js +1 -0
- package/src/libs/Icon/icons/expand.js +1 -0
- package/src/libs/Icon/icons/eyeClose.js +1 -0
- package/src/libs/Icon/icons/eyeOpen.js +1 -0
- package/src/libs/Icon/icons/facebook.js +1 -0
- package/src/libs/Icon/icons/filter.js +1 -0
- package/src/libs/Icon/icons/filterClear.js +1 -0
- package/src/libs/Icon/icons/finance.js +1 -0
- package/src/libs/Icon/icons/firefox.js +1 -0
- package/src/libs/Icon/icons/focus.js +1 -0
- package/src/libs/Icon/icons/fullArrowDown.js +1 -0
- package/src/libs/Icon/icons/fullArrowLeft.js +1 -0
- package/src/libs/Icon/icons/fullArrowRight.js +1 -0
- package/src/libs/Icon/icons/fullArrowUp.js +1 -0
- package/src/libs/Icon/icons/globe.js +1 -0
- package/src/libs/Icon/icons/home.js +1 -0
- package/src/libs/Icon/icons/iOs.js +1 -0
- package/src/libs/Icon/icons/information.js +1 -0
- package/src/libs/Icon/icons/information_square.js +1 -0
- package/src/libs/Icon/icons/instagram.js +1 -0
- package/src/libs/Icon/icons/internetExplorer.js +1 -0
- package/src/libs/Icon/icons/islam.js +1 -0
- package/src/libs/Icon/icons/key.js +1 -0
- package/src/libs/Icon/icons/labelCustom.js +1 -0
- package/src/libs/Icon/icons/labelCustom2.js +1 -0
- package/src/libs/Icon/icons/laptop.js +1 -0
- package/src/libs/Icon/icons/link.js +1 -0
- package/src/libs/Icon/icons/linkedIn.js +1 -0
- package/src/libs/Icon/icons/linux.js +1 -0
- package/src/libs/Icon/icons/loading.js +1 -0
- package/src/libs/Icon/icons/loading2.js +1 -0
- package/src/libs/Icon/icons/loading3.js +1 -0
- package/src/libs/Icon/icons/loading4.js +1 -0
- package/src/libs/Icon/icons/loading5.js +1 -0
- package/src/libs/Icon/icons/loading6.js +1 -0
- package/src/libs/Icon/icons/loading7.js +1 -0
- package/src/libs/Icon/icons/location.js +1 -0
- package/src/libs/Icon/icons/lockClose.js +1 -0
- package/src/libs/Icon/icons/lockOpen.js +1 -0
- package/src/libs/Icon/icons/logoHead.js +1 -0
- package/src/libs/Icon/icons/macOs.js +1 -0
- package/src/libs/Icon/icons/mail.js +1 -0
- package/src/libs/Icon/icons/mail2.js +1 -0
- package/src/libs/Icon/icons/menu.js +1 -0
- package/src/libs/Icon/icons/menu2.js +1 -0
- package/src/libs/Icon/icons/menuStylish.js +1 -0
- package/src/libs/Icon/icons/menuStylishFull.js +1 -0
- package/src/libs/Icon/icons/mobile.js +1 -0
- package/src/libs/Icon/icons/mobileAll.js +1 -0
- package/src/libs/Icon/icons/mobileAll2.js +1 -0
- package/src/libs/Icon/icons/mobileAndroid.js +1 -0
- package/src/libs/Icon/icons/mobileApple.js +1 -0
- package/src/libs/Icon/icons/mobileWin.js +1 -0
- package/src/libs/Icon/icons/museum.js +1 -0
- package/src/libs/Icon/icons/notification.js +1 -0
- package/src/libs/Icon/icons/offer.js +1 -0
- package/src/libs/Icon/icons/opera.js +1 -0
- package/src/libs/Icon/icons/path.js +1 -0
- package/src/libs/Icon/icons/pause.js +1 -0
- package/src/libs/Icon/icons/phone.js +1 -0
- package/src/libs/Icon/icons/phone2.js +1 -0
- package/src/libs/Icon/icons/pin.js +1 -0
- package/src/libs/Icon/icons/pixels.js +1 -0
- package/src/libs/Icon/icons/plane.js +1 -0
- package/src/libs/Icon/icons/play.js +1 -0
- package/src/libs/Icon/icons/plus.js +1 -0
- package/src/libs/Icon/icons/preview.js +1 -0
- package/src/libs/Icon/icons/question.js +1 -0
- package/src/libs/Icon/icons/quote1.js +1 -0
- package/src/libs/Icon/icons/quote2.js +1 -0
- package/src/libs/Icon/icons/refresh.js +1 -0
- package/src/libs/Icon/icons/rejected.js +1 -0
- package/src/libs/Icon/icons/report.js +1 -0
- package/src/libs/Icon/icons/reset.js +1 -0
- package/src/libs/Icon/icons/restaurant.js +1 -0
- package/src/libs/Icon/icons/route.js +1 -0
- package/src/libs/Icon/icons/safari.js +1 -0
- package/src/libs/Icon/icons/samsungExplorer.js +1 -0
- package/src/libs/Icon/icons/sandclock.js +1 -0
- package/src/libs/Icon/icons/screenMobile.js +1 -0
- package/src/libs/Icon/icons/screenRegular.js +1 -0
- package/src/libs/Icon/icons/screenWide.js +1 -0
- package/src/libs/Icon/icons/search.js +1 -0
- package/src/libs/Icon/icons/selectAll.js +1 -0
- package/src/libs/Icon/icons/selectNone.js +1 -0
- package/src/libs/Icon/icons/settings.js +1 -0
- package/src/libs/Icon/icons/share.js +1 -0
- package/src/libs/Icon/icons/shop.js +1 -0
- package/src/libs/Icon/icons/star.js +1 -0
- package/src/libs/Icon/icons/starEmpty.js +1 -0
- package/src/libs/Icon/icons/starHalf.js +1 -0
- package/src/libs/Icon/icons/stop.js +1 -0
- package/src/libs/Icon/icons/style.js +1 -0
- package/src/libs/Icon/icons/switch.js +1 -0
- package/src/libs/Icon/icons/tablet.js +1 -0
- package/src/libs/Icon/icons/tag.js +1 -0
- package/src/libs/Icon/icons/targeting.js +1 -0
- package/src/libs/Icon/icons/threeDots.js +1 -0
- package/src/libs/Icon/icons/threeDotsLarge.js +1 -0
- package/src/libs/Icon/icons/threeDotsLargeHorizontal.js +1 -0
- package/src/libs/Icon/icons/trash.js +1 -0
- package/src/libs/Icon/icons/trees.js +1 -0
- package/src/libs/Icon/icons/ubuntu.js +1 -0
- package/src/libs/Icon/icons/ucExplorer.js +1 -0
- package/src/libs/Icon/icons/upload.js +1 -0
- package/src/libs/Icon/icons/user.js +1 -0
- package/src/libs/Icon/icons/userAdvanced.js +1 -0
- package/src/libs/Icon/icons/volumeOff.js +1 -0
- package/src/libs/Icon/icons/volumeOn.js +1 -0
- package/src/libs/Icon/icons/walk.js +1 -0
- package/src/libs/Icon/icons/warning.js +1 -0
- package/src/libs/Icon/icons/warning2.js +1 -0
- package/src/libs/Icon/icons/website.js +1 -0
- package/src/libs/Icon/icons/widget.js +1 -0
- package/src/libs/Icon/icons/win.js +1 -0
- package/src/libs/Icon/icons/windows.js +1 -0
- package/src/libs/Icon/icons.js +37 -0
- package/src/libs/Icon/index.jsx +285 -0
- package/src/libs/Icon/tools/IconLayer.jsx +221 -0
- package/src/libs/Icon/tools/PopTipWrapper.jsx +6 -0
- package/src/libs/Icon/tools/iconMeta.js +65 -0
- package/src/libs/Icon/tools/pathBounds.js +166 -0
- package/src/libs/Icon/tools/styled.js +115 -0
- package/src/libs/Icon/tools/validators.js +20 -0
- package/src/libs/Icon/tools/visualScale.js +31 -0
- package/src/libs/IdleManager/_dS.jsx +74 -0
- package/src/libs/IdleManager/index.js +164 -0
- package/src/libs/Image/_dS.jsx +271 -0
- package/src/libs/Image/_styled.js +29 -0
- package/src/libs/Image/animations/index.js +16 -0
- package/src/libs/Image/animations/pulse.js +9 -0
- package/src/libs/Image/assets/sample-landscape.svg +5 -0
- package/src/libs/Image/index.jsx +91 -0
- package/src/libs/Image/useVars.js +393 -0
- package/src/libs/Image/useVars.test.jsx +93 -0
- package/src/libs/ImageGalery/Amedist/_styled.js +193 -0
- package/src/libs/ImageGalery/Amedist/index.jsx +285 -0
- package/src/libs/ImageGalery/_Base.jsx +139 -0
- package/src/libs/ImageGalery/_Base.test.jsx +66 -0
- package/src/libs/ImageGalery/_dS.jsx +71 -0
- package/src/libs/ImageGalery/index.jsx +23 -0
- package/src/libs/Layout/ControllerError.jsx +28 -0
- package/src/libs/Layout/_dS_footerAmedist.jsx +62 -0
- package/src/libs/Layout/_dS_headerAmedist.jsx +139 -0
- package/src/libs/Layout/_dS_mainAmedist.jsx +87 -0
- package/src/libs/Layout/_dS_useLayout.jsx +55 -0
- package/src/libs/Layout/controllerRegistry.js +121 -0
- package/src/libs/Layout/controllerRegistry.test.jsx +99 -0
- package/src/libs/Layout/controllers.js +169 -0
- package/src/libs/Layout/footerAmedist/_styled.js +75 -0
- package/src/libs/Layout/footerAmedist/index.jsx +22 -0
- package/src/libs/Layout/headerAmedist/_styled.js +151 -0
- package/src/libs/Layout/headerAmedist/index.jsx +240 -0
- package/src/libs/Layout/index.js +51 -0
- package/src/libs/Layout/mainAmedist/_styled.js +87 -0
- package/src/libs/Layout/mainAmedist/index.jsx +45 -0
- package/src/libs/LottiePlayer/_ds.jsx +308 -0
- package/src/libs/LottiePlayer/_eski/StickyLottiePlayer.js +91 -0
- package/src/libs/LottiePlayer/_eski/_styled.js +23 -0
- package/src/libs/LottiePlayer/_eski/index.js +224 -0
- package/src/libs/LottiePlayer/_styled.js +87 -0
- package/src/libs/LottiePlayer/index.jsx +455 -0
- package/src/libs/LottiePlayer/test.json +344 -0
- package/src/libs/ParalaxItem/_dS.jsx +253 -0
- package/src/libs/ParalaxItem/_styled.js +79 -0
- package/src/libs/ParalaxItem/index.jsx +64 -0
- package/src/libs/ParalaxItem/useCoverImageVars.js +98 -0
- package/src/libs/ParalaxItem/useVars.js +208 -0
- package/src/libs/PopConfirm/_dS.jsx +148 -0
- package/src/libs/PopConfirm/index.js +8 -0
- package/src/libs/PopConfirm/tools/_Base.jsx +21 -0
- package/src/libs/PopConfirm/tools/buttonActionProps.js +206 -0
- package/src/libs/PopConfirm/tools/defaultPopConfirmProps.js +33 -0
- package/src/libs/PopConfirm/tools/useVars.js +157 -0
- package/src/libs/PopOver/_dS.jsx +227 -0
- package/src/libs/PopOver/index.js +14 -0
- package/src/libs/PopOver/tools/_Base.jsx +68 -0
- package/src/libs/PopOver/tools/resolveFloatingUiProps.js +25 -0
- package/src/libs/PopOver/tools/useVars.js +65 -0
- package/src/libs/PopTip/_dS.jsx +263 -0
- package/src/libs/PopTip/index.js +14 -0
- package/src/libs/PopTip/tools/_Base.jsx +24 -0
- package/src/libs/PopTip/tools/useVars.js +37 -0
- package/src/libs/PopUp/_dS.jsx +230 -0
- package/src/libs/PopUp/index.js +8 -0
- package/src/libs/PopUp/tools/_Base.jsx +49 -0
- package/src/libs/PopUp/tools/_styled.js +74 -0
- package/src/libs/PopUp/tools/defaultPopUpProps.js +30 -0
- package/src/libs/PopUp/tools/mergeActionButtonProps.js +13 -0
- package/src/libs/PopUp/tools/popUpBodyWrapper.jsx +66 -0
- package/src/libs/PopUp/tools/useVars.js +173 -0
- package/src/libs/ScrollAnimatedItem/Amedist/_styled.js +33 -0
- package/src/libs/ScrollAnimatedItem/Amedist/index.jsx +65 -0
- package/src/libs/ScrollAnimatedItem/_dS.jsx +81 -0
- package/src/libs/ScrollAnimatedItem/index.js +13 -0
- package/src/libs/ScrollBar/Body.js +32 -0
- package/src/libs/ScrollBar/DefaultVariant.js +43 -0
- package/src/libs/ScrollBar/_dS.jsx +502 -0
- package/src/libs/ScrollBar/index.js +25 -0
- package/src/libs/ScrollBar/tools/_Base.jsx +317 -0
- package/src/libs/ScrollBar/tools/_styled.js +9 -0
- package/src/libs/ScrollBar/tools/getScrollHost.js +7 -0
- package/src/libs/ScrollBar/tools/getScrollMetrics.js +83 -0
- package/src/libs/ScrollBar/tools/getThumbProps.js +133 -0
- package/src/libs/ScrollBar/tools/manageBrowsersScrollBar.js +70 -0
- package/src/libs/ScrollBar/tools/scrollBarAxis.js +17 -0
- package/src/libs/ScrollBar/tools/useVars.js +871 -0
- package/src/libs/ScrollBar/tools/useVars.test.jsx +66 -0
- package/src/libs/ScrollFlex/DefaultVariant.js +17 -0
- package/src/libs/ScrollFlex/HoverShadow.js +14 -0
- package/src/libs/ScrollFlex/Plain.js +7 -0
- package/src/libs/ScrollFlex/Shadow.js +16 -0
- package/src/libs/ScrollFlex/_dS.jsx +478 -0
- package/src/libs/ScrollFlex/index.js +20 -0
- package/src/libs/ScrollFlex/tools/01.jpg +0 -0
- package/src/libs/ScrollFlex/tools/_Base.jsx +68 -0
- package/src/libs/ScrollFlex/tools/_styled.js +27 -0
- package/src/libs/ScrollFlex/tools/buildVariantOuterStyle.js +125 -0
- package/src/libs/ScrollFlex/tools/computeDragScrollDelta.js +5 -0
- package/src/libs/ScrollFlex/tools/constants.js +32 -0
- package/src/libs/ScrollFlex/tools/containerDimensions.js +34 -0
- package/src/libs/ScrollFlex/tools/containerExtraInset.js +9 -0
- package/src/libs/ScrollFlex/tools/contentFlexProps.js +67 -0
- package/src/libs/ScrollFlex/tools/contentMeasure.js +96 -0
- package/src/libs/ScrollFlex/tools/cssSizeUtils.js +59 -0
- package/src/libs/ScrollFlex/tools/domInsets.js +25 -0
- package/src/libs/ScrollFlex/tools/organizedFlexProps.js +92 -0
- package/src/libs/ScrollFlex/tools/parentMeasure.js +82 -0
- package/src/libs/ScrollFlex/tools/refUtils.js +23 -0
- package/src/libs/ScrollFlex/tools/scrollBarLayout.js +114 -0
- package/src/libs/ScrollFlex/tools/shellPadding.js +147 -0
- package/src/libs/ScrollFlex/tools/shellTextSelection.js +13 -0
- package/src/libs/ScrollFlex/tools/useScrollFlexMeasureEffects.js +308 -0
- package/src/libs/ScrollFlex/tools/useShellDrag.js +159 -0
- package/src/libs/ScrollFlex/tools/useShellDrag.test.jsx +40 -0
- package/src/libs/ScrollFlex/tools/useVars.js +424 -0
- package/src/libs/Slider/Amedist/_styled.js +532 -0
- package/src/libs/Slider/Amedist/index.jsx +245 -0
- package/src/libs/Slider/Amedist/useTrackpadNavigation.js +78 -0
- package/src/libs/Slider/Amedist/useTrackpadNavigation.test.jsx +112 -0
- package/src/libs/Slider/Amedist/useVars.jsx +674 -0
- package/src/libs/Slider/_dS.jsx +270 -0
- package/src/libs/Slider/index.js +13 -0
- package/src/libs/Space/_dS.jsx +54 -0
- package/src/libs/Space/_styled.js +10 -0
- package/src/libs/Space/index.jsx +23 -0
- package/src/libs/StoryTeller/Amedist/_styled.js +100 -0
- package/src/libs/StoryTeller/Amedist/index.jsx +112 -0
- package/src/libs/StoryTeller/Amedist/useVars.js +210 -0
- package/src/libs/StoryTeller/Amedist/useVars.test.js +18 -0
- package/src/libs/StoryTeller/AmedistHorizontalLeft/index.jsx +147 -0
- package/src/libs/StoryTeller/AmedistHorizontalRight/index.jsx +147 -0
- package/src/libs/StoryTeller/AmedistVertical/index.jsx +205 -0
- package/src/libs/StoryTeller/AmedistVertical/index.test.js +39 -0
- package/src/libs/StoryTeller/index.js +16 -0
- package/src/libs/StoryTeller/slideDesigns.js +9 -0
- package/src/libs/StoryTeller/textItems.jsx +51 -0
- package/src/libs/StoryTeller/textItems.test.jsx +60 -0
- package/src/libs/Table/_dS.jsx +7 -0
- package/src/libs/Table/index.js +1 -0
- package/src/libs/TemplateLiteral/_dS.jsx +73 -0
- package/src/libs/TemplateLiteral/index.jsx +37 -0
- package/src/libs/TextArea/index.jsx +66 -0
- package/src/libs/Typo/_dS.jsx +406 -0
- package/src/libs/Typo/index.js +38 -0
- package/src/libs/Typo/tools/_Base.jsx +153 -0
- package/src/libs/Typo/tools/_styled.js +373 -0
- package/src/libs/Typo/tools/getTruncatedHtml.js +277 -0
- package/src/libs/Typo/tools/isTypoPhrasingOnlyHostTag.js +5 -0
- package/src/libs/Typo/tools/useVars.js +291 -0
- package/src/libs/TypoAnimated/_dS.jsx +243 -0
- package/src/libs/TypoAnimated/animations/animatedWriter.jsx +94 -0
- package/src/libs/TypoAnimated/animations/scatterLines.jsx +126 -0
- package/src/libs/TypoAnimated/animations/scrambleReveal.js +10 -0
- package/src/libs/TypoAnimated/animations/stackedWords.jsx +219 -0
- package/src/libs/TypoAnimated/animations/typewriter.js +10 -0
- package/src/libs/TypoAnimated/index.jsx +14 -0
- package/src/libs/TypoAnimated/tools/AnimationSlot.jsx +32 -0
- package/src/libs/TypoAnimated/tools/Base.jsx +71 -0
- package/src/libs/TypoAnimated/tools/animationRegistry.js +20 -0
- package/src/libs/TypoAnimated/tools/animationUtils.js +112 -0
- package/src/libs/TypoAnimated/tools/autoDuration.js +49 -0
- package/src/libs/TypoAnimated/tools/useAnimations.js +136 -0
- package/src/libs/Visibility/_dS.jsx +122 -0
- package/src/libs/Visibility/index.jsx +27 -0
- package/src/libs/Visibility/useVars.js +12 -0
- package/src/libs/baseDate/_dS.jsx +595 -0
- package/src/libs/baseDate/createBaseDatePackage.js +460 -0
- package/src/libs/baseDate/index.js +202 -0
- package/src/libs/baseDate/tools.js +384 -0
- package/src/libs/baseFetch/_dS.jsx +121 -0
- package/src/libs/baseFetch/_tools.js +232 -0
- package/src/libs/baseFetch/index.js +349 -0
- package/src/libs/baseForm/BaseForm.jsx +19 -0
- package/src/libs/baseForm/BaseFormItem.jsx +284 -0
- package/src/libs/baseForm/BaseFormTest.jsx +145 -0
- package/src/libs/baseForm/DefaultHelper/index.jsx +125 -0
- package/src/libs/baseForm/_dS.jsx +127 -0
- package/src/libs/baseForm/index.js +1 -0
- package/src/libs/baseForm/inputComponents/index.js +7 -0
- package/src/libs/baseForm/tools/clearForm.js +1 -0
- package/src/libs/baseForm/tools/getField.js +22 -0
- package/src/libs/baseForm/tools/getPath.js +16 -0
- package/src/libs/baseForm/tools/mountForm.js +64 -0
- package/src/libs/baseForm/tools/mountItem.js +180 -0
- package/src/libs/baseForm/tools/resetToDefaults.js +1 -0
- package/src/libs/baseForm/tools/resetToLastSubmit.js +1 -0
- package/src/libs/baseForm/tools/setField.js +39 -0
- package/src/libs/baseForm/tools/setFields.js +1 -0
- package/src/libs/baseForm/tools/submitForm.js +1 -0
- package/src/libs/baseForm/tools/unmountForm.js +3 -0
- package/src/libs/baseForm/tools/unmountItem.js +1 -0
- package/src/libs/baseForm/tools/useDefineStore.js +27 -0
- package/src/libs/baseForm/tools/useHelper.js +80 -0
- package/src/libs/baseForm/tools/validateField.js +74 -0
- package/src/libs/baseForm/tools/validateForm.js +20 -0
- package/src/libs/baseForm/useBaseForm.jsx +65 -0
- package/src/libs/baseStore/_dS_useAndCreate.jsx +466 -0
- package/src/libs/baseStore/_dS_useGlobal.jsx +104 -0
- package/src/libs/baseStore/_dS_useLocal.jsx +84 -0
- package/src/libs/baseStore/create/index.js +189 -0
- package/src/libs/baseStore/globalData/index.js +3 -0
- package/src/libs/baseStore/index.js +13 -0
- package/src/libs/baseStore/use/index.js +94 -0
- package/src/libs/baseStore/useGlobal/index.js +7 -0
- package/src/libs/baseStore/useLocal/index.js +11 -0
- package/src/libs/byPath/_dS.jsx +232 -0
- package/src/libs/byPath/index.js +154 -0
- package/src/libs/cleanFalsyValues/_dS.jsx +187 -0
- package/src/libs/cleanFalsyValues/index.js +86 -0
- package/src/libs/colorAlpha/_dS.jsx +123 -0
- package/src/libs/colorAlpha/index.js +25 -0
- package/src/libs/colorConverter/_dS.jsx +105 -0
- package/src/libs/colorConverter/index.js +497 -0
- package/src/libs/colorFind/_dS.jsx +115 -0
- package/src/libs/colorFind/index.js +70 -0
- package/src/libs/colorGet/_dS.jsx +101 -0
- package/src/libs/colorGet/index.js +149 -0
- package/src/libs/colorGet3DShadow/_dS.jsx +166 -0
- package/src/libs/colorGet3DShadow/index.js +45 -0
- package/src/libs/colorPickHigherContrast/_dS.jsx +136 -0
- package/src/libs/colorPickHigherContrast/index.js +18 -0
- package/src/libs/colorShader/_dS.jsx +110 -0
- package/src/libs/colorShader/index.js +40 -0
- package/src/libs/colorTinter/_dS.jsx +107 -0
- package/src/libs/colorTinter/index.js +42 -0
- package/src/libs/colorWcagMatch/_dS.jsx +327 -0
- package/src/libs/colorWcagMatch/index.js +76 -0
- package/src/libs/colorWcagValue/_dS.jsx +120 -0
- package/src/libs/colorWcagValue/index.js +18 -0
- package/src/libs/columnTypes/_dS.jsx +90 -0
- package/src/libs/columnTypes/index.jsx +107 -0
- package/src/libs/copyToClipboard/_dS.jsx +215 -0
- package/src/libs/copyToClipboard/index.js +147 -0
- package/src/libs/copyToClipboard/reactNodeToPlainText.js +80 -0
- package/src/libs/createImageCatalog/_dS.jsx +260 -0
- package/src/libs/createImageCatalog/index.js +100 -0
- package/src/libs/createImageCatalog/tools/base-image-catalog-setup.cjs +10 -0
- package/src/libs/createImageCatalog/tools/base-image-index.cjs +9 -0
- package/src/libs/createImageCatalog/vars.js +875 -0
- package/src/libs/cssNormalizeSize/_dS.jsx +49 -0
- package/src/libs/cssNormalizeSize/index.js +30 -0
- package/src/libs/cssSpacingResolver/_dS.jsx +57 -0
- package/src/libs/cssSpacingResolver/index.js +51 -0
- package/src/libs/debouncedFunction/_dS.jsx +308 -0
- package/src/libs/debouncedFunction/index.js +121 -0
- package/src/libs/deepMerge/_dS.jsx +88 -0
- package/src/libs/deepMerge/index.js +30 -0
- package/src/libs/delayedFunction/_dS.jsx +148 -0
- package/src/libs/delayedFunction/index.js +52 -0
- package/src/libs/downloadAsCsv/_dS.jsx +143 -0
- package/src/libs/downloadAsCsv/index.js +57 -0
- package/src/libs/findDifferences/_dS.jsx +78 -0
- package/src/libs/findDifferences/index.js +120 -0
- package/src/libs/generateRandom/_dS.jsx +199 -0
- package/src/libs/generateRandom/index.js +136 -0
- package/src/libs/getClientData/_dS.jsx +185 -0
- package/src/libs/getClientData/index.js +208 -0
- package/src/libs/getPageRrdInfo/_dS.jsx +78 -0
- package/src/libs/getPageRrdInfo/index.js +59 -0
- package/src/libs/getText/_dS.jsx +192 -0
- package/src/libs/getText/index.js +39 -0
- package/src/libs/getTimeDiff/_dS.jsx +345 -0
- package/src/libs/getTimeDiff/index.js +245 -0
- package/src/libs/isArray/_dS.jsx +68 -0
- package/src/libs/isArray/index.js +2 -0
- package/src/libs/isArrayOrPlainObject/_dS.jsx +75 -0
- package/src/libs/isArrayOrPlainObject/index.js +4 -0
- package/src/libs/isDeepEqual/_dS.jsx +343 -0
- package/src/libs/isDeepEqual/index.js +83 -0
- package/src/libs/isNumber/_dS.jsx +71 -0
- package/src/libs/isNumber/index.js +1 -0
- package/src/libs/isPlainObject/_dS.jsx +75 -0
- package/src/libs/isPlainObject/index.js +7 -0
- package/src/libs/isShallowEqual/_dS.jsx +82 -0
- package/src/libs/isShallowEqual/index.js +34 -0
- package/src/libs/logReferrers/index.js +7 -0
- package/src/libs/manageSearchParams/_dS.jsx +496 -0
- package/src/libs/manageSearchParams/index.js +426 -0
- package/src/libs/notifier/_Base.js +258 -0
- package/src/libs/notifier/_dS.jsx +219 -0
- package/src/libs/notifier/index.js +16 -0
- package/src/libs/pushAsSorted/_dS.jsx +169 -0
- package/src/libs/pushAsSorted/index.js +46 -0
- package/src/libs/queryConverter/_dS.jsx +339 -0
- package/src/libs/queryConverter/index.js +146 -0
- package/src/libs/queryConverter/mergeImportIntoStore.js +48 -0
- package/src/libs/queryConverter/prefixPath.js +30 -0
- package/src/libs/scrollLock/_dS.jsx +69 -0
- package/src/libs/scrollLock/index.js +33 -0
- package/src/libs/sleep/_dS.jsx +54 -0
- package/src/libs/sleep/index.js +2 -0
- package/src/libs/sortBy/_dS.jsx +96 -0
- package/src/libs/sortBy/index.js +38 -0
- package/src/libs/stringCaseConverter/_dS.jsx +120 -0
- package/src/libs/stringCaseConverter/index.js +97 -0
- package/src/libs/templateLiteralTo/_dS.jsx +82 -0
- package/src/libs/templateLiteralTo/dedent.js +46 -0
- package/src/libs/templateLiteralTo/index.js +49 -0
- package/src/libs/typeOf/_dS.jsx +70 -0
- package/src/libs/typeOf/index.js +20 -0
- package/src/libs/useBaseEffect/_dS.jsx +390 -0
- package/src/libs/useBaseEffect/index.js +87 -0
- package/src/libs/useBaseFetch/index.js +208 -0
- package/src/libs/useCatalogImage/_dS.jsx +100 -0
- package/src/libs/useCatalogImage/index.js +9 -0
- package/src/libs/useCheckOverflow/_dS.jsx +264 -0
- package/src/libs/useCheckOverflow/index.js +122 -0
- package/src/libs/useCountNumber/_dS.jsx +236 -0
- package/src/libs/useCountNumber/format.js +94 -0
- package/src/libs/useCountNumber/format.test.js +47 -0
- package/src/libs/useCountNumber/index.js +47 -0
- package/src/libs/useCountNumber/useVars.js +360 -0
- package/src/libs/useDebouncedFunction/_dS.jsx +168 -0
- package/src/libs/useDebouncedFunction/index.js +41 -0
- package/src/libs/useDebouncedFunction/useStableCallback.js +7 -0
- package/src/libs/useDebouncedValue/_dS.jsx +120 -0
- package/src/libs/useDebouncedValue/index.js +85 -0
- package/src/libs/useDeepEqual/_dS.jsx +116 -0
- package/src/libs/useDeepEqual/index.js +6 -0
- package/src/libs/useDelayedFunction/_dS.jsx +142 -0
- package/src/libs/useDelayedFunction/index.js +61 -0
- package/src/libs/useEffectAfterMount/_dS.jsx +78 -0
- package/src/libs/useEffectAfterMount/index.js +15 -0
- package/src/libs/useEventListener/_dS.jsx +114 -0
- package/src/libs/useEventListener/index.js +68 -0
- package/src/libs/useImagePreloader/_dS.jsx +50 -0
- package/src/libs/useImagePreloader/index.js +65 -0
- package/src/libs/useImagesReady/_dS.jsx +51 -0
- package/src/libs/useImagesReady/index.js +74 -0
- package/src/libs/useMouseXY/_dS.jsx +61 -0
- package/src/libs/useMouseXY/index.js +62 -0
- package/src/libs/useObserver/_dS.jsx +260 -0
- package/src/libs/useObserver/index.js +239 -0
- package/src/libs/useObserver/index.test.js +72 -0
- package/src/libs/usePrevious/_dS.jsx +99 -0
- package/src/libs/usePrevious/index.js +37 -0
- package/src/libs/useRevealNavItem/_dS.jsx +129 -0
- package/src/libs/useRevealNavItem/index.js +96 -0
- package/src/libs/useScrollThrottle/_dS.jsx +179 -0
- package/src/libs/useScrollThrottle/index.js +29 -0
- package/src/libs/useScrollTopLeft/_dS.jsx +175 -0
- package/src/libs/useScrollTopLeft/index.js +77 -0
- package/src/libs/useScrollWidthHeight/_dS.jsx +127 -0
- package/src/libs/useScrollWidthHeight/index.js +56 -0
- package/src/libs/useSearchParams/_dS.jsx +65 -0
- package/src/libs/useSearchParams/index.js +32 -0
- package/src/libs/useTimer/_dS.jsx +120 -0
- package/src/libs/useTimer/index.js +186 -0
- package/vite.aliases.mjs +43 -0
|
@@ -0,0 +1,875 @@
|
|
|
1
|
+
/* eslint-disable no-undef */
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
|
|
5
|
+
const IMAGE_SCRIPT_NAME = "images:index";
|
|
6
|
+
const IMAGE_SCRIPT_COMMAND =
|
|
7
|
+
"node node_modules/@bariskuran/base/src/libs/createImageCatalog/tools/base-image-index.cjs";
|
|
8
|
+
const SUPPORTED_EXTENSIONS = new Set([".webp", ".jpg", ".jpeg", ".png", ".gif"]);
|
|
9
|
+
const GENERATED_HEADER = "// Auto Generated by `yarn images:index`";
|
|
10
|
+
const ROOT_PROPS_TO_DROP = new Set(["imageSet", "images", "name", "originalName", "originalPath"]);
|
|
11
|
+
const KNOWN_VARIANT_ORDER = [
|
|
12
|
+
"placeholder",
|
|
13
|
+
"thumb",
|
|
14
|
+
"small",
|
|
15
|
+
"medium",
|
|
16
|
+
"large",
|
|
17
|
+
"ultra",
|
|
18
|
+
"original",
|
|
19
|
+
];
|
|
20
|
+
const IMAGE_CATALOG_DIR_NAME = "imageCatalog";
|
|
21
|
+
const ARATIO_DECIMALS = 1;
|
|
22
|
+
// Keep generated catalog modules comfortably below Vite's default chunk warning.
|
|
23
|
+
const IMAGE_CATALOG_CHUNK_SIZE_LIMIT = 220 * 1024;
|
|
24
|
+
|
|
25
|
+
function getARatio(naturalWidth, naturalHeight) {
|
|
26
|
+
if (!naturalWidth || !naturalHeight) return null;
|
|
27
|
+
const factor = 10 ** ARATIO_DECIMALS;
|
|
28
|
+
return Math.round((naturalWidth / naturalHeight) * factor) / factor;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getSrcImageCatalogDir(projectRoot) {
|
|
32
|
+
return path.join(projectRoot, "src", IMAGE_CATALOG_DIR_NAME);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function getPublicImageCatalogDir(projectRoot) {
|
|
36
|
+
return path.join(projectRoot, "public", IMAGE_CATALOG_DIR_NAME);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function ensureDir(dirPath) {
|
|
40
|
+
if (!fs.existsSync(dirPath)) fs.mkdirSync(dirPath, { recursive: true });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function readText(filePath) {
|
|
44
|
+
if (!fs.existsSync(filePath)) return "";
|
|
45
|
+
return fs.readFileSync(filePath, "utf8");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function writeTextIfChanged(filePath, content) {
|
|
49
|
+
const current = readText(filePath);
|
|
50
|
+
if (current === content) return false;
|
|
51
|
+
fs.writeFileSync(filePath, content);
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function getMimeType(ext) {
|
|
56
|
+
const cleanExt = ext.toLowerCase();
|
|
57
|
+
if (cleanExt === ".webp") return "image/webp";
|
|
58
|
+
if (cleanExt === ".jpg" || cleanExt === ".jpeg") return "image/jpeg";
|
|
59
|
+
if (cleanExt === ".png") return "image/png";
|
|
60
|
+
if (cleanExt === ".gif") return "image/gif";
|
|
61
|
+
return "application/octet-stream";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function getShape(naturalWidth, naturalHeight) {
|
|
65
|
+
if (!naturalWidth || !naturalHeight) return "unknown";
|
|
66
|
+
if (naturalWidth === naturalHeight) return "square";
|
|
67
|
+
return naturalWidth > naturalHeight ? "landscape" : "portrait";
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function normalizeShape(value) {
|
|
71
|
+
const cleanValue = String(value || "")
|
|
72
|
+
.replace(/^["'`]|["'`]$/g, "")
|
|
73
|
+
.trim()
|
|
74
|
+
.toLowerCase();
|
|
75
|
+
|
|
76
|
+
if (cleanValue === "horizontal" || cleanValue === "landscape") return "landscape";
|
|
77
|
+
if (cleanValue === "vertical" || cleanValue === "portrait") return "portrait";
|
|
78
|
+
if (cleanValue === "square") return "square";
|
|
79
|
+
return cleanValue || "unknown";
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function getPngSize(buffer) {
|
|
83
|
+
if (buffer.length < 24 || buffer.toString("ascii", 1, 4) !== "PNG") return null;
|
|
84
|
+
return {
|
|
85
|
+
naturalWidth: buffer.readUInt32BE(16),
|
|
86
|
+
naturalHeight: buffer.readUInt32BE(20),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function getGifSize(buffer) {
|
|
91
|
+
if (buffer.length < 10) return null;
|
|
92
|
+
const signature = buffer.toString("ascii", 0, 6);
|
|
93
|
+
if (signature !== "GIF87a" && signature !== "GIF89a") return null;
|
|
94
|
+
return {
|
|
95
|
+
naturalWidth: buffer.readUInt16LE(6),
|
|
96
|
+
naturalHeight: buffer.readUInt16LE(8),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function getJpegSize(buffer) {
|
|
101
|
+
if (buffer.length < 4 || buffer[0] !== 0xff || buffer[1] !== 0xd8) return null;
|
|
102
|
+
|
|
103
|
+
let offset = 2;
|
|
104
|
+
while (offset < buffer.length) {
|
|
105
|
+
if (buffer[offset] !== 0xff) {
|
|
106
|
+
offset += 1;
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const marker = buffer[offset + 1];
|
|
111
|
+
offset += 2;
|
|
112
|
+
|
|
113
|
+
if (marker === 0xd9 || marker === 0xda) break;
|
|
114
|
+
if (offset + 2 > buffer.length) break;
|
|
115
|
+
|
|
116
|
+
const blockLength = buffer.readUInt16BE(offset);
|
|
117
|
+
const isSizeMarker =
|
|
118
|
+
(marker >= 0xc0 && marker <= 0xc3) ||
|
|
119
|
+
(marker >= 0xc5 && marker <= 0xc7) ||
|
|
120
|
+
(marker >= 0xc9 && marker <= 0xcb) ||
|
|
121
|
+
(marker >= 0xcd && marker <= 0xcf);
|
|
122
|
+
|
|
123
|
+
if (isSizeMarker && offset + 7 < buffer.length) {
|
|
124
|
+
return {
|
|
125
|
+
naturalHeight: buffer.readUInt16BE(offset + 3),
|
|
126
|
+
naturalWidth: buffer.readUInt16BE(offset + 5),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
offset += blockLength;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function getWebpSize(buffer) {
|
|
137
|
+
if (buffer.length < 30) return null;
|
|
138
|
+
if (buffer.toString("ascii", 0, 4) !== "RIFF" || buffer.toString("ascii", 8, 12) !== "WEBP") {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const chunkType = buffer.toString("ascii", 12, 16);
|
|
143
|
+
if (chunkType === "VP8 ") {
|
|
144
|
+
return {
|
|
145
|
+
naturalWidth: buffer.readUInt16LE(26) & 0x3fff,
|
|
146
|
+
naturalHeight: buffer.readUInt16LE(28) & 0x3fff,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (chunkType === "VP8L") {
|
|
151
|
+
const bits =
|
|
152
|
+
buffer[21] |
|
|
153
|
+
(buffer[22] << 8) |
|
|
154
|
+
(buffer[23] << 16) |
|
|
155
|
+
(buffer[24] << 24);
|
|
156
|
+
return {
|
|
157
|
+
naturalWidth: (bits & 0x3fff) + 1,
|
|
158
|
+
naturalHeight: ((bits >> 14) & 0x3fff) + 1,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (chunkType === "VP8X") {
|
|
163
|
+
return {
|
|
164
|
+
naturalWidth: buffer.readUIntLE(24, 3) + 1,
|
|
165
|
+
naturalHeight: buffer.readUIntLE(27, 3) + 1,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function getImageSize(filePath) {
|
|
173
|
+
const buffer = fs.readFileSync(filePath);
|
|
174
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
175
|
+
const size =
|
|
176
|
+
ext === ".png"
|
|
177
|
+
? getPngSize(buffer)
|
|
178
|
+
: ext === ".gif"
|
|
179
|
+
? getGifSize(buffer)
|
|
180
|
+
: ext === ".jpg" || ext === ".jpeg"
|
|
181
|
+
? getJpegSize(buffer)
|
|
182
|
+
: ext === ".webp"
|
|
183
|
+
? getWebpSize(buffer)
|
|
184
|
+
: null;
|
|
185
|
+
|
|
186
|
+
return size || { naturalWidth: null, naturalHeight: null };
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function compareImageFileNames(a, b) {
|
|
190
|
+
const aKey = path.basename(a, path.extname(a)).toLowerCase();
|
|
191
|
+
const bKey = path.basename(b, path.extname(b)).toLowerCase();
|
|
192
|
+
const aIndex = KNOWN_VARIANT_ORDER.indexOf(aKey);
|
|
193
|
+
const bIndex = KNOWN_VARIANT_ORDER.indexOf(bKey);
|
|
194
|
+
|
|
195
|
+
if (aIndex !== -1 || bIndex !== -1) {
|
|
196
|
+
if (aIndex === -1) return 1;
|
|
197
|
+
if (bIndex === -1) return -1;
|
|
198
|
+
return aIndex - bIndex;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return a.localeCompare(b);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function toIdentifier(value, fallback = "imageFile") {
|
|
205
|
+
const normalized = String(value)
|
|
206
|
+
.normalize("NFKD")
|
|
207
|
+
.replace(/[\u0300-\u036f]/g, "")
|
|
208
|
+
.replace(/[^a-zA-Z0-9_$]/g, "_")
|
|
209
|
+
.replace(/^([^a-zA-Z_$])/, "_$1");
|
|
210
|
+
|
|
211
|
+
return normalized || fallback;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function createUniqueIdentifier(baseIdentifier, usedIdentifiers) {
|
|
215
|
+
let identifier = baseIdentifier;
|
|
216
|
+
let counter = 2;
|
|
217
|
+
|
|
218
|
+
while (usedIdentifiers.has(identifier)) {
|
|
219
|
+
identifier = `${baseIdentifier}_${counter}`;
|
|
220
|
+
counter += 1;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
usedIdentifiers.add(identifier);
|
|
224
|
+
return identifier;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function findObjectBody(source) {
|
|
228
|
+
const constMatch = source.match(/const\s+image\s*=\s*\{/);
|
|
229
|
+
const exportMatch = source.match(/export\s+default\s*\{/);
|
|
230
|
+
const match = constMatch || exportMatch;
|
|
231
|
+
if (!match) return "";
|
|
232
|
+
|
|
233
|
+
const openIndex = match.index + match[0].lastIndexOf("{");
|
|
234
|
+
let depth = 0;
|
|
235
|
+
let quote = null;
|
|
236
|
+
let escaped = false;
|
|
237
|
+
let lineComment = false;
|
|
238
|
+
let blockComment = false;
|
|
239
|
+
|
|
240
|
+
for (let index = openIndex; index < source.length; index += 1) {
|
|
241
|
+
const char = source[index];
|
|
242
|
+
const next = source[index + 1];
|
|
243
|
+
|
|
244
|
+
if (lineComment) {
|
|
245
|
+
if (char === "\n") lineComment = false;
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (blockComment) {
|
|
250
|
+
if (char === "*" && next === "/") {
|
|
251
|
+
blockComment = false;
|
|
252
|
+
index += 1;
|
|
253
|
+
}
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (quote) {
|
|
258
|
+
if (escaped) escaped = false;
|
|
259
|
+
else if (char === "\\") escaped = true;
|
|
260
|
+
else if (char === quote) quote = null;
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (char === "/" && next === "/") {
|
|
265
|
+
lineComment = true;
|
|
266
|
+
index += 1;
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (char === "/" && next === "*") {
|
|
271
|
+
blockComment = true;
|
|
272
|
+
index += 1;
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
277
|
+
quote = char;
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (char === "{") depth += 1;
|
|
282
|
+
if (char === "}") depth -= 1;
|
|
283
|
+
|
|
284
|
+
if (depth === 0) return source.slice(openIndex + 1, index);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
return "";
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function splitTopLevelProperties(objectBody) {
|
|
291
|
+
const props = [];
|
|
292
|
+
let start = 0;
|
|
293
|
+
let depth = 0;
|
|
294
|
+
let quote = null;
|
|
295
|
+
let escaped = false;
|
|
296
|
+
let lineComment = false;
|
|
297
|
+
let blockComment = false;
|
|
298
|
+
|
|
299
|
+
for (let index = 0; index < objectBody.length; index += 1) {
|
|
300
|
+
const char = objectBody[index];
|
|
301
|
+
const next = objectBody[index + 1];
|
|
302
|
+
|
|
303
|
+
if (lineComment) {
|
|
304
|
+
if (char === "\n") lineComment = false;
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if (blockComment) {
|
|
309
|
+
if (char === "*" && next === "/") {
|
|
310
|
+
blockComment = false;
|
|
311
|
+
index += 1;
|
|
312
|
+
}
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
if (quote) {
|
|
317
|
+
if (escaped) escaped = false;
|
|
318
|
+
else if (char === "\\") escaped = true;
|
|
319
|
+
else if (char === quote) quote = null;
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if (char === "/" && next === "/") {
|
|
324
|
+
lineComment = true;
|
|
325
|
+
index += 1;
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
if (char === "/" && next === "*") {
|
|
330
|
+
blockComment = true;
|
|
331
|
+
index += 1;
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
336
|
+
quote = char;
|
|
337
|
+
continue;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if (char === "{" || char === "[" || char === "(") depth += 1;
|
|
341
|
+
if (char === "}" || char === "]" || char === ")") depth -= 1;
|
|
342
|
+
|
|
343
|
+
if (char === "," && depth === 0) {
|
|
344
|
+
const prop = objectBody.slice(start, index).trim();
|
|
345
|
+
if (prop) props.push(prop);
|
|
346
|
+
start = index + 1;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
const lastProp = objectBody.slice(start).trim();
|
|
351
|
+
if (lastProp) props.push(lastProp);
|
|
352
|
+
return props;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function getPropertyKey(prop) {
|
|
356
|
+
const match = prop.match(/^((?:["'`][^"'`]+["'`])|(?:[a-zA-Z_$][\w$-]*))\s*:/);
|
|
357
|
+
if (!match) return null;
|
|
358
|
+
return match[1].replace(/^["'`]|["'`]$/g, "");
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
function getPropertyValue(prop) {
|
|
362
|
+
const colonIndex = prop.indexOf(":");
|
|
363
|
+
if (colonIndex === -1) return "";
|
|
364
|
+
return prop.slice(colonIndex + 1).trim();
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function createProperty(key, value) {
|
|
368
|
+
return ` ${key}: ${value}`;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
function normalizeExistingProps(source, generatedKeys = new Set()) {
|
|
372
|
+
const objectBody = findObjectBody(source);
|
|
373
|
+
const props = objectBody ? splitTopLevelProperties(objectBody) : [];
|
|
374
|
+
const nextProps = [];
|
|
375
|
+
let hasAlt = false;
|
|
376
|
+
let descriptionValue = null;
|
|
377
|
+
|
|
378
|
+
for (const prop of props) {
|
|
379
|
+
const key = getPropertyKey(prop);
|
|
380
|
+
if (!key) continue;
|
|
381
|
+
if (ROOT_PROPS_TO_DROP.has(key) || generatedKeys.has(key)) continue;
|
|
382
|
+
|
|
383
|
+
if (key === "description") {
|
|
384
|
+
descriptionValue = getPropertyValue(prop);
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
if (key === "orientation" || key === "shape") {
|
|
389
|
+
continue;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
if (key === "alt") hasAlt = true;
|
|
393
|
+
nextProps.push(createProperty(key, getPropertyValue(prop)));
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
if (!hasAlt) nextProps.unshift(createProperty("alt", descriptionValue || '""'));
|
|
397
|
+
return nextProps;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
function getImageFiles(folderPath) {
|
|
401
|
+
if (!fs.existsSync(folderPath)) return [];
|
|
402
|
+
return fs
|
|
403
|
+
.readdirSync(folderPath, { withFileTypes: true })
|
|
404
|
+
.filter((entry) => entry.isFile())
|
|
405
|
+
.map((entry) => entry.name)
|
|
406
|
+
.filter((fileName) => SUPPORTED_EXTENSIONS.has(path.extname(fileName).toLowerCase()))
|
|
407
|
+
.sort(compareImageFileNames);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function createImageSetData(folderPath, imageFiles, options = {}) {
|
|
411
|
+
const usedIdentifiers = new Set();
|
|
412
|
+
|
|
413
|
+
return imageFiles.map((fileName) => {
|
|
414
|
+
const ext = path.extname(fileName).toLowerCase();
|
|
415
|
+
const key = path.basename(fileName, ext);
|
|
416
|
+
const importName = createUniqueIdentifier(toIdentifier(key, "imageFile"), usedIdentifiers);
|
|
417
|
+
const filePath = path.join(folderPath, fileName);
|
|
418
|
+
const stats = fs.statSync(filePath);
|
|
419
|
+
const size = getImageSize(filePath);
|
|
420
|
+
|
|
421
|
+
return {
|
|
422
|
+
key,
|
|
423
|
+
fileName,
|
|
424
|
+
importName,
|
|
425
|
+
srcExpression:
|
|
426
|
+
options.sourceType === "public"
|
|
427
|
+
? JSON.stringify(`/${IMAGE_CATALOG_DIR_NAME}/${path.basename(folderPath)}/${fileName}`)
|
|
428
|
+
: importName,
|
|
429
|
+
naturalWidth: size.naturalWidth,
|
|
430
|
+
naturalHeight: size.naturalHeight,
|
|
431
|
+
aRatio: getARatio(size.naturalWidth, size.naturalHeight),
|
|
432
|
+
type: getMimeType(ext),
|
|
433
|
+
sizeBytes: stats.size,
|
|
434
|
+
shape: getShape(size.naturalWidth, size.naturalHeight),
|
|
435
|
+
};
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function formatMaybeNumber(value) {
|
|
440
|
+
return value === null || value === undefined ? "null" : String(value);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
function createImageSetEntry(item) {
|
|
444
|
+
return ` ${JSON.stringify(item.key)}: {
|
|
445
|
+
key: ${JSON.stringify(item.key)},
|
|
446
|
+
src: ${item.srcExpression},
|
|
447
|
+
naturalWidth: ${formatMaybeNumber(item.naturalWidth)},
|
|
448
|
+
naturalHeight: ${formatMaybeNumber(item.naturalHeight)},
|
|
449
|
+
aRatio: ${formatMaybeNumber(item.aRatio)},
|
|
450
|
+
type: ${JSON.stringify(item.type)},
|
|
451
|
+
sizeBytes: ${item.sizeBytes},
|
|
452
|
+
sizeKBytes: ${Number((item.sizeBytes / 1024).toFixed(2))},
|
|
453
|
+
sizeMBytes: ${Number((item.sizeBytes / 1024 / 1024).toFixed(3))},
|
|
454
|
+
shape: ${JSON.stringify(item.shape)},
|
|
455
|
+
}`;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
function getRepresentativeImage(imageSetData) {
|
|
459
|
+
return imageSetData
|
|
460
|
+
.filter((item) => item.naturalWidth && item.naturalHeight)
|
|
461
|
+
.sort((a, b) => b.naturalWidth * b.naturalHeight - a.naturalWidth * a.naturalHeight)[0];
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
function createImageObjectContent(currentSource, imageFiles, folderPath, options = {}) {
|
|
465
|
+
const generatedKeys = new Set(imageFiles.map((fileName) => path.basename(fileName, path.extname(fileName))));
|
|
466
|
+
const existingProps = normalizeExistingProps(currentSource, generatedKeys);
|
|
467
|
+
const imageSetData = createImageSetData(folderPath, imageFiles, options);
|
|
468
|
+
const representativeImage = getRepresentativeImage(imageSetData);
|
|
469
|
+
const props = [...existingProps];
|
|
470
|
+
|
|
471
|
+
props.push(`
|
|
472
|
+
${GENERATED_HEADER}
|
|
473
|
+
shape: ${JSON.stringify(representativeImage?.shape || "unknown")},
|
|
474
|
+
imageSet: {
|
|
475
|
+
${imageSetData.map(createImageSetEntry).join(",\n")}
|
|
476
|
+
}`);
|
|
477
|
+
|
|
478
|
+
return `{
|
|
479
|
+
${props.join(",\n")}
|
|
480
|
+
}`;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
function createImageIndexContent(folderName, currentSource, imageFiles, folderPath, options = {}) {
|
|
484
|
+
const imageSetData = createImageSetData(folderPath, imageFiles, options);
|
|
485
|
+
const imports =
|
|
486
|
+
options.sourceType === "public"
|
|
487
|
+
? []
|
|
488
|
+
: imageSetData.map((item) => `import ${item.importName} from "./${item.fileName}";`);
|
|
489
|
+
const imageObject = createImageObjectContent(currentSource, imageFiles, folderPath, options);
|
|
490
|
+
|
|
491
|
+
return `${GENERATED_HEADER}
|
|
492
|
+
${imports.join("\n")}
|
|
493
|
+
|
|
494
|
+
const image = ${imageObject};
|
|
495
|
+
|
|
496
|
+
export default image;
|
|
497
|
+
`;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function createFolderIndexIfMissing(folderPath) {
|
|
501
|
+
const indexPath = path.join(folderPath, "index.js");
|
|
502
|
+
if (fs.existsSync(indexPath)) return false;
|
|
503
|
+
|
|
504
|
+
fs.writeFileSync(
|
|
505
|
+
indexPath,
|
|
506
|
+
`const image = {
|
|
507
|
+
alt: "",
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
export default image;
|
|
511
|
+
`,
|
|
512
|
+
);
|
|
513
|
+
return true;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
function updateImageFolderIndex(folderPath, options = {}) {
|
|
517
|
+
createFolderIndexIfMissing(folderPath);
|
|
518
|
+
|
|
519
|
+
const imageFiles = getImageFiles(folderPath);
|
|
520
|
+
if (imageFiles.length === 0) return { changed: false, imageCount: 0 };
|
|
521
|
+
|
|
522
|
+
const indexPath = path.join(folderPath, "index.js");
|
|
523
|
+
const currentSource = readText(indexPath);
|
|
524
|
+
const content = createImageIndexContent(
|
|
525
|
+
path.basename(folderPath),
|
|
526
|
+
currentSource,
|
|
527
|
+
imageFiles,
|
|
528
|
+
folderPath,
|
|
529
|
+
options,
|
|
530
|
+
);
|
|
531
|
+
const changed = writeTextIfChanged(indexPath, content);
|
|
532
|
+
|
|
533
|
+
return { changed, imageCount: imageFiles.length };
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
function getImageFolders(imagesDir) {
|
|
537
|
+
if (!fs.existsSync(imagesDir)) return [];
|
|
538
|
+
return fs
|
|
539
|
+
.readdirSync(imagesDir, { withFileTypes: true })
|
|
540
|
+
.filter((entry) => entry.isDirectory())
|
|
541
|
+
.map((entry) => entry.name)
|
|
542
|
+
.filter((folderName) => getImageFiles(path.join(imagesDir, folderName)).length > 0)
|
|
543
|
+
.sort((a, b) => a.localeCompare(b));
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
function createCatalogIndexContent(imageFolders) {
|
|
547
|
+
const usedIdentifiers = new Set();
|
|
548
|
+
const imports = [];
|
|
549
|
+
const entries = imageFolders.map((folder) => {
|
|
550
|
+
if (folder.sourceType === "public") {
|
|
551
|
+
const imageFiles = getImageFiles(folder.folderPath);
|
|
552
|
+
const currentSource = readText(path.join(folder.folderPath, "index.js"));
|
|
553
|
+
return {
|
|
554
|
+
folderName: folder.folderName,
|
|
555
|
+
expression: createImageObjectContent(currentSource, imageFiles, folder.folderPath, {
|
|
556
|
+
sourceType: "public",
|
|
557
|
+
}),
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
const importName = createUniqueIdentifier(toIdentifier(folder.folderName, "image"), usedIdentifiers);
|
|
562
|
+
imports.push({
|
|
563
|
+
folderName: folder.folderName,
|
|
564
|
+
importName,
|
|
565
|
+
line: `import ${importName} from "./${folder.folderName}";`,
|
|
566
|
+
});
|
|
567
|
+
return { folderName: folder.folderName, expression: importName };
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
return `${GENERATED_HEADER}
|
|
571
|
+
${imports.map((item) => item.line).join("\n")}
|
|
572
|
+
|
|
573
|
+
export default {
|
|
574
|
+
${entries.map((item) => ` ${JSON.stringify(item.folderName)}: ${item.expression}`).join(",\n")}
|
|
575
|
+
};
|
|
576
|
+
`;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
function updateCatalogIndex(imagesDir, imageFolders) {
|
|
580
|
+
const indexPath = path.join(imagesDir, "index.js");
|
|
581
|
+
return writeTextIfChanged(indexPath, createCatalogIndexContent(imageFolders));
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
function findCatalogExportObject(source) {
|
|
585
|
+
const marker = "export default";
|
|
586
|
+
const exportIndex = source.indexOf(marker);
|
|
587
|
+
if (exportIndex < 0) return null;
|
|
588
|
+
|
|
589
|
+
const openIndex = source.indexOf("{", exportIndex);
|
|
590
|
+
if (openIndex < 0) return null;
|
|
591
|
+
|
|
592
|
+
let depth = 0;
|
|
593
|
+
let quote = null;
|
|
594
|
+
let inLineComment = false;
|
|
595
|
+
let inBlockComment = false;
|
|
596
|
+
let escaped = false;
|
|
597
|
+
|
|
598
|
+
for (let index = openIndex; index < source.length; index += 1) {
|
|
599
|
+
const char = source[index];
|
|
600
|
+
const next = source[index + 1];
|
|
601
|
+
|
|
602
|
+
if (inLineComment) {
|
|
603
|
+
if (char === "\n") inLineComment = false;
|
|
604
|
+
continue;
|
|
605
|
+
}
|
|
606
|
+
if (inBlockComment) {
|
|
607
|
+
if (char === "*" && next === "/") {
|
|
608
|
+
inBlockComment = false;
|
|
609
|
+
index += 1;
|
|
610
|
+
}
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
613
|
+
if (quote) {
|
|
614
|
+
if (escaped) escaped = false;
|
|
615
|
+
else if (char === "\\") escaped = true;
|
|
616
|
+
else if (char === quote) quote = null;
|
|
617
|
+
continue;
|
|
618
|
+
}
|
|
619
|
+
if (char === "/" && next === "/") {
|
|
620
|
+
inLineComment = true;
|
|
621
|
+
index += 1;
|
|
622
|
+
continue;
|
|
623
|
+
}
|
|
624
|
+
if (char === "/" && next === "*") {
|
|
625
|
+
inBlockComment = true;
|
|
626
|
+
index += 1;
|
|
627
|
+
continue;
|
|
628
|
+
}
|
|
629
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
630
|
+
quote = char;
|
|
631
|
+
continue;
|
|
632
|
+
}
|
|
633
|
+
if (char === "{") depth += 1;
|
|
634
|
+
if (char === "}") {
|
|
635
|
+
depth -= 1;
|
|
636
|
+
if (depth === 0) {
|
|
637
|
+
return { prefix: source.slice(0, exportIndex), body: source.slice(openIndex + 1, index) };
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
return null;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
function splitCatalogEntries(body) {
|
|
646
|
+
const entries = [];
|
|
647
|
+
let start = 0;
|
|
648
|
+
let depth = 0;
|
|
649
|
+
let quote = null;
|
|
650
|
+
let inLineComment = false;
|
|
651
|
+
let inBlockComment = false;
|
|
652
|
+
let escaped = false;
|
|
653
|
+
|
|
654
|
+
for (let index = 0; index < body.length; index += 1) {
|
|
655
|
+
const char = body[index];
|
|
656
|
+
const next = body[index + 1];
|
|
657
|
+
|
|
658
|
+
if (inLineComment) {
|
|
659
|
+
if (char === "\n") inLineComment = false;
|
|
660
|
+
continue;
|
|
661
|
+
}
|
|
662
|
+
if (inBlockComment) {
|
|
663
|
+
if (char === "*" && next === "/") {
|
|
664
|
+
inBlockComment = false;
|
|
665
|
+
index += 1;
|
|
666
|
+
}
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
if (quote) {
|
|
670
|
+
if (escaped) escaped = false;
|
|
671
|
+
else if (char === "\\") escaped = true;
|
|
672
|
+
else if (char === quote) quote = null;
|
|
673
|
+
continue;
|
|
674
|
+
}
|
|
675
|
+
if (char === "/" && next === "/") {
|
|
676
|
+
inLineComment = true;
|
|
677
|
+
index += 1;
|
|
678
|
+
continue;
|
|
679
|
+
}
|
|
680
|
+
if (char === "/" && next === "*") {
|
|
681
|
+
inBlockComment = true;
|
|
682
|
+
index += 1;
|
|
683
|
+
continue;
|
|
684
|
+
}
|
|
685
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
686
|
+
quote = char;
|
|
687
|
+
continue;
|
|
688
|
+
}
|
|
689
|
+
if (char === "{" || char === "[" || char === "(") depth += 1;
|
|
690
|
+
if (char === "}" || char === "]" || char === ")") depth -= 1;
|
|
691
|
+
if (char === "," && depth === 0) {
|
|
692
|
+
const entry = body.slice(start, index).trim();
|
|
693
|
+
if (entry) entries.push(entry);
|
|
694
|
+
start = index + 1;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
const lastEntry = body.slice(start).trim();
|
|
699
|
+
if (lastEntry) entries.push(lastEntry);
|
|
700
|
+
return entries;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
function removeCatalogChunks(chunksDir) {
|
|
704
|
+
if (!fs.existsSync(chunksDir)) return;
|
|
705
|
+
for (const fileName of fs.readdirSync(chunksDir)) {
|
|
706
|
+
if (/^catalog_\d+\.js$/.test(fileName)) fs.unlinkSync(path.join(chunksDir, fileName));
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
function splitImageCatalog(imagesDir, chunkSizeLimit = IMAGE_CATALOG_CHUNK_SIZE_LIMIT) {
|
|
711
|
+
const indexPath = path.join(imagesDir, "index.js");
|
|
712
|
+
const source = readText(indexPath);
|
|
713
|
+
const chunksDir = path.join(imagesDir, "_chunks");
|
|
714
|
+
|
|
715
|
+
if (!source || Buffer.byteLength(source, "utf8") <= chunkSizeLimit) {
|
|
716
|
+
removeCatalogChunks(chunksDir);
|
|
717
|
+
return { split: false, chunkCount: 0 };
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
const parsed = findCatalogExportObject(source);
|
|
721
|
+
if (!parsed) throw new Error(`Could not split generated image catalog: ${indexPath}`);
|
|
722
|
+
|
|
723
|
+
const entries = splitCatalogEntries(parsed.body);
|
|
724
|
+
if (entries.length === 0) return { split: false, chunkCount: 0 };
|
|
725
|
+
|
|
726
|
+
const chunks = [];
|
|
727
|
+
let currentEntries = [];
|
|
728
|
+
let currentSize = 0;
|
|
729
|
+
|
|
730
|
+
for (const entry of entries) {
|
|
731
|
+
const entrySize = Buffer.byteLength(entry, "utf8");
|
|
732
|
+
if (currentEntries.length > 0 && currentSize + entrySize > chunkSizeLimit) {
|
|
733
|
+
chunks.push(currentEntries);
|
|
734
|
+
currentEntries = [];
|
|
735
|
+
currentSize = 0;
|
|
736
|
+
}
|
|
737
|
+
currentEntries.push(entry);
|
|
738
|
+
currentSize += entrySize;
|
|
739
|
+
}
|
|
740
|
+
if (currentEntries.length > 0) chunks.push(currentEntries);
|
|
741
|
+
|
|
742
|
+
ensureDir(chunksDir);
|
|
743
|
+
removeCatalogChunks(chunksDir);
|
|
744
|
+
|
|
745
|
+
chunks.forEach((chunkEntries, index) => {
|
|
746
|
+
const usesPlaceholder = chunkEntries.some((entry) => /\b_placeholder\b/.test(entry));
|
|
747
|
+
const imports = usesPlaceholder
|
|
748
|
+
? `${GENERATED_HEADER}\nimport _placeholder from "../_placeholder";\n\n`
|
|
749
|
+
: `${GENERATED_HEADER}\n\n`;
|
|
750
|
+
const content = `${imports}export default {\n${chunkEntries.map((entry) => ` ${entry}`).join(",\n")}\n};\n`;
|
|
751
|
+
writeTextIfChanged(path.join(chunksDir, `catalog_${index}.js`), content);
|
|
752
|
+
});
|
|
753
|
+
|
|
754
|
+
const imports = chunks.map((_, index) => `import catalog_${index} from "./_chunks/catalog_${index}.js";`);
|
|
755
|
+
const entriesContent = chunks.map((_, index) => ` ...catalog_${index},`);
|
|
756
|
+
const nextIndex = `${GENERATED_HEADER}\n${imports.join("\n")}\n\nexport default {\n${entriesContent.join("\n")}\n};\n`;
|
|
757
|
+
writeTextIfChanged(indexPath, nextIndex);
|
|
758
|
+
|
|
759
|
+
return { split: true, chunkCount: chunks.length };
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
function generateImageIndexes(projectRoot) {
|
|
763
|
+
const srcCatalogDir = getSrcImageCatalogDir(projectRoot);
|
|
764
|
+
const publicCatalogDir = getPublicImageCatalogDir(projectRoot);
|
|
765
|
+
ensureDir(srcCatalogDir);
|
|
766
|
+
ensureDir(publicCatalogDir);
|
|
767
|
+
|
|
768
|
+
const srcImageFolders = getImageFolders(srcCatalogDir).map((folderName) => ({
|
|
769
|
+
folderName,
|
|
770
|
+
folderPath: path.join(srcCatalogDir, folderName),
|
|
771
|
+
sourceType: "src",
|
|
772
|
+
}));
|
|
773
|
+
const publicImageFolders = getImageFolders(publicCatalogDir).map((folderName) => ({
|
|
774
|
+
folderName,
|
|
775
|
+
folderPath: path.join(publicCatalogDir, folderName),
|
|
776
|
+
sourceType: "public",
|
|
777
|
+
}));
|
|
778
|
+
const imageFolders = [...srcImageFolders, ...publicImageFolders].sort((a, b) =>
|
|
779
|
+
a.folderName.localeCompare(b.folderName),
|
|
780
|
+
);
|
|
781
|
+
let totalImages = 0;
|
|
782
|
+
const changedFolders = [];
|
|
783
|
+
|
|
784
|
+
for (const folder of imageFolders) {
|
|
785
|
+
const result = updateImageFolderIndex(folder.folderPath, { sourceType: folder.sourceType });
|
|
786
|
+
totalImages += result.imageCount;
|
|
787
|
+
if (result.changed) changedFolders.push(folder.folderName);
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
const catalogChanged = updateCatalogIndex(srcCatalogDir, imageFolders);
|
|
791
|
+
const catalogSplit = splitImageCatalog(srcCatalogDir);
|
|
792
|
+
|
|
793
|
+
return {
|
|
794
|
+
imagesDir: srcCatalogDir,
|
|
795
|
+
srcCatalogDir,
|
|
796
|
+
publicCatalogDir,
|
|
797
|
+
imageFolders: imageFolders.map((folder) => folder.folderName),
|
|
798
|
+
changedFolders,
|
|
799
|
+
totalImages,
|
|
800
|
+
catalogChanged,
|
|
801
|
+
catalogSplit,
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
function readPackageJson(projectRoot) {
|
|
806
|
+
const packageJsonPath = path.join(projectRoot, "package.json");
|
|
807
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
808
|
+
throw new Error(`package.json not found at ${packageJsonPath}`);
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
return {
|
|
812
|
+
packageJsonPath,
|
|
813
|
+
packageJson: JSON.parse(fs.readFileSync(packageJsonPath, "utf8")),
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
function setupImageCatalog(projectRoot) {
|
|
818
|
+
const imagesDir = getSrcImageCatalogDir(projectRoot);
|
|
819
|
+
const publicImagesDir = getPublicImageCatalogDir(projectRoot);
|
|
820
|
+
const imagesDirCreated = !fs.existsSync(imagesDir);
|
|
821
|
+
ensureDir(imagesDir);
|
|
822
|
+
ensureDir(publicImagesDir);
|
|
823
|
+
|
|
824
|
+
const indexPath = path.join(imagesDir, "index.js");
|
|
825
|
+
if (!fs.existsSync(indexPath)) {
|
|
826
|
+
fs.writeFileSync(
|
|
827
|
+
indexPath,
|
|
828
|
+
`${GENERATED_HEADER}
|
|
829
|
+
|
|
830
|
+
export default {};
|
|
831
|
+
`,
|
|
832
|
+
);
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
const { packageJsonPath, packageJson } = readPackageJson(projectRoot);
|
|
836
|
+
const currentScripts = packageJson.scripts || {};
|
|
837
|
+
const shouldReplaceImageScript =
|
|
838
|
+
!currentScripts[IMAGE_SCRIPT_NAME] || currentScripts[IMAGE_SCRIPT_NAME] === "base-image-index";
|
|
839
|
+
const nextPackageJson = {
|
|
840
|
+
...packageJson,
|
|
841
|
+
scripts: {
|
|
842
|
+
...currentScripts,
|
|
843
|
+
[IMAGE_SCRIPT_NAME]: shouldReplaceImageScript
|
|
844
|
+
? IMAGE_SCRIPT_COMMAND
|
|
845
|
+
: currentScripts[IMAGE_SCRIPT_NAME],
|
|
846
|
+
},
|
|
847
|
+
};
|
|
848
|
+
|
|
849
|
+
const packageJsonUpdated = writeTextIfChanged(
|
|
850
|
+
packageJsonPath,
|
|
851
|
+
`${JSON.stringify(nextPackageJson, null, 4)}\n`,
|
|
852
|
+
);
|
|
853
|
+
|
|
854
|
+
return {
|
|
855
|
+
imagesDir,
|
|
856
|
+
imagesDirCreated,
|
|
857
|
+
packageJsonUpdated,
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
module.exports = {
|
|
862
|
+
GENERATED_HEADER,
|
|
863
|
+
IMAGE_SCRIPT_COMMAND,
|
|
864
|
+
IMAGE_SCRIPT_NAME,
|
|
865
|
+
SUPPORTED_EXTENSIONS,
|
|
866
|
+
createCatalogIndexContent,
|
|
867
|
+
createImageIndexContent,
|
|
868
|
+
generateImageIndexes,
|
|
869
|
+
getARatio,
|
|
870
|
+
getImageSize,
|
|
871
|
+
getShape,
|
|
872
|
+
normalizeShape,
|
|
873
|
+
splitImageCatalog,
|
|
874
|
+
setupImageCatalog,
|
|
875
|
+
};
|