@egen-civitas/esm-nextjs-utils 0.0.0-stage → 0.3.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.
- package/CHANGELOG.md +26 -0
- package/README.md +83 -2
- package/dist/client.d.ts +38 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +189 -0
- package/dist/host.d.ts +37 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +253 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/navigation-sync.test.js +931 -0
- package/dist/navigation.d.ts +51 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +153 -0
- package/dist/navigation.test.js +101 -0
- package/dist/nextjs-utils.test.js +956 -0
- package/dist/protocol.d.ts +79 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +83 -0
- package/package.json +84 -3
- package/src/client.ts +108 -0
- package/src/host.ts +215 -0
- package/src/index.ts +3 -0
- package/src/navigation.ts +163 -0
- package/src/protocol.ts +82 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @egen-civitas/esm-nextjs-utils
|
|
2
|
+
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3f171d9: Navigation partagée Shell ↔ application embarquée (protocole 1.1, additif) : l'URL du Core reflète la page courante de l'app (actualisation, retour/avance, partage).
|
|
8
|
+
|
|
9
|
+
- Hôte : option `navigation` de `getEmbedLifecycle` (`route`, `mode` `history` | `hash` | `none`, `sensitiveParams`, `pathMap`, `onTitle`) ; messages `hello`, `location`, `goto`.
|
|
10
|
+
- Client : `reportLocation()` et `onGoto()`.
|
|
11
|
+
- Script injectable sans dépendance `assets/egen-bridge.js` (export `@egen-civitas/esm-nextjs-utils/egen-bridge.js`).
|
|
12
|
+
- Fonctions pures exportées (`normalizeAppPath`, `stripSensitive`, `coreSubpath`, `buildCoreUrl`, `buildEmbedSrc`…). Paramètres sensibles jamais recopiés dans l'URL du Core.
|
|
13
|
+
- Sans l'option `navigation`, comportement inchangé.
|
|
14
|
+
|
|
15
|
+
## 0.2.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 0371cd7: Nouveau paquet `esm-nextjs-utils` : intégration d'applications autonomes (Next.js, SSR, routeur propre) par iframe et pont `postMessage` sécurisé. `getEmbedLifecycle` / `getSyncLifecycle` côté Shell (langue, session filtrée sans `sessionId`, navigation limitée aux chemins internes, hauteur, titre) ; `createEgenBridge` (entrée `/client`) côté application embarquée. Origines explicites obligatoires, jamais « * ».
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [d9b2c40]
|
|
24
|
+
- Updated dependencies [f71c7f8]
|
|
25
|
+
- @egen-civitas/esm-globals@2.5.0
|
|
26
|
+
- @egen-civitas/esm-integration-utils@0.2.0
|
package/README.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @egen-civitas/esm-nextjs-utils
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Intégration à EGEN d'une **application autonome** (Next.js, rendu serveur, routeur propre) affichée dans une **iframe** reliée au Shell par un pont `postMessage` sécurisé. Fonctionne avec n'importe quelle application web ; pensé pour Next.js.
|
|
4
|
+
|
|
5
|
+
## Pourquoi une iframe
|
|
6
|
+
|
|
7
|
+
Next.js possède son routeur, son rendu serveur et son compilateur. Le plugin Module Federation de Next (`@module-federation/nextjs-mf` 8.9) ne couvre que Next 12 à 15, alors que Next courant est la 16 : produire un conteneur Module Federation à partir du compilateur Next n'est donc pas une base fiable. L'iframe garde l'application intacte (SSR compris) et ne dépend pas de ses internes.
|
|
8
|
+
|
|
9
|
+
Ce que l'on perd : pas de partage de contexte React, de dépendances ni de styles avec le Shell ; tout passe par le pont.
|
|
10
|
+
|
|
11
|
+
## Côté Shell (le `routes.json` et l'export)
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
// src/start.ts de l'app « enveloppe » (peut être minuscule)
|
|
15
|
+
import { getSyncLifecycle } from '@egen-civitas/esm-nextjs-utils';
|
|
16
|
+
|
|
17
|
+
export const root = getSyncLifecycle({
|
|
18
|
+
moduleName: '@acme/esm-mon-next', // = name du package.json
|
|
19
|
+
featureName: 'mon-next',
|
|
20
|
+
url: 'https://next.exemple.org/app', // origine autorisée = origine de l'URL
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
`routes.json` : `{ "pages": [{ "component": "root", "routeRegex": "^mon-next(/.*)?$" }] }`.
|
|
24
|
+
|
|
25
|
+
Options : `allowedOrigin`, `sessionFields` (défaut : `authenticated, locale, allowedLocales, user.uuid, user.display, user.username` ; **jamais** `sessionId`), `sandbox`, `title`, `minHeight`, `onNavigate`.
|
|
26
|
+
|
|
27
|
+
## Côté application embarquée (Next.js)
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
'use client';
|
|
31
|
+
import { useEffect, useState } from 'react';
|
|
32
|
+
import { createEgenBridge, type EgenBridge } from '@egen-civitas/esm-nextjs-utils/client';
|
|
33
|
+
|
|
34
|
+
export function useEgen() {
|
|
35
|
+
const [state, setState] = useState<any>({});
|
|
36
|
+
const [bridge, setBridge] = useState<EgenBridge>();
|
|
37
|
+
useEffect(() => { // navigateur uniquement, jamais pendant le rendu serveur
|
|
38
|
+
const b = createEgenBridge({
|
|
39
|
+
moduleName: '@acme/esm-mon-next',
|
|
40
|
+
allowedHostOrigins: ['https://shell.exemple.org'],
|
|
41
|
+
});
|
|
42
|
+
const off = b.subscribe(setState);
|
|
43
|
+
const stopResize = b.autoResize();
|
|
44
|
+
setBridge(b);
|
|
45
|
+
return () => { off(); stopResize(); b.destroy(); };
|
|
46
|
+
}, []);
|
|
47
|
+
return { ...state, bridge }; // locale, session, spaBase ; bridge.navigate('/accueil')
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Protocole (v1)
|
|
52
|
+
|
|
53
|
+
Enveloppe `{ egen: 1, moduleName, message }`.
|
|
54
|
+
Shell → app : `init { moduleName, locale, spaBase, session? }`, `session`, `locale`.
|
|
55
|
+
App → Shell : `ready`, `navigate { to }`, `resize { height }`, `title { title }`.
|
|
56
|
+
|
|
57
|
+
## Sécurité
|
|
58
|
+
|
|
59
|
+
- Un message n'est traité que s'il vient **de l'iframe elle-même ET de l'origine autorisée** (côté app : de `window.parent` ET d'une origine listée). Aucune origine `*` acceptée ; envoi toujours avec une origine cible explicite.
|
|
60
|
+
- Navigation demandée par l'app : **chemins internes uniquement** (`/x`) ; `//hôte`, URL absolues et `javascript:` sont ignorés.
|
|
61
|
+
- `sessionId` n'est jamais transmis ; la session est filtrée par liste blanche.
|
|
62
|
+
- Iframe `sandbox` par défaut (`allow-scripts allow-same-origin allow-forms allow-popups`). Si l'application a la **même origine** que le Shell, ces deux options annulent le bac à sable : héberger l'app sur une autre origine (sous-domaine) ; un avertissement est journalisé sinon.
|
|
63
|
+
|
|
64
|
+
## Exploitation (à ne pas oublier)
|
|
65
|
+
|
|
66
|
+
- L'application doit **autoriser l'affichage dans une iframe** par le Shell : `Content-Security-Policy: frame-ancestors https://shell.exemple.org` (et pas de `X-Frame-Options: DENY/SAMEORIGIN`). C'est la cause n°1 d'une iframe vide.
|
|
67
|
+
- Le CSP du Shell doit autoriser `frame-src` vers l'application.
|
|
68
|
+
- Authentification : les cookies tiers sont bloqués par les navigateurs entre sites distincts. Préférer le **même site** (sous-domaines d'un même domaine) ou une session propre à l'application.
|
|
69
|
+
- Les apps natives (Android/iOS) exigent un contenu embarqué : une iframe distante n'y est pas adaptée.
|
|
70
|
+
|
|
71
|
+
Tests : `yarn test` (fenêtres simulées ; l'exécution inter-fenêtres dans un vrai navigateur reste à valider).
|
|
72
|
+
|
|
73
|
+
## Navigation partagée (protocole 1.1)
|
|
74
|
+
|
|
75
|
+
L'URL du Core reflète la page courante de l'application embarquée : actualisation, retour/avance et liens partageables fonctionnent comme pour une app interne.
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
getEmbedLifecycle({
|
|
79
|
+
moduleName, featureName, url,
|
|
80
|
+
navigation: { route: 'mon-app', mode: 'history' /* | 'hash' | 'none' */, sensitiveParams: ['invite'] },
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Côté application : soit le script injectable `assets/egen-bridge.js` (`<script src="/egen-bridge.js" defer data-mode="history">`), soit le client (`bridge.reportLocation(path)`, `bridge.onGoto(fn)`). Sans l'option `navigation`, rien ne change. Détails, sécurité et exemples : `docs/integration-apps/16-navigation-partagee-apps-externes.md` du dépôt Core.
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Côté application embarquée (Next.js ou autre) : s'exécute DANS l'iframe, sans dépendance au Framework.
|
|
3
|
+
* Ne l'utiliser que côté navigateur (dans un `useEffect` pour Next.js : pas pendant le rendu serveur).
|
|
4
|
+
*/
|
|
5
|
+
import { type EmbedInit } from './protocol.js';
|
|
6
|
+
export type { EmbedInit } from './protocol.js';
|
|
7
|
+
export interface EgenBridgeOptions {
|
|
8
|
+
/** Nom du module (identique à `moduleName` du lifecycle côté Shell). */
|
|
9
|
+
moduleName: string;
|
|
10
|
+
/** Origines du Shell autorisées. Obligatoire, jamais « * ». */
|
|
11
|
+
allowedHostOrigins: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface EgenBridge {
|
|
14
|
+
/** Résolue à la réception des données initiales du Shell. */
|
|
15
|
+
ready: Promise<EmbedInit>;
|
|
16
|
+
/** Dernières données connues (session, langue). */
|
|
17
|
+
getState(): Partial<EmbedInit>;
|
|
18
|
+
/** S'abonne aux changements (session, langue) ; renvoie le désabonnement. */
|
|
19
|
+
subscribe(listener: (state: Partial<EmbedInit>) => void): () => void;
|
|
20
|
+
/** Demande une navigation du Shell vers un chemin interne (`/accueil`). */
|
|
21
|
+
navigate(to: string): void;
|
|
22
|
+
/** Annonce la hauteur du contenu (le Shell redimensionne l'iframe). */
|
|
23
|
+
setHeight(height: number): void;
|
|
24
|
+
/** Annonce un titre accessible pour l'iframe. */
|
|
25
|
+
setTitle(title: string): void;
|
|
26
|
+
/** Protocole 1.1 : annonce la page courante de l'application (`/chemin?q#h`) ; `replace` n'ajoute pas d'entrée d'historique. */
|
|
27
|
+
reportLocation(path: string, options?: {
|
|
28
|
+
replace?: boolean;
|
|
29
|
+
title?: string;
|
|
30
|
+
}): void;
|
|
31
|
+
/** Protocole 1.1 : le Shell demande d'aller à `path` (retour/avance, lien du Core) ; renvoie le désabonnement. */
|
|
32
|
+
onGoto(listener: (path: string) => void): () => void;
|
|
33
|
+
/** Annonce automatiquement la hauteur du document (ResizeObserver). */
|
|
34
|
+
autoResize(): () => void;
|
|
35
|
+
destroy(): void;
|
|
36
|
+
}
|
|
37
|
+
export declare function createEgenBridge(opts: EgenBridgeOptions): EgenBridge;
|
|
38
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAoB,KAAK,SAAS,EAAsC,MAAM,eAAe,CAAC;AAErG,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,UAAU;IACzB,6DAA6D;IAC7D,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1B,mDAAmD;IACnD,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B,6EAA6E;IAC7E,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACrE,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,uEAAuE;IACvE,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gIAAgI;IAChI,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACpF,kHAAkH;IAClH,MAAM,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACrD,uEAAuE;IACvE,UAAU,IAAI,MAAM,IAAI,CAAC;IACzB,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,UAAU,CAsEpE"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Côté application embarquée (Next.js ou autre) : s'exécute DANS l'iframe, sans dépendance au Framework.
|
|
55
|
+
* Ne l'utiliser que côté navigateur (dans un `useEffect` pour Next.js : pas pendant le rendu serveur).
|
|
56
|
+
*/ import { isEnvelope, wrap } from './protocol.js';
|
|
57
|
+
export function createEgenBridge(opts) {
|
|
58
|
+
var _opts_allowedHostOrigins;
|
|
59
|
+
if (!((_opts_allowedHostOrigins = opts.allowedHostOrigins) === null || _opts_allowedHostOrigins === void 0 ? void 0 : _opts_allowedHostOrigins.length) || opts.allowedHostOrigins.some(function(o) {
|
|
60
|
+
return o === '*' || o === 'null';
|
|
61
|
+
})) {
|
|
62
|
+
throw new Error('allowedHostOrigins : au moins une origine explicite est requise (jamais « * »).');
|
|
63
|
+
}
|
|
64
|
+
var host = window.parent;
|
|
65
|
+
if (host === window) throw new Error("createEgenBridge doit s'exécuter dans une iframe affichée par le Shell EGEN.");
|
|
66
|
+
var state = {};
|
|
67
|
+
var listeners = new Set();
|
|
68
|
+
var gotoListeners = new Set();
|
|
69
|
+
var resolveReady;
|
|
70
|
+
var ready = new Promise(function(r) {
|
|
71
|
+
return resolveReady = r;
|
|
72
|
+
});
|
|
73
|
+
// L'origine du Shell n'est connue qu'à la première réponse : le message `ready` est donc envoyé à chaque origine autorisée.
|
|
74
|
+
var hostOrigin;
|
|
75
|
+
var emit = function emit() {
|
|
76
|
+
return listeners.forEach(function(l) {
|
|
77
|
+
return l(state);
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
var onMessage = function onMessage(event) {
|
|
81
|
+
if (event.source !== host || !opts.allowedHostOrigins.includes(event.origin)) return;
|
|
82
|
+
if (!isEnvelope(event.data, opts.moduleName)) return;
|
|
83
|
+
hostOrigin = event.origin;
|
|
84
|
+
var msg = event.data.message;
|
|
85
|
+
if (msg.kind === 'init') {
|
|
86
|
+
state = _object_spread({}, msg.payload);
|
|
87
|
+
resolveReady(msg.payload);
|
|
88
|
+
emit();
|
|
89
|
+
} else if (msg.kind === 'session') {
|
|
90
|
+
state = _object_spread_props(_object_spread({}, state), {
|
|
91
|
+
session: msg.session
|
|
92
|
+
});
|
|
93
|
+
emit();
|
|
94
|
+
} else if (msg.kind === 'hello') {
|
|
95
|
+
send({
|
|
96
|
+
kind: 'ready',
|
|
97
|
+
caps: [
|
|
98
|
+
'location',
|
|
99
|
+
'goto'
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
} else if (msg.kind === 'goto') {
|
|
103
|
+
gotoListeners.forEach(function(l) {
|
|
104
|
+
return l(msg.path);
|
|
105
|
+
});
|
|
106
|
+
} else if (msg.kind === 'locale') {
|
|
107
|
+
state = _object_spread_props(_object_spread({}, state), {
|
|
108
|
+
locale: msg.locale
|
|
109
|
+
});
|
|
110
|
+
emit();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
window.addEventListener('message', onMessage);
|
|
114
|
+
var send = function send(message) {
|
|
115
|
+
var targets = hostOrigin ? [
|
|
116
|
+
hostOrigin
|
|
117
|
+
] : opts.allowedHostOrigins;
|
|
118
|
+
targets.forEach(function(o) {
|
|
119
|
+
return host.postMessage(wrap(opts.moduleName, message), o);
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
send({
|
|
123
|
+
kind: 'ready',
|
|
124
|
+
caps: [
|
|
125
|
+
'location',
|
|
126
|
+
'goto'
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
return {
|
|
130
|
+
ready: ready,
|
|
131
|
+
getState: function getState() {
|
|
132
|
+
return state;
|
|
133
|
+
},
|
|
134
|
+
reportLocation: function reportLocation(path, o) {
|
|
135
|
+
return send({
|
|
136
|
+
kind: 'location',
|
|
137
|
+
path: path,
|
|
138
|
+
replace: o === null || o === void 0 ? void 0 : o.replace,
|
|
139
|
+
title: o === null || o === void 0 ? void 0 : o.title
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
onGoto: function onGoto(l) {
|
|
143
|
+
gotoListeners.add(l);
|
|
144
|
+
return function() {
|
|
145
|
+
return gotoListeners.delete(l);
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
subscribe: function subscribe(l) {
|
|
149
|
+
listeners.add(l);
|
|
150
|
+
return function() {
|
|
151
|
+
return listeners.delete(l);
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
navigate: function navigate(to) {
|
|
155
|
+
return send({
|
|
156
|
+
kind: 'navigate',
|
|
157
|
+
to: to
|
|
158
|
+
});
|
|
159
|
+
},
|
|
160
|
+
setHeight: function setHeight(height) {
|
|
161
|
+
return send({
|
|
162
|
+
kind: 'resize',
|
|
163
|
+
height: height
|
|
164
|
+
});
|
|
165
|
+
},
|
|
166
|
+
setTitle: function setTitle(title) {
|
|
167
|
+
return send({
|
|
168
|
+
kind: 'title',
|
|
169
|
+
title: title
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
autoResize: function autoResize() {
|
|
173
|
+
var ro = new ResizeObserver(function() {
|
|
174
|
+
return send({
|
|
175
|
+
kind: 'resize',
|
|
176
|
+
height: document.documentElement.scrollHeight
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
ro.observe(document.documentElement);
|
|
180
|
+
return function() {
|
|
181
|
+
return ro.disconnect();
|
|
182
|
+
};
|
|
183
|
+
},
|
|
184
|
+
destroy: function destroy() {
|
|
185
|
+
window.removeEventListener('message', onMessage);
|
|
186
|
+
listeners.clear();
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
}
|
package/dist/host.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { LifeCycles } from 'single-spa';
|
|
2
|
+
import { type LifecycleExport, type LifecycleOptions } from '@egen-civitas/esm-integration-utils';
|
|
3
|
+
import { type NavigationOptions } from './navigation.js';
|
|
4
|
+
export interface EmbedLifecycleOptions extends LifecycleOptions {
|
|
5
|
+
/** URL de l'application embarquée (ou fonction des props Single-SPA). */
|
|
6
|
+
url: string | ((props: Record<string, any>) => string);
|
|
7
|
+
/** Origine autorisée pour les messages (défaut : origine de `url`). Jamais de « * ». */
|
|
8
|
+
allowedOrigin?: string;
|
|
9
|
+
/** Champs de session transmis (notation pointée). Défaut : `DEFAULT_SESSION_FIELDS` (sans `sessionId`). */
|
|
10
|
+
sessionFields?: string[];
|
|
11
|
+
/** Attribut `sandbox` de l'iframe (défaut : scripts + même origine + formulaires + popups). */
|
|
12
|
+
sandbox?: string;
|
|
13
|
+
/** Titre accessible de l'iframe. */
|
|
14
|
+
title?: string;
|
|
15
|
+
/** Hauteur minimale en px tant que l'application n'a pas annoncé la sienne (défaut 400). */
|
|
16
|
+
minHeight?: number;
|
|
17
|
+
/** Navigation demandée par l'application (défaut : `singleSpaNavigate(spaBase + chemin)`). */
|
|
18
|
+
onNavigate?: (to: string) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Navigation partagée (protocole 1.1) : l'URL du Core reflète la page courante de l'application et inversement
|
|
21
|
+
* (actualisation, retour/avance, lien partageable). Absent ou `mode: 'none'` : comportement opaque d'origine.
|
|
22
|
+
*/
|
|
23
|
+
navigation?: NavigationOptions;
|
|
24
|
+
}
|
|
25
|
+
/** Chemin relatif interne uniquement (`/x`), jamais d'URL absolue ni `//hôte`. */
|
|
26
|
+
export declare function isSafeInternalPath(to: unknown): to is string;
|
|
27
|
+
/**
|
|
28
|
+
* Lifecycles Single-SPA qui affichent une application autonome (ex. Next.js avec SSR) dans une iframe
|
|
29
|
+
* et la relient au Shell par un pont `postMessage` :
|
|
30
|
+
* Shell → app : langue, session filtrée ; app → Shell : prêt, navigation, hauteur, titre.
|
|
31
|
+
* Sécurité : messages acceptés seulement de l'iframe elle-même ET de l'origine autorisée ; envoi toujours
|
|
32
|
+
* avec une origine cible explicite ; navigation limitée aux chemins internes.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getEmbedLifecycle(userOpts: EmbedLifecycleOptions): LifeCycles;
|
|
35
|
+
/** Export prêt pour `routes.json` : fonction → promesse de lifecycles. */
|
|
36
|
+
export declare function getSyncLifecycle(options: EmbedLifecycleOptions): LifecycleExport;
|
|
37
|
+
//# sourceMappingURL=host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAML,KAAK,eAAe,EACpB,KAAK,gBAAgB,EAEtB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAQL,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AAGzB,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,yEAAyE;IACzE,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC,CAAC;IACvD,wFAAwF;IACxF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2GAA2G;IAC3G,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4FAA4F;IAC5F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8FAA8F;IAC9F,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAKD,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,MAAM,CAE5D;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,UAAU,CAqJ7E;AAED,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,qBAAqB,GAAG,eAAe,CAEhF"}
|
package/dist/host.js
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
import { assertLifecycleOptions, resolveMountTarget, toLifecycleExport, watchSession, watchTranslations } from '@egen-civitas/esm-integration-utils';
|
|
54
|
+
import { buildCoreUrl, buildEmbedSrc, coreSubpath, createRateLimiter, stripSensitive, toAppPath, toCorePath } from './navigation.js';
|
|
55
|
+
import { DEFAULT_SESSION_FIELDS, isEnvelope, pickFields, wrap } from './protocol.js';
|
|
56
|
+
var DEFAULT_SANDBOX = 'allow-scripts allow-same-origin allow-forms allow-popups';
|
|
57
|
+
var SAFE_PATH = /^\/(?!\/)[^\s\\]*$/;
|
|
58
|
+
/** Chemin relatif interne uniquement (`/x`), jamais d'URL absolue ni `//hôte`. */ export function isSafeInternalPath(to) {
|
|
59
|
+
return typeof to === 'string' && SAFE_PATH.test(to);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Lifecycles Single-SPA qui affichent une application autonome (ex. Next.js avec SSR) dans une iframe
|
|
63
|
+
* et la relient au Shell par un pont `postMessage` :
|
|
64
|
+
* Shell → app : langue, session filtrée ; app → Shell : prêt, navigation, hauteur, titre.
|
|
65
|
+
* Sécurité : messages acceptés seulement de l'iframe elle-même ET de l'origine autorisée ; envoi toujours
|
|
66
|
+
* avec une origine cible explicite ; navigation limitée aux chemins internes.
|
|
67
|
+
*/ export function getEmbedLifecycle(userOpts) {
|
|
68
|
+
var _opts_sessionFields;
|
|
69
|
+
assertLifecycleOptions(userOpts);
|
|
70
|
+
var opts = userOpts;
|
|
71
|
+
var fields = (_opts_sessionFields = opts.sessionFields) !== null && _opts_sessionFields !== void 0 ? _opts_sessionFields : DEFAULT_SESSION_FIELDS;
|
|
72
|
+
var mounted = new Map();
|
|
73
|
+
return {
|
|
74
|
+
bootstrap: function bootstrap() {
|
|
75
|
+
return Promise.resolve();
|
|
76
|
+
},
|
|
77
|
+
mount: function mount(props) {
|
|
78
|
+
var _opts_navigation_mode, _opts_navigation_mode1, _currentCorePath, _toAppPath, _opts_allowedOrigin, _opts_sandbox, _opts_title, _opts_minHeight;
|
|
79
|
+
var target = resolveMountTarget(props);
|
|
80
|
+
var baseUrl = typeof opts.url === 'function' ? opts.url(props) : opts.url;
|
|
81
|
+
var nav = opts.navigation && ((_opts_navigation_mode = opts.navigation.mode) !== null && _opts_navigation_mode !== void 0 ? _opts_navigation_mode : 'history') !== 'none' ? _object_spread_props(_object_spread({}, opts.navigation), {
|
|
82
|
+
mode: (_opts_navigation_mode1 = opts.navigation.mode) !== null && _opts_navigation_mode1 !== void 0 ? _opts_navigation_mode1 : 'history'
|
|
83
|
+
}) : undefined;
|
|
84
|
+
var spaBase = function spaBase() {
|
|
85
|
+
var _ref;
|
|
86
|
+
var _window_getEgenSpaBase, _window;
|
|
87
|
+
return (_ref = (_window_getEgenSpaBase = (_window = window).getEgenSpaBase) === null || _window_getEgenSpaBase === void 0 ? void 0 : _window_getEgenSpaBase.call(_window)) !== null && _ref !== void 0 ? _ref : '/';
|
|
88
|
+
};
|
|
89
|
+
/** Page courante du Core, en chemin (`/x?q#h`) relatif à la route de l'application ; `null` hors de cette page. */ var currentCorePath = function currentCorePath() {
|
|
90
|
+
if (!nav) return null;
|
|
91
|
+
var sub = coreSubpath(window.location.pathname, spaBase(), nav.route);
|
|
92
|
+
if (sub === null) return null;
|
|
93
|
+
var raw = sub + window.location.search + window.location.hash;
|
|
94
|
+
return stripSensitive(raw, nav.sensitiveParams);
|
|
95
|
+
};
|
|
96
|
+
var lastCorePath = (_currentCorePath = currentCorePath()) !== null && _currentCorePath !== void 0 ? _currentCorePath : '/';
|
|
97
|
+
var initialAppPath = nav ? (_toAppPath = toAppPath(lastCorePath, nav)) !== null && _toAppPath !== void 0 ? _toAppPath : '/' : '/';
|
|
98
|
+
var src = nav ? buildEmbedSrc(baseUrl, initialAppPath, nav.mode) : baseUrl;
|
|
99
|
+
var origin = (_opts_allowedOrigin = opts.allowedOrigin) !== null && _opts_allowedOrigin !== void 0 ? _opts_allowedOrigin : new URL(src, window.location.href).origin;
|
|
100
|
+
if (origin === '*' || origin === 'null') throw new Error('allowedOrigin invalide : une origine explicite est requise.');
|
|
101
|
+
var sandbox = (_opts_sandbox = opts.sandbox) !== null && _opts_sandbox !== void 0 ? _opts_sandbox : DEFAULT_SANDBOX;
|
|
102
|
+
if (origin === window.location.origin && /allow-scripts/.test(sandbox) && /allow-same-origin/.test(sandbox)) {
|
|
103
|
+
console.warn("[egen] ".concat(opts.moduleName, " : application embarqu\xe9e de m\xeame origine que le Shell avec \xab allow-scripts allow-same-origin \xbb : ") + "le bac à sable est sans effet. Héberger l'application sur une autre origine (sous-domaine).");
|
|
104
|
+
}
|
|
105
|
+
var iframe = document.createElement('iframe');
|
|
106
|
+
iframe.src = src;
|
|
107
|
+
iframe.title = (_opts_title = opts.title) !== null && _opts_title !== void 0 ? _opts_title : opts.featureName;
|
|
108
|
+
iframe.setAttribute('sandbox', sandbox);
|
|
109
|
+
iframe.setAttribute('referrerpolicy', 'strict-origin-when-cross-origin');
|
|
110
|
+
iframe.style.cssText = "width:100%;border:0;display:block;min-height:".concat((_opts_minHeight = opts.minHeight) !== null && _opts_minHeight !== void 0 ? _opts_minHeight : 400, "px");
|
|
111
|
+
var send = function send(message) {
|
|
112
|
+
var _iframe_contentWindow;
|
|
113
|
+
return (_iframe_contentWindow = iframe.contentWindow) === null || _iframe_contentWindow === void 0 ? void 0 : _iframe_contentWindow.postMessage(wrap(opts.moduleName, message), origin);
|
|
114
|
+
};
|
|
115
|
+
var stop = [];
|
|
116
|
+
var ready = false;
|
|
117
|
+
var lastSession;
|
|
118
|
+
var bridgeSeen = false;
|
|
119
|
+
var seq = 0;
|
|
120
|
+
var allowLocation = createRateLimiter();
|
|
121
|
+
var onMessage = function onMessage(event) {
|
|
122
|
+
if (event.source !== iframe.contentWindow || event.origin !== origin) return;
|
|
123
|
+
if (!isEnvelope(event.data, opts.moduleName)) return;
|
|
124
|
+
var msg = event.data.message;
|
|
125
|
+
switch(msg.kind){
|
|
126
|
+
case 'ready':
|
|
127
|
+
var _ref;
|
|
128
|
+
var _window_i18next, _window_getEgenSpaBase, _window;
|
|
129
|
+
ready = true;
|
|
130
|
+
bridgeSeen = true;
|
|
131
|
+
send({
|
|
132
|
+
kind: 'init',
|
|
133
|
+
payload: {
|
|
134
|
+
moduleName: opts.moduleName,
|
|
135
|
+
locale: (_window_i18next = window.i18next) === null || _window_i18next === void 0 ? void 0 : _window_i18next.language,
|
|
136
|
+
spaBase: (_ref = (_window_getEgenSpaBase = (_window = window).getEgenSpaBase) === null || _window_getEgenSpaBase === void 0 ? void 0 : _window_getEgenSpaBase.call(_window)) !== null && _ref !== void 0 ? _ref : '/',
|
|
137
|
+
session: lastSession,
|
|
138
|
+
navigation: nav ? {
|
|
139
|
+
mode: nav.mode,
|
|
140
|
+
route: nav.route
|
|
141
|
+
} : undefined
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
break;
|
|
145
|
+
case 'navigate':
|
|
146
|
+
if (isSafeInternalPath(msg.to)) {
|
|
147
|
+
var _opts_onNavigate;
|
|
148
|
+
((_opts_onNavigate = opts.onNavigate) !== null && _opts_onNavigate !== void 0 ? _opts_onNavigate : function(to) {
|
|
149
|
+
var _ref;
|
|
150
|
+
var _window_getEgenSpaBase, _window, _window_singleSpaNavigate, _window1;
|
|
151
|
+
return (_window_singleSpaNavigate = (_window1 = window).singleSpaNavigate) === null || _window_singleSpaNavigate === void 0 ? void 0 : _window_singleSpaNavigate.call(_window1, ((_ref = (_window_getEgenSpaBase = (_window = window).getEgenSpaBase) === null || _window_getEgenSpaBase === void 0 ? void 0 : _window_getEgenSpaBase.call(_window)) !== null && _ref !== void 0 ? _ref : '/') + to.replace(/^\//, ''));
|
|
152
|
+
})(msg.to);
|
|
153
|
+
}
|
|
154
|
+
break;
|
|
155
|
+
case 'resize':
|
|
156
|
+
if (Number.isFinite(msg.height) && msg.height >= 0) iframe.style.height = "".concat(Math.min(Math.ceil(msg.height), 100000), "px");
|
|
157
|
+
break;
|
|
158
|
+
case 'title':
|
|
159
|
+
if (typeof msg.title === 'string') iframe.title = msg.title.slice(0, 200);
|
|
160
|
+
break;
|
|
161
|
+
case 'location':
|
|
162
|
+
{
|
|
163
|
+
if (!nav || !allowLocation()) break;
|
|
164
|
+
bridgeSeen = true;
|
|
165
|
+
if (typeof msg.title === 'string') {
|
|
166
|
+
var _nav_onTitle;
|
|
167
|
+
iframe.title = msg.title.slice(0, 200);
|
|
168
|
+
(_nav_onTitle = nav.onTitle) === null || _nav_onTitle === void 0 ? void 0 : _nav_onTitle.call(nav, iframe.title);
|
|
169
|
+
}
|
|
170
|
+
var corePath = toCorePath(msg.path, nav);
|
|
171
|
+
if (!corePath || corePath === lastCorePath) break;
|
|
172
|
+
lastCorePath = corePath;
|
|
173
|
+
var url = buildCoreUrl(spaBase(), nav.route, corePath);
|
|
174
|
+
// History API (surchargée par Single-SPA) : la page reste active (la route correspond toujours), sans remontage.
|
|
175
|
+
window.history[msg.replace ? 'replaceState' : 'pushState'](window.history.state, '', url);
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
window.addEventListener('message', onMessage);
|
|
181
|
+
stop.push(function() {
|
|
182
|
+
return window.removeEventListener('message', onMessage);
|
|
183
|
+
});
|
|
184
|
+
if (nav) {
|
|
185
|
+
// poignée de main à chaque chargement de l'iframe (le script injectable n'a pas besoin de connaître l'origine du Shell)
|
|
186
|
+
var onLoad = function onLoad() {
|
|
187
|
+
return send({
|
|
188
|
+
kind: 'hello'
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
iframe.addEventListener('load', onLoad);
|
|
192
|
+
stop.push(function() {
|
|
193
|
+
return iframe.removeEventListener('load', onLoad);
|
|
194
|
+
});
|
|
195
|
+
// URL du Core modifiée hors de l'application (retour/avance, lien) → l'application suit
|
|
196
|
+
var onCoreLocation = function onCoreLocation() {
|
|
197
|
+
var cur = currentCorePath();
|
|
198
|
+
if (cur === null || cur === lastCorePath) return;
|
|
199
|
+
lastCorePath = cur;
|
|
200
|
+
var appPath = toAppPath(cur, nav);
|
|
201
|
+
if (!appPath) return;
|
|
202
|
+
if (bridgeSeen) send({
|
|
203
|
+
kind: 'goto',
|
|
204
|
+
path: appPath,
|
|
205
|
+
seq: ++seq
|
|
206
|
+
});
|
|
207
|
+
else iframe.src = buildEmbedSrc(baseUrl, appPath, nav.mode);
|
|
208
|
+
};
|
|
209
|
+
window.addEventListener('single-spa:routing-event', onCoreLocation);
|
|
210
|
+
window.addEventListener('popstate', onCoreLocation);
|
|
211
|
+
stop.push(function() {
|
|
212
|
+
window.removeEventListener('single-spa:routing-event', onCoreLocation);
|
|
213
|
+
window.removeEventListener('popstate', onCoreLocation);
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
stop.push(watchSession(function(session) {
|
|
217
|
+
lastSession = pickFields(session, fields);
|
|
218
|
+
if (ready) send({
|
|
219
|
+
kind: 'session',
|
|
220
|
+
session: lastSession
|
|
221
|
+
});
|
|
222
|
+
}));
|
|
223
|
+
stop.push(watchTranslations(function() {
|
|
224
|
+
var _window_i18next;
|
|
225
|
+
var locale = (_window_i18next = window.i18next) === null || _window_i18next === void 0 ? void 0 : _window_i18next.language;
|
|
226
|
+
if (ready && locale) send({
|
|
227
|
+
kind: 'locale',
|
|
228
|
+
locale: locale
|
|
229
|
+
});
|
|
230
|
+
}));
|
|
231
|
+
target.appendChild(iframe);
|
|
232
|
+
mounted.set(props.name, {
|
|
233
|
+
iframe: iframe,
|
|
234
|
+
stop: stop
|
|
235
|
+
});
|
|
236
|
+
return Promise.resolve();
|
|
237
|
+
},
|
|
238
|
+
unmount: function unmount(props) {
|
|
239
|
+
var m = mounted.get(props.name);
|
|
240
|
+
if (m) {
|
|
241
|
+
m.stop.forEach(function(s) {
|
|
242
|
+
return s();
|
|
243
|
+
});
|
|
244
|
+
m.iframe.remove();
|
|
245
|
+
mounted.delete(props.name);
|
|
246
|
+
}
|
|
247
|
+
return Promise.resolve();
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
/** Export prêt pour `routes.json` : fonction → promesse de lifecycles. */ export function getSyncLifecycle(options) {
|
|
252
|
+
return toLifecycleExport(getEmbedLifecycle(options));
|
|
253
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
package/dist/index.js
ADDED