@egen-civitas/esm-app-shell 2.11.1 → 3.0.0

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.
Files changed (137) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dependencies.json +0 -1
  3. package/dist/{20657ca044e03c5a.js → 3511cb52421245d2.js} +1 -1
  4. package/dist/{20657ca044e03c5a.js.map → 3511cb52421245d2.js.map} +1 -1
  5. package/dist/6dbcb5941f2df991.css +1 -0
  6. package/dist/6dbcb5941f2df991.css.map +1 -0
  7. package/dist/813eae2000ea36ed.js +1 -0
  8. package/dist/813eae2000ea36ed.js.map +1 -0
  9. package/dist/{e7bbded2c2574aaf.js.map → 9b6e06745c772498.js.map} +1 -1
  10. package/dist/{124ea515e17df9d6.js → 9db69859ba0e2e39.js} +1 -1
  11. package/dist/{124ea515e17df9d6.js.map → 9db69859ba0e2e39.js.map} +1 -1
  12. package/dist/{6e590e5d195a54b4.js → b5df5f2d225330c6.js} +1 -1
  13. package/dist/b5df5f2d225330c6.js.map +1 -0
  14. package/dist/{4f17082326de0924.js → bab5d9d70fb62ab3.js} +1 -1
  15. package/dist/{4f17082326de0924.js.map → bab5d9d70fb62ab3.js.map} +1 -1
  16. package/dist/d1cb238decb53613.js +20 -0
  17. package/dist/d1cb238decb53613.js.map +1 -0
  18. package/dist/{egen.193711b6d6c5fcdf.js → egen.3c5427db0e04799d.js} +3 -3
  19. package/dist/egen.3c5427db0e04799d.js.map +1 -0
  20. package/dist/egen.9d32a525f71496ff.css +1 -0
  21. package/dist/{5ad49928ffd2c870.js → fa413d650533c455.js} +1 -1
  22. package/dist/fa413d650533c455.js.map +1 -0
  23. package/dist/index.html +42 -2
  24. package/package.json +4 -6
  25. package/rspack.config.js +3 -23
  26. package/src/host-incompatible.ts +1 -1
  27. package/src/index.ejs +50 -6
  28. package/src/run.ts +1 -1
  29. package/src/ui/breadcrumbs.tsx +10 -9
  30. package/tools/targets.js +1 -1
  31. package/dist/08aa56bc39f555b0.js +0 -20
  32. package/dist/08aa56bc39f555b0.js.map +0 -1
  33. package/dist/56d16b0a42960c11.css +0 -1
  34. package/dist/56d16b0a42960c11.css.map +0 -1
  35. package/dist/5ad49928ffd2c870.js.map +0 -1
  36. package/dist/5eeaed47d520b54d.js +0 -1
  37. package/dist/5eeaed47d520b54d.js.map +0 -1
  38. package/dist/67c7c33d226f8c4a.css +0 -1
  39. package/dist/67c7c33d226f8c4a.css.map +0 -1
  40. package/dist/6e590e5d195a54b4.js.map +0 -1
  41. package/dist/76aef6b4c07d22a7.js +0 -1
  42. package/dist/76aef6b4c07d22a7.js.map +0 -1
  43. package/dist/dca183c189ecf073.js +0 -1
  44. package/dist/dca183c189ecf073.js.map +0 -1
  45. package/dist/egen.193711b6d6c5fcdf.js.map +0 -1
  46. package/dist/egen.5a4d64708e9ef5e3.css +0 -1
  47. package/dist/fonts/IBMPlexMono-Italic-Cyrillic.woff2 +0 -0
  48. package/dist/fonts/IBMPlexMono-Italic-Latin1.woff2 +0 -0
  49. package/dist/fonts/IBMPlexMono-Italic-Latin2.woff2 +0 -0
  50. package/dist/fonts/IBMPlexMono-Italic-Latin3.woff2 +0 -0
  51. package/dist/fonts/IBMPlexMono-Italic-Pi.woff2 +0 -0
  52. package/dist/fonts/IBMPlexMono-Light-Cyrillic.woff2 +0 -0
  53. package/dist/fonts/IBMPlexMono-Light-Latin1.woff2 +0 -0
  54. package/dist/fonts/IBMPlexMono-Light-Latin2.woff2 +0 -0
  55. package/dist/fonts/IBMPlexMono-Light-Latin3.woff2 +0 -0
  56. package/dist/fonts/IBMPlexMono-Light-Pi.woff2 +0 -0
  57. package/dist/fonts/IBMPlexMono-LightItalic-Cyrillic.woff2 +0 -0
  58. package/dist/fonts/IBMPlexMono-LightItalic-Latin1.woff2 +0 -0
  59. package/dist/fonts/IBMPlexMono-LightItalic-Latin2.woff2 +0 -0
  60. package/dist/fonts/IBMPlexMono-LightItalic-Latin3.woff2 +0 -0
  61. package/dist/fonts/IBMPlexMono-LightItalic-Pi.woff2 +0 -0
  62. package/dist/fonts/IBMPlexMono-Regular-Cyrillic.woff2 +0 -0
  63. package/dist/fonts/IBMPlexMono-Regular-Latin1.woff2 +0 -0
  64. package/dist/fonts/IBMPlexMono-Regular-Latin2.woff2 +0 -0
  65. package/dist/fonts/IBMPlexMono-Regular-Latin3.woff2 +0 -0
  66. package/dist/fonts/IBMPlexMono-Regular-Pi.woff2 +0 -0
  67. package/dist/fonts/IBMPlexMono-SemiBold-Cyrillic.woff2 +0 -0
  68. package/dist/fonts/IBMPlexMono-SemiBold-Latin1.woff2 +0 -0
  69. package/dist/fonts/IBMPlexMono-SemiBold-Latin2.woff2 +0 -0
  70. package/dist/fonts/IBMPlexMono-SemiBold-Latin3.woff2 +0 -0
  71. package/dist/fonts/IBMPlexMono-SemiBold-Pi.woff2 +0 -0
  72. package/dist/fonts/IBMPlexMono-SemiBoldItalic-Cyrillic.woff2 +0 -0
  73. package/dist/fonts/IBMPlexMono-SemiBoldItalic-Latin1.woff2 +0 -0
  74. package/dist/fonts/IBMPlexMono-SemiBoldItalic-Latin2.woff2 +0 -0
  75. package/dist/fonts/IBMPlexMono-SemiBoldItalic-Latin3.woff2 +0 -0
  76. package/dist/fonts/IBMPlexMono-SemiBoldItalic-Pi.woff2 +0 -0
  77. package/dist/fonts/IBMPlexSans-Italic-Cyrillic.woff2 +0 -0
  78. package/dist/fonts/IBMPlexSans-Italic-Latin1.woff2 +0 -0
  79. package/dist/fonts/IBMPlexSans-Italic-Latin2.woff2 +0 -0
  80. package/dist/fonts/IBMPlexSans-Italic-Latin3.woff2 +0 -0
  81. package/dist/fonts/IBMPlexSans-Italic-Pi.woff2 +0 -0
  82. package/dist/fonts/IBMPlexSans-Light-Cyrillic.woff2 +0 -0
  83. package/dist/fonts/IBMPlexSans-Light-Latin1.woff2 +0 -0
  84. package/dist/fonts/IBMPlexSans-Light-Latin2.woff2 +0 -0
  85. package/dist/fonts/IBMPlexSans-Light-Latin3.woff2 +0 -0
  86. package/dist/fonts/IBMPlexSans-Light-Pi.woff2 +0 -0
  87. package/dist/fonts/IBMPlexSans-LightItalic-Cyrillic.woff2 +0 -0
  88. package/dist/fonts/IBMPlexSans-LightItalic-Latin1.woff2 +0 -0
  89. package/dist/fonts/IBMPlexSans-LightItalic-Latin2.woff2 +0 -0
  90. package/dist/fonts/IBMPlexSans-LightItalic-Latin3.woff2 +0 -0
  91. package/dist/fonts/IBMPlexSans-LightItalic-Pi.woff2 +0 -0
  92. package/dist/fonts/IBMPlexSans-Regular-Cyrillic.woff2 +0 -0
  93. package/dist/fonts/IBMPlexSans-Regular-Latin1.woff2 +0 -0
  94. package/dist/fonts/IBMPlexSans-Regular-Latin2.woff2 +0 -0
  95. package/dist/fonts/IBMPlexSans-Regular-Latin3.woff2 +0 -0
  96. package/dist/fonts/IBMPlexSans-Regular-Pi.woff2 +0 -0
  97. package/dist/fonts/IBMPlexSans-SemiBold-Cyrillic.woff2 +0 -0
  98. package/dist/fonts/IBMPlexSans-SemiBold-Latin1.woff2 +0 -0
  99. package/dist/fonts/IBMPlexSans-SemiBold-Latin2.woff2 +0 -0
  100. package/dist/fonts/IBMPlexSans-SemiBold-Latin3.woff2 +0 -0
  101. package/dist/fonts/IBMPlexSans-SemiBold-Pi.woff2 +0 -0
  102. package/dist/fonts/IBMPlexSans-SemiBoldItalic-Cyrillic.woff2 +0 -0
  103. package/dist/fonts/IBMPlexSans-SemiBoldItalic-Latin1.woff2 +0 -0
  104. package/dist/fonts/IBMPlexSans-SemiBoldItalic-Latin2.woff2 +0 -0
  105. package/dist/fonts/IBMPlexSans-SemiBoldItalic-Latin3.woff2 +0 -0
  106. package/dist/fonts/IBMPlexSans-SemiBoldItalic-Pi.woff2 +0 -0
  107. package/dist/fonts/IBMPlexSerif-Italic-Cyrillic.woff2 +0 -0
  108. package/dist/fonts/IBMPlexSerif-Italic-Latin1.woff2 +0 -0
  109. package/dist/fonts/IBMPlexSerif-Italic-Latin2.woff2 +0 -0
  110. package/dist/fonts/IBMPlexSerif-Italic-Latin3.woff2 +0 -0
  111. package/dist/fonts/IBMPlexSerif-Italic-Pi.woff2 +0 -0
  112. package/dist/fonts/IBMPlexSerif-Light-Cyrillic.woff2 +0 -0
  113. package/dist/fonts/IBMPlexSerif-Light-Latin1.woff2 +0 -0
  114. package/dist/fonts/IBMPlexSerif-Light-Latin2.woff2 +0 -0
  115. package/dist/fonts/IBMPlexSerif-Light-Latin3.woff2 +0 -0
  116. package/dist/fonts/IBMPlexSerif-Light-Pi.woff2 +0 -0
  117. package/dist/fonts/IBMPlexSerif-LightItalic-Cyrillic.woff2 +0 -0
  118. package/dist/fonts/IBMPlexSerif-LightItalic-Latin1.woff2 +0 -0
  119. package/dist/fonts/IBMPlexSerif-LightItalic-Latin2.woff2 +0 -0
  120. package/dist/fonts/IBMPlexSerif-LightItalic-Latin3.woff2 +0 -0
  121. package/dist/fonts/IBMPlexSerif-LightItalic-Pi.woff2 +0 -0
  122. package/dist/fonts/IBMPlexSerif-Regular-Cyrillic.woff2 +0 -0
  123. package/dist/fonts/IBMPlexSerif-Regular-Latin1.woff2 +0 -0
  124. package/dist/fonts/IBMPlexSerif-Regular-Latin2.woff2 +0 -0
  125. package/dist/fonts/IBMPlexSerif-Regular-Latin3.woff2 +0 -0
  126. package/dist/fonts/IBMPlexSerif-Regular-Pi.woff2 +0 -0
  127. package/dist/fonts/IBMPlexSerif-SemiBold-Cyrillic.woff2 +0 -0
  128. package/dist/fonts/IBMPlexSerif-SemiBold-Latin1.woff2 +0 -0
  129. package/dist/fonts/IBMPlexSerif-SemiBold-Latin2.woff2 +0 -0
  130. package/dist/fonts/IBMPlexSerif-SemiBold-Latin3.woff2 +0 -0
  131. package/dist/fonts/IBMPlexSerif-SemiBold-Pi.woff2 +0 -0
  132. package/dist/fonts/IBMPlexSerif-SemiBoldItalic-Cyrillic.woff2 +0 -0
  133. package/dist/fonts/IBMPlexSerif-SemiBoldItalic-Latin1.woff2 +0 -0
  134. package/dist/fonts/IBMPlexSerif-SemiBoldItalic-Latin2.woff2 +0 -0
  135. package/dist/fonts/IBMPlexSerif-SemiBoldItalic-Latin3.woff2 +0 -0
  136. package/dist/fonts/IBMPlexSerif-SemiBoldItalic-Pi.woff2 +0 -0
  137. /package/dist/{e7bbded2c2574aaf.js → 9b6e06745c772498.js} +0 -0
