Skip to content

Commit ddde969

Browse files
committed
release: cut 2.0.2
1 parent b259073 commit ddde969

File tree

12 files changed

+140
-91
lines changed

12 files changed

+140
-91
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [2.0.2]
11+
12+
### Fixed
13+
14+
- Fix `RecaptchaLoaderModule.withParameters` AOT build errors
15+
1016
## [2.0.1]
1117

1218
### Changed
@@ -71,7 +77,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7177

7278
- Provide empty configs if none specified
7379

74-
[Unreleased]: https://github.com/Spaier/spaier-ng-recaptcha/compare/2.0.1...HEAD
80+
[Unreleased]: https://github.com/Spaier/spaier-ng-recaptcha/compare/2.0.2...HEAD
81+
[2.0.2]: https://github.com/Spaier/spaier-ng-recaptcha/compare/2.0.1...2.0.2
7582
[2.0.1]: https://github.com/Spaier/spaier-ng-recaptcha/compare/2.0.0...2.0.1
7683
[2.0.0]: https://github.com/Spaier/spaier-ng-recaptcha/compare/1.1.0...2.0.0
7784
[1.1.1]: https://github.com/Spaier/spaier-ng-recaptcha/compare/1.0.0...1.1.0

docs/changelog.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ <h1 id="changelog">Changelog</h1>
3737
<p>All notable changes to this project will be documented in this file.</p>
3838
<p>The format is based on <a href="https://keepachangelog.com/en/1.0.0/">Keep a Changelog</a>
3939
and this project adheres to <a href="https://semver.org/spec/v2.0.0.html">Semantic Versioning</a>.</p>
40-
<h2 id="unreleased"><a href="https://github.com/Spaier/spaier-ng-recaptcha/compare/2.0.1...HEAD">Unreleased</a></h2>
40+
<h2 id="unreleased"><a href="https://github.com/Spaier/spaier-ng-recaptcha/compare/2.0.2...HEAD">Unreleased</a></h2>
41+
<h2 id="2-0-2"><a href="https://github.com/Spaier/spaier-ng-recaptcha/compare/2.0.1...2.0.2">2.0.2</a></h2>
42+
<h3 id="fixed">Fixed</h3>
43+
<ul>
44+
<li>Fix <code>RecaptchaLoaderModule.withParameters</code> AOT build errors</li>
45+
</ul>
4146
<h2 id="2-0-1"><a href="https://github.com/Spaier/spaier-ng-recaptcha/compare/2.0.0...2.0.1">2.0.1</a></h2>
4247
<h3 id="changed">Changed</h3>
4348
<ul>

docs/coverage.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@
8585
<tr class="low">
8686
<td>
8787
<!-- miscellaneous -->
88-
<a href="./miscellaneous/variables.html#useV3">projects/sample/src/app/app.module.ts</a>
88+
<a href=".//functions.html#onLoad">projects/sample/src/app/app.module.ts</a>
8989
</td>
9090
<td>
91-
variable
91+
function
9292
</td>
9393
<td>
94-
useV3
94+
onLoad
9595
</td>
9696
<td align="right" data-sort="0">
9797
<span class="coverage-percent">0 %</span>

