@hashicorp/design-system-components 5.0.0-rc-20251017103721 → 5.0.0-rc-20251017112620

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/addon-main.cjs CHANGED
@@ -4,14 +4,20 @@
4
4
  */
5
5
 
6
6
  const { addonV1Shim } = require('@embroider/addon-shim');
7
+ const flightIconSprite = require('@hashicorp/flight-icons/svg-sprite/svg-sprite-module');
7
8
 
8
9
  module.exports = {
9
10
  ...addonV1Shim(__dirname),
10
- options: {
11
- '@embroider/macros': {
12
- setOwnConfig: {
13
- flightIconsSpriteLazyEmbed: true,
14
- },
15
- },
11
+
12
+ contentFor(type, config) {
13
+ if (
14
+ !config.flightIconsSpriteLazyEmbed &&
15
+ !config.__flightIconsSpriteLoaded &&
16
+ type === 'body-footer'
17
+ ) {
18
+ config.__flightIconsSpriteLoaded = true;
19
+
20
+ return flightIconSprite;
21
+ }
16
22
  },
17
23
  };
@@ -2,7 +2,8 @@
2
2
  * Copyright (c) HashiCorp, Inc.
3
3
  * SPDX-License-Identifier: MPL-2.0
4
4
  */
5
- export declare function initialize(): Promise<void>;
5
+ import type ApplicationInstance from '@ember/application/instance';
6
+ export declare function initialize(appInstance: ApplicationInstance): Promise<void>;
6
7
  declare const _default: {
7
8
  initialize: typeof initialize;
8
9
  };
@@ -1,12 +1,13 @@
1
- import { macroCondition, getOwnConfig, isTesting } from '@embroider/macros';
1
+ import { macroCondition, isTesting } from '@embroider/macros';
2
2
 
3
3
  /**
4
4
  * Copyright (c) HashiCorp, Inc.
5
5
  * SPDX-License-Identifier: MPL-2.0
6
6
  */
7
7
 
8
- async function initialize() {
9
- if (macroCondition(getOwnConfig().flightIconsSpriteLazyEmbed)) {
8
+ async function initialize(appInstance) {
9
+ const config = appInstance.resolveRegistration('config:environment');
10
+ if (config.flightIconsSpriteLazyEmbed) {
10
11
  const {
11
12
  default: svgSprite
12
13
  } = await import('@hashicorp/flight-icons/svg-sprite/svg-sprite-module');
@@ -1 +1 @@
1
- {"version":3,"file":"load-sprite.js","sources":["../../src/instance-initializers/load-sprite.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport { macroCondition, isTesting, getOwnConfig } from '@embroider/macros';\n\ninterface Config {\n flightIconsSpriteLazyEmbed: boolean;\n}\n\nexport async function initialize() {\n if (macroCondition(getOwnConfig<Config>().flightIconsSpriteLazyEmbed)) {\n const { default: svgSprite } = await import(\n '@hashicorp/flight-icons/svg-sprite/svg-sprite-module'\n );\n\n // in test environments we can inject the sprite directly into the ember testing container\n // to avoid issues with tools like Percy that only consider content inside that element\n if (macroCondition(isTesting())) {\n const container = window.document?.getElementById('ember-testing');\n\n if (container && !container.querySelector('.flight-sprite-container')) {\n container.insertAdjacentHTML('afterbegin', svgSprite);\n }\n } else {\n const container = window.document?.body;\n\n if (container && !container.querySelector('.flight-sprite-container')) {\n container.insertAdjacentHTML('beforeend', svgSprite);\n }\n }\n }\n}\n\nexport default {\n initialize,\n};\n"],"names":["initialize","macroCondition","getOwnConfig","flightIconsSpriteLazyEmbed","default","svgSprite","isTesting","container","window","document","getElementById","querySelector","insertAdjacentHTML","body"],"mappings":";;AAAA;AACA;AACA;AACA;;AAQO,eAAeA,UAAUA,GAAG;EACjC,IAAIC,cAAc,CAACC,YAAY,EAAU,CAACC,0BAA0B,CAAC,EAAE;IACrE,MAAM;AAAEC,MAAAA,OAAO,EAAEC;AAAU,KAAC,GAAG,MAAM,OACnC,sDACF,CAAC;;AAED;AACA;AACA,IAAA,IAAIJ,cAAc,CAACK,SAAS,EAAE,CAAC,EAAE;MAC/B,MAAMC,SAAS,GAAGC,MAAM,CAACC,QAAQ,EAAEC,cAAc,CAAC,eAAe,CAAC;MAElE,IAAIH,SAAS,IAAI,CAACA,SAAS,CAACI,aAAa,CAAC,0BAA0B,CAAC,EAAE;AACrEJ,QAAAA,SAAS,CAACK,kBAAkB,CAAC,YAAY,EAAEP,SAAS,CAAC;AACvD,MAAA;AACF,IAAA,CAAC,MAAM;AACL,MAAA,MAAME,SAAS,GAAGC,MAAM,CAACC,QAAQ,EAAEI,IAAI;MAEvC,IAAIN,SAAS,IAAI,CAACA,SAAS,CAACI,aAAa,CAAC,0BAA0B,CAAC,EAAE;AACrEJ,QAAAA,SAAS,CAACK,kBAAkB,CAAC,WAAW,EAAEP,SAAS,CAAC;AACtD,MAAA;AACF,IAAA;AACF,EAAA;AACF;AAEA,iBAAe;AACbL,EAAAA;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"load-sprite.js","sources":["../../src/instance-initializers/load-sprite.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport { macroCondition, isTesting } from '@embroider/macros';\n\nimport type ApplicationInstance from '@ember/application/instance';\n\ninterface Config {\n flightIconsSpriteLazyEmbed?: boolean;\n}\n\nexport async function initialize(appInstance: ApplicationInstance) {\n const config = appInstance.resolveRegistration(\n 'config:environment'\n ) as Config;\n\n if (config.flightIconsSpriteLazyEmbed) {\n const { default: svgSprite } = await import(\n '@hashicorp/flight-icons/svg-sprite/svg-sprite-module'\n );\n\n // in test environments we can inject the sprite directly into the ember testing container\n // to avoid issues with tools like Percy that only consider content inside that element\n if (macroCondition(isTesting())) {\n const container = window.document?.getElementById('ember-testing');\n\n if (container && !container.querySelector('.flight-sprite-container')) {\n container.insertAdjacentHTML('afterbegin', svgSprite);\n }\n } else {\n const container = window.document?.body;\n\n if (container && !container.querySelector('.flight-sprite-container')) {\n container.insertAdjacentHTML('beforeend', svgSprite);\n }\n }\n }\n}\n\nexport default {\n initialize,\n};\n"],"names":["initialize","appInstance","config","resolveRegistration","flightIconsSpriteLazyEmbed","default","svgSprite","macroCondition","isTesting","container","window","document","getElementById","querySelector","insertAdjacentHTML","body"],"mappings":";;AAAA;AACA;AACA;AACA;;AAUO,eAAeA,UAAUA,CAACC,WAAgC,EAAE;AACjE,EAAA,MAAMC,MAAM,GAAGD,WAAW,CAACE,mBAAmB,CAC5C,oBACF,CAAW;EAEX,IAAID,MAAM,CAACE,0BAA0B,EAAE;IACrC,MAAM;AAAEC,MAAAA,OAAO,EAAEC;AAAU,KAAC,GAAG,MAAM,OACnC,sDACF,CAAC;;AAED;AACA;AACA,IAAA,IAAIC,cAAc,CAACC,SAAS,EAAE,CAAC,EAAE;MAC/B,MAAMC,SAAS,GAAGC,MAAM,CAACC,QAAQ,EAAEC,cAAc,CAAC,eAAe,CAAC;MAElE,IAAIH,SAAS,IAAI,CAACA,SAAS,CAACI,aAAa,CAAC,0BAA0B,CAAC,EAAE;AACrEJ,QAAAA,SAAS,CAACK,kBAAkB,CAAC,YAAY,EAAER,SAAS,CAAC;AACvD,MAAA;AACF,IAAA,CAAC,MAAM;AACL,MAAA,MAAMG,SAAS,GAAGC,MAAM,CAACC,QAAQ,EAAEI,IAAI;MAEvC,IAAIN,SAAS,IAAI,CAACA,SAAS,CAACI,aAAa,CAAC,0BAA0B,CAAC,EAAE;AACrEJ,QAAAA,SAAS,CAACK,kBAAkB,CAAC,WAAW,EAAER,SAAS,CAAC;AACtD,MAAA;AACF,IAAA;AACF,EAAA;AACF;AAEA,iBAAe;AACbN,EAAAA;AACF,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/design-system-components",
3
- "version": "5.0.0-rc-20251017103721",
3
+ "version": "5.0.0-rc-20251017112620",
4
4
  "description": "Helios Design System Components",
5
5
  "keywords": [
6
6
  "hashicorp",
@@ -36,7 +36,7 @@
36
36
  "@embroider/util": "^1.13.4",
37
37
  "@floating-ui/dom": "^1.6.12",
38
38
  "@hashicorp/design-system-tokens": "^3.0.0",
39
- "@hashicorp/flight-icons": "4.0.0-rc-20251017103721",
39
+ "@hashicorp/flight-icons": "4.0.0-rc-20251017112620",
40
40
  "@lezer/highlight": "^1.2.1",
41
41
  "@nullvoxpopuli/ember-composable-helpers": "^5.2.11",
42
42
  "clipboard-polyfill": "^4.1.1",