package/rspack.config.js CHANGED
@@ -22,7 +22,6 @@ try {
22
22
 
23
23
 
24
24
  const { mkdirSync, readdirSync, statSync, readFileSync, writeFileSync } = require('node:fs');
25
- const sass = require('sass-embedded');
26
25
  const semver = require('semver');
27
26
  const { removeTrailingSlash, getTimestamp } = require('./tools/helpers');
28
27
  const { resolveTarget, targetWindowBridge } = require('./tools/targets');
@@ -344,15 +343,9 @@ module.exports = (env, argv = []) => {
344
343
 
345
344
  const assetsPatterns = egenJsCssAssets.map((asset) => ({ from: asset, to: 'assets' }));
346
345
 
347
- // Compile the styleguide SCSS to CSS outside of rspack so it's a pure static file
348
- // with no JS involvement. The result is content-hashed for long-term caching.
349
- // Sass preserves @import of .css files as plain CSS @import rules rather than
350
- // inlining them, so we strip those out and prepend the actual file contents.
351
- const sassOutput = sass.compile(require.resolve('@egen-civitas/esm-styleguide/styles'), {
352
- style: isProd ? 'compressed' : 'expanded',
353
- quietDeps: true,
354
- loadPaths: [resolve(__dirname, '..', '..', '..', 'node_modules')],
355
- }).css;
346
+ // La feuille globale du styleguide est du CSS standard (plus de préprocesseur) : on la lit telle quelle, hors rspack,
347
+ // pour qu'elle reste un fichier statique sans JS, haché par contenu pour le cache long terme.
348
+ const sassOutput = readFileSync(require.resolve('@egen-civitas/esm-styleguide/styles'), 'utf-8');
356
349
 
357
350
  const cssImportRegex = /@import\s*["']([^"']+)["']\s*;?\n?/g;
358
351
  const inlinedImports = [];
@@ -528,19 +521,6 @@ module.exports = (env, argv = []) => {
528
521
  { loader: require.resolve('css-loader') },
529
522
  ],
530
523
  },
531
- {
532
- test: /\.s[ac]ss$/,
533
- use: [
534
- isProd
535
- ? { loader: require.resolve(CssExtractRspackPlugin.loader) }
536
- : { loader: require.resolve('style-loader') },
537
- { loader: require.resolve('css-loader') },
538
- {
539
- loader: require.resolve('sass-loader'),
540
- options: { sassOptions: { quietDeps: true } },
541
- },
542
- ],
543
- },
544
524
  {
545
525
  test: /\.(woff|woff2|png)?$/,
546
526
  type: 'asset/resource',
@@ -46,7 +46,7 @@ export function renderHostIncompatibleScreen(error: unknown, doc: Document = doc
46
46
  detail.className = 'egen-host-incompatible__detail';
47
47
  detail.textContent = error instanceof Error ? error.message : '';
48
48
  const button = doc.createElement('button');
49
- button.className = 'cds--btn cds--btn--primary';
49
+ button.className = 'egen-btn egen-btn--primary';
50
50
  button.type = 'button';
51
51
  button.textContent = t.reload;
52
52
  button.addEventListener('click', () => location.reload());
package/src/index.ejs CHANGED
@@ -85,6 +85,50 @@
85
85
  <% if (egenCoreRoutes) { %>
86
86
  <script type="egen-routes"><%= egenCoreRoutes %></script>
87
87
  <% } %>
88
+ <!-- Fond et centrage des modales (showModal). CSS simple : la fenêtre elle-même est stylée en ligne par esm-styleguide. -->
89
+ <style>
90
+ .egen-modals-container {
91
+ position: fixed;
92
+ top: 0;
93
+ left: 0;
94
+ width: 100vw;
95
+ height: 100vh;
96
+ z-index: 9001;
97
+ display: flex;
98
+ align-items: center;
99
+ justify-content: center;
100
+ background-color: rgba(0, 0, 0, 0.5);
101
+ visibility: hidden;
102
+ }
103
+ /* Page d'erreur de l'application (modèle #app-error) : CSS simple, sans dépendance à une bibliothèque de composants. */
104
+ .egen-btn {
105
+ display: inline-flex;
106
+ align-items: center;
107
+ min-height: 2.5rem;
108
+ padding: 0 1rem;
109
+ border: 1px solid transparent;
110
+ border-radius: 0.375rem;
111
+ background: #e5e7eb;
112
+ color: #111827;
113
+ font: inherit;
114
+ cursor: pointer;
115
+ }
116
+ .egen-btn:hover { filter: brightness(0.95); }
117
+ .egen-btn--primary { background: #0f62fe; color: #fff; }
118
+ .egen-snippet {
119
+ position: relative;
120
+ max-width: 48rem;
121
+ margin-top: 1rem;
122
+ background: #f4f4f4;
123
+ border-radius: 0.375rem;
124
+ }
125
+ .egen-snippet-container { overflow: auto; padding: 0.75rem 3rem 0.75rem 1rem; font-family: ui-monospace, monospace; font-size: 0.8125rem; }
126
+ .egen-snippet-container pre { margin: 0; white-space: pre-wrap; }
127
+ .egen-copy-btn { position: absolute; top: 0; right: 0; width: 2.5rem; height: 2.5rem; border: 0; background: transparent; cursor: pointer; }
128
+ .egen-copy-btn:hover { background: rgba(0, 0, 0, 0.08); }
129
+ .egen-copy-btn__feedback, .egen-assistive-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
130
+ .egen-snippet__icon { fill: currentColor; }
131
+ </style>
88
132
  </head>
89
133
  <body>
90
134
  <%= htmlWebpackPlugin.tags.bodyTags %>
@@ -127,18 +171,18 @@
127
171
  <p>Something went wrong. Please try reloading.</p>
128
172
  <p>Contact your system administrator if the problem persists.</p>
129
173
  <div id="buttons">
130
- <button class="cds--btn cds--btn--primary" <% if (!egenBootstrap) { %>onclick="location.reload()"<% } else { %>data-egen-action="reload"<% } %>>Reload</button>
174
+ <button class="egen-btn egen-btn--primary" <% if (!egenBootstrap) { %>onclick="location.reload()"<% } else { %>data-egen-action="reload"<% } %>>Reload</button>
131
175
  </div>
132
- <div class="cds--snippet cds--snippet--single" >
133
- <div tabindex="0" class="cds--snippet-container"
176
+ <div class="egen-snippet" >
177
+ <div tabindex="0" class="egen-snippet-container"
134
178
  aria-label="Code Snippet Text">
135
179
  <pre>
136
180
  <code data-var="message"></code>
137
181
  </pre>
138
182
  </div>
139
- <button data-copy-btn class="cds--copy-btn" type="button" tabindex="0" <% if (!egenBootstrap) { %>onclick="copyText(this.parentElement)"<% } else { %>data-egen-action="copy"<% } %>>
140
- <span class="cds--assistive-text cds--copy-btn__feedback">Copied!</span>
141
- <svg focusable="false" preserveAspectRatio="xMidYMid meet" style="will-change: transform;" xmlns="http://www.w3.org/2000/svg" class="cds--snippet__icon" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M14,5v9H5V5h9m0-1H5A1,1,0,0,0,4,5v9a1,1,0,0,0,1,1h9a1,1,0,0,0,1-1V5a1,1,0,0,0-1-1Z"></path><path d="M2,9H1V2A1,1,0,0,1,2,1H9V2H2Z"></path></svg>
183
+ <button data-copy-btn class="egen-copy-btn" type="button" tabindex="0" <% if (!egenBootstrap) { %>onclick="copyText(this.parentElement)"<% } else { %>data-egen-action="copy"<% } %>>
184
+ <span class="egen-assistive-text egen-copy-btn__feedback">Copied!</span>
185
+ <svg focusable="false" preserveAspectRatio="xMidYMid meet" style="will-change: transform;" xmlns="http://www.w3.org/2000/svg" class="egen-snippet__icon" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M14,5v9H5V5h9m0-1H5A1,1,0,0,0,4,5v9a1,1,0,0,0,1,1h9a1,1,0,0,0,1-1V5a1,1,0,0,0-1-1Z"></path><path d="M2,9H1V2A1,1,0,0,1,2,1H9V2H2Z"></path></svg>
142
186
  </button>
143
187
  </div>
144
188
  </div>
package/src/run.ts CHANGED
@@ -226,7 +226,7 @@ function renderFatalErrorPage(e?: Error) {
226
226
  const appErrorActionButtons = fragment?.querySelector('#buttons');
227
227
  if (appErrorActionButtons) {
228
228
  const clearDevOverridesButton = document.createElement('button');
229
- clearDevOverridesButton.className = 'cds--btn';
229
+ clearDevOverridesButton.className = 'egen-btn';
230
230
  clearDevOverridesButton.innerHTML = 'Clear dev overrides';
231
231
  clearDevOverridesButton.onclick = clearDevOverrides;
232
232
  appErrorActionButtons.appendChild(clearDevOverridesButton);
@@ -1,7 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { Breadcrumb, BreadcrumbItem, InlineLoading } from '@carbon/react';
3
2
  import type { BreadcrumbRegistration } from '@egen-civitas/esm-framework';
4
- import { getBreadcrumbsFor, ConfigurableLink } from '@egen-civitas/esm-framework';
3
+ import { getBreadcrumbsFor, ConfigurableLink, InlineLoading } from '@egen-civitas/esm-framework';
5
4
 
6
5
  function getPath(path: string, params: Array<string>) {
7
6
  const parts = [...params];
@@ -44,11 +43,11 @@ export const CustomBreadcrumbItem: React.FC<CustomBreadcrumbItemProps> = ({ brea
44
43
  }, [breadcrumbRegistration, params]);
45
44
 
46
45
  return (
47
- <BreadcrumbItem key={breadcrumbRegistration.settings.path}>
46
+ <li key={breadcrumbRegistration.settings.path} className="egen-breadcrumb-item">
48
47
  <ConfigurableLink to={getPath(breadcrumbRegistration.settings.path, params)}>
49
48
  {title ? title : <InlineLoading />}
50
49
  </ConfigurableLink>
51
- </BreadcrumbItem>
50
+ </li>
52
51
  );
53
52
  };
54
53
 
@@ -75,11 +74,13 @@ export const Breadcrumbs: React.FC = () => {
75
74
  }
76
75
 
77
76
  return (
78
- <Breadcrumb className="breadcrumbs-container">
79
- {breadcrumbs.map((bc, index) => (
80
- <CustomBreadcrumbItem key={`breadcrumb-item-${index}`} breadcrumbRegistration={bc} params={params} />
81
- ))}
82
- </Breadcrumb>
77
+ <nav aria-label="Breadcrumb" className="breadcrumbs-container">
78
+ <ol className="egen-breadcrumb">
79
+ {breadcrumbs.map((bc, index) => (
80
+ <CustomBreadcrumbItem key={`breadcrumb-item-${index}`} breadcrumbRegistration={bc} params={params} />
81
+ ))}
82
+ </ol>
83
+ </nav>
83
84
  );
84
85
  };
85
86
 
package/tools/targets.js CHANGED
@@ -25,7 +25,7 @@ const WEB_DEFAULT_PUBLIC_PATH = '/egen-civitas/spa';
25
25
 
26
26
  /**
27
27
  * CSP de départ de la cible native (proposition à valider sur appareil, cf. tâche B5).
28
- * Les styles `'unsafe-inline'` sont à réexaminer (Carbon / injection de styles). `'unsafe-eval'` est interdit.
28
+ * Les styles `'unsafe-inline'` sont à réexaminer (injection de styles). `'unsafe-eval'` est interdit.
29
29
  *
30
30
  * @param {string} apiOrigin Origine de l'API (`https://api.exemple.ga`), déjà validée.
31
31
  * @returns {string}