@sprlab/wccompiler 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +998 -998
- package/adapters/angular-compiled/angular.d.ts +197 -197
- package/adapters/angular-compiled/angular.mjs +488 -488
- package/adapters/angular.js +54 -54
- package/adapters/angular.ts +630 -630
- package/adapters/react.js +114 -114
- package/adapters/vue.js +103 -103
- package/bin/wcc.js +412 -412
- package/bin/wcc.test.js +126 -126
- package/integrations/angular.js +73 -73
- package/integrations/react.js +859 -859
- package/integrations/vue.js +253 -253
- package/lib/codegen.js +2078 -2074
- package/lib/compiler-browser.js +545 -545
- package/lib/compiler.js +483 -479
- package/lib/config.js +71 -71
- package/lib/css-scoper.js +180 -180
- package/lib/dev-server.js +193 -193
- package/lib/import-resolver.js +160 -160
- package/lib/parser-extractors.js +1240 -1169
- package/lib/parser.js +273 -269
- package/lib/reactive-runtime.js +143 -143
- package/lib/sfc-parser.js +333 -333
- package/lib/template-normalizer.js +114 -114
- package/lib/tree-walker.js +1013 -1013
- package/lib/types.js +262 -262
- package/lib/wcc-runtime.js +68 -68
- package/package.json +85 -85
- package/types/wcc.d.ts +28 -28
- package/types/wcc.test.js +46 -46
package/adapters/angular.js
CHANGED
|
@@ -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
|
+
*/
|