docs/index.html

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,28 @@ <h3 id="load-script">Load script</h3>
7171
<li><code>RecaptchaRender.Onload</code> renders the first element with <code>g-recaptcha</code> class.</li>
7272
<li><code>your_sitekey</code> renders isolated invisible reCAPTCHA that can be used from <code>RecaptchaService</code>. V3 best practice.</li>
7373
</ol>
74-
<p><code>onload</code>: specifies function name on the window object.</p>
75-
<p><code>onloadFunc</code>: specifies function that is executed after reCAPTCHA loads.</p>
74+
<p><code>onload</code>: specifies a function name on the window object. Defaults to <code>RecaptchaOnloadEventName = &#39;recaptchaloaded&#39;</code></p>
75+
<p><code>onloadFunc</code>: specifies a function that is executed after reCAPTCHA loads.</p>
7676
<p><code>recaptchaUrl</code>: script&#39;s url. Defaults to <code>RecaptchaGoogleUrl = &#39;https://www.google.com/recaptcha/api.js&#39;</code></p>
77-
<div><pre class="line-numbers"><code class="language-ts"> RecaptchaLoaderModule.withParameters({
77+
<div><pre class="line-numbers"><code class="language-ts">export async function onLoad(recaptcha: Recaptcha) {
78+
// Sitekey Execution
79+
const result = await recaptcha.execute(&#39;your_sitekey&#39;, { action: &#39;background&#39; })
80+
console.log(result)
81+
}
82+
83+
&#64;NgModule({
84+
imports: [
85+
// ...
86+
RecaptchaLoaderModule.withParameters({
7887
language: &#39;en&#39;,
7988
render: &#39;your_sitekey&#39;,
80-
onloadFunc: async aptcha: Recaptcha) =&gt; {
81-
// Sitekey Execution
82-
const result = await recaptcha.execute(&#39;your_sitekey&#39;, { action: &#39;background&#39; })
83-
},
84-
}),</code></pre></div><h3 id="recaptchaservice">RecaptchaService</h3>
89+
onloadFunc: onLoad
90+
}), // loads script and allows to use `RecaptchaService`
91+
// ...
92+
],
93+
providers: [],
94+
bootstrap: [AppComponent]
95+
})</code></pre></div><h3 id="recaptchaservice">RecaptchaService</h3>
8596
<p>Inject <code>RecaptchaService</code> and use provided <code>recaptcha$</code> observable or <code>recaptcha</code> object.
8697
If you use <code>recaptcha</code> object be sure to check that reCAPTCHA library is loaded.</p>
8798
<div><pre class="line-numbers"><code class="language-ts"> constructor(private readonly recaptchaService: RecaptchaService) { }

