@analogjs/astro-angular 3.0.0-beta.57 → 3.0.0-beta.59
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/package.json +2 -2
- package/src/client-ngh.js +3 -4
- package/src/client.js +2 -3
- package/src/context.js +1 -2
- package/src/create-component.js +1 -2
- package/src/id.js +1 -2
- package/src/index.js +1 -2
- package/src/middleware.js +1 -2
- package/src/projection.js +1 -2
- package/src/selector.js +1 -2
- package/src/server-ngh.js +2 -3
- package/src/server.js +1 -2
- package/src/ssr-integrity.js +1 -2
- package/src/utils.js +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@analogjs/astro-angular",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.59",
|
|
4
4
|
"description": "Use Angular components within Astro",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Brandon Roberts <robertsbt@gmail.com>",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"url": "https://github.com/sponsors/brandonroberts"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@analogjs/vite-plugin-angular": "3.0.0-beta.
|
|
59
|
+
"@analogjs/vite-plugin-angular": "3.0.0-beta.59",
|
|
60
60
|
"rehype": "^13.0.2"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
package/src/client-ngh.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ID_PROP_NAME } from "./id.js";
|
|
2
1
|
import { createComponentBindings, getComponentElementTag, registerRootComponent } from "./create-component.js";
|
|
3
|
-
import {
|
|
2
|
+
import { ID_PROP_NAME } from "./id.js";
|
|
4
3
|
import { ensureSsrIntegrityMarker } from "./ssr-integrity.js";
|
|
4
|
+
import { buildProjectableNodes, collectProjectedNodes } from "./projection.js";
|
|
5
5
|
import { APP_ID, createComponent, provideZonelessChangeDetection, reflectComponentType } from "@angular/core";
|
|
6
6
|
import { createApplication, provideClientHydration } from "@angular/platform-browser";
|
|
7
|
-
|
|
7
|
+
// packages/astro-angular/src/client-ngh.ts
|
|
8
8
|
var client_ngh_default = (element) => {
|
|
9
9
|
return (Component, props, slots) => {
|
|
10
10
|
const mirror = reflectComponentType(Component);
|
|
@@ -41,7 +41,6 @@ var client_ngh_default = (element) => {
|
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
//#endregion
|
|
45
44
|
export { client_ngh_default as default };
|
|
46
45
|
|
|
47
46
|
//# sourceMappingURL=client-ngh.js.map
|
package/src/client.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ID_PROP_NAME } from "./id.js";
|
|
2
1
|
import { createComponentBindings, registerRootComponent } from "./create-component.js";
|
|
2
|
+
import { ID_PROP_NAME } from "./id.js";
|
|
3
3
|
import { buildProjectableNodes } from "./projection.js";
|
|
4
4
|
import { createComponent, provideZonelessChangeDetection, reflectComponentType } from "@angular/core";
|
|
5
5
|
import { createApplication } from "@angular/platform-browser";
|
|
6
|
-
|
|
6
|
+
// packages/astro-angular/src/client.ts
|
|
7
7
|
var client_default = (element) => {
|
|
8
8
|
return (Component, props, slots) => {
|
|
9
9
|
const mirror = reflectComponentType(Component);
|
|
@@ -23,7 +23,6 @@ var client_default = (element) => {
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
//#endregion
|
|
27
26
|
export { client_default as default };
|
|
28
27
|
|
|
29
28
|
//# sourceMappingURL=client.js.map
|
package/src/context.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// packages/astro-angular/src/context.ts
|
|
2
2
|
var contexts = /* @__PURE__ */ new WeakMap();
|
|
3
3
|
function getContext(result) {
|
|
4
4
|
let ctx = contexts.get(result);
|
|
@@ -17,7 +17,6 @@ function incrementId(ctx) {
|
|
|
17
17
|
ctx.c++;
|
|
18
18
|
return id;
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { getContext, incrementId };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=context.js.map
|
package/src/create-component.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./id.js";
|
|
2
2
|
import { APP_BOOTSTRAP_LISTENER, inputBinding, outputBinding } from "@angular/core";
|
|
3
|
-
|
|
3
|
+
// packages/astro-angular/src/create-component.ts
|
|
4
4
|
function getComponentElementTag(mirror) {
|
|
5
5
|
return mirror.selector.split(",")[0] || "ng-component";
|
|
6
6
|
}
|
|
@@ -37,7 +37,6 @@ function registerRootComponent(appRef, componentRef) {
|
|
|
37
37
|
appRef.components.push(componentRef);
|
|
38
38
|
appRef.injector.get(APP_BOOTSTRAP_LISTENER, []).forEach((listener) => listener(componentRef));
|
|
39
39
|
}
|
|
40
|
-
//#endregion
|
|
41
40
|
export { createComponentBindings, createInputBindings, createOutputBindings, getComponentElementTag, registerRootComponent };
|
|
42
41
|
|
|
43
42
|
//# sourceMappingURL=create-component.js.map
|
package/src/id.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// packages/astro-angular/src/id.ts
|
|
2
2
|
/**
|
|
3
3
|
* Property name used to serialize the APP_ID of each component.
|
|
4
4
|
*/
|
|
5
5
|
var ID_PROP_NAME = "data-analog-id";
|
|
6
|
-
//#endregion
|
|
7
6
|
export { ID_PROP_NAME };
|
|
8
7
|
|
|
9
8
|
//# sourceMappingURL=id.js.map
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import viteAngular from "@analogjs/vite-plugin-angular";
|
|
2
2
|
import { enableProdMode } from "@angular/core";
|
|
3
|
-
|
|
3
|
+
// packages/astro-angular/src/index.ts
|
|
4
4
|
function getRenderer(ngHydration) {
|
|
5
5
|
return {
|
|
6
6
|
name: "@analogjs/astro-angular",
|
|
@@ -88,7 +88,6 @@ function src_default(options) {
|
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
//#endregion
|
|
92
91
|
export { src_default as default };
|
|
93
92
|
|
|
94
93
|
//# sourceMappingURL=index.js.map
|
package/src/middleware.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { rehype } from "rehype";
|
|
2
|
-
|
|
2
|
+
// packages/astro-angular/src/middleware.ts
|
|
3
3
|
var processor = rehype();
|
|
4
4
|
var onRequest = async (_ctx, next) => {
|
|
5
5
|
const response = await next();
|
|
@@ -42,7 +42,6 @@ var onRequest = async (_ctx, next) => {
|
|
|
42
42
|
newResponse.headers.set("content-length", Buffer.byteLength(newBody).toFixed(0));
|
|
43
43
|
return newResponse;
|
|
44
44
|
};
|
|
45
|
-
//#endregion
|
|
46
45
|
export { onRequest };
|
|
47
46
|
|
|
48
47
|
//# sourceMappingURL=middleware.js.map
|
package/src/projection.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isSameSelector, parseSelectorList } from "./selector.js";
|
|
2
|
-
|
|
2
|
+
// packages/astro-angular/src/projection.ts
|
|
3
3
|
var ELEMENT_NODE = 1;
|
|
4
4
|
var TEXT_NODE = 3;
|
|
5
5
|
var COMMENT_NODE = 8;
|
|
@@ -92,7 +92,6 @@ function matches(node, selector) {
|
|
|
92
92
|
return false;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
//#endregion
|
|
96
95
|
export { buildProjectableNodes, collectProjectedNodes, markProjectableNodes };
|
|
97
96
|
|
|
98
97
|
//# sourceMappingURL=projection.js.map
|
package/src/selector.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// packages/astro-angular/src/selector.ts
|
|
2
2
|
var SELECTOR_REGEXP = /* @__PURE__ */ new RegExp("(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=([\"']?)([^\\]\"']*)\\5)?\\])|(\\))|(\\s*,\\s*)", "g");
|
|
3
3
|
var NOT = 1;
|
|
4
4
|
var TAG = 2;
|
|
@@ -57,7 +57,6 @@ function isSameSelector(a, b) {
|
|
|
57
57
|
function normalizeElement(element) {
|
|
58
58
|
return element === "*" ? "" : element;
|
|
59
59
|
}
|
|
60
|
-
//#endregion
|
|
61
60
|
export { isSameSelector, parseSelectorList };
|
|
62
61
|
|
|
63
62
|
//# sourceMappingURL=selector.js.map
|
package/src/server-ngh.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { getContext, incrementId } from "./context.js";
|
|
1
2
|
import { ID_PROP_NAME } from "./id.js";
|
|
2
3
|
import { createInputBindings, getComponentElementTag, registerRootComponent } from "./create-component.js";
|
|
3
4
|
import { buildProjectableNodes, markProjectableNodes } from "./projection.js";
|
|
4
|
-
import { getContext, incrementId } from "./context.js";
|
|
5
5
|
import { APP_ID, DOCUMENT, createComponent, provideZonelessChangeDetection, reflectComponentType } from "@angular/core";
|
|
6
6
|
import { createApplication, provideClientHydration } from "@angular/platform-browser";
|
|
7
7
|
import { platformServer, provideServerRendering, renderApplication, ɵSERVER_CONTEXT } from "@angular/platform-server";
|
|
8
8
|
import { readFileSync } from "node:fs";
|
|
9
9
|
import { createRequire } from "node:module";
|
|
10
|
-
|
|
10
|
+
// packages/astro-angular/src/server-ngh.ts
|
|
11
11
|
var require = createRequire(import.meta.url);
|
|
12
12
|
var jsActionContractScript = void 0;
|
|
13
13
|
var HYDRATION_SCRIPT_ID = "ng-event-dispatch-contract";
|
|
@@ -70,7 +70,6 @@ var server_ngh_default = {
|
|
|
70
70
|
renderToStaticMarkup,
|
|
71
71
|
renderHydrationScript: () => getHydrationScript()
|
|
72
72
|
};
|
|
73
|
-
//#endregion
|
|
74
73
|
export { server_ngh_default as default };
|
|
75
74
|
|
|
76
75
|
//# sourceMappingURL=server-ngh.js.map
|
package/src/server.js
CHANGED
|
@@ -3,7 +3,7 @@ import { buildProjectableNodes } from "./projection.js";
|
|
|
3
3
|
import { DOCUMENT, createComponent, provideZonelessChangeDetection, reflectComponentType } from "@angular/core";
|
|
4
4
|
import { createApplication } from "@angular/platform-browser";
|
|
5
5
|
import { platformServer, provideServerRendering, renderApplication, ɵSERVER_CONTEXT } from "@angular/platform-server";
|
|
6
|
-
|
|
6
|
+
// packages/astro-angular/src/server.ts
|
|
7
7
|
function check(Component, _props, _children) {
|
|
8
8
|
return !!reflectComponentType(Component);
|
|
9
9
|
}
|
|
@@ -49,7 +49,6 @@ var renderer = {
|
|
|
49
49
|
check,
|
|
50
50
|
renderToStaticMarkup
|
|
51
51
|
};
|
|
52
|
-
//#endregion
|
|
53
52
|
export { renderer as default };
|
|
54
53
|
|
|
55
54
|
//# sourceMappingURL=server.js.map
|
package/src/ssr-integrity.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ɵCLIENT_RENDER_MODE_FLAG, ɵSSR_CONTENT_INTEGRITY_MARKER } from "@angular/core";
|
|
2
|
-
|
|
2
|
+
// packages/astro-angular/src/ssr-integrity.ts
|
|
3
3
|
function ensureSsrIntegrityMarker() {
|
|
4
4
|
if (document.body.firstChild?.nodeType !== Node.COMMENT_NODE || document.body.firstChild.textContent !== ɵSSR_CONTENT_INTEGRITY_MARKER) document.body.prepend(document.createComment(ɵSSR_CONTENT_INTEGRITY_MARKER));
|
|
5
5
|
if (!document.body.hasAttribute(ɵCLIENT_RENDER_MODE_FLAG)) document.body.setAttribute(ɵCLIENT_RENDER_MODE_FLAG, "");
|
|
6
6
|
}
|
|
7
|
-
//#endregion
|
|
8
7
|
export { ensureSsrIntegrityMarker };
|
|
9
8
|
|
|
10
9
|
//# sourceMappingURL=ssr-integrity.js.map
|
package/src/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// packages/astro-angular/src/utils.ts
|
|
2
2
|
function addOutputListener(analogId, outputName, callback, eventListenerOptions = {}) {
|
|
3
3
|
const observer = new MutationObserver((mutations) => {
|
|
4
4
|
const foundTarget = mutations.find((mutation) => mutation.target.dataset?.["analogId"] === analogId)?.target;
|
|
@@ -13,7 +13,6 @@ function addOutputListener(analogId, outputName, callback, eventListenerOptions
|
|
|
13
13
|
});
|
|
14
14
|
return () => observer.disconnect();
|
|
15
15
|
}
|
|
16
|
-
//#endregion
|
|
17
16
|
export { addOutputListener };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=utils.js.map
|