@ikas/bp-storefront 1.4.0-beta.12 → 1.4.0-beta.121
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/dist/analytics/analytics-functions/helpers.js +1 -1
- package/dist/analytics/analytics.js +1 -1
- package/dist/analytics/google-tag-manager/productView.js +1 -1
- package/dist/analytics/google-tag-manager/viewCategory.js +1 -1
- package/dist/analytics/ikas/analytics.js +1 -1
- package/dist/analytics/utils.js +1 -1
- package/dist/ext/lodash/flatten.js +1 -0
- package/dist/ext/tslib/tslib.es6.mjs.js +1 -1
- package/dist/functions/api/cart/index.js +1 -1
- package/dist/functions/models/category/index.js +1 -1
- package/dist/functions/models/image/index.d.ts +65 -20
- package/dist/functions/models/image/index.js +1 -1
- package/dist/functions/models/product/variant/index.d.ts +14 -4
- package/dist/functions/models/product-list/index.js +1 -1
- package/dist/functions/models/validator/account-info/index.js +1 -1
- package/dist/functions/models/validator/contact-form/index.js +1 -1
- package/dist/functions/models/validator/coupon-code-form/index.js +1 -1
- package/dist/functions/models/validator/customer-review/index.js +1 -1
- package/dist/functions/models/validator/forgot-password/index.js +1 -1
- package/dist/functions/models/validator/login/index.js +1 -1
- package/dist/functions/models/validator/newsletter-subscription/index.js +1 -1
- package/dist/functions/models/validator/order-tracking/index.js +1 -1
- package/dist/functions/models/validator/recover-password/index.js +1 -1
- package/dist/functions/models/validator/register/index.js +1 -1
- package/dist/functions/models/validator/sms-login/index.js +1 -1
- package/dist/functions/models/validator/verify-phone-number/index.js +1 -1
- package/dist/functions/stores/base/index.d.ts +76 -1
- package/dist/functions/stores/base/index.js +1 -1
- package/dist/functions/stores/cart/index.js +1 -1
- package/dist/functions/stores/customer/index.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/packages/storefront-config/src/index.js +1 -1
- package/dist/packages/storefront-config/src/theme-globals.js +1 -0
- package/dist/storefront-config/src/index.d.ts +4 -0
- package/dist/storefront-config/src/theme-globals.d.ts +314 -0
- package/dist/storefront-models/src/models/blueprint/prop-value/color.d.ts +2 -0
- package/dist/storefront-models/src/models/blueprint/prop-value/index.d.ts +2 -0
- package/dist/storefront-models/src/models/blueprint/prop-value/svg-list.d.ts +3 -0
- package/dist/storefront-models/src/models/blueprint/prop-value/svg.d.ts +3 -0
- package/dist/theme/settings/index.d.ts +48 -0
- package/dist/theme/settings/index.js +1 -0
- package/dist/utils/component-renderer.d.ts +2 -1
- package/dist/utils/component-renderer.js +1 -1
- package/dist/utils/svg.d.ts +15 -0
- package/dist/utils/svg.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type NormalizeSvgOptions = {
|
|
2
|
+
/** Deterministic, instance-unique prefix (element id, or prop key + list index). */
|
|
3
|
+
idPrefix: string;
|
|
4
|
+
/** Rewrite ids and their references. Default: true. */
|
|
5
|
+
scopeIds?: boolean;
|
|
6
|
+
/** Normalize fill/stroke to this color. Opt-in. */
|
|
7
|
+
color?: "currentColor";
|
|
8
|
+
/** Strip fixed width/height and ensure a viewBox. Default: true. */
|
|
9
|
+
size?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Isomorphic, DOM-free normalization of a raw SVG markup string for render.
|
|
13
|
+
* Safe to call in SSR, browser, and node — pure string transforms only.
|
|
14
|
+
*/
|
|
15
|
+
export declare function normalizeSvg(svg: string, options: NormalizeSvgOptions): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=/\swidth\s*=\s*["']([^"']*)["']/i,n=/\sheight\s*=\s*["']([^"']*)["']/i,t=function(r,n){var t;return null===(t=r.match(n))||void 0===t?void 0:t[1]},c=function(r){var n=null==r?void 0:r.trim().match(/^(-?\d*\.?\d+)(px)?$/i);return n?parseFloat(n[1]):NaN},e=/(\sfill\s*=\s*["'])([^"']*)(["'])/gi,i=/(\sstroke\s*=\s*["'])([^"']*)(["'])/gi,s=/(fill\s*:\s*)([^;"']+)/gi,o=/(stroke\s*:\s*)([^;"']+)/gi;function a(a,u){var l=u.idPrefix,f=u.scopeIds,v=void 0===f||f,p=u.color,h=u.size,d=void 0===h||h,g=v?function(r,n){var t=new Set(Array.from(r.matchAll(/\sid\s*=\s*["']([^"']+)["']/g)).map(function(r){return r[1]}));if(0===t.size)return r;var c=function(r){return"".concat(n,"-").concat(r)};return r.replace(/(\sid\s*=\s*["'])([^"']+)(["'])/g,function(r,n,e,i){return t.has(e)?"".concat(n).concat(c(e)).concat(i):r}).replace(/url\(\s*["']?#([^"')\s]+)["']?\s*\)/g,function(r,n){return t.has(n)?"url(#".concat(c(n),")"):r}).replace(/((?:xlink:)?href\s*=\s*["'])#([^"']+)(["'])/g,function(r,n,e,i){return t.has(e)?"".concat(n,"#").concat(c(e)).concat(i):r})}(a,l):a,m="currentColor"===p?function(r){var n=function(r){var n=r.trim();return"none"===n||n.startsWith("url(")},t=function(r,t,c,e){return n(c)?r:"".concat(t,"currentColor").concat(e)},c=function(r,t,c){return n(c)?r:"".concat(t,"currentColor")};return r.replace(e,t).replace(i,t).replace(s,c).replace(o,c)}(g):g;return d?function(e){return e.replace(/<svg\b[^>]*>/i,function(e){var i=/\sviewBox\s*=/i.test(e),s=c(t(e,r)),o=c(t(e,n)),a=!i&&!Number.isNaN(s)&&!Number.isNaN(o);return i||a?(a?e.replace(/<svg\b/i,'<svg viewBox="0 0 '.concat(s," ").concat(o,'"')):e).replace(/\swidth\s*=\s*["'][^"']*["']/i,"").replace(/\sheight\s*=\s*["'][^"']*["']/i,""):e})}(m):m}export{a as normalizeSvg};
|