@edynamix/mf-isolation 0.0.6 → 0.0.8
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/README.md +35 -0
- package/dist/angular-runtime.d.ts.map +1 -1
- package/dist/angular-runtime.js.map +1 -1
- package/dist/angular.d.ts.map +1 -1
- package/dist/angular.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/navigation.d.ts +29 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +123 -0
- package/dist/navigation.js.map +1 -0
- package/dist/postcss.d.ts.map +1 -1
- package/dist/postcss.js.map +1 -1
- package/dist/vite.d.ts +10 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +48 -0
- package/dist/vite.js.map +1 -0
- package/package.json +15 -3
package/README.md
CHANGED
|
@@ -60,6 +60,41 @@ The Angular-aware plugin uses `:host-context([data-edyn-mf="<scope-id>"])` for E
|
|
|
60
60
|
|
|
61
61
|
Run this plugin through Vite/PostCSS before Angular AOT compilation. Do not combine it with `scopeRemoteCss` in the same Vite configuration.
|
|
62
62
|
|
|
63
|
+
## Navigation manifest
|
|
64
|
+
|
|
65
|
+
Declare module-owned navigation as validated data and emit `navigation.json` from the same Vite build:
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
import {
|
|
69
|
+
defineMfNavigation,
|
|
70
|
+
MF_NAVIGATION_CONTRACT_VERSION,
|
|
71
|
+
} from '@edynamix/mf-isolation/navigation';
|
|
72
|
+
import { mfNavigationPlugin } from '@edynamix/mf-isolation/vite';
|
|
73
|
+
import { defineConfig } from 'vite';
|
|
74
|
+
|
|
75
|
+
const navigation = defineMfNavigation({
|
|
76
|
+
applicationId: 22,
|
|
77
|
+
contractVersion: MF_NAVIGATION_CONTRACT_VERSION,
|
|
78
|
+
items: [
|
|
79
|
+
{
|
|
80
|
+
id: 'stockmaster.for-sale',
|
|
81
|
+
label: 'For Sale',
|
|
82
|
+
order: 1,
|
|
83
|
+
path: 'usedstock/for-sale',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
label: 'Stock Master',
|
|
87
|
+
landingPath: 'usedstock',
|
|
88
|
+
moduleId: 'stockmaster',
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
export default defineConfig({
|
|
92
|
+
plugins: [mfNavigationPlugin({ navigation })],
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Routes are module-relative and contain no leading slash. The plugin validates the complete tree, emits deterministic JSON with a SHA-256 revision during builds, and serves the same manifest with `Cache-Control: no-cache` in development.
|
|
97
|
+
|
|
63
98
|
## Angular CDK overlays
|
|
64
99
|
|
|
65
100
|
The Angular integration targets Angular/CDK 19.x. In a hosted application, install the complete provider array so global and connected overlays share the module boundary's viewport and coordinate system:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular-runtime.d.ts","sourceRoot":"","sources":["../src/angular-runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QAAO,IAMxC,CAAC"}
|
|
1
|
+
{"version":3,"file":"angular-runtime.d.ts","sourceRoot":"","sources":["../src/angular-runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QAAO,IAMxC,CAAC","sourcesContent":["/**\n * Verifies the host-owned Zone.js runtime before Angular is loaded.\n *\n * This check is intentionally framework-free and must run before dynamically\n * importing an Angular bootstrap module.\n */\nexport const assertHostZoneRuntime = (): void => {\n const zoneRuntime = (globalThis as typeof globalThis & { Zone?: unknown }).Zone;\n\n if (typeof zoneRuntime !== 'function') {\n throw new Error('Host Zone.js runtime is missing. Expected globalThis.Zone to be a function before loading Angular.');\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular-runtime.js","sourceRoot":"","sources":["../src/angular-runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAS,EAAE;IAC9C,MAAM,WAAW,GAAI,UAAqD,CAAC,IAAI,CAAC;IAEhF,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,oGAAoG,CAAC,CAAC;IACxH,CAAC;AACH,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"angular-runtime.js","sourceRoot":"","sources":["../src/angular-runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAS,EAAE;IAC9C,MAAM,WAAW,GAAI,UAAqD,CAAC,IAAI,CAAC;IAEhF,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,oGAAoG,CAAC,CAAC;IACxH,CAAC;AACH,CAAC,CAAC","sourcesContent":["/**\n * Verifies the host-owned Zone.js runtime before Angular is loaded.\n *\n * This check is intentionally framework-free and must run before dynamically\n * importing an Angular bootstrap module.\n */\nexport const assertHostZoneRuntime = (): void => {\n const zoneRuntime = (globalThis as typeof globalThis & { Zone?: unknown }).Zone;\n\n if (typeof zoneRuntime !== 'function') {\n throw new Error('Host Zone.js runtime is missing. Expected globalThis.Zone to be a function before loading Angular.');\n }\n};\n"]}
|
package/dist/angular.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular.d.ts","sourceRoot":"","sources":["../src/angular.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AA2SnE,eAAO,MAAM,oBAAoB,GAAI,cAAc,WAAW,KAAG,cAAc,EAkB9E,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,kBAAkB,aAAa,CAAC,WAAW,CAAC,KAAG,cAAc,EAE1G,CAAC"}
|
|
1
|
+
{"version":3,"file":"angular.d.ts","sourceRoot":"","sources":["../src/angular.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AA2SnE,eAAO,MAAM,oBAAoB,GAAI,cAAc,WAAW,KAAG,cAAc,EAkB9E,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,kBAAkB,aAAa,CAAC,WAAW,CAAC,KAAG,cAAc,EAE1G,CAAC","sourcesContent":["import {\n FlexibleConnectedPositionStrategy,\n type FlexibleConnectedPositionStrategyOrigin,\n GlobalPositionStrategy,\n OverlayContainer,\n OverlayPositionBuilder,\n} from '@angular/cdk/overlay';\nimport { Platform } from '@angular/cdk/platform';\nimport { ViewportRuler } from '@angular/cdk/scrolling';\nimport { DOCUMENT } from '@angular/common';\nimport type { ProviderToken, StaticProvider } from '@angular/core';\n\n// Mirrors the CDK 19 overlay-prebuilt.css structural rules while intentionally excluding document-level scroll blocking.\nconst CDK_OVERLAY_STRUCTURAL_CSS = `\n.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}\n.cdk-overlay-container{position:fixed;z-index:1000}\n.cdk-overlay-container:empty{display:none}\n.cdk-global-overlay-wrapper{display:flex;position:absolute;z-index:1000}\n.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%;z-index:1000}\n.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation;z-index:1000;transition:opacity 400ms cubic-bezier(0.25,0.8,0.25,1)}\n@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}\n.cdk-overlay-backdrop-showing{opacity:1}\n@media(forced-colors:active){.cdk-overlay-backdrop-showing{opacity:.6}}\n.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}\n.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}\n.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}\n.cdk-overlay-backdrop-noop-animation{transition:none}\n.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px;z-index:1000}\n`;\n\ninterface IClientRect {\n bottom: number;\n height: number;\n left: number;\n right: number;\n top: number;\n width: number;\n x?: number;\n y?: number;\n}\n\ninterface IFlexibleConnectedPositionStrategyInternals {\n _getOriginPoint: (originRect: IClientRect, containerRect: IClientRect, position: unknown) => { x: number; y: number };\n _getOriginRect: () => IClientRect;\n}\n\nconst translateRectToBoundary = (rect: IClientRect, boundary: IClientRect): IClientRect => {\n const left = rect.left - boundary.left;\n const top = rect.top - boundary.top;\n\n return {\n bottom: top + rect.height,\n height: rect.height,\n left,\n right: left + rect.width,\n top,\n width: rect.width,\n x: left,\n y: top,\n };\n};\n\nconst getBoundaryRect = (overlayRoot: HTMLElement): IClientRect => {\n const { height, width } = overlayRoot.getBoundingClientRect();\n return {\n bottom: height,\n height,\n left: 0,\n right: width,\n top: 0,\n width,\n x: 0,\n y: 0,\n };\n};\n\nconst createBoundaryDocument = (document: Document, overlayRoot: HTMLElement): Document => {\n const boundaryDocumentElement = new Proxy(document.documentElement, {\n get: (target, property, receiver) => {\n if (property === 'clientHeight') {\n return overlayRoot.getBoundingClientRect().height;\n }\n if (property === 'clientWidth') {\n return overlayRoot.getBoundingClientRect().width;\n }\n return Reflect.get(target, property, receiver);\n },\n });\n\n return new Proxy(document, {\n get: (target, property, receiver) => {\n if (property === 'documentElement') {\n return boundaryDocumentElement;\n }\n return Reflect.get(target, property, receiver);\n },\n });\n};\n\nconst createBoundaryViewportRuler = (viewportRuler: ViewportRuler, overlayRoot: HTMLElement): ViewportRuler => {\n const boundaryViewportRuler = Object.create(viewportRuler) as ViewportRuler;\n boundaryViewportRuler.getViewportRect = () => getBoundaryRect(overlayRoot);\n boundaryViewportRuler.getViewportScrollPosition = () => ({ left: 0, top: 0 });\n boundaryViewportRuler.getViewportSize = () => {\n const { height, width } = getBoundaryRect(overlayRoot);\n return { height, width };\n };\n return boundaryViewportRuler;\n};\n\nconst adaptConnectedPositionStrategy = (\n strategy: FlexibleConnectedPositionStrategy,\n overlayRoot: HTMLElement,\n observeBoundary: (callback: () => void) => () => void,\n): FlexibleConnectedPositionStrategy => {\n const internals = strategy as unknown as IFlexibleConnectedPositionStrategyInternals;\n const getOriginRect = internals._getOriginRect.bind(strategy);\n const getOriginPoint = internals._getOriginPoint.bind(strategy);\n const attach = strategy.attach.bind(strategy);\n const detach = strategy.detach.bind(strategy);\n const dispose = strategy.dispose.bind(strategy);\n let stopObserving = () => {};\n internals._getOriginRect = () => {\n return translateRectToBoundary(getOriginRect(), overlayRoot.getBoundingClientRect());\n };\n internals._getOriginPoint = (originRect, _containerRect, position) => {\n return getOriginPoint(originRect, getBoundaryRect(overlayRoot), position);\n };\n strategy.attach = (overlayRef) => {\n attach(overlayRef);\n stopObserving();\n stopObserving = observeBoundary(() => strategy.apply());\n };\n strategy.detach = () => {\n stopObserving();\n stopObserving = () => {};\n detach();\n };\n strategy.dispose = () => {\n stopObserving();\n stopObserving = () => {};\n dispose();\n };\n\n return strategy;\n};\n\nclass MfOverlayPositionBuilder extends OverlayPositionBuilder {\n readonly #document: Document;\n readonly #overlayContainer: OverlayContainer;\n readonly #overlayRoot: HTMLElement;\n readonly #platform: Platform;\n readonly #viewportRuler: ViewportRuler;\n\n constructor(viewportRuler: ViewportRuler, document: Document, platform: Platform, overlayContainer: OverlayContainer, overlayRoot: HTMLElement) {\n super();\n this.#viewportRuler = viewportRuler;\n this.#document = document;\n this.#platform = platform;\n this.#overlayContainer = overlayContainer;\n this.#overlayRoot = overlayRoot;\n }\n\n override global(): GlobalPositionStrategy {\n return new GlobalPositionStrategy();\n }\n\n override flexibleConnectedTo(origin: FlexibleConnectedPositionStrategyOrigin): FlexibleConnectedPositionStrategy {\n const boundaryDocument = createBoundaryDocument(this.#document, this.#overlayRoot);\n const boundaryViewportRuler = createBoundaryViewportRuler(this.#viewportRuler, this.#overlayRoot);\n const strategy = new FlexibleConnectedPositionStrategy(origin, boundaryViewportRuler, boundaryDocument, this.#platform, this.#overlayContainer);\n\n const overlayContainer = this.#overlayContainer as MfOverlayContainer;\n return adaptConnectedPositionStrategy(strategy, this.#overlayRoot, (callback) => overlayContainer.observeBoundary(callback));\n }\n}\n\nclass MfOverlayContainer extends OverlayContainer {\n readonly #boundaryObservers = new Set<() => void>();\n readonly #overlayRoot: HTMLElement;\n #animationFrame: number | null = null;\n #boundaryRect: IClientRect | null = null;\n #restoreRootPosition: (() => void) | null = null;\n #shadowStyle: HTMLStyleElement | null = null;\n\n constructor(overlayRoot: HTMLElement) {\n super();\n this.#overlayRoot = overlayRoot;\n }\n\n override ngOnDestroy(): void {\n if (this.#animationFrame !== null) {\n this.#overlayRoot.ownerDocument.defaultView?.cancelAnimationFrame(this.#animationFrame);\n }\n this.#animationFrame = null;\n this.#boundaryObservers.clear();\n super.ngOnDestroy();\n this.#shadowStyle?.remove();\n this.#shadowStyle = null;\n this.#restoreRootPosition?.();\n this.#restoreRootPosition = null;\n }\n\n observeBoundary(callback: () => void): () => void {\n this.#boundaryObservers.add(callback);\n if (this.#boundaryObservers.size === 1) {\n this.#boundaryRect = this.#overlayRoot.getBoundingClientRect();\n this.#scheduleBoundaryCheck();\n }\n\n return () => {\n this.#boundaryObservers.delete(callback);\n if (this.#boundaryObservers.size === 0 && this.#animationFrame !== null) {\n this.#overlayRoot.ownerDocument.defaultView?.cancelAnimationFrame(this.#animationFrame);\n this.#animationFrame = null;\n this.#boundaryRect = null;\n }\n };\n }\n\n protected override _createContainer(): void {\n if (this.#overlayRoot.ownerDocument.defaultView?.getComputedStyle(this.#overlayRoot).position === 'static') {\n const previousPosition = this.#overlayRoot.style.position;\n this.#overlayRoot.style.position = 'relative';\n this.#restoreRootPosition = () => {\n this.#overlayRoot.style.position = previousPosition;\n };\n }\n\n const rootNode = this.#overlayRoot.getRootNode();\n const ShadowRootConstructor = this.#overlayRoot.ownerDocument.defaultView?.ShadowRoot;\n if (ShadowRootConstructor && rootNode instanceof ShadowRootConstructor) {\n const style = this._document.createElement('style');\n style.setAttribute('data-edyn-mf-cdk-overlay-styles', '');\n style.textContent = CDK_OVERLAY_STRUCTURAL_CSS;\n rootNode.appendChild(style);\n this.#shadowStyle = style;\n }\n\n const container = this._document.createElement('div');\n container.classList.add('cdk-overlay-container');\n container.style.inset = '0';\n container.style.position = 'absolute';\n this.#overlayRoot.appendChild(container);\n this._containerElement = container;\n }\n\n #scheduleBoundaryCheck(): void {\n const window = this.#overlayRoot.ownerDocument.defaultView;\n if (!window || this.#animationFrame !== null || this.#boundaryObservers.size === 0) {\n return;\n }\n\n this.#animationFrame = window.requestAnimationFrame(() => {\n this.#animationFrame = null;\n const previous = this.#boundaryRect;\n const current = this.#overlayRoot.getBoundingClientRect();\n this.#boundaryRect = current;\n\n if (\n previous &&\n (previous.height !== current.height || previous.left !== current.left || previous.top !== current.top || previous.width !== current.width)\n ) {\n for (const observer of this.#boundaryObservers) {\n observer();\n }\n }\n\n this.#scheduleBoundaryCheck();\n });\n }\n}\n\nconst isDocumentViewportRoot = (overlayRoot: HTMLElement): boolean => {\n return overlayRoot === overlayRoot.ownerDocument.body || overlayRoot === overlayRoot.ownerDocument.documentElement;\n};\n\nconst createOverlayContainer = (overlayRoot: HTMLElement): OverlayContainer => {\n return isDocumentViewportRoot(overlayRoot) ? new OverlayContainer() : new MfOverlayContainer(overlayRoot);\n};\n\nconst createOverlayPositionBuilder = (\n viewportRuler: ViewportRuler,\n document: Document,\n platform: Platform,\n overlayContainer: OverlayContainer,\n overlayRoot: HTMLElement,\n): OverlayPositionBuilder => {\n if (isDocumentViewportRoot(overlayRoot)) {\n return new OverlayPositionBuilder();\n }\n return new MfOverlayPositionBuilder(viewportRuler, document, platform, overlayContainer, overlayRoot);\n};\n\nconst createTokenProviders = (overlayRootToken: ProviderToken<HTMLElement>): StaticProvider[] => {\n return [\n {\n provide: OverlayContainer,\n useFactory: createOverlayContainer,\n deps: [overlayRootToken],\n },\n {\n provide: OverlayPositionBuilder,\n useFactory: createOverlayPositionBuilder,\n deps: [ViewportRuler, DOCUMENT, Platform, OverlayContainer, overlayRootToken],\n },\n ];\n};\n\nexport const provideMfOverlayRoot = (overlayRoot?: HTMLElement): StaticProvider[] => {\n if (!overlayRoot) {\n return [];\n }\n\n return [\n {\n provide: OverlayContainer,\n useFactory: () => createOverlayContainer(overlayRoot),\n },\n {\n provide: OverlayPositionBuilder,\n useFactory: (viewportRuler: ViewportRuler, document: Document, platform: Platform, overlayContainer: OverlayContainer) => {\n return createOverlayPositionBuilder(viewportRuler, document, platform, overlayContainer, overlayRoot);\n },\n deps: [ViewportRuler, DOCUMENT, Platform, OverlayContainer],\n },\n ];\n};\n\nexport const provideMfOverlayRootFromToken = (overlayRootToken: ProviderToken<HTMLElement>): StaticProvider[] => {\n return createTokenProviders(overlayRootToken);\n};\n"]}
|
package/dist/angular.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular.js","sourceRoot":"","sources":["../src/angular.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EAEjC,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,yHAAyH;AACzH,MAAM,0BAA0B,GAAG;;;;;;;;;;;;;;;CAelC,CAAC;AAkBF,MAAM,uBAAuB,GAAG,CAAC,IAAiB,EAAE,QAAqB,EAAe,EAAE;IACxF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,G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Q,EAAE,gBAAgB,CAAC;SAC5D;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,gBAA4C,EAAoB,EAAE;IAC9G,OAAO,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;AAChD,CAAC,CAAC","sourcesContent":["import {\n FlexibleConnectedPositionStrategy,\n type FlexibleConnectedPositionStrategyOrigin,\n GlobalPositionStrategy,\n OverlayContainer,\n OverlayPositionBuilder,\n} from '@angular/cdk/overlay';\nimport { Platform } from '@angular/cdk/platform';\nimport { ViewportRuler } from '@angular/cdk/scrolling';\nimport { DOCUMENT } from '@angular/common';\nimport type { ProviderToken, StaticProvider } from '@angular/core';\n\n// Mirrors the CDK 19 overlay-prebuilt.css structural rules while intentionally excluding document-level scroll blocking.\nconst CDK_OVERLAY_STRUCTURAL_CSS = `\n.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}\n.cdk-overlay-container{position:fixed;z-index:1000}\n.cdk-overlay-container:empty{display:none}\n.cdk-global-overlay-wrapper{display:flex;position:absolute;z-index:1000}\n.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%;z-index:1000}\n.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation;z-index:1000;transition:opacity 400ms cubic-bezier(0.25,0.8,0.25,1)}\n@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}\n.cdk-overlay-backdrop-showing{opacity:1}\n@media(forced-colors:active){.cdk-overlay-backdrop-showing{opacity:.6}}\n.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}\n.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}\n.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}\n.cdk-overlay-backdrop-noop-animation{transition:none}\n.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px;z-index:1000}\n`;\n\ninterface IClientRect {\n bottom: number;\n height: number;\n left: number;\n right: number;\n top: number;\n width: number;\n x?: number;\n y?: number;\n}\n\ninterface IFlexibleConnectedPositionStrategyInternals {\n _getOriginPoint: (originRect: IClientRect, containerRect: IClientRect, position: unknown) => { x: number; y: number };\n _getOriginRect: () => IClientRect;\n}\n\nconst translateRectToBoundary = (rect: IClientRect, boundary: IClientRect): IClientRect => {\n const left = rect.left - boundary.left;\n const top = rect.top - boundary.top;\n\n return {\n bottom: top + rect.height,\n height: rect.height,\n left,\n right: left + rect.width,\n top,\n width: rect.width,\n x: left,\n y: top,\n };\n};\n\nconst getBoundaryRect = (overlayRoot: HTMLElement): IClientRect => {\n const { height, width } = overlayRoot.getBoundingClientRect();\n return {\n bottom: height,\n height,\n left: 0,\n right: width,\n top: 0,\n width,\n x: 0,\n y: 0,\n };\n};\n\nconst createBoundaryDocument = (document: Document, overlayRoot: HTMLElement): Document => {\n const boundaryDocumentElement = new Proxy(document.documentElement, {\n get: (target, property, receiver) => {\n if (property === 'clientHeight') {\n return overlayRoot.getBoundingClientRect().height;\n }\n if (property === 'clientWidth') {\n return overlayRoot.getBoundingClientRect().width;\n }\n return Reflect.get(target, property, receiver);\n },\n });\n\n return new Proxy(document, {\n get: (target, property, receiver) => {\n if (property === 'documentElement') {\n return boundaryDocumentElement;\n }\n return Reflect.get(target, property, receiver);\n },\n });\n};\n\nconst createBoundaryViewportRuler = (viewportRuler: ViewportRuler, overlayRoot: HTMLElement): ViewportRuler => {\n const boundaryViewportRuler = Object.create(viewportRuler) as ViewportRuler;\n boundaryViewportRuler.getViewportRect = () => getBoundaryRect(overlayRoot);\n boundaryViewportRuler.getViewportScrollPosition = () => ({ left: 0, top: 0 });\n boundaryViewportRuler.getViewportSize = () => {\n const { height, width } = getBoundaryRect(overlayRoot);\n return { height, width };\n };\n return boundaryViewportRuler;\n};\n\nconst adaptConnectedPositionStrategy = (\n strategy: FlexibleConnectedPositionStrategy,\n overlayRoot: HTMLElement,\n observeBoundary: (callback: () => void) => () => void,\n): FlexibleConnectedPositionStrategy => {\n const internals = strategy as unknown as IFlexibleConnectedPositionStrategyInternals;\n const getOriginRect = internals._getOriginRect.bind(strategy);\n const getOriginPoint = internals._getOriginPoint.bind(strategy);\n const attach = strategy.attach.bind(strategy);\n const detach = strategy.detach.bind(strategy);\n const dispose = strategy.dispose.bind(strategy);\n let stopObserving = () => {};\n internals._getOriginRect = () => {\n return translateRectToBoundary(getOriginRect(), overlayRoot.getBoundingClientRect());\n };\n internals._getOriginPoint = (originRect, _containerRect, position) => {\n return getOriginPoint(originRect, getBoundaryRect(overlayRoot), position);\n };\n strategy.attach = (overlayRef) => {\n attach(overlayRef);\n stopObserving();\n stopObserving = observeBoundary(() => strategy.apply());\n };\n strategy.detach = () => {\n stopObserving();\n stopObserving = () => {};\n detach();\n };\n strategy.dispose = () => {\n stopObserving();\n stopObserving = () => {};\n dispose();\n };\n\n return strategy;\n};\n\nclass MfOverlayPositionBuilder extends OverlayPositionBuilder {\n readonly #document: Document;\n readonly #overlayContainer: OverlayContainer;\n readonly #overlayRoot: HTMLElement;\n readonly #platform: Platform;\n readonly #viewportRuler: ViewportRuler;\n\n constructor(viewportRuler: ViewportRuler, document: Document, platform: Platform, overlayContainer: OverlayContainer, overlayRoot: HTMLElement) {\n super();\n this.#viewportRuler = viewportRuler;\n this.#document = document;\n this.#platform = platform;\n this.#overlayContainer = overlayContainer;\n this.#overlayRoot = overlayRoot;\n }\n\n override global(): GlobalPositionStrategy {\n return new GlobalPositionStrategy();\n }\n\n override flexibleConnectedTo(origin: FlexibleConnectedPositionStrategyOrigin): FlexibleConnectedPositionStrategy {\n const boundaryDocument = createBoundaryDocument(this.#document, this.#overlayRoot);\n const boundaryViewportRuler = createBoundaryViewportRuler(this.#viewportRuler, this.#overlayRoot);\n const strategy = new FlexibleConnectedPositionStrategy(origin, boundaryViewportRuler, boundaryDocument, this.#platform, this.#overlayContainer);\n\n const overlayContainer = this.#overlayContainer as MfOverlayContainer;\n return adaptConnectedPositionStrategy(strategy, this.#overlayRoot, (callback) => overlayContainer.observeBoundary(callback));\n }\n}\n\nclass MfOverlayContainer extends OverlayContainer {\n readonly #boundaryObservers = new Set<() => void>();\n readonly #overlayRoot: HTMLElement;\n #animationFrame: number | null = null;\n #boundaryRect: IClientRect | null = null;\n #restoreRootPosition: (() => void) | null = null;\n #shadowStyle: HTMLStyleElement | null = null;\n\n constructor(overlayRoot: HTMLElement) {\n super();\n this.#overlayRoot = overlayRoot;\n }\n\n override ngOnDestroy(): void {\n if (this.#animationFrame !== null) {\n this.#overlayRoot.ownerDocument.defaultView?.cancelAnimationFrame(this.#animationFrame);\n }\n this.#animationFrame = null;\n this.#boundaryObservers.clear();\n super.ngOnDestroy();\n this.#shadowStyle?.remove();\n this.#shadowStyle = null;\n this.#restoreRootPosition?.();\n this.#restoreRootPosition = null;\n }\n\n observeBoundary(callback: () => void): () => void {\n this.#boundaryObservers.add(callback);\n if (this.#boundaryObservers.size === 1) {\n this.#boundaryRect = this.#overlayRoot.getBoundingClientRect();\n this.#scheduleBoundaryCheck();\n }\n\n return () => {\n this.#boundaryObservers.delete(callback);\n if (this.#boundaryObservers.size === 0 && this.#animationFrame !== null) {\n this.#overlayRoot.ownerDocument.defaultView?.cancelAnimationFrame(this.#animationFrame);\n this.#animationFrame = null;\n this.#boundaryRect = null;\n }\n };\n }\n\n protected override _createContainer(): void {\n if (this.#overlayRoot.ownerDocument.defaultView?.getComputedStyle(this.#overlayRoot).position === 'static') {\n const previousPosition = this.#overlayRoot.style.position;\n this.#overlayRoot.style.position = 'relative';\n this.#restoreRootPosition = () => {\n this.#overlayRoot.style.position = previousPosition;\n };\n }\n\n const rootNode = this.#overlayRoot.getRootNode();\n const ShadowRootConstructor = this.#overlayRoot.ownerDocument.defaultView?.ShadowRoot;\n if (ShadowRootConstructor && rootNode instanceof ShadowRootConstructor) {\n const style = this._document.createElement('style');\n style.setAttribute('data-edyn-mf-cdk-overlay-styles', '');\n style.textContent = CDK_OVERLAY_STRUCTURAL_CSS;\n rootNode.appendChild(style);\n this.#shadowStyle = style;\n }\n\n const container = this._document.createElement('div');\n container.classList.add('cdk-overlay-container');\n container.style.inset = '0';\n container.style.position = 'absolute';\n this.#overlayRoot.appendChild(container);\n this._containerElement = container;\n }\n\n #scheduleBoundaryCheck(): void {\n const window = this.#overlayRoot.ownerDocument.defaultView;\n if (!window || this.#animationFrame !== null || this.#boundaryObservers.size === 0) {\n return;\n }\n\n this.#animationFrame = window.requestAnimationFrame(() => {\n this.#animationFrame = null;\n const previous = this.#boundaryRect;\n const current = this.#overlayRoot.getBoundingClientRect();\n this.#boundaryRect = current;\n\n if (\n previous &&\n (previous.height !== current.height || previous.left !== current.left || previous.top !== current.top || previous.width !== current.width)\n ) {\n for (const observer of this.#boundaryObservers) {\n observer();\n }\n }\n\n this.#scheduleBoundaryCheck();\n });\n }\n}\n\nconst isDocumentViewportRoot = (overlayRoot: HTMLElement): boolean => {\n return overlayRoot === overlayRoot.ownerDocument.body || overlayRoot === overlayRoot.ownerDocument.documentElement;\n};\n\nconst createOverlayContainer = (overlayRoot: HTMLElement): OverlayContainer => {\n return isDocumentViewportRoot(overlayRoot) ? new OverlayContainer() : new MfOverlayContainer(overlayRoot);\n};\n\nconst createOverlayPositionBuilder = (\n viewportRuler: ViewportRuler,\n document: Document,\n platform: Platform,\n overlayContainer: OverlayContainer,\n overlayRoot: HTMLElement,\n): OverlayPositionBuilder => {\n if (isDocumentViewportRoot(overlayRoot)) {\n return new OverlayPositionBuilder();\n }\n return new MfOverlayPositionBuilder(viewportRuler, document, platform, overlayContainer, overlayRoot);\n};\n\nconst createTokenProviders = (overlayRootToken: ProviderToken<HTMLElement>): StaticProvider[] => {\n return [\n {\n provide: OverlayContainer,\n useFactory: createOverlayContainer,\n deps: [overlayRootToken],\n },\n {\n provide: OverlayPositionBuilder,\n useFactory: createOverlayPositionBuilder,\n deps: [ViewportRuler, DOCUMENT, Platform, OverlayContainer, overlayRootToken],\n },\n ];\n};\n\nexport const provideMfOverlayRoot = (overlayRoot?: HTMLElement): StaticProvider[] => {\n if (!overlayRoot) {\n return [];\n }\n\n return [\n {\n provide: OverlayContainer,\n useFactory: () => createOverlayContainer(overlayRoot),\n },\n {\n provide: OverlayPositionBuilder,\n useFactory: (viewportRuler: ViewportRuler, document: Document, platform: Platform, overlayContainer: OverlayContainer) => {\n return createOverlayPositionBuilder(viewportRuler, document, platform, overlayContainer, overlayRoot);\n },\n deps: [ViewportRuler, DOCUMENT, Platform, OverlayContainer],\n },\n ];\n};\n\nexport const provideMfOverlayRootFromToken = (overlayRootToken: ProviderToken<HTMLElement>): StaticProvider[] => {\n return createTokenProviders(overlayRootToken);\n};\n"]}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AACjD,eAAO,MAAM,gBAAgB,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AACjD,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAE3C,cAAc,cAAc,CAAC;AAI7B,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,MAMnD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,KAAG,MAEpD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAS,WAAW,EAAE,oBAAyB,yBAAyB,KAAG,CAAC,MAAM,IAAI,CA2CvH,CAAC","sourcesContent":["export const MF_SCOPE_ATTRIBUTE = 'data-edyn-mf';\nexport const MF_ROOT_SELECTOR = ':mf-root';\n\nexport * from './navigation';\n\nconst SCOPE_ID_PATTERN = /^[a-z][a-z0-9-]*$/;\n\nexport interface IPrepareMfBoundaryOptions {\n scopeId: string;\n theme?: Record<string, string>;\n}\n\nexport const validateMfScopeId = (scopeId: string): string => {\n if (!SCOPE_ID_PATTERN.test(scopeId)) {\n throw new Error(`Invalid microfrontend scope id: \"${scopeId}\".`);\n }\n\n return scopeId;\n};\n\nexport const getMfScopeSelector = (scopeId: string): string => {\n return `:where([${MF_SCOPE_ATTRIBUTE}=\"${validateMfScopeId(scopeId)}\"])`;\n};\n\nexport const prepareMfBoundary = (element: HTMLElement, { scopeId, theme = {} }: IPrepareMfBoundaryOptions): (() => void) => {\n validateMfScopeId(scopeId);\n\n for (const name of Object.keys(theme)) {\n if (!name.startsWith('--')) {\n throw new Error(`Microfrontend theme token must be a CSS custom property: \"${name}\".`);\n }\n }\n\n const previousScope = element.getAttribute(MF_SCOPE_ATTRIBUTE);\n const hadRootClass = element.classList.contains('edx-root');\n const previousTheme = new Map<string, { priority: string; value: string }>();\n\n element.setAttribute(MF_SCOPE_ATTRIBUTE, scopeId);\n element.classList.add('edx-root');\n\n for (const [name, value] of Object.entries(theme)) {\n previousTheme.set(name, {\n priority: element.style.getPropertyPriority(name),\n value: element.style.getPropertyValue(name),\n });\n element.style.setProperty(name, value);\n }\n\n return () => {\n if (previousScope === null) {\n element.removeAttribute(MF_SCOPE_ATTRIBUTE);\n } else {\n element.setAttribute(MF_SCOPE_ATTRIBUTE, previousScope);\n }\n\n if (!hadRootClass) {\n element.classList.remove('edx-root');\n }\n\n for (const [name, previous] of previousTheme) {\n if (previous.value) {\n element.style.setProperty(name, previous.value, previous.priority);\n } else {\n element.style.removeProperty(name);\n }\n }\n };\n};\n"]}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAE3C,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAO7C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAU,EAAE;IAC3D,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,oCAAoC,OAAO,IAAI,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAe,EAAU,EAAE;IAC5D,OAAO,WAAW,kBAAkB,KAAK,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC;AAC3E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAoB,EAAE,EAAE,OAAO,EAAE,KAAK,GAAG,EAAE,EAA6B,EAAgB,EAAE;IAC1H,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAE3B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,6DAA6D,IAAI,IAAI,CAAC,CAAC;QACzF,CAAC;IACH,CAAC;IAED,MAAM,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAC/D,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CA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CAAC,CAAC","sourcesContent":["export const MF_SCOPE_ATTRIBUTE = 'data-edyn-mf';\nexport const MF_ROOT_SELECTOR = ':mf-root';\n\nexport * from './navigation';\n\nconst SCOPE_ID_PATTERN = /^[a-z][a-z0-9-]*$/;\n\nexport interface IPrepareMfBoundaryOptions {\n scopeId: string;\n theme?: Record<string, string>;\n}\n\nexport const validateMfScopeId = (scopeId: string): string => {\n if (!SCOPE_ID_PATTERN.test(scopeId)) {\n throw new Error(`Invalid microfrontend scope id: \"${scopeId}\".`);\n }\n\n return scopeId;\n};\n\nexport const getMfScopeSelector = (scopeId: string): string => {\n return `:where([${MF_SCOPE_ATTRIBUTE}=\"${validateMfScopeId(scopeId)}\"])`;\n};\n\nexport const prepareMfBoundary = (element: HTMLElement, { scopeId, theme = {} }: IPrepareMfBoundaryOptions): (() => void) => {\n validateMfScopeId(scopeId);\n\n for (const name of Object.keys(theme)) {\n if (!name.startsWith('--')) {\n throw new Error(`Microfrontend theme token must be a CSS custom property: \"${name}\".`);\n }\n }\n\n const previousScope = element.getAttribute(MF_SCOPE_ATTRIBUTE);\n const hadRootClass = element.classList.contains('edx-root');\n const previousTheme = new Map<string, { priority: string; value: string }>();\n\n element.setAttribute(MF_SCOPE_ATTRIBUTE, scopeId);\n element.classList.add('edx-root');\n\n for (const [name, value] of Object.entries(theme)) {\n previousTheme.set(name, {\n priority: element.style.getPropertyPriority(name),\n value: element.style.getPropertyValue(name),\n });\n element.style.setProperty(name, value);\n }\n\n return () => {\n if (previousScope === null) {\n element.removeAttribute(MF_SCOPE_ATTRIBUTE);\n } else {\n element.setAttribute(MF_SCOPE_ATTRIBUTE, previousScope);\n }\n\n if (!hadRootClass) {\n element.classList.remove('edx-root');\n }\n\n for (const [name, previous] of previousTheme) {\n if (previous.value) {\n element.style.setProperty(name, previous.value, previous.priority);\n } else {\n element.style.removeProperty(name);\n }\n }\n };\n};\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const MF_NAVIGATION_CONTRACT_VERSION: 1;
|
|
2
|
+
export type TMfNavigationCounterTone = 'danger' | 'neutral' | 'success' | 'warning';
|
|
3
|
+
export interface IMfNavigationCounterReference {
|
|
4
|
+
id: string;
|
|
5
|
+
tone?: TMfNavigationCounterTone;
|
|
6
|
+
}
|
|
7
|
+
export interface IMfNavigationItem {
|
|
8
|
+
accessKey?: string;
|
|
9
|
+
children?: readonly IMfNavigationItem[];
|
|
10
|
+
counters?: readonly IMfNavigationCounterReference[];
|
|
11
|
+
icon?: string;
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
order: number;
|
|
15
|
+
path?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface IMfNavigationDefinition {
|
|
18
|
+
applicationId: number;
|
|
19
|
+
contractVersion: typeof MF_NAVIGATION_CONTRACT_VERSION;
|
|
20
|
+
items: readonly IMfNavigationItem[];
|
|
21
|
+
label: string;
|
|
22
|
+
landingPath: string;
|
|
23
|
+
moduleId: string;
|
|
24
|
+
}
|
|
25
|
+
export interface IMfNavigationManifest extends IMfNavigationDefinition {
|
|
26
|
+
revision: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const defineMfNavigation: (value: IMfNavigationDefinition) => Readonly<IMfNavigationDefinition>;
|
|
29
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../src/navigation.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,EAAG,CAAU,CAAC;AAMzD,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpF,MAAM,WAAW,6BAA6B;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,wBAAwB,CAAC;CACjC;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACxC,QAAQ,CAAC,EAAE,SAAS,6BAA6B,EAAE,CAAC;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,OAAO,8BAA8B,CAAC;IACvD,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAsB,SAAQ,uBAAuB;IACpE,QAAQ,EAAE,MAAM,CAAC;CAClB;AA8GD,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,KAAG,QAAQ,CAAC,uBAAuB,CAoCnG,CAAC","sourcesContent":["export const MF_NAVIGATION_CONTRACT_VERSION = 1 as const;\n\nconst IDENTIFIER_PATTERN = /^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/;\nconst MODULE_ID_PATTERN = /^[a-z][a-z0-9-]*$/;\nconst RELATIVE_ROUTE_PATTERN = /^(?!\\/)(?!.*(?:^|\\/)\\.\\.?(?:\\/|$))[a-zA-Z0-9][a-zA-Z0-9/_-]*$/;\n\nexport type TMfNavigationCounterTone = 'danger' | 'neutral' | 'success' | 'warning';\n\nexport interface IMfNavigationCounterReference {\n id: string;\n tone?: TMfNavigationCounterTone;\n}\n\nexport interface IMfNavigationItem {\n accessKey?: string;\n children?: readonly IMfNavigationItem[];\n counters?: readonly IMfNavigationCounterReference[];\n icon?: string;\n id: string;\n label: string;\n order: number;\n path?: string;\n}\n\nexport interface IMfNavigationDefinition {\n applicationId: number;\n contractVersion: typeof MF_NAVIGATION_CONTRACT_VERSION;\n items: readonly IMfNavigationItem[];\n label: string;\n landingPath: string;\n moduleId: string;\n}\n\nexport interface IMfNavigationManifest extends IMfNavigationDefinition {\n revision: string;\n}\n\nconst assertPlainObject = (value: unknown, location: string): Record<string, unknown> => {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new Error(`${location} must be a plain object.`);\n }\n\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) {\n throw new Error(`${location} must be a plain object.`);\n }\n\n return value as Record<string, unknown>;\n};\n\nconst assertExactKeys = (value: Record<string, unknown>, allowedKeys: readonly string[], location: string): void => {\n const allowed = new Set(allowedKeys);\n const unknownKey = Object.keys(value).find((key) => !allowed.has(key));\n if (unknownKey) {\n throw new Error(`${location} contains unsupported property \"${unknownKey}\".`);\n }\n};\n\nconst assertNonEmptyString = (value: unknown, location: string): string => {\n if (typeof value !== 'string' || value.trim() !== value || value.length === 0) {\n throw new Error(`${location} must be a non-empty trimmed string.`);\n }\n\n return value;\n};\n\nconst assertIdentifier = (value: unknown, location: string): string => {\n const identifier = assertNonEmptyString(value, location);\n if (!IDENTIFIER_PATTERN.test(identifier)) {\n throw new Error(`${location} must be a stable lowercase identifier.`);\n }\n\n return identifier;\n};\n\nconst normalizeCounter = (value: unknown, location: string): IMfNavigationCounterReference => {\n const counter = assertPlainObject(value, location);\n assertExactKeys(counter, ['id', 'tone'], location);\n\n const id = assertIdentifier(counter.id, `${location}.id`);\n const tone = counter.tone;\n if (tone !== undefined && tone !== 'danger' && tone !== 'neutral' && tone !== 'success' && tone !== 'warning') {\n throw new Error(`${location}.tone is not supported.`);\n }\n\n return Object.freeze(tone === undefined ? { id } : { id, tone });\n};\n\nconst normalizeItems = (values: unknown, location: string, seenIds: Set<string>): readonly IMfNavigationItem[] => {\n if (!Array.isArray(values)) {\n throw new Error(`${location} must be an array.`);\n }\n\n const items = values.map((value, index) => {\n const itemLocation = `${location}[${index}]`;\n const item = assertPlainObject(value, itemLocation);\n assertExactKeys(item, ['accessKey', 'children', 'counters', 'icon', 'id', 'label', 'order', 'path'], itemLocation);\n\n const id = assertIdentifier(item.id, `${itemLocation}.id`);\n if (seenIds.has(id)) {\n throw new Error(`${itemLocation}.id must be unique within the navigation tree.`);\n }\n seenIds.add(id);\n\n const label = assertNonEmptyString(item.label, `${itemLocation}.label`);\n if (!Number.isSafeInteger(item.order) || (item.order as number) < 0) {\n throw new Error(`${itemLocation}.order must be a non-negative safe integer.`);\n }\n\n const path = item.path;\n if (path !== undefined && (typeof path !== 'string' || !RELATIVE_ROUTE_PATTERN.test(path))) {\n throw new Error(`${itemLocation}.path must be an origin-safe module-relative route.`);\n }\n\n const icon = item.icon === undefined ? undefined : assertIdentifier(item.icon, `${itemLocation}.icon`);\n const accessKey = item.accessKey === undefined ? undefined : assertIdentifier(item.accessKey, `${itemLocation}.accessKey`);\n\n if (item.counters !== undefined && !Array.isArray(item.counters)) {\n throw new Error(`${itemLocation}.counters must be an array.`);\n }\n const counters = item.counters?.map((counter, counterIndex) => normalizeCounter(counter, `${itemLocation}.counters[${counterIndex}]`));\n if (counters && new Set(counters.map((counter) => counter.id)).size !== counters.length) {\n throw new Error(`${itemLocation}.counters contains duplicate counter ids.`);\n }\n\n const children = item.children === undefined ? undefined : normalizeItems(item.children, `${itemLocation}.children`, seenIds);\n if (path === undefined && (!children || children.length === 0)) {\n throw new Error(`${itemLocation} must define a path or at least one child.`);\n }\n\n return Object.freeze({\n ...(accessKey === undefined ? {} : { accessKey }),\n ...(children === undefined ? {} : { children }),\n ...(counters === undefined ? {} : { counters }),\n ...(icon === undefined ? {} : { icon }),\n id,\n label,\n order: item.order as number,\n ...(path === undefined ? {} : { path }),\n });\n });\n\n return Object.freeze(items.sort((left, right) => left.order - right.order || left.id.localeCompare(right.id)));\n};\n\nexport const defineMfNavigation = (value: IMfNavigationDefinition): Readonly<IMfNavigationDefinition> => {\n const definition = assertPlainObject(value, 'navigation');\n assertExactKeys(definition, ['applicationId', 'contractVersion', 'items', 'label', 'landingPath', 'moduleId'], 'navigation');\n\n if (definition.contractVersion !== MF_NAVIGATION_CONTRACT_VERSION) {\n throw new Error(`navigation.contractVersion must be ${MF_NAVIGATION_CONTRACT_VERSION}.`);\n }\n\n if (!Number.isSafeInteger(definition.applicationId) || (definition.applicationId as number) <= 0) {\n throw new Error('navigation.applicationId must be a positive safe integer.');\n }\n\n const moduleId = assertNonEmptyString(definition.moduleId, 'navigation.moduleId');\n if (!MODULE_ID_PATTERN.test(moduleId)) {\n throw new Error('navigation.moduleId must be a lowercase module identifier.');\n }\n\n const label = assertNonEmptyString(definition.label, 'navigation.label');\n const landingPath = definition.landingPath;\n if (typeof landingPath !== 'string' || !RELATIVE_ROUTE_PATTERN.test(landingPath)) {\n throw new Error('navigation.landingPath must be an origin-safe module-relative route.');\n }\n\n const items = normalizeItems(definition.items, 'navigation.items', new Set());\n if (items.length === 0) {\n throw new Error('navigation.items must contain at least one item.');\n }\n\n return Object.freeze({\n applicationId: definition.applicationId as number,\n contractVersion: MF_NAVIGATION_CONTRACT_VERSION,\n items,\n label,\n landingPath,\n moduleId,\n });\n};\n"]}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export const MF_NAVIGATION_CONTRACT_VERSION = 1;
|
|
2
|
+
const IDENTIFIER_PATTERN = /^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/;
|
|
3
|
+
const MODULE_ID_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
4
|
+
const RELATIVE_ROUTE_PATTERN = /^(?!\/)(?!.*(?:^|\/)\.\.?(?:\/|$))[a-zA-Z0-9][a-zA-Z0-9/_-]*$/;
|
|
5
|
+
const assertPlainObject = (value, location) => {
|
|
6
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
7
|
+
throw new Error(`${location} must be a plain object.`);
|
|
8
|
+
}
|
|
9
|
+
const prototype = Object.getPrototypeOf(value);
|
|
10
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
11
|
+
throw new Error(`${location} must be a plain object.`);
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
};
|
|
15
|
+
const assertExactKeys = (value, allowedKeys, location) => {
|
|
16
|
+
const allowed = new Set(allowedKeys);
|
|
17
|
+
const unknownKey = Object.keys(value).find((key) => !allowed.has(key));
|
|
18
|
+
if (unknownKey) {
|
|
19
|
+
throw new Error(`${location} contains unsupported property "${unknownKey}".`);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const assertNonEmptyString = (value, location) => {
|
|
23
|
+
if (typeof value !== 'string' || value.trim() !== value || value.length === 0) {
|
|
24
|
+
throw new Error(`${location} must be a non-empty trimmed string.`);
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
};
|
|
28
|
+
const assertIdentifier = (value, location) => {
|
|
29
|
+
const identifier = assertNonEmptyString(value, location);
|
|
30
|
+
if (!IDENTIFIER_PATTERN.test(identifier)) {
|
|
31
|
+
throw new Error(`${location} must be a stable lowercase identifier.`);
|
|
32
|
+
}
|
|
33
|
+
return identifier;
|
|
34
|
+
};
|
|
35
|
+
const normalizeCounter = (value, location) => {
|
|
36
|
+
const counter = assertPlainObject(value, location);
|
|
37
|
+
assertExactKeys(counter, ['id', 'tone'], location);
|
|
38
|
+
const id = assertIdentifier(counter.id, `${location}.id`);
|
|
39
|
+
const tone = counter.tone;
|
|
40
|
+
if (tone !== undefined && tone !== 'danger' && tone !== 'neutral' && tone !== 'success' && tone !== 'warning') {
|
|
41
|
+
throw new Error(`${location}.tone is not supported.`);
|
|
42
|
+
}
|
|
43
|
+
return Object.freeze(tone === undefined ? { id } : { id, tone });
|
|
44
|
+
};
|
|
45
|
+
const normalizeItems = (values, location, seenIds) => {
|
|
46
|
+
if (!Array.isArray(values)) {
|
|
47
|
+
throw new Error(`${location} must be an array.`);
|
|
48
|
+
}
|
|
49
|
+
const items = values.map((value, index) => {
|
|
50
|
+
const itemLocation = `${location}[${index}]`;
|
|
51
|
+
const item = assertPlainObject(value, itemLocation);
|
|
52
|
+
assertExactKeys(item, ['accessKey', 'children', 'counters', 'icon', 'id', 'label', 'order', 'path'], itemLocation);
|
|
53
|
+
const id = assertIdentifier(item.id, `${itemLocation}.id`);
|
|
54
|
+
if (seenIds.has(id)) {
|
|
55
|
+
throw new Error(`${itemLocation}.id must be unique within the navigation tree.`);
|
|
56
|
+
}
|
|
57
|
+
seenIds.add(id);
|
|
58
|
+
const label = assertNonEmptyString(item.label, `${itemLocation}.label`);
|
|
59
|
+
if (!Number.isSafeInteger(item.order) || item.order < 0) {
|
|
60
|
+
throw new Error(`${itemLocation}.order must be a non-negative safe integer.`);
|
|
61
|
+
}
|
|
62
|
+
const path = item.path;
|
|
63
|
+
if (path !== undefined && (typeof path !== 'string' || !RELATIVE_ROUTE_PATTERN.test(path))) {
|
|
64
|
+
throw new Error(`${itemLocation}.path must be an origin-safe module-relative route.`);
|
|
65
|
+
}
|
|
66
|
+
const icon = item.icon === undefined ? undefined : assertIdentifier(item.icon, `${itemLocation}.icon`);
|
|
67
|
+
const accessKey = item.accessKey === undefined ? undefined : assertIdentifier(item.accessKey, `${itemLocation}.accessKey`);
|
|
68
|
+
if (item.counters !== undefined && !Array.isArray(item.counters)) {
|
|
69
|
+
throw new Error(`${itemLocation}.counters must be an array.`);
|
|
70
|
+
}
|
|
71
|
+
const counters = item.counters?.map((counter, counterIndex) => normalizeCounter(counter, `${itemLocation}.counters[${counterIndex}]`));
|
|
72
|
+
if (counters && new Set(counters.map((counter) => counter.id)).size !== counters.length) {
|
|
73
|
+
throw new Error(`${itemLocation}.counters contains duplicate counter ids.`);
|
|
74
|
+
}
|
|
75
|
+
const children = item.children === undefined ? undefined : normalizeItems(item.children, `${itemLocation}.children`, seenIds);
|
|
76
|
+
if (path === undefined && (!children || children.length === 0)) {
|
|
77
|
+
throw new Error(`${itemLocation} must define a path or at least one child.`);
|
|
78
|
+
}
|
|
79
|
+
return Object.freeze({
|
|
80
|
+
...(accessKey === undefined ? {} : { accessKey }),
|
|
81
|
+
...(children === undefined ? {} : { children }),
|
|
82
|
+
...(counters === undefined ? {} : { counters }),
|
|
83
|
+
...(icon === undefined ? {} : { icon }),
|
|
84
|
+
id,
|
|
85
|
+
label,
|
|
86
|
+
order: item.order,
|
|
87
|
+
...(path === undefined ? {} : { path }),
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
return Object.freeze(items.sort((left, right) => left.order - right.order || left.id.localeCompare(right.id)));
|
|
91
|
+
};
|
|
92
|
+
export const defineMfNavigation = (value) => {
|
|
93
|
+
const definition = assertPlainObject(value, 'navigation');
|
|
94
|
+
assertExactKeys(definition, ['applicationId', 'contractVersion', 'items', 'label', 'landingPath', 'moduleId'], 'navigation');
|
|
95
|
+
if (definition.contractVersion !== MF_NAVIGATION_CONTRACT_VERSION) {
|
|
96
|
+
throw new Error(`navigation.contractVersion must be ${MF_NAVIGATION_CONTRACT_VERSION}.`);
|
|
97
|
+
}
|
|
98
|
+
if (!Number.isSafeInteger(definition.applicationId) || definition.applicationId <= 0) {
|
|
99
|
+
throw new Error('navigation.applicationId must be a positive safe integer.');
|
|
100
|
+
}
|
|
101
|
+
const moduleId = assertNonEmptyString(definition.moduleId, 'navigation.moduleId');
|
|
102
|
+
if (!MODULE_ID_PATTERN.test(moduleId)) {
|
|
103
|
+
throw new Error('navigation.moduleId must be a lowercase module identifier.');
|
|
104
|
+
}
|
|
105
|
+
const label = assertNonEmptyString(definition.label, 'navigation.label');
|
|
106
|
+
const landingPath = definition.landingPath;
|
|
107
|
+
if (typeof landingPath !== 'string' || !RELATIVE_ROUTE_PATTERN.test(landingPath)) {
|
|
108
|
+
throw new Error('navigation.landingPath must be an origin-safe module-relative route.');
|
|
109
|
+
}
|
|
110
|
+
const items = normalizeItems(definition.items, 'navigation.items', new Set());
|
|
111
|
+
if (items.length === 0) {
|
|
112
|
+
throw new Error('navigation.items must contain at least one item.');
|
|
113
|
+
}
|
|
114
|
+
return Object.freeze({
|
|
115
|
+
applicationId: definition.applicationId,
|
|
116
|
+
contractVersion: MF_NAVIGATION_CONTRACT_VERSION,
|
|
117
|
+
items,
|
|
118
|
+
label,
|
|
119
|
+
landingPath,
|
|
120
|
+
moduleId,
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=navigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../src/navigation.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAU,CAAC;AAEzD,MAAM,kBAAkB,GAAG,oCAAoC,CAAC;AAChE,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAC9C,MAAM,sBAAsB,GAAG,+DAA+D,CAAC;AAiC/F,MAAM,iBAAiB,GAAG,CAAC,KAAc,EAAE,QAAgB,EAA2B,EAAE;IACtF,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,0BAA0B,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC/C,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,0BAA0B,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,KAAgC,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAA8B,EAAE,WAA8B,EAAE,QAAgB,EAAQ,EAAE;IACjH,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IACrC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CA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AC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QACjF,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;IAC1F,CAAC;IAED,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,CAAC,KAAK,EAAE,kBAAkB,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;IAC9E,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,aAAa,EAAE,UAAU,CAAC,aAAuB;QACjD,eAAe,EAAE,8BAA8B;QAC/C,KAAK;QACL,KAAK;QACL,WAAW;QACX,QAAQ;KACT,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["export const MF_NAVIGATION_CONTRACT_VERSION = 1 as const;\n\nconst IDENTIFIER_PATTERN = /^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/;\nconst MODULE_ID_PATTERN = /^[a-z][a-z0-9-]*$/;\nconst RELATIVE_ROUTE_PATTERN = /^(?!\\/)(?!.*(?:^|\\/)\\.\\.?(?:\\/|$))[a-zA-Z0-9][a-zA-Z0-9/_-]*$/;\n\nexport type TMfNavigationCounterTone = 'danger' | 'neutral' | 'success' | 'warning';\n\nexport interface IMfNavigationCounterReference {\n id: string;\n tone?: TMfNavigationCounterTone;\n}\n\nexport interface IMfNavigationItem {\n accessKey?: string;\n children?: readonly IMfNavigationItem[];\n counters?: readonly IMfNavigationCounterReference[];\n icon?: string;\n id: string;\n label: string;\n order: number;\n path?: string;\n}\n\nexport interface IMfNavigationDefinition {\n applicationId: number;\n contractVersion: typeof MF_NAVIGATION_CONTRACT_VERSION;\n items: readonly IMfNavigationItem[];\n label: string;\n landingPath: string;\n moduleId: string;\n}\n\nexport interface IMfNavigationManifest extends IMfNavigationDefinition {\n revision: string;\n}\n\nconst assertPlainObject = (value: unknown, location: string): Record<string, unknown> => {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new Error(`${location} must be a plain object.`);\n }\n\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) {\n throw new Error(`${location} must be a plain object.`);\n }\n\n return value as Record<string, unknown>;\n};\n\nconst assertExactKeys = (value: Record<string, unknown>, allowedKeys: readonly string[], location: string): void => {\n const allowed = new Set(allowedKeys);\n const unknownKey = Object.keys(value).find((key) => !allowed.has(key));\n if (unknownKey) {\n throw new Error(`${location} contains unsupported property \"${unknownKey}\".`);\n }\n};\n\nconst assertNonEmptyString = (value: unknown, location: string): string => {\n if (typeof value !== 'string' || value.trim() !== value || value.length === 0) {\n throw new Error(`${location} must be a non-empty trimmed string.`);\n }\n\n return value;\n};\n\nconst assertIdentifier = (value: unknown, location: string): string => {\n const identifier = assertNonEmptyString(value, location);\n if (!IDENTIFIER_PATTERN.test(identifier)) {\n throw new Error(`${location} must be a stable lowercase identifier.`);\n }\n\n return identifier;\n};\n\nconst normalizeCounter = (value: unknown, location: string): IMfNavigationCounterReference => {\n const counter = assertPlainObject(value, location);\n assertExactKeys(counter, ['id', 'tone'], location);\n\n const id = assertIdentifier(counter.id, `${location}.id`);\n const tone = counter.tone;\n if (tone !== undefined && tone !== 'danger' && tone !== 'neutral' && tone !== 'success' && tone !== 'warning') {\n throw new Error(`${location}.tone is not supported.`);\n }\n\n return Object.freeze(tone === undefined ? { id } : { id, tone });\n};\n\nconst normalizeItems = (values: unknown, location: string, seenIds: Set<string>): readonly IMfNavigationItem[] => {\n if (!Array.isArray(values)) {\n throw new Error(`${location} must be an array.`);\n }\n\n const items = values.map((value, index) => {\n const itemLocation = `${location}[${index}]`;\n const item = assertPlainObject(value, itemLocation);\n assertExactKeys(item, ['accessKey', 'children', 'counters', 'icon', 'id', 'label', 'order', 'path'], itemLocation);\n\n const id = assertIdentifier(item.id, `${itemLocation}.id`);\n if (seenIds.has(id)) {\n throw new Error(`${itemLocation}.id must be unique within the navigation tree.`);\n }\n seenIds.add(id);\n\n const label = assertNonEmptyString(item.label, `${itemLocation}.label`);\n if (!Number.isSafeInteger(item.order) || (item.order as number) < 0) {\n throw new Error(`${itemLocation}.order must be a non-negative safe integer.`);\n }\n\n const path = item.path;\n if (path !== undefined && (typeof path !== 'string' || !RELATIVE_ROUTE_PATTERN.test(path))) {\n throw new Error(`${itemLocation}.path must be an origin-safe module-relative route.`);\n }\n\n const icon = item.icon === undefined ? undefined : assertIdentifier(item.icon, `${itemLocation}.icon`);\n const accessKey = item.accessKey === undefined ? undefined : assertIdentifier(item.accessKey, `${itemLocation}.accessKey`);\n\n if (item.counters !== undefined && !Array.isArray(item.counters)) {\n throw new Error(`${itemLocation}.counters must be an array.`);\n }\n const counters = item.counters?.map((counter, counterIndex) => normalizeCounter(counter, `${itemLocation}.counters[${counterIndex}]`));\n if (counters && new Set(counters.map((counter) => counter.id)).size !== counters.length) {\n throw new Error(`${itemLocation}.counters contains duplicate counter ids.`);\n }\n\n const children = item.children === undefined ? undefined : normalizeItems(item.children, `${itemLocation}.children`, seenIds);\n if (path === undefined && (!children || children.length === 0)) {\n throw new Error(`${itemLocation} must define a path or at least one child.`);\n }\n\n return Object.freeze({\n ...(accessKey === undefined ? {} : { accessKey }),\n ...(children === undefined ? {} : { children }),\n ...(counters === undefined ? {} : { counters }),\n ...(icon === undefined ? {} : { icon }),\n id,\n label,\n order: item.order as number,\n ...(path === undefined ? {} : { path }),\n });\n });\n\n return Object.freeze(items.sort((left, right) => left.order - right.order || left.id.localeCompare(right.id)));\n};\n\nexport const defineMfNavigation = (value: IMfNavigationDefinition): Readonly<IMfNavigationDefinition> => {\n const definition = assertPlainObject(value, 'navigation');\n assertExactKeys(definition, ['applicationId', 'contractVersion', 'items', 'label', 'landingPath', 'moduleId'], 'navigation');\n\n if (definition.contractVersion !== MF_NAVIGATION_CONTRACT_VERSION) {\n throw new Error(`navigation.contractVersion must be ${MF_NAVIGATION_CONTRACT_VERSION}.`);\n }\n\n if (!Number.isSafeInteger(definition.applicationId) || (definition.applicationId as number) <= 0) {\n throw new Error('navigation.applicationId must be a positive safe integer.');\n }\n\n const moduleId = assertNonEmptyString(definition.moduleId, 'navigation.moduleId');\n if (!MODULE_ID_PATTERN.test(moduleId)) {\n throw new Error('navigation.moduleId must be a lowercase module identifier.');\n }\n\n const label = assertNonEmptyString(definition.label, 'navigation.label');\n const landingPath = definition.landingPath;\n if (typeof landingPath !== 'string' || !RELATIVE_ROUTE_PATTERN.test(landingPath)) {\n throw new Error('navigation.landingPath must be an origin-safe module-relative route.');\n }\n\n const items = normalizeItems(definition.items, 'navigation.items', new Set());\n if (items.length === 0) {\n throw new Error('navigation.items must contain at least one item.');\n }\n\n return Object.freeze({\n applicationId: definition.applicationId as number,\n contractVersion: MF_NAVIGATION_CONTRACT_VERSION,\n items,\n label,\n landingPath,\n moduleId,\n });\n};\n"]}
|
package/dist/postcss.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcss.d.ts","sourceRoot":"","sources":["../src/postcss.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,MAAM,EAAwB,MAAM,SAAS,CAAC;AAKlE,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB;AA8KD,eAAO,MAAM,gCAAgC,GAAI,WAAW,MAAM,GAAG,SAAS,KAAG,OAEhF,CAAC;AA0NF,eAAO,MAAM,cAAc,GAAI,aAAa,sBAAsB,KAAG,MAWpE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,aAAa,sBAAsB,KAAG,MAiB3E,CAAC"}
|
|
1
|
+
{"version":3,"file":"postcss.d.ts","sourceRoot":"","sources":["../src/postcss.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,MAAM,EAAwB,MAAM,SAAS,CAAC;AAKlE,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB;AA8KD,eAAO,MAAM,gCAAgC,GAAI,WAAW,MAAM,GAAG,SAAS,KAAG,OAEhF,CAAC;AA0NF,eAAO,MAAM,cAAc,GAAI,aAAa,sBAAsB,KAAG,MAWpE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,aAAa,sBAAsB,KAAG,MAiB3E,CAAC","sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { list, type Plugin, type Root, type Rule } from 'postcss';\nimport selectorParser from 'postcss-selector-parser';\nimport valueParser from 'postcss-value-parser';\nimport { getMfScopeSelector, MF_ROOT_SELECTOR, MF_SCOPE_ATTRIBUTE, validateMfScopeId } from './index.js';\n\nexport interface IScopeRemoteCssOptions {\n scopeId: string;\n}\n\nconst ANGULAR_COMPONENT_STYLE_PATTERN = /\\.component\\.(?:css|less|sass|scss)$/i;\nconst VIEW_ENCAPSULATION_NONE_PATTERN = /(?:^|[,{])\\s*encapsulation\\s*:\\s*(?:[A-Za-z_$][\\w$]*\\s*\\.\\s*)+None\\b/m;\nconst MF_OVERLAY_ATTRIBUTE = 'data-edyn-mf-overlay';\n\ntype TTypeScriptMaskState = 'block-comment' | 'code' | 'double-quote' | 'line-comment' | 'single-quote' | 'template';\n\nconst maskTypeScriptCommentsAndStrings = (source: string): string => {\n let maskedSource = '';\n let state: TTypeScriptMaskState = 'code';\n let escaped = false;\n\n const maskCharacter = (character: string): string => {\n return character === '\\n' || character === '\\r' ? character : ' ';\n };\n\n for (let index = 0; index < source.length; index += 1) {\n const character = source[index] ?? '';\n const nextCharacter = source[index + 1];\n\n if (state === 'code') {\n if (character === '/' && nextCharacter === '/') {\n maskedSource += ' ';\n index += 1;\n state = 'line-comment';\n } else if (character === '/' && nextCharacter === '*') {\n maskedSource += ' ';\n index += 1;\n state = 'block-comment';\n } else if (character === \"'\") {\n maskedSource += ' ';\n state = 'single-quote';\n } else if (character === '\"') {\n maskedSource += ' ';\n state = 'double-quote';\n } else if (character === '`') {\n maskedSource += ' ';\n state = 'template';\n } else {\n maskedSource += character;\n }\n continue;\n }\n\n if (state === 'line-comment') {\n maskedSource += maskCharacter(character);\n if (character === '\\n' || character === '\\r') {\n state = 'code';\n }\n continue;\n }\n\n if (state === 'block-comment') {\n if (character === '*' && nextCharacter === '/') {\n maskedSource += ' ';\n index += 1;\n state = 'code';\n } else {\n maskedSource += maskCharacter(character);\n }\n continue;\n }\n\n maskedSource += maskCharacter(character);\n if (escaped) {\n escaped = false;\n } else if (character === '\\\\') {\n escaped = true;\n } else if (\n (state === 'single-quote' && character === \"'\") ||\n (state === 'double-quote' && character === '\"') ||\n (state === 'template' && character === '`')\n ) {\n state = 'code';\n }\n }\n\n return maskedSource;\n};\n\nconst isKeyframesRule = (rule: Rule): boolean => {\n const parent = rule.parent;\n return parent?.type === 'atrule' && /keyframes$/i.test(parent.name);\n};\n\nconst isRootNode = (node: selectorParser.Node): boolean => {\n return (\n (node.type === 'tag' && (node.value.toLowerCase() === 'html' || node.value.toLowerCase() === 'body')) ||\n (node.type === 'pseudo' && (node.value === ':root' || node.value === MF_ROOT_SELECTOR))\n );\n};\n\nconst isScopeNode = (node: selectorParser.Node | undefined, scopeId: string): boolean => {\n if (node?.type === 'attribute' && node.attribute === MF_SCOPE_ATTRIBUTE && node.operator === '=' && node.value === scopeId) {\n return true;\n }\n\n const normalized = node?.toString().replaceAll('\"', '').replaceAll(\"'\", '');\n return (\n node?.type === 'pseudo' &&\n (normalized === `:where([${MF_SCOPE_ATTRIBUTE}=${scopeId}])` ||\n normalized === `:where([${MF_SCOPE_ATTRIBUTE}=${scopeId}]:not([${MF_OVERLAY_ATTRIBUTE}]))`)\n );\n};\n\nconst startsWithHostPseudo = (selector: selectorParser.Selector): boolean => {\n return selector.first?.type === 'pseudo' && selector.first.value === ':host';\n};\n\nconst removeRootIdentityIds = (selector: selectorParser.Selector): void => {\n let compound: selectorParser.Node[] = [];\n const removeIdsFromRootCompound = (): void => {\n if (compound.some(isRootNode)) {\n for (const node of compound) {\n if (node.type === 'id') {\n node.remove();\n }\n }\n }\n };\n\n for (const node of [...selector.nodes]) {\n if (node.type === 'combinator') {\n removeIdsFromRootCompound();\n compound = [];\n } else {\n compound.push(node);\n }\n }\n removeIdsFromRootCompound();\n};\n\nconst isRootOnlySelector = (selector: selectorParser.Selector): boolean => {\n const compounds: selectorParser.Node[][] = [[]];\n\n for (const node of selector.nodes) {\n if (node.type === 'combinator') {\n compounds.push([]);\n } else {\n compounds.at(-1)?.push(node);\n }\n }\n\n return compounds.every((compound) => compound.some(isRootNode));\n};\n\nconst hasRootOnlySelector = (selectorList: string): boolean => {\n let result = false;\n selectorParser((root) => {\n result = root.nodes.some(isRootOnlySelector);\n }).processSync(selectorList);\n return result;\n};\n\nconst getAngularComponentSourcePath = (stylePath: string): string | undefined => {\n const cleanStylePath = stylePath.replace(/[?#].*$/, '');\n if (!ANGULAR_COMPONENT_STYLE_PATTERN.test(cleanStylePath)) {\n return undefined;\n }\n\n return cleanStylePath.replace(/\\.(?:css|less|sass|scss)$/i, '.ts');\n};\n\nconst usesViewEncapsulationNone = (stylePath: string): boolean => {\n const componentSourcePath = getAngularComponentSourcePath(stylePath);\n if (!componentSourcePath || !existsSync(componentSourcePath)) {\n return false;\n }\n\n const componentSource = readFileSync(componentSourcePath, 'utf8');\n return VIEW_ENCAPSULATION_NONE_PATTERN.test(maskTypeScriptCommentsAndStrings(componentSource));\n};\n\nexport const shouldUseAngularComponentScoping = (stylePath: string | undefined): boolean => {\n return !!stylePath && !!getAngularComponentSourcePath(stylePath) && !usesViewEncapsulationNone(stylePath);\n};\n\nconst scopeSelectorList = (selectorList: string, scopeId: string, scopeSelector: string, rootScopeSelectors: string[]): string => {\n return selectorParser((root) => {\n const sourceSelectors = [...root.nodes];\n\n for (const selector of sourceSelectors) {\n const rootNodes = selector.nodes.filter(isRootNode);\n\n if (rootNodes.length > 0) {\n const replacementSelectors = isRootOnlySelector(selector) ? rootScopeSelectors : [`[${MF_SCOPE_ATTRIBUTE}=\"${scopeId}\"]`];\n\n for (const replacementSelector of replacementSelectors) {\n const variant = selector.clone();\n removeRootIdentityIds(variant);\n const [firstRoot, ...duplicateRoots] = variant.nodes.filter(isRootNode);\n const scopeNode = selectorParser().astSync(replacementSelector).first.first.clone();\n firstRoot?.replaceWith(scopeNode);\n\n for (const duplicateRoot of duplicateRoots) {\n const previous = duplicateRoot.prev();\n if (previous?.type === 'combinator') {\n previous.remove();\n }\n duplicateRoot.remove();\n }\n\n root.insertBefore(selector, variant);\n }\n selector.remove();\n continue;\n }\n\n if (startsWithHostPseudo(selector) || isScopeNode(selector.first, scopeId)) {\n continue;\n }\n\n const first = selector.first;\n const needsBoundaryVariant = first?.type === 'universal' || (first?.type === 'pseudo' && first.value.startsWith('::'));\n\n if (needsBoundaryVariant) {\n const hasSiblingCombinator = selector.nodes.some((node) => node.type === 'combinator' && (node.value === '+' || node.value === '~'));\n\n if (!hasSiblingCombinator) {\n const boundaryVariant = selector.clone();\n const boundaryScope = selectorParser().astSync(scopeSelector).first.first.clone();\n boundaryVariant.first.rawSpaceBefore = '';\n if (boundaryVariant.first.type === 'universal') {\n boundaryVariant.first.replaceWith(boundaryScope);\n } else {\n boundaryVariant.prepend(boundaryScope);\n }\n root.insertBefore(selector, boundaryVariant);\n }\n }\n\n const descendantScope = selectorParser().astSync(`${scopeSelector} *`).first;\n const prefixNodes = descendantScope.nodes.slice(0, -1).map((node) => node.clone());\n selector.first.rawSpaceBefore = '';\n for (const prefixNode of prefixNodes.reverse()) {\n selector.prepend(prefixNode);\n }\n }\n\n const seenSelectors = new Set<string>();\n for (const selector of [...root.nodes]) {\n const normalizedSelector = selector.toString().trim();\n if (seenSelectors.has(normalizedSelector)) {\n selector.remove();\n } else {\n seenSelectors.add(normalizedSelector);\n }\n }\n }).processSync(selectorList);\n};\n\nconst findFunctionalPseudoEnd = (selector: string, openParenthesisIndex: number): number => {\n let depth = 0;\n let quote: '\"' | \"'\" | undefined;\n\n for (let index = openParenthesisIndex; index < selector.length; index += 1) {\n const character = selector[index];\n const previousCharacter = selector[index - 1];\n\n if (quote) {\n if (character === quote && previousCharacter !== '\\\\') {\n quote = undefined;\n }\n continue;\n }\n\n if (character === '\"' || character === \"'\") {\n quote = character;\n continue;\n }\n\n if (character === '(') {\n depth += 1;\n } else if (character === ')') {\n depth -= 1;\n if (depth === 0) {\n return index;\n }\n }\n }\n\n return -1;\n};\n\nconst scopeAngularSelector = (selector: string, boundarySelector: string): string => {\n const normalizedSelector = selector.trim();\n const angularBoundary = `:host-context(${boundarySelector})`;\n const normalizedBoundary = normalizedSelector.slice(0, angularBoundary.length).replaceAll(\"'\", '\"');\n\n if (normalizedBoundary === angularBoundary) {\n return normalizedSelector;\n }\n\n if (/^:host-context\\(/i.test(normalizedSelector)) {\n return `${angularBoundary}${normalizedSelector}`;\n }\n\n if (/^:host\\(/i.test(normalizedSelector)) {\n const openParenthesisIndex = normalizedSelector.indexOf('(');\n const closeParenthesisIndex = findFunctionalPseudoEnd(normalizedSelector, openParenthesisIndex);\n if (closeParenthesisIndex !== -1) {\n const hostSelector = normalizedSelector.slice(openParenthesisIndex + 1, closeParenthesisIndex);\n const remainder = normalizedSelector.slice(closeParenthesisIndex + 1);\n return list\n .comma(hostSelector)\n .map((hostSelectorVariant) => `${angularBoundary}${hostSelectorVariant}${remainder}`)\n .join(', ');\n }\n }\n\n if (/^:host\\b/i.test(normalizedSelector)) {\n return normalizedSelector.replace(/^:host\\b/i, angularBoundary);\n }\n\n return `${angularBoundary} ${normalizedSelector}`;\n};\n\nconst scopeAngularSelectorList = (selectorList: string, boundarySelector: string): string => {\n return list\n .comma(selectorList)\n .map((selector) => scopeAngularSelector(selector, boundarySelector))\n .join(', ');\n};\n\nconst namespaceKeyframes = (root: Root, keyframePrefix: string): void => {\n const keyframes = new Map<string, string>();\n\n root.walkAtRules((atRule) => {\n if (!/keyframes$/i.test(atRule.name) || atRule.params.startsWith(keyframePrefix)) {\n return;\n }\n\n const originalName = atRule.params.trim();\n const scopedName = `${keyframePrefix}${originalName}`;\n keyframes.set(originalName, scopedName);\n atRule.params = scopedName;\n });\n\n root.walkDecls((declaration) => {\n if (!/^(?:-webkit-)?animation(?:-name)?$/i.test(declaration.prop) && !declaration.prop.startsWith('--animate-')) {\n return;\n }\n\n const parsed = valueParser(declaration.value);\n parsed.walk((node) => {\n if (node.type === 'word') {\n node.value = keyframes.get(node.value) ?? node.value;\n }\n });\n declaration.value = parsed.toString();\n });\n};\n\nconst scopeGlobalRoot = (root: Root, scopeId: string, scopeSelector: string, keyframePrefix: string): void => {\n namespaceKeyframes(root, keyframePrefix);\n const contentRootSelector = `:where([${MF_SCOPE_ATTRIBUTE}=\"${scopeId}\"]:not([${MF_OVERLAY_ATTRIBUTE}]))`;\n root.walkRules((rule) => {\n if (!isKeyframesRule(rule)) {\n const declarations = rule.nodes.filter((node) => node.type === 'decl');\n const customProperties = declarations.filter((declaration) => declaration.prop.startsWith('--'));\n const standardDeclarations = declarations.filter((declaration) => !declaration.prop.startsWith('--'));\n\n if (customProperties.length > 0 && standardDeclarations.length > 0 && hasRootOnlySelector(rule.selector)) {\n const customPropertyRule = rule.cloneBefore();\n customPropertyRule.walkDecls((declaration) => {\n if (!declaration.prop.startsWith('--')) {\n declaration.remove();\n }\n });\n customPropertyRule.selector = scopeSelectorList(customPropertyRule.selector, scopeId, scopeSelector, [':host', scopeSelector]);\n rule.walkDecls((declaration) => {\n if (declaration.prop.startsWith('--')) {\n declaration.remove();\n }\n });\n }\n\n const containsOnlyCustomProperties = declarations.length > 0 && declarations.every((declaration) => declaration.prop.startsWith('--'));\n const rootScopeSelectors = containsOnlyCustomProperties ? [':host', scopeSelector] : [':host', contentRootSelector];\n rule.selector = scopeSelectorList(rule.selector, scopeId, scopeSelector, rootScopeSelectors);\n }\n });\n};\n\nconst scopeAngularComponentRoot = (root: Root, boundarySelector: string, keyframePrefix: string): void => {\n namespaceKeyframes(root, keyframePrefix);\n root.walkRules((rule) => {\n if (!isKeyframesRule(rule)) {\n rule.selector = scopeAngularSelectorList(rule.selector, boundarySelector);\n }\n });\n};\n\nexport const scopeRemoteCss = ({ scopeId }: IScopeRemoteCssOptions): Plugin => {\n const validScopeId = validateMfScopeId(scopeId);\n const scopeSelector = getMfScopeSelector(validScopeId);\n const keyframePrefix = `edyn-mf-${validScopeId}--`;\n\n return {\n postcssPlugin: `edyn-mf-isolation-${validScopeId}`,\n Once(root) {\n scopeGlobalRoot(root, validScopeId, scopeSelector, keyframePrefix);\n },\n };\n};\n\nexport const scopeAngularRemoteCss = ({ scopeId }: IScopeRemoteCssOptions): Plugin => {\n const validScopeId = validateMfScopeId(scopeId);\n const scopeSelector = getMfScopeSelector(validScopeId);\n const boundarySelector = `[${MF_SCOPE_ATTRIBUTE}=\"${validScopeId}\"]`;\n const keyframePrefix = `edyn-mf-${validScopeId}--`;\n\n return {\n postcssPlugin: `edyn-mf-angular-isolation-${validScopeId}`,\n Once(root) {\n if (shouldUseAngularComponentScoping(root.source?.input.file)) {\n scopeAngularComponentRoot(root, boundarySelector, keyframePrefix);\n return;\n }\n\n scopeGlobalRoot(root, validScopeId, scopeSelector, keyframePrefix);\n },\n };\n};\n"]}
|
package/dist/postcss.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcss.js","sourceRoot":"","sources":["../src/postcss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAqC,MAAM,SAAS,CAAC;AAClE,OAAO,cAAc,MAAM,yBAAyB,CAAC;AACrD,OAAO,WAAW,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAMzG,MAAM,+BAA+B,GAAG,uCAAuC,CAAC;AAChF,MAAM,+BAA+B,GAAG,uEAAuE,CAAC;AAChH,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAIpD,MAAM,gCAAgC,GAAG,CAAC,MAAc,EAAU,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AAE,cAAc,CAAC,CAAC;gBAClE,OAAO;YACT,CAAC;YAED,eAAe,CAAC,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;QACrE,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { list, type Plugin, type Root, type Rule } from 'postcss';\nimport selectorParser from 'postcss-selector-parser';\nimport valueParser from 'postcss-value-parser';\nimport { getMfScopeSelector, MF_ROOT_SELECTOR, MF_SCOPE_ATTRIBUTE, validateMfScopeId } from './index.js';\n\nexport interface IScopeRemoteCssOptions {\n scopeId: string;\n}\n\nconst ANGULAR_COMPONENT_STYLE_PATTERN = /\\.component\\.(?:css|less|sass|scss)$/i;\nconst VIEW_ENCAPSULATION_NONE_PATTERN = /(?:^|[,{])\\s*encapsulation\\s*:\\s*(?:[A-Za-z_$][\\w$]*\\s*\\.\\s*)+None\\b/m;\nconst MF_OVERLAY_ATTRIBUTE = 'data-edyn-mf-overlay';\n\ntype TTypeScriptMaskState = 'block-comment' | 'code' | 'double-quote' | 'line-comment' | 'single-quote' | 'template';\n\nconst maskTypeScriptCommentsAndStrings = (source: string): string => {\n let maskedSource = '';\n let state: TTypeScriptMaskState = 'code';\n let escaped = false;\n\n const maskCharacter = (character: string): string => {\n return character === '\\n' || character === '\\r' ? character : ' ';\n };\n\n for (let index = 0; index < source.length; index += 1) {\n const character = source[index] ?? '';\n const nextCharacter = source[index + 1];\n\n if (state === 'code') {\n if (character === '/' && nextCharacter === '/') {\n maskedSource += ' ';\n index += 1;\n state = 'line-comment';\n } else if (character === '/' && nextCharacter === '*') {\n maskedSource += ' ';\n index += 1;\n state = 'block-comment';\n } else if (character === \"'\") {\n maskedSource += ' ';\n state = 'single-quote';\n } else if (character === '\"') {\n maskedSource += ' ';\n state = 'double-quote';\n } else if (character === '`') {\n maskedSource += ' ';\n state = 'template';\n } else {\n maskedSource += character;\n }\n continue;\n }\n\n if (state === 'line-comment') {\n maskedSource += maskCharacter(character);\n if (character === '\\n' || character === '\\r') {\n state = 'code';\n }\n continue;\n }\n\n if (state === 'block-comment') {\n if (character === '*' && nextCharacter === '/') {\n maskedSource += ' ';\n index += 1;\n state = 'code';\n } else {\n maskedSource += maskCharacter(character);\n }\n continue;\n }\n\n maskedSource += maskCharacter(character);\n if (escaped) {\n escaped = false;\n } else if (character === '\\\\') {\n escaped = true;\n } else if (\n (state === 'single-quote' && character === \"'\") ||\n (state === 'double-quote' && character === '\"') ||\n (state === 'template' && character === '`')\n ) {\n state = 'code';\n }\n }\n\n return maskedSource;\n};\n\nconst isKeyframesRule = (rule: Rule): boolean => {\n const parent = rule.parent;\n return parent?.type === 'atrule' && /keyframes$/i.test(parent.name);\n};\n\nconst isRootNode = (node: selectorParser.Node): boolean => {\n return (\n (node.type === 'tag' && (node.value.toLowerCase() === 'html' || node.value.toLowerCase() === 'body')) ||\n (node.type === 'pseudo' && (node.value === ':root' || node.value === MF_ROOT_SELECTOR))\n );\n};\n\nconst isScopeNode = (node: selectorParser.Node | undefined, scopeId: string): boolean => {\n if (node?.type === 'attribute' && node.attribute === MF_SCOPE_ATTRIBUTE && node.operator === '=' && node.value === scopeId) {\n return true;\n }\n\n const normalized = node?.toString().replaceAll('\"', '').replaceAll(\"'\", '');\n return (\n node?.type === 'pseudo' &&\n (normalized === `:where([${MF_SCOPE_ATTRIBUTE}=${scopeId}])` ||\n normalized === `:where([${MF_SCOPE_ATTRIBUTE}=${scopeId}]:not([${MF_OVERLAY_ATTRIBUTE}]))`)\n );\n};\n\nconst startsWithHostPseudo = (selector: selectorParser.Selector): boolean => {\n return selector.first?.type === 'pseudo' && selector.first.value === ':host';\n};\n\nconst removeRootIdentityIds = (selector: selectorParser.Selector): void => {\n let compound: selectorParser.Node[] = [];\n const removeIdsFromRootCompound = (): void => {\n if (compound.some(isRootNode)) {\n for (const node of compound) {\n if (node.type === 'id') {\n node.remove();\n }\n }\n }\n };\n\n for (const node of [...selector.nodes]) {\n if (node.type === 'combinator') {\n removeIdsFromRootCompound();\n compound = [];\n } else {\n compound.push(node);\n }\n }\n removeIdsFromRootCompound();\n};\n\nconst isRootOnlySelector = (selector: selectorParser.Selector): boolean => {\n const compounds: selectorParser.Node[][] = [[]];\n\n for (const node of selector.nodes) {\n if (node.type === 'combinator') {\n compounds.push([]);\n } else {\n compounds.at(-1)?.push(node);\n }\n }\n\n return compounds.every((compound) => compound.some(isRootNode));\n};\n\nconst hasRootOnlySelector = (selectorList: string): boolean => {\n let result = false;\n selectorParser((root) => {\n result = root.nodes.some(isRootOnlySelector);\n }).processSync(selectorList);\n return result;\n};\n\nconst getAngularComponentSourcePath = (stylePath: string): string | undefined => {\n const cleanStylePath = stylePath.replace(/[?#].*$/, '');\n if (!ANGULAR_COMPONENT_STYLE_PATTERN.test(cleanStylePath)) {\n return undefined;\n }\n\n return cleanStylePath.replace(/\\.(?:css|less|sass|scss)$/i, '.ts');\n};\n\nconst usesViewEncapsulationNone = (stylePath: string): boolean => {\n const componentSourcePath = getAngularComponentSourcePath(stylePath);\n if (!componentSourcePath || !existsSync(componentSourcePath)) {\n return false;\n }\n\n const componentSource = readFileSync(componentSourcePath, 'utf8');\n return VIEW_ENCAPSULATION_NONE_PATTERN.test(maskTypeScriptCommentsAndStrings(componentSource));\n};\n\nexport const shouldUseAngularComponentScoping = (stylePath: string | undefined): boolean => {\n return !!stylePath && !!getAngularComponentSourcePath(stylePath) && !usesViewEncapsulationNone(stylePath);\n};\n\nconst scopeSelectorList = (selectorList: string, scopeId: string, scopeSelector: string, rootScopeSelectors: string[]): string => {\n return selectorParser((root) => {\n const sourceSelectors = [...root.nodes];\n\n for (const selector of sourceSelectors) {\n const rootNodes = selector.nodes.filter(isRootNode);\n\n if (rootNodes.length > 0) {\n const replacementSelectors = isRootOnlySelector(selector) ? rootScopeSelectors : [`[${MF_SCOPE_ATTRIBUTE}=\"${scopeId}\"]`];\n\n for (const replacementSelector of replacementSelectors) {\n const variant = selector.clone();\n removeRootIdentityIds(variant);\n const [firstRoot, ...duplicateRoots] = variant.nodes.filter(isRootNode);\n const scopeNode = selectorParser().astSync(replacementSelector).first.first.clone();\n firstRoot?.replaceWith(scopeNode);\n\n for (const duplicateRoot of duplicateRoots) {\n const previous = duplicateRoot.prev();\n if (previous?.type === 'combinator') {\n previous.remove();\n }\n duplicateRoot.remove();\n }\n\n root.insertBefore(selector, variant);\n }\n selector.remove();\n continue;\n }\n\n if (startsWithHostPseudo(selector) || isScopeNode(selector.first, scopeId)) {\n continue;\n }\n\n const first = selector.first;\n const needsBoundaryVariant = first?.type === 'universal' || (first?.type === 'pseudo' && first.value.startsWith('::'));\n\n if (needsBoundaryVariant) {\n const hasSiblingCombinator = selector.nodes.some((node) => node.type === 'combinator' && (node.value === '+' || node.value === '~'));\n\n if (!hasSiblingCombinator) {\n const boundaryVariant = selector.clone();\n const boundaryScope = selectorParser().astSync(scopeSelector).first.first.clone();\n boundaryVariant.first.rawSpaceBefore = '';\n if (boundaryVariant.first.type === 'universal') {\n boundaryVariant.first.replaceWith(boundaryScope);\n } else {\n boundaryVariant.prepend(boundaryScope);\n }\n root.insertBefore(selector, boundaryVariant);\n }\n }\n\n const descendantScope = selectorParser().astSync(`${scopeSelector} *`).first;\n const prefixNodes = descendantScope.nodes.slice(0, -1).map((node) => node.clone());\n selector.first.rawSpaceBefore = '';\n for (const prefixNode of prefixNodes.reverse()) {\n selector.prepend(prefixNode);\n }\n }\n\n const seenSelectors = new Set<string>();\n for (const selector of [...root.nodes]) {\n const normalizedSelector = selector.toString().trim();\n if (seenSelectors.has(normalizedSelector)) {\n selector.remove();\n } else {\n seenSelectors.add(normalizedSelector);\n }\n }\n }).processSync(selectorList);\n};\n\nconst findFunctionalPseudoEnd = (selector: string, openParenthesisIndex: number): number => {\n let depth = 0;\n let quote: '\"' | \"'\" | undefined;\n\n for (let index = openParenthesisIndex; index < selector.length; index += 1) {\n const character = selector[index];\n const previousCharacter = selector[index - 1];\n\n if (quote) {\n if (character === quote && previousCharacter !== '\\\\') {\n quote = undefined;\n }\n continue;\n }\n\n if (character === '\"' || character === \"'\") {\n quote = character;\n continue;\n }\n\n if (character === '(') {\n depth += 1;\n } else if (character === ')') {\n depth -= 1;\n if (depth === 0) {\n return index;\n }\n }\n }\n\n return -1;\n};\n\nconst scopeAngularSelector = (selector: string, boundarySelector: string): string => {\n const normalizedSelector = selector.trim();\n const angularBoundary = `:host-context(${boundarySelector})`;\n const normalizedBoundary = normalizedSelector.slice(0, angularBoundary.length).replaceAll(\"'\", '\"');\n\n if (normalizedBoundary === angularBoundary) {\n return normalizedSelector;\n }\n\n if (/^:host-context\\(/i.test(normalizedSelector)) {\n return `${angularBoundary}${normalizedSelector}`;\n }\n\n if (/^:host\\(/i.test(normalizedSelector)) {\n const openParenthesisIndex = normalizedSelector.indexOf('(');\n const closeParenthesisIndex = findFunctionalPseudoEnd(normalizedSelector, openParenthesisIndex);\n if (closeParenthesisIndex !== -1) {\n const hostSelector = normalizedSelector.slice(openParenthesisIndex + 1, closeParenthesisIndex);\n const remainder = normalizedSelector.slice(closeParenthesisIndex + 1);\n return list\n .comma(hostSelector)\n .map((hostSelectorVariant) => `${angularBoundary}${hostSelectorVariant}${remainder}`)\n .join(', ');\n }\n }\n\n if (/^:host\\b/i.test(normalizedSelector)) {\n return normalizedSelector.replace(/^:host\\b/i, angularBoundary);\n }\n\n return `${angularBoundary} ${normalizedSelector}`;\n};\n\nconst scopeAngularSelectorList = (selectorList: string, boundarySelector: string): string => {\n return list\n .comma(selectorList)\n .map((selector) => scopeAngularSelector(selector, boundarySelector))\n .join(', ');\n};\n\nconst namespaceKeyframes = (root: Root, keyframePrefix: string): void => {\n const keyframes = new Map<string, string>();\n\n root.walkAtRules((atRule) => {\n if (!/keyframes$/i.test(atRule.name) || atRule.params.startsWith(keyframePrefix)) {\n return;\n }\n\n const originalName = atRule.params.trim();\n const scopedName = `${keyframePrefix}${originalName}`;\n keyframes.set(originalName, scopedName);\n atRule.params = scopedName;\n });\n\n root.walkDecls((declaration) => {\n if (!/^(?:-webkit-)?animation(?:-name)?$/i.test(declaration.prop) && !declaration.prop.startsWith('--animate-')) {\n return;\n }\n\n const parsed = valueParser(declaration.value);\n parsed.walk((node) => {\n if (node.type === 'word') {\n node.value = keyframes.get(node.value) ?? node.value;\n }\n });\n declaration.value = parsed.toString();\n });\n};\n\nconst scopeGlobalRoot = (root: Root, scopeId: string, scopeSelector: string, keyframePrefix: string): void => {\n namespaceKeyframes(root, keyframePrefix);\n const contentRootSelector = `:where([${MF_SCOPE_ATTRIBUTE}=\"${scopeId}\"]:not([${MF_OVERLAY_ATTRIBUTE}]))`;\n root.walkRules((rule) => {\n if (!isKeyframesRule(rule)) {\n const declarations = rule.nodes.filter((node) => node.type === 'decl');\n const customProperties = declarations.filter((declaration) => declaration.prop.startsWith('--'));\n const standardDeclarations = declarations.filter((declaration) => !declaration.prop.startsWith('--'));\n\n if (customProperties.length > 0 && standardDeclarations.length > 0 && hasRootOnlySelector(rule.selector)) {\n const customPropertyRule = rule.cloneBefore();\n customPropertyRule.walkDecls((declaration) => {\n if (!declaration.prop.startsWith('--')) {\n declaration.remove();\n }\n });\n customPropertyRule.selector = scopeSelectorList(customPropertyRule.selector, scopeId, scopeSelector, [':host', scopeSelector]);\n rule.walkDecls((declaration) => {\n if (declaration.prop.startsWith('--')) {\n declaration.remove();\n }\n });\n }\n\n const containsOnlyCustomProperties = declarations.length > 0 && declarations.every((declaration) => declaration.prop.startsWith('--'));\n const rootScopeSelectors = containsOnlyCustomProperties ? [':host', scopeSelector] : [':host', contentRootSelector];\n rule.selector = scopeSelectorList(rule.selector, scopeId, scopeSelector, rootScopeSelectors);\n }\n });\n};\n\nconst scopeAngularComponentRoot = (root: Root, boundarySelector: string, keyframePrefix: string): void => {\n namespaceKeyframes(root, keyframePrefix);\n root.walkRules((rule) => {\n if (!isKeyframesRule(rule)) {\n rule.selector = scopeAngularSelectorList(rule.selector, boundarySelector);\n }\n });\n};\n\nexport const scopeRemoteCss = ({ scopeId }: IScopeRemoteCssOptions): Plugin => {\n const validScopeId = validateMfScopeId(scopeId);\n const scopeSelector = getMfScopeSelector(validScopeId);\n const keyframePrefix = `edyn-mf-${validScopeId}--`;\n\n return {\n postcssPlugin: `edyn-mf-isolation-${validScopeId}`,\n Once(root) {\n scopeGlobalRoot(root, validScopeId, scopeSelector, keyframePrefix);\n },\n };\n};\n\nexport const scopeAngularRemoteCss = ({ scopeId }: IScopeRemoteCssOptions): Plugin => {\n const validScopeId = validateMfScopeId(scopeId);\n const scopeSelector = getMfScopeSelector(validScopeId);\n const boundarySelector = `[${MF_SCOPE_ATTRIBUTE}=\"${validScopeId}\"]`;\n const keyframePrefix = `edyn-mf-${validScopeId}--`;\n\n return {\n postcssPlugin: `edyn-mf-angular-isolation-${validScopeId}`,\n Once(root) {\n if (shouldUseAngularComponentScoping(root.source?.input.file)) {\n scopeAngularComponentRoot(root, boundarySelector, keyframePrefix);\n return;\n }\n\n scopeGlobalRoot(root, validScopeId, scopeSelector, keyframePrefix);\n },\n };\n};\n"]}
|
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Plugin } from 'vite';
|
|
2
|
+
import { type IMfNavigationDefinition, type IMfNavigationManifest } from './navigation';
|
|
3
|
+
export interface IMfNavigationPluginOptions {
|
|
4
|
+
fileName?: string;
|
|
5
|
+
navigation: IMfNavigationDefinition;
|
|
6
|
+
}
|
|
7
|
+
export declare const createMfNavigationManifest: (navigation: IMfNavigationDefinition) => Readonly<IMfNavigationManifest>;
|
|
8
|
+
export declare const serializeMfNavigationManifest: (navigation: IMfNavigationDefinition) => string;
|
|
9
|
+
export declare const mfNavigationPlugin: ({ fileName, navigation }: IMfNavigationPluginOptions) => Plugin;
|
|
10
|
+
//# sourceMappingURL=vite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAsB,KAAK,uBAAuB,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAK5G,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,uBAAuB,CAAC;CACrC;AAID,eAAO,MAAM,0BAA0B,GAAI,YAAY,uBAAuB,KAAG,QAAQ,CAAC,qBAAqB,CAa9G,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,YAAY,uBAAuB,KAAG,MAEnF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,0BAA8C,0BAA0B,KAAG,MA4B7G,CAAC","sourcesContent":["import { createHash } from 'node:crypto';\nimport type { Plugin } from 'vite';\nimport { defineMfNavigation, type IMfNavigationDefinition, type IMfNavigationManifest } from './navigation';\n\nconst DEFAULT_FILE_NAME = 'navigation.json';\nconst FILE_NAME_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9._-]*\\.json$/;\n\nexport interface IMfNavigationPluginOptions {\n fileName?: string;\n navigation: IMfNavigationDefinition;\n}\n\nconst serializeDefinition = (definition: Readonly<IMfNavigationDefinition>): string => JSON.stringify(definition);\n\nexport const createMfNavigationManifest = (navigation: IMfNavigationDefinition): Readonly<IMfNavigationManifest> => {\n const definition = defineMfNavigation(navigation);\n const revision = createHash('sha256').update(serializeDefinition(definition)).digest('hex');\n\n return Object.freeze({\n applicationId: definition.applicationId,\n contractVersion: definition.contractVersion,\n items: definition.items,\n label: definition.label,\n landingPath: definition.landingPath,\n moduleId: definition.moduleId,\n revision,\n });\n};\n\nexport const serializeMfNavigationManifest = (navigation: IMfNavigationDefinition): string => {\n return `${JSON.stringify(createMfNavigationManifest(navigation), null, 2)}\\n`;\n};\n\nexport const mfNavigationPlugin = ({ fileName = DEFAULT_FILE_NAME, navigation }: IMfNavigationPluginOptions): Plugin => {\n if (!FILE_NAME_PATTERN.test(fileName)) {\n throw new Error('Microfrontend navigation fileName must be a safe JSON file name.');\n }\n\n const source = serializeMfNavigationManifest(navigation);\n const publicPath = `/${fileName}`;\n\n return {\n name: 'edynamix-mf-navigation',\n configureServer(server) {\n server.middlewares.use((request, response, next) => {\n const requestPath = request.url?.split('?', 1)[0];\n if (requestPath !== publicPath) {\n next();\n return;\n }\n\n response.statusCode = 200;\n response.setHeader('Cache-Control', 'no-cache');\n response.setHeader('Content-Type', 'application/json; charset=utf-8');\n response.end(source);\n });\n },\n generateBundle() {\n this.emitFile({ fileName, source, type: 'asset' });\n },\n };\n};\n"]}
|
package/dist/vite.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { defineMfNavigation } from './navigation';
|
|
3
|
+
const DEFAULT_FILE_NAME = 'navigation.json';
|
|
4
|
+
const FILE_NAME_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9._-]*\.json$/;
|
|
5
|
+
const serializeDefinition = (definition) => JSON.stringify(definition);
|
|
6
|
+
export const createMfNavigationManifest = (navigation) => {
|
|
7
|
+
const definition = defineMfNavigation(navigation);
|
|
8
|
+
const revision = createHash('sha256').update(serializeDefinition(definition)).digest('hex');
|
|
9
|
+
return Object.freeze({
|
|
10
|
+
applicationId: definition.applicationId,
|
|
11
|
+
contractVersion: definition.contractVersion,
|
|
12
|
+
items: definition.items,
|
|
13
|
+
label: definition.label,
|
|
14
|
+
landingPath: definition.landingPath,
|
|
15
|
+
moduleId: definition.moduleId,
|
|
16
|
+
revision,
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
export const serializeMfNavigationManifest = (navigation) => {
|
|
20
|
+
return `${JSON.stringify(createMfNavigationManifest(navigation), null, 2)}\n`;
|
|
21
|
+
};
|
|
22
|
+
export const mfNavigationPlugin = ({ fileName = DEFAULT_FILE_NAME, navigation }) => {
|
|
23
|
+
if (!FILE_NAME_PATTERN.test(fileName)) {
|
|
24
|
+
throw new Error('Microfrontend navigation fileName must be a safe JSON file name.');
|
|
25
|
+
}
|
|
26
|
+
const source = serializeMfNavigationManifest(navigation);
|
|
27
|
+
const publicPath = `/${fileName}`;
|
|
28
|
+
return {
|
|
29
|
+
name: 'edynamix-mf-navigation',
|
|
30
|
+
configureServer(server) {
|
|
31
|
+
server.middlewares.use((request, response, next) => {
|
|
32
|
+
const requestPath = request.url?.split('?', 1)[0];
|
|
33
|
+
if (requestPath !== publicPath) {
|
|
34
|
+
next();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
response.statusCode = 200;
|
|
38
|
+
response.setHeader('Cache-Control', 'no-cache');
|
|
39
|
+
response.setHeader('Content-Type', 'application/json; charset=utf-8');
|
|
40
|
+
response.end(source);
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
generateBundle() {
|
|
44
|
+
this.emitFile({ fileName, source, type: 'asset' });
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=vite.js.map
|
package/dist/vite.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAA4D,MAAM,cAAc,CAAC;AAE5G,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAC5C,MAAM,iBAAiB,GAAG,oCAAoC,CAAC;AAO/D,MAAM,mBAAmB,GAAG,CAAC,UAA6C,EAAU,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAElH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,UAAmC,EAAmC,EAAE;IACjH,MAAM,UAAU,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,UAAU,CA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BACT,CAAC;gBAED,QAAQ,CAAC,UAAU,GAAG,GAAG,CAAC;gBAC1B,QAAQ,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;gBAChD,QAAQ,CAAC,SAAS,CAAC,cAAc,EAAE,iCAAiC,CAAC,CAAC;gBACtE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACvB,CAAC,CAAC,CAAC;QACL,CAAC;QACD,cAAc;YACZ,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACrD,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { createHash } from 'node:crypto';\nimport type { Plugin } from 'vite';\nimport { defineMfNavigation, type IMfNavigationDefinition, type IMfNavigationManifest } from './navigation';\n\nconst DEFAULT_FILE_NAME = 'navigation.json';\nconst FILE_NAME_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9._-]*\\.json$/;\n\nexport interface IMfNavigationPluginOptions {\n fileName?: string;\n navigation: IMfNavigationDefinition;\n}\n\nconst serializeDefinition = (definition: Readonly<IMfNavigationDefinition>): string => JSON.stringify(definition);\n\nexport const createMfNavigationManifest = (navigation: IMfNavigationDefinition): Readonly<IMfNavigationManifest> => {\n const definition = defineMfNavigation(navigation);\n const revision = createHash('sha256').update(serializeDefinition(definition)).digest('hex');\n\n return Object.freeze({\n applicationId: definition.applicationId,\n contractVersion: definition.contractVersion,\n items: definition.items,\n label: definition.label,\n landingPath: definition.landingPath,\n moduleId: definition.moduleId,\n revision,\n });\n};\n\nexport const serializeMfNavigationManifest = (navigation: IMfNavigationDefinition): string => {\n return `${JSON.stringify(createMfNavigationManifest(navigation), null, 2)}\\n`;\n};\n\nexport const mfNavigationPlugin = ({ fileName = DEFAULT_FILE_NAME, navigation }: IMfNavigationPluginOptions): Plugin => {\n if (!FILE_NAME_PATTERN.test(fileName)) {\n throw new Error('Microfrontend navigation fileName must be a safe JSON file name.');\n }\n\n const source = serializeMfNavigationManifest(navigation);\n const publicPath = `/${fileName}`;\n\n return {\n name: 'edynamix-mf-navigation',\n configureServer(server) {\n server.middlewares.use((request, response, next) => {\n const requestPath = request.url?.split('?', 1)[0];\n if (requestPath !== publicPath) {\n next();\n return;\n }\n\n response.statusCode = 200;\n response.setHeader('Cache-Control', 'no-cache');\n response.setHeader('Content-Type', 'application/json; charset=utf-8');\n response.end(source);\n });\n },\n generateBundle() {\n this.emitFile({ fileName, source, type: 'asset' });\n },\n };\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edynamix/mf-isolation",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "CSS and overlay isolation helpers for eDynamix microfrontends.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -33,10 +33,18 @@
|
|
|
33
33
|
"types": "./dist/postcss.d.ts",
|
|
34
34
|
"import": "./dist/postcss.js"
|
|
35
35
|
},
|
|
36
|
+
"./navigation": {
|
|
37
|
+
"types": "./dist/navigation.d.ts",
|
|
38
|
+
"import": "./dist/navigation.js"
|
|
39
|
+
},
|
|
40
|
+
"./vite": {
|
|
41
|
+
"types": "./dist/vite.d.ts",
|
|
42
|
+
"import": "./dist/vite.js"
|
|
43
|
+
},
|
|
36
44
|
"./package.json": "./package.json"
|
|
37
45
|
},
|
|
38
46
|
"scripts": {
|
|
39
|
-
"build": "bun run clean && tsc -p tsconfig.build.json",
|
|
47
|
+
"build": "bun run clean && tsc -p tsconfig.build.json && bun run scripts/embed-source-map-sources.ts",
|
|
40
48
|
"clean": "bun -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true });\"",
|
|
41
49
|
"format": "biome format --write .",
|
|
42
50
|
"knip": "knip",
|
|
@@ -78,7 +86,8 @@
|
|
|
78
86
|
"peerDependencies": {
|
|
79
87
|
"@angular/cdk": "^19.0.0",
|
|
80
88
|
"@angular/common": "^19.0.0",
|
|
81
|
-
"@angular/core": "^19.0.0"
|
|
89
|
+
"@angular/core": "^19.0.0",
|
|
90
|
+
"vite": "^8.0.0"
|
|
82
91
|
},
|
|
83
92
|
"peerDependenciesMeta": {
|
|
84
93
|
"@angular/cdk": {
|
|
@@ -89,6 +98,9 @@
|
|
|
89
98
|
},
|
|
90
99
|
"@angular/core": {
|
|
91
100
|
"optional": true
|
|
101
|
+
},
|
|
102
|
+
"vite": {
|
|
103
|
+
"optional": true
|
|
92
104
|
}
|
|
93
105
|
}
|
|
94
106
|
}
|