@sprlab/wccompiler 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,54 +1,54 @@
1
- /**
2
- * Angular adapter for WCC custom elements.
3
- *
4
- * @module @sprlab/wccompiler/adapters/angular
5
- *
6
- * ANGULAR INTEGRATION:
7
- *
8
- * The adapter ships as TypeScript source (adapters/angular.ts) because Angular
9
- * AOT requires directives to be compiled within the consuming project's scope.
10
- * The package.json "exports" map points directly to the .ts file, which Angular's
11
- * esbuild-based `application` builder (Angular 17+) handles natively.
12
- *
13
- * SETUP:
14
- *
15
- * 1. Install the package:
16
- * npm install @sprlab/wccompiler
17
- *
18
- * 2. Add a tsconfig path mapping (tsconfig.json):
19
- * {
20
- * "compilerOptions": {
21
- * "paths": {
22
- * "@sprlab/wccompiler/adapters/angular": ["node_modules/@sprlab/wccompiler/adapters/angular.ts"]
23
- * }
24
- * }
25
- * }
26
- *
27
- * 3. Import in your component:
28
- * import { WccSlotsDirective, WccSlotDef } from '@sprlab/wccompiler/adapters/angular';
29
- *
30
- * @Component({
31
- * imports: [WccSlotsDirective, WccSlotDef],
32
- * schemas: [CUSTOM_ELEMENTS_SCHEMA],
33
- * template: `
34
- * <wcc-card wccSlots>
35
- * <ng-template slot="header"><strong>Title</strong></ng-template>
36
- * <ng-template slot="stats" let-likes>⭐ {{likes}} stars!</ng-template>
37
- * </wcc-card>
38
- * `
39
- * })
40
- *
41
- * HOW IT WORKS:
42
- *
43
- * - WccSlotDef: Captures ng-template[slot] elements and their slot names
44
- * - WccSlotsDirective: Activated via [wccSlots] attribute on the host element
45
- * - Classifies slots as "named" or "scoped" using the component's __scopedSlots metadata
46
- * - Named slots: rendered immediately into the component's [data-slot] container
47
- * - Scoped slots: registered via registerSlotRenderer() for reactive updates
48
- *
49
- * REQUIREMENTS:
50
- * - Angular 17+ with the `application` builder (esbuild-based)
51
- * - The [wccSlots] attribute must be added to WCC elements that use slots
52
- *
53
- * NOTE: This .js file is documentation only. The actual source is adapters/angular.ts.
54
- */
1
+ /**
2
+ * Angular adapter for WCC custom elements.
3
+ *
4
+ * @module @sprlab/wccompiler/adapters/angular
5
+ *
6
+ * ANGULAR INTEGRATION:
7
+ *
8
+ * The adapter ships as TypeScript source (adapters/angular.ts) because Angular
9
+ * AOT requires directives to be compiled within the consuming project's scope.
10
+ * The package.json "exports" map points directly to the .ts file, which Angular's
11
+ * esbuild-based `application` builder (Angular 17+) handles natively.
12
+ *
13
+ * SETUP:
14
+ *
15
+ * 1. Install the package:
16
+ * npm install @sprlab/wccompiler
17
+ *
18
+ * 2. Add a tsconfig path mapping (tsconfig.json):
19
+ * {
20
+ * "compilerOptions": {
21
+ * "paths": {
22
+ * "@sprlab/wccompiler/adapters/angular": ["node_modules/@sprlab/wccompiler/adapters/angular.ts"]
23
+ * }
24
+ * }
25
+ * }
26
+ *
27
+ * 3. Import in your component:
28
+ * import { WccSlotsDirective, WccSlotDef } from '@sprlab/wccompiler/adapters/angular';
29
+ *
30
+ * @Component({
31
+ * imports: [WccSlotsDirective, WccSlotDef],
32
+ * schemas: [CUSTOM_ELEMENTS_SCHEMA],
33
+ * template: `
34
+ * <wcc-card wccSlots>
35
+ * <ng-template slot="header"><strong>Title</strong></ng-template>
36
+ * <ng-template slot="stats" let-likes>⭐ {{likes}} stars!</ng-template>
37
+ * </wcc-card>
38
+ * `
39
+ * })
40
+ *
41
+ * HOW IT WORKS:
42
+ *
43
+ * - WccSlotDef: Captures ng-template[slot] elements and their slot names
44
+ * - WccSlotsDirective: Activated via [wccSlots] attribute on the host element
45
+ * - Classifies slots as "named" or "scoped" using the component's __scopedSlots metadata
46
+ * - Named slots: rendered immediately into the component's [data-slot] container
47
+ * - Scoped slots: registered via registerSlotRenderer() for reactive updates
48
+ *
49
+ * REQUIREMENTS:
50
+ * - Angular 17+ with the `application` builder (esbuild-based)
51
+ * - The [wccSlots] attribute must be added to WCC elements that use slots
52
+ *
53
+ * NOTE: This .js file is documentation only. The actual source is adapters/angular.ts.
54
+ */