docs/js/menu-wc.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ customElements.define('compodoc-menu', class extends HTMLElement {
6969
<a href="modules/AppModule.html" data-type="entity-link">AppModule</a>
7070
<li class="chapter inner">
7171
<div class="simple menu-toggler" data-toggle="collapse"
72-
${ isNormalMode ? 'data-target="#components-links-module-AppModule-bd690e63bfdbe86943dc5ec39bbe278d"' : 'data-target="#xs-components-links-module-AppModule-bd690e63bfdbe86943dc5ec39bbe278d"' }>
72+
${ isNormalMode ? 'data-target="#components-links-module-AppModule-b09e201eaa4c5711f4cbd3fb68359f3c"' : 'data-target="#xs-components-links-module-AppModule-b09e201eaa4c5711f4cbd3fb68359f3c"' }>
7373
<span class="icon ion-md-cog"></span>
7474
<span>Components</span>
7575
<span class="icon ion-ios-arrow-down"></span>
7676
</div>
7777
<ul class="links collapse"
78-
${ isNormalMode ? 'id="components-links-module-AppModule-bd690e63bfdbe86943dc5ec39bbe278d"' : 'id="xs-components-links-module-AppModule-bd690e63bfdbe86943dc5ec39bbe278d"' }>
78+
${ isNormalMode ? 'id="components-links-module-AppModule-b09e201eaa4c5711f4cbd3fb68359f3c"' : 'id="xs-components-links-module-AppModule-b09e201eaa4c5711f4cbd3fb68359f3c"' }>
7979
<li class="link">
8080
<a href="components/AppComponent.html" data-type="entity-link" data-context="sub-entity" data-context-id="modules">AppComponent</a>
8181
</li>
@@ -135,13 +135,13 @@ customElements.define('compodoc-menu', class extends HTMLElement {
135135
<a href="modules/RecaptchaLoaderModule.html" data-type="entity-link">RecaptchaLoaderModule</a>
136136
<li class="chapter inner">
137137
<div class="simple menu-toggler" data-toggle="collapse"
138-
${ isNormalMode ? 'data-target="#injectables-links-module-RecaptchaLoaderModule-df529a3ff4814faa5a0bd6860794ac6c"' : 'data-target="#xs-injectables-links-module-RecaptchaLoaderModule-df529a3ff4814faa5a0bd6860794ac6c"' }>
138+
${ isNormalMode ? 'data-target="#injectables-links-module-RecaptchaLoaderModule-b1f01472bc43b49abc712b8e07b8a848"' : 'data-target="#xs-injectables-links-module-RecaptchaLoaderModule-b1f01472bc43b49abc712b8e07b8a848"' }>
139139
<span class="icon ion-md-arrow-round-down"></span>
140140
<span>Injectables</span>
141141
<span class="icon ion-ios-arrow-down"></span>
142142
</div>
143143
<ul class="links collapse"
144-
${ isNormalMode ? 'id="injectables-links-module-RecaptchaLoaderModule-df529a3ff4814faa5a0bd6860794ac6c"' : 'id="xs-injectables-links-module-RecaptchaLoaderModule-df529a3ff4814faa5a0bd6860794ac6c"' }>
144+
${ isNormalMode ? 'id="injectables-links-module-RecaptchaLoaderModule-b1f01472bc43b49abc712b8e07b8a848"' : 'id="xs-injectables-links-module-RecaptchaLoaderModule-b1f01472bc43b49abc712b8e07b8a848"' }>
145145
<li class="link">
146146
<a href="injectables/RecaptchaService.html" data-type="entity-link" data-context="sub-entity" data-context-id="modules"}>RecaptchaService</a>
147147
</li>

docs/js/search/search_index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/miscellaneous/functions.html

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ <h3 id="index">Index</h3>
6262
<li>
6363
<a href="#getAttributeName" title="projects/spaier-ng-recaptcha/src/lib/recaptcha/recaptcha-parameter-names.ts"><b>getAttributeName</b>&nbsp;&nbsp;&nbsp;(projects/.../recaptcha-parameter-names.ts)</a>
6464
</li>
65+
<li>
66+
<a href="#onLoad" title="projects/sample/src/app/app.module.ts"><b>onLoad</b>&nbsp;&nbsp;&nbsp;(projects/.../app.module.ts)</a>
67+
</li>
6568
</ul>
6669
</td>
6770
</tr>
@@ -125,6 +128,62 @@ <h3></h3> <table class="table table-sm table-bordered">
125128
</tbody>
126129
</table>
127130
</section>
131+
<h3>projects/sample/src/app/app.module.ts</h3>
132+
<section>
133+
<h3></h3> <table class="table table-sm table-bordered">
134+
<tbody>
135+
<tr>
136+
<td class="col-md-4">
137+
<a name="onLoad"></a>
138+
<span class="name">
139+
<b>
140+
onLoad
141+
</b>
142+
<a href="#onLoad"><span class="icon ion-ios-link"></span></a>
143+
</span>
144+
</td>
145+
</tr>
146+
<tr>
147+
<td class="col-md-4">
148+
<code>onLoad(recaptcha: undefined)</code>
149+
</td>
150+
</tr>
151+
152+
153+
154+
155+
<tr>
156+
<td class="col-md-4">
157+
158+
<div class="io-description">
159+
<b>Parameters :</b>
160+
<table class="params">
161+
<thead>
162+
<tr>
163+
<td>Name</td>
164+
<td>Optional</td>
165+
</tr>
166+
</thead>
167+
<tbody>
168+
<tr>
169+
<td>recaptcha</td>
170+
171+
<td>
172+
No
173+
</td>
174+
175+
176+
</tr>
177+
</tbody>
178+
</table>
179+
</div>
180+
<div>
181+
</div>
182+
</td>
183+
</tr>
184+
</tbody>
185+
</table>
186+
</section>
128187

129188

130189

docs/miscellaneous/variables.html

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ <h3 id="index">Index</h3>
8181
<a href="#context" title="projects/sample/src/test.ts"><b>context</b>&nbsp;&nbsp;&nbsp;(projects/.../test.ts)</a>
8282
</li>
8383
<li>
84-
<a href="#DIRECTIVES" title="projects/spaier-ng-recaptcha/src/lib/recaptcha/directive/recaptcha-forms.module.ts"><b>DIRECTIVES</b>&nbsp;&nbsp;&nbsp;(projects/.../recaptcha-forms.module.ts)</a>
84+
<a href="#DIRECTIVES" title="projects/spaier-ng-recaptcha/src/lib/recaptcha/directive/recaptcha-directive.module.ts"><b>DIRECTIVES</b>&nbsp;&nbsp;&nbsp;(projects/.../recaptcha-directive.module.ts)</a>
8585
</li>
8686
<li>
87-
<a href="#DIRECTIVES" title="projects/spaier-ng-recaptcha/src/lib/recaptcha/directive/recaptcha-directive.module.ts"><b>DIRECTIVES</b>&nbsp;&nbsp;&nbsp;(projects/.../recaptcha-directive.module.ts)</a>
87+
<a href="#DIRECTIVES" title="projects/spaier-ng-recaptcha/src/lib/recaptcha/directive/recaptcha-forms.module.ts"><b>DIRECTIVES</b>&nbsp;&nbsp;&nbsp;(projects/.../recaptcha-forms.module.ts)</a>
8888
</li>
8989
<li>
9090
<a href="#environment" title="projects/sample/src/environments/environment.prod.ts"><b>environment</b>&nbsp;&nbsp;&nbsp;(projects/.../environment.prod.ts)</a>
@@ -176,9 +176,6 @@ <h3 id="index">Index</h3>
176176
<li>
177177
<a href="#typeName" title="projects/spaier-ng-recaptcha/src/lib/recaptcha/recaptcha-parameter-names.ts"><b>typeName</b>&nbsp;&nbsp;&nbsp;(projects/.../recaptcha-parameter-names.ts)</a>
178178
</li>
179-
<li>
180-
<a href="#useV3" title="projects/sample/src/app/app.module.ts"><b>useV3</b>&nbsp;&nbsp;&nbsp;(projects/.../app.module.ts)</a>
181-
</li>
182179
<li>
183180
<a href="#v2CheckboxSitekey" title="projects/sample/src/app/app.module.ts"><b>v2CheckboxSitekey</b>&nbsp;&nbsp;&nbsp;(projects/.../app.module.ts)</a>
184181
</li>
@@ -930,7 +927,7 @@ <h3></h3> <table class="table table-sm table-bordered">
930927
</tbody>
931928
</table>
932929
</section>
933-
<h3>projects/spaier-ng-recaptcha/src/lib/recaptcha/directive/recaptcha-forms.module.ts</h3>
930+
<h3>projects/spaier-ng-recaptcha/src/lib/recaptcha/directive/recaptcha-directive.module.ts</h3>
934931
<section>
935932
<h3></h3> <table class="table table-sm table-bordered">
936933
<tbody>
@@ -960,7 +957,7 @@ <h3></h3> <table class="table table-sm table-bordered">
960957
<tr>
961958
<td class="col-md-4">
962959
<i>Default value : </i><code>[
963-
RecaptchaValueAccessorDirective
960+
RecaptchaDirective
964961
]</code>
965962
</td>
966963
</tr>
@@ -969,7 +966,7 @@ <h3></h3> <table class="table table-sm table-bordered">
969966
</tbody>
970967
</table>
971968
</section>
972-
<h3>projects/spaier-ng-recaptcha/src/lib/recaptcha/directive/recaptcha-directive.module.ts</h3>
969+
<h3>projects/spaier-ng-recaptcha/src/lib/recaptcha/directive/recaptcha-forms.module.ts</h3>
973970
<section>
974971
<h3></h3> <table class="table table-sm table-bordered">
975972
<tbody>
@@ -999,7 +996,7 @@ <h3></h3> <table class="table table-sm table-bordered">
999996
<tr>
1000997
<td class="col-md-4">
1001998
<i>Default value : </i><code>[
1002-
RecaptchaDirective
999+
RecaptchaValueAccessorDirective
10031000
]</code>
10041001
</td>
10051002
</tr>
@@ -1602,34 +1599,6 @@ <h3></h3> <table class="table table-sm table-bordered">
16021599
<h3>projects/sample/src/app/app.module.ts</h3>
16031600
<section>
16041601
<h3></h3> <table class="table table-sm table-bordered">
1605-
<tbody>
1606-
<tr>
1607-
<td class="col-md-4">
1608-
<a name="useV3"></a>
1609-
<span class="name">
1610-
<b>
1611-
useV3
1612-
</b>
1613-
<a href="#useV3"><span class="icon ion-ios-link"></span></a>
1614-
</span>
1615-
</td>
1616-
</tr>
1617-
<tr>
1618-
<td class="col-md-4">
1619-
<code>useV3: <code></code>
1620-
</code>
1621-
</td>
1622-
</tr>
1623-
<tr>
1624-
<td class="col-md-4">
1625-
<i>Default value : </i><code>false</code>
1626-
</td>
1627-
</tr>
1628-
1629-
1630-
</tbody>
1631-
</table>
1632-
<table class="table table-sm table-bordered">
16331602
<tbody>
16341603
<tr>
16351604
<td class="col-md-4">

docs/modules/AppModule.html

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ <h3>Bootstrap<a href="https://angular.io/api/core/NgModule#bootstrap" target="_b
306306
RecaptchaDirectiveModule,
307307
RecaptchaFormsModule,
308308
RecaptchaLoaderModule,
309-
RecaptchaRender
310309
} from &#x27;spaier-ng-recaptcha&#x27;
311310

312311
import { MaterialModule } from &#x27;./material/material.module&#x27;
@@ -321,7 +320,11 @@ <h3>Bootstrap<a href="https://angular.io/api/core/NgModule#bootstrap" target="_b
321320
const v2InvisibleSitekey &#x3D; &#x27;6LcqUE4UAAAAAKZ5w4ejDKGo8GxOLkPMy6RhaErW&#x27;
322321
const v3Sitekey &#x3D; &#x27;6Lcj7WcUAAAAAD-LipyB7wyI7mv5ONLDS0wRPXVj&#x27;
323322

324-
const useV3 &#x3D; false
323+
export async function onLoad(recaptcha: Recaptcha) {
324+
// Sitekey Execution
325+
const result &#x3D; await recaptcha.execute(v3Sitekey, { action: &#x27;background&#x27; })
326+
console.log(result)
327+
}
325328

326329
@NgModule({
327330
declarations: [
@@ -339,15 +342,9 @@ <h3>Bootstrap<a href="https://angular.io/api/core/NgModule#bootstrap" target="_b
339342
MaterialModule,
340343
RecaptchaLoaderModule.withParameters({
341344
language: &#x27;en&#x27;,
342-
render: useV3 ? &#x27;6Lcj7WcUAAAAAD-LipyB7wyI7mv5ONLDS0wRPXVj&#x27; : RecaptchaRender.Explicit,
343-
onloadFunc: async (recaptcha: Recaptcha) &#x3D;&gt; {
344-
// Sitekey Execution
345-
if (useV3) {
346-
const result &#x3D; await recaptcha.execute(v3Sitekey, { action: &#x27;background&#x27; })
347-
console.log(result)
348-
}
349-
},
350-
}), // load script and allows to use &#x60;RecaptchaService&#x60;
345+
render: &#x27;6Lcj7WcUAAAAAD-LipyB7wyI7mv5ONLDS0wRPXVj&#x27;, // or RecaptchaRender.Explicit,
346+
onloadFunc: onLoad
347+
}), // loads script and allows to use &#x60;RecaptchaService&#x60;
351348
RecaptchaDirectiveModule, // allows to use RecaptchaDirective
352349
RecaptchaFormsModule, // integrates RecaptchaDirective with @angular/forms
353350
AppRoutingModule

0 commit comments

Comments
 (0)