@veeqo/ui 9.14.3 → 9.14.4

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.
@@ -34,8 +34,9 @@ const addPrefixToUrl = (url) => { var _a; return `${((_a = window.veeqoContext)
34
34
  * @returns {string} The processed URL
35
35
  */
36
36
  const createContextAwareUrl = (url) => {
37
- // Don't modify anchor URLs (they should be treated as absolute)
38
- if (!url || isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url))
37
+ if (!url)
38
+ return '';
39
+ if (isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url))
39
40
  return url;
40
41
  return addPrefixToUrl(url);
41
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"urlUtils.cjs","sources":["../../../../src/components/Anchor/utils/urlUtils.ts"],"sourcesContent":["/**\n * Utility functions for URL processing\n */\n\n/**\n * Checks if the URL should have a prefix added based on the current context\n * @returns {boolean} Whether a prefix should be added\n */\nexport const shouldAddPrefix = (): boolean =>\n !!(\n window.veeqoContext &&\n window.veeqoContext.vqHost !== 'standalone' &&\n window.veeqoContext.baseUrl\n );\n\n/**\n * Checks if a URL is relative (not starting with http://, https://, or //)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is relative\n */\nexport const isRelativeUrl = (url: string): boolean => !url.match(/^(https?:\\/\\/|\\/\\/)/);\n\n/**\n * Checks if a URL is an anchor link (starts with #)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is an anchor link\n */\nexport const isAnchorUrl = (url: string): boolean => url.startsWith('#');\n\n/**\n * Adds the appropriate prefix to a URL based on the current context\n * @param {string} url - The URL to add a prefix to\n * @returns {string} The URL with prefix added if needed\n */\nexport const addPrefixToUrl = (url: string): string =>\n `${window.veeqoContext?.baseUrl || ''}${url.startsWith('/') ? '' : '/'}${url}`;\n\n/**\n * Processes a URL by adding the appropriate prefix if needed\n * @param {string} url - The URL to process\n * @returns {string} The processed URL\n */\nexport const createContextAwareUrl = (url: string | undefined): string | undefined => {\n // Don't modify anchor URLs (they should be treated as absolute)\n if (!url || isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url)) return url;\n\n return addPrefixToUrl(url);\n};\n"],"names":[],"mappings":";;AAAA;;AAEG;AAEH;;;AAGG;AACI,MAAM,eAAe,GAAG,MAC7B,CAAC,EACC,MAAM,CAAC,YAAY;AACnB,IAAA,MAAM,CAAC,YAAY,CAAC,MAAM,KAAK,YAAY;AAC3C,IAAA,MAAM,CAAC,YAAY,CAAC,OAAO;AAG/B;;;;AAIG;AACU,MAAA,aAAa,GAAG,CAAC,GAAW,KAAc,CAAC,GAAG,CAAC,KAAK,CAAC,qBAAqB;AAEvF;;;;AAIG;AACI,MAAM,WAAW,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,GAAG;AAEvE;;;;AAIG;AACU,MAAA,cAAc,GAAG,CAAC,GAAW,KAAY,EAAA,IAAA,EAAA,CAAA,CACpD,OAAA,CAAA,EAAG,CAAA,CAAA,EAAA,GAAA,MAAM,CAAC,YAAY,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAE,OAAO,KAAI,EAAE,CAAG,EAAA,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,CAAA,EAAG,GAAG,CAAE,CAAA,CAAA;AAEhF;;;;AAIG;AACU,MAAA,qBAAqB,GAAG,CAAC,GAAuB,KAAwB;;AAEnF,IAAA,IAAI,CAAC,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,GAAG;AAErF,IAAA,OAAO,cAAc,CAAC,GAAG,CAAC;AAC5B;;;;;;;;"}
1
+ {"version":3,"file":"urlUtils.cjs","sources":["../../../../src/components/Anchor/utils/urlUtils.ts"],"sourcesContent":["/**\n * Utility functions for URL processing\n */\n\n/**\n * Checks if the URL should have a prefix added based on the current context\n * @returns {boolean} Whether a prefix should be added\n */\nexport const shouldAddPrefix = (): boolean =>\n !!(\n window.veeqoContext &&\n window.veeqoContext.vqHost !== 'standalone' &&\n window.veeqoContext.baseUrl\n );\n\n/**\n * Checks if a URL is relative (not starting with http://, https://, or //)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is relative\n */\nexport const isRelativeUrl = (url: string): boolean => !url.match(/^(https?:\\/\\/|\\/\\/)/);\n\n/**\n * Checks if a URL is an anchor link (starts with #)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is an anchor link\n */\nexport const isAnchorUrl = (url: string): boolean => url.startsWith('#');\n\n/**\n * Adds the appropriate prefix to a URL based on the current context\n * @param {string} url - The URL to add a prefix to\n * @returns {string} The URL with prefix added if needed\n */\nexport const addPrefixToUrl = (url: string): string =>\n `${window.veeqoContext?.baseUrl || ''}${url.startsWith('/') ? '' : '/'}${url}`;\n\n/**\n * Processes a URL by adding the appropriate prefix if needed\n * @param {string} url - The URL to process\n * @returns {string} The processed URL\n */\nexport const createContextAwareUrl = (url: string | undefined | null): string => {\n if (!url) return '';\n if (isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url)) return url;\n\n return addPrefixToUrl(url);\n};\n"],"names":[],"mappings":";;AAAA;;AAEG;AAEH;;;AAGG;AACI,MAAM,eAAe,GAAG,MAC7B,CAAC,EACC,MAAM,CAAC,YAAY;AACnB,IAAA,MAAM,CAAC,YAAY,CAAC,MAAM,KAAK,YAAY;AAC3C,IAAA,MAAM,CAAC,YAAY,CAAC,OAAO;AAG/B;;;;AAIG;AACU,MAAA,aAAa,GAAG,CAAC,GAAW,KAAc,CAAC,GAAG,CAAC,KAAK,CAAC,qBAAqB;AAEvF;;;;AAIG;AACI,MAAM,WAAW,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,GAAG;AAEvE;;;;AAIG;AACU,MAAA,cAAc,GAAG,CAAC,GAAW,KAAY,EAAA,IAAA,EAAA,CAAA,CACpD,OAAA,CAAA,EAAG,CAAA,CAAA,EAAA,GAAA,MAAM,CAAC,YAAY,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAE,OAAO,KAAI,EAAE,CAAG,EAAA,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,CAAA,EAAG,GAAG,CAAE,CAAA,CAAA;AAEhF;;;;AAIG;AACU,MAAA,qBAAqB,GAAG,CAAC,GAA8B,KAAY;AAC9E,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,EAAE;AACnB,IAAA,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,GAAG;AAE7E,IAAA,OAAO,cAAc,CAAC,GAAG,CAAC;AAC5B;;;;;;;;"}
@@ -29,4 +29,4 @@ export declare const addPrefixToUrl: (url: string) => string;
29
29
  * @param {string} url - The URL to process
30
30
  * @returns {string} The processed URL
31
31
  */
32
- export declare const createContextAwareUrl: (url: string | undefined) => string | undefined;
32
+ export declare const createContextAwareUrl: (url: string | undefined | null) => string;
@@ -32,8 +32,9 @@ const addPrefixToUrl = (url) => { var _a; return `${((_a = window.veeqoContext)
32
32
  * @returns {string} The processed URL
33
33
  */
34
34
  const createContextAwareUrl = (url) => {
35
- // Don't modify anchor URLs (they should be treated as absolute)
36
- if (!url || isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url))
35
+ if (!url)
36
+ return '';
37
+ if (isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url))
37
38
  return url;
38
39
  return addPrefixToUrl(url);
39
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"urlUtils.js","sources":["../../../../src/components/Anchor/utils/urlUtils.ts"],"sourcesContent":["/**\n * Utility functions for URL processing\n */\n\n/**\n * Checks if the URL should have a prefix added based on the current context\n * @returns {boolean} Whether a prefix should be added\n */\nexport const shouldAddPrefix = (): boolean =>\n !!(\n window.veeqoContext &&\n window.veeqoContext.vqHost !== 'standalone' &&\n window.veeqoContext.baseUrl\n );\n\n/**\n * Checks if a URL is relative (not starting with http://, https://, or //)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is relative\n */\nexport const isRelativeUrl = (url: string): boolean => !url.match(/^(https?:\\/\\/|\\/\\/)/);\n\n/**\n * Checks if a URL is an anchor link (starts with #)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is an anchor link\n */\nexport const isAnchorUrl = (url: string): boolean => url.startsWith('#');\n\n/**\n * Adds the appropriate prefix to a URL based on the current context\n * @param {string} url - The URL to add a prefix to\n * @returns {string} The URL with prefix added if needed\n */\nexport const addPrefixToUrl = (url: string): string =>\n `${window.veeqoContext?.baseUrl || ''}${url.startsWith('/') ? '' : '/'}${url}`;\n\n/**\n * Processes a URL by adding the appropriate prefix if needed\n * @param {string} url - The URL to process\n * @returns {string} The processed URL\n */\nexport const createContextAwareUrl = (url: string | undefined): string | undefined => {\n // Don't modify anchor URLs (they should be treated as absolute)\n if (!url || isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url)) return url;\n\n return addPrefixToUrl(url);\n};\n"],"names":[],"mappings":"AAAA;;AAEG;AAEH;;;AAGG;AACI,MAAM,eAAe,GAAG,MAC7B,CAAC,EACC,MAAM,CAAC,YAAY;AACnB,IAAA,MAAM,CAAC,YAAY,CAAC,MAAM,KAAK,YAAY;AAC3C,IAAA,MAAM,CAAC,YAAY,CAAC,OAAO;AAG/B;;;;AAIG;AACU,MAAA,aAAa,GAAG,CAAC,GAAW,KAAc,CAAC,GAAG,CAAC,KAAK,CAAC,qBAAqB;AAEvF;;;;AAIG;AACI,MAAM,WAAW,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,GAAG;AAEvE;;;;AAIG;AACU,MAAA,cAAc,GAAG,CAAC,GAAW,KAAY,EAAA,IAAA,EAAA,CAAA,CACpD,OAAA,CAAA,EAAG,CAAA,CAAA,EAAA,GAAA,MAAM,CAAC,YAAY,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAE,OAAO,KAAI,EAAE,CAAG,EAAA,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,CAAA,EAAG,GAAG,CAAE,CAAA,CAAA;AAEhF;;;;AAIG;AACU,MAAA,qBAAqB,GAAG,CAAC,GAAuB,KAAwB;;AAEnF,IAAA,IAAI,CAAC,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,GAAG;AAErF,IAAA,OAAO,cAAc,CAAC,GAAG,CAAC;AAC5B;;;;"}
1
+ {"version":3,"file":"urlUtils.js","sources":["../../../../src/components/Anchor/utils/urlUtils.ts"],"sourcesContent":["/**\n * Utility functions for URL processing\n */\n\n/**\n * Checks if the URL should have a prefix added based on the current context\n * @returns {boolean} Whether a prefix should be added\n */\nexport const shouldAddPrefix = (): boolean =>\n !!(\n window.veeqoContext &&\n window.veeqoContext.vqHost !== 'standalone' &&\n window.veeqoContext.baseUrl\n );\n\n/**\n * Checks if a URL is relative (not starting with http://, https://, or //)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is relative\n */\nexport const isRelativeUrl = (url: string): boolean => !url.match(/^(https?:\\/\\/|\\/\\/)/);\n\n/**\n * Checks if a URL is an anchor link (starts with #)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is an anchor link\n */\nexport const isAnchorUrl = (url: string): boolean => url.startsWith('#');\n\n/**\n * Adds the appropriate prefix to a URL based on the current context\n * @param {string} url - The URL to add a prefix to\n * @returns {string} The URL with prefix added if needed\n */\nexport const addPrefixToUrl = (url: string): string =>\n `${window.veeqoContext?.baseUrl || ''}${url.startsWith('/') ? '' : '/'}${url}`;\n\n/**\n * Processes a URL by adding the appropriate prefix if needed\n * @param {string} url - The URL to process\n * @returns {string} The processed URL\n */\nexport const createContextAwareUrl = (url: string | undefined | null): string => {\n if (!url) return '';\n if (isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url)) return url;\n\n return addPrefixToUrl(url);\n};\n"],"names":[],"mappings":"AAAA;;AAEG;AAEH;;;AAGG;AACI,MAAM,eAAe,GAAG,MAC7B,CAAC,EACC,MAAM,CAAC,YAAY;AACnB,IAAA,MAAM,CAAC,YAAY,CAAC,MAAM,KAAK,YAAY;AAC3C,IAAA,MAAM,CAAC,YAAY,CAAC,OAAO;AAG/B;;;;AAIG;AACU,MAAA,aAAa,GAAG,CAAC,GAAW,KAAc,CAAC,GAAG,CAAC,KAAK,CAAC,qBAAqB;AAEvF;;;;AAIG;AACI,MAAM,WAAW,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,GAAG;AAEvE;;;;AAIG;AACU,MAAA,cAAc,GAAG,CAAC,GAAW,KAAY,EAAA,IAAA,EAAA,CAAA,CACpD,OAAA,CAAA,EAAG,CAAA,CAAA,EAAA,GAAA,MAAM,CAAC,YAAY,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAE,OAAO,KAAI,EAAE,CAAG,EAAA,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,CAAA,EAAG,GAAG,CAAE,CAAA,CAAA;AAEhF;;;;AAIG;AACU,MAAA,qBAAqB,GAAG,CAAC,GAA8B,KAAY;AAC9E,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,EAAE;AACnB,IAAA,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,GAAG;AAE7E,IAAA,OAAO,cAAc,CAAC,GAAG,CAAC;AAC5B;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/ui",
3
- "version": "9.14.3",
3
+ "version": "9.14.4",
4
4
  "description": "New optimised component library for Veeqo.",
5
5
  "author": "Robert Wealthall",
6
6
  "license": "ISC",