@hashicorp/design-system-components 5.1.1-rc-20251208205057 → 5.1.1-rc-20251209143536
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/declarations/components/hds/breadcrumb/item.d.ts +8 -4
- package/declarations/components/hds/interactive/index.d.ts +9 -4
- package/dist/components/hds/breadcrumb/item.js +15 -17
- package/dist/components/hds/breadcrumb/item.js.map +1 -1
- package/dist/components/hds/interactive/index.js +19 -17
- package/dist/components/hds/interactive/index.js.map +1 -1
- package/package.json +1 -2
- package/declarations/utils/hds-resolve-link-to-external.d.ts +0 -12
- package/dist/utils/hds-resolve-link-to-external.js +0 -33
- package/dist/utils/hds-resolve-link-to-external.js.map +0 -1
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
*/
|
|
5
5
|
import Component from '@glimmer/component';
|
|
6
|
-
import type Owner from '@ember/owner';
|
|
7
6
|
import type { LinkTo } from '@ember/routing';
|
|
8
7
|
import type { SafeString } from '@ember/template';
|
|
9
8
|
import type { HdsIconSignature } from '../icon/index';
|
|
@@ -24,9 +23,14 @@ export interface HdsBreadcrumbItemSignature {
|
|
|
24
23
|
Element: HTMLLIElement;
|
|
25
24
|
}
|
|
26
25
|
export default class HdsBreadcrumbItem extends Component<HdsBreadcrumbItemSignature> {
|
|
27
|
-
linkToExternal: LinkTo | null;
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
static linkToExternal: LinkTo | null;
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @param linkToExternal
|
|
30
|
+
* @type LinkTo | null
|
|
31
|
+
* @default null
|
|
32
|
+
*/
|
|
33
|
+
get linkToExternal(): LinkTo | null;
|
|
30
34
|
/**
|
|
31
35
|
* @param maxWidth
|
|
32
36
|
* @type {string}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
*/
|
|
5
5
|
import Component from '@glimmer/component';
|
|
6
|
-
import type Owner from '@ember/owner';
|
|
7
6
|
import type { LinkTo } from '@ember/routing';
|
|
8
7
|
export interface HdsInteractiveSignature {
|
|
9
8
|
Args: {
|
|
@@ -23,9 +22,15 @@ export interface HdsInteractiveSignature {
|
|
|
23
22
|
Element: HTMLAnchorElement | HTMLButtonElement;
|
|
24
23
|
}
|
|
25
24
|
export default class HdsInteractive extends Component<HdsInteractiveSignature> {
|
|
26
|
-
linkToExternal: LinkTo | null;
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
static linkToExternal: LinkTo | null;
|
|
26
|
+
/**
|
|
27
|
+
* Determines if a @href value is "external" (it adds target="_blank" rel="noopener noreferrer")
|
|
28
|
+
*
|
|
29
|
+
* @param linkToExternal
|
|
30
|
+
* @type LinkTo | null
|
|
31
|
+
* @default null
|
|
32
|
+
*/
|
|
33
|
+
get linkToExternal(): LinkTo | null;
|
|
29
34
|
/**
|
|
30
35
|
* Determines if a @href value is "external" (it adds target="_blank" rel="noopener noreferrer")
|
|
31
36
|
*
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import { tracked } from '@glimmer/tracking';
|
|
3
2
|
import { htmlSafe } from '@ember/template';
|
|
4
3
|
import { assert } from '@ember/debug';
|
|
5
|
-
import { hdsResolveLinkToExternal } from '../../../utils/hds-resolve-link-to-external.js';
|
|
6
4
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
7
|
-
import { g, i } from 'decorator-transforms/runtime';
|
|
8
5
|
import { setComponentTemplate } from '@ember/component';
|
|
9
6
|
|
|
10
7
|
var TEMPLATE = precompileTemplate("{{!\n Copyright IBM Corp. 2021, 2025\n SPDX-License-Identifier: MPL-2.0\n}}\n<li class=\"hds-breadcrumb__item\" style={{this.itemStyle}} ...attributes>\n {{#if @current}}\n <div class=\"hds-breadcrumb__current\">\n {{#if @icon}}\n <div class=\"hds-breadcrumb__icon\">\n <Hds::Icon @name={{@icon}} @size=\"16\" @stretched={{true}} />\n </div>\n {{/if}}\n <span class=\"hds-breadcrumb__text\">{{@text}}</span>\n </div>\n {{else}}\n {{#if @isRouteExternal}}\n <this.linkToExternal\n class=\"hds-breadcrumb__link\"\n @current-when={{@current-when}}\n @models={{hds-link-to-models @model @models}}\n @query={{hds-link-to-query @query}}\n @replace={{@replace}}\n @route={{@route}}\n >\n {{#if @icon}}\n <div class=\"hds-breadcrumb__icon\">\n <Hds::Icon @name={{@icon}} @size=\"16\" @stretched={{true}} />\n </div>\n {{/if}}\n <span class=\"hds-breadcrumb__text\">{{@text}}</span>\n </this.linkToExternal>\n {{else}}\n <LinkTo\n class=\"hds-breadcrumb__link\"\n @current-when={{@current-when}}\n @models={{hds-link-to-models @model @models}}\n @query={{hds-link-to-query @query}}\n @replace={{@replace}}\n @route={{@route}}\n >\n {{#if @icon}}\n <div class=\"hds-breadcrumb__icon\">\n <Hds::Icon @name={{@icon}} @size=\"16\" @stretched={{true}} />\n </div>\n {{/if}}\n <span class=\"hds-breadcrumb__text\">{{@text}}</span>\n </LinkTo>\n {{/if}}\n {{/if}}\n</li>");
|
|
@@ -15,22 +12,23 @@ var TEMPLATE = precompileTemplate("{{!\n Copyright IBM Corp. 2021, 2025\n SPDX
|
|
|
15
12
|
*/
|
|
16
13
|
|
|
17
14
|
class HdsBreadcrumbItem extends Component {
|
|
18
|
-
static
|
|
19
|
-
g(this.prototype, "linkToExternal", [tracked], function () {
|
|
20
|
-
return null;
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
#linkToExternal = (i(this, "linkToExternal"), void 0);
|
|
24
|
-
constructor(owner, args) {
|
|
25
|
-
super(owner, args);
|
|
15
|
+
static linkToExternal = null;
|
|
26
16
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param linkToExternal
|
|
20
|
+
* @type LinkTo | null
|
|
21
|
+
* @default null
|
|
22
|
+
*/
|
|
23
|
+
get linkToExternal() {
|
|
24
|
+
const component = HdsBreadcrumbItem.linkToExternal;
|
|
25
|
+
if (component === null) {
|
|
26
|
+
assert(`HdsBreadcrumbItem: You attempted to use an external link without configuring HDS with an external component. Please add this in your app.js file:
|
|
27
|
+
|
|
28
|
+
import { HdsBreadcrumbItem } from @hashicorp/design-system-components/components;'
|
|
29
|
+
HdsBreadcrumbItem.linkToExternal = LinkToExternalComponent;`);
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
resolveLinkToExternal() {
|
|
33
|
-
this.linkToExternal = hdsResolveLinkToExternal(this.args.isRouteExternal);
|
|
31
|
+
return component;
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sources":["../../../../src/components/hds/breadcrumb/item.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport {
|
|
1
|
+
{"version":3,"file":"item.js","sources":["../../../../src/components/hds/breadcrumb/item.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { htmlSafe } from '@ember/template';\nimport { assert } from '@ember/debug';\n\nimport type { LinkTo } from '@ember/routing';\nimport type { SafeString } from '@ember/template';\nimport type { HdsIconSignature } from '../icon/index';\n\nexport interface HdsBreadcrumbItemSignature {\n Args: {\n current?: boolean;\n maxWidth?: string;\n text: string;\n isRouteExternal?: boolean;\n icon?: HdsIconSignature['Args']['name'];\n route?: string;\n models?: Array<string | number>;\n model?: string | number;\n query?: Record<string, string>;\n 'current-when'?: string;\n replace?: boolean;\n };\n Element: HTMLLIElement;\n}\n\nexport default class HdsBreadcrumbItem extends Component<HdsBreadcrumbItemSignature> {\n static linkToExternal: LinkTo | null = null;\n\n /**\n *\n * @param linkToExternal\n * @type LinkTo | null\n * @default null\n */\n get linkToExternal(): LinkTo | null {\n const component = HdsBreadcrumbItem.linkToExternal;\n if (component === null) {\n assert(\n `HdsBreadcrumbItem: You attempted to use an external link without configuring HDS with an external component. Please add this in your app.js file:\n\nimport { HdsBreadcrumbItem } from @hashicorp/design-system-components/components;'\nHdsBreadcrumbItem.linkToExternal = LinkToExternalComponent;`\n );\n }\n return component;\n }\n\n /**\n * @param maxWidth\n * @type {string}\n * @default undefined\n * @description A parameter that can be applied to an \"item\" to limit its max-width\n */\n get maxWidth(): string | undefined {\n const { maxWidth } = this.args;\n\n if (maxWidth) {\n assert(\n `@maxWidth for \"Hds::Breadcrumb::Item\" must be a size as number in 'px' or in 'em' (eg. '200px' or '24em'); received: ${maxWidth}`,\n maxWidth.match(/^\\d+(px|em)$/)\n );\n\n return maxWidth;\n } else {\n return undefined;\n }\n }\n\n /**\n * Get the inline style to apply to the item.\n * @method BreadcrumbItem#itemStyle\n * @return {string} The \"style\" attribute to apply to the item.\n */\n get itemStyle(): SafeString | undefined {\n if (this.maxWidth) {\n return htmlSafe(`max-width: ${this.maxWidth}`);\n } else {\n return undefined;\n }\n }\n\n /**\n * Get the class names to apply to the component.\n * @method BreadcrumbItem#classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-breadcrumb__item'];\n\n return classes.join(' ');\n }\n}\n"],"names":["HdsBreadcrumbItem","Component","linkToExternal","component","assert","maxWidth","args","match","undefined","itemStyle","htmlSafe","classNames","classes","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;;AA2Be,MAAMA,iBAAiB,SAASC,SAAS,CAA6B;EACnF,OAAOC,cAAc,GAAkB,IAAI;;AAE3C;AACF;AACA;AACA;AACA;AACA;EACE,IAAIA,cAAcA,GAAkB;AAClC,IAAA,MAAMC,SAAS,GAAGH,iBAAiB,CAACE,cAAc;IAClD,IAAIC,SAAS,KAAK,IAAI,EAAE;AACtBC,MAAAA,MAAM,CACJ,CAAA;;AAER;AACA,2DAAA,CACM,CAAC;AACH,IAAA;AACA,IAAA,OAAOD,SAAS;AAClB,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;EACE,IAAIE,QAAQA,GAAuB;IACjC,MAAM;AAAEA,MAAAA;KAAU,GAAG,IAAI,CAACC,IAAI;AAE9B,IAAA,IAAID,QAAQ,EAAE;MACZD,MAAM,CACJ,CAAA,qHAAA,EAAwHC,QAAQ,CAAA,CAAE,EAClIA,QAAQ,CAACE,KAAK,CAAC,cAAc,CAC/B,CAAC;AAED,MAAA,OAAOF,QAAQ;AACjB,IAAA,CAAC,MAAM;AACL,MAAA,OAAOG,SAAS;AAClB,IAAA;AACF,EAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,SAASA,GAA2B;IACtC,IAAI,IAAI,CAACJ,QAAQ,EAAE;AACjB,MAAA,OAAOK,QAAQ,CAAC,CAAA,WAAA,EAAc,IAAI,CAACL,QAAQ,EAAE,CAAC;AAChD,IAAA,CAAC,MAAM;AACL,MAAA,OAAOG,SAAS;AAClB,IAAA;AACF,EAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIG,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CAAC,sBAAsB,CAAC;AAExC,IAAA,OAAOA,OAAO,CAACC,IAAI,CAAC,GAAG,CAAC;AAC1B,EAAA;AACF;AAACC,oBAAA,CAAAC,QAAA,EAlEoBf,iBAAiB,CAAA;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import { tracked } from '@glimmer/tracking';
|
|
3
2
|
import { action } from '@ember/object';
|
|
4
|
-
import {
|
|
3
|
+
import { assert } from '@ember/debug';
|
|
5
4
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
6
|
-
import {
|
|
5
|
+
import { n } from 'decorator-transforms/runtime';
|
|
7
6
|
import { setComponentTemplate } from '@ember/component';
|
|
8
7
|
|
|
9
8
|
var TEMPLATE = precompileTemplate("{{! IMPORTANT: we removed the newlines before/after the yield to reduce the issues with unexpected whitespaces (see https://github.com/hashicorp/design-system/pull/231#issuecomment-1123502499) }}\n{{! IMPORTANT: we need to add \"squishies\" here (~) because otherwise the whitespace added by Ember becomes visible in the link (being an inline element) - See https://handlebarsjs.com/guide/expressions.html#whitespace-control }}\n{{! NOTICE: we can\'t support the direct use of the \"href\" HTML attribute via ...attributes in the <a> elements, because we need to rely on the \"@href\" Ember argument to differentiate between different types of generated output }}\n{{~#if @route~}}\n {{~#if this.isRouteExternal~}}\n <this.linkToExternal\n @current-when={{@current-when}}\n @models={{hds-link-to-models @model @models}}\n @query={{hds-link-to-query @query}}\n @replace={{@replace}}\n @route={{@route}}\n ...attributes\n >{{yield}}</this.linkToExternal>\n {{~else~}}\n <LinkTo\n @current-when={{@current-when}}\n @models={{hds-link-to-models @model @models}}\n @query={{hds-link-to-query @query}}\n @replace={{@replace}}\n @route={{@route}}\n ...attributes\n >{{yield}}</LinkTo>\n {{~/if~}}\n{{~else if @href~}}\n {{~#if this.isHrefExternal~}}\n <a target=\"_blank\" rel=\"noopener noreferrer\" ...attributes href={{@href}} {{on \"keyup\" this.onKeyUp}}>{{yield}}</a>\n {{~else~}}\n <a ...attributes href={{@href}} {{on \"keyup\" this.onKeyUp}}>{{yield}}</a>\n {{~/if~}}\n{{~else~}}\n <button type=\"button\" ...attributes>{{yield}}</button>\n{{~/if~}}");
|
|
@@ -14,23 +13,26 @@ var TEMPLATE = precompileTemplate("{{! IMPORTANT: we removed the newlines before
|
|
|
14
13
|
*/
|
|
15
14
|
|
|
16
15
|
class HdsInteractive extends Component {
|
|
17
|
-
static
|
|
18
|
-
g(this.prototype, "linkToExternal", [tracked], function () {
|
|
19
|
-
return null;
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
#linkToExternal = (i(this, "linkToExternal"), void 0);
|
|
23
|
-
constructor(owner, args) {
|
|
24
|
-
super(owner, args);
|
|
16
|
+
static linkToExternal = null;
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Determines if a @href value is "external" (it adds target="_blank" rel="noopener noreferrer")
|
|
20
|
+
*
|
|
21
|
+
* @param linkToExternal
|
|
22
|
+
* @type LinkTo | null
|
|
23
|
+
* @default null
|
|
24
|
+
*/
|
|
25
|
+
get linkToExternal() {
|
|
26
|
+
const component = HdsInteractive.linkToExternal;
|
|
27
|
+
if (component === null) {
|
|
28
|
+
assert(`HdsInteractive: You attempted to use an external link without configuring HDS with an external component. Please add this in your app.js file:
|
|
29
|
+
|
|
30
|
+
import { HdsInteractive } from '@hashicorp/design-system-components/components';
|
|
31
|
+
HdsInteractive.linkToExternal = LinkToExternalComponent;`);
|
|
29
32
|
}
|
|
33
|
+
return component;
|
|
30
34
|
}
|
|
31
|
-
|
|
32
|
-
this.linkToExternal = hdsResolveLinkToExternal(this.args.isRouteExternal);
|
|
33
|
-
}
|
|
35
|
+
|
|
34
36
|
/**
|
|
35
37
|
* Determines if a @href value is "external" (it adds target="_blank" rel="noopener noreferrer")
|
|
36
38
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/hds/interactive/index.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/hds/interactive/index.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\n\nimport type { LinkTo } from '@ember/routing';\n\nexport interface HdsInteractiveSignature {\n Args: {\n href?: string;\n isHrefExternal?: boolean;\n isRouteExternal?: boolean;\n // the arguments and types below are mirroring the ones in LinkTo https://github.com/typed-ember/glint/blob/main/packages/environment-ember-loose/-private/intrinsics/link-to.d.ts#L9\n // because they're not exported we're unable to import them directly from glint\n route?: string;\n models?: unknown[];\n model?: unknown;\n query?: Record<string, unknown>;\n 'current-when'?: string | boolean;\n replace?: boolean;\n };\n Blocks: {\n default: [];\n };\n Element: HTMLAnchorElement | HTMLButtonElement;\n}\n\nexport default class HdsInteractive extends Component<HdsInteractiveSignature> {\n static linkToExternal: LinkTo | null = null;\n\n /**\n * Determines if a @href value is \"external\" (it adds target=\"_blank\" rel=\"noopener noreferrer\")\n *\n * @param linkToExternal\n * @type LinkTo | null\n * @default null\n */\n get linkToExternal(): LinkTo | null {\n const component = HdsInteractive.linkToExternal;\n if (component === null) {\n assert(\n `HdsInteractive: You attempted to use an external link without configuring HDS with an external component. Please add this in your app.js file:\n\nimport { HdsInteractive } from '@hashicorp/design-system-components/components';\nHdsInteractive.linkToExternal = LinkToExternalComponent;`\n );\n }\n return component;\n }\n\n /**\n * Determines if a @href value is \"external\" (it adds target=\"_blank\" rel=\"noopener noreferrer\")\n *\n * @param isHrefExternal\n * @type boolean\n * @default true\n */\n get isHrefExternal(): boolean {\n return this.args.isHrefExternal ?? true;\n }\n\n /**\n * Determines if a @route value is \"external\" (uses the LinkToExternal component instead of LinkTo)\n *\n * @param isRouteExternal\n * @type boolean\n * @default false\n */\n get isRouteExternal(): boolean {\n return this.args.isRouteExternal ?? false;\n }\n\n @action\n onKeyUp(event: KeyboardEvent): void {\n if (event.key === ' ' || event.code === 'Space') {\n (event.target as HTMLElement).click();\n }\n }\n}\n"],"names":["HdsInteractive","Component","linkToExternal","component","assert","isHrefExternal","args","isRouteExternal","onKeyUp","event","key","code","target","click","n","prototype","action","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;;AA4Be,MAAMA,cAAc,SAASC,SAAS,CAA0B;EAC7E,OAAOC,cAAc,GAAkB,IAAI;;AAE3C;AACF;AACA;AACA;AACA;AACA;AACA;EACE,IAAIA,cAAcA,GAAkB;AAClC,IAAA,MAAMC,SAAS,GAAGH,cAAc,CAACE,cAAc;IAC/C,IAAIC,SAAS,KAAK,IAAI,EAAE;AACtBC,MAAAA,MAAM,CACJ,CAAA;;AAER;AACA,wDAAA,CACM,CAAC;AACH,IAAA;AACA,IAAA,OAAOD,SAAS;AAClB,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,IAAIE,cAAcA,GAAY;AAC5B,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,cAAc,IAAI,IAAI;AACzC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,IAAIE,eAAeA,GAAY;AAC7B,IAAA,OAAO,IAAI,CAACD,IAAI,CAACC,eAAe,IAAI,KAAK;AAC3C,EAAA;EAGAC,OAAOA,CAACC,KAAoB,EAAQ;IAClC,IAAIA,KAAK,CAACC,GAAG,KAAK,GAAG,IAAID,KAAK,CAACE,IAAI,KAAK,OAAO,EAAE;AAC9CF,MAAAA,KAAK,CAACG,MAAM,CAAiBC,KAAK,EAAE;AACvC,IAAA;AACF,EAAA;AAAC,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,SAAA,EAAA,CALAC,MAAM,CAAA,CAAA;AAAA;AAMT;AAACC,oBAAA,CAAAC,QAAA,EAnDoBlB,cAAc,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashicorp/design-system-components",
|
|
3
|
-
"version": "5.1.1-rc-
|
|
3
|
+
"version": "5.1.1-rc-20251209143536",
|
|
4
4
|
"description": "Helios Design System Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hashicorp",
|
|
@@ -105,7 +105,6 @@
|
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"@ember/string": "^3.1.1 || ^4.0.0",
|
|
107
107
|
"ember-basic-dropdown": "^7.3.0 || ^8.6.1",
|
|
108
|
-
"ember-engines": ">= 0.11.0",
|
|
109
108
|
"ember-intl": "^7.3.0"
|
|
110
109
|
},
|
|
111
110
|
"peerDependenciesMeta": {
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2021, 2025
|
|
3
|
-
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { LinkTo } from '@ember/routing';
|
|
6
|
-
/**
|
|
7
|
-
* Resolves the correct component to use for the `LinkTo`.
|
|
8
|
-
*
|
|
9
|
-
* @param isRouteExternal - If true, will return the `LinkToExternal` component. If `ember-engines` is not installed, an assertion will be thrown.
|
|
10
|
-
* @returns The correct component to use for the `LinkTo`.
|
|
11
|
-
*/
|
|
12
|
-
export declare function hdsResolveLinkToExternal(isRouteExternal?: boolean): typeof LinkTo;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { LinkTo } from '@ember/routing';
|
|
2
|
-
import { assert } from '@ember/debug';
|
|
3
|
-
import { macroCondition, dependencySatisfies, importSync } from '@embroider/macros';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Copyright IBM Corp. 2021, 2025
|
|
7
|
-
* SPDX-License-Identifier: MPL-2.0
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Resolves the correct component to use for the `LinkTo`.
|
|
13
|
-
*
|
|
14
|
-
* @param isRouteExternal - If true, will return the `LinkToExternal` component. If `ember-engines` is not installed, an assertion will be thrown.
|
|
15
|
-
* @returns The correct component to use for the `LinkTo`.
|
|
16
|
-
*/
|
|
17
|
-
function hdsResolveLinkToExternal(isRouteExternal) {
|
|
18
|
-
if (isRouteExternal) {
|
|
19
|
-
if (macroCondition(dependencySatisfies('ember-engines', '*'))) {
|
|
20
|
-
// Use importSync for compile-time conditional import
|
|
21
|
-
const {
|
|
22
|
-
default: module
|
|
23
|
-
} = importSync('ember-engines/components/link-to-external-component');
|
|
24
|
-
return module;
|
|
25
|
-
} else {
|
|
26
|
-
assert(`@isRouteExternal is only available when using the "ember-engines" addon. Please install it to use this feature.`, false);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return LinkTo;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { hdsResolveLinkToExternal };
|
|
33
|
-
//# sourceMappingURL=hds-resolve-link-to-external.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hds-resolve-link-to-external.js","sources":["../../src/utils/hds-resolve-link-to-external.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport { LinkTo } from '@ember/routing';\nimport { assert } from '@ember/debug';\nimport {\n dependencySatisfies,\n macroCondition,\n importSync,\n} from '@embroider/macros';\n\n/**\n * Resolves the correct component to use for the `LinkTo`.\n *\n * @param isRouteExternal - If true, will return the `LinkToExternal` component. If `ember-engines` is not installed, an assertion will be thrown.\n * @returns The correct component to use for the `LinkTo`.\n */\nexport function hdsResolveLinkToExternal(\n isRouteExternal?: boolean\n): typeof LinkTo {\n if (isRouteExternal) {\n if (macroCondition(dependencySatisfies('ember-engines', '*'))) {\n // Use importSync for compile-time conditional import\n const { default: module } = importSync(\n 'ember-engines/components/link-to-external-component'\n ) as { default: typeof LinkTo };\n return module;\n } else {\n assert(\n `@isRouteExternal is only available when using the \"ember-engines\" addon. Please install it to use this feature.`,\n false\n );\n }\n }\n\n return LinkTo;\n}\n"],"names":["hdsResolveLinkToExternal","isRouteExternal","macroCondition","dependencySatisfies","default","module","importSync","assert","LinkTo"],"mappings":";;;;AAAA;AACA;AACA;AACA;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,wBAAwBA,CACtCC,eAAyB,EACV;AACf,EAAA,IAAIA,eAAe,EAAE;IACnB,IAAIC,cAAc,CAACC,mBAAmB,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC,EAAE;AAC7D;MACA,MAAM;AAAEC,QAAAA,OAAO,EAAEC;AAAO,OAAC,GAAGC,UAAU,CACpC,qDACF,CAA+B;AAC/B,MAAA,OAAOD,MAAM;AACf,IAAA,CAAC,MAAM;AACLE,MAAAA,MAAM,CACJ,CAAA,+GAAA,CAAiH,EACjH,KACF,CAAC;AACH,IAAA;AACF,EAAA;AAEA,EAAA,OAAOC,MAAM;AACf;;;;"